:root{
  --bg:#f3f3f3;
  --card:#fff;
  --text:#1f1f1f;
  --muted:#6b6b6b;
  --line:#e5e5e5;
  --shadow:0 10px 22px rgba(0,0,0,.10);
  --shadow2:0 8px 16px rgba(0,0,0,.08);
  --radius:10px;
  --wrap:1100px;
  --accent:#2cc36b;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:Montserrat,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
}

a{color:inherit;text-decoration:none}
.wrap{max-width:var(--wrap);margin:0 auto;padding:18px 16px}

.hero{
  position:relative;
  height:160px;
  background:
    linear-gradient(rgba(0,0,0,.45),rgba(0,0,0,.45)),
    url('header.jpg');
  background-size:cover;
  background-position:center;
}

.hero-top{
  max-width:var(--wrap);
  margin:0 auto;
  padding:14px 16px;
  display:flex;
  align-items:center;
  gap:14px;
}

.brand{
  display:flex;
  flex-direction:column;
  line-height:1;
  user-select:none;
}
.brand-mark{
  font-weight:800;
  letter-spacing:.8px;
  font-size:28px;
  color:#fff;
}
.brand-sub{
  font-size:12px;
  color:rgba(255,255,255,.7);
  font-weight:600;
  letter-spacing:2px;
  margin-top:2px;
}

.nav-toggle{
  margin-left:auto;
  border:0;
  width:42px;
  height:42px;
  border-radius:12px;
  background:rgba(255,255,255,.10);
  color:#fff;
  display:none;
}

.nav{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:14px;
}
.nav-link{
  color:#fff;
  font-weight:700;
  letter-spacing:.7px;
  font-size:12px;
  padding:10px 10px;
  border-radius:12px;
}
.nav-link:hover{background:rgba(255,255,255,.10)}
.nav-cta{
  background:rgba(0,0,0,.28);
}
.nav-cta:hover{background:rgba(0,0,0,.40)}

.hero-badge{
  max-width:var(--wrap);
  margin:0 auto;
  padding:0 16px;
  position:absolute;
  left:0;right:0;bottom:-18px;
  display:flex;
  justify-content:flex-start;
}
.pill{
  display:inline-flex;
  align-items:center;
  gap:10px;
  background:rgba(0,0,0,.60);
  color:#fff;
  padding:12px 14px;
  border-radius:999px;
  font-weight:700;
  font-size:12px;
  letter-spacing:.6px;
  box-shadow:var(--shadow2);
  backdrop-filter: blur(6px);
}

