/* ==========================================================================
   轻论坛 · 前台样式（原生 CSS，无框架）
   ========================================================================== */
:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #e8edf5;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-soft: #eef2ff;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --gold: #b45309;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 12px 34px rgba(30, 41, 59, 0.06);
    --shadow-sm: 0 4px 14px rgba(30, 41, 59, 0.05);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.7;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 10px; color: #111827; }
p { margin: 0 0 10px; }
ul, ol { margin: 0; padding: 0; }
code, .mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
}
code { background: #f1f5f9; padding: 2px 6px; border-radius: 5px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.main { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.center { justify-content: center; text-align: center; }
.text-gold { color: var(--gold); }
.text-danger { color: var(--danger); }
.inline-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.stack-form { display: flex; flex-direction: column; gap: 12px; }

/* ---------- 顶部导航 ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: saturate(180%) blur(12px);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 66px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex-shrink: 0; }
.brand:hover { color: var(--text); }
.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16px; }
.brand-text small { font-size: 10px; color: var(--muted); letter-spacing: 1.2px; text-transform: uppercase; }
.header-nav { display: flex; align-items: center; gap: 18px; flex: 1; }
.main-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
    padding: 8px 12px;
    border-radius: 9px;
    color: #4b5563;
    font-weight: 500;
    white-space: nowrap;
}
.main-nav a:hover { background: #f3f4f9; color: var(--text); }
.main-nav a.active { background: var(--primary-soft); color: var(--primary); }

/* ---------- 版块导航条（与下方内容同宽同卡片的整体） ---------- */
.forum-nav {
    background: var(--card);
    border-bottom: 1px solid var(--line);
}
.forum-nav-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding-top: 8px;
    padding-bottom: 8px;
}
.forum-nav-link {
    margin: 5px 0px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: inherit;
    color: #4b5563;
    white-space: nowrap;
}
.forum-nav-link:hover { background: #f3f4f9; color: var(--text); }
.forum-nav-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.header-search {
    position: relative;
    margin-left: auto;
    max-width: 240px;
    flex: 1;
}
.header-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #9ca3af; }
.header-search input {
    width: 100%;
    padding: 8px 12px 8px 33px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fafc;
    outline: none;
    transition: 0.15s;
}
.header-search input:focus { background: #fff; border-color: #c7d2fe; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12); }
.header-user { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: #4b5563; margin: 4px 0; border-radius: 2px; }
.mobile-search { display: none; }
.mobile-actions { display: contents; }
.mobile-quick-links { display: none; }
.mobile-quick-nav { display: none; }
.nav-backdrop { position: fixed; inset: 0; z-index: 49; background: rgba(15, 23, 42, 0.35); }
.nav-backdrop[hidden] { display: none; }

.user-menu { position: relative; }
.user-menu summary {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    list-style: none;
    padding: 4px 6px;
    border-radius: 999px;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: #f3f4f9; }
.user-menu-name { font-weight: 500; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 168px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    padding: 6px;
    z-index: 80;
}
.menu-panel a, .menu-panel button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    border-radius: 8px;
    border: 0;
    background: none;
    color: #374151;
    cursor: pointer;
    font-size: 13px;
}
.menu-panel a:hover, .menu-panel button:hover { background: #f5f7fb; color: var(--primary); }
.menu-panel form { margin: 0; }
.menu-panel .menu-danger { color: var(--danger); }
.menu { position: relative; }
.menu > summary { cursor: pointer; list-style: none; display: inline-flex; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel-right { right: 0; left: auto; }
.menu-panel form button.danger, .menu-panel .danger { color: var(--danger); }
.menu-move { display: flex; gap: 6px; padding: 6px; }
.menu-move select { flex: 1; padding: 6px; border: 1px solid var(--line); border-radius: 7px; }
.menu-views { display: flex; gap: 6px; padding: 6px; }
.menu-views input { width: 88px; padding: 6px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: #eef1f7;
    color: #374151;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.16s ease;
    white-space: nowrap;
    line-height: 1.4;
}
.btn:hover { filter: brightness(0.98); color: #111827; }
.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    color: #fff;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.22);
}
.btn-primary:hover { color: #fff; filter: brightness(1.05); }
.btn-ghost { background: #fff; border-color: var(--line); color: #4b5563; }
.btn-ghost:hover { border-color: #c7d2fe; color: var(--primary); }
.btn-danger { background: #fef2f2; color: var(--danger); border-color: #fee2e2; }
.btn-disabled, .btn:disabled { background: #e5e7eb; color: #9ca3af; cursor: not-allowed; box-shadow: none; }
.btn-link { background: none; border: 0; color: var(--muted); padding: 4px 6px; font-weight: 500; }
.btn-link:hover { color: var(--primary); }
.btn-link.danger { color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-xs { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn-block { display: flex; width: 100%; }
.btn.active { border-color: #c7d2fe; color: var(--primary); background: var(--primary-soft); }

/* ---------- 卡片与分区 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.section { padding: 20px; margin-bottom: 18px; }
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.section-head h2 { font-size: 17px; margin: 0; display: flex; align-items: center; gap: 8px; }
.section-head h2 .muted { font-size: 13px; font-weight: 400; }
.section-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.link-more { font-size: 13px; color: var(--muted); }
.link-more:hover { color: var(--primary); }
.link-more.center { display: block; text-align: center; margin-top: 10px; }
.empty-state { padding: 38px 16px; text-align: center; color: var(--muted); }
.empty-state a { font-weight: 600; }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; overflow: hidden; }

/* ---------- 徽章 ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.7;
    border: 1px solid transparent;
    white-space: nowrap;
}
.badge-global { background: #fef3c7; color: #92400e; }
.badge-top { background: #e0f2fe; color: #0369a1; }
.badge-essence { background: #fce7f3; color: #be185d; }
.badge-hot { background: #ffedd5; color: #c2410c; }
.badge-type { background: #f8fafc; border-color: #e2e8f0; }
.badge-group { background: var(--primary-soft); color: var(--primary); }
.badge-mutual { background: #ecfdf5; color: #047857; }
.badge-soft { background: #eef2ff; color: var(--primary); }
.badge-muted { background: #f1f5f9; color: #64748b; }
.badge-danger { background: #fef2f2; color: var(--danger); }
.badge-ok { background: #ecfdf5; color: var(--success); }

/* ---------- 提示 ---------- */
.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    border: 1px solid transparent;
    transition: opacity 0.3s, transform 0.3s;
}
.flash.is-hiding { opacity: 0; transform: translateY(-4px); }
.flash-success { background: #ecfdf5; border-color: #d1fae5; color: #047857; }
.flash-error { background: #fef2f2; border-color: #fee2e2; color: #b91c1c; }
.flash-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.flash-info { background: #eff6ff; border-color: #dbeafe; color: #1d4ed8; }
.flash-close { background: none; border: 0; font-size: 18px; line-height: 1; color: currentColor; opacity: 0.6; cursor: pointer; }
.flash-close:hover { opacity: 1; }
.alert { padding: 13px 16px; border-radius: 12px; border: 1px solid transparent; font-size: 13px; line-height: 1.7; margin-bottom: 16px; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert-error { background: #fef2f2; border-color: #fee2e2; color: #b91c1c; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-success { background: #ecfdf5; border-color: #d1fae5; color: #047857; }
.alert-info { background: #eff6ff; border-color: #dbeafe; color: #1d4ed8; }
.notice-inline { display: inline-block; padding: 8px 14px; border-radius: 10px; background: #fef2f2; color: #b91c1c; font-size: 13px; }

/* ---------- 首页 ---------- */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 10px 24px;
    margin-bottom: 20px;
    background:
        radial-gradient(800px 300px at 90% -20%, rgba(14, 165, 233, 0.18), transparent 60%),
        radial-gradient(700px 280px at 0% 0%, rgba(79, 70, 229, 0.16), transparent 55%),
        #fff;
    overflow: hidden;
    position: relative;
}
.eyebrow { font-size: 12px; letter-spacing: 2px; color: var(--primary); font-weight: 700; text-transform: uppercase; margin-bottom: 6px; }
.hero-notice { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.hero-notice-label {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
}
.hero-notice-text { margin: 0; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-stats { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.hero-stats div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 88px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    text-align: center;
    backdrop-filter: blur(6px);
    white-space: nowrap;
}
.hero-stats strong { font-size: 14px; color: #111827; line-height: 1.3; }
.hero-stats span { font-size: 14px; color: var(--muted); }

.layout-2col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.no-sidebar .col-side { display: none; }
.no-sidebar .layout-2col,
.no-sidebar .topic-layout { grid-template-columns: minmax(0, 1fr); }
.col-main { min-width: 0; }
.col-side { display: flex; flex-direction: column; gap: 16px; }
.side-card { padding: 18px; }
.side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.side-head h3 { font-size: 15px; margin: 0; }
.stat-list { display: flex; flex-direction: column; gap: 8px; }
.stat-list > div { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 3px 0; }
.stat-list strong { color: #111827; font-size: 13px; }
.stat-list.compact { gap: 4px; }

/* ---------- 版块图标 ---------- */
.forum-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #eef2ff, #e0f2fe);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
    object-fit: cover;
    border: 1px solid rgba(199, 210, 254, 0.6);
}
.forum-icon-lg { width: 58px; height: 58px; border-radius: 18px; font-size: 22px; }
.forum-icon-sm { width: 30px; height: 30px; border-radius: 9px; font-size: 13px; }
.forum-icon-xs { width: 22px; height: 22px; border-radius: 7px; font-size: 11px; }

/* ---------- 主题列表 ---------- */
.topic-list { display: flex; flex-direction: column; }
.topic-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid #f1f5f9;
}
.topic-row:last-child { border-bottom: 0; }
.topic-row:hover { background: #fbfcfe; }
.topic-row-main { display: contents; }
.topic-headline {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.topic-badges { display: flex; gap: 5px; flex-wrap: nowrap; }
.topic-row .topic-badges:empty { display: none; }
.topic-title { display: block; flex: 0 1 auto; min-width: 0; font-size: 15px; font-weight: 600; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-title:hover { color: var(--primary); }
.topic-meta { grid-column: 1; display: flex; gap: 5px; align-items: center; flex-wrap: nowrap; min-width: 0; overflow: hidden; white-space: nowrap; color: var(--muted); font-size: 12px; margin-top: 0; }
.topic-meta a { color: #4b5563; }
.topic-meta a:hover { color: var(--primary); }
.topic-stats { grid-column: 2; display: flex; gap: 12px; font-size: 12px; color: var(--muted); justify-content: flex-end; white-space: nowrap; }
.topic-stats b { color: #374151; }
.topic-last { display: none; }
.sticky-list { background: #fbfcfe; border-radius: 12px; padding: 0; margin-bottom: 6px; }

/* ---------- 单页 ---------- */
.page-title { font-size: 25px; margin-bottom: 14px; }
.page-body { color: #374151; font-size: 15px; line-height: 1.85; }
.page-body > * + * { margin-top: 12px; }
.page-body h2 { font-size: 19px; margin-top: 22px; }
.page-body h3 { font-size: 16px; margin-top: 18px; }
.page-body ul,
.page-body ol { padding-left: 22px; }
.page-body ul { list-style: disc; }
.page-body ol { list-style: decimal; }
.page-body a { color: var(--primary); }
.page-body img { max-width: 100%; height: auto; border-radius: 10px; }
.page-body blockquote { border-left: 3px solid var(--line); padding-left: 12px; color: var(--muted); }

/* ---------- 版块页 ---------- */
.breadcrumb { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.forum-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 4px 10px;
    padding: 20px;
    margin-bottom: 14px;
}
.forum-header-main { display: contents; }
.forum-header-main > div { display: contents; }
.forum-header-main > .forum-icon { grid-column: 1; grid-row: 1 / span 2; }
.forum-header h1 {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.forum-header-actions { grid-column: 3; grid-row: 1; justify-self: end; }
.forum-header .muted {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.forum-header-meta {
    grid-column: 3;
    grid-row: 2;
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    flex-wrap: nowrap;
    margin: 0;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}
.subforum-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.subforum-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px 6px 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #374151;
    font-size: 13px;
    box-shadow: var(--shadow-sm);
}
.subforum-chip:hover { border-color: #c7d2fe; color: var(--primary); }
.subforum-chip.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.subforum-chip small { color: var(--muted); font-size: 11px; }
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #f1f5f9; }
.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-tabs a { padding: 6px 12px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 500; }
.filter-tabs a:hover { background: #f3f4f9; color: #374151; }
.filter-tabs a.active { background: var(--primary-soft); color: var(--primary); }
.type-tabs a.active { background: color-mix(in srgb, var(--type-color, #4f46e5) 12%, white); color: var(--type-color, #4f46e5); }

/* ---------- 帖子详情 ---------- */
.topic-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.topic-main { min-width: 0; }
.topic-detail { padding: 26px; margin-bottom: 18px; }
.topic-head { border-bottom: 1px solid #f1f5f9; padding-bottom: 16px; margin-bottom: 20px; }
.topic-head h1 { font-size: 25px; letter-spacing: -0.3px; margin: 8px 0 12px; }
.topic-head-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.topic-head-meta a { color: #4b5563; }
.topic-content { font-size: 15px; line-height: 1.9; }
.rich-content { word-wrap: break-word; overflow-wrap: break-word; }
.rich-content p { margin: 0 0 1em; }
.rich-content img { max-width: 100%; height: auto; border-radius: 10px; margin: 8px 0; cursor: zoom-in; }
.rich-content blockquote { margin: 12px 0; padding: 8px 16px; border-left: 3px solid #c7d2fe; background: #f8fafc; color: #4b5563; border-radius: 0 8px 8px 0; }
.rich-content pre { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 10px; overflow: auto; font-size: 13px; }
.rich-content code { background: #f1f5f9; color: #be123c; }
.rich-content pre code { background: none; color: inherit; }
.rich-content ul, .rich-content ol { padding-left: 24px; margin: 0 0 1em; }
.rich-content h1, .rich-content h2, .rich-content h3 { margin: 1.2em 0 0.6em; }
.rich-content table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.rich-content th, .rich-content td { border: 1px solid var(--line); padding: 8px 10px; }
.content-pages { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); }
.content-pages a { min-width: 30px; height: 30px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; color: #4b5563; }
.content-pages a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.attachments { margin-top: 20px; padding: 14px 16px; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; }
.attachments h4 { font-size: 13px; margin-bottom: 8px; }
.attachments li { list-style: none; padding: 4px 0; }
.attachments a { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.topic-footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; padding-top: 16px; border-top: 1px solid #f1f5f9; }

/* 点赞 */
.btn-like { background: #f8fafc; border: 1px solid var(--line); color: #64748b; }
.btn-like .like-icon { font-size: 15px; color: #cbd5e1; transition: 0.15s; }
.btn-like.is-liked { background: #fff1f2; border-color: #fecdd3; color: #e11d48; }
.btn-like.is-liked .like-icon { color: #e11d48; transform: scale(1.08); }
.btn-like .like-count { font-weight: 700; }
.btn-like .like-label { font-size: 12px; }
.btn-like:disabled { opacity: 0.7; }

/* 回复 */
.reply-list { display: flex; flex-direction: column; }
.reply-row { display: flex; gap: 12px; padding: 18px 0; border-bottom: 1px solid #f1f5f9; }
.reply-row:last-child { border-bottom: 0; }
.reply-row.is-pinned { background: #fbfcfe; border-radius: 12px; padding: 18px 14px; margin-bottom: 6px; border: 1px dashed #dbeafe; }
.reply-avatar { flex-shrink: 0; }
.reply-body { min-width: 0; flex: 1; }
.reply-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.reply-author { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13px; }
.reply-author a { font-weight: 600; color: #374151; }
.reply-head time { font-size: 12px; }
.reply-actions { display: flex; align-items: center; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.reply-actions .btn-like { padding: 3px 9px; font-size: 12px; border-radius: 7px; }
.reply-actions .btn-link { font-size: 12px; }
.quote-block { margin: 6px 0 10px; padding: 8px 12px; background: #f8fafc; border-left: 3px solid #c7d2fe; border-radius: 0 8px 8px 0; font-size: 12px; color: #6b7280; }
.quote-block p { margin: 3px 0 0; }
.quote-hint { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 8px 12px; background: var(--primary-soft); color: var(--primary); border-radius: 9px; font-size: 12px; }

/* 作者侧栏 */
.author-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.author-name { font-weight: 700; font-size: 15px; color: #111827; display: block; }
.forum-side-link { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 10px; color: #374151; font-weight: 600; }
.forum-side-link:hover { background: #f8fafc; color: var(--primary); }

/* ---------- 头像 ---------- */
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: #eef2ff; flex-shrink: 0; }
.avatar-sm { width: 28px; height: 28px; }
.avatar-xs { width: 22px; height: 22px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 96px; height: 96px; }
.author-card .avatar-lg { border: 3px solid #fff; box-shadow: 0 4px 14px rgba(30, 41, 59, 0.12); }

/* ---------- 表单 / 编辑器 ---------- */
.field { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.field > span { font-weight: 600; color: #475569; }
.field em { color: var(--danger); font-style: normal; }
.field input[type="text"],
.field input[type="password"],
.field input[type="email"],
.field input[type="number"],
.field input[type="search"],
.field input[type="datetime-local"],
.field input[type="color"],
.field select,
.field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    background: #fbfdff;
    outline: none;
    transition: 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: #a5b4fc;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    background: #fff;
}
.field input:disabled { background: #f3f4f6; color: #9ca3af; }
.field textarea { resize: vertical; min-height: 100px; line-height: 1.7; }
.field small { color: var(--muted); font-size: 12px; }
.form-row { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.form-row-between { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #4b5563; cursor: pointer; }
.checkbox-row { display: flex; gap: 20px; flex-wrap: wrap; margin: 16px 0; }
.file-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.file-field > span { font-weight: 600; color: #475569; }
.file-field input[type="file"] { font-size: 12px; color: var(--muted); }
.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-row input { flex: 1; }
.captcha-row img { height: 42px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; background: #f3f5fb; }

/* 富文本编辑器 */
.editor { border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; background: #fff; }
.editor:focus-within { border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }
.editor-toolbar { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 7px 8px; background: #f8fafc; border-bottom: 1px solid var(--line); }
.editor-toolbar button {
    min-width: 30px;
    height: 29px;
    padding: 0 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #4b5563;
    font-size: 12px;
    cursor: pointer;
}
.editor-toolbar button:hover { background: #eef2ff; color: var(--primary); }
.editor-surface {
    min-height: 150px;
    max-height: 460px;
    overflow: auto;
    padding: 14px 16px;
    outline: none;
    line-height: 1.85;
    font-size: 14px;
}
.editor-surface-lg { min-height: 320px; }
.editor-surface:empty::before { content: attr(data-placeholder); color: #9ca3af; pointer-events: none; }
.editor-surface img { max-width: 100%; border-radius: 8px; }
.editor-surface blockquote { border-left: 3px solid #c7d2fe; margin: 8px 0; padding: 4px 12px; color: #6b7280; background: #f8fafc; }
.editor-surface pre { background: #0f172a; color: #e2e8f0; padding: 10px 12px; border-radius: 8px; overflow: auto; }
.editor-color-btn { display: inline-flex; align-items: center; gap: 5px; }
.editor-size {
    height: 29px;
    padding: 0 4px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: #4b5563;
    font-size: 12px;
    cursor: pointer;
}
.editor-menu {
    position: fixed;
    z-index: 95;
    min-width: 128px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
}
.editor-menu[hidden] { display: none; }
.editor-menu button {
    display: block;
    width: 100%;
    padding: 7px 10px;
    border: 0;
    border-radius: 7px;
    background: none;
    color: #374151;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.editor-menu button:hover { background: #f5f7fb; color: var(--primary); }
.editor-surface table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.editor-surface th, .editor-surface td { border: 1px solid #dbe3ee; padding: 8px 10px; min-width: 40px; }
.editor-surface th { background: #f8fafc; text-align: left; }

/* 付费块改价提示 */
.pay-editor-hint { margin-left: auto; color: #9ca3af; font-size: 11px; }

/* 本地草稿提示条 */
.editor-draft {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    padding: 8px 12px;
    border: 1px dashed #c7d2fe;
    border-radius: 10px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 12px;
}
.editor-draft .btn { padding: 2px 8px; font-size: 12px; border-radius: 6px; }

/* 图片弹窗预览 */
.img-dialog-preview {
    display: flex;
    justify-content: center;
    padding: 2px 0;
}
.img-dialog-preview[hidden] { display: none; }
.img-dialog-preview img {
    max-width: 100%;
    max-height: 160px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

/* 购买确认弹窗 */
.pay-confirm-mask {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.45);
}
.pay-confirm-mask[hidden] { display: none; }
.pay-confirm {
    width: 100%;
    max-width: 360px;
    padding: 18px 18px 16px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
}
.pay-confirm h3 { margin: 0 0 10px; font-size: 16px; }
.pay-confirm-text { margin: 0 0 8px; color: #374151; line-height: 1.6; }
.pay-confirm-text strong { color: var(--primary); }
.pay-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

@media (max-width: 640px) {
    .editor-toolbar button { min-height: 32px; padding: 6px 10px; }
    .rich-content table { display: block; overflow-x: auto; }
}

/* 图片插入对话框 */
.img-dialog-mask {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.4);
}
.img-dialog-mask[hidden] { display: none; }
.img-dialog {
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow: auto;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}
.img-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 8px;
}
.img-dialog-head strong { font-size: 15px; color: #111827; }
.img-dialog-x {
    padding: 0 2px;
    border: 0;
    background: none;
    color: #6b7280;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.img-dialog-x:hover { color: var(--danger); }
.img-dialog-tabs {
    display: flex;
    gap: 4px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
}
.img-dialog-tabs button {
    margin-bottom: -1px;
    padding: 8px 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: #4b5563;
    font-size: 13px;
    cursor: pointer;
}
.img-dialog-tabs button.is-active {
    border-bottom-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}
.img-dialog-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
}
.img-dialog-field {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #374151;
}
.img-dialog-field > span:first-child {
    min-width: 64px;
    color: #6b7280;
}
.img-dialog-field input[type="url"],
.img-dialog-field input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: none;
}
.img-dialog-field input[type="url"]:focus,
.img-dialog-field input[type="text"]:focus {
    border-color: #c7d2fe;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.img-dialog-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.img-dialog-inline input[type="number"] {
    width: 78px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: none;
}
.img-dialog-align {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.img-dialog-align-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    cursor: pointer;
}
.img-dialog-file { margin: 0; }
.dlg-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #4b5563;
}
.dlg-field input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: none;
}
.dlg-field input:focus {
    border-color: #c7d2fe;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.img-dialog-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 16px 16px;
}
.editor-color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 3px;
    background: #dc2626;
}
.color-palette {
    position: fixed;
    z-index: 95;
    width: 178px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
}
.color-palette[hidden] { display: none; }
.color-palette-title {
    display: block;
    width: 100%;
    margin: 0 0 7px;
    padding: 3px 0;
    border: 0;
    border-radius: 6px;
    background: none;
    color: #4b5563;
    font-size: 12px;
    text-align: center;
    cursor: pointer;
}
.color-palette-title:hover { background: #f5f7fb; color: var(--primary); }
.color-palette-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.color-swatch {
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 3px;
    cursor: pointer;
}
.color-swatch:hover { outline: 2px solid var(--primary); outline-offset: 1px; }
.editor-toolbar button.is-active {
    background: #d6e0ff;
    color: var(--primary-dark);
    box-shadow: inset 0 0 0 1px #b4c4ff;
}
.editor-source {
    display: block;
    width: 100%;
    min-height: 320px;
    max-height: 460px;
    padding: 14px 16px;
    border: 0;
    outline: none;
    resize: vertical;
    background: #fff;
    color: #334155;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    line-height: 1.7;
}
.editor-source[hidden],
.editor-surface[hidden] { display: none; }

/* 付费隐藏内容 */
.pay-editor-card {
    margin: 12px 0;
    padding: 10px 12px;
    border: 1px dashed #a5b4fc;
    border-radius: 10px;
    background: #f8faff;
}
.pay-editor-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 12px;
    color: #4b5563;
}
.pay-editor-head strong { color: var(--primary); }
.pay-editor-head input {
    width: 72px;
    padding: 3px 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 12px;
}
.pay-editor-head button {
    padding: 2px 8px;
    border: 0;
    border-radius: 6px;
    background: #fee2e2;
    color: var(--danger);
    font-size: 12px;
    cursor: pointer;
}
.pay-editor-body {
    min-height: 64px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    outline: none;
    line-height: 1.8;
}
.pay-editor-body:empty::before { content: "填写付费隐藏内容…"; color: #9ca3af; }
.pay-block.pay-locked {
    margin: 14px 0;
    padding: 18px 16px;
    border: 1px dashed #c7d2fe;
    border-radius: 12px;
    background: #f8faff;
    text-align: center;
}
.pay-lock p { margin: 0 0 10px; color: #4b5563; }
.pay-lock strong { color: var(--primary); font-size: 16px; }
.pay-block.pay-unlocked {
    margin: 14px 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--primary);
    border-radius: 10px;
    background: #fff;
}
.pay-note {
    display: inline-block;
    margin-bottom: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
}
.pay-block.pay-unlocked .pay-body > :last-child { margin-bottom: 0; }

/* ---------- 登录 / 注册 ---------- */
.auth-wrap { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 22px; max-width: 900px; margin: 24px auto; align-items: stretch; }
.auth-card { padding: 30px; }
.auth-card-wide { max-width: 520px; }
.auth-head h1 { font-size: 23px; margin-bottom: 6px; }
.auth-head { margin-bottom: 18px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid #f1f5f9; text-align: center; font-size: 13px; color: var(--muted); }
.auth-side {
    padding: 34px;
    border-radius: var(--radius);
    background:
        radial-gradient(500px 200px at 100% 0%, rgba(14, 165, 233, 0.25), transparent 60%),
        linear-gradient(150deg, #4f46e5, #4338ca 60%, #312e81);
    color: #e0e7ff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-side h2 { color: #fff; font-size: 24px; }
.auth-side p { color: #c7d2fe; }
.auth-side ul { margin-top: 16px; padding-left: 18px; font-size: 13px; }
.auth-side li { margin-bottom: 8px; }

/* ---------- 用户主页 ---------- */
.profile-card { overflow: hidden; margin-bottom: 18px; }
.profile-cover { height: 96px; background: radial-gradient(600px 200px at 20% 0%, rgba(14, 165, 233, 0.35), transparent 60%), linear-gradient(135deg, #4f46e5, #1d4ed8); }
.profile-body { display: flex; gap: 18px; align-items: flex-start; padding: 0 24px 18px; margin-top: -40px; flex-wrap: wrap; }
.profile-avatar { border: 4px solid #fff; box-shadow: 0 8px 20px rgba(30, 41, 59, 0.16); }
.profile-main { flex: 1; min-width: 220px; padding-top: 42px; }
.profile-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-name h1 { font-size: 22px; margin: 0; }
.profile-signature { margin: 4px 0; color: #4b5563; }
.profile-bio { color: var(--muted); font-size: 13px; }
.profile-actions { display: flex; gap: 8px; padding-top: 48px; flex-wrap: wrap; }
.profile-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid #f1f5f9; }
.profile-stats > div, .profile-stats > a { padding: 12px; text-align: center; color: var(--muted); border-right: 1px solid #f1f5f9; display: flex; flex-direction: column; }
.profile-stats > *:last-child { border-right: 0; }
.profile-stats strong { color: #111827; font-size: 16px; }
.profile-stats span { font-size: 11px; }
.profile-stats a:hover { background: #f8fafc; color: var(--primary); }

.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.user-card { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; align-items: center; }
.user-card-main { display: flex; flex-direction: column; min-width: 0; }
.user-card-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 600; }
.user-card small { display: block; }
.user-list { display: flex; flex-direction: column; gap: 10px; }
.user-list li { display: flex; gap: 9px; align-items: center; list-style: none; }
.user-list small { display: block; color: var(--muted); font-size: 11px; }
.relation-links { display: flex; gap: 10px; }
.relation-links a { flex: 1; text-align: center; padding: 10px; border-radius: 10px; background: #f8fafc; font-size: 13px; }
.relation-links a:hover { background: var(--primary-soft); }
.simple-list { display: flex; flex-direction: column; gap: 12px; }
.simple-list li { list-style: none; padding-bottom: 12px; border-bottom: 1px dashed #f1f5f9; }
.simple-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.simple-list p { margin: 3px 0; font-size: 12px; }
.simple-list time { font-size: 11px; }

/* ---------- 设置 ---------- */
.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { padding: 10px; display: flex; flex-direction: column; gap: 3px; position: sticky; top: 86px; }
.settings-nav a { padding: 9px 12px; border-radius: 9px; color: #4b5563; font-size: 13px; font-weight: 500; }
.settings-nav a:hover { background: #f8fafc; }
.settings-nav a.active { background: var(--primary-soft); color: var(--primary); }
.settings-main .section { margin-bottom: 16px; }
.avatar-editor { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }

/* ---------- 搜索 / 排行 ---------- */
.search-head { }
.search-form { display: flex; gap: 10px; }
.search-form input { flex: 1; padding: 11px 16px; border: 1px solid #e2e8f0; border-radius: 11px; background: #fbfdff; outline: none; }
.search-form input:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12); background: #fff; }
.search-filter { margin-top: 14px; margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.search-results { display: flex; flex-direction: column; }
.search-item { padding: 16px 4px; border-bottom: 1px solid #f1f5f9; }
.search-item:last-child { border-bottom: 0; }
.search-item h3 { font-size: 16px; margin-bottom: 4px; }
.search-item h3 a { color: #1f2937; }
.search-item h3 a:hover { color: var(--primary); }
.search-snippet { color: #4b5563; font-size: 13px; line-height: 1.75; margin-bottom: 6px; }
.search-meta { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
mark { background: #fef08a; color: inherit; padding: 0 2px; border-radius: 3px; }

.rank-type-tabs { margin-bottom: 6px; }
.period-tabs { margin-bottom: 16px; }
.period-tabs a { font-size: 12px; padding: 5px 11px; border: 1px solid var(--line); background: #fff; }
.period-tabs a.active { border-color: #c7d2fe; }
.rank-table td { vertical-align: middle; }
.rank-medal { display: inline-flex; width: 27px; height: 27px; align-items: center; justify-content: center; border-radius: 9px; font-weight: 700; font-size: 12px; background: #f1f5f9; color: #64748b; }
.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.rank-2 { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; }
.rank-3 { background: linear-gradient(135deg, #fdba74, #fb923c); color: #fff; }
.rank-user { display: flex; align-items: center; gap: 9px; }
.rank-value { font-size: 15px; color: var(--primary); }
.rank-list { display: flex; flex-direction: column; gap: 7px; }
.rank-list li { display: flex; align-items: center; gap: 8px; list-style: none; font-size: 13px; min-width: 0; }
.rank-list a { color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list a:hover { color: var(--primary); }
.rank-index { width: 20px; height: 20px; border-radius: 6px; background: #f1f5f9; color: #64748b; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 700; }
.rank-index.top { background: #eef2ff; color: var(--primary); }
.rank-val { margin-left: auto; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.rank-list.compact li { font-size: 13px; }

/* ---------- 签到 ---------- */
.checkin-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 30px;
    margin-bottom: 18px;
    background:
        radial-gradient(500px 220px at 100% 0%, rgba(251, 191, 36, 0.18), transparent 60%),
        #fff;
}
.checkin-hero h1 { font-size: 26px; }
.checkin-hero-main .btn { margin-top: 8px; }
.checkin-hero-side { display: flex; gap: 14px; }
.checkin-hero-side > div { background: #fffbeb; border: 1px solid #fde68a; border-radius: 14px; padding: 14px 18px; text-align: center; min-width: 120px; }
.checkin-hero-side span { display: block; font-size: 11px; color: var(--muted); }
.checkin-hero-side strong { font-size: 20px; color: var(--gold); }
.checkin-mini { display: flex; gap: 10px; margin-bottom: 12px; }
.checkin-mini > div { flex: 1; background: #f8fafc; border-radius: 10px; padding: 10px; text-align: center; }
.checkin-label { display: block; font-size: 11px; color: var(--muted); }
.checkin-mini strong { font-size: 16px; }
.rule-list { padding-left: 18px; font-size: 13px; color: #4b5563; }
.rule-list li { margin-bottom: 7px; }

/* ---------- 表格 ---------- */
.table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: auto; background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 11px 13px; text-align: left; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table th { background: #f8fafc; color: #64748b; font-size: 12px; font-weight: 600; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbfcfe; }
.table-compact th, .table-compact td { padding: 8px 10px; }

/* ---------- 分页 / 其他 ---------- */
.pager { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.site-footer { border-top: 1px solid var(--line); background: #fff; padding: 22px 0; margin-top: 10px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.footer-links { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--primary); }
.error-card { max-width: 560px; margin: 40px auto; text-align: center; padding: 44px 30px; }
.error-code { font-size: 58px; font-weight: 800; color: #c7d2fe; line-height: 1; margin-bottom: 8px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
    .layout-2col { grid-template-columns: minmax(0, 1fr) 280px; }
    .topic-layout { grid-template-columns: minmax(0, 1fr) 270px; }
}
@media (max-width: 900px) {
    .header-inner { position: relative; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
    .mobile-search {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        margin-left: auto;
        border-radius: 10px;
        color: #4b5563;
    }
    .mobile-search:hover { background: #f3f4f9; color: var(--text); }
    .mobile-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
    .mobile-search { margin-left: 0; }
    .mobile-quick-links { display: flex; align-items: center; gap: 2px; max-width: 46vw; overflow: hidden; }
    .mobile-quick-nav {
        display: inline-flex;
        align-items: center;
        height: 38px;
        padding: 0 7px;
        border-radius: 10px;
        color: #4b5563;
        font-size: 13px;
        white-space: nowrap;
    }
    .mobile-quick-nav:hover { background: #f3f4f9; color: var(--text); }
    .nav-toggle { display: block; margin-left: 0; }
    .header-nav {
        display: none;
        position: absolute;
        top: calc(100% + 2px);
        right: 20px;
        z-index: 60;
        width: min(200px, calc(100vw - 40px));
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px;
        background: var(--card);
        border: 1px solid var(--line);
        border-radius: 14px;
        box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
    }
    .header-nav.open { display: flex; }
    body.nav-open { overflow: hidden; }
    .header-search { display: none; }
    .header-user { display: flex; justify-content: stretch; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
    .header-user > .btn { flex: 1; justify-content: center; }
    .user-menu { width: 100%; }
    .user-menu > summary { width: 100%; justify-content: flex-start; padding: 6px 10px; }
    .user-menu .menu-panel {
        position: static;
        top: auto;
        right: auto;
        width: 100%;
        min-width: 0;
        margin-top: 6px;
        background: #f8fafc;
        box-shadow: none;
    }
    .main-nav {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
        overflow: visible;
    }
    .main-nav a {
        padding: 9px 8px;
        text-align: center;
        background: #f8fafc;
    }
    .main-nav a.active { background: var(--primary-soft); }
    .layout-2col, .topic-layout { grid-template-columns: minmax(0, 1fr); }
    .col-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
    .auth-wrap { grid-template-columns: minmax(0, 1fr); }
    .auth-side { order: -1; min-height: 180px; }
    .hero { flex-wrap: wrap; gap: 12px; }
    .hero-stats { width: 100%; justify-content: space-between; }
    .settings-layout { grid-template-columns: minmax(0, 1fr); }
    .settings-nav { position: static; flex-direction: row; overflow: auto; }
    .profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .container { padding: 0 14px; }
    .header-nav { right: 14px; width: min(200px, calc(100vw - 28px)); }
    .main > .card,
    .layout-2col .card,
    .topic-layout .card,
    .tuku-app .card {
        margin-left: -14px;
        margin-right: -14px;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
    .main { padding-top: 10px; }
    .hero,
    .section,
    .forum-header,
    .breadcrumb,
    .topic-detail,
    .profile-card,
    .flash-stack,
    .subforum-row,
    .period-tabs,
    .filter-bar,
    .checkin-hero { margin-bottom: 10px; }
    .settings-main .section { margin-bottom: 10px; }
    .pager { margin-top: 10px; }
    .layout-2col,
    .topic-layout,
    .settings-layout,
    .col-side { gap: 10px; }
    .auth-wrap { margin: 10px auto; }
    .hero { padding: 8px 16px; }
    .hero-notice-text { font-size: 13px; }
    .hero-stats div { flex: 1 1 0; min-width: 0; padding: 6px 8px; }
    .section { padding: 16px; }
    .topic-row-main { display: contents; }
    .topic-headline {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
    }
    .topic-meta { grid-column: 1; margin-top: 0; flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
    .topic-stats { grid-column: 2; justify-content: flex-end; white-space: nowrap; }
    .forum-header {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 16px 14px;
        gap: 4px 10px;
    }
    .forum-header-main > .forum-icon { display: none; }
    .forum-header h1 { grid-column: 1; grid-row: 1; font-size: 18px; }
    .forum-header-actions { grid-column: 2; grid-row: 1; }
    .forum-header .muted { grid-column: 1; grid-row: 2; font-size: 12px; }
    .forum-header-meta { grid-column: 2; grid-row: 2; gap: 10px; }
    .profile-actions { padding-top: 0; }
    .profile-main { padding-top: 0; }
    .profile-body { margin-top: -30px; }
    .topic-detail { padding: 18px; }
    .topic-head h1 { font-size: 21px; }
    .checkin-hero { flex-direction: column; align-items: flex-start; }
    .checkin-hero-side { width: 100%; }
    .checkin-hero-side > div { flex: 1; }
    .section-head { align-items: flex-start; }
    .filter-bar { align-items: flex-start; }
    .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .reply-row { gap: 9px; }
    .avatar-lg { width: 52px; height: 52px; }
    .avatar-xl { width: 76px; height: 76px; }
}

/* ---------- 轻提示 ---------- */
.toast-stack {
    position: fixed;
    top: 78px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
    width: max-content;
    max-width: 92vw;
}
.toast {
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.92);
    color: #fff;
    font-size: 13px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.22);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast-error { background: rgba(185, 28, 28, 0.94); }
.toast-success { background: rgba(4, 120, 87, 0.94); }

/* 移动端表单字号不小于 16px，避免 iOS 聚焦输入框时自动放大页面 */
@media (max-width: 900px) {
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* 移动端导航条上下间隙 6px、字号 16px（避免被 .container 的 padding 覆盖） */
@media (max-width: 640px) {
    .forum-nav .forum-nav-inner {
        padding-top: 6px;
        padding-bottom: 6px;
    }
    .forum-nav .forum-nav-link {
        font-size: 16px;
    }
}

/* ---------- 图片灯箱 ---------- */
body.lightbox-open { overflow: hidden; }
.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: rgba(9, 12, 20, 0.92);
    overscroll-behavior: contain;
    touch-action: none;
}
.image-lightbox[hidden] { display: none; }
.image-lightbox-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 70px;
    overflow: hidden;
    touch-action: none;
}
.image-lightbox-status {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    color: #cbd5e1;
    font-size: 14px;
    text-align: center;
    pointer-events: none;
}
.image-lightbox-status[hidden] { display: none; }
.image-lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.18s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    will-change: transform;
}
.image-lightbox-img.is-ready { opacity: 1; }
.image-lightbox-img.is-zoomed { cursor: grab; }
.image-lightbox-img.is-dragging { cursor: grabbing; }
.image-lightbox-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s;
}
.image-lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }
.image-lightbox-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.image-lightbox-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
    font-size: 13px;
    line-height: 1.4;
}
.image-lightbox-counter[hidden] { display: none; }
.image-lightbox-nav {
    position: absolute;
    top: 50%;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 0.15s;
}
.image-lightbox-nav:hover { background: rgba(255, 255, 255, 0.28); }
.image-lightbox-nav[hidden] { display: none; }
.image-lightbox-prev { left: 14px; }
.image-lightbox-next { right: 14px; }
.image-lightbox-zoom {
    position: absolute;
    left: 50%;
    bottom: 16px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #e2e8f0;
    transform: translateX(-50%);
}
.image-lightbox-zoom button {
    padding: 4px 11px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s;
}
.image-lightbox-zoom button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.28); }
.image-lightbox-zoom button:disabled { opacity: 0.4; cursor: default; }
.image-lightbox-zoom-value { min-width: 42px; text-align: center; font-size: 12px; }

@media (max-width: 640px) {
    .image-lightbox-stage { padding: 58px 12px; }
    .image-lightbox-close { top: 10px; right: 10px; width: 36px; height: 36px; font-size: 22px; }
    .image-lightbox-counter { top: 16px; left: 12px; font-size: 12px; }
    .image-lightbox-nav { width: 38px; height: 38px; font-size: 22px; }
    .image-lightbox-prev { left: 8px; }
    .image-lightbox-next { right: 8px; }
    .image-lightbox-zoom { bottom: 12px; padding: 4px 6px; }
    .image-lightbox-zoom button { padding: 4px 8px; font-size: 11px; }
}
