/* 观澜 · 古为今用写作台 —— 现代极简 + 东方意象（宣纸/墨/朱砂） */
:root {
  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-2: #fbfaf6;
  --ink: #24221b;
  --ink-2: #6f6a5c;
  --ink-3: #a29c8b;
  --line: #e6e1d4;
  --line-2: #efece2;
  --accent: #b0402a;        /* 朱砂 */
  --accent-soft: #f7ebe6;
  --qing: #37535e;          /* 黛青 */
  --qing-soft: #e9eff1;
  --gold: #9a7b45;
  --ok: #3a7d5c;
  --warn: #b07d2a;
  --serif: "Noto Serif SC","Songti SC","STSong","SimSun",serif;
  --sans: -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Segoe UI",sans-serif;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(36,34,27,.05), 0 6px 24px rgba(36,34,27,.06);
  --shadow-lg: 0 4px 12px rgba(36,34,27,.08), 0 16px 48px rgba(36,34,27,.10);
}
* { margin:0; padding:0; box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
html,body { height:100%; }
body {
  font-family: var(--sans); background: var(--bg); color: var(--ink);
  font-size:15px; line-height:1.7; -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
button { font-family:inherit; cursor:pointer; border:none; background:none; }
input,textarea,select { font-family:inherit; font-size:inherit; color:inherit; }
img { max-width:100%; }
a { color:inherit; text-decoration:none; }

/* ===== 布局骨架：电脑左侧栏 / 平板窄侧栏 / 手机底部标签栏 ===== */
.shell { display:none; min-height:100vh; min-height:100dvh; }
.shell.on { display:flex; }
.sidebar {
  width:216px; flex-shrink:0; background:var(--surface); border-right:1px solid var(--line);
  display:flex; flex-direction:column; position:sticky; top:0;
  height:100vh; height:100dvh;
}
.brand { padding:26px 20px 18px; display:flex; align-items:center; gap:12px; }
.brand-seal {
  width:44px; height:44px; background:var(--accent); color:#fff; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--serif); font-size:15px; font-weight:700; letter-spacing:1px;
  writing-mode:vertical-rl; line-height:1.05; padding:4px 0; flex-shrink:0;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.22);
}
.brand-name { font-family:var(--serif); font-size:21px; font-weight:700; letter-spacing:2px; }
.brand-sub { font-size:11px; color:var(--ink-3); letter-spacing:1.5px; margin-top:2px; }
.nav { flex:1; padding:8px 12px; overflow-y:auto; }
.nav-item {
  display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px;
  color:var(--ink-2); font-size:14.5px; margin-bottom:2px; transition:.15s;
}
.nav-item:hover { background:var(--line-2); color:var(--ink); }
.nav-item.on { background:var(--accent); color:#fff; font-weight:500; }
.nav-item .ni { font-size:16px; width:20px; text-align:center; }
.side-foot { padding:16px; border-top:1px solid var(--line); font-size:12px; color:var(--ink-3); }
.usage-chip { background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:10px 12px; margin-bottom:10px; }
.usage-chip b { font-size:13px; color:var(--ink); }
.usage-bar { height:5px; background:var(--line); border-radius:3px; margin-top:6px; overflow:hidden; }
.usage-bar i { display:block; height:100%; background:var(--qing); border-radius:3px; }
.main { flex:1; min-width:0; width:100%; }
.page { max-width:960px; margin:0 auto; padding:34px clamp(16px,3vw,36px) 88px; }
/* 热榜页用更宽的容器，一行四个才真正放得开；左右留白收紧，把宽度让给卡片 */
.page-wide {
  max-width:1320px;
  padding-left:clamp(12px,1.6vw,24px);
  padding-right:clamp(12px,1.6vw,24px);
}

/* 底部标签栏（仅小屏显示） */
.tabbar { display:none; }
.page-head { display:flex; align-items:baseline; justify-content:space-between; margin-bottom:22px; flex-wrap:wrap; gap:8px; }
.page-title { font-family:var(--serif); font-size:26px; letter-spacing:2px; }
.page-title small { font-size:12px; color:var(--ink-3); letter-spacing:1px; margin-left:12px; font-family:var(--sans); }

/* ===== 通用组件 ===== */
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); }
.card-pad { padding:22px 24px; }
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  padding:9px 18px; border-radius:10px; font-size:14px; font-weight:500;
  background:var(--ink); color:#fff; transition:.15s;
}
.btn:hover { opacity:.9; }
.btn:disabled { opacity:.45; cursor:not-allowed; }
.btn-accent { background:var(--accent); }
.btn-ghost { background:transparent; color:var(--ink-2); border:1px solid var(--line); }
.btn-ghost:hover { background:var(--line-2); color:var(--ink); }
.btn-sm { padding:5px 12px; font-size:13px; border-radius:8px; }
.btn-lg { padding:13px 30px; font-size:16px; border-radius:12px; letter-spacing:2px; }
.btn-block { width:100%; }
.tag { display:inline-block; padding:2px 10px; border-radius:99px; font-size:12px; background:var(--qing-soft); color:var(--qing); margin:2px 4px 2px 0; }
.tag-red { background:var(--accent-soft); color:var(--accent); }
.tag-gold { background:#f5efe3; color:var(--gold); }
.muted { color:var(--ink-2); font-size:13px; }
.hint { color:var(--ink-3); font-size:12.5px; }
.field { margin-bottom:16px; }
.field label { display:block; font-size:13px; font-weight:600; margin-bottom:6px; color:var(--ink-2); }
.field input[type=text],.field input[type=password],.field input[type=email],.field select,.field textarea {
  width:100%; padding:10px 14px; border:1px solid var(--line); border-radius:10px; background:var(--surface);
  outline:none; transition:.15s; font-size:14.5px;
}
.field input:focus,.field textarea:focus,.field select:focus { border-color:var(--qing); box-shadow:0 0 0 3px rgba(55,83,94,.1); }
.field textarea { resize:vertical; min-height:110px; line-height:1.8; }
.seg { display:inline-flex; background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:3px; gap:2px; }
.seg button { padding:6px 14px; border-radius:8px; font-size:13.5px; color:var(--ink-2); }
.seg button.on { background:var(--surface); color:var(--ink); font-weight:600; box-shadow:var(--shadow); }
.empty { text-align:center; padding:56px 20px; color:var(--ink-3); }
.empty .e-icon { font-size:34px; margin-bottom:10px; opacity:.6; }

/* toast */
#toast-wrap { position:fixed; top:20px; left:50%; transform:translateX(-50%); z-index:999; display:flex; flex-direction:column; gap:8px; align-items:center; }
.toast {
  background:var(--ink); color:#fff; padding:10px 22px; border-radius:99px; font-size:14px;
  box-shadow:var(--shadow-lg); animation:toastIn .25s; max-width:86vw;
}
.toast.err { background:var(--accent); }
.toast.ok { background:var(--ok); }
@keyframes toastIn { from{opacity:0; transform:translateY(-8px);} to{opacity:1;} }

/* modal（自适应：宽屏居中，内容超高时内部滚动；小屏见底部媒体查询） */
.modal-mask {
  position:fixed; inset:0; background:rgba(30,28,22,.45); z-index:900;
  display:flex; align-items:center; justify-content:center;
  padding:clamp(10px,2.6vw,28px);
}
.modal-shell {
  position:relative; width:100%; max-width:520px;
  max-height:min(90vh, 940px); max-height:min(90dvh, 940px);
  display:flex;
}
.modal-shell.modal-wide { max-width:min(1060px, 96vw); }
.modal-shell.modal-sm { max-width:400px; }
.modal {
  background:var(--surface); border-radius:16px; box-shadow:var(--shadow-lg);
  flex:1 1 auto; width:100%; min-width:0; min-height:0; padding:clamp(20px,3vw,28px);
  overflow-y:auto; overscroll-behavior:contain; animation:toastIn .2s;
}
.modal h3 { font-family:var(--serif); font-size:19px; margin-bottom:12px; letter-spacing:1px; padding-right:36px; }
.modal-x {
  position:absolute; top:10px; right:10px; z-index:6;
  width:34px; height:34px; border-radius:10px; line-height:1;
  display:flex; align-items:center; justify-content:center;
  font-size:15px; color:var(--ink-3);
  background:var(--surface-2); border:1px solid var(--line);
  transition:.15s; padding:0;
}
.modal-x:hover { background:var(--accent); border-color:var(--accent); color:#fff; }
.code-box {
  font-family:ui-monospace,Consolas,monospace; font-size:24px; letter-spacing:3px; text-align:center;
  background:var(--surface-2); border:1px dashed var(--line); border-radius:12px; padding:18px; margin:14px 0; color:var(--accent); font-weight:700;
}

/* spinner */
.spinner { width:22px; height:22px; border:3px solid var(--line); border-top-color:var(--accent); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to{transform:rotate(360deg);} }
.loading-panel { text-align:center; padding:60px 20px; }
.loading-panel .lp-status { margin-top:16px; color:var(--ink-2); font-size:14.5px; }
.loading-panel .lp-quote { font-family:var(--serif); color:var(--ink-3); font-size:13px; margin-top:22px; letter-spacing:1px; }

/* ===== 登录页 ===== */
.auth-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; background:
  radial-gradient(1200px 600px at 80% -10%, #efe9db 0%, transparent 60%),
  radial-gradient(900px 500px at -10% 110%, #eceee6 0%, transparent 55%), var(--bg); }
.auth-card { width:400px; max-width:92vw; background:var(--surface); border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow-lg); padding:36px 38px 30px; }
.auth-brand { text-align:center; margin-bottom:26px; }
.auth-brand .brand-seal { width:58px; height:58px; font-size:19px; border-radius:13px; margin:0 auto 14px; }
.auth-tabs { display:flex; border-bottom:1px solid var(--line); margin-bottom:22px; }
.auth-tabs button { flex:1; padding:11px; font-size:14.5px; color:var(--ink-3); border-bottom:2px solid transparent; margin-bottom:-1px; }
.auth-tabs button.on { color:var(--accent); border-bottom-color:var(--accent); font-weight:600; }

/* ===== 热榜 ===== */
.plat-tabs { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:18px; }
.plat-tab {
  padding:7px 16px; border-radius:99px; font-size:13.5px; background:var(--surface);
  border:1px solid var(--line); color:var(--ink-2); transition:.15s;
}
.plat-tab:hover { border-color:var(--qing); }
.plat-tab.on { background:var(--ink); color:#fff; border-color:var(--ink); }
.hot-list { display:flex; flex-direction:column; gap:10px; }
.hot-item {
  display:flex; align-items:center; gap:16px; padding:15px 20px; background:var(--surface);
  border:1px solid var(--line); border-radius:12px; transition:.15s; cursor:pointer;
}
.hot-item:hover { border-color:var(--qing); box-shadow:var(--shadow); }
.hot-rank { font-family:var(--serif); font-size:19px; width:28px; text-align:center; color:var(--ink-3); flex-shrink:0; }
.hot-rank.top { color:var(--accent); font-weight:700; }
.hot-body { flex:1; min-width:0; }
.hot-title { font-size:15px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.hot-meta { font-size:12px; color:var(--ink-3); margin-top:3px; }
.hot-go { color:var(--ink-3); font-size:13px; flex-shrink:0; }
.hot-item:hover .hot-go { color:var(--accent); }

/* ===== 分析页 ===== */
.an-topic { display:flex; align-items:center; gap:14px; margin-bottom:18px; }
.an-topic-badge {
  writing-mode:vertical-rl; background:var(--accent); color:#fff; font-family:var(--serif);
  padding:10px 5px; border-radius:6px; font-size:13px; letter-spacing:3px; flex-shrink:0;
}
.section-title {
  font-family:var(--serif); font-size:17px; letter-spacing:1px; margin:30px 0 14px;
  display:flex; align-items:center; gap:10px;
}
.section-title::after { content:""; flex:1; height:1px; background:var(--line); }
.emotion-bar { display:flex; height:14px; border-radius:8px; overflow:hidden; margin:14px 0 10px; }
.emotion-legend { display:flex; flex-wrap:wrap; gap:10px 20px; font-size:12.5px; color:var(--ink-2); }
.emotion-legend i { display:inline-block; width:9px; height:9px; border-radius:3px; margin-right:5px; vertical-align:0; }
.arg-card { margin-bottom:14px; overflow:hidden; }
.arg-head { display:flex; align-items:center; gap:10px; padding:13px 18px; background:var(--surface-2); border-bottom:1px solid var(--line-2); }
.arg-side { font-size:12px; padding:2px 10px; border-radius:99px; font-weight:600; flex-shrink:0; }
.arg-side.oppose { background:var(--accent-soft); color:var(--accent); }
.arg-side.support { background:#e8f2ec; color:var(--ok); }
.arg-side.neutral { background:var(--qing-soft); color:var(--qing); }
.arg-point { font-size:14.5px; font-weight:600; }
.classic-card { padding:18px 20px; border-top:1px solid var(--line-2); }
.classic-quote-wrap { display:flex; gap:16px; align-items:flex-start; }
.classic-quote-v {
  writing-mode:vertical-rl; font-family:var(--serif); font-size:13px; color:var(--gold);
  letter-spacing:4px; border-right:1px solid var(--line); padding-right:12px; max-height:180px;
  overflow:hidden; flex-shrink:0; line-height:1.9; opacity:.9;
}
.classic-body { flex:1; min-width:0; }
.classic-source { display:inline-block; background:var(--accent); color:#fff; font-size:11.5px; padding:1px 9px; border-radius:4px; font-family:var(--serif); letter-spacing:1px; margin-bottom:8px; }
.classic-quote { font-family:var(--serif); font-size:16.5px; line-height:1.9; margin-bottom:8px; }
.classic-trans { font-size:13px; color:var(--ink-2); margin-bottom:10px; }
.classic-interp { font-size:14px; background:var(--surface-2); border-left:3px solid var(--qing); padding:10px 14px; border-radius:0 8px 8px 0; }
.angles li { margin:6px 0 6px 20px; }
.mirror-item { padding:10px 16px; background:var(--surface-2); border-radius:10px; margin-bottom:8px; font-size:14px; }

/* ===== 生成页 ===== */
.gen-layout { display:grid; grid-template-columns:280px 1fr; gap:20px; align-items:start; }
@media (max-width:1000px){ .gen-layout { grid-template-columns:240px 1fr; } }
@media (max-width:880px){ .gen-layout { grid-template-columns:1fr; } }
.gen-opts { position:sticky; top:20px; }
.opt-group { margin-bottom:16px; }
.opt-label { font-size:12.5px; font-weight:600; color:var(--ink-2); margin-bottom:7px; display:flex; justify-content:space-between; }
.opt-label .val { color:var(--accent); font-weight:400; }
.plat-check { display:flex; gap:8px; flex-wrap:wrap; }
.plat-check label {
  padding:7px 14px; border:1px solid var(--line); border-radius:9px; font-size:13.5px; cursor:pointer;
  color:var(--ink-2); transition:.15s; user-select:none;
}
.plat-check label.on { background:var(--qing); color:#fff; border-color:var(--qing); }
.plat-check label.lock { opacity:.45; }
.article-tabs { display:flex; gap:6px; margin-bottom:14px; flex-wrap:wrap; }
.article-tabs button { padding:7px 16px; border-radius:9px; font-size:13.5px; border:1px solid var(--line); color:var(--ink-2); }
.article-tabs button.on { background:var(--surface); color:var(--accent); border-color:var(--accent); font-weight:600; }
.article-view { padding:26px 30px; }
.article-title { font-family:var(--serif); font-size:21px; line-height:1.5; margin-bottom:6px; }
.article-meta { font-size:12px; color:var(--ink-3); margin-bottom:18px; padding-bottom:14px; border-bottom:1px solid var(--line-2); }
.article-content { font-size:15.5px; line-height:2; white-space:pre-wrap; word-break:break-word; overflow-wrap:anywhere; }
.article-content::-webkit-scrollbar { width:6px; }
.scores-row { display:flex; gap:8px; flex-wrap:wrap; margin:16px 0 4px; }
.score-chip { padding:4px 12px; border-radius:8px; background:var(--surface-2); font-size:12px; color:var(--ink-2); border:1px solid var(--line-2); }
.score-chip b { color:var(--ink); }
.score-chip.danger b { color:var(--accent); }
.rewrite-chips { display:flex; gap:6px; flex-wrap:wrap; margin-top:14px; padding-top:14px; border-top:1px dashed var(--line); }
.rewrite-chips button {
  font-size:12.5px; padding:5px 12px; border-radius:99px; border:1px solid var(--line); color:var(--ink-2); transition:.15s;
}
.rewrite-chips button:hover { border-color:var(--accent); color:var(--accent); }

/* ===== 历史 ===== */
.hist-item { display:flex; align-items:center; gap:14px; padding:14px 18px; border-bottom:1px solid var(--line-2); cursor:pointer; }
.hist-item:hover { background:var(--surface-2); }
.hist-item:last-child { border-bottom:none; border-radius:0 0 var(--radius) var(--radius); }
.hist-main { flex:1; min-width:0; }
.hist-title { font-size:14.5px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.hist-sub { font-size:12px; color:var(--ink-3); margin-top:2px; }
.hist-act { display:flex; gap:6px; flex-shrink:0; }

/* ===== 会员 ===== */
.plans-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px; }
.plan-card { padding:24px 22px; position:relative; }
.plan-name { font-family:var(--serif); font-size:19px; margin-bottom:4px; }
.plan-price { font-size:30px; font-weight:700; margin:10px 0 2px; }
.plan-price small { font-size:13px; color:var(--ink-3); font-weight:400; }
.plan-feats { margin:14px 0; font-size:13px; color:var(--ink-2); line-height:2.1; }
.plan-current { position:absolute; top:16px; right:16px; }
.plan-card.current { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent); }

/* ===== 管理后台 ===== */
.stat-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin-bottom:22px; }
.stat-card { padding:18px 20px; }
.stat-num { font-size:26px; font-weight:700; font-family:var(--serif); }
.stat-label { font-size:12px; color:var(--ink-3); margin-top:2px; }
table.tbl { width:100%; border-collapse:collapse; font-size:13.5px; }
.tbl th { text-align:left; padding:10px 12px; color:var(--ink-3); font-weight:600; border-bottom:1px solid var(--line); font-size:12px; }
.tbl td { padding:10px 12px; border-bottom:1px solid var(--line-2); vertical-align:middle; }
.tbl tr:hover td { background:var(--surface-2); }
.admin-tabs { display:flex; gap:8px; margin-bottom:18px; flex-wrap:wrap; }

/* ===== 热榜平铺（默认一行四个，卡片可拖拽缩放） ===== */
.hot-grid {
  display:grid;
  /* auto-fill：≥1366 的屏幕正好 4 列（一页四个），随屏幕自动降到 3/2/1 列，卡片宽度始终一致 */
  grid-template-columns:repeat(auto-fill,minmax(min(268px,100%),1fr));
  grid-auto-rows:148px;          /* 行基准高度，卡片按 span 组合 */
  gap:14px;
  align-items:stretch;
}
.hot-board {
  grid-column:span var(--cw,1);
  grid-row:span var(--ch,3);
  min-height:0;
  background:var(--surface); border:1px solid var(--line); border-radius:14px;
  box-shadow:var(--shadow); overflow:hidden; display:flex; flex-direction:column;
  position:relative;
}
.hot-board.resizing {
  outline:2px solid var(--accent); outline-offset:-2px;
  box-shadow:0 10px 30px rgba(176,64,42,.2); z-index:5;
}
/* 右下角拖拽手柄 */
.hot-grip {
  position:absolute; right:0; bottom:0; width:22px; height:22px; z-index:4;
  cursor:nwse-resize; opacity:0; transition:opacity .16s;
  border-bottom-right-radius:14px;
  touch-action:none; user-select:none; -webkit-user-select:none;
}
.hot-grip::after {
  content:''; position:absolute; right:4px; bottom:4px; width:9px; height:9px;
  border-right:2px solid var(--ink-3); border-bottom:2px solid var(--ink-3);
  border-radius:0 0 3px 0; transition:border-color .16s;
}
.hot-board:hover .hot-grip { opacity:.75; }
.hot-grip:hover { opacity:1 !important; }
.hot-grip:hover::after { border-color:var(--accent); }
/* 拖动时显示的尺寸提示 */
.hot-size-tip {
  position:absolute; left:10px; bottom:9px; z-index:4;
  font-size:11px; padding:2px 8px; border-radius:7px; letter-spacing:.6px;
  background:var(--accent-soft); color:var(--accent);
  pointer-events:none; opacity:0; transition:opacity .16s;
}
.hot-board.resizing .hot-size-tip { opacity:1; }
.hot-hint-bar {
  display:flex; align-items:center; gap:8px; margin:-6px 0 14px;
  font-size:12px; color:var(--ink-3);
}
.hot-hint-bar .k {
  display:inline-block; padding:1px 6px; border:1px solid var(--line);
  border-radius:5px; background:var(--surface-2); font-size:11px;
}
.hot-board-head {
  display:flex; align-items:center; gap:8px; padding:11px 15px;
  border-bottom:1px solid var(--line-2); background:var(--surface-2);
}
.hot-board-name { font-family:var(--serif); font-size:15px; font-weight:600; letter-spacing:1px; }
.hot-board-dot { width:7px; height:7px; border-radius:50%; background:var(--ok); flex-shrink:0; }
.hot-board-src { margin-left:auto; font-size:10.5px; color:var(--ink-3); letter-spacing:.5px; }
.hot-rows { padding:6px; flex:1; min-height:0; overflow-y:auto; }
.hot-rows::-webkit-scrollbar { width:5px; }
.hot-rows::-webkit-scrollbar-thumb { background:var(--line); border-radius:3px; }
.hot-row { display:flex; gap:9px; padding:6px 9px; border-radius:9px; cursor:pointer; transition:.12s; align-items:flex-start; }
.hot-row:hover { background:var(--accent-soft); }
.hot-row .r { font-family:var(--serif); font-size:13px; color:var(--ink-3); width:17px; flex-shrink:0; text-align:center; margin-top:1px; }
.hot-row.top3 .r { color:var(--accent); font-weight:700; }
.hot-row .t { font-size:13.5px; line-height:1.5; }
.hot-row .h { font-size:11px; color:var(--ink-3); margin-top:1px; }
.hot-board-err { padding:26px 16px; text-align:center; color:var(--ink-3); font-size:12.5px; line-height:1.8; }
.hot-refresh { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:16px; }

/* ===== 事件速览弹层（宽屏双栏 / 窄屏堆叠，随屏幕自适应） ===== */
.brief-eyebrow { font-size:11.5px; letter-spacing:2px; color:var(--accent); margin-bottom:6px; }
.brief-title {
  font-family:var(--serif); font-size:clamp(17px,2vw,21px); line-height:1.55;
  margin:0 0 16px; padding-right:38px;
}
.brief-cols { display:grid; grid-template-columns:1.05fr 1fr; gap:18px; align-items:stretch; }
.brief-block { display:flex; flex-direction:column; min-width:0; }
.brief-block-head { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.brief-block-head b { font-size:13px; }
.src-chip { font-size:11px; padding:1px 9px; border-radius:99px; letter-spacing:.3px; }
.src-chip.real { background:#e8f2ec; color:var(--ok); }
.src-chip.fake { background:#fbf3e4; color:var(--warn); }
.brief-summary, .brief-cmts {
  width:100%; border:1px solid var(--line); border-radius:10px; padding:11px 13px;
  font-size:13.5px; line-height:1.85; resize:vertical; flex:1; min-height:200px;
}
.brief-note { font-size:12px; color:var(--ink-3); line-height:1.7; margin-top:14px; }
.brief-actions {
  display:flex; gap:10px; flex-wrap:wrap; align-items:center;
  margin-top:16px; padding-top:16px; border-top:1px solid var(--line-2);
}

/* ===== 会员 / 收款码 ===== */
.pay-qr { width:210px; height:210px; object-fit:contain; border:1px solid var(--line); border-radius:12px; background:#fff; }
.pay-amount { font-family:var(--serif); font-size:34px; color:var(--accent); font-weight:700; }
.order-no {
  font-family:ui-monospace,Consolas,monospace; font-size:15px; letter-spacing:1.5px;
  background:var(--surface-2); border:1px dashed var(--line); border-radius:9px; padding:9px 13px;
  display:inline-block; color:var(--ink);
}
.order-row { display:flex; align-items:center; gap:12px; padding:12px 16px; border-bottom:1px solid var(--line-2); font-size:13.5px; flex-wrap:wrap; }
.order-row:last-child { border-bottom:none; }
.order-row .o-main { flex:1; min-width:180px; }
.st { font-size:11.5px; padding:2px 10px; border-radius:99px; }
.st-pending { background:var(--surface-2); color:var(--ink-2); border:1px solid var(--line); }
.st-submitted { background:#fbf3e4; color:var(--warn); }
.st-paid { background:#e8f2ec; color:var(--ok); }
.st-canceled { background:var(--line-2); color:var(--ink-3); }
.proof-thumb { width:52px; height:52px; object-fit:cover; border-radius:8px; border:1px solid var(--line); cursor:pointer; }

/* ===== 批量创作平铺 ===== */
.gen-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(348px,100%),1fr)); gap:14px; align-items:start; }
.gen-card {
  background:var(--surface); border:1px solid var(--line); border-radius:14px;
  box-shadow:var(--shadow); display:flex; flex-direction:column; overflow:hidden;
}
.gen-card-head { display:flex; align-items:center; gap:8px; padding:11px 15px; border-bottom:1px solid var(--line-2); background:var(--surface-2); }
.gen-card-plat { font-family:var(--serif); font-size:14.5px; font-weight:600; letter-spacing:1px; }
.gen-card-body { padding:13px 15px; }
.gen-card-title {
  width:100%; border:1px solid var(--line-2); border-radius:8px; padding:7px 10px;
  font-size:14px; font-weight:600; margin-bottom:9px; background:var(--surface);
}
.gen-card-title:focus, .gen-card-text:focus { border-color:var(--qing); outline:none; }
.gen-card-text {
  width:100%; border:1px solid var(--line-2); border-radius:9px; padding:10px 12px;
  font-size:13.5px; line-height:1.85; resize:vertical; min-height:220px; background:var(--surface);
}
.gen-card-read { font-size:13.5px; line-height:1.85; white-space:pre-wrap; max-height:300px; overflow-y:auto; }
.gen-card-read::-webkit-scrollbar { width:5px; }
.gen-card-read::-webkit-scrollbar-thumb { background:var(--line); border-radius:3px; }
.gen-card-foot { padding:9px 15px; border-top:1px solid var(--line-2); display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.gen-card-foot button { font-size:12.5px; padding:5px 11px; border-radius:8px; border:1px solid var(--line); color:var(--ink-2); transition:.13s; }
.gen-card-foot button:hover { border-color:var(--accent); color:var(--accent); }
.gen-card-foot button.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
.gen-card-foot button.primary:hover { opacity:.9; color:#fff; }
.gen-card-wordcount { margin-left:auto; font-size:11.5px; color:var(--ink-3); }

/* ===== 古籍批量导入 ===== */
.imp-drop {
  display:block; /* label 默认 inline：22px 纵向 padding 会画出行盒、叠到标题行上 */
  border:1.5px dashed var(--line); border-radius:12px; padding:22px; text-align:center;
  color:var(--ink-2); font-size:13.5px; cursor:pointer; transition:.15s; background:var(--surface-2);
}
.imp-drop:hover { border-color:var(--accent); color:var(--accent); }
.imp-preview { max-height:270px; overflow:auto; margin-top:12px; }
.imp-preview table { font-size:12.5px; }
.imp-bar { height:6px; background:var(--line); border-radius:3px; overflow:hidden; margin:10px 0 4px; }
.imp-bar i { display:block; height:100%; background:var(--accent); transition:.3s; }
.imp-log { font-size:12.5px; color:var(--ink-2); max-height:180px; overflow-y:auto; line-height:1.9; }
.imp-ok { color:var(--ok); }
.imp-skip { color:var(--warn); }

/* ============================================================
   响应式：电脑 / 平板 / 手机
   ≤1000px 平板竖屏 ｜ ≤880px 切底部标签栏 ｜ ≤760px 手机 ｜ ≤560px 小屏
   ============================================================ */

/* ---- 侧栏收窄：把宽度让给热榜，保证 1366/1440 屏也能排满四列 ---- */
@media (max-width:1500px){
  .sidebar { width:190px; }
}

/* ---- 窄屏下热榜卡片一律占满一格 ----
   大屏拖出来的宽度记忆（--cw）在小屏会横向溢出。这里用纯 CSS 兜底，
   不依赖 resize / ResizeObserver 事件（无头浏览器和嵌入 webview 里这些事件会哑掉）。 */
@media (max-width:1000px){
  .hot-grid .hot-board { grid-column: span 1 !important; }
}
@media (max-width:1000px){
  .sidebar { width:180px; }
  .brand { padding:22px 16px 14px; }
}

/* ---- 小屏：侧栏隐藏，改用底部标签栏（否则手机上完全没有导航） ---- */
@media (max-width:880px){
  .sidebar { display:none; }
  .main { padding-bottom:calc(58px + env(safe-area-inset-bottom,0px)); }
  .page, .page-wide { max-width:100%; padding:22px clamp(14px,4vw,24px) 46px; }

  .tabbar {
    display:flex; position:fixed; left:0; right:0; bottom:0; z-index:800;
    background:rgba(255,255,255,.94);
    -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
    border-top:1px solid var(--line);
    padding-bottom:env(safe-area-inset-bottom,0px);
  }
  .tab-item {
    flex:1; min-width:0; display:flex; flex-direction:column; align-items:center; gap:2px;
    padding:8px 2px 7px; font-size:10.5px; color:var(--ink-3); letter-spacing:.5px; transition:.15s;
  }
  .tab-item .ti { font-size:17px; line-height:1.15; }
  .tab-item.on { color:var(--accent); font-weight:600; }
  .tab-item:active { background:var(--surface-2); }

  /* 速览改为单栏堆叠，输入框给足高度，窗口更舒展 */
  .brief-cols { grid-template-columns:1fr; gap:14px; }
  .brief-summary { min-height:140px; }
  .brief-cmts { min-height:230px; }
}

/* ---- 手机 ---- */
@media (max-width:760px){
  body { font-size:14.5px; }
  .page-head { margin-bottom:16px; }
  .page-title { font-size:22px; }
  .page-title small { display:block; margin:4px 0 0; }
  .card-pad { padding:18px 16px; }
  .article-view { padding:18px 16px; }
  .gen-opts { position:static; }
  .gen-grid { grid-template-columns:1fr; }
  .stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .plan-price { font-size:26px; }
  .auth-card { padding:26px 20px 22px; border-radius:16px; }
  .hot-hint-bar { font-size:11.5px; }
  .rewrite-chips { gap:5px; }

  /* 输入框 ≥16px，避免 iOS 聚焦时整页被放大 */
  .field input, .field textarea, .field select,
  .brief-summary, .brief-cmts, .gen-card-title, .gen-card-text,
  input[type=text], input[type=password], input[type=email] { font-size:16px; }

  /* 表格不再撑破页面：列数 ≥5 的表才允许横向滚动 */
  .card:has(table.tbl) { overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .tbl:has(th:nth-child(5)) { min-width:560px; }

  /* 弹层贴底铺满，接近全屏 */
  .modal-mask { align-items:flex-end; padding:0; }
  .modal-shell, .modal-shell.modal-wide, .modal-shell.modal-sm {
    max-width:100%; max-height:94vh; max-height:94dvh;
  }
  .modal {
    border-radius:18px 18px 0 0;
    padding:22px 16px calc(22px + env(safe-area-inset-bottom,0px));
  }
  .modal-x { top:12px; right:12px; }
  #toast-wrap { top:12px; width:92vw; }
  .toast { max-width:92vw; }
}

/* ---- 小屏手机 ---- */
@media (max-width:560px){
  .hot-grid { grid-auto-rows:132px; }
  .plat-tabs, .admin-tabs { gap:6px; }
  .plat-tab, .article-tabs button { padding:6px 12px; font-size:13px; }
  .stat-grid { grid-template-columns:1fr; }
  .order-row .o-main { min-width:120px; }
  .gen-card-foot { gap:5px; }
  .article-title { font-size:18px; }
  .code-box { font-size:17px; letter-spacing:2px; padding:14px 10px; }
  .order-no { font-size:13px; letter-spacing:1px; word-break:break-all; }
  .pay-qr { width:100%; max-width:240px; height:auto; aspect-ratio:1/1; }
  /* 竖排原文摘录窄屏太占位，正文里已完整引用 */
  .classic-quote-v { display:none; }
}

/* ---- 触屏设备：拖拽手柄常显（触屏没有 hover 可触发） ---- */
@media (hover:none), (pointer:coarse){
  .hot-grip { opacity:.7; }
  .hot-grip:hover { opacity:1; }
}

/* ===== 构建版本水印：用于判断浏览器加载的是否为最新发布 ===== */
.build-ver {
  margin-top:14px; text-align:center; font-size:11.5px; color:var(--ink-3);
  letter-spacing:.3px; opacity:.8; line-height:1.7;
}
.build-ver b { color:var(--accent); font-weight:600; letter-spacing:.5px; }
.side-foot .build-ver { margin-top:10px; text-align:left; border-top:1px dashed var(--line); padding-top:8px; }