.flash{display:grid;gap:10px;margin-top:14px}
.flash-item{
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow2);
  padding:12px 14px;
  border-left:6px solid var(--line);
}
.flash-success{border-left-color:#2cc36b}
.flash-error{border-left-color:#e34b4b}

.section{margin-top:22px}
.section-title{
  font-size:14px;
  letter-spacing:1px;
  text-transform:uppercase;
  margin:22px 0 12px;
  font-weight:800;
  position:relative;
}
.section-title:after{
  content:"";
  display:block;
  height:3px;
  width:42px;
  background:#dcdcdc;
  margin-top:6px;
  border-radius:99px;
}

.tiles{
  display:grid;
  gap:16px;
  grid-template-columns: repeat(3, minmax(0,1fr));
}

.tile{
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:26px 16px;
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  border:1px solid rgba(0,0,0,.03);
  transition:transform .12s ease, box-shadow .12s ease;
}
.tile:hover{transform:translateY(-2px);box-shadow:0 14px 26px rgba(0,0,0,.12)}
.tile-icon{
  width:56px;height:56px;
  display:grid;place-items:center;
  color:#7a7a7a;
  font-size:28px;
  margin-bottom:10px;
}
.tile-title{
  font-weight:800;
  font-size:14px;
}
.tile-sub{
  margin-top:6px;
  color:var(--muted);
  font-size:11px;
  line-height:1.25;
}

.breadcrumbs{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  color:#555;
  font-size:12px;
  margin-top:12px;
}
.breadcrumbs a{color:#2a2a2a;font-weight:700}

.bar{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  margin:12px 0 14px;
}
.page-title{
  margin:0;
  font-size:22px;
  font-weight:900;
  letter-spacing:.2px;
}
.page-sub{
  margin-top:6px;
  color:var(--muted);
  font-size:12px;
}
.dot{margin:0 6px}

.btn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  border:0;
  background:#fff;
  border-radius:14px;
  padding:12px 14px;
  box-shadow:var(--shadow2);
  font-weight:800;
  font-size:12px;
  letter-spacing:.3px;
  cursor:pointer;
}
.btn:hover{transform:translateY(-1px)}
.btn-ghost{
  background:transparent;
  box-shadow:none;
  border:1px solid var(--line);
}

.panel{
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow2);
  overflow:hidden;
  border:1px solid rgba(0,0,0,.03);
}

.topic-head{
  display:grid;
  grid-template-columns: 1fr 120px 120px 180px;
  gap:12px;
  padding:14px 16px;
  font-weight:900;
  font-size:12px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(#fff,#fbfbfb);
}
.topic-row{
  display:grid;
  grid-template-columns: 1fr 120px 120px 180px;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid var(--line);
}
.topic-row:last-child{border-bottom:0}
.topic-title{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  font-weight:900;
}
.topic-title a{color:#1f1f1f}
.topic-meta{
  margin-top:6px;
  color:var(--muted);
  font-size:12px;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.th-center{text-align:center;color:#333;font-weight:800}
.th-right{text-align:right;color:#333;font-weight:800}

.tag{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:900;
  background:#f4f4f4;
  color:#333;
}
.tag-pin{background:#eef6ff}
.tag-lock{background:#fff1f1}

.empty{
  padding:18px 16px;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:10px;
  justify-content:center;
}

.pager{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin:14px 0 4px;
}
.pager-btn{
  width:42px;height:42px;
  border-radius:14px;
  display:grid;place-items:center;
  background:#fff;
  box-shadow:var(--shadow2);
}
.pager-info{font-weight:900;color:#333}

.posts{display:grid;gap:14px}
.post{
  display:grid;
  grid-template-columns: 240px 1fr;
  border-radius:var(--radius);
  overflow:hidden;
  box-shadow:var(--shadow2);
  border:1px solid rgba(0,0,0,.03);
  background:#fff;
}
.post-side{
  padding:16px;
  background:linear-gradient(#fff,#fbfbfb);
  border-right:1px solid var(--line);
}
.post-user-name{
  font-weight:900;
  font-size:14px;
  display:inline-flex;
  align-items:center;
  gap:10px;
}
.post-user-meta{margin-top:6px;color:var(--muted);font-size:12px}
.post-body{padding:16px}
.post-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
.post-date{color:var(--muted);font-size:12px;font-weight:700}
.post-content{font-size:14px;line-height:1.65}

.form{padding:16px}
.form-grid{display:grid;gap:12px}
.field{display:grid;gap:8px}
.field-label{font-weight:900;font-size:12px;color:#333}
.input,.textarea{
  width:100%;
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px 12px;
  font-family:inherit;
  font-size:14px;
  outline:none;
}
.input:focus,.textarea:focus{border-color:#cfcfcf;box-shadow:0 0 0 4px rgba(0,0,0,.04)}
.form-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}

.auth{display:flex;justify-content:center;margin-top:18px}
.auth-card{max-width:520px;width:100%}
.auth-foot{margin-top:12px;color:var(--muted);font-size:12px;text-align:center}
.auth-foot a{font-weight:900}

.u-name{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-weight:900;
  color:var(--u-color,#222);
}
.u-name i{opacity:.85}

.profile{padding:18px}
.profile-name{font-size:24px;font-weight:900}
.profile-sub{margin-top:6px;color:var(--muted);font-weight:700}
.profile-grid{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:12px;
}
.profile-card{
  padding:14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:linear-gradient(#fff,#fbfbfb);
}
.pc-title{font-size:11px;color:var(--muted);font-weight:800;text-transform:uppercase;letter-spacing:.8px}
.pc-val{margin-top:6px;font-size:16px;font-weight:900}

.footer{
  margin-top:28px;
  background:#111;
  color:#ddd;
  padding:18px 0;
}
.footer-inner{display:flex;justify-content:space-between;align-items:center;gap:18px}
.footer-title{font-weight:900}
.footer-sub{margin-top:4px;font-size:12px;color:rgba(255,255,255,.65)}
.footer-right{font-size:12px;color:rgba(255,255,255,.75);display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:flex-end}

.theme-toggle{
  display:inline-flex;
  align-items:center;
  gap:10px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.08);
  color:#fff;
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  font-weight:800;
  font-size:12px;
  letter-spacing:.3px;
}
.theme-toggle:hover{background:rgba(255,255,255,.12)}
.theme-toggle i{font-size:14px}

@media (max-width: 980px){
  .tiles{grid-template-columns: repeat(2, minmax(0,1fr))}
  .topic-head,.topic-row{grid-template-columns: 1fr 92px 92px 140px}
  .post{grid-template-columns: 200px 1fr}
  .profile-grid{grid-template-columns: repeat(2, minmax(0,1fr))}
}

@media (max-width: 680px){
  .nav-toggle{display:inline-grid;place-items:center}
  .nav{
    position:absolute;
    top:62px;
    right:16px;
    left:16px;
    display:none;
    flex-direction:column;
    align-items:stretch;
    background:rgba(0,0,0,.72);
    border-radius:16px;
    padding:10px;
    box-shadow:var(--shadow2);
  }
  .nav.open{display:flex}
  .nav-link{padding:12px 12px}
  .hero{height:150px}
  .hero-badge{bottom:-20px}
  .tiles{grid-template-columns: 1fr}
  .bar{flex-direction:column;align-items:flex-start}
  .topic-head{display:none}
  .topic-row{
    grid-template-columns:1fr;
    gap:6px;
  }
  .th-center,.th-right{text-align:left}
  .post{grid-template-columns:1fr}
  .post-side{border-right:0;border-bottom:1px solid var(--line)}
}

:root[data-theme="dark"]{
  --bg:#0f1115;
  --card:#151a24;
  --text:#e8edf5;
  --muted:#9aa3b2;
  --line:#242b3b;
  --shadow:0 10px 22px rgba(0,0,0,.55);
  --shadow2:0 8px 16px rgba(0,0,0,.45);
  --accent:#2cc36b;
}

[data-theme="dark"] .section-title:after{background:var(--line)}
[data-theme="dark"] .tile{border:1px solid rgba(255,255,255,.06)}
[data-theme="dark"] .tile-icon{color:var(--muted)}

[data-theme="dark"] .breadcrumbs{color:var(--muted)}
[data-theme="dark"] .breadcrumbs a{color:var(--text)}

[data-theme="dark"] .btn{background:var(--card);color:var(--text);border:1px solid var(--line)}
[data-theme="dark"] .btn-ghost{background:transparent}

[data-theme="dark"] .panel{border:1px solid rgba(255,255,255,.06)}
[data-theme="dark"] .topic-head{background:linear-gradient(#171c27,#141925)}
[data-theme="dark"] .topic-title a{color:var(--text)}
[data-theme="dark"] .th-center,[data-theme="dark"] .th-right{color:var(--text)}

[data-theme="dark"] .tag{background:#1c2230;color:var(--text)}
[data-theme="dark"] .tag-pin{background:#162437}
[data-theme="dark"] .tag-lock{background:#2b1a1d}

[data-theme="dark"] .pager-btn{background:var(--card);border:1px solid var(--line)}
[data-theme="dark"] .pager-info{color:var(--text)}

[data-theme="dark"] .post{background:var(--card);border:1px solid rgba(255,255,255,.06)}
[data-theme="dark"] .post-side{background:linear-gradient(#171c27,#141925)}

[data-theme="dark"] .field-label{color:var(--text)}
[data-theme="dark"] .input,[data-theme="dark"] .textarea{background:#0f141d;color:var(--text);border:1px solid var(--line)}
[data-theme="dark"] .input:focus,[data-theme="dark"] .textarea:focus{border-color:#3a4357;box-shadow:0 0 0 4px rgba(255,255,255,.06)}

[data-theme="dark"] .profile-card{background:linear-gradient(#171c27,#141925)}
