/* ============================================================
   涵云社区 · Hanyun Community
   现代蓝白主题 / Design tokens
   ============================================================ */
:root {
    --brand: #029efe;
    --brand-600: #0089e6;
    --brand-700: #006fbd;
    --brand-50: #eef8ff;
    --brand-100: #d9efff;
    --brand-200: #b9e3ff;
    --ink: #0d1b2a;
    --ink-soft: #33475c;
    --muted: #6b7f95;
    --line: #e3edf7;
    --line-strong: #cfe2f2;
    --bg: #f5f9fd;
    --surface: #ffffff;
    --surface-2: #f9fcff;
    --success: #0ea472;
    --success-soft: #e6f9f1;
    --danger: #e5484d;
    --danger-soft: #fff0f1;
    --warning: #d98a00;
    --warning-soft: #fff8e6;
    --info: #0284c7;
    --info-soft: #eaf7ff;
    --radius: 16px;
    --radius-lg: 24px;
    --shadow-xs: 0 1px 2px rgba(13, 60, 100, 0.05);
    --shadow: 0 6px 24px rgba(13, 60, 100, 0.06);
    --shadow-lg: 0 24px 60px rgba(2, 90, 150, 0.14);
    --header-h: 74px;
    --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --mono: "SFMono-Regular", ui-monospace, "Cascadia Code", Consolas, monospace;
}

