/* ==========================================================================
   通印象 lt — 主样式
   纸张、墨色与朱砂，克制而有温度的编辑设计。
   ========================================================================== */

:root {
    --paper: #f6f2e9;
    --paper-deep: #eee7d9;
    --surface: #fffdf8;
    --surface-2: #fbf7ef;
    --ink: #17212b;
    --ink-2: #2b3743;
    --muted: #68737e;
    --faint: #98a0a8;
    --line: #e3dbcd;
    --line-strong: #cec3b1;
    --accent: #c54b32;
    --accent-dark: #a83b26;
    --teal: #126c61;
    --teal-soft: #e4f0ec;
    --gold: #ad813d;
    --gold-soft: #f4ead7;
    --danger: #b23a2e;
    --ok: #2f7d55;
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow-sm: 0 2px 8px rgba(34, 28, 18, .05);
    --shadow: 0 14px 40px rgba(34, 28, 18, .08);
    --shadow-lg: 0 30px 80px rgba(34, 28, 18, .14);
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --container: 1200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent); color: #fff; }

h1, h2, h3, h4, h5 { margin: 0 0 .6em; line-height: 1.3; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

.container { width: min(var(--container), calc(100% - 48px)); margin: 0 auto; }
.narrow { width: min(820px, calc(100% - 48px)); margin: 0 auto; }
.tiny-container { width: min(560px, calc(100% - 48px)); margin: 0 auto; }

.icon { flex: 0 0 auto; vertical-align: -2px; }
.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; }

/* ---------- 通用组件 ---------- */

