:root {
  color-scheme: dark;
  --bg: #0e161e;
  --bg-deep: #0a1118;
  --surface: #14212c;
  --surface-soft: #192a36;
  --surface-hover: #1e3341;
  --line: rgba(210, 232, 243, .12);
  --text: #eef6fa;
  --muted: #a6b7c2;
  --faint: #708692;
  --accent: #f05a45;
  --accent-strong: #ff765f;
  --accent-soft: rgba(240, 90, 69, .15);
  --blue: #55badc;
  --green: #6dd19b;
  --warning: #f2bc59;
  --danger: #ff7d73;
  --shadow: 0 16px 40px rgba(0, 0, 0, .22);
  --radius: 16px;
  --radius-sm: 10px;
  font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef3f5;
  --bg-deep: #e6eef1;
  --surface: #fff;
  --surface-soft: #f5f8f9;
  --surface-hover: #e9f0f3;
  --line: rgba(21, 48, 62, .13);
  --text: #12232e;
  --muted: #506775;
  --faint: #788d98;
  --accent: #d84b39;
  --accent-strong: #bd3828;
  --accent-soft: rgba(216, 75, 57, .11);
  --blue: #197da1;
  --green: #137849;
  --warning: #976510;
  --danger: #bd3029;
  --shadow: 0 16px 40px rgba(24, 48, 60, .12);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; background: radial-gradient(1100px 420px at 70% -150px, rgba(82, 175, 211, .14), transparent 65%), var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
.skip-link { position: fixed; top: -4rem; left: 1rem; z-index: 50; padding: .7rem 1rem; background: var(--accent); color: #fff; border-radius: 0 0 .5rem .5rem; }
.skip-link:focus { top: 0; }

.shell { min-height: 100vh; padding-bottom: 2rem; }
.topbar { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(16rem, 34rem) minmax(13rem, 1fr); align-items: center; gap: 1rem; min-height: 72px; padding: 0 max(1.25rem, calc((100vw - 1380px) / 2)); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg-deep) 90%, transparent); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: .7rem; width: max-content; text-decoration: none; font-weight: 800; letter-spacing: -.03em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid var(--accent); border-radius: 11px; background: var(--accent-soft); color: var(--accent-strong); font-size: .74rem; letter-spacing: -.08em; }
.brand-name { font-size: 1.15rem; }.brand-name span { color: var(--accent-strong); }.brand-forum { padding-left: .65rem; border-left: 1px solid var(--line); color: var(--muted); font-weight: 650; }
.search-box { display: flex; align-items: center; gap: .5rem; padding: .42rem .52rem .42rem .85rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); }
.search-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(85, 186, 220, .16); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); }
.search-box button { border: 0; border-radius: 8px; padding: .38rem .62rem; background: var(--surface-soft); color: var(--text); }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: .45rem; }.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); text-decoration: none; }.icon-btn:hover, .icon-btn:focus-visible { border-color: var(--line); background: var(--surface); color: var(--text); }.icon-btn .counter { position: absolute; margin: -25px 0 0 25px; min-width: 17px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: #fff; font-size: .66rem; line-height: 17px; text-align: center; }
.user-chip { display: inline-flex; align-items: center; gap: .55rem; max-width: 180px; padding: .34rem .58rem .34rem .36rem; border: 1px solid var(--line); border-radius: 99px; color: var(--text); text-decoration: none; }.user-chip:hover { background: var(--surface); }.user-chip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.avatar { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; overflow: hidden; border: 1px solid var(--line); border-radius: 50%; background: linear-gradient(145deg, var(--surface-hover), var(--accent-soft)); color: var(--text); font-size: .82rem; font-weight: 750; }.avatar.small { width: 30px; height: 30px; font-size: .68rem; }.avatar.large { width: 68px; height: 68px; font-size: 1.35rem; }.avatar img { width: 100%; height: 100%; object-fit: cover; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; gap: .4rem; padding: .55rem .9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font-weight: 700; text-decoration: none; }.btn:hover, .btn:focus-visible { background: var(--surface-hover); }.btn.primary { border-color: var(--accent); background: var(--accent); color: #fff; }.btn.primary:hover { background: var(--accent-strong); }.btn.ghost { background: transparent; }.btn.danger { color: var(--danger); }.btn.compact { min-height: 34px; padding: .35rem .66rem; font-size: .86rem; }
.main { width: min(1380px, calc(100% - 2.5rem)); margin: 0 auto; padding: 2.25rem 0 4rem; }.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin: 0 0 1.4rem; }.eyebrow { margin: 0 0 .28rem; color: var(--accent-strong); font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }.page-head h1, .hero h1 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.65rem); line-height: 1.12; letter-spacing: -.045em; }.page-head p, .hero p { max-width: 58rem; margin: .5rem 0 0; color: var(--muted); }
.hero { position: relative; overflow: hidden; margin-bottom: 1.8rem; padding: clamp(1.55rem, 4vw, 3.4rem); border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(125deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 74%, #255468) 100%); box-shadow: var(--shadow); }.hero::after { content: ""; position: absolute; right: -3.5rem; bottom: -4.3rem; width: 260px; height: 260px; border: 22px solid var(--accent-soft); border-radius: 50%; }.hero-content { position: relative; z-index: 1; }.hero-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.4rem; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 1.35rem; }.aside-card, .card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }.aside-card { padding: 1rem; }.aside-card h2 { margin: 0 0 .75rem; font-size: .94rem; }.aside-link { display: flex; align-items: center; gap: .62rem; padding: .55rem; border-radius: 9px; color: var(--muted); text-decoration: none; }.aside-link:hover { background: var(--surface-soft); color: var(--text); }.aside-link b { margin-left: auto; color: var(--faint); font-size: .75rem; }
.category-stack { display: grid; gap: 1rem; }.category { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }.category-header { display: flex; gap: .7rem; align-items: start; padding: 1.05rem 1.2rem; border-bottom: 1px solid var(--line); }.category-icon { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); font-size: 1.12rem; }.category-header h2 { margin: 0; font-size: 1.05rem; }.category-header p { margin: .18rem 0 0; color: var(--muted); font-size: .88rem; }.forum-row { display: grid; grid-template-columns: minmax(16rem, 1.25fr) 150px minmax(15rem, 1fr); align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); text-decoration: none; }.forum-row:last-child { border-bottom: 0; }.forum-row:hover { background: var(--surface-soft); }.forum-title { display: flex; gap: .65rem; align-items: flex-start; }.forum-title strong { display: block; }.forum-title span { display: block; margin-top: .13rem; color: var(--muted); font-size: .84rem; }.forum-stats { color: var(--muted); font-size: .79rem; }.last-post { min-width: 0; color: var(--muted); font-size: .8rem; }.last-post strong { display: block; overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }.last-post span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }.thread-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 160px; gap: 1rem; align-items: center; padding: 1rem 1.15rem; border-bottom: 1px solid var(--line); text-decoration: none; }.thread-row:last-child { border-bottom: 0; }.thread-row:hover { background: var(--surface-soft); }.thread-main { min-width: 0; }.thread-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.thread-meta { display: flex; flex-wrap: wrap; gap: .35rem .65rem; margin-top: .26rem; color: var(--muted); font-size: .8rem; }.thread-num { color: var(--muted); font-size: .82rem; text-align: center; }.thread-last { min-width: 0; color: var(--muted); font-size: .78rem; }.thread-last b { display: block; overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; width: max-content; padding: .18rem .42rem; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: .69rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }.badge.pinned { border-color: rgba(240, 90, 69, .45); color: var(--accent-strong); }.badge.solved { border-color: rgba(109, 209, 155, .4); color: var(--green); }.badge.closed, .badge.archived { color: var(--faint); }
.thread-header { padding: 1.5rem; }.breadcrumb { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .8rem; color: var(--muted); font-size: .82rem; }.breadcrumb a { color: var(--blue); text-decoration: none; }.thread-head-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.posts { display: grid; gap: .8rem; }.post { display: grid; grid-template-columns: 168px minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }.post-side { padding: 1.15rem; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface-soft) 70%, transparent); }.post-user { display: grid; justify-items: start; gap: .55rem; text-decoration: none; }.post-user strong { font-size: .9rem; }.post-user span { color: var(--muted); font-size: .78rem; }.role { color: var(--accent-strong) !important; font-size: .68rem !important; font-weight: 800; text-transform: uppercase; }.post-content { min-width: 0; }.post-top { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: .82rem 1rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .78rem; }.post-top a { color: inherit; }.post-body { padding: 1.1rem 1.2rem 1.35rem; overflow-wrap: anywhere; }.post-body p { margin: 0 0 .9rem; }.post-body p:last-child { margin-bottom: 0; }.post-body h2,.post-body h3 { margin: 1.1rem 0 .5rem; font-size: 1.1rem; }.post-body ul,.post-body ol { padding-left: 1.25rem; }.post-body blockquote { margin: 1rem 0; padding: .7rem .9rem; border-left: 3px solid var(--blue); border-radius: 0 8px 8px 0; background: var(--surface-soft); color: var(--muted); }.post-body pre { overflow: auto; padding: .9rem; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-deep); }.post-body code { padding: .1rem .32rem; border-radius: 4px; background: var(--surface-soft); font: .88em ui-monospace, SFMono-Regular, Menlo, monospace; }.post-body pre code { padding: 0; background: none; }.post-body img { display: block; max-width: min(100%, 680px); margin: .7rem 0; border-radius: 9px; }.post-body a { color: var(--blue); }.post-actions { display: flex; gap: .45rem; padding: 0 1rem 1rem; }.post-actions button { min-height: 33px; padding: .3rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); }.post-actions button:hover { color: var(--text); background: var(--surface-soft); }.post-actions .liked { color: var(--accent-strong); border-color: rgba(240,90,69,.4); }
.editor-card { margin-top: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }.editor-card h2 { margin: 0 0 .8rem; font-size: 1rem; }.editor-toolbar { display: flex; flex-wrap: wrap; gap: .35rem; padding: .45rem; border: 1px solid var(--line); border-bottom: 0; border-radius: 9px 9px 0 0; background: var(--surface-soft); }.editor-toolbar button { min-width: 32px; min-height: 31px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-weight: 800; }.editor-toolbar button:hover { background: var(--surface-hover); color: var(--text); }.editor-card textarea, .field textarea { display: block; width: 100%; min-height: 180px; resize: vertical; padding: .85rem; border: 1px solid var(--line); border-radius: 0 0 9px 9px; outline: 0; background: var(--bg-deep); color: var(--text); line-height: 1.5; }.editor-card textarea:focus,.field textarea:focus,.field input:focus,.field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(85,186,220,.15); }.editor-foot { display: flex; justify-content: space-between; gap: .8rem; align-items: center; margin-top: .8rem; color: var(--muted); font-size: .78rem; }
.compose { max-width: 850px; padding: 1.25rem; }.field { display: grid; gap: .38rem; margin-bottom: .85rem; }.field label { font-size: .84rem; font-weight: 700; }.field input,.field select { width: 100%; min-height: 43px; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: var(--surface-soft); color: var(--text); }.field textarea { min-height: 100px; border-radius: 9px; }.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem; margin-top: 1rem; }
.empty { padding: 2.1rem 1.5rem; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }.empty strong { display: block; margin-bottom: .4rem; color: var(--text); }.error-page { max-width: 680px; margin: 7vh auto; padding: 2.2rem; text-align: center; }.error-code { margin: 0; color: var(--accent-strong); font-size: clamp(4rem, 16vw, 8rem); font-weight: 900; line-height: .95; letter-spacing: -.09em; }
.profile { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.2rem; }.profile-card { padding: 1.2rem; text-align: center; }.profile-card .avatar { margin: 0 auto .75rem; }.profile-card h1 { margin: 0; font-size: 1.4rem; }.profile-card .handle { color: var(--muted); }.profile-bio { margin: 1rem 0; color: var(--muted); text-align: left; }.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }.stat { padding: .7rem .3rem; border-radius: 8px; background: var(--surface-soft); }.stat b { display: block; font-size: 1.12rem; }.stat span { color: var(--muted); font-size: .7rem; }.section-card { padding: 1.1rem; }.section-card h2 { margin: 0 0 .8rem; font-size: 1rem; }.simple-list { display: grid; gap: .4rem; }.simple-item { display: block; padding: .68rem; border-radius: 8px; background: var(--surface-soft); text-decoration: none; }.simple-item:hover { background: var(--surface-hover); }.simple-item strong { display: block; }.simple-item span { color: var(--muted); font-size: .79rem; }
.notification { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .9rem; border-bottom: 1px solid var(--line); }.notification:last-child { border: 0; }.notification.unread { background: var(--accent-soft); }.notice-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }.notice-dot.read { visibility: hidden; }.notification p { margin: 0; }.notification span { color: var(--muted); font-size: .76rem; }.notification a { color: var(--blue); }.conversation { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .65rem; align-items: center; padding: .78rem; border-bottom: 1px solid var(--line); text-decoration: none; }.conversation:hover { background: var(--surface-soft); }.conversation strong,.conversation p { display: block; overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; }.conversation p,.conversation time { color: var(--muted); font-size: .78rem; }.unread-pill { display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 99px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 800; }
.message-list { display: grid; gap: .65rem; min-height: 280px; padding: 1rem; }.message { max-width: min(82%, 620px); padding: .65rem .75rem; border-radius: 12px 12px 12px 3px; background: var(--surface-soft); }.message.mine { justify-self: end; border-radius: 12px 12px 3px 12px; background: var(--accent-soft); }.message p { margin: 0; white-space: pre-wrap; }.message time { display: block; margin-top: .25rem; color: var(--muted); font-size: .68rem; }.message-compose { display: flex; gap: .55rem; padding: .8rem; border-top: 1px solid var(--line); }.message-compose textarea { flex: 1; min-height: 42px; max-height: 130px; padding: .55rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); color: var(--text); }
.moderation-grid { display: grid; gap: .75rem; }.report { padding: 1rem; }.report-top { display: flex; justify-content: space-between; gap: .7rem; }.report p { margin: .55rem 0; }.report-content { padding: .7rem; border-left: 3px solid var(--warning); border-radius: 0 7px 7px 0; background: var(--surface-soft); color: var(--muted); }.report-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .8rem; }
.pager { display: flex; justify-content: center; gap: .6rem; margin-top: 1rem; }.toast-region { position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 30; display: grid; gap: .5rem; width: min(380px, calc(100vw - 2rem)); }.toast { padding: .8rem .95rem; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); }.toast.error { border-left-color: var(--danger); }
.mobile-nav { display: none; }
.aside-spaced { margin-top: 1rem; }.stack-gap { margin-bottom: 1rem; }.top-spaced { margin-top: 1rem; }.head-inline { display: flex; justify-content: space-between; align-items: center; }.head-inline h2 { margin: 0; }.center-actions { justify-content: center; }
.modal-backdrop { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; padding: 1rem; background: rgba(3, 9, 13, .7); backdrop-filter: blur(4px); }.modal-backdrop > .compose { width: min(100%, 680px); max-height: min(90dvh, 780px); overflow: auto; box-shadow: var(--shadow); }