[data-theme="dark"] {
    --brand: #38b6ff;
    --brand-600: #0ea5ef;
    --brand-700: #7ed0ff;
    --brand-50: #0d2537;
    --brand-100: #12354c;
    --brand-200: #1b4c6c;
    --ink: #e7f2fb;
    --ink-soft: #c3d5e4;
    --muted: #8ba3b8;
    --line: #1d3448;
    --line-strong: #2a4a63;
    --bg: #08131e;
    --surface: #0e1f2e;
    --surface-2: #112536;
    --success-soft: #0d2f27;
    --danger-soft: #341a1f;
    --warning-soft: #332a12;
    --info-soft: #0d2c3d;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand-600); text-decoration: none; transition: color .18s ease, background-color .18s ease, border-color .18s ease; }
a:hover { color: var(--brand); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.3; margin: 0; font-weight: 750; letter-spacing: -0.015em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
code, pre { font-family: var(--mono); }
::selection { background: var(--brand-200); color: var(--ink); }

.container { width: min(1200px, calc(100% - 40px)); margin: 0 auto; }
.page-wrap { padding: 28px 0 64px; min-height: 60vh; }
.page-wide { width: min(1360px, calc(100% - 40px)); }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: 16px; top: -60px; z-index: 1000;
    background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 10px;
    transition: top .2s ease;
}
.skip-link:focus { top: 0; color: #fff; }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.icon { width: 18px; height: 18px; flex: 0 0 auto; display: inline-block; vertical-align: -3px; }
.icon + span, .icon + a { margin-inline-start: 6px; }
.small { font-size: 13px; }
.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.nowrap { white-space: nowrap; }
.dot { color: var(--line-strong); padding: 0 2px; }
.hide-sm { display: inline-flex; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }

/* Buttons */
.btn {
    --btn-bg: var(--surface);
    --btn-color: var(--ink-soft);
    --btn-border: var(--line);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid var(--btn-border);
    background: var(--btn-bg);
    color: var(--btn-color);
    padding: 10px 16px;
    border-radius: 11px;
    font-weight: 650;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .15s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
    line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-xs); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn .icon { width: 17px; height: 17px; }
.btn-primary {
    --btn-bg: linear-gradient(135deg, var(--brand) 0%, #0575e6 100%);
    --btn-color: #fff;
    --btn-border: transparent;
    box-shadow: 0 8px 20px rgba(2, 158, 254, 0.24);
}
.btn-primary:hover { --btn-bg: linear-gradient(135deg, #16a9ff 0%, #0a80f0 100%); color: #fff; box-shadow: 0 12px 26px rgba(2, 158, 254, 0.32); }
.btn-soft { --btn-bg: var(--brand-50); --btn-color: var(--brand-700); --btn-border: var(--brand-100); }
.btn-soft:hover { --btn-bg: var(--brand-100); }
.btn-ghost { --btn-bg: transparent; --btn-color: var(--muted); --btn-border: transparent; }
.btn-ghost:hover { --btn-bg: var(--brand-50); --btn-color: var(--brand-700); }
.btn-light { --btn-bg: rgba(255, 255, 255, 0.9); --btn-color: var(--brand-700); --btn-border: transparent; }
.btn-danger-soft { --btn-bg: var(--danger-soft); --btn-color: var(--danger); --btn-border: transparent; }
.btn-danger-ghost { --btn-bg: transparent; --btn-color: var(--danger); --btn-border: transparent; }
.btn-danger-ghost:hover { --btn-bg: var(--danger-soft); --btn-color: var(--danger); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn.is-active { --btn-bg: var(--brand-100); --btn-color: var(--brand-700); --btn-border: var(--brand-200); }
.btn.is-danger, .is-danger { color: var(--danger); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    width: 40px; height: 40px; border-radius: 11px;
    border: 1px solid transparent; background: transparent; color: var(--muted);
    cursor: pointer; position: relative; transition: .18s ease;
}
.icon-btn:hover { background: var(--brand-50); color: var(--brand-700); }
.lang-code { font-size: 10px; font-weight: 800; letter-spacing: .04em; margin-inline-start: -2px; white-space: nowrap; }
.lang-switch > summary { width: auto; min-width: 40px; padding: 0 9px; }

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 22px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { border-radius: 11px; box-shadow: 0 6px 16px rgba(2, 158, 254, .28); flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name { font-weight: 800; font-size: 18px; color: var(--ink); letter-spacing: -0.02em; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-tagline { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.main-nav { display: flex; align-items: center; gap: 4px; margin-inline-start: 6px; }
.main-nav a {
    display: inline-flex; align-items: center; gap: 7px;
    color: var(--muted); font-size: 14px; font-weight: 600;
    padding: 9px 12px; border-radius: 9px;
}
.main-nav a:hover { background: var(--brand-50); color: var(--brand-700); }
.main-nav a.is-active { color: var(--brand-700); background: var(--brand-50); }
.main-nav .icon { width: 16px; height: 16px; }
.header-tools { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.search-mini {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: 11px; padding: 0 10px; height: 40px; width: 230px;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.search-mini:focus-within { border-color: var(--brand-200); box-shadow: 0 0 0 3px var(--brand-50); }
.search-mini .icon { color: var(--muted); width: 16px; height: 16px; }
.search-mini input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 13px; min-width: 0; }
.user-trigger { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; cursor: pointer; list-style: none; }
.user-trigger::-webkit-details-marker, .dropdown summary::-webkit-details-marker { display: none; }
.user-trigger:hover { background: var(--brand-50); }
.user-name { font-size: 13px; font-weight: 700; color: var(--ink-soft); max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { width: 14px; height: 14px; color: var(--muted); }
.bell-btn .badge-dot {
    position: absolute; top: 4px; inset-inline-end: 2px;
    background: var(--danger); color: #fff; font-size: 9px; font-weight: 800;
    min-width: 18px; height: 18px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    line-height: 1; text-align: center; font-variant-numeric: tabular-nums;
    padding: 0 3px; border: 2px solid var(--surface);
}
.mobile-toggle { display: none; }
.mobile-nav { display: none; border-top: 1px solid var(--line); background: var(--surface); padding: 10px 0 16px; }
.mobile-nav .container { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.mobile-nav a { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-radius: 9px; color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.mobile-nav a:hover { background: var(--brand-50); color: var(--brand-700); }

/* Dropdowns */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown-menu {
    position: absolute; top: calc(100% + 10px); inset-inline-end: 0;
    min-width: 230px; max-width: calc(100vw - 28px); background: var(--surface);
    border: 1px solid var(--line); border-radius: 14px;
    box-shadow: var(--shadow-lg); padding: 7px;
    z-index: 300; display: none;
}
.dropdown[open] > .dropdown-menu { display: block; animation: dropIn .16s ease; }
.dropdown-menu::before {
    content: ""; position: absolute; top: -6px; inset-inline-end: 18px;
    width: 10px; height: 10px; background: var(--surface);
    border-left: 1px solid var(--line); border-top: 1px solid var(--line);
    transform: rotate(45deg);
}
.dropdown-menu--wide { min-width: 260px; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-menu a, .dropdown-link {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 10px 11px; border: 0; background: none; border-radius: 9px;
    color: var(--ink-soft); font-size: 13.5px; font-weight: 600; text-align: start; cursor: pointer;
}
.dropdown-menu a:hover, .dropdown-link:hover { background: var(--brand-50); color: var(--brand-700); }
.dropdown-menu form { margin: 0; }
.dropdown-header { padding: 10px 11px 12px; border-bottom: 1px solid var(--line); margin-bottom: 5px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dropdown-header strong { font-size: 14px; max-width: 100%; overflow-wrap: anywhere; }
.dropdown-header span { max-width: 100%; overflow-wrap: anywhere; }
.dropdown-hint { padding: 8px 11px 4px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 6px; }
.locale-form { padding: 4px; }
.locale-options { display: grid; gap: 2px; max-height: min(340px, 60vh); overflow-y: auto; }
.locale-option { justify-content: space-between; }
.locale-option.is-active { background: var(--brand-50); color: var(--brand-700); }
.locale-option .icon { width: 15px; height: 15px; color: var(--brand); flex: 0 0 auto; }

/* Announcement + alerts */
.announcement-bar { background: linear-gradient(90deg, #029efe, #0a7fe8); color: #fff; font-size: 13.5px; }
.announcement-bar .container { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.announcement-bar .icon { flex: 0 0 auto; }
.announcement-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.announcement-close { background: rgba(255, 255, 255, .16); border: 0; color: #fff; width: 26px; height: 26px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.announcement-close .icon { width: 14px; height: 14px; }

.flash-stack { padding-top: 18px; display: grid; gap: 8px; }
.alert {
    display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
    border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
    color: var(--ink-soft); font-size: 14px; box-shadow: var(--shadow-xs);
}
.alert-icon { display: inline-flex; margin-top: 1px; }
.alert-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.alert-close { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 6px; }
.alert-close:hover { color: var(--ink); background: var(--brand-50); }
.alert-success { border-color: #bcebd8; background: var(--success-soft); color: #0a6a4d; }
.alert-error { border-color: #ffd3d5; background: var(--danger-soft); color: #b02a2f; }
.alert-warning { border-color: #ffe2a8; background: var(--warning-soft); color: #8a5a00; }
.alert-info { border-color: var(--brand-100); background: var(--info-soft); color: #0b5e85; }
[data-theme="dark"] .alert-success { color: #6fe0b8; }
[data-theme="dark"] .alert-error { color: #ffb3b7; }
[data-theme="dark"] .alert-warning { color: #ffd27a; }
[data-theme="dark"] .alert-info { color: #8fd8ff; }
.verify-banner {
    margin-top: 14px; display: flex; align-items: center; gap: 10px;
    background: var(--warning-soft); border: 1px solid #ffe2a8; color: #8a5a00;
    border-radius: 12px; padding: 10px 14px; font-size: 13.5px;
}
.verify-banner span:nth-child(2) { flex: 1; }
[data-theme="dark"] .verify-banner { border-color: #574316; color: #ffd27a; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 30px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; padding: 42px 0 30px; }
.footer-brand p { color: var(--muted); font-size: 13.5px; margin: 14px 0 16px; max-width: 320px; overflow-wrap: anywhere; }
.footer-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.footer-meta span { display: inline-flex; align-items: center; gap: 5px; }
.footer-meta .icon { width: 14px; height: 14px; }
.footer-col h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 12px; font-weight: 800; }
.footer-col a { display: block; color: var(--ink-soft); font-size: 13.5px; padding: 4px 0; }
.footer-col a:hover { color: var(--brand-700); }
.footer-bottom {
    border-top: 1px solid var(--line); padding: 16px 0 22px;
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    font-size: 12px; color: var(--muted);
}
.footer-bottom a { color: var(--muted); }
.footer-bottom a:hover { color: var(--brand-700); }
.powered { margin-inline-start: 12px; }

/* Hero */
.hero {
    position: relative; overflow: hidden;
    border-radius: var(--radius-lg);
    background: linear-gradient(130deg, #ffffff 0%, #f0f9ff 52%, #e6f4ff 100%);
    border: 1px solid var(--brand-100);
    box-shadow: var(--shadow);
    margin: 8px 0 28px;
}
[data-theme="dark"] .hero { background: linear-gradient(130deg, #0e2033 0%, #0c1a28 60%, #0a283c 100%); }
.hero-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1.35fr .9fr; gap: 28px; padding: 48px 46px; align-items: center; }
.hero-orb { position: absolute; border-radius: 50%; filter: blur(8px); opacity: .55; z-index: 1; }
.hero-orb--one { width: 320px; height: 320px; right: -90px; top: -120px; background: radial-gradient(circle, rgba(2,158,254,.3), transparent 65%); }
.hero-orb--two { width: 260px; height: 260px; left: -100px; bottom: -140px; background: radial-gradient(circle, rgba(5,117,230,.18), transparent 65%); }
.hero-copy .eyebrow { margin-bottom: 14px; }
.hero h1 { font-size: clamp(30px, 4.2vw, 46px); letter-spacing: -0.035em; line-height: 1.16; margin-bottom: 14px; overflow-wrap: anywhere; }
.hero-accent { display: block; background: linear-gradient(100deg, #029efe, #0468d7 65%); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme="dark"] .hero-accent { background: linear-gradient(100deg, #6fd0ff, #2fb1ff 65%); -webkit-background-clip: text; background-clip: text; }
.hero-copy > p { color: var(--muted); font-size: 15.5px; max-width: 520px; }
.hero-search {
    margin: 24px 0 20px; display: flex; align-items: center; gap: 8px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
    padding: 7px 7px 7px 15px; max-width: 560px; box-shadow: var(--shadow-xs);
}
.hero-search:focus-within { border-color: var(--brand-200); box-shadow: 0 0 0 4px var(--brand-50); }
.hero-search .icon { color: var(--muted); }
.hero-search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 14px; }
.hero-search .btn { padding: 9px 18px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800; color: var(--brand-700); text-transform: uppercase; letter-spacing: .1em; }
.eyebrow .icon { width: 15px; height: 15px; }

.hero-panel {
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    border: 1px solid var(--line); border-radius: 20px;
    padding: 18px; box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}
.hero-panel-head { display: flex; gap: 10px; align-items: center; padding: 2px 2px 14px; border-bottom: 1px solid var(--line); }
.hero-panel-head .icon { width: 26px; height: 26px; color: var(--brand); background: var(--brand-50); border-radius: 9px; padding: 5px; }
.hero-panel-head strong { display: block; font-size: 13.5px; }
.hero-panel-head span { font-size: 11.5px; color: var(--muted); }
.hero-panel-yield { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 0; }
.hero-stat { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.hero-stat-icon { color: var(--brand); }
.hero-stat-icon .icon { width: 16px; height: 16px; }
.hero-stat strong { font-size: 22px; letter-spacing: -0.02em; line-height: 1.2; }
.hero-stat > span:last-child { font-size: 11.5px; color: var(--muted); }
.hero-online { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 4px; }

/* Sections / home */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 26px; align-items: start; }
.section { margin-bottom: 30px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section-head h2 { display: flex; align-items: center; gap: 8px; font-size: 19px; }
.section-head h2 .icon { color: var(--brand); width: 20px; height: 20px; }
.section-head p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.home-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 14px 4px 0; color: var(--muted); font-size: 12.5px; }
.home-tags > span { display: inline-flex; align-items: center; gap: 5px; margin-inline-end: 4px; }

.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cat-card {
    --cat-color: var(--brand);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow-xs);
    transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease;
    display: flex; flex-direction: column; gap: 11px; min-width: 0;
}
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--cat-color) 30%, var(--line)); }
.cat-card-head { display: flex; gap: 11px; align-items: flex-start; color: inherit; }
.cat-icon {
    width: 42px; height: 42px; border-radius: 12px; flex: 0 0 auto;
    display: grid; place-items: center;
    background: color-mix(in srgb, var(--cat-color) 12%, var(--surface));
    color: var(--cat-color);
}
.cat-icon .icon { width: 21px; height: 21px; }
.cat-card-title { min-width: 0; flex: 1; }
.cat-card-title strong { display: block; font-size: 15.5px; color: var(--ink); overflow-wrap: anywhere; }
.cat-card-title span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.5; margin-top: 2px; overflow-wrap: anywhere; }
.cat-arrow { width: 16px; height: 16px; color: var(--muted); margin-top: 4px; }
.cat-card-stats { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.cat-card-stats span { display: inline-flex; align-items: center; gap: 4px; }
.cat-card-stats .icon { width: 13px; height: 13px; }
.cat-children { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-children a { font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); padding: 2px 8px; border-radius: 999px; max-width: 100%; overflow-wrap: anywhere; }
.cat-children a:hover { color: var(--brand-700); border-color: var(--brand-200); }
.cat-topics { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px dashed var(--line); display: grid; gap: 6px; }
.cat-topics li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12.5px; min-width: 0; }
.cat-topics a { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-topics a:hover { color: var(--brand-700); }
.cat-topics time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.cat-empty { color: var(--muted); font-size: 12px; }

/* Topic list */
.topic-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-xs); }
.card-list { border: 0; background: transparent; box-shadow: none; display: grid; gap: 8px; }
.card-list .topic-row { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.topic-row {
    display: grid; grid-template-columns: 46px minmax(0, 1fr) auto 174px;
    gap: 14px; align-items: center; padding: 15px 18px;
    border-bottom: 1px solid var(--line); min-width: 0;
}
.topic-row:last-child { border-bottom: 0; }
.topic-row:hover { background: var(--surface-2); }
.topic-row.is-pinned { background: linear-gradient(90deg, var(--brand-50), transparent 55%); }
.topic-avatar { display: block; }
.topic-main { min-width: 0; }
.topic-title-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; }
.topic-title { font-weight: 680; font-size: 15px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.topic-title:hover { color: var(--brand-700); }
.topic-locked { color: var(--warning); display: inline-flex; }
.topic-locked .icon { width: 14px; height: 14px; }
.topic-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; margin-top: 4px; flex-wrap: wrap; }
.topic-author { color: var(--ink-soft); font-weight: 600; }
.topic-stats { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.topic-stats span { display: inline-flex; align-items: center; gap: 4px; }
.topic-stats .icon { width: 14px; height: 14px; }
.topic-last { display: flex; align-items: center; gap: 8px; justify-content: flex-end; min-width: 0; }
.topic-last-info { display: flex; flex-direction: column; line-height: 1.35; font-size: 11.5px; color: var(--muted); min-width: 0; }
.topic-last-info > span { color: var(--ink-soft); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-last-info time { font-size: 11px; }

/* Chips / badges / tags / avatars */
.chip {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 700; line-height: 1;
    padding: 5px 8px; border-radius: 7px;
    background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
    max-width: 100%; overflow-wrap: anywhere;
    white-space: normal;
}
.chip .icon { width: 12px; height: 12px; }
.chip-cat { color: var(--brand-700); background: var(--brand-50); border-color: var(--brand-100); }
.chip-cat .icon { color: var(--cat-color, var(--brand)); }
.chip-pin { color: var(--brand-700); background: var(--brand-50); border-color: var(--brand-100); }
.chip-locked { color: var(--warning); background: var(--warning-soft); border-color: #ffe2a8; }
.chip-large { font-size: 12.5px; padding: 8px 12px; border-radius: 10px; }
.chip-large span { background: var(--surface); border-radius: 5px; padding: 0 5px; margin-inline-start: 2px; font-size: 11px; }
.badge {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 10.5px; font-weight: 800; letter-spacing: .02em;
    padding: 3px 7px; border-radius: 6px; line-height: 1.4;
    background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
    white-space: nowrap;
}
.badge .icon { width: 12px; height: 12px; display: block; flex: 0 0 auto; }
.badge-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-notify { background: var(--danger); color: #fff; border-color: transparent; font-variant-numeric: tabular-nums; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge-admin { background: #eef2ff; color: #4f46e5; border-color: transparent; }
.badge-founder { background: linear-gradient(135deg, var(--brand), #0575e6); color: #fff; border-color: transparent; }
.badge-mod { background: #ecfdf5; color: #047857; border-color: transparent; }
.badge-sm { padding: 1px 6px; border-radius: 5px; font-size: 10px; line-height: 1.45; }
[data-theme="dark"] .badge-admin { background: #1e2444; color: #a5b4fc; }
[data-theme="dark"] .badge-mod { background: #102f27; color: #6ee7b7; }
.verify-badge { display: inline-flex; align-items: center; justify-content: center; width: .92em; height: .92em; margin-inline-start: .22em; border-radius: 50%; color: #fff; font-size: inherit; font-weight: 900; line-height: 1; vertical-align: middle; flex: none; transform: translateY(-.5px); box-shadow: 0 1px 3px rgba(14, 50, 90, .22); }
.verify-badge > span { font-size: .58em; line-height: 1; transform: none; }
.verify-personal { background: radial-gradient(circle at 30% 25%, #69cbff, #1d9bf0 58%, #0b6bc1); }
.verify-personal > span { color: #fff; -webkit-text-fill-color: #fff; }
.verify-organization { background: linear-gradient(135deg, #ffd95f, #f0b400); color: #4a3400; }
.verify-organization > span { color: #4a3400; -webkit-text-fill-color: #4a3400; }
.profile-verification { color: var(--ink-soft) !important; font-weight: 600; }
[data-theme="dark"] .verify-personal { background: radial-gradient(circle at 30% 25%, #47b5f5, #1687d9 58%, #0b5f9f); }
[data-theme="dark"] .verify-organization { background: linear-gradient(135deg, #e9c34b, #d9a300); color: #2f2100; }
.tag {
    display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600;
    color: var(--muted); background: var(--surface-2); border: 1px solid var(--line);
    padding: 3px 9px; border-radius: 999px; max-width: 100%; overflow-wrap: anywhere;
}
.tag:hover { color: var(--brand-700); background: var(--brand-50); border-color: var(--brand-100); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 16px 16px; }

.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    line-height: 1; text-align: center; vertical-align: middle;
    overflow: hidden; border-radius: 50%; flex: 0 0 auto; object-fit: cover;
    background: var(--brand-50); color: var(--brand-700);
    font-weight: 800; border: 1px solid var(--line);
}
.avatar-xs { width: 22px; height: 22px; font-size: 10px; }
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.avatar-md { width: 42px; height: 42px; font-size: 15px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-xl { width: 98px; height: 98px; font-size: 34px; }
.avatar-text {
    line-height: 1;
    padding-bottom: .02em;
    background: linear-gradient(135deg,
        hsl(var(--av-hue, 200) 85% 92%),
        hsl(calc(var(--av-hue, 200) + 24) 80% 86%));
    color: hsl(var(--av-hue, 200) 70% 32%);
}
[data-theme="dark"] .avatar-text {
    background: linear-gradient(135deg,
        hsl(var(--av-hue, 200) 45% 24%),
        hsl(calc(var(--av-hue, 200) + 24) 42% 18%));
    color: hsl(var(--av-hue, 200) 80% 78%);
}

/* Cards / sidebar / page layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.card-head h2 { display: flex; align-items: center; gap: 7px; font-size: 14.5px; min-width: 0; overflow-wrap: anywhere; }
.card-head h2 .icon { color: var(--brand); width: 17px; height: 17px; }
.link-more { font-size: 12px; color: var(--muted); font-weight: 600; }
.link-more:hover { color: var(--brand-700); }
.sidebar { display: grid; gap: 16px; align-content: start; }
.sidebar-card { overflow: hidden; }
.cat-nav { list-style: none; margin: 0; padding: 6px 8px 8px; }
.cat-nav a { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 9px; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.cat-nav a:hover { background: var(--brand-50); color: var(--brand-700); }
.cat-dot {
    width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
    background: color-mix(in srgb, var(--cat-color, var(--brand)) 12%, transparent);
    color: var(--cat-color, var(--brand)); flex: 0 0 auto;
}
.cat-dot .icon { width: 15px; height: 15px; }
.cat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-count { font-size: 11px; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 1px 6px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.stat-grid .stat { background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; }
.stat strong { font-size: 20px; letter-spacing: -0.02em; }
.stat span { font-size: 11.5px; color: var(--muted); }
.sidebar-note { display: flex; align-items: center; gap: 6px; padding: 11px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.sidebar-note a { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; line-height: 1.25; }
.sidebar-note .verify-badge { width: .92em; height: .92em; margin-inline-start: 2px; vertical-align: 0; align-self: center; transform: translateY(-.5px); }
.sidebar-note .verify-badge > span { font-size: .58em; }
.sidebar-note .icon { width: 14px; height: 14px; }
.online-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 14px 16px; }
.related-list { list-style: none; margin: 0; padding: 10px 16px 14px; display: grid; gap: 10px; }
.related-list a { color: var(--ink-soft); font-size: 13px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
.related-list a:hover { color: var(--brand-700); }
.related-list span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.about-list { padding: 8px 16px 14px; display: grid; gap: 8px; }
.about-list div { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.about-list span { color: var(--muted); }
.signature-preview { padding: 12px 16px 16px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

.layout-with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 318px; gap: 24px; align-items: start; }
.content-main { min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 27px; letter-spacing: -0.025em; margin-top: 5px; overflow-wrap: anywhere; }
.page-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; overflow-wrap: anywhere; }
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); margin: 2px 0 14px; flex-wrap: wrap; }
.breadcrumb .icon { width: 12px; height: 12px; color: var(--line-strong); }
.breadcrumb a { color: var(--muted); font-weight: 600; }
.breadcrumb a:hover { color: var(--brand-700); }
.breadcrumb > span { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 2px 10px; font-size: 12.5px; color: var(--muted); }

/* Category page */
.category-hero {
    --cat-color: var(--brand);
    display: flex; align-items: center; gap: 18px; padding: 26px 28px;
    background: linear-gradient(120deg, color-mix(in srgb, var(--cat-color) 9%, var(--surface)), var(--surface) 65%);
    border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px;
    box-shadow: var(--shadow-xs);
}
.cat-hero-icon { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--cat-color) 14%, transparent); color: var(--cat-color); flex: 0 0 auto; }
.cat-hero-icon .icon { width: 30px; height: 30px; }
.cat-hero-copy { flex: 1; min-width: 0; }
.cat-hero-copy h1 { font-size: 25px; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.cat-hero-copy p { color: var(--muted); font-size: 13.5px; margin-top: 4px; overflow-wrap: anywhere; }
.cat-hero-meta { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.cat-hero-meta span { display: inline-flex; align-items: center; gap: 4px; }
.cat-hero-meta .icon { width: 14px; height: 14px; }
.subcategory-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.subcategory-row .chip { color: var(--ink-soft); }
.subcategory-row .chip:hover { border-color: var(--brand-200); color: var(--brand-700); }

/* Topic page */
.topic-header { padding: 22px 24px; margin-bottom: 16px; }
.topic-header-top { display: flex; gap: 20px; align-items: flex-start; }
.topic-header-main { flex: 1; min-width: 0; }
.topic-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 9px; }
.topic-header h1 { font-size: clamp(20px, 2.2vw, 26px); letter-spacing: -0.025em; line-height: 1.35; overflow-wrap: anywhere; word-break: break-word; }
.topic-header-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; color: var(--muted); font-size: 12.5px; }
.topic-header-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.topic-header-meta .icon { width: 14px; height: 14px; }
.author-inline { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-weight: 650; }
.topic-header-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 320px; }
.topic-first-post { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.topic-first-content { padding: 0; }
.topic-first-post .post-signature { margin: 14px 0 0; }
.topic-first-actions { margin-top: 14px; }
.topic-first-actions .post-actions { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.topic-posts { display: grid; gap: 12px; }
.post-list { display: grid; gap: 12px; }
.reply-form-error { color: var(--danger); font-size: 12px; line-height: 1.5; }
.reply-form-error[hidden] { display: none; }
.form-error { margin: 2px 0 0; color: var(--danger); font-size: 12.5px; line-height: 1.5; }
.form-error[hidden] { display: none; }
.post { display: grid; grid-template-columns: 148px minmax(0, 1fr); overflow: hidden; }
.post-author {
    padding: 22px 16px; background: var(--surface-2); border-inline-end: 1px solid var(--line);
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
}
.post-author-name { display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; font-weight: 750; font-size: 13.5px; line-height: 1.35; color: var(--ink); margin-top: 6px; word-break: break-word; }
.post-author-name .verify-badge { margin-inline-start: 0; vertical-align: 0; align-self: center; transform: translateY(-.5px); }
.post-author-stat { font-size: 11px; color: var(--muted); }
.post-main { min-width: 0; display: flex; flex-direction: column; }
.post-head { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-bottom: 1px dashed var(--line); font-size: 11.5px; color: var(--muted); }
.post-floor { font-weight: 800; color: var(--brand-700); background: var(--brand-50); padding: 1px 7px; border-radius: 5px; }
.post-edited { font-style: italic; }
.post-content { padding: 20px 22px; flex: 1; }
.post-signature { margin: 0 22px 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.post-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); }
.post-action {
    display: inline-flex; align-items: center; gap: 5px; border: 0; background: none;
    color: var(--muted); font-size: 12px; font-weight: 600; padding: 5px 8px;
    border-radius: 7px; cursor: pointer;
}
.post-action:hover { background: var(--brand-50); color: var(--brand-700); }
.post-action.is-active { color: var(--brand-700); background: var(--brand-50); }
.post-action .icon { width: 14px; height: 14px; }
.post-action-count { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; font-size: 10.5px; }
.post-action.is-danger:hover { color: var(--danger); background: var(--danger-soft); }
.reply-box { overflow: hidden; }
.reply-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.reply-head h2 { display: flex; align-items: center; gap: 7px; font-size: 15px; }
.reply-head h2 .icon { color: var(--brand); width: 17px; height: 17px; }
.reply-box form { padding: 18px 20px 20px; }
.reply-gate { padding: 34px 24px; text-align: center; display: grid; justify-items: center; gap: 8px; }
.reply-gate h2 { font-size: 18px; }
.reply-gate p { color: var(--muted); font-size: 13.5px; }
.reply-gate .row-actions { margin-top: 8px; }
.cat-about { padding: 20px 18px; text-align: left; background: linear-gradient(140deg, color-mix(in srgb, var(--cat-color) 7%, var(--surface)), var(--surface)); }
.cat-about-icon { width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--cat-color) 14%, transparent); color: var(--cat-color); display: grid; place-items: center; margin-bottom: 10px; }
.cat-about h2 { font-size: 16px; margin-bottom: 4px; }
.cat-about p { color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }

/* Forms */
.form { padding: 20px; display: grid; gap: 16px; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid--3 { grid-template-columns: repeat(3, 1fr); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field-hint { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.field-hint--strong { color: var(--warning); font-weight: 600; }
.password-strength { display: none; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: 2px; }
.password-strength.is-visible { display: grid; }
.password-strength-track { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.password-strength-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--muted); transition: width .2s ease, background-color .2s ease; }
.password-strength-text { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.password-strength[data-level="weak"] .password-strength-fill { background: var(--danger); }
.password-strength[data-level="weak"] .password-strength-text { color: var(--danger); }
.password-strength[data-level="fair"] .password-strength-fill { background: var(--warning); }
.password-strength[data-level="fair"] .password-strength-text { color: var(--warning); }
.password-strength[data-level="good"] .password-strength-fill { background: var(--brand); }
.password-strength[data-level="good"] .password-strength-text { color: var(--brand-700); }
.password-strength[data-level="strong"] .password-strength-fill { background: var(--success); }
.password-strength[data-level="strong"] .password-strength-text { color: var(--success); }
.input {
    width: 100%; background: var(--surface); border: 1px solid var(--line-strong);
    border-radius: 10px; padding: 10px 12px; font-size: 14px; outline: 0;
    transition: border-color .18s ease, box-shadow .18s ease; color: var(--ink);
}
.input:hover { border-color: var(--brand-200); }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.input::placeholder { color: var(--muted); opacity: .75; }
textarea.input { resize: vertical; min-height: 80px; line-height: 1.6; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-inline-end: 34px; }
.input-lg { padding: 13px 14px; font-size: 15.5px; }
.input-sm { padding: 7px 10px; font-size: 12.5px; border-radius: 8px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > .icon { position: absolute; inset-inline-start: 12px; color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.input-wrap .input { padding-inline-start: 38px; }
.input-action {
    position: absolute; inset-inline-end: 6px; border: 0; background: none;
    color: var(--muted); width: 30px; height: 30px; border-radius: 7px;
    cursor: pointer; display: grid; place-items: center;
}
.input-action:hover { background: var(--brand-50); color: var(--brand-700); }
.checkbox { display: inline-flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--ink-soft); cursor: pointer; line-height: 1.5; }
input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    margin: 0;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background-color: var(--surface);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 12px 12px;
    cursor: pointer;
    flex: 0 0 auto;
    vertical-align: middle;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
input[type="checkbox"]:hover { border-color: var(--brand); }
input[type="checkbox"]:checked,
input[type="checkbox"]:indeterminate {
    border-color: var(--brand);
    background-color: var(--brand);
}
input[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='m3 8 3.2 3.2L13 4.8'/%3E%3C/svg%3E");
}
input[type="checkbox"]:indeterminate {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' d='M4 8h8'/%3E%3C/svg%3E");
}
input[type="checkbox"]:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px var(--brand-50);
}
input[type="checkbox"]:disabled {
    opacity: .5;
    cursor: not-allowed;
}
.checkbox input { margin-top: 2px; }
.checkbox-sm { font-size: 12px; }
.stack-form { display: grid; gap: 8px; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.color-field { display: flex; align-items: center; gap: 9px; }
.color-field input[type="color"] { width: 46px; height: 38px; padding: 2px; cursor: pointer; }
.color-field span { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* Vditor editor */
.vditor-shell { position: relative; border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; background: var(--surface); transition: border-color .18s ease, box-shadow .18s ease; }
.vditor-shell:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.vditor-host { min-height: var(--vditor-height, 360px); }
.vditor-loading { position: absolute; top: 0; left: 0; right: 0; z-index: 2; height: var(--vditor-height, 360px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: var(--surface); color: var(--muted); font-size: 12px; }
.vditor-spinner { width: 22px; height: 22px; border: 2px solid var(--brand-100); border-top-color: var(--brand); border-radius: 50%; animation: vditor-spin .75s linear infinite; }
.vditor-shell.is-ready .vditor-loading { display: none; }
.vditor-shell.is-error .vditor-loading { color: var(--danger); }
.vditor-shell.is-error .vditor-spinner { display: none; }
@keyframes vditor-spin { to { transform: rotate(360deg); } }
.vditor-shell .vditor { border: 0; border-radius: 0; background: transparent; }
.vditor-shell .vditor--fullscreen { height: var(--vvh, 100dvh) !important; }
.vditor-shell .vditor-toolbar { border-bottom: 1px solid var(--line); background: var(--surface-2); padding: 4px 8px; }
.vditor-shell .vditor-reset { font-family: var(--font); color: var(--ink); }
.vditor-shell .vditor-ir { background: var(--surface); }
.vditor-shell .vditor-counter { color: var(--muted); font-size: 11px; }
.vditor-note { padding: 7px 12px; border-top: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.vditor-shell .vditor-toolbar__item { color: var(--muted); }
.vditor-shell .vditor-toolbar__item:hover { background: var(--brand-50); color: var(--brand-700); }
.vditor-shell .vditor-emojis { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; overscroll-behavior: contain; }
.vditor-shell .vditor-emojis::-webkit-scrollbar { display: block; width: 6px; }
.vditor-shell .vditor-emojis::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.vditor-shell .vditor-emojis button { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.vditor-shell .hy-emoji-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 0 6px; margin: 0 0 2px; border-bottom: 1px solid var(--line); }
.vditor-shell .hy-emoji-tab { flex: 0 0 auto; padding: 2px 7px; border-radius: 999px; font-size: 12px; line-height: 18px; color: var(--muted); cursor: pointer; white-space: nowrap; user-select: none; }
.vditor-shell .hy-emoji-tab:hover { color: var(--brand-700); background: var(--brand-50); }
.vditor-shell .hy-emoji-tab.is-active { color: #fff; background: var(--brand); }
[data-theme="dark"] .vditor-shell .hy-emoji-tab.is-active { color: #062033; }
.post-draft-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 11px; margin-bottom: 14px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.post-draft-bar[hidden] { display: none; }
.post-draft-text { min-width: 0; line-height: 1.45; }
.post-draft-clear { flex: none; padding: 2px 4px; border: 0; background: none; color: var(--brand-700); font-size: 12px; font-weight: 650; cursor: pointer; }
.post-draft-clear:hover { text-decoration: underline; }
.captcha-box { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.captcha-visual { position: relative; display: flex; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--surface-2); flex: 0 0 auto; }
.captcha-content { display: flex; }
.captcha-content img { display: block; width: 208px; height: 62px; object-fit: cover; }
.captcha-math { width: 208px; height: 62px; display: grid; place-items: center; padding: 0 12px; font-size: 20px; font-weight: 600; color: var(--ink); background: linear-gradient(135deg, #f5faff, #e7f4ff); letter-spacing: .04em; }
.captcha-refresh { position: absolute; inset-inline-end: 3px; bottom: 3px; border: 0; background: rgba(255, 255, 255, .84); color: var(--brand-700); width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; cursor: pointer; }
.captcha-refresh:hover { background: #fff; }
.captcha-refresh:disabled { opacity: .5; cursor: wait; }
.captcha-refresh .icon { width: 13px; height: 13px; }
.captcha-entry { display: flex; flex-direction: column; gap: 4px; flex: 1 1 150px; min-width: 140px; }
.captcha-entry .input { width: 100%; max-width: 190px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.captcha-entry .input::placeholder { text-transform: none; letter-spacing: normal; font-weight: 400; }
.captcha-pow { font-size: 11px; min-height: 14px; line-height: 1.4; color: var(--muted); }
.captcha-pow.is-ready { color: var(--success); }
.captcha-pow.is-failed { color: var(--danger); }
.captcha-pow.is-working { color: var(--muted); }

/* Auth */
.auth-body { background: var(--bg); min-height: 100vh; }
.auth-shell { display: grid; grid-template-columns: minmax(360px, .92fr) 1.08fr; min-height: 100vh; }
.auth-brand {
    position: relative; overflow: hidden;
    background: linear-gradient(150deg, #029efe 0%, #0575e6 55%, #0152b8 100%);
    color: #fff; padding: 42px 46px; display: flex; flex-direction: column;
}
.auth-brand::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 1px solid rgba(255,255,255,.16); right: -190px; bottom: -200px; }
.auth-brand::before { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; background: rgba(255,255,255,.08); right: -40px; top: -120px; filter: blur(2px); }
.auth-brand-top { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 19px; color: #fff; position: relative; z-index: 2; }
.auth-brand-top img { border-radius: 13px; background: #fff; padding: 2px; }
.auth-brand-copy { margin: auto 0; position: relative; z-index: 2; max-width: 440px; }
.auth-brand-copy h1 { color: #fff; font-size: clamp(28px, 3.3vw, 42px); line-height: 1.2; letter-spacing: -0.035em; margin-bottom: 14px; }
.auth-brand-copy p { color: rgba(255,255,255,.82); font-size: 14.5px; }
.auth-features { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.auth-features li { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.92); font-size: 13.5px; }
.auth-features .icon { background: rgba(255,255,255,.14); border-radius: 8px; padding: 6px; width: 30px; height: 30px; }
.auth-brand-foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 12px; color: rgba(255,255,255,.72); position: relative; z-index: 2; }
.auth-brand-foot span { display: inline-flex; align-items: center; gap: 5px; }
.auth-brand-foot .icon { width: 14px; height: 14px; }
.auth-main { padding: 30px clamp(20px, 5vw, 72px) 24px; display: flex; flex-direction: column; justify-content: center; max-width: 640px; width: 100%; margin: 0 auto; }
.auth-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 22px; }
.auth-toolbar > a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.auth-toolbar .icon { width: 15px; height: 15px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(22px, 3vw, 34px); box-shadow: var(--shadow); }
.auth-head { margin-bottom: 22px; }
.auth-head h1 { font-size: 26px; letter-spacing: -0.025em; margin: 6px 0 6px; }
.auth-head p { color: var(--muted); font-size: 13.5px; }
.auth-head--center { text-align: center; display: grid; justify-items: center; gap: 2px; }
.auth-head--center p { max-width: 400px; }
.auth-head .eyebrow { margin-bottom: 2px; }
.success-ring {
    width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center;
    background: var(--brand-50); color: var(--brand); border: 1px solid var(--brand-100);
    margin-bottom: 8px;
}
.success-ring .icon { width: 28px; height: 28px; }
.success-ring--warn { background: var(--warning-soft); color: var(--warning); border-color: #ffe2a8; }
.auth-head + .form { padding: 0; }
.auth-alt { display: flex; justify-content: center; gap: 8px; align-items: center; margin-top: 18px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.auth-alt a { font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.auth-actions { display: flex; align-items: center; justify-content: center; gap: 9px; flex-wrap: wrap; margin-top: 20px; }
.auth-note { display: flex; gap: 11px; padding: 13px 15px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-strong); margin: 18px 0; font-size: 12.5px; color: var(--muted); }
.auth-note .icon { color: var(--brand); flex: 0 0 auto; margin-top: 2px; }
.auth-note strong { display: block; color: var(--ink-soft); margin-bottom: 3px; font-size: 12.5px; }
.auth-footer { display: flex; justify-content: center; gap: 16px; margin-top: 22px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.auth-footer a { color: var(--muted); }
.auth-footer a:hover { color: var(--brand-700); }

/* Profile */
.profile-hero { overflow: hidden; margin-bottom: 22px; }
.profile-cover { height: 112px; background:
    radial-gradient(120% 180% at 8% 0%, rgba(255,255,255,.5), transparent 55%),
    linear-gradient(120deg, #029efe, #0575e6 55%, #0b63c9); position: relative; }
.profile-cover.has-image { background-color: #0b63c9; background-size: cover; background-position: center; }
.profile-cover::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.22) 1px, transparent 1px); background-size: 18px 18px; opacity: .5; }
.profile-cover.has-image::after { background-image: linear-gradient(180deg, rgba(3,35,70,.02), rgba(3,35,70,.20)); background-size: auto; opacity: 1; }
.profile-body { display: flex; gap: 18px; padding: 0 24px 18px; margin-top: -48px; align-items: flex-end; position: relative; }
.profile-avatar .avatar { border: 4px solid var(--surface); box-shadow: var(--shadow); }
.profile-info { flex: 1; min-width: 0; padding-top: 52px; }
.profile-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-name-row h1 { font-size: 24px; letter-spacing: -0.02em; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.profile-name-row h1 .verify-badge {
    width: .92em; height: .92em; font-size: inherit; margin-inline-start: 0;
    vertical-align: 0; align-self: center;
}
.profile-name-row h1 .verify-badge > span { font-size: .58em; transform: none; }
.profile-bio { font-size: 13px; color: var(--ink-soft); margin-top: 5px; max-width: 660px; overflow-wrap: anywhere; }
.profile-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--muted); }
.profile-meta span, .profile-meta a { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); max-width: 100%; overflow-wrap: anywhere; }
.profile-meta .icon { width: 14px; height: 14px; }
.profile-actions { padding-bottom: 4px; }
.profile-action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: var(--surface-2); }
.profile-stats div { padding: 12px 20px; display: flex; flex-direction: column; border-inline-end: 1px solid var(--line); }
.profile-stats div:last-child { border-inline-end: 0; }
.profile-stats strong { font-size: 18px; }
.profile-stats span { font-size: 11.5px; color: var(--muted); }
.profile-empty { padding: 14px 2px; color: var(--muted); font-size: 13px; }

/* Messages */
.conversation-list { display: grid; gap: 8px; }
.conversation-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: inherit; }
.conversation-row:hover { border-color: var(--brand-200); box-shadow: var(--shadow); }
.conversation-row.is-unread { border-color: var(--brand-200); background: linear-gradient(90deg, var(--brand-50), var(--surface)); }
.conversation-body { flex: 1; min-width: 0; }
.conversation-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.conversation-name strong { display: inline-flex; align-items: center; gap: 2px; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.conversation-body p { color: var(--muted); font-size: 12.5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-row > time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.unread-pill { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; }
.empty-state h2 { font-size: 18px; }

/* Search */
.search-page { padding: 18px; margin-bottom: 18px; display: grid; gap: 14px; }
.search-form { display: flex; align-items: center; gap: 8px; }
.search-form > .icon { color: var(--muted); margin-inline-start: 2px; }
.search-form input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; min-width: 0; }
.search-page .tabs { margin: 0 -6px; }
.result-meta { font-size: 12px; color: var(--muted); }
.search-filters { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px dashed var(--line); }
.search-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); }
.search-filters .input { height: 34px; min-width: 120px; }
.search-filters .btn { height: 34px; }
.member-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.member-card { display: flex; align-items: center; gap: 12px; padding: 16px; color: inherit; }
.member-card:hover { border-color: var(--brand-200); box-shadow: var(--shadow); transform: translateY(-1px); }
.member-card-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.member-card-body strong { font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; }
.member-card-body > span, .member-card-body time { font-size: 11.5px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-card > .icon { color: var(--line-strong); }
.member-snippet { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.topic-snippet { margin-top: 5px; color: var(--muted); font-size: 12.5px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.topic-snippet mark, .topic-title mark, .member-snippet mark { background: #fff0b3; color: inherit; padding: 0 2px; border-radius: 3px; }
[data-theme="dark"] .topic-snippet mark, [data-theme="dark"] .topic-title mark, [data-theme="dark"] .member-snippet mark { background: #7a5c16; color: #fff8d8; }
@media (max-width: 640px) { .search-filters label { flex: 1 1 130px; } .search-filters .input { width: 100%; } }

/* Tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding: 0 4px; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; font-size: 13px; font-weight: 650; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 7px 7px 0 0; }
.tab:hover { color: var(--brand-700); background: var(--brand-50); }
.tab.is-active { color: var(--brand-700); border-bottom-color: var(--brand); }
.tab .badge { margin-inline-start: 2px; }
.tab .icon { width: 15px; height: 15px; }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding: 18px 2px 4px; }
.page-btn {
    min-width: 34px; height: 34px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
    border-radius: 9px; font-size: 12.5px; font-weight: 650;
}
.page-btn:hover { border-color: var(--brand-200); color: var(--brand-700); background: var(--brand-50); }
.page-btn.is-active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(2,158,254,.25); }
.page-btn.is-disabled { opacity: .45; pointer-events: none; }
.page-btn .icon { width: 15px; height: 15px; }
.page-ellipsis { color: var(--muted); padding: 0 4px; }
.page-info { margin-inline-start: auto; font-size: 11.5px; color: var(--muted); }

/* Empty / error / prose */
.empty-state { text-align: center; padding: 46px 24px; display: grid; justify-items: center; gap: 8px; }
.empty-state h3 { font-size: 17px; }
.empty-state p { color: var(--muted); font-size: 13px; max-width: 440px; }
.empty-state .btn { margin-top: 8px; }
.empty-icon {
    width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center;
    background: var(--brand-50); color: var(--brand); border: 1px solid var(--brand-100); margin-bottom: 4px;
}
.empty-icon .icon { width: 24px; height: 24px; }
.empty-icon--large { width: 70px; height: 70px; border-radius: 20px; }
.empty-icon--large .icon { width: 32px; height: 32px; }
.error-page { position: relative; text-align: center; padding: 70px 20px; display: grid; justify-items: center; gap: 8px; overflow: hidden; }
.error-code { font-size: clamp(64px, 12vw, 120px); font-weight: 900; letter-spacing: -0.06em; line-height: 1; background: linear-gradient(135deg, #029efe, #0575e6); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: .9; }
.error-page h1 { font-size: 22px; }
.error-page p { color: var(--muted); font-size: 13.5px; max-width: 520px; }
.error-orb { position: absolute; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(2,158,254,.16), transparent 70%); top: -120px; }
.error-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.prose { font-size: 14.5px; line-height: 1.8; color: var(--ink-soft); word-wrap: break-word; overflow-wrap: anywhere; }
.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }
.prose p { margin: 0 0 14px; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin: 24px 0 10px; color: var(--ink); }
.prose h1 { font-size: 24px; } .prose h2 { font-size: 20px; } .prose h3 { font-size: 17px; } .prose h4 { font-size: 15px; }
.prose a { color: var(--brand-700); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--brand-200); }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { margin: 0 0 14px; padding-inline-start: 24px; }
.prose li { margin: 4px 0; }
.prose blockquote { margin: 0 0 14px; padding: 10px 16px; border-inline-start: 3px solid var(--brand-200); background: var(--brand-50); border-radius: 0 10px 10px 0; color: var(--ink-soft); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose pre { background: #0f1c2b; color: #d7e6f4; border-radius: 12px; padding: 14px 16px; overflow: auto; margin: 0 0 16px; font-size: 12.5px; line-height: 1.65; }
.prose code { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 5px; padding: 1px 5px; font-size: 12.5px; color: var(--brand-700); }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }
.prose img { border-radius: 12px; margin: 4px 0; max-width: 100%; height: auto; }
.prose video, .prose iframe { max-width: 100%; }
.prose table { display: block; max-width: 100%; overflow-x: auto; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.prose .mention { color: var(--brand-700); background: var(--brand-50); padding: 0 3px; border-radius: 4px; }
.page-doc { max-width: 860px; margin: 0 auto; overflow: hidden; }
.page-doc-head { padding: 30px 34px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(140deg, var(--brand-50), var(--surface) 60%); }
.page-doc-head h1 { font-size: 28px; margin-top: 4px; overflow-wrap: anywhere; }
.page-doc .prose { padding: 26px 34px 34px; }

/* Notifications */
.notification-list { display: grid; gap: 8px; }
.notif-item { display: flex; gap: 12px; align-items: flex-start; padding: 15px 17px; color: inherit; position: relative; }
.notif-item:hover { border-color: var(--brand-200); box-shadow: var(--shadow-xs); }
.notif-item.is-unread { background: var(--brand-50); border-color: var(--brand-100); }
.notif-body { flex: 1; min-width: 0; }
.notif-body p { font-size: 13.5px; color: var(--ink-soft); overflow-wrap: anywhere; }
.notif-body time { font-size: 11px; color: var(--muted); }
.notif-system { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-top: 7px; }
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { padding: 8px; display: grid; gap: 2px; position: sticky; top: calc(var(--header-h) + 16px); }
.settings-nav a { display: flex; align-items: center; gap: 9px; padding: 10px 11px; border-radius: 9px; color: var(--ink-soft); font-size: 13px; font-weight: 650; }
.settings-nav a:hover { background: var(--brand-50); color: var(--brand-700); }
.settings-nav a.is-active { background: var(--brand-50); color: var(--brand-700); }
.settings-main { display: grid; gap: 16px; min-width: 0; }
.settings-main .card-head { padding-top: 14px; }
.account-email { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; flex-wrap: wrap; }
.account-email > div { display: flex; flex-direction: column; min-width: 0; }
.account-email strong { font-size: 15px; overflow-wrap: anywhere; }
.avatar-editor { display: flex; align-items: center; gap: 16px; padding: 4px 0 6px; flex-wrap: wrap; }
.avatar-editor-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.cover-editor { display: flex; flex-direction: column; gap: 8px; padding: 2px 0 12px; }
.cover-preview { height: 112px; border-radius: 10px; border: 1px solid var(--line); background: radial-gradient(120% 180% at 8% 0%, rgba(255,255,255,.5), transparent 55%), linear-gradient(120deg, #029efe, #0575e6 55%, #0b63c9); background-size: cover; background-position: center; overflow: hidden; }
.cover-preview.has-image { background-color: #0b63c9; }
.cover-editor-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Admin */
.admin-body { background: var(--bg); }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 244px; flex: 0 0 244px; background: #071c2e;
    color: #b9cfe0; display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh; z-index: 120;
}
[data-theme="dark"] .admin-sidebar { background: #050f18; }
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.07); min-width: 0; }
.admin-brand img { border-radius: 9px; background: #fff; flex: 0 0 auto; }
.admin-brand span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.admin-brand strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.admin-brand small { font-size: 10px; color: #7fa3bd; letter-spacing: .08em; text-transform: uppercase; }
.admin-nav { padding: 12px 10px; display: grid; gap: 2px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent; }
.admin-nav::-webkit-scrollbar { width: 6px; }
.admin-nav::-webkit-scrollbar-track { background: transparent; }
.admin-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 999px; }
.admin-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.3); }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; color: #9db8cc; font-size: 13px; font-weight: 600; }
.admin-nav a:hover { background: rgba(56,182,255,.1); color: #e4f4ff; }
.admin-nav a.is-active { background: linear-gradient(90deg, rgba(2,158,254,.24), rgba(2,158,254,.06)); color: #fff; box-shadow: inset 2px 0 0 #38b6ff; }
.admin-nav .icon { width: 17px; height: 17px; }
.admin-sidebar-foot { margin-top: auto; padding: 12px 10px 18px; border-top: 1px solid rgba(255,255,255,.07); display: grid; gap: 2px; }
.admin-sidebar-foot a { display: flex; align-items: center; gap: 9px; padding: 9px 12px; color: #8fb0c7; font-size: 12.5px; border-radius: 8px; }
.admin-sidebar-foot a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
    display: flex; align-items: center; gap: 14px; padding: 0 26px;
    min-height: 66px; background: var(--surface); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 90;
}
.admin-topbar h1 { font-size: 18px; letter-spacing: -0.02em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-topbar-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.admin-user { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; color: var(--ink-soft); }
.admin-content { padding: 24px 26px 60px; flex: 1; min-width: 0; }
.admin-content > .alert { margin-bottom: 18px; }
.admin-menu-toggle { display: none; }
.admin-overlay { display: none; }
.admin-page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-subtitle { font-size: 13px; color: var(--muted); font-weight: 500; }
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 7px 10px; }
.filter-bar > .icon { color: var(--muted); }
.filter-bar .input { border: 0; padding: 6px 2px; background: transparent; min-width: 150px; }
.filter-bar select.input { padding: 6px 26px 6px 8px; background-color: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; min-width: 120px; }
.filter-bar .input:focus { box-shadow: none; border: 0; }
.stat-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-cards > * { min-width: 0; }
.stat-card { display: flex; align-items: center; gap: 13px; padding: 17px; position: relative; color: inherit; }
.stat-card:hover { border-color: var(--brand-200); box-shadow: var(--shadow); }
.stat-card-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; flex: 0 0 auto; }
.stat-card-icon .icon { width: 21px; height: 21px; }
.stat-card div { display: flex; flex-direction: column; min-width: 0; }
.stat-card strong { font-size: 23px; letter-spacing: -0.03em; line-height: 1.2; }
.stat-card span { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.stat-card small { font-size: 10.5px; color: var(--muted); }
.stat-card.is-alert .stat-card-icon { background: var(--danger-soft); color: var(--danger); }
.stat-card-arrow { margin-inline-start: auto; color: var(--line-strong); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.dashboard-grid > * { min-width: 0; }
.dashboard-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-chart { padding-bottom: 0; }
.chart-legend { display: flex; gap: 10px; font-size: 10.5px; color: var(--muted); flex-wrap: wrap; }
.legend-users::before, .legend-topics::before, .legend-posts::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-inline-end: 4px; }
.legend-users::before { background: #029efe; }
.legend-topics::before { background: #6366f1; }
.legend-posts::before { background: #14b8a6; }
.activity-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px 18px 0; }
.activity-summary > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.activity-summary span { display: inline-flex; align-items: center; font-size: 11px; color: var(--muted); }
.activity-summary strong { font-size: 17px; line-height: 1; color: var(--ink); }
.activity-chart { --activity-height: 150px; position: relative; height: calc(var(--activity-height) + 22px); margin: 16px 18px 14px; }
.activity-grid { position: absolute; inset: 0 0 22px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.activity-grid span { border-top: 1px dashed var(--line); }
.activity-grid span:first-child, .activity-grid span:last-child { border-top-color: var(--line-strong); }
.activity-days { position: relative; z-index: 1; display: flex; align-items: stretch; gap: 10px; height: 100%; }
.activity-day { position: relative; display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 0; }
.activity-bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; width: 100%; height: var(--activity-height); padding: 0 3px; border-radius: 8px 8px 0 0; }
.activity-day.is-today .activity-bars { background: linear-gradient(to top, var(--brand-50), transparent 85%); }
.activity-bar { position: relative; width: 9px; min-height: 0; border-radius: 4px 4px 2px 2px; transition: filter .16s ease; }
.activity-bar:hover { filter: brightness(.88); }
.activity-bar--users { background: linear-gradient(to top, #0284d8, #35b6ff); }
.activity-bar--topics { background: linear-gradient(to top, #5155e8, #8183ff); }
.activity-bar--posts { background: linear-gradient(to top, #0e9f90, #35d3c4); }
.activity-bar em { position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 10px; font-style: normal; font-weight: 750; line-height: 1; }
.activity-date { height: 22px; line-height: 22px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.activity-day.is-today .activity-date { color: var(--brand-700); font-weight: 800; }
.activity-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 170px; margin: 8px 18px 14px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 12px; }
.activity-empty .icon { width: 22px; height: 22px; opacity: .55; }
.sys-list { list-style: none; margin: 0; padding: 10px 18px; }
.sys-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.sys-list li:last-child { border-bottom: 0; }
.sys-list span { color: var(--muted); }
.sys-list strong { font-weight: 650; color: var(--ink-soft); font-size: 12.5px; text-align: end; min-width: 0; overflow-wrap: anywhere; }
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 18px 16px; }
.admin-list { padding: 6px 0 10px; min-width: 0; }
.admin-list > p { margin: 0; padding: 10px 18px; }
.admin-list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; border-radius: 9px; color: inherit; min-width: 0; }
.admin-list-item:hover { background: var(--brand-50); }
.admin-list-item > div { min-width: 0; overflow: hidden; }
.admin-list-item strong { display: block; max-width: 100%; font-size: 13px; font-weight: 650; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-list-item > div > span:not(.avatar) { display: block; max-width: 100%; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-list-user > div > span { font-size: 11px; color: var(--muted); }
.admin-list-user { display: flex; align-items: center; gap: 8px; }
.admin-list-item .chip { flex: 0 0 auto; white-space: nowrap; }
.admin-list-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.admin-list-name strong { min-width: 0; max-width: 100%; }
.admin-list-user div { min-width: 0; }

/* Admin tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
    text-align: start; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
    color: var(--muted); font-weight: 800; padding: 11px 14px; background: var(--surface-2);
    border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.is-child td { background: color-mix(in srgb, var(--brand-50) 40%, transparent); }
.table tr.is-muted td { opacity: .65; }
.table code { font-size: 11px; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; color: var(--ink-soft); }
.table-user { display: flex; align-items: center; gap: 9px; color: inherit; min-width: 180px; }
.table-user > span { display: flex; flex-direction: column; min-width: 0; }
.table-user strong { font-size: 13px; color: var(--ink-soft); }
.table-user small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.table-cat { display: flex; align-items: center; gap: 9px; min-width: 180px; }
.table-cat div { min-width: 0; }
.table-cat strong { display: block; font-size: 13px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-cat small { display: block; max-width: 220px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.table-content { max-width: 430px; overflow: hidden; }
.table-content a { display: block; max-width: 430px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-content a:hover { color: var(--brand-700); }
.table-empty { text-align: center; color: var(--muted); padding: 34px !important; }
.table-topic { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-soft); font-size: 13px; max-width: 420px; min-width: 0; }
.table-topic strong { display: block; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-topics th, .table-topics td { white-space: nowrap; }
.table-topics th:first-child, .table-topics td:first-child { width: 420px; max-width: 420px; }
.table-topics .table-topic { max-width: 100%; }
.table-posts th, .table-posts td { white-space: nowrap; }
.table-posts .table-content { width: 430px; max-width: 430px; }
.table-posts .table-content a { max-width: 100%; }
.table-users th, .table-users td { white-space: nowrap; }
.table-audit td:not(.table-content) { white-space: nowrap; }
.table-audit .table-content { width: 430px; max-width: 430px; }
.table-audit .table-content span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-categories td:not(:first-child) { white-space: nowrap; }
.table-words th, .table-words td { white-space: nowrap; }
.table-topic .icon { width: 13px; height: 13px; color: var(--brand); }
.row-menu { position: relative; }
.row-menu summary { list-style: none; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu-panel {
    position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 60;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow-lg); padding: 8px; min-width: 230px; display: grid; gap: 3px;
}
.row-menu-panel.is-floating {
    position: fixed; inset-inline-end: auto; z-index: 95;
    overflow-y: auto; overscroll-behavior: contain;
}
.row-menu-panel .dropdown-link { font-size: 12.5px; padding: 8px 9px; }
.row-menu-panel .input { width: 100%; }
.row-menu-panel form { margin: 0; }
.row-menu-panel .btn { width: 100%; }
.row-menu-panel .checkbox { font-size: 11.5px; }
.sub-menu { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.sub-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 7px 9px; color: var(--danger); cursor: pointer; border-radius: 7px; }
.sub-menu summary:hover { background: var(--danger-soft); }
.sub-menu .stack-form { padding: 6px 2px 2px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 15px; border-radius: 12px; font-size: 12.5px; margin-bottom: 16px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-soft); }
.notice .icon { color: var(--brand); margin-top: 1px; flex: 0 0 auto; }
.notice-warn { background: var(--warning-soft); border-color: #ffe2a8; color: #8a5a00; }
.notice-info { background: var(--info-soft); border-color: var(--brand-100); }
.security-checklist ul { list-style: none; margin: 0; padding: 8px 18px 16px; display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); }
.security-checklist li { display: flex; align-items: center; gap: 8px; }
.security-checklist li .icon { width: 16px; height: 16px; color: var(--warning); }
.security-checklist li.is-ok { color: var(--ink-soft); }
.security-checklist li.is-ok .icon { color: var(--success); }
.report-list { display: grid; gap: 10px; }
.report-card { padding: 17px 18px; }
.report-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.report-card-head time { font-size: 11px; color: var(--muted); }
.report-card h3 { font-size: 15px; margin-bottom: 6px; overflow-wrap: anywhere; }
.report-card h3 a { color: var(--ink); }
.report-reason { font-size: 13px; color: var(--ink-soft); background: var(--surface-2); border-radius: 9px; padding: 9px 12px; overflow-wrap: anywhere; }
.report-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 9px; }
.report-meta span { display: inline-flex; align-items: center; gap: 4px; }
.report-meta .icon { width: 13px; height: 13px; }
.report-actions { display: flex; gap: 7px; margin-top: 11px; flex-wrap: wrap; }
.report-actions .input { flex: 1; min-width: 180px; }
.report-note { margin-top: 9px; font-size: 12px; color: var(--muted); border-inline-start: 3px solid var(--line-strong); padding-inline-start: 9px; overflow-wrap: anywhere; }
.report-target { display: flex; gap: 10px; align-items: center; padding: 12px 14px; background: var(--brand-50); border: 1px dashed var(--brand-100); border-radius: 11px; }
.report-target .icon { color: var(--brand); }
.report-target div { display: flex; flex-direction: column; min-width: 0; }
.report-target strong { overflow-wrap: anywhere; }
.report-target strong { font-size: 13.5px; }
.rule-list { margin: 0; padding: 12px 18px 16px 30px; font-size: 12.5px; color: var(--muted); display: grid; gap: 6px; }
.report-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.admin-shell .form { padding: 20px; }

/* Responsive */
@media (max-width: 1180px) {
    .search-mini { width: 180px; }
    .hero-inner { padding: 38px 32px; }
    .home-grid { grid-template-columns: minmax(0, 1fr) 300px; }
    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr) 290px; }
    .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1020px) {
    .main-nav { display: none; }
    .mobile-toggle { display: inline-flex; }
    .mobile-nav { display: block; }
    .mobile-nav[hidden] { display: none; }
    .header-inner { gap: 12px; }
    .search-mini { width: 160px; }
    .home-grid, .layout-with-sidebar { grid-template-columns: 1fr; }
    .sidebar { grid-template-columns: 1fr 1fr; display: grid; }
    .topic-last { display: none; }
    .topic-row { grid-template-columns: 42px minmax(0, 1fr) auto; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-main { max-width: 560px; padding-top: 40px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-content { padding: 20px 18px 50px; }
    .topic-header-top { flex-direction: column; }
    .topic-header-actions { justify-content: flex-start; max-width: none; }
}
@media (max-width: 900px) {
    .admin-sidebar { position: fixed; inset-inline-start: 0; top: 0; transform: translateX(-104%); transition: transform .22s ease; }
    [dir="rtl"] .admin-sidebar { transform: translateX(104%); }
    .admin-sidebar.is-open { transform: translateX(0); }
    .admin-menu-toggle { display: inline-flex; }
    .admin-overlay { position: fixed; inset: 0; background: rgba(6, 20, 34, .5); z-index: 110; }
    .admin-overlay.is-open { display: block; }
}
@media (max-width: 760px) {
    .site-header .lang-switch { position: static; }
    .site-header .lang-switch .dropdown-menu {
        inset-inline-end: 14px;
        width: min(240px, calc(100vw - 28px));
        min-width: 0;
    }
    .site-header .lang-switch .dropdown-menu::before { display: none; }
    .auth-toolbar { position: relative; }
    .auth-toolbar .lang-switch { position: static; }
    .auth-toolbar .lang-switch .dropdown-menu {
        inset-inline-end: 0;
        width: min(240px, calc(100vw - 28px));
        min-width: 0;
    }
    .auth-toolbar .lang-switch .dropdown-menu::before { display: none; }
    .container { width: calc(100% - 28px); }
    .page-wrap { padding: 18px 0 46px; }
    .brand-tagline { display: none; }
    .search-mini { display: none; }
    .header-tools { gap: 6px; }
    .header-tools .lang-code { display: none; }
    .user-name { display: none; }
    .user-trigger .chev { display: none; }
    .hero { border-radius: 18px; }
    .hero-inner { grid-template-columns: 1fr; padding: 28px 22px; gap: 22px; }
    .hero h1 { font-size: 30px; }
    .hero-panel { display: none; }
    .hero-search { margin: 18px 0 16px; }
    .hero-search .btn { padding: 8px 13px; }
    .category-grid { grid-template-columns: 1fr; }
    .topic-row { padding: 13px 14px; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; }
    .topic-stats { display: none; }
    .topic-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .sidebar { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px; padding: 30px 0 22px; }
    .footer-brand { grid-column: 1 / -1; }
    .post { grid-template-columns: 1fr; }
    .post-author {
        flex-direction: row; text-align: left; align-items: center; gap: 9px;
        border-inline-end: 0; border-bottom: 1px solid var(--line); padding: 11px 16px;
    }
    .post-author .avatar-lg { width: 38px; height: 38px; font-size: 14px; }
    .post-author-name { margin-top: 0; }
    .post-author-stat { display: none; }
    .post-content { padding: 16px; }
    .post-signature { margin-inline: 16px; }
    .form-grid, .form-grid--3 { grid-template-columns: 1fr; }
    .form { padding: 16px; }
    .topic-header { padding: 18px; }
    .category-hero { flex-wrap: wrap; padding: 20px; }
    .cat-hero-copy { flex: 1 1 200px; }
    .profile-body { flex-direction: column; align-items: flex-start; gap: 10px; margin-top: -40px; padding-inline: 18px; }
    .profile-info { padding-top: 0; }
    .profile-avatar .avatar { width: 78px; height: 78px; font-size: 26px; }
    .profile-stats { grid-template-columns: 1fr 1fr; }
    .profile-stats div:nth-child(2) { border-inline-end: 0; }
    .profile-stats div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .member-grid { grid-template-columns: 1fr; }
    .settings-layout { grid-template-columns: 1fr; }
    .settings-nav { position: static; display: flex; overflow-x: auto; gap: 2px; }
    .settings-nav a { white-space: nowrap; font-size: 12.5px; }
    .report-grid { grid-template-columns: 1fr; }
    .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-card { padding: 13px; }
    .stat-card strong { font-size: 19px; }
    .stat-card small { display: none; }
    .dashboard-grid--2 { grid-template-columns: 1fr; }
    .activity-chart { --activity-height: 130px; margin-inline: 12px; }
    .activity-summary { padding-inline: 12px; gap: 6px; }
    .activity-summary > div { padding: 7px 8px; }
    .activity-days { gap: 5px; }
    .activity-bar { width: 6px; }
    .activity-date { font-size: 9px; }
    .page-head h1 { font-size: 23px; }
    .pagination .page-info { width: 100%; margin-inline-start: 0; }
    .auth-main { padding: 22px 16px; }
    .auth-card { border-radius: 16px; padding: 20px; }
    .auth-head h1 { font-size: 23px; }
    .topic-header-actions .btn { flex: 1 1 auto; }
    .hide-sm { display: none; }
    .admin-topbar { padding: 0 14px; min-height: 60px; }
    .admin-topbar h1 { font-size: 16px; }
    .admin-content { padding: 16px 12px 44px; }
    .table th, .table td { padding: 9px 10px; }
    .table-topics th:first-child, .table-topics td:first-child { width: 240px; max-width: 240px; }
    .table-posts .table-content { width: 240px; max-width: 240px; }
    .table-audit .table-content { width: 240px; max-width: 240px; }
    .filter-bar { width: 100%; }
    .filter-bar .input { min-width: 100px; }
}
@media (max-width: 460px) {
    .header-tools .btn-ghost { display: none; }
    .brand-name { font-size: 16px; max-width: 140px; }
    .theme-toggle { display: none; }
    .stat-cards { grid-template-columns: 1fr; }
    .profile-actions { width: 100%; }
    .profile-actions .btn { width: 100%; }
    .footer-bottom { flex-direction: column; }
    .pagination .page-btn { min-width: 31px; height: 31px; font-size: 11.5px; }
    .error-code { font-size: 76px; }
}

/* RTL */
[dir="rtl"] .icon[data-flip], [dir="rtl"] .cat-arrow, [dir="rtl"] .stat-card-arrow { transform: scaleX(-1); }
[dir="rtl"] .page-btn .icon { transform: scaleX(-1); }
[dir="rtl"] .prose blockquote { border-radius: 10px 0 0 10px; }
[dir="rtl"] .dropdown-menu::before { inset-inline-end: auto; inset-inline-start: 18px; }

/* Only-light / only-dark */
.only-dark { display: none; }
[data-theme="dark"] .only-light { display: none; }
[data-theme="dark"] .only-dark { display: inline-flex; }

/* Social compact mobile */
@media (max-width: 640px) {
    .profile-body { flex-wrap: wrap; align-items: flex-start; }
    .profile-info { flex: 1 1 180px; }
    .profile-actions { flex: 0 0 100%; width: 100%; padding-bottom: 0; }
    .profile-action-row { width: 100%; }
    .profile-action-row form { flex: 1; }
    .profile-action-row .btn { width: 100%; }
    .conversation-row > time { display: none; }
}

/* Blocks */
.profile-block-notice { margin-bottom: 16px; }
.blocked-user-list { display: grid; gap: 8px; }
.blocked-user-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.blocked-user-row:last-child { border-bottom: 0; }
.blocked-user-row a { flex: 1; color: var(--ink-soft); font-weight: 600; display: inline-flex; align-items: center; }
.blocked-user-row form { margin: 0; }

/* Verification info */
.verification-info { display: grid; gap: 7px; padding: 12px 18px 16px; }
.verification-summary { display: grid; gap: 7px; padding: 4px 0; }
.verification-info-head { display: flex; align-items: flex-start; gap: 8px; color: var(--ink-soft); }
.verification-info-head .verify-badge { margin-inline-start: 0; margin-top: 4px; transform: none; }
.verification-info-body { flex: 1; min-width: 0; display: grid; gap: 5px; }
.verification-info-title { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; min-width: 0; }
.verification-info-title strong,
.verification-info-title span { color: var(--ink-soft); font-size: 13px; }
.verification-info-title span { font-weight: 700; overflow-wrap: anywhere; }
.verification-summary strong { overflow-wrap: anywhere; }
.verification-info p, .verification-summary p { color: var(--muted); font-size: 12.5px; line-height: 1.7; white-space: normal; overflow-wrap: anywhere; }
.verification-info time, .verification-summary time { color: var(--muted); font-size: 11px; }

/* Message center tabs */
.notification-tabs { margin-bottom: 16px; }
.notification-tabs .tab { display: inline-flex; align-items: center; gap: 6px; }
.notification-tabs .tab .badge { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; font-size: 10px; line-height: 1; }

/* Topic sorting and comment filters */
.topic-sort { margin-bottom: 12px; }
.comment-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.comment-toolbar .tabs { border-bottom: 0; padding: 0; }
.comment-toolbar .tab { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 0; padding: 6px 11px; }
.comment-toolbar .tab.is-active { border-color: var(--brand-200); background: var(--brand-50); }

/* Chat conversation */
.chat-page { max-width: 920px; margin: 0 auto; }
.chat-panel { display: flex; flex-direction: column; height: min(78vh, 760px); min-height: 520px; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-back { width: 34px; height: 34px; flex: none; }
.chat-peer { display: inline-flex; align-items: center; gap: 9px; min-width: 0; color: var(--ink); }
.chat-peer-name { display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.chat-peer-name strong { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.chat-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; background: linear-gradient(180deg, var(--surface), var(--surface-2)); }
.chat-row { display: flex; align-items: flex-start; gap: 9px; }
.chat-row > .avatar { flex: none; margin-top: 2px; }
.chat-row.is-mine { flex-direction: row-reverse; }
.chat-message { min-width: 0; max-width: min(76%, 560px); display: flex; flex-direction: column; gap: 4px; }
.chat-row.is-mine .chat-message { align-items: flex-end; }
.chat-meta { display: flex; align-items: center; gap: 7px; padding: 0 2px; color: var(--muted); font-size: 11px; }
.chat-meta strong { display: inline-flex; align-items: center; gap: 2px; color: var(--ink-soft); font-size: 11px; }
.chat-bubble { padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; border-start-start-radius: 5px; background: var(--surface); color: var(--ink); font-size: 13.5px; line-height: 1.7; overflow-wrap: anywhere; }
.chat-row.is-mine .chat-bubble { border-color: transparent; border-start-start-radius: 14px; border-start-end-radius: 5px; background: linear-gradient(135deg, var(--brand), var(--brand-600)); color: #fff; }
.chat-composer { padding: 12px 16px 13px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-input-wrap { display: flex; align-items: flex-end; gap: 8px; padding: 7px 7px 7px 12px; border: 1px solid var(--line-strong); border-radius: 15px; background: var(--surface-2); transition: border-color .18s ease, box-shadow .18s ease; }
.chat-input-wrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.chat-input { flex: 1; min-width: 0; min-height: 24px; max-height: 140px; padding: 5px 0; border: 0; outline: 0; resize: none; background: transparent; color: var(--ink); font-size: 13.5px; line-height: 1.6; }
.chat-input::placeholder { color: var(--muted); }
.chat-send { width: 36px; height: 36px; flex: none; border: 0; border-radius: 11px; display: grid; place-items: center; background: var(--brand); color: #fff; cursor: pointer; transition: background .18s ease, transform .18s ease; }
.chat-send:hover { background: var(--brand-600); transform: translateY(-1px); }
.chat-send .icon { width: 17px; height: 17px; }
.chat-send-error { padding: 5px 4px 0; color: var(--danger); font-size: 11.5px; line-height: 1.5; }
.chat-send-error[hidden] { display: none; }
.chat-composer-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 4px 0; color: var(--muted); font-size: 10.5px; }
.chat-enter-hint { margin-inline-start: auto; }
.chat-pagination { padding: 6px 16px; border-top: 1px solid var(--line); }
.chat-pagination .pagination { padding: 0; }
.chat-limit { display: flex; align-items: center; gap: 11px; padding: 16px; border-top: 1px solid var(--line); background: var(--surface-2); color: var(--muted); }
.chat-limit-icon { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--warning-soft); color: var(--warning); }
.chat-limit-icon .icon { width: 18px; height: 18px; }
.chat-limit strong { display: block; color: var(--ink-soft); font-size: 13px; margin-bottom: 2px; }
.chat-limit p { font-size: 12.5px; }
.chat-empty { flex: 1; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--muted); text-align: center; }
.chat-empty .icon { width: 34px; height: 34px; color: var(--brand); }
@media (max-width: 760px) {
    .chat-panel { height: calc(var(--vvh, 100dvh) - 150px); min-height: 240px; }
    .chat-thread { padding: 14px; gap: 13px; }
    .chat-message { max-width: 84%; }
    .chat-composer { padding: 10px 12px 11px; }
    .chat-enter-hint { display: none; }
    .chat-composer-meta { justify-content: flex-start; }
    .vditor-shell .vditor:not(.vditor--fullscreen) {
        height: min(var(--vditor-height, 360px), calc(var(--vvh, 100dvh) - 240px)) !important;
        min-height: 180px;
    }
    .vditor-host {
        min-height: min(var(--vditor-height, 360px), calc(var(--vvh, 100dvh) - 240px));
    }
    .vditor-shell .vditor-toolbar {
        padding: 4px 6px;
    }
    .vditor-shell .vditor-reset { font-size: 14px; line-height: 1.7; }
    .post-draft-bar { align-items: flex-start; }
}

/* Admin tools */
.tools-grid { align-items: stretch; }
.tool-card { display: flex; flex-direction: column; }
.tool-body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 14px 18px 18px; }
.tool-body > p { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.tool-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.tool-actions .btn { align-self: flex-start; }
.tool-mail-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.tool-mail-form .input { flex: 1 1 180px; min-width: 0; }
.tool-mail-form .btn { flex: 0 0 auto; }