.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 99px;
    font-size: 11.5px; font-weight: 600; letter-spacing: .03em;
    background: var(--paper-deep); color: var(--ink-2); white-space: nowrap;
}
.badge-accent { background: #f8e4df; color: var(--accent-dark); }
.badge-teal { background: var(--teal-soft); color: var(--teal); }
.badge-gold { background: var(--gold-soft); color: #7d5a23; }
.badge-ink { background: var(--ink); color: #fff; }
.badge-muted { background: #eef0f1; color: var(--muted); }
.badge-danger { background: #f8e1de; color: var(--danger); }

.tag {
    display: inline-flex; align-items: center;
    padding: 3px 9px; border: 1px solid var(--line);
    border-radius: 99px; font-size: 12px; color: var(--muted);
    background: transparent; transition: .18s ease;
}
.tag:hover { border-color: var(--accent); color: var(--accent); background: #fff; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    border: 1px solid transparent; border-radius: 99px;
    padding: 9px 18px; font-size: 14px; font-weight: 600;
    line-height: 1.2; transition: .2s ease; white-space: nowrap;
    background: var(--ink); color: #fff;
}
.btn:hover { background: var(--ink-2); color: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-teal { background: var(--teal); }
.btn-teal:hover { background: #0b574e; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.btn-soft { background: var(--paper-deep); color: var(--ink); }
.btn-soft:hover { background: var(--line); color: var(--ink); }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 13px 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.text-muted { color: var(--muted); }
.text-faint { color: var(--faint); }
.text-accent { color: var(--accent); }
.text-teal { color: var(--teal); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.serif { font-family: var(--serif); }
.mono { font-family: var(--mono); }
.fw-600 { font-weight: 600; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; } .mt-6 { margin-top: 3rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.flex { display: flex; } .flex-wrap { flex-wrap: wrap; } .items-center { align-items: center; }
.justify-between { justify-content: space-between; } .gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; } .grow { flex: 1; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--line); margin: 1.5rem 0; }

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 700; letter-spacing: .16em;
    text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.section { padding: 52px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.section-head h2 { font-family: var(--serif); font-size: clamp(24px, 3vw, 34px); margin: 4px 0 0; letter-spacing: -.02em; }
.section-head p { color: var(--muted); margin: 4px 0 0; }
.section-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.section-link:hover { color: var(--accent); }
.section-band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-dark { background: var(--ink); color: #f4efe4; }
.section-dark .section-head p, .section-dark .text-muted { color: #9ba7b1; }

/* ---------- 提示 ---------- */

.flash-stack { position: fixed; top: 86px; right: 24px; z-index: 100; width: min(390px, calc(100% - 48px)); display: grid; gap: 10px; }
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    background: var(--surface); border: 1px solid var(--line);
    box-shadow: var(--shadow); font-size: 13.5px; animation: slideIn .28s ease both;
}
.alert-success { border-left: 3px solid var(--ok); }
.alert-error { border-left: 3px solid var(--danger); }
.alert-info { border-left: 3px solid var(--teal); }
.alert-warning { border-left: 3px solid var(--gold); }
.alert .alert-close { margin-left: auto; background: none; border: 0; color: var(--faint); padding: 0; line-height: 1; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.errors-box {
    background: #fdf1ef; border: 1px solid #f0c9c2; color: #76251b;
    border-radius: var(--radius-sm); padding: 12px 18px; margin-bottom: 20px; font-size: 13.5px;
}
.errors-box ul { margin: 0; padding-left: 1.1rem; }

/* ---------- 前台头部 ---------- */

.site-header { position: sticky; top: 0; z-index: 60; background: rgba(246, 242, 233, .94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar { background: var(--ink); color: #d9d2c4; font-size: 11.5px; letter-spacing: .05em; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 32px; }
.topbar a { color: #d9d2c4; }
.topbar a:hover { color: #fff; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 18px; }
.masthead { display: flex; align-items: center; gap: 30px; height: 74px; }
.brand { display: inline-flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.brand-logo { display: block; width: auto; max-width: 210px; height: 46px; object-fit: contain; }
.brand:hover .brand-logo { opacity: .86; }
.brand-mark {
    width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--ink); color: var(--paper);
    font-family: var(--serif); font-size: 15px; font-weight: 700; letter-spacing: -.04em;
    position: relative; overflow: hidden;
}
.brand-mark::after { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(246,242,233,.35); border-radius: 50%; }
.brand-text { display: grid; line-height: 1.15; }
.brand-name { font-family: var(--serif); font-size: 21px; font-weight: 700; letter-spacing: .08em; }
.brand-en { font-size: 9px; letter-spacing: .34em; color: var(--muted); text-transform: uppercase; margin-top: 2px; }
.primary-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-link {
    padding: 8px 13px; border-radius: 8px; font-size: 14px; color: var(--ink-2);
    position: relative; transition: .18s ease;
}
.nav-link:hover { background: var(--paper-deep); color: var(--ink); }
.nav-link.is-active { color: var(--accent); font-weight: 700; }
.nav-link.is-active::after {
    content: ""; position: absolute; left: 13px; right: 13px; bottom: 2px; height: 2px; background: var(--accent); border-radius: 2px;
}
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: 12px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; background: transparent; border: 1px solid transparent; border-radius: 50%; color: var(--ink-2); transition: .18s; }
.icon-btn:hover { background: var(--paper-deep); color: var(--ink); }
.header-search { position: relative; display: flex; align-items: center; }
.header-search input {
    width: 150px; height: 36px; border-radius: 99px; border: 1px solid var(--line);
    background: var(--surface); padding: 0 14px 0 34px; font-size: 12.5px; color: var(--ink);
    transition: .22s ease; outline: none;
}
.header-search input:focus { width: 210px; border-color: var(--ink); }
.header-search .icon { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 5px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; font-weight: 600; }
.user-chip .avatar { width: 28px; height: 28px; }
.user-menu { position: relative; }
.user-menu-panel {
    position: absolute; right: 0; top: calc(100% + 10px); width: 210px; padding: 8px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); display: none;
}
.user-menu:hover .user-menu-panel, .user-menu:focus-within .user-menu-panel { display: block; }
.user-menu-panel a { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.user-menu-panel a:hover { background: var(--paper-deep); color: var(--ink); }
.mobile-toggle { display: none; }

/* ---------- 头像 ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--paper-deep); }
.avatar-sm { width: 30px; height: 30px; }
.avatar-lg { width: 72px; height: 72px; }
.avatar-xl { width: 108px; height: 108px; }
.avatar-ring { padding: 3px; border: 1px solid var(--line-strong); background: var(--surface); }

/* ---------- 首页 ---------- */
.site-main { min-height: 60vh; }
.home-hero { padding: 34px 0 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 30px; align-items: stretch; }
.hero-lead { position: relative; min-height: 440px; border-radius: var(--radius-lg); overflow: hidden; background: var(--ink); display: flex; align-items: flex-end; color: #fff; box-shadow: var(--shadow); }
.hero-lead img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .82; transition: transform .8s ease; }
.hero-lead:hover img { transform: scale(1.03); }
.hero-lead::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13,19,25,.02) 20%, rgba(11,17,23,.86) 100%); }
.hero-copy { position: relative; z-index: 2; padding: 34px; width: 100%; }
.hero-copy h1 { font-family: var(--serif); font-size: clamp(30px, 4vw, 46px); line-height: 1.25; letter-spacing: -.02em; margin: 12px 0 12px; color: #fff; }
.hero-copy p { color: rgba(255,255,255,.78); max-width: 620px; margin-bottom: 18px; }
.hero-meta { display: flex; align-items: center; gap: 14px; font-size: 12px; color: rgba(255,255,255,.66); }
.hero-meta .badge { background: rgba(255,255,255,.14); color: #fff; backdrop-filter: blur(4px); }
.hero-side { display: grid; gap: 14px; align-content: start; }
.hero-side-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.hero-side-head span { font-family: var(--serif); font-size: 17px; font-weight: 700; }
.hero-mini { display: grid; grid-template-columns: 56px 1fr; gap: 13px; align-items: start; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.hero-mini:last-child { border-bottom: 0; }
.hero-mini-index { font-family: var(--serif); font-size: 24px; color: var(--line-strong); line-height: 1; }
.hero-mini h3 { font-size: 14px; line-height: 1.5; margin: 0 0 4px; font-weight: 600; }
.hero-mini time { font-size: 11px; color: var(--faint); }
.hero-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 26px; }
.hero-stat { background: var(--surface); padding: 17px 20px; }
.hero-stat strong { display: block; font-family: var(--serif); font-size: 24px; line-height: 1.2; }
.hero-stat span { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }

/* ---------- 内容卡片 ---------- */
.content-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.content-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: .22s ease; display: flex; flex-direction: column; }
.content-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.card-cover { aspect-ratio: 16 / 10; background: var(--paper-deep); overflow: hidden; position: relative; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.content-card:hover .card-cover img { transform: scale(1.025); }
.card-cover .badge { position: absolute; top: 12px; left: 12px; background: rgba(255,253,248,.94); }
.card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.card-kicker { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--faint); margin-bottom: 8px; }
.card-body h3 { font-family: var(--serif); font-size: 20px; line-height: 1.45; margin: 0 0 8px; letter-spacing: -.01em; }
.card-body h3 a:hover { color: var(--accent); }
.card-body p { color: var(--muted); font-size: 13px; line-height: 1.75; margin: 0 0 16px; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--faint); }
.card-author { display: flex; align-items: center; gap: 7px; }
.card-author .avatar { width: 24px; height: 24px; }

.feature-card { display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.feature-card .card-cover { aspect-ratio: auto; min-height: 320px; }
.feature-card .card-body { padding: 32px; justify-content: center; }
.feature-card h3 { font-size: 28px; }
.feature-card p { font-size: 14px; }

.feed-list { display: grid; }
.feed-item { display: grid; grid-template-columns: 1fr 210px; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--line); align-items: start; }
.feed-item:first-child { padding-top: 0; }
.feed-item h3 { font-family: var(--serif); font-size: 22px; margin: 6px 0 8px; line-height: 1.4; }
.feed-item p { color: var(--muted); font-size: 13.5px; margin: 0 0 12px; }
.feed-meta { display: flex; align-items: center; gap: 14px; font-size: 11.5px; color: var(--faint); flex-wrap: wrap; }
.feed-thumb { aspect-ratio: 16/10; border-radius: var(--radius-sm); overflow: hidden; background: var(--paper-deep); }
.feed-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 图片 ---------- */
.image-mosaic { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 170px; gap: 12px; }
.image-tile { position: relative; overflow: hidden; border-radius: var(--radius-sm); background: var(--paper-deep); }
.image-tile:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.image-tile img { width: 100%; height: 100%; object-fit: cover; transition: .5s ease; }
.image-tile:hover img { transform: scale(1.04); }
.image-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.68)); opacity: .8; }
.image-tile-caption { position: absolute; z-index: 2; left: 14px; right: 14px; bottom: 12px; color: #fff; font-size: 12.5px; font-weight: 600; }
.image-tile-caption span { display: block; font-size: 10.5px; font-weight: 400; opacity: .7; margin-top: 2px; }
.image-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.image-card { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--paper-deep); aspect-ratio: 4/3; }
.image-card img { width: 100%; height: 100%; object-fit: cover; transition: .5s; }
.image-card:hover img { transform: scale(1.04); }
.image-card .image-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.65)); display: flex; align-items: flex-end; padding: 16px; color: #fff; font-size: 13px; }
.image-card .count { position: absolute; top: 12px; right: 12px; }

/* ---------- 视频 ---------- */
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.video-card { background: var(--ink); border-radius: var(--radius); overflow: hidden; color: #fff; position: relative; }
.video-card img { aspect-ratio: 16/9; width: 100%; object-fit: cover; opacity: .78; transition: .4s; }
.video-card:hover img { opacity: .96; transform: scale(1.02); }
.video-card-body { padding: 16px 18px 18px; }
.video-card h3 { font-family: var(--serif); font-size: 18px; margin: 0 0 6px; color: #fff; }
.video-card p { color: rgba(255,255,255,.6); font-size: 12px; margin: 0; }
.play-badge { position: absolute; top: calc(56.25% - 23px); left: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--ink); display: grid; place-items: center; transition: .2s; }
.video-card:hover .play-badge { background: var(--accent); color: #fff; transform: translate(-50%,-50%) scale(1.07); }

/* ---------- 博客 ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.blog-card { display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: .2s; }
.blog-card:hover { box-shadow: var(--shadow-sm); border-color: var(--line-strong); transform: translateY(-2px); }
.blog-card-cover { border-radius: var(--radius-sm); overflow: hidden; background: var(--paper-deep); aspect-ratio: 1; }
.blog-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-body h3 { font-family: var(--serif); font-size: 18px; margin: 5px 0 6px; }
.blog-card-body p { font-size: 12.5px; color: var(--muted); margin: 0 0 9px; }
.blog-card-meta { display: flex; gap: 10px; align-items: center; font-size: 11px; color: var(--faint); }

/* ---------- 论坛 ---------- */
.forum-hero { background: var(--ink); color: #f3eee3; padding: 46px 0 38px; position: relative; overflow: hidden; }
.forum-hero::after { content: "COMMUNITY"; position: absolute; right: -10px; bottom: -26px; font-family: var(--serif); font-size: 150px; letter-spacing: -.05em; color: rgba(255,255,255,.035); pointer-events: none; }
.forum-hero h1 { font-family: var(--serif); font-size: clamp(30px, 4vw, 46px); margin: 8px 0 10px; color: #fff; }
.forum-hero p { color: #aab3bb; max-width: 620px; margin: 0; }
.forum-stats { display: flex; gap: 30px; margin-top: 22px; }
.forum-stats div strong { display: block; font-family: var(--serif); font-size: 22px; color: #fff; }
.forum-stats div span { font-size: 11px; color: #87939e; }
.board-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.board-card { display: flex; gap: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: .2s; }
.board-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.board-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; flex: 0 0 auto; }
.board-card h3 { font-size: 16px; margin: 0 0 3px; }
.board-card p { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; }
.board-card-meta { display: flex; gap: 14px; font-size: 11px; color: var(--faint); }
.topic-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.topic-row { display: grid; grid-template-columns: 46px 1fr 160px 120px; gap: 14px; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.topic-row:last-child { border-bottom: 0; }
.topic-row:hover { background: var(--surface-2); }
.topic-avatar .avatar { width: 38px; height: 38px; }
.topic-main h3 { font-size: 14.5px; margin: 0 0 3px; line-height: 1.5; }
.topic-main h3 .badge { margin-right: 4px; vertical-align: 1px; }
.topic-main p { margin: 0; font-size: 11.5px; color: var(--faint); display: flex; gap: 10px; }
.topic-stats { display: flex; gap: 14px; font-size: 11px; color: var(--muted); justify-content: flex-end; }
.topic-last { font-size: 11px; color: var(--faint); }
.topic-badge-sep { color: var(--line-strong); }

/* ---------- 考试 ---------- */
.exam-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.exam-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: relative; overflow: hidden; transition: .2s; }
.exam-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--accent), var(--gold)); opacity: .8; }
.exam-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.exam-card h3 { font-family: var(--serif); font-size: 21px; margin: 8px 0 8px; line-height: 1.4; }
.exam-card p { color: var(--muted); font-size: 12.5px; min-height: 38px; }
.exam-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); margin: 8px 0 14px; }
.exam-meta span { display: block; font-size: 10px; color: var(--faint); }
.exam-meta strong { font-family: var(--serif); font-size: 17px; }
.exam-card-foot { display: flex; align-items: center; justify-content: space-between; }
.exam-status { font-size: 11px; color: var(--muted); }
.exam-status.is-open { color: var(--ok); }

/* ---------- 博客空间 ---------- */
.blog-shell { --blog-accent: var(--accent); --blog-bg: var(--paper); }
.blog-theme-paper { --blog-accent: #b24e35; --blog-bg: #fbf7ee; }
.blog-theme-ink { --blog-accent: #c8a56b; --blog-bg: #101820; color: #e9e2d5; }
.blog-theme-mint { --blog-accent: #157a6d; --blog-bg: #eef5f0; }
.blog-theme-ink .blog-space-body { background: #101820; color: #e9e2d5; }
.blog-theme-ink .blog-space-card, .blog-theme-ink .blog-post-card { background: #16222c; border-color: #26343f; color: #e9e2d5; }
.blog-theme-ink .text-muted, .blog-theme-ink .blog-card-meta { color: #96a3ae; }
.blog-cover { background: var(--blog-bg); border-bottom: 1px solid var(--line); padding: 46px 0 0; position: relative; overflow: hidden; }
.blog-cover-inner { display: grid; grid-template-columns: 1fr 320px; gap: 30px; align-items: end; }
.blog-cover h1 { font-family: var(--serif); font-size: clamp(34px, 5vw, 58px); letter-spacing: -.03em; margin: 10px 0 8px; }
.blog-cover p { color: var(--muted); max-width: 680px; }
.blog-profile { display: flex; gap: 18px; align-items: center; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; border-bottom: 0; }
.blog-space-nav { display: flex; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); margin-top: 26px; overflow-x: auto; }
.blog-space-nav a { padding: 7px 13px; border-radius: 99px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.blog-space-nav a:hover, .blog-space-nav a.is-active { background: var(--surface); color: var(--ink); }
.blog-space-body { background: var(--blog-bg); padding: 40px 0 60px; min-height: 40vh; }
.blog-space-grid { display: grid; grid-template-columns: 1fr 300px; gap: 36px; align-items: start; }
.blog-post-card { padding: 26px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; }
.blog-post-card h2 { font-family: var(--serif); font-size: 26px; margin: 6px 0 8px; }
.blog-post-card h2 a:hover { color: var(--blog-accent); }
.blog-post-card p { color: var(--muted); font-size: 13px; }
.blog-side-card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.blog-side-card h3 { font-family: var(--serif); font-size: 16px; margin-bottom: 12px; }
.blog-side-link { display: flex; justify-content: space-between; padding: 6px 0; font-size: 12.5px; border-bottom: 1px dashed var(--line); }
.blog-side-link:last-child { border-bottom: 0; }
.blog-side-link span { color: var(--faint); }
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.album-card { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.album-card img { aspect-ratio: 1; width: 100%; object-fit: cover; }
.album-card-body { padding: 9px 11px; font-size: 12px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.photo-grid img { aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.guestbook-entry { padding: 14px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 11px; }
.guestbook-entry:last-child { border-bottom: 0; }
.guestbook-entry .body { font-size: 13px; }
.guestbook-entry time { font-size: 10.5px; color: var(--faint); }

/* ---------- 阅读页 ---------- */
.article-hero { padding: 28px 0 0; }
.breadcrumb { display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--faint); margin-bottom: 18px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--accent); }
.article-head { max-width: 850px; }
.article-head h1 { font-family: var(--serif); font-size: clamp(32px, 5vw, 52px); line-height: 1.25; letter-spacing: -.025em; margin: 12px 0 14px; }
.article-deck { font-size: 17px; color: var(--muted); max-width: 720px; line-height: 1.75; }
.article-byline { display: flex; align-items: center; gap: 12px; margin-top: 20px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.article-byline .avatar { width: 34px; height: 34px; }
.article-cover { margin: 28px 0 0; border-radius: var(--radius-lg); overflow: hidden; background: var(--paper-deep); max-height: 560px; }
.article-cover img { width: 100%; max-height: 560px; object-fit: cover; }
.article-layout { display: grid; grid-template-columns: minmax(0, 780px) 240px; gap: 60px; justify-content: center; padding: 40px 0 70px; align-items: start; }
.article-body { font-size: 16.5px; line-height: 1.95; color: #2a333c; }
.article-body h2 { font-family: var(--serif); font-size: 27px; margin: 1.8em 0 .6em; }
.article-body h3 { font-family: var(--serif); font-size: 21px; margin: 1.5em 0 .5em; }
.article-body p { margin: 0 0 1.25em; }
.article-body blockquote { margin: 1.8em 0; padding: 16px 22px; border-left: 3px solid var(--accent); background: var(--surface); color: var(--ink-2); font-family: var(--serif); font-size: 18px; }
.article-body img { border-radius: var(--radius-sm); margin: 1.4em 0; }
.article-body code { background: var(--paper-deep); padding: 2px 5px; border-radius: 4px; font-family: var(--mono); font-size: .88em; }
.article-body pre { background: var(--ink); color: #e9e2d5; padding: 18px 20px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 13px; line-height: 1.7; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body hr { margin: 2rem 0; }
.article-actions { display: flex; gap: 10px; margin: 28px 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.action-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 12.5px; }
.action-btn:hover, .action-btn.is-active { border-color: var(--accent); color: var(--accent); background: #fff; }
.action-btn.is-active .icon { fill: currentColor; }
.article-side { position: sticky; top: 100px; }
.side-block { margin-bottom: 26px; }
.side-block h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--faint); margin-bottom: 12px; }
.side-link { display: block; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.side-link:hover { color: var(--accent); }
.side-link time { display: block; font-size: 10px; color: var(--faint); margin-top: 2px; }

/* ---------- 评论 ---------- */
.comments-section { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.comments-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.comments-head h2 { font-family: var(--serif); font-size: 22px; margin: 0; }
.comment { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: 0; }
.comment-head { display: flex; align-items: center; gap: 9px; font-size: 12.5px; flex-wrap: wrap; }
.comment-head strong { font-size: 13px; }
.comment-head time { color: var(--faint); font-size: 10.5px; }
.comment-body { font-size: 13.5px; color: var(--ink-2); margin: 5px 0 0; white-space: pre-line; }
.comment-actions { display: flex; gap: 12px; margin-top: 5px; font-size: 11px; color: var(--faint); }
.comment-actions button { background: none; border: 0; padding: 0; color: var(--faint); font-size: 11px; }
.comment-actions button:hover { color: var(--accent); }
.comment-replies { margin-top: 10px; padding-left: 14px; border-left: 2px solid var(--line); display: grid; gap: 8px; }
.comment-reply { font-size: 12.5px; background: var(--surface); padding: 9px 12px; border-radius: 8px; }
.comment-form { display: grid; gap: 10px; margin: 18px 0; }
.comment-form textarea { min-height: 92px; }
.reply-target { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); background: var(--paper-deep); padding: 6px 10px; border-radius: 8px; }
.reply-target button { margin-left: auto; border: 0; background: none; color: var(--faint); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 18px; }
.field > label, .field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field .hint { font-size: 11.5px; color: var(--faint); margin-top: 5px; }
.input, .select, .textarea {
    width: 100%; border: 1px solid var(--line-strong); background: var(--surface);
    border-radius: 9px; padding: 10px 12px; font-size: 14px; color: var(--ink);
    transition: .18s; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23,33,43,.06); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.select { 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; background-repeat: no-repeat; padding-right: 32px; }
.checkbox { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.checkbox input { width: 15px; height: 15px; accent-color: var(--accent); }
.form-shell { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 10px; align-items: center; padding-top: 8px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form .input { padding: 7px 10px; font-size: 12.5px; }
.upload-field { display: flex; gap: 8px; align-items: center; }
.upload-preview { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); background: var(--paper-deep); }

/* ---------- 认证 ---------- */
.auth-body { background: var(--ink); min-height: 100vh; }
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.auth-aside { background: var(--ink); color: #f5efe4; padding: 54px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-aside::before { content: ""; position: absolute; width: 500px; height: 500px; border-radius: 50%; border: 1px solid rgba(255,255,255,.09); right: -140px; top: -120px; }
.auth-aside::after { content: ""; position: absolute; width: 700px; height: 700px; border-radius: 50%; border: 1px solid rgba(255,255,255,.05); right: -250px; top: -220px; }
.auth-aside .brand { color: #fff; }
.auth-aside .brand-en { color: #8e9aa5; }
.auth-aside h1 { font-family: var(--serif); font-size: clamp(38px, 5vw, 64px); line-height: 1.22; letter-spacing: -.03em; margin: 40px 0 18px; position: relative; z-index: 2; }
.auth-aside h1 em { color: var(--gold); font-style: normal; }
.auth-aside p { color: #9da8b2; max-width: 480px; position: relative; z-index: 2; }
.auth-features { display: grid; gap: 12px; margin-top: 30px; position: relative; z-index: 2; }
.auth-feature { display: flex; gap: 10px; align-items: center; font-size: 13px; color: #c9d0d6; }
.auth-feature .icon { color: var(--gold); }
.auth-main { background: var(--paper); display: grid; place-items: center; padding: 48px 32px; }
.auth-card { width: min(420px, 100%); }
.auth-card h2 { font-family: var(--serif); font-size: 30px; margin-bottom: 6px; }
.auth-card .auth-sub { color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.auth-card .btn { width: 100%; padding: 12px; margin-top: 4px; }
.auth-links { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 18px; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 11px; margin: 24px 0; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.demo-note { background: var(--paper-deep); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 12px 14px; font-size: 11.5px; color: var(--muted); margin-top: 22px; }

/* ---------- 会员 ---------- */
.member-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 34px; padding: 34px 0 60px; align-items: start; }
.member-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: sticky; top: 96px; }
.member-profile { text-align: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.member-profile .avatar { margin: 0 auto 10px; }
.member-profile h3 { font-family: var(--serif); font-size: 18px; margin: 0 0 2px; }
.member-profile p { font-size: 11.5px; color: var(--faint); margin: 0; }
.member-nav { display: grid; gap: 2px; }
.member-nav a { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; font-size: 13px; color: var(--muted); }
.member-nav a:hover, .member-nav a.is-active { background: var(--paper-deep); color: var(--ink); }
.member-nav a.is-active { font-weight: 600; }
.member-content h1 { font-family: var(--serif); font-size: 32px; margin: 0 0 5px; }
.member-content .lead { color: var(--muted); margin-bottom: 26px; }
.member-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
.member-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px; }
.member-stat strong { display: block; font-family: var(--serif); font-size: 25px; }
.member-stat span { font-size: 11px; color: var(--muted); }

/* ---------- 页脚 ---------- */
.site-footer { background: var(--ink); color: #b8c0c8; padding: 52px 0 24px; margin-top: 70px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand .brand-name { color: #fff; }
.footer-brand .brand-en { color: #7f8b96; }
.footer-brand p { font-size: 12.5px; color: #8e9aa5; margin-top: 16px; max-width: 320px; }
.footer-col h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .16em; color: #74808b; margin-bottom: 14px; }
.footer-col a { display: block; font-size: 12.5px; color: #b8c0c8; padding: 4px 0; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); margin-top: 38px; padding-top: 18px; display: flex; justify-content: space-between; gap: 20px; font-size: 11px; color: #74808b; flex-wrap: wrap; }
.footer-bottom a { color: #b8c0c8; }
.footer-bottom a:hover { color: #fff; }
.site-footer-slim { padding: 18px 0; margin-top: 46px; }
.site-footer-slim .footer-bottom-slim { border: 0; margin: 0; padding: 0; align-items: center; font-size: 11.5px; }
.site-footer-slim .footer-bottom-slim span:last-child:empty { display: none; }
@media (max-width: 640px) {
    .brand-logo { height: 38px; max-width: 170px; }
    .site-footer-slim { padding: 15px 0; margin-top: 28px; }
    .site-footer-slim .footer-bottom-slim { gap: 8px; }
}

/* ---------- 分页 ---------- */
.pagination-wrap { margin-top: 30px; }
.pagination { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; list-style: none; padding: 0; margin: 0; }
.pagination li { display: inline-flex; }
.pagination a, .pagination span { min-width: 34px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; color: var(--muted); }
.pagination a:hover { border-color: var(--ink); color: var(--ink); }
.pagination .active span { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination .disabled span { opacity: .4; }

/* ---------- 空状态 ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .empty-icon { width: 54px; height: 54px; border-radius: 50%; background: var(--paper-deep); display: grid; place-items: center; margin: 0 auto 14px; color: var(--faint); }
.empty-state h3 { font-family: var(--serif); font-size: 20px; color: var(--ink); margin-bottom: 5px; }
.empty-state p { font-size: 13px; margin: 0 0 16px; }

/* ==========================================================================
   后台
   ========================================================================== */

.admin-body { background: #f2f4f5; }
.admin-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar { background: #111b26; color: #b8c3cc; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 0 14px 24px; scrollbar-width: thin; }
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 22px 10px 20px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 16px; }
.admin-brand .brand-mark { width: 36px; height: 36px; font-size: 13px; background: var(--paper); color: var(--ink); }
.admin-brand-text { display: grid; line-height: 1.2; }
.admin-brand-text strong { font-family: var(--serif); font-size: 16px; color: #fff; letter-spacing: .06em; }
.admin-brand-text span { font-size: 9px; letter-spacing: .3em; color: #6f7d89; }
.admin-nav-group { margin-bottom: 18px; }
.admin-nav-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: .18em; color: #5e6c77; padding: 0 10px; margin-bottom: 6px; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; font-size: 12.5px; color: #aeb9c3; margin-bottom: 1px; }
.admin-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav a.is-active { background: var(--accent); color: #fff; }
.admin-nav a .icon { opacity: .8; }
.admin-side-footer { border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; margin-top: 20px; }
.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { height: 62px; background: #fff; border-bottom: 1px solid #e2e6e8; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 30; }
.admin-topbar-left { display: flex; align-items: center; gap: 14px; }
.admin-topbar h1 { font-size: 15px; margin: 0; font-weight: 600; }
.admin-breadcrumb { font-size: 11px; color: #8b969e; }
.admin-topbar-right { display: flex; align-items: center; gap: 12px; }
.admin-content { padding: 26px 28px 44px; flex: 1; }
.admin-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-page-head h2 { font-size: 24px; margin: 0 0 3px; letter-spacing: -.02em; }
.admin-page-head p { color: #7b878f; font-size: 12.5px; margin: 0; }
.admin-page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid #e4e8ea; border-radius: 10px; padding: 18px; position: relative; overflow: hidden; }
.stat-card .stat-label { font-size: 11px; color: #849099; letter-spacing: .03em; }
.stat-card .stat-value { font-family: var(--serif); font-size: 30px; line-height: 1.25; margin-top: 6px; }
.stat-card .stat-foot { font-size: 10.5px; color: #97a2aa; margin-top: 3px; }
.stat-card .stat-icon { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 9px; background: #f1f4f5; display: grid; place-items: center; color: #6e7c86; }
.stat-card.accent .stat-icon { background: #fbece8; color: var(--accent); }
.stat-card.teal .stat-icon { background: var(--teal-soft); color: var(--teal); }
.stat-card.gold .stat-icon { background: var(--gold-soft); color: var(--gold); }

.panel { background: #fff; border: 1px solid #e4e8ea; border-radius: 10px; margin-bottom: 20px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-bottom: 1px solid #eef1f2; }
.panel-head h3 { font-size: 13.5px; margin: 0; font-weight: 600; }
.panel-head .panel-sub { font-size: 11px; color: #8c979f; }
.panel-body { padding: 18px; }
.panel-body.flush { padding: 0; }
.panel-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #8c979f; font-weight: 600; padding: 10px 14px; background: #fafbfb; border-bottom: 1px solid #e9edee; white-space: nowrap; }
.data-table td { padding: 11px 14px; border-bottom: 1px solid #f0f2f3; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: #fcfcfb; }
.data-table .cell-title { font-weight: 600; color: var(--ink); }
.data-table .cell-sub { font-size: 10.5px; color: #94a0a8; margin-top: 2px; }
.data-table .actions { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.data-table .actions a, .data-table .actions button { color: #69757e; background: none; border: 0; padding: 0; font-size: 11.5px; }
.data-table .actions a:hover, .data-table .actions button:hover { color: var(--accent); }
.admin-filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 18px; border-bottom: 1px solid #eef1f2; background: #fcfcfb; }
.admin-filter .input, .admin-filter .select { padding: 7px 9px; font-size: 12px; width: auto; min-width: 130px; background: #fff; }
.admin-filter .input[type="search"] { min-width: 190px; }
.admin-empty { padding: 40px; text-align: center; color: #8c979f; font-size: 12.5px; }
.admin-note { font-size: 11.5px; color: #8c979f; }
.admin-summary { display: flex; gap: 22px; flex-wrap: wrap; padding: 12px 18px; background: #fafbfb; border-bottom: 1px solid #eef1f2; font-size: 11.5px; color: #7f8b93; }
.admin-summary strong { color: var(--ink); }

/* 后台表单 */
.admin-form { max-width: 860px; }
.admin-form .panel-body { padding: 22px; }
.admin-form .form-grid { gap: 0 22px; }
.admin-form .field > label { font-size: 11.5px; color: #65727b; }
.admin-form .input, .admin-form .select, .admin-form .textarea { background: #fdfdfc; border-color: #dce2e4; font-size: 13px; }
.admin-form .input:focus, .admin-form .select:focus, .admin-form .textarea:focus { border-color: #7d8b94; box-shadow: 0 0 0 3px rgba(23,33,43,.04); }
.admin-form .form-actions { border-top: 1px solid #eef1f2; margin-top: 8px; padding-top: 18px; }
.admin-form .textarea { min-height: 180px; }
.slug-row { display: flex; gap: 8px; }
.slug-row .input { flex: 1; }
.help-text { font-size: 10.5px; color: #97a2aa; margin-top: 4px; line-height: 1.5; }

/* 编辑器 */
.editor-toolbar { display: flex; gap: 4px; flex-wrap: wrap; padding: 7px; background: #f7f9f9; border: 1px solid #dce2e4; border-bottom: 0; border-radius: 8px 8px 0 0; }
.editor-toolbar button { border: 1px solid transparent; background: none; border-radius: 4px; min-width: 28px; height: 26px; font-size: 11px; color: #5f6d76; }
.editor-toolbar button:hover { background: #fff; border-color: #dce2e4; color: var(--ink); }
.editor-toolbar .sep { width: 1px; background: #e1e6e8; margin: 3px 4px; }
.editor-area { border-radius: 0 0 8px 8px !important; font-family: var(--mono); font-size: 12.5px !important; min-height: 360px; }
.editor-hint { display: flex; justify-content: space-between; font-size: 10.5px; color: #97a2aa; margin-top: 4px; }

/* 上传 */
.image-upload { border: 1px dashed #cfd7db; border-radius: 8px; padding: 12px; background: #fbfcfc; display: flex; gap: 12px; align-items: center; }
.image-upload input[type="file"] { font-size: 11.5px; }
.image-upload .image-preview { width: 70px; height: 70px; border-radius: 7px; object-fit: cover; background: #eef1f2; border: 1px solid #e1e6e8; }

/* 后台登录 */
.admin-auth { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 20% 10%, #1d2c39 0, #111b26 55%); padding: 30px; }
.admin-auth-card { width: min(410px, 100%); background: #fffdf8; border-radius: 16px; padding: 38px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.admin-auth-card .brand { justify-content: center; margin-bottom: 22px; }
.admin-auth-card h1 { font-family: var(--serif); text-align: center; font-size: 26px; margin-bottom: 4px; }
.admin-auth-card p { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 24px; }

/* ==========================================================================
   BBS 详情 / 发帖 / 考试 / 博客管理
   ========================================================================== */

.forum-shell { padding: 32px 0 60px; }
.forum-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.forum-main { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.forum-main-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.forum-main-head h2 { font-family: var(--serif); font-size: 22px; margin: 0; }
.forum-topic { padding: 26px 28px; }
.forum-topic-head h1 { font-family: var(--serif); font-size: clamp(25px, 3vw, 34px); margin: 8px 0 10px; line-height: 1.4; }
.topic-author-line { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.bbs-content { font-size: 15px; line-height: 1.9; margin: 24px 0; color: var(--ink-2); }
.bbs-content img.bbs-inline-image { border-radius: var(--radius-sm); margin: 12px 0; }
.topic-toolbar { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line); }
.replies-head { padding: 16px 28px; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.reply-item { display: grid; grid-template-columns: 40px 1fr; gap: 13px; padding: 20px 28px; border-bottom: 1px solid var(--line); }
.reply-item:last-child { border-bottom: 0; }
.reply-head { display: flex; align-items: center; gap: 9px; font-size: 12px; flex-wrap: wrap; }
.reply-head strong { font-size: 13px; }
.reply-head .op { background: var(--gold-soft); color: #7c5a20; padding: 1px 6px; border-radius: 4px; font-size: 9.5px; }
.reply-content { font-size: 14px; line-height: 1.8; margin: 6px 0 8px; }
.reply-content blockquote { margin: 4px 0 10px; padding: 8px 12px; background: var(--surface-2); border-left: 2px solid var(--line-strong); font-size: 12px; color: var(--muted); border-radius: 4px; }
.reply-actions { display: flex; gap: 12px; font-size: 11px; color: var(--faint); }
.reply-actions button { background: none; border: 0; color: var(--faint); padding: 0; font-size: 11px; }
.reply-actions button:hover { color: var(--accent); }
.forum-side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.forum-side-card h3 { font-size: 13px; margin-bottom: 12px; }
.forum-side-topic { display: block; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.forum-side-topic:last-child { border-bottom: 0; }
.bbs-editor-preview img { max-height: 120px; border-radius: 6px; margin-top: 8px; }
.bbs-upload { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.bbs-upload input { font-size: 11px; }

.exam-shell { padding: 32px 0 60px; }
.exam-hero { background: var(--ink); color: #f3eee4; border-radius: var(--radius-lg); padding: 36px; position: relative; overflow: hidden; margin-bottom: 26px; }
.exam-hero::after { content: ""; position: absolute; right: -70px; top: -90px; width: 350px; height: 350px; border-radius: 50%; border: 1px solid rgba(255,255,255,.09); }
.exam-hero h1 { font-family: var(--serif); font-size: clamp(30px, 4vw, 44px); color: #fff; margin: 8px 0 10px; }
.exam-hero p { color: #a9b3bc; max-width: 680px; }
.exam-hero-meta { display: flex; gap: 30px; margin-top: 20px; flex-wrap: wrap; }
.exam-hero-meta div strong { display: block; font-family: var(--serif); font-size: 25px; color: #fff; }
.exam-hero-meta div span { font-size: 10.5px; color: #8c98a2; }
.exam-take-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 28px; align-items: start; }
.exam-timer-card { position: sticky; top: 96px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.exam-timer { font-family: var(--mono); font-size: 34px; line-height: 1.2; letter-spacing: .02em; text-align: center; color: var(--ink); }
.exam-timer.is-warning { color: var(--accent); }
.timer-label { text-align: center; font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 8px; }
.exam-progress { height: 4px; background: var(--paper-deep); border-radius: 4px; overflow: hidden; margin: 14px 0 8px; }
.exam-progress span { display: block; height: 100%; background: var(--teal); transition: width .3s; }
.question-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; margin-bottom: 18px; scroll-margin-top: 92px; }
.question-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.question-index { width: 28px; height: 28px; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.question-stem { font-size: 15.5px; line-height: 1.8; color: var(--ink); }
.question-stem .blank { display: inline-block; min-width: 52px; border-bottom: 1px solid var(--ink); margin: 0 4px; }
.option-list { display: grid; gap: 8px; margin-top: 16px; }
.option { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: 13.5px; transition: .15s; background: var(--surface-2); }
.option:hover { border-color: var(--line-strong); background: #fff; }
.option input { margin-top: 3px; accent-color: var(--accent); }
.option.is-selected { border-color: var(--accent); background: #fdf5f2; }
.option-letter { font-weight: 700; color: var(--muted); min-width: 17px; }
.fill-list { display: grid; gap: 8px; margin-top: 14px; }
.fill-row { display: flex; align-items: center; gap: 9px; }
.fill-row span { font-size: 11px; color: var(--faint); min-width: 42px; }
.exam-nav-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
.exam-nav-grid a { height: 30px; display: grid; place-items: center; border-radius: 5px; border: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.exam-nav-grid a.answered { background: var(--teal); color: #fff; border-color: var(--teal); }
.exam-save-status { font-size: 10.5px; color: var(--faint); text-align: center; min-height: 15px; }
.result-hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 34px; display: grid; grid-template-columns: 190px 1fr; gap: 32px; align-items: center; margin-bottom: 24px; }
.score-ring { width: 170px; height: 170px; border-radius: 50%; background: conic-gradient(var(--teal) calc(var(--score) * 1%), var(--paper-deep) 0); display: grid; place-items: center; }
.score-ring::before { content: ""; width: 132px; height: 132px; border-radius: 50%; background: var(--surface); grid-area: 1/1; }
.score-inner { grid-area: 1/1; text-align: center; z-index: 1; }
.score-inner strong { display: block; font-family: var(--serif); font-size: 40px; line-height: 1; }
.score-inner span { font-size: 10.5px; color: var(--faint); }
.result-summary h1 { font-family: var(--serif); font-size: 30px; margin: 0 0 6px; }
.result-pills { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.result-pill { background: var(--paper-deep); border-radius: 8px; padding: 8px 13px; font-size: 11px; color: var(--muted); }
.result-pill strong { display: block; font-size: 18px; color: var(--ink); font-family: var(--serif); }
.review-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 17px 19px; margin-bottom: 12px; background: var(--surface); }
.review-item.correct { border-left: 3px solid var(--ok); }
.review-item.wrong { border-left: 3px solid var(--danger); }
.review-item.unanswered { border-left: 3px solid var(--faint); }
.review-head { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; font-size: 11px; color: var(--faint); }
.review-answers { font-size: 12px; color: var(--muted); display: grid; gap: 2px; margin-top: 8px; }
.review-analysis { font-size: 12px; color: var(--ink-2); background: var(--surface-2); padding: 9px 11px; border-radius: 6px; margin-top: 8px; }

/* 博客管理 */
.manage-shell { display: grid; grid-template-columns: 220px 1fr; gap: 28px; padding: 30px 0 60px; align-items: start; }
.manage-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: sticky; top: 96px; }
.manage-side .space-mini { padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.manage-side h3 { font-family: var(--serif); font-size: 17px; margin: 0 0 2px; }
.manage-side p { font-size: 11px; color: var(--faint); margin: 0; }
.manage-nav { display: grid; gap: 1px; }
.manage-nav a { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 7px; font-size: 12.5px; color: var(--muted); }
.manage-nav a:hover, .manage-nav a.is-active { background: var(--paper-deep); color: var(--ink); }
.manage-main h1 { font-family: var(--serif); font-size: 30px; margin: 0 0 4px; }
.manage-main .lead { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.manage-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.manage-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.manage-stat strong { display: block; font-family: var(--serif); font-size: 24px; }
.manage-stat span { font-size: 10.5px; color: var(--muted); }

/* 图片灯箱 */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(10,15,20,.94); display: none; place-items: center; padding: 24px; }
.lightbox.is-open { display: grid; }
.lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 4px; }
.lightbox-close { position: absolute; top: 20px; right: 22px; background: none; border: 0; color: #fff; }
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.1); border: 0; color: #fff; width: 44px; height: 44px; border-radius: 50%; }
.lightbox-prev { left: 20px; } .lightbox-next { right: 20px; }

/* 工具 */
.meta-dot::before { content: "·"; margin-right: 8px; color: var(--line-strong); }
.ratio-16-9 { aspect-ratio: 16/9; }
.ratio-4-3 { aspect-ratio: 4/3; }
.ratio-1-1 { aspect-ratio: 1; }
.rounded { border-radius: var(--radius); }
.border { border: 1px solid var(--line); }
.surface { background: var(--surface); }
.muted-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.text-danger { color: var(--danger) !important; }
.code-block { margin: 12px 0; padding: 14px 16px; border-radius: var(--radius-sm); background: #17212b; color: #e8e2d6; font-size: 12px; line-height: 1.7; overflow: auto; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.sidebar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 34px; align-items: start; }
.sticky { position: sticky; top: 96px; }
.pill-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; background: var(--paper-deep); border-radius: 99px; width: fit-content; }
.pill-tabs a { padding: 6px 14px; border-radius: 99px; font-size: 12px; color: var(--muted); }
.pill-tabs a.is-active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.06); }

/* 响应式 */
@media (max-width: 1080px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-lead { min-height: 380px; }
    .article-layout { grid-template-columns: 1fr; gap: 0; }
    .article-side { display: none; }
    .admin-shell { grid-template-columns: 210px minmax(0, 1fr); }
    .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
    .board-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .container, .narrow { width: calc(100% - 32px); }
    .section { padding: 38px 0; }
    .primary-nav { position: fixed; inset: 106px 0 auto; background: var(--paper); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 12px 16px 18px; display: none; box-shadow: var(--shadow); }
    .primary-nav.is-open { display: flex; }
    .nav-link { padding: 11px 14px; }
    .nav-link.is-active::after { display: none; }
    .header-actions { margin-left: auto; }
    .mobile-toggle { display: grid; }
    .header-search { display: none; }
    .masthead { height: 64px; }
    .topbar-left span:last-child { display: none; }
    .content-grid, .video-grid, .exam-grid, .image-grid { grid-template-columns: repeat(2, 1fr); }
    .image-mosaic { grid-auto-rows: 140px; }
    .image-tile:nth-child(1) { grid-column: span 2; grid-row: span 1; }
    .blog-grid { grid-template-columns: 1fr; }
    .feed-item { grid-template-columns: 1fr 150px; }
    .feature-card { grid-template-columns: 1fr; }
    .feature-card .card-cover { min-height: 240px; }
    .blog-space-grid, .forum-layout, .exam-take-layout, .manage-shell, .member-shell { grid-template-columns: 1fr; }
    .member-side, .manage-side, .exam-timer-card { position: static; }
    .auth-page { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-main { padding: 34px 20px; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 100; transform: translateX(-100%); transition: .25s; }
    .admin-sidebar.is-open { transform: none; }
    .admin-topbar { padding: 0 16px; }
    .admin-content { padding: 20px 16px 40px; }
    .admin-mobile-toggle { display: grid; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
    .member-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: auto; }
    .blog-cover-inner { grid-template-columns: 1fr; }
    .blog-profile { border-radius: var(--radius); }
}
@media (max-width: 640px) {
    body { font-size: 14px; }
    .container { width: calc(100% - 28px); }
    .content-grid, .video-grid, .exam-grid, .image-grid, .album-grid, .photo-grid { grid-template-columns: 1fr; }
    .image-mosaic { grid-template-columns: 1fr 1fr; grid-auto-rows: 120px; }
    .image-tile:nth-child(1) { grid-column: span 2; }
    .hero-lead { min-height: 420px; }
    .hero-copy { padding: 24px; }
    .hero-strip { grid-template-columns: 1fr 1fr; }
    .feed-item { grid-template-columns: 1fr; }
    .feed-thumb { display: none; }
    .blog-card { grid-template-columns: 94px 1fr; }
    .topic-row { grid-template-columns: 38px 1fr; }
    .topic-stats, .topic-last { display: none; }
    .section-head { align-items: flex-start; flex-direction: column; gap: 8px; }
    .article-head h1 { font-size: 30px; }
    .article-body { font-size: 15.5px; }
    .result-hero { grid-template-columns: 1fr; text-align: center; }
    .score-ring { margin: 0 auto; }
    .forum-topic, .reply-item, .question-card { padding: 18px; }
    .reply-item { grid-template-columns: 34px 1fr; }
    .two-col, .three-col { grid-template-columns: 1fr; }
    .sidebar-layout { grid-template-columns: 1fr; }
    .admin-page-head { align-items: flex-start; flex-direction: column; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .topbar-right a:first-child { display: none; }
    .site-footer { margin-top: 40px; }
    .blog-cover { padding-top: 28px; }
    .manage-stat-grid { grid-template-columns: 1fr 1fr; }
}

@media print {
    .site-header, .site-footer, .article-actions, .comments-section, .article-side { display: none !important; }
    .article-layout { display: block; padding: 0; }
}
/* ---------- 补充 ---------- */
.cover-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-family: var(--serif);
    font-size: 44px;
    font-weight: 700;
    color: rgba(255, 253, 248, .9);
    background:
        radial-gradient(circle at 75% 20%, rgba(201, 75, 50, .55), transparent 45%),
        linear-gradient(135deg, #22313d, #0f1820);
    letter-spacing: -.03em;
}
.cover-fallback-article, .cover-fallback-cms { background: linear-gradient(135deg, #2f4550, #17212b); }
.cover-fallback-image { background: linear-gradient(135deg, #c58a63, #823c2d); }
.cover-fallback-video { background: linear-gradient(135deg, #1b2a35, #0a1117); }
.cover-fallback-blog { background: linear-gradient(135deg, #26776c, #0e3d38); }
.cover-fallback-exam { background: linear-gradient(135deg, #b08a4e, #5d4320); }
.hero-fallback { position: absolute; inset: 0; font-size: 120px; opacity: .75; }
.card-cover .cover-fallback, .blog-card-cover .cover-fallback { font-size: 34px; }
.image-tile .cover-fallback { font-size: 54px; }

.user-menu-logout {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    background: none;
    border-radius: 8px;
    font-size: 13px;
    color: var(--muted);
    text-align: left;
}
.user-menu-logout:hover { background: var(--paper-deep); color: var(--danger); }

.db-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 34px;
    align-items: start;
}
@media (max-width: 900px) { .db-grid { grid-template-columns: 1fr; } }

details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary { color: var(--accent); }

.blog-theme-ink .breadcrumb, .blog-theme-ink .breadcrumb a { color: #8f9ca7; }
.blog-theme-ink .article-body { color: #dfe6eb; }
.blog-theme-ink .article-body a { color: #d8b273; }
.blog-theme-ink .blog-side-card, .blog-theme-ink .blog-post-card { background: #16222c; border-color: #26343f; }
.blog-theme-ink .blog-post-card h2 a { color: #f2ede3; }
.blog-theme-ink .blog-space-body { background: #101820; }

.photo-grid a { display: block; overflow: hidden; border-radius: 8px; }
.photo-grid img { transition: transform .4s ease; }
.photo-grid a:hover img { transform: scale(1.03); }

.manage-side .space-mini .eyebrow { margin-bottom: 5px; }
.blog-cover .breadcrumb { color: var(--muted); }
.admin-body details .input, .admin-body details .select { min-width: 0; }


/* ---------- AI 助手 ---------- */
.ai-hero {
    background: linear-gradient(135deg, #101820, #1b2b36 60%, #263d43);
    color: #f2ede3;
    padding: 46px 0 38px;
    position: relative;
    overflow: hidden;
}
.ai-hero::after {
    content: "AI";
    position: absolute;
    right: 4%;
    top: -40px;
    font-family: var(--serif);
    font-size: 230px;
    line-height: 1;
    color: rgba(255,255,255,.04);
    pointer-events: none;
}
.ai-hero h1 { font-size: clamp(38px, 5vw, 58px); color: #fff; margin: 6px 0 8px; }
.ai-hero p { color: #aab5bd; max-width: 680px; margin: 0; }
.ai-hero .badge { background: rgba(255,255,255,.1); color: #e8dfd0; }
.ai-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.ai-chat-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.ai-chat-head { display: flex; align-items: center; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.ai-chat-head strong { display: block; font-size: 13px; }
.ai-chat-head span { display: block; font-size: 10.5px; color: var(--faint); }
.ai-chat-head .badge { margin-left: auto; }
.ai-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.ai-messages { padding: 22px 22px 8px; max-height: 520px; overflow-y: auto; display: grid; gap: 18px; min-height: 280px; }
.ai-message { display: flex; gap: 10px; align-items: flex-start; }
.ai-message-user { justify-content: flex-end; }
.ai-message-user .ai-bubble { background: var(--ink); color: #fff; border-radius: 14px 14px 3px 14px; }
.ai-message-bot .ai-bubble { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px 14px 14px 3px; }
.ai-avatar { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 9px; background: var(--ink); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-size: 11px; }
.ai-bubble { padding: 12px 15px; font-size: 13.5px; line-height: 1.8; max-width: 82%; white-space: pre-line; }
.ai-sources { display: grid; gap: 4px; margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ai-sources a { font-size: 11.5px; color: var(--teal); text-decoration: underline; text-underline-offset: 2px; }
.ai-form { border-top: 1px solid var(--line); padding: 14px 18px 16px; background: var(--surface); }
.ai-form textarea { min-height: 70px; resize: vertical; margin-bottom: 8px; }
.ai-suggestion { display: block; width: 100%; text-align: left; padding: 8px 0; border: 0; border-bottom: 1px dashed var(--line); background: none; font-size: 12px; color: var(--muted); line-height: 1.6; }
.ai-suggestion:last-child { border-bottom: 0; }
.ai-suggestion:hover { color: var(--accent); }
.ai-tools { margin-top: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.ai-tools-head { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.ai-tools-head strong { color: var(--ink); font-size: 12px; }
.ai-tools-buttons { display: flex; gap: 5px; flex-wrap: wrap; }
.ai-tool-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 11px; font-size: 11px; color: var(--ink-2); }
.ai-tool-btn:hover { border-color: var(--teal); color: var(--teal); }
.ai-tool-btn[disabled] { opacity: .5; }
.ai-tools-output { display: none; margin-top: 8px; font-size: 12px; color: var(--muted); white-space: pre-line; background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; }
.ai-tools-output.is-visible { display: block; }
@media (max-width: 900px) { .ai-layout { grid-template-columns: 1fr; } }