@media (max-width: 900px) { .topbar { grid-template-columns: 1fr auto; }.topbar .search-box { display: none; }.layout { grid-template-columns: 1fr; }.layout aside { display: none; }.post { grid-template-columns: 116px minmax(0,1fr); }.post-side { padding: .85rem; }.forum-row { grid-template-columns: minmax(0,1fr) 145px; }.last-post { display: none; }.profile { grid-template-columns: 1fr; }.profile-card { display: grid; grid-template-columns: auto 1fr; gap: 0 1rem; text-align: left; }.profile-card .avatar { grid-row: span 3; margin: 0; }.profile-card .profile-bio,.profile-card .stat-grid { grid-column: 1 / -1; }.profile-card .profile-bio { margin-bottom: .65rem; } }
@media (max-width: 700px), (max-height: 620px) { .shell { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }.topbar { min-height: 62px; padding: 0 1rem; }.brand-forum { display: none; }.brand-name { font-size: 1rem; }.top-actions .icon-btn:first-child,.user-chip strong { display: none; }.user-chip { padding: .2rem; border: 0; }.main { width: min(100% - 1.15rem, 720px); padding: 1rem 0 2rem; }.page-head { align-items: start; margin-bottom: 1rem; }.page-head h1 { font-size: 1.55rem; }.hero { margin: 0 -.02rem 1rem; padding: 1.35rem; border-radius: 16px; }.hero h1 { font-size: 1.75rem; }.category-header { padding: .9rem; }.forum-row { grid-template-columns: minmax(0,1fr) auto; gap: .5rem; padding: .82rem .9rem; }.forum-stats { align-self: end; text-align: right; }.thread-row { grid-template-columns: minmax(0,1fr) auto; padding: .86rem .9rem; }.thread-last { display: none; }.thread-num { font-size: .73rem; }.thread-header { padding: 1rem; }.post { grid-template-columns: 1fr; }.post-side { display: flex; padding: .65rem .85rem; border-right: 0; border-bottom: 1px solid var(--line); background: transparent; }.post-user { grid-template-columns: auto auto auto; align-items: center; gap: .5rem; }.post-user .avatar { grid-row: span 2; }.post-user .role { grid-column: 2 / -1; }.post-body { padding: .95rem; }.post-top { padding: .65rem .85rem; }.post-actions { padding: 0 .85rem .85rem; }.editor-card { padding: .8rem; }.editor-foot { align-items: start; flex-direction: column; }.mobile-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 15; display: grid; grid-template-columns: repeat(5, 1fr); padding: .4rem max(.45rem, env(safe-area-inset-right)) calc(.4rem + env(safe-area-inset-bottom)) max(.45rem, env(safe-area-inset-left)); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg-deep) 94%, transparent); backdrop-filter: blur(16px); }.mobile-nav a { display: grid; place-items: center; min-height: 46px; color: var(--muted); font-size: .66rem; text-align: center; text-decoration: none; }.mobile-nav a span { font-size: 1.15rem; line-height: 1.1; }.mobile-nav a.active { color: var(--accent-strong); }.mobile-nav a.new { margin: -1.05rem .15rem .15rem; border: 1px solid var(--accent); border-radius: 13px; background: var(--accent); color: #fff; box-shadow: 0 5px 15px rgba(240,90,69,.3); }.compose { padding: 1rem; }.form-actions .btn { flex: 1; }.message { max-width: 92%; }.error-page { margin-top: 3vh; padding: 1.2rem; } }
@media (max-width: 430px) { .top-actions { gap: .15rem; }.brand { gap: .45rem; }.brand-mark { width: 31px; height: 31px; }.top-actions .btn { min-height: 35px; padding: .36rem .5rem; font-size: .78rem; }.stat-grid { gap: .35rem; }.stat b { font-size: 1rem; } }
