/* =========================================================
   拣豆 · 大模型安全知识档案馆 · 浅色档案馆主题
   纸底 / 墨色 / 朱砂印,与竞品深色霓虹科技风刻意拉开距离
   ========================================================= */

:root {
  /* 档案馆色板(PRD 前端风格设计) */
  --bg: #f7f4ec;        /* 纸底 */
  --surface: #fffdf8;   /* 表面 */
  --ink: #2a2720;       /* 墨色 */
  --muted: #7a7466;     /* 弱墨 */
  --rule: #e5dfd0;      /* 纸线 */
  --accent: #b0442e;    /* 朱砂 */
  --accent2: #0e7c6b;   /* 深青 */
  --warn: #b45309;      /* 琥珀 */
  --ok: #3f6212;        /* 墨绿 */
  --danger: #b91c1c;    /* 赤红 */
  --index-bg: #26221a;  /* 目录栏深墨色 */
  --index-ink: #d8d2c2;
  --index-muted: #8d8674;
  --serif: Georgia, 'Times New Roman', 'Songti SC', 'SimSun', serif;
  --sans: -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
  --shadow: 0 1px 3px rgba(42, 39, 32, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: clip;   /* 侧栏收起滑出(负 margin)时避免出现横向滚动条 */
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: var(--mono);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.88em;
  color: var(--accent2);
}

/* ============ 左右分栏骨架 ============ */
.layout { display: flex; min-height: 100vh; }

/* ---- 左侧目录栏(暖墨渐变 + 纸纹噪点 + 朱砂水印) ---- */
.index {
  width: 240px;
  flex-shrink: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #31291f 0%, #282116 52%, #1f1a11 100%);
  color: var(--index-ink);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 0.8rem 0.9rem;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid #463c2b;
  box-shadow: inset 0 1px 0 rgba(240, 228, 200, 0.07), inset 0 0 80px rgba(0, 0, 0, 0.28);
  transition: margin-left 0.25s ease;
}
/* 桌面端手动收起:侧栏整体滑出,内容区占满全宽 */
.layout.side-collapsed .index { margin-left: -240px; }
/* 底部「拣豆」藏书章水印(半透明朱砂,旋转 -12 度,不拦截点击) */
.index::after {
  content: "拣豆";
  position: absolute; right: -24px; bottom: 92px;
  font-family: var(--serif); font-weight: 700; font-size: 96px;
  color: rgba(176, 68, 46, 0.07);
  transform: rotate(-12deg);
  letter-spacing: 0.1em;
  pointer-events: none;
  z-index: 0;
}
.index .brand {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.1rem 0.3rem 0.9rem;
  border-bottom: 1px solid rgba(233, 222, 196, 0.13);
}
.seal {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #c25a3c, var(--accent)); color: #fbf8ef;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 1.5rem; font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(251, 248, 239, 0.55), inset 0 0 0 4px var(--accent), 0 0 18px rgba(176, 68, 46, 0.3);
  letter-spacing: 0.05em;
}
.brand-text {
  font-family: var(--serif); font-size: 0.78rem; line-height: 1.4;
  color: #efe6d3;
}
.brand-text .bn {
  display: block; font-size: 0.92rem; letter-spacing: 0.12em;
}
.brand-text small {
  display: block; font-family: var(--mono); font-size: 0.5rem;
  color: #9d9278; letter-spacing: 0.1em; margin-top: 0.18rem;
}
.index .cat {
  padding: 0.85rem 0.35rem 0.3rem;
  font-size: 0.56rem; letter-spacing: 0.22em; color: #a99e83;
  font-family: var(--mono);
}
.index nav a {
  display: flex; align-items: center; gap: 0.5rem;
  color: #c2b9a1; font-size: 0.78rem;
  padding: 0.42rem 0.5rem; border-radius: 5px;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.index nav a:hover { background: rgba(176, 68, 46, 0.16); text-decoration: none; color: #f6efe0; border-left-color: rgba(176, 68, 46, 0.65); }
.index nav a.on {
  background: linear-gradient(90deg, rgba(176, 68, 46, 0.26), rgba(176, 68, 46, 0.05) 72%);
  color: #f7f0e2; border-left-color: #c05a3c;
  box-shadow: inset 0 1px 0 rgba(240, 228, 200, 0.08);
}
.index nav a .no { font-family: var(--mono); font-size: 0.6rem; color: #a98f5f; }
.index nav a.on .no { color: #dcbd8d; }
/* 侧边栏底部:用户条 + 操作按钮(两行紧凑布局) */
.index .foot {
  margin-top: auto;
  padding: 0.75rem 0.6rem 0.7rem;
  border-top: 1px solid rgba(233, 222, 196, 0.13);
  display: flex; flex-direction: column; gap: 0.4rem;
}
.index .user-chip {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  width: 100%; font-size: 0.74rem; padding: 0.36rem 0.5rem; border-radius: 5px;
  color: #f0e7d4; border: 1px solid rgba(176, 68, 46, 0.55);
  background: rgba(176, 68, 46, 0.09);
  transition: border-color 0.15s, background 0.15s;
}
.index .user-chip:hover { background: rgba(176, 68, 46, 0.2); text-decoration: none; }
.index .uc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.index .uc-id {
  flex-shrink: 0; font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.06em;
  padding: 0.06rem 0.32rem; border-radius: 8px; background: rgba(176, 68, 46, 0.28); color: #eabda4;
}
.index .foot-actions { display: flex; gap: 0.35rem; }
.index .foot-btn {
  flex: 1; text-align: center; font-size: 0.72rem; cursor: pointer;
  padding: 0.36rem 0; border-radius: 4px;
  border: 1px solid rgba(233, 222, 196, 0.3); color: #dbd4c0;
  display: flex; align-items: center; justify-content: center; gap: 0.2rem;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.index .foot-btn:hover { border-color: var(--accent); color: #f6efe0; text-decoration: none; }
.index .foot-btn.primary { background: var(--accent); border-color: var(--accent); color: #fbf8ef; }
.index .foot-btn.primary:hover { opacity: 0.9; border-color: var(--accent); color: #fbf8ef; }
.index .foot-btn.danger { border-color: var(--danger); color: #e8b4a0; background: transparent; }
.index .foot-btn.danger:hover { background: rgba(185, 28, 28, 0.2); border-color: var(--danger); color: #f2ede0; }
.index .foot-btn-form { flex: 1; display: flex; margin: 0; }
.index .foot-btn-form .foot-btn { flex: 1; width: 100%; }

/* ---- 右侧阅览区(暖纸色) ---- */
.reading {
  flex: 1; min-width: 0;
  background-image: repeating-linear-gradient(0deg, rgba(42, 39, 32, 0.018) 0 1px, transparent 1px 4px);
}
.filehead {
  display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap;
  padding: 0.5rem 1.2rem;
  border-bottom: 1px solid var(--rule);
  background: rgba(251, 248, 239, 0.72);
  font-family: var(--mono); font-size: 0.58rem; color: var(--muted);
  letter-spacing: 0.05em;
}
.filehead .sep { color: #c4bdab; }
.filehead .right { margin-left: auto; display: flex; gap: 0.9rem; align-items: center; }
.stamp {
  color: var(--accent); border: 1px solid rgba(176, 68, 46, 0.4);
  border-radius: 3px; padding: 0.08rem 0.4rem; font-family: var(--sans);
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 1.4rem 3rem; }

/* ============ 通用排版 ============ */
.kicker {
  font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.24em;
  color: var(--accent2); text-transform: uppercase; margin-bottom: 0.6rem;
}
h1 { font-family: var(--serif); font-size: 1.6rem; line-height: 1.3; margin-bottom: 0.5rem; }
h1 em { font-style: normal; color: var(--accent); }
h1 .art-name {
  font-family: var(--serif);
  font-size: 1.15em;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-shadow: 0.5px 0.5px 0 rgba(176, 68, 46, 0.25);
}
h1 .art-name::after {
  content: "·";
  margin: 0 0.18em;
  color: var(--muted);
  font-weight: 400;
}
h2 { font-family: var(--serif); font-size: 1.1rem; }
p { color: var(--ink); margin-bottom: 0.9rem; }

/* ============ 首页:欢迎区 ============ */
.welcome {
  display: grid; grid-template-columns: 1fr auto; gap: 1.4rem; align-items: end;
  padding: 2.2rem 0 1.6rem;
}
.welcome p { color: var(--muted); max-width: 460px; line-height: 1.9; font-size: 0.92rem; }
.welcome-cta { display: flex; gap: 0.7rem; margin-top: 0.4rem; }
.chop {
  text-align: center; padding: 0.6rem 1.2rem 0.3rem;
  border: 2px solid var(--accent); border-radius: 6px;
  color: var(--accent); font-family: var(--serif); font-size: 1.1rem;
  letter-spacing: 0.35em; transform: rotate(-3deg); opacity: 0.92;
  background: rgba(176, 68, 46, 0.06);
  box-shadow: 0 2px 8px rgba(176, 68, 46, 0.12);
}
.chop .c { font-size: 1.35rem; font-weight: 700; }
.chop small { display: block; font-family: var(--mono); font-size: 0.5rem; letter-spacing: 0.12em; margin-top: 0.3rem; }

/* 首页欢迎语与身份徽章 */
.welcome-user { font-size: 0.85rem; color: var(--muted); align-self: center; }
.welcome-user strong { color: var(--ink); }
.badge-identity {
  display: inline-block; margin-left: 0.4rem; padding: 0.08rem 0.5rem;
  border: 1px solid rgba(14, 124, 107, 0.4); border-radius: 10px;
  color: var(--accent2); font-size: 0.68rem;
}

/* ============ 馆藏登记簿 ============ */
.ledger {
  border: 1px solid var(--rule); border-radius: 7px; overflow: hidden;
  background: var(--surface); margin-bottom: 1.8rem; box-shadow: var(--shadow);
}
.ledger-head {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.42rem 0.85rem; border-bottom: 1px solid var(--rule);
  background: #ece6d6;
  font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.16em; color: var(--muted);
}
.ledger-head .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.ledger table { width: 100%; border-collapse: collapse; }
.ledger td { padding: 0.45rem 0.85rem; font-size: 0.82rem; border-bottom: 1px dashed var(--rule); }
.ledger tr:last-child td { border-bottom: none; }
.ledger td .c { font-family: var(--mono); color: var(--muted); font-size: 0.72rem; }
.ledger td .n { font-family: var(--serif); font-size: 1.1rem; font-weight: 700; color: var(--accent); }

/* ============ 品牌释义卡 ============ */
.brand-note {
  border: 1px solid var(--rule); border-radius: 6px;
  background: var(--surface); box-shadow: var(--shadow);
  padding: 1.2rem 1.4rem; margin-bottom: 2rem;
}
.brand-note .bn-kicker {
  font-family: var(--mono); font-size: 0.54rem; letter-spacing: 0.22em;
  color: var(--accent2); margin-bottom: 0.7rem;
}
.brand-note .chars { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.brand-note .char { flex: 1; min-width: 180px; }
.brand-note .char .big {
  font-family: var(--serif); font-size: 2rem; color: var(--accent); font-weight: 700;
  margin-bottom: 0.2rem; line-height: 1.1;
  text-shadow: 0.5px 0.5px 0 rgba(176, 68, 46, 0.2);
}
.brand-note .char p { font-size: 0.82rem; color: var(--muted); margin: 0; }
.brand-note .slogan {
  margin-top: 1rem; padding-top: 0.9rem; border-top: 1px dashed var(--rule);
  font-family: var(--mono); font-size: 0.68rem; color: var(--accent); letter-spacing: 0.12em;
}

/* 分节标题 */
.sec { display: flex; align-items: baseline; gap: 0.7rem; margin: 1.6rem 0 0.8rem; }
.sec:first-child { margin-top: 0; }
.sec .sub { font-family: var(--mono); font-size: 0.54rem; color: var(--muted); letter-spacing: 0.1em; }
.sec h2 { font-size: 1.22rem; font-weight: 700; letter-spacing: 0.02em; }

/* 卷宗卡片(彩色装订脊) */
.dossiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; margin-bottom: 1.8rem; }
.dossier {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 7px;
  overflow: hidden; display: flex; box-shadow: var(--shadow);
}
.dossier .spine { width: 5px; flex-shrink: 0; }
.dossier .body { padding: 0.75rem 0.8rem 0.7rem; flex: 1; }
.dossier .no {
  font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.12em;
  margin-bottom: 0.3rem; display: flex; align-items: center; gap: 0.35rem;
}
.dossier .no::before { content: ''; width: 10px; height: 1px; background: currentColor; opacity: 0.5; }
.dossier h3 { font-family: var(--serif); font-size: 0.92rem; margin-bottom: 0.2rem; }
.dossier p { font-size: 0.72rem; color: var(--muted); line-height: 1.65; margin: 0; }
.d1 .spine, .d1 .no { background: var(--accent); color: var(--accent); }
.d2 .spine, .d2 .no { background: var(--accent2); color: var(--accent2); }
.d3 .spine, .d3 .no { background: var(--warn); color: var(--warn); }
.d4 .spine, .d4 .no { background: var(--ok); color: var(--ok); }
.d5 .spine, .d5 .no { background: #1d4ed8; color: #1d4ed8; }

/* ============ 按钮 ============ */
.btn {
  display: inline-block; font-family: var(--sans); font-size: 0.88rem;
  padding: 0.5rem 1.3rem; border-radius: 6px; cursor: pointer;
  border: 1px solid transparent; text-align: center; transition: opacity 0.15s;
}
.btn:hover { opacity: 0.88; text-decoration: none; }
.btn.primary { background: var(--accent); color: #fbf8ef; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--rule); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }

/* ============ 门禁(登录/注册) ============ */
.gate { display: flex; justify-content: center; padding: 2.4rem 0 1rem; }
.gate-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 10px; padding: 1.8rem 2rem 1.6rem;
  box-shadow: var(--shadow);
}
.gate-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.3rem; }
.gate-head h1 { font-size: 1.35rem; margin-bottom: 0.15rem; }
.gate-head p { font-size: 0.78rem; color: var(--muted); margin: 0; }
.gate-seal {
  width: 52px; height: 52px; flex-shrink: 0; border-radius: 50%;
  background: var(--accent); color: #fbf8ef;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 1.5rem; font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(251, 248, 239, 0.6);
}
.gate-form { display: flex; flex-direction: column; gap: 0.9rem; }
.field label {
  display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.3rem;
}
.field label em { color: var(--accent); font-style: normal; }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.58rem 0.75rem;
  border: 1px solid var(--rule); border-radius: 6px;
  background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(176, 68, 46, 0.15);
}
.gate-form .btn { margin-top: 0.4rem; letter-spacing: 0.3em; }
.gate-switch { margin-top: 1.1rem; text-align: center; font-size: 0.82rem; color: var(--muted); }
.gate-switch a { margin-left: 0.3rem; }

/* 登录图形验证码:输入框 + 图片同行,不额外包裹(连续失败达阈值后才展示) */
.captcha-body { display: flex; align-items: stretch; gap: 0.5rem; }
.captcha-body input {
  flex: 1; min-width: 0; margin: 0;
  font-family: var(--mono); font-size: 1.05rem; letter-spacing: 0.35em;
  text-transform: uppercase; text-align: center; padding-left: 0.75rem;
}
/* 验证码图片:按钮承载,悬停浮出"换一张"遮罩 */
.captcha-figure {
  flex: none; position: relative; display: block; padding: 0;
  width: 120px; height: 42px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--rule); border-radius: 6px; background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.captcha-figure img { display: block; width: 100%; height: 100%; object-fit: cover; }
.captcha-figure:hover, .captcha-figure:focus-visible {
  border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 2px rgba(176, 68, 46, 0.15);
}
.captcha-figure-mask {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.05rem;
  background: rgba(42, 39, 32, 0.72); color: #fbf8ef;
  opacity: 0; transition: opacity 0.16s;
}
.captcha-figure:hover .captcha-figure-mask,
.captcha-figure:focus-visible .captcha-figure-mask { opacity: 1; }
.captcha-figure-icon { font-size: 0.95rem; line-height: 1; }
.captcha-figure-text { font-size: 0.62rem; letter-spacing: 0.08em; }
/* 刷新中:图片半透明 + 图标旋转 */
.captcha-figure.loading img { opacity: 0.35; }
.captcha-figure.loading .captcha-figure-mask { opacity: 1; }
.captcha-figure.loading .captcha-figure-icon { animation: jd-rot 0.8s linear infinite; }
/* hidden 属性优先于 .field 的 flex 布局,避免被覆盖后仍占位 */
.captcha-field[hidden] { display: none; }

/* 错误提示 */
.alert {
  background: rgba(185, 28, 28, 0.06); border: 1px solid rgba(185, 28, 28, 0.35);
  color: var(--danger); border-radius: 6px;
  padding: 0.55rem 0.8rem; font-size: 0.82rem; margin-bottom: 1rem;
}

/* 卷宗占位页 */
.dossier-page { padding: 2.4rem 0 1rem; }
.notice {
  display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap;
  border: 1px dashed var(--rule); border-radius: 7px;
  background: var(--surface); padding: 0.7rem 0.9rem;
  font-size: 0.82rem; color: var(--muted); margin-top: 1rem;
}

/* ============ 响应式 ============ */
/* 折叠按钮:任意宽度可见(桌面收起侧栏,移动端开合抽屉) */
.nav-toggle {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 32px; height: 32px; flex-shrink: 0;
  border: 1px solid var(--rule); border-radius: 6px;
  background: var(--surface); color: var(--ink);
  font-size: 1rem; line-height: 1; cursor: pointer;
  margin-right: 0.5rem;
  transition: border-color 0.15s, color 0.15s;
}
.nav-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* 抽屉遮罩:默认隐藏 */
.index-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 150;
  background: rgba(42, 39, 32, 0.45);
}

@media (max-width: 1024px) {
  .layout { flex-direction: row; }
  /* 抽屉模式:侧边栏默认隐藏,滑入显示(2026-09 起覆盖 ≤1024px 平板竖屏) */
  .index {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 200;
    width: 260px; height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 8px 40px rgba(42, 39, 32, 0.22);
    /* 恢复原有的纵向 flex 布局 */
    flex-direction: column; align-items: stretch;
    padding: 1.1rem 0.8rem 0.9rem;
  }
  .layout.drawer-open .index { transform: translateX(0); }
  .layout.drawer-open .index-backdrop { display: block; }
  /* 移动端抽屉与桌面端收起互不冲突:收起态仅作用于桌面 margin 方案,抽屉模式强制复位 */
  .layout.side-collapsed .index { margin-left: 0; }
  
  /* 让主内容区占据全屏 */
  .reading { flex: 1; }

  /* 汉堡按钮在 filehead 里显示 */
  .filehead { padding: 0.4rem 0.7rem; gap: 0.45rem; font-size: 0.52rem; }
  .filehead .right { gap: 0.5rem; }
  .wrap { padding: 0 0.85rem 2rem; }

  /* 排版收窄 */
  h1 { font-size: 1.35rem; }
  .page-head { padding: 1.4rem 0 1rem; }
  .welcome { grid-template-columns: 1fr; padding: 1.4rem 0 1.2rem; gap: 1rem; }
  .welcome-cta { flex-wrap: wrap; }
  .chop { justify-self: start; padding: 0.5rem 1rem 0.25rem; font-size: 1rem; }
  .gate { padding: 1.4rem 0 1rem; }
  .gate-card { padding: 1.3rem 1.15rem 1.2rem; }
  /* 验证码:窄屏下输入框独占一行,图片整宽并加大点击区 */
  .captcha-body { flex-wrap: wrap; }
  .captcha-body input { flex: 1 1 100%; }
  .captcha-figure { width: 100%; height: 46px; }

  /* 卡片内边距收紧 */
  .profile-card { padding: 1.1rem 1rem; gap: 1.1rem; }
  .admin-table th, .admin-table td { padding: 0.45rem 0.6rem; }
  .comment.child { margin-left: 0.6rem; }
  .pagination { flex-wrap: wrap; }
  .activity-item { flex-wrap: wrap; }
  .notice-item { flex-wrap: wrap; gap: 0.4rem; }
  .foot-row { flex-wrap: wrap; }
  .view-toggle { flex-wrap: wrap; }
  .matrix-chart { height: 360px; }
  .tool-form { padding: 0.9rem 0.85rem 1.1rem; }
  .thread-form { padding: 0.85rem 0.8rem; }
  .ledger th { padding: 0.4rem 0.55rem; }
}

/* ============ 知识层通用组件 ============ */
.page-head { padding: 2rem 0 1.2rem; }
.page-head h1 { margin-bottom: 0.4rem; }
.page-head p { color: var(--muted); max-width: 560px; font-size: 0.9rem; }
.prose { line-height: 1.9; color: var(--ink); }
.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }
.prose p { margin: 0 0 0.85rem; }
.prose h1, .prose h2, .prose h3 {
  font-family: var(--serif); color: var(--ink);
  margin: 1.2rem 0 0.5rem; line-height: 1.4;
}
.prose h1 { font-size: 1.2rem; }
.prose h2 { font-size: 1.05rem; }
.prose h3 { font-size: 0.95rem; }
.prose ul, .prose ol { margin: 0 0 0.85rem; padding-left: 1.4rem; }
.prose li { margin-bottom: 0.25rem; }
.prose blockquote {
  margin: 0 0 0.85rem; padding: 0.4rem 0.9rem;
  border-left: 3px solid var(--accent); background: rgba(176, 68, 46, 0.05);
  color: var(--muted);
}
.prose blockquote p { margin: 0; }
.prose pre {
  margin: 0 0 0.85rem; padding: 0.8rem 1rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--rule); border-left: 3px solid var(--accent);
  border-radius: 6px; overflow-x: auto; font-size: 0.82rem; line-height: 1.6;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
/* 代码块复制按钮:JS 为 .prose pre 包一层 .code-wrap 并注入右上角按钮 */
.code-wrap { position: relative; margin: 0 0 0.85rem; }
.code-wrap > pre { margin: 0; }
.code-copy {
  position: absolute; top: 0.4rem; right: 0.4rem;
  font-family: var(--sans); font-size: 0.68rem; line-height: 1;
  color: var(--muted); background: var(--surface);
  border: 1px solid var(--rule); border-radius: 4px;
  padding: 0.22rem 0.5rem; cursor: pointer;
  opacity: 0; transform: translateY(-2px); pointer-events: none;
  transition: opacity 0.15s, transform 0.15s, color 0.15s, border-color 0.15s;
}
.code-wrap:hover .code-copy,
.code-copy:focus-visible {
  opacity: 1; transform: translateY(0); pointer-events: auto;
}
.code-copy:hover { color: var(--accent); border-color: var(--accent); }
.code-copy.copied {
  color: var(--ok); border-color: var(--ok);
  opacity: 1; transform: translateY(0); pointer-events: auto;
}
.prose code {
  font-family: var(--mono); font-size: 0.82em;
  background: rgba(42, 39, 32, 0.07); padding: 0.1rem 0.35rem; border-radius: 3px;
}
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 1.2rem 0; }
.prose a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(176, 68, 46, 0.3); }
.prose a:hover { border-bottom-color: var(--accent); }
.prose strong { font-weight: 700; }
.prose em { font-style: italic; }
/* Markdown 图片:自适应容器宽度,避免大图撑破版面 */
.prose img, .c-content img { max-width: 100%; height: auto; border-radius: 6px; }
/* 列表页摘要:行内 Markdown 渲染,无块级 margin,保持紧凑布局 */
.prose-inline { line-height: 1.7; color: var(--ink); }
.prose-inline p { margin: 0; }
.prose-inline strong { font-weight: 700; }
.prose-inline em { font-style: italic; }
.prose-inline code { font-family: var(--mono); font-size: 0.82em; background: rgba(42, 39, 32, 0.07); padding: 0.1rem 0.35rem; border-radius: 3px; }
.prose-inline a { color: var(--accent); text-decoration: none; }
.back { margin-top: 2rem; display: flex; gap: 1rem; align-items: center; font-size: 0.85rem; }

/* 卷宗阅读器翻页导航(上一个/下一个内容,档案书签样式) */
.pager-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 0.9rem; margin-top: 2.4rem; flex-wrap: wrap;
}
.pager {
  display: inline-flex; align-items: center; gap: 0.6rem;
  min-width: 10.5rem;
  padding: 0.55rem 0.9rem 0.55rem 0.85rem;
  border: 1px solid rgba(176, 68, 46, 0.28);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(42, 39, 32, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s, background 0.18s;
}
.pager.next { flex-direction: row-reverse; }
.pager:hover {
  border-color: var(--accent);
  background: #fdf6f0;
  box-shadow: 0 4px 12px rgba(176, 68, 46, 0.12);
  transform: translateY(-1px);
}
.pager-arrow {
  font-size: 1.05rem; line-height: 1; color: var(--accent);
  font-family: var(--serif);
  transition: transform 0.18s;
}
.pager.prev:hover .pager-arrow { transform: translateX(-3px); }
.pager.next:hover .pager-arrow { transform: translateX(3px); }
.pager-body { display: inline-flex; flex-direction: column; gap: 0.12rem; min-width: 0; }
.pager-label {
  font-family: var(--mono); font-size: 0.58rem;
  letter-spacing: 0.18em; color: var(--muted); text-transform: uppercase;
}
.pager-title {
  font-family: var(--serif); font-size: 0.88rem; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 12rem;
}
.pager:hover .pager-title { color: var(--accent); }
.pager.disabled { opacity: 0.35; pointer-events: none; }
.pager-center {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.3rem 0.8rem;
  font-size: 0.74rem; color: var(--muted);
  border: 1px dashed var(--rule); border-radius: 16px;
  transition: color 0.15s, border-color 0.15s;
}
.pager-center:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
@media (max-width: 720px) {
  .pager-nav { flex-direction: column; align-items: stretch; }
  .pager-center { order: -1; align-self: center; }
  .pager { min-width: 0; }
}

/* 筛选 chip 条 */
.filter-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.2rem; }
.filter-chips .chip-label { font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.14em; color: var(--muted); margin-right: 0.3rem; }

/* 馆藏搜索条:flex-wrap 兜底,窄屏按钮不被挤压 */
.repo-search { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.2rem; max-width: 34rem; }
.repo-search .form-input { flex: 1; padding: 0.5rem 0.85rem; border: 1px solid var(--rule); border-radius: 20px; background: var(--surface); color: var(--text); font-size: 0.85rem; }
.repo-search .form-input:focus { outline: none; border-color: var(--accent); }

.chip {
  padding: 0.3rem 0.85rem; border: 1px solid var(--rule); border-radius: 20px;
  font-size: 0.8rem; color: var(--muted); background: var(--surface); cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.chip.active { background: var(--accent); color: #fbf8ef; border-color: var(--accent); }
.chip.restricted-link { color: var(--warn); border-color: rgba(180, 83, 9, 0.4); }

/* 知识库·细分方向:按阶段分行,每行阶段标签 + 紧凑 chips 流(可折叠) */
.cat-chips {
  margin: -0.2rem 0 1.3rem;
  border: 1px solid var(--rule); border-radius: 8px;
  background: rgba(176, 68, 46, 0.035);
  overflow: hidden;
}
.cat-chips.collapsed .cat-body { display: none; }
.cat-chips-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.55rem 0.9rem;
  cursor: pointer; user-select: none;
  transition: background 0.15s;
}
.cat-chips-head:hover { background: rgba(176, 68, 46, 0.07); }
.cat-chips-title {
  font-family: var(--sans); font-weight: 700; font-size: 0.84rem; color: var(--accent);
}
.cat-chips-right { display: flex; align-items: center; gap: 0.5rem; }
.cat-clear {
  font-size: 0.74rem; color: var(--muted);
  border-radius: 10px; padding: 0.12rem 0.55rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cat-clear:hover { color: var(--accent); text-decoration: none; }
.cat-clear.active {
  background: rgba(176, 68, 46, 0.1); color: var(--accent);
}
.cat-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.3rem; height: 1.3rem; font-size: 0.6rem; color: var(--accent);
  border: 1px solid var(--rule); border-radius: 4px;
  transition: transform 0.2s, border-color 0.15s, color 0.15s;
}
.cat-chips.collapsed .cat-toggle { transform: rotate(180deg); }
.cat-toggle:hover { border-color: var(--accent); color: var(--accent); }
.cat-body { padding: 0.3rem 0.9rem 0.55rem; }
/* 三个阶段并排成列,列宽按内容自适应(内容多者更宽,内容少者不浪费空间) */
.cat-columns {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.6rem 1.2rem;
}
.cat-stage {
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
  min-width: 9rem;
  position: relative;
  /* 固定列高上限,超出后该列内部滚动(类似分页翻页) */
  max-height: 16rem;
  overflow-y: auto;
  padding-right: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(176, 68, 46, 0.35) transparent;
}
.cat-stage::-webkit-scrollbar { width: 6px; }
.cat-stage::-webkit-scrollbar-thumb { background: rgba(176, 68, 46, 0.3); border-radius: 3px; }
.cat-stage::-webkit-scrollbar-track { background: transparent; }
.cat-stage-label {
  font-size: 0.74rem; color: var(--accent);
  font-family: var(--sans); letter-spacing: 0.02em;
  padding-bottom: 0.25rem; margin-bottom: 0.25rem;
  border-bottom: 1px dashed rgba(176, 68, 46, 0.25);
}
/* 细分方向树:顶层威胁类别为一级,子分类缩进 + 左侧虚线连接线体现层级 */
.cat-tree { list-style: none; margin: 0; padding: 0; }
.cat-node { display: block; margin: 0.16rem 0; }
.cat-tree .chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  white-space: nowrap;
  padding: 0.22rem 0.7rem; font-size: 0.78rem;
}
.cat-tree.sub {
  margin: 0.1rem 0 0.2rem 1.05rem;
  border-left: 1px dashed rgba(176, 68, 46, 0.3);
  padding-left: 0.5rem;
}
.cat-tree .chip.sub {
  padding: 0.18rem 0.6rem; font-size: 0.72rem;
  color: var(--muted); background: transparent;
  border: 1px dashed rgba(176, 68, 46, 0.3);
}
.cat-tree .chip.sub:hover { border-color: var(--accent); color: var(--accent); }
.cat-tree .chip.sub.active { background: var(--accent); color: #fbf8ef; border-style: solid; }
/* 细分方向挂载卷宗数(「n 卷」文字徽章,0 时不渲染) */
.cat-tree .cat-count {
  font-style: normal;
  font-size: 0.62rem; font-family: var(--sans);
  color: var(--accent); background: rgba(176, 68, 46, 0.1);
  border-radius: 8px; padding: 0.05rem 0.4rem;
  vertical-align: 0.05em; white-space: nowrap;
}
.cat-tree .chip.sub .cat-count { background: rgba(176, 68, 46, 0.08); }
.cat-tree .chip.active .cat-count { background: rgba(251, 248, 239, 0.22); color: #fbf8ef; }
/* 细分方向悬停预览 tooltip */
.cat-tip {
  position: fixed; z-index: 999;
  max-width: 260px;
  padding: 0.45rem 0.65rem; font-size: 0.74rem; line-height: 1.5;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: 6px;
  box-shadow: 0 6px 18px rgba(42, 39, 32, 0.14);
  pointer-events: none; display: none;
}
@media (max-width: 720px) {
  .cat-columns { display: block; }
  .cat-stage { width: 100%; max-width: 100%; }
}

/* 视角切换 */
.view-toggle { display: flex; gap: 0.5rem; margin: 1rem 0 1.2rem; }
.view-toggle .vt {
  padding: 0.45rem 1.2rem; border: 1px solid var(--rule); border-radius: 6px;
  background: var(--surface); color: var(--muted); font-size: 0.85rem;
}
.view-toggle .vt.active { background: var(--accent); color: #fbf8ef; border-color: var(--accent); }
.view-toggle .vt:hover { text-decoration: none; }

/* 矩阵画布 */
.matrix-chart { width: 100%; height: 460px; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; margin-bottom: 1.5rem; }

/* 攻击者视角:ATLAS 战术分组卡片 */
.attack-groups { display: flex; flex-direction: column; gap: 0.7rem; }
.attack-group {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px;
  overflow: hidden; box-shadow: var(--shadow);
}
.ag-head {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.7rem 1rem; cursor: pointer; list-style: none;
  font-family: var(--mono); font-size: 0.82rem; color: var(--ink);
  border-left: 3px solid var(--accent);
  background: rgba(176, 68, 46, 0.04);
}
.ag-head::-webkit-details-marker { display: none; }
.ag-idx {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fbf8ef; font-size: 0.7rem; font-weight: 700;
  flex-shrink: 0;
}
.ag-tactic { flex: 1; font-family: var(--serif); font-size: 0.92rem; }
.ag-count { color: var(--muted); font-size: 0.74rem; }
.ag-body { padding: 0.4rem 0.6rem 0.6rem; display: flex; flex-direction: column; gap: 0.3rem; }
.ag-item {
  display: flex; align-items: center; gap: 0.6rem; justify-content: space-between;
  padding: 0.5rem 0.7rem; border-radius: 5px; text-decoration: none;
  border: 1px solid transparent; transition: background 0.15s, border-color 0.15s;
}
.ag-item:hover { background: rgba(176, 68, 46, 0.06); border-color: rgba(176, 68, 46, 0.2); }
.ag-name { font-family: var(--serif); font-size: 0.86rem; color: var(--ink); }
.ag-meta { display: flex; align-items: center; gap: 0.45rem; font-size: 0.72rem; color: var(--muted); }
.ag-score { font-family: var(--mono); color: var(--accent2); font-weight: 600; }

/* 知识/案例条目(装订脊卡片) */
/* kb-grid:卷宗/案例列表多列网格,宽屏 3 列自适应,窄屏自动降列 */
/* 含 kb-grid 的页面内容容器同步加宽,否则 wrap 720px 限制导致自动降为单列 */
.reading:has(.kb-grid) .wrap { max-width: 1240px; }
.kb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 0.8rem;
  align-items: stretch;
}
.kb-grid .kb-item { margin-bottom: 0; height: 100%; }
.kb-item {
  display: flex; background: var(--surface); border: 1px solid var(--rule);
  border-radius: 7px; overflow: hidden; margin-bottom: 0.7rem; box-shadow: var(--shadow);
}
.kb-item .spine { width: 5px; flex-shrink: 0; }
.kb-item .body { padding: 0.8rem 1rem 0.75rem; flex: 1; min-width: 0; }
.kb-item .no { font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 0.2rem; }
.kb-item h3 { font-family: var(--serif); font-size: 0.98rem; margin-bottom: 0.25rem; }
.kb-item p { font-size: 0.8rem; color: var(--muted); line-height: 1.7; margin: 0; }
.kb-item .score { margin-left: auto; font-family: var(--mono); }

/* 条目元信息行:标签/时间不换行;来源随宽度自适应,仅超出部分折到第二行(截断优先于整体掉行) */
.kb-item .meta {
  margin-top: 0.5rem; padding-top: 0.45rem; border-top: 1px dashed var(--rule);
  display: flex; flex-wrap: wrap; align-items: flex-start;
  gap: 0.35rem; row-gap: 0.3rem;
  font-size: 0.74rem; color: var(--muted);
}
.kb-item .meta .tag,
.kb-item .meta .meta-date {
  display: inline-block; white-space: nowrap; flex: 0 0 auto;
  font-size: 0.72rem; line-height: 1.6;
}
.kb-item .meta .meta-source {
  display: inline-block;
  font-size: 0.72rem; line-height: 1.6;
  overflow-wrap: anywhere; word-break: break-word;
  min-width: 6rem; flex: 1 1 6rem;
}
.kb-item .meta .meta-date,
.kb-item .meta .meta-source { color: var(--muted); }

/* 研究追踪检索条与筛选条:窄屏搜索按钮独占一行,芯片不撑破栏宽 */
.journal-search { display: flex; gap: 0.5rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1.1rem; }
.journal-search .field { flex: 1; min-width: 0; }
.journal-chips { margin-bottom: 1.1rem; }

/* 徽章与标签 */
.badge { display: inline-block; padding: 0.08rem 0.5rem; border-radius: 10px; font-size: 0.7rem; }
.badge.risk-high { background: rgba(185, 28, 28, 0.1); color: var(--danger); }
.badge.risk-mid { background: rgba(180, 83, 9, 0.1); color: var(--warn); }
.badge.risk-low { background: rgba(63, 98, 18, 0.1); color: var(--ok); }
.tag { display: inline-block; padding: 0.08rem 0.5rem; border: 1px solid var(--rule); border-radius: 4px; font-size: 0.7rem; color: var(--accent2); }
/* 外联/本站 标识(深度文章/关联案例/外部参考条目,管理员发布时选择) */
.badge.link-tag { margin-right: 0.35rem; vertical-align: 0.08rem; font-weight: 600; letter-spacing: 0.04em; }
.badge.link-tag.external { background: rgba(176, 68, 46, 0.12); color: var(--accent); }
.badge.link-tag.internal { background: rgba(14, 124, 107, 0.12); color: var(--accent2); }
.rating-badge { display: inline-block; padding: 0.08rem 0.5rem; border-radius: 4px; font-size: 0.7rem; font-weight: 700; }
.rating-badge.r-S { background: rgba(176, 68, 46, 0.12); color: var(--accent); }
.rating-badge.r-A { background: rgba(14, 124, 107, 0.12); color: var(--accent2); }
.rating-badge.r-B { background: rgba(180, 83, 9, 0.12); color: var(--warn); }
.rating-badge.r-C { background: rgba(125, 116, 102, 0.12); color: var(--muted); }

/* 缓解建议 / 列表 */
.mitigations { list-style: none; padding-left: 0; }
.mitigations li { position: relative; padding: 0.35rem 0 0.35rem 1.4rem; font-size: 0.88rem; }
.mitigations li::before {
  content: '■'; position: absolute; left: 0; top: 0.35rem;
  color: var(--accent); font-size: 0.7rem;
}

/* 卷宗详情:外部参考链接列表 */
.ext-links { list-style: none; padding-left: 0; }
.ext-links li { position: relative; padding: 0.35rem 0 0.35rem 1.4rem; font-size: 0.88rem; }
.ext-links li::before {
  content: '↗'; position: absolute; left: 0; top: 0.35rem;
  color: var(--accent2); font-size: 0.78rem;
}
.ext-links a { color: var(--accent); text-decoration: none; border-bottom: 1px dashed rgba(176, 68, 46, 0.4); }
.ext-links a:hover { color: var(--accent2); border-bottom-style: solid; }

/* 书架卡片 */
.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.8rem; align-items: stretch; }
.shelf-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 0.9rem 1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: border-color 0.15s, box-shadow 0.15s; }
.shelf-card:hover { border-color: rgba(176, 68, 46, 0.45); box-shadow: 0 3px 10px rgba(42, 39, 32, 0.1); }
.shelf-card .shelf-top { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.shelf-card .stars { margin-left: auto; font-size: 0.7rem; color: var(--muted); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62%; }
/* 影音馆视频来源徽标:按平台着色(哔哩哔哩蓝 / YouTube 红 / 其余深青),档案馆低饱和风格 */
.shelf-card .tag.src-bilibili { background: rgba(0, 161, 214, 0.12); color: #0a8fbe; border-color: rgba(0, 161, 214, 0.30); }
.shelf-card .tag.src-youtube { background: rgba(230, 33, 23, 0.10); color: #cf2317; border-color: rgba(230, 33, 23, 0.30); }
.shelf-card .tag.src-other { background: rgba(14, 124, 107, 0.12); color: var(--accent2); border-color: rgba(14, 124, 107, 0.30); }
.shelf-card h3 { font-family: var(--serif); font-size: 0.92rem; margin-bottom: 0.3rem; line-height: 1.4; }
.shelf-card h3 a { color: var(--ink); }
.shelf-card h3 a:hover { color: var(--accent); text-decoration: none; }
.shelf-card h3 a .arr { color: var(--accent); font-size: 0.78em; margin-left: 0.15rem; }
/* AI 网站导航:标题前的网站图标 */
.shelf-card h3 a .site-ico { width: 20px; height: 20px; border-radius: 5px; object-fit: contain; vertical-align: -4px; margin-right: 0.3rem; }
.shelf-card p { font-size: 0.76rem; color: var(--muted); line-height: 1.65; margin: 0 0 0.15rem; }
.shelf-card p.src { font-family: var(--mono); font-size: 0.68rem; color: var(--accent2); overflow-wrap: anywhere; }
.shelf-card .meta { margin-top: auto; padding-top: 0.45rem; font-size: 0.72rem; color: var(--muted); border-top: 1px dashed var(--rule); display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }

/* ===== AI 网站导航:极简可点击卡片(整卡为链接,hover 诱导跳转) ===== */
.ai-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.7rem; align-items: stretch; }
.ai-card {
  display: flex; gap: 0.7rem; padding: 0.85rem 0.95rem;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px;
  text-decoration: none; color: inherit;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.ai-card:hover {
  border-color: var(--accent2); background: #fffdf7;
  box-shadow: 0 4px 14px rgba(42, 39, 32, 0.10); transform: translateY(-2px);
}
.ai-card-ico { width: 40px; height: 40px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.ai-card-ico img { width: 40px; height: 40px; border-radius: 9px; object-fit: contain; }
.ai-ico-ph {
  width: 40px; height: 40px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper); border: 1px solid var(--rule); font-family: var(--serif);
  font-size: 1.15rem; color: var(--accent2);
}
.ai-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ai-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.ai-card-name { font-family: var(--serif); font-size: 1rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-card:hover .ai-card-name { color: var(--accent2); }
.ai-card-go {
  font-size: 0.74rem; color: var(--muted); white-space: nowrap; flex-shrink: 0;
  transition: color 0.16s ease;
}
.ai-card:hover .ai-card-go { color: var(--accent); }
.ai-card-meta { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.2rem; font-size: 0.7rem; }
.ai-card-vendor { color: var(--accent2); font-weight: 500; white-space: nowrap; }
.ai-card-vendor:empty { display: none; }
.ai-card-domain { color: var(--muted); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-card-desc { font-size: 0.76rem; color: var(--muted); line-height: 1.6; margin: 0.25rem 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* AI 网站导航:页尾关于块(无边框纯居中文字收尾) */
.ai-about {
  margin: 2.2rem auto 0; max-width: 760px;
  padding-top: 1.4rem; border-top: 1px solid var(--rule);
  text-align: center;
}
.ai-about-head .kicker { margin-bottom: 0.45rem; }
.ai-about h2 { font-family: var(--serif); font-size: 1.05rem; margin: 0 0 0.7rem; }
.ai-about-main p { font-size: 0.78rem; color: var(--muted); line-height: 1.8; margin: 0 0 0.5rem; text-align: center; }
.ai-about-main p:last-of-type { margin-bottom: 0; }

/* 书架新排版:主题分区 → 来源分组 → 推荐卡(设计稿 shelf-redesign-preview) */
/* 含书架主题分区的页面内容容器同步加宽,否则 wrap 720px 限制导致网格过窄 */
.reading:has(.shelf-zone) .wrap { max-width: 1180px; }
.head-stats { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.7rem; }
.head-stat { font-family: var(--mono); font-size: 0.66rem; color: var(--accent2); border: 1px solid rgba(14, 124, 107, 0.3); background: rgba(14, 124, 107, 0.05); border-radius: 12px; padding: 0.12rem 0.6rem; }

/* 主题索引导航(sticky) */
.shelf-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  margin-bottom: 1.6rem; padding: 0.55rem 0.9rem;
  border: 1px solid var(--rule); border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
}
.shelf-nav .sn-label { font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.16em; color: var(--muted); margin-right: 0.3rem; }
.shelf-nav a {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.24rem 0.7rem; border-radius: 20px;
  font-size: 0.78rem; color: var(--ink);
  border: 1px solid var(--rule); background: var(--surface);
  transition: border-color 0.15s, color 0.15s;
}
.shelf-nav a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.shelf-nav a .c { font-family: var(--mono); font-size: 0.6rem; color: var(--accent); }
.shelf-nav .sn-total { margin-left: auto; font-family: var(--mono); font-size: 0.62rem; color: var(--muted); }

/* 主题分区(书橱) */
.shelf-zone { margin-bottom: 2.6rem; scroll-margin-top: 3.4rem; }
.zone-head {
  display: flex; align-items: baseline; gap: 0.9rem; flex-wrap: wrap;
  padding-bottom: 0.55rem; margin-bottom: 1.1rem;
  border-bottom: 2px solid var(--rule);
}
.zone-no { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; color: var(--accent); letter-spacing: 0.1em; }
.zone-head h2 { font-family: var(--serif); font-size: 1.22rem; }
.zone-en { font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.14em; color: var(--muted); }
.zone-count { margin-left: auto; font-family: var(--mono); font-size: 0.66rem; color: var(--muted); }

/* 来源分组 */
.zone-group { margin-bottom: 1.3rem; }
.group-label { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.65rem; }
.group-label .gl-tag {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.16rem 0.7rem; border-radius: 4px;
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em;
}
.group-label .gl-tag.overseas { color: var(--accent2); border: 1px solid rgba(14, 124, 107, 0.35); background: rgba(14, 124, 107, 0.06); }
.group-label .gl-tag.domestic { color: var(--accent); border: 1px solid rgba(176, 68, 46, 0.35); background: rgba(176, 68, 46, 0.06); }
.group-label .gl-tag.project { color: var(--warn); border: 1px solid rgba(180, 83, 9, 0.4); background: rgba(180, 83, 9, 0.06); }
.group-label .gl-en { font-family: var(--mono); font-size: 0.54rem; letter-spacing: 0.12em; color: var(--muted); }
.group-label .gl-count { font-family: var(--mono); font-size: 0.62rem; color: var(--muted); }

/* 回顶 */
.back-top { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--muted); margin-top: 1.6rem; padding: 0.3rem 0.8rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); }
.back-top:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* 书架响应式:≤860px 网格单列、索引导航取消 sticky */
@media (max-width: 860px) {
  .shelf-nav { position: static; }
  .shelf-grid { grid-template-columns: 1fr; }
}

/* 馆藏文档列表:纸面卡片风格。暖白纸卡 + 细线 + 极淡投影,
   标签为低饱和纸感胶囊,与档案馆纸底主题一致 */
.reading:has(.doc-list) .wrap { max-width: 1180px; }
.doc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.75rem; margin-bottom: 0.6rem; align-items: stretch; }
.doc-card {
  display: flex; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: var(--shadow); height: 100%;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.doc-card:hover { border-color: #d8d1bf; box-shadow: 0 3px 10px rgba(42, 39, 32, 0.09); }
.doc-card .doc-body { display: flex; flex-direction: column; padding: 0.85rem 1rem 0.8rem; flex: 1; min-width: 0; }
.doc-card .doc-top { display: flex; align-items: center; gap: 0.4rem; }
.doc-card .doc-cats { display: flex; gap: 0.35rem; flex-wrap: wrap; min-width: 0; }
/* 分类标签:低饱和纸感小方角(与主题色板同源);次级标签中性纸底 */
.doc-card .doc-cats .tag { padding: 0.1rem 0.5rem; border: none; border-radius: 4px; font-size: 0.68rem; line-height: 1.5; }
.doc-card .doc-cats .tag.sub { background: var(--bg); color: var(--muted); border: 1px solid var(--rule); }
.doc-card .doc-cats .tag.cat.c1 { background: rgba(176, 68, 46, 0.08); color: var(--accent); }
.doc-card .doc-cats .tag.cat.c2 { background: rgba(14, 124, 107, 0.08); color: var(--accent2); }
.doc-card .doc-cats .tag.cat.c3 { background: rgba(180, 83, 9, 0.09); color: var(--warn); }
.doc-card .doc-cats .tag.cat.c4 { background: rgba(185, 28, 28, 0.08); color: var(--danger); }
.doc-card .doc-cats .tag.cat.c5 { background: rgba(29, 78, 216, 0.07); color: #1d4ed8; }
.doc-card .doc-cats .tag.cat.c6 { background: rgba(63, 98, 18, 0.08); color: var(--ok); }
.doc-card .doc-cats .tag.cat.internal { background: rgba(180, 83, 9, 0.09); color: var(--warn); }
.doc-card .doc-top .dl-count { margin-left: auto; font-size: 0.66rem; color: var(--muted); font-family: var(--mono); white-space: nowrap; }
.doc-card h3 { font-family: var(--serif); font-size: 1rem; line-height: 1.5; margin: 0.45rem 0 0.25rem; }
.doc-card h3 a { color: var(--ink); text-decoration: none; }
.doc-card h3 a:hover { color: var(--accent); }
.doc-card .doc-desc { font-size: 0.78rem; color: var(--muted); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.doc-card .doc-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 0.55rem; padding-top: 0.45rem; border-top: 1px solid var(--rule); }
.doc-card .doc-foot .rating-badge { border-radius: 4px; font-weight: 600; }
.doc-card .doc-actions { display: inline-flex; align-items: center; gap: 0.9rem; }
.doc-card .doc-read { font-size: 0.74rem; color: var(--accent2); text-decoration: none; white-space: nowrap; }
.doc-card .doc-read:hover { color: var(--accent); }
.doc-card .doc-read .arr { display: inline-block; margin-left: 0.05rem; transition: transform 0.15s ease; }
.doc-card .doc-read:hover .arr { transform: translateX(2px); }
.doc-card .doc-dl { font-size: 0.74rem; color: var(--muted); text-decoration: none; white-space: nowrap; }
.doc-card .doc-dl:hover { color: var(--accent); }
.btn.small { padding: 0.25rem 0.8rem; font-size: 0.76rem; }

/* 分页 */
.pagination { display: flex; gap: 1rem; align-items: center; margin-top: 1.4rem; }
.pagination .pg { padding: 0.35rem 0.9rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); font-size: 0.8rem; }
.pagination .pg:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination .pg-info { font-size: 0.78rem; color: var(--muted); font-family: var(--mono); }

/* 在线 PDF 阅览器:纸面卡风格,工具栏 + 画布舞台 + 底栏快捷键提示 */
.pdf-viewer { border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.pdf-toolbar { display: flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--rule); background: var(--bg); flex-wrap: wrap; }
.pdf-toolbar .pdf-grp { display: flex; align-items: center; gap: 0.3rem; }
.pdf-toolbar .pdf-spacer { flex: 1; min-width: 0.5rem; }
.pdf-btn { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 1.05rem; line-height: 1; cursor: pointer; transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease; }
.pdf-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: #fff; }
.pdf-btn:active:not(:disabled) { transform: translateY(1px); }
.pdf-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pdf-page-input { width: 2.6rem; height: 28px; text-align: center; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 0.8rem; font-family: var(--mono); padding: 0 0.2rem; transition: border-color 0.14s ease; }
.pdf-page-input:focus { outline: none; border-color: var(--accent2); }
.pdf-page-input:disabled { opacity: 0.4; }
.pdf-pager { font-size: 0.8rem; color: var(--muted); font-family: var(--mono); }
.pdf-pager .pdf-sep { margin: 0 0.15rem; }
.pdf-toolbar .pdf-zoom { font-size: 0.78rem; color: var(--muted); font-family: var(--mono); min-width: 3rem; text-align: center; }
.pdf-fit { font-size: 0.95rem; }
.pdf-stage { position: relative; display: flex; justify-content: center; align-items: flex-start; padding: 1.2rem 1rem; background: #e9e5db; overflow: auto; min-height: 420px; }
.pdf-stage canvas { display: block; max-width: 100%; height: auto; box-shadow: 0 4px 18px rgba(42, 39, 32, 0.22); background: #fff; border-radius: 2px; }
.pdf-status { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.8rem; color: var(--muted); }
.pdf-status-txt { font-size: 0.82rem; }
.pdf-status.error .pdf-status-txt { color: var(--danger); }
.pdf-spinner { width: 26px; height: 26px; border: 2.5px solid var(--rule); border-top-color: var(--accent2); border-radius: 50%; animation: pdfspin 0.8s linear infinite; }
.pdf-status.error .pdf-spinner { display: none; }
@keyframes pdfspin { to { transform: rotate(360deg); } }
.pdf-foot { padding: 0.45rem 0.8rem; border-top: 1px solid var(--rule); background: var(--bg); text-align: center; }
.pdf-hint { font-size: 0.7rem; color: var(--muted); font-family: var(--mono); letter-spacing: 0.02em; }

/* 空状态 */
.empty { text-align: center; padding: 2.4rem 0; color: var(--muted); font-size: 0.85rem; border: 1px dashed var(--rule); border-radius: 7px; background: var(--surface); }

/* ============ 列表卡片 / 帖头(个人空间 · 会客厅共用) ============ */
.tool-tasks { display: flex; flex-direction: column; gap: 0.6rem; }
.task-item {
  display: flex; background: var(--surface); border: 1px solid var(--rule);
  border-radius: 7px; overflow: hidden; box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.task-item:hover { border-color: var(--accent); text-decoration: none; }
.task-item .body { padding: 0.7rem 0.9rem; flex: 1; min-width: 0; }
.task-item .meta { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.25rem; }
.task-id { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); }
.task-target { margin: 0; font-size: 0.82rem; color: var(--ink); }
.task-result { margin: 0.2rem 0 0; font-size: 0.78rem; color: var(--accent2); }
.task-target .sep { margin: 0 0.4rem; color: var(--muted); }

/* 会客厅帖头 */
.tf-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.9rem; }
.tf-head h2 { font-size: 1.02rem; margin: 0; }
.tf-head h3 { font-size: 0.95rem; margin: 0; color: var(--ink); }
/* 主栏内首个区块不再叠加外边距(帖头已提供间距) */
.salon-main > .notice { margin-top: 0; }

/* ============ 会客厅(salon) ============ */
/* 会客厅主框架:主内容在左、频道索引在右 */
.salon-hall {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  gap: 2.2rem;
  align-items: start;
}
.reading:has(.salon-hall) .wrap { max-width: 1000px; }
.salon-hall .salon-side { position: sticky; top: 1.2rem; }

/* 右栏:整块「索引卡」包住频道列表——一个容器,而非 N 个盒子 */
.salon-panel {
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: rgba(176, 68, 46, 0.028);
  overflow: hidden;
}
.salon-panel .panel-head {
  display: flex; align-items: baseline; gap: 0.45rem;
  padding: 0.6rem 0.85rem 0.5rem;
  border-bottom: 1px solid var(--rule);
}
.salon-panel .ph-kicker {
  font-family: var(--mono); font-size: 0.52rem; letter-spacing: 0.16em; color: var(--muted);
}
.salon-panel .ph-name { font-family: var(--serif); font-size: 0.9rem; font-weight: 700; color: var(--ink); }

/* 频道索引列表:竖向排布,行间细线分隔,无独立卡片边框 */
.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; margin-bottom: 1.4rem; }
.salon-panel .channel-grid { display: block; grid-template-columns: none; gap: 0; margin: 0; }

.channel-cell {
  display: flex; align-items: stretch;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 7px;
  overflow: hidden; box-shadow: var(--shadow); color: var(--ink); text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.channel-cell:hover { border-color: var(--accent); box-shadow: 0 3px 10px rgba(42, 39, 32, 0.1); transform: translateY(-1px); text-decoration: none; }

/* 右栏内的行:剥掉卡片外形,只留「书签边 + 行」 */
.salon-panel .channel-cell {
  align-items: center;
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
  transition: background 0.15s;
}
.salon-panel .channel-cell + .channel-cell { border-top: 1px solid var(--rule); }
.salon-panel .channel-cell:hover {
  background: rgba(176, 68, 46, 0.06);
  border-color: transparent; box-shadow: none; transform: none;
}

/* 朱砂书签边:默认 2px 淡痕,悬停/选中时显色并加宽 */
.channel-cell .pill-spine { width: 3px; flex-shrink: 0; background: var(--accent); }
.salon-panel .channel-cell .pill-spine {
  width: 2px; background: transparent;
  transition: background 0.16s, width 0.16s;
}
.salon-panel .channel-cell:hover .pill-spine { background: rgba(176, 68, 46, 0.55); }

.salon-panel .channel-cell .cell-body {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.5rem 0.7rem; flex: 1; min-width: 0;
}
.channel-cell .cell-name { display: block; font-family: var(--serif); font-size: 0.92rem; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.15s; }
.channel-cell:hover .cell-name { color: var(--accent); }
.salon-panel .channel-cell .cell-name { font-size: 0.86rem; }
.salon-panel .channel-cell:hover .cell-name { color: var(--accent); }

/* 计数:右对齐的等宽数字,像档案索引的页数 */
.channel-cell .cell-meta { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.28rem;
  font-size: 0.68rem; color: var(--muted); }
.channel-cell .cell-meta::before { content: ''; width: 10px; height: 1px; background: var(--muted); opacity: 0.5; }
.salon-panel .channel-cell .cell-meta {
  margin: 0; font-family: var(--mono); font-size: 0.68rem;
  color: var(--muted); flex-shrink: 0;
}
.salon-panel .channel-cell .cell-meta::before { display: none; }
.salon-panel .channel-cell:hover .cell-meta { color: var(--accent); }

.channel-cell.active { border-color: var(--accent); background: #fdf5ee; box-shadow: inset 0 0 0 1px rgba(176, 68, 46, 0.22); }
.channel-cell.active .cell-name { color: var(--accent); }
/* 右栏内的选中态:淡底 + 朱砂书签边点亮 */
.salon-panel .channel-cell.active {
  background: rgba(176, 68, 46, 0.08); border: 0; box-shadow: none;
}
.salon-panel .channel-cell.active .pill-spine { background: var(--accent); }
.salon-panel .channel-cell.active .cell-name { color: var(--accent); }

/* 窄屏:双栏塌成单栏,频道索引回落为主内容上方并恢复多列 */
@media (max-width: 860px) {
  .salon-hall { grid-template-columns: 1fr; gap: 1.4rem; }
  .salon-hall .salon-side { position: static; order: -1; }
  .salon-panel { background: transparent; border: 0; overflow: visible; }
  .salon-panel .panel-head { padding: 0 0 0.5rem; }
  .salon-panel .channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; }
  /* 恢复为独立小卡片(横向铺开时行内分隔线不再合适) */
  .salon-panel .channel-cell {
    background: var(--surface); border: 1px solid var(--rule); border-radius: 3px;
    box-shadow: none; align-items: stretch;
  }
  .salon-panel .channel-cell + .channel-cell { border-top: 1px solid var(--rule); }
  .salon-panel .channel-cell .pill-spine { width: 3px; background: var(--accent); }
  .salon-panel .channel-cell .cell-body { align-items: flex-start; flex-direction: column; gap: 0.1rem; }
  .salon-panel .channel-cell .cell-meta::before { display: block; }
  .salon-panel .channel-cell:hover { background: var(--surface); border-color: var(--accent); }
  .salon-panel .channel-cell.active { border-color: var(--accent); background: #fdf5ee; box-shadow: inset 0 0 0 1px rgba(176, 68, 46, 0.22); }
}
@media (max-width: 760px) {
  .salon-panel .channel-grid { display: flex; flex-wrap: nowrap; overflow-x: auto; }
  .salon-panel .channel-cell { flex: 0 0 auto; min-width: 9rem; }
  .salon-panel .channel-cell .cell-body { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* 频道页主栏:帖头/表单/帖子流/分页 的纵向节奏 */
.salon-main .tf-head { margin-top: 0; }
.salon-main .tool-tasks { margin-top: 0.2rem; }
.salon-main .pagination { margin-top: 1.4rem; }

.thread-form { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.1rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.thread-form.collapsed { display: none; }
.thread-toggle { margin-left: auto; font-size: 0.82rem; padding: 0.35rem 0.95rem; }
.thread-form textarea {
  width: 100%; padding: 0.58rem 0.75rem;
  border: 1px solid var(--rule); border-radius: 6px;
  background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 0.9rem;
  resize: vertical;
}
.thread-form textarea:focus { outline: none; border-color: var(--accent); }

.thread-body { padding: 0.3rem 0 0.8rem; }
.thread-actions { display: flex; gap: 0.6rem; align-items: center; margin: 0.6rem 0 1.6rem; }
.inline-form { margin: 0; }

.comment-tree { margin-bottom: 1.4rem; }
.comment { background: var(--surface); border: 1px solid var(--rule); border-radius: 7px; padding: 0.7rem 0.95rem; margin-bottom: 0.6rem; }
.comment.child { margin: 0.5rem 0 0 1.6rem; background: var(--bg); }
.comment-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.3rem; }
.c-author { font-weight: 600; font-size: 0.8rem; color: var(--accent); }
.c-parent { font-size: 0.78rem; color: var(--accent2); background: rgba(14, 124, 107, 0.08); padding: 0.05rem 0.45rem; border-radius: 8px; }
.c-parent a { color: inherit; }
.c-parent a:hover { text-decoration: underline; }
.c-time { font-size: 0.7rem; color: var(--muted); }
.pending-mark {
  font-size: 0.7rem; color: var(--accent); background: rgba(180, 36, 36, 0.08);
  border: 1px solid rgba(180, 36, 36, 0.25); padding: 0.05rem 0.5rem;
  border-radius: 999px; white-space: nowrap;
}
.reply-btn { margin-left: auto; font-size: 0.7rem; color: var(--accent2); background: none; border: 1px solid var(--rule); border-radius: 4px; padding: 0.1rem 0.5rem; cursor: pointer; }
.del-btn { font-size: 0.7rem; color: var(--muted); background: none; border: 1px solid var(--rule); border-radius: 4px; padding: 0.1rem 0.5rem; cursor: pointer; transition: color 0.15s, border-color 0.15s, background 0.15s; }
.del-btn:hover { color: var(--danger); border-color: var(--danger); background: rgba(185, 28, 28, 0.06); }
.c-content { margin: 0; font-size: 0.86rem; line-height: 1.75; }

/* ---- 评论表情选择器(位于输入框下方) ---- */
.emoji-bar { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
/* 提交按钮「发表评论」置于输入框右下角 */
.emoji-submit { margin-left: auto; }
.emoji-toggle {
  font-size: 0.78rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: 5px; padding: 0.18rem 0.6rem;
  cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.emoji-toggle:hover { border-color: var(--accent); color: var(--accent); }
.emoji-hint { font-size: 0.7rem; color: var(--muted); }
.emoji-panel {
  position: fixed; z-index: 60; width: 292px; max-height: 252px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(42, 39, 32, 0.16);
  padding: 0.5rem; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
}
.emoji-panel.hidden { display: none; }
.emoji-item {
  font-size: 1.15rem; line-height: 1; padding: 0.32rem 0.2rem; text-align: center;
  background: none; border: 0; border-radius: 5px; cursor: pointer; transition: background 0.15s;
}
.emoji-item:hover { background: rgba(176, 68, 46, 0.1); }

/* ============ 个人空间(借阅卡 / 阅览者) ============ */
.foot-row { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.3rem; }
.foot-row .bell { position: relative; font-size: 0.78rem; color: var(--accent2); }
.foot-row .bell:hover { color: var(--accent); text-decoration: none; }
/* 侧边栏「通知」未读条数徽章:底色取朱砂(与侧栏红调统一,不用冷调赤红);
   弹性布局 + line-height:1 让数字在红点中双向精确居中,外描一圈浅光使红点在深褐底上更清晰 */
.badge-warn { display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box; min-width: 1.15rem; height: 1.15rem; margin-left: 0.3rem; padding: 0 0.32rem;
  border-radius: 999px; background: var(--accent); color: #fbf8ef;
  font-size: 0.66rem; line-height: 1; font-weight: 600;
  box-shadow: 0 0 0 1px rgba(226, 176, 152, 0.22); }
/* hidden 属性来自 UA 样式表,优先级低于作者样式;上面写了 display 会使其失效,故显式重置 */
.badge-warn[hidden] { display: none; }
.alert.ok { background: rgba(63, 98, 18, 0.08); color: var(--ok); }
.btn.active { border-color: var(--accent); background: transparent; color: var(--accent); }
.link-btn { background: none; border: none; padding: 0; color: var(--accent2); font-size: 0.76rem; cursor: pointer; }
.link-btn:hover { color: var(--accent); text-decoration: underline; }
.muted { color: var(--muted); }

/* 资料卡 */
.profile-card { display: flex; gap: 1.6rem; align-items: flex-start; padding: 1.6rem 1.8rem;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow); }
.profile-card .avatar { width: 92px; height: 92px; border-radius: 50%; overflow: hidden; flex: none;
  border: 2px solid var(--accent); background: var(--bg); display: flex; align-items: center; justify-content: center; }
.profile-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-fallback { display: inline-flex; width: 100%; height: 100%; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700; color: var(--accent); background: rgba(176, 68, 46, 0.08); }
.profile-card .info { flex: 1; }
.profile-card .info h2 { margin: 0 0 0.4rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.profile-card .bio { font-size: 0.9rem; line-height: 1.7; color: var(--ink); }
.profile-card .tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.5rem 0 0; }
.profile-card .meta { font-size: 0.78rem; color: var(--muted); margin: 0.5rem 0 0; }
.profile-card .actions { margin-top: 0.8rem; display: flex; gap: 0.6rem; }

/* 关注关系 */
.link-row { display: flex; gap: 1rem; margin: 0.8rem 0 0; }
.link-chip { padding: 0.45rem 1rem; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--surface); font-size: 0.85rem; color: var(--ink); }
.link-chip b { color: var(--accent); font-family: var(--mono); }
.link-chip:hover { border-color: var(--accent); text-decoration: none; }

/* 主页分块 */
.profile-tabs h3 { font-size: 0.9rem; color: var(--accent2); margin: 1.2rem 0 0.6rem; }
.profile-tabs h3:first-child { margin-top: 0.4rem; }

/* 最近动态 */
.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; align-items: baseline; gap: 0.8rem; padding: 0.55rem 0.8rem;
  border-bottom: 1px dashed var(--rule); font-size: 0.85rem; }
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--surface); text-decoration: none; }
.act-kind { flex: none; width: 3.2em; font-size: 0.72rem; color: var(--accent);
  border: 1px solid var(--rule); border-radius: 4px; text-align: center; padding: 0.05rem 0; }
.act-title { flex: 1; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-ts { flex: none; font-size: 0.7rem; color: var(--muted); font-family: var(--mono); }

/* 个人中心 */
.card-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.2rem; }
@media (max-width: 860px) { .card-grid { grid-template-columns: 1fr; } }
.card-panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px;
  padding: 1.2rem 1.4rem; box-shadow: var(--shadow); }
.card-panel h2 { margin: 0 0 1rem; font-size: 1rem; }
.stack-form label { display: block; margin-bottom: 1rem; font-size: 0.82rem; color: var(--muted); }
.stack-form label small { display: block; margin-top: 0.3rem; color: var(--muted); }
.stack-form textarea, .stack-form input[type="text"] { display: block; width: 100%; margin-top: 0.35rem;
  padding: 0.55rem 0.7rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg);
  font-size: 0.88rem; font-family: inherit; color: var(--ink); }
.stack-form textarea:focus, .stack-form input[type="text"]:focus { outline: none; border-color: var(--accent); }
.stack-form .check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--ink); }
.stack-form .check input { width: auto; margin: 0; }
.avatar-row { display: flex; align-items: center; gap: 1rem; margin-top: 0.35rem; }
.avatar-preview { width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--accent); }
.avatar-row .avatar-fallback { width: 56px; height: 56px; font-size: 1.4rem; border-radius: 50%; }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { border-bottom: 1px dashed var(--rule); }
.link-list a { display: block; padding: 0.6rem 0.2rem; font-size: 0.88rem; color: var(--ink); }
.link-list a:hover { color: var(--accent); text-decoration: none; }
.card-panel .meta { font-size: 0.78rem; color: var(--muted); margin-top: 1rem; }

/* 关注 / 粉丝列表 */
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.9rem; }
.user-item { display: flex; gap: 0.9rem; padding: 0.9rem 1rem; background: var(--surface);
  border: 1px solid var(--rule); border-radius: 10px; align-items: flex-start; }
.user-item .avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none;
  border: 1px solid var(--rule); }
.user-item .avatar-fallback { width: 48px; height: 48px; font-size: 1.1rem; border-radius: 50%; }
.user-item .u-body { flex: 1; min-width: 0; }
.user-item .u-name { margin: 0 0 0.3rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.user-item .meta { font-size: 0.74rem; color: var(--muted); margin: 0.2rem 0 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 通知列表 */
.notice-list { display: flex; flex-direction: column; margin-top: 1rem; }
.notice-item { display: flex; align-items: center; gap: 0.8rem; padding: 0.75rem 0.9rem;
  border-bottom: 1px dashed var(--rule); }
.notice-content { flex: 1; min-width: 0; margin: 0; font-size: 0.88rem; line-height: 1.6;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.notice-content { color: var(--ink); text-decoration: none; }
a.notice-content:hover { color: var(--accent2); text-decoration: underline; }
.notice-link { flex: none; font-size: 0.78rem; color: var(--accent2); }
.notice-ts { flex: none; font-size: 0.7rem; color: var(--muted); font-family: var(--mono); }
.inline-form.right { text-align: right; margin: 0.6rem 0 0; }

/* 通知详情 */
.notice-detail { margin-top: 1rem; padding: 1.1rem 1.2rem; border: 1px solid var(--rule);
  border-radius: 8px; background: var(--surface); }
.notice-detail .nd-content { margin: 0; font-size: 0.95rem; line-height: 1.85; white-space: pre-wrap; }
/* 详情页标题单独成行:与正文分行,下方留白区隔 */
.notice-detail .nd-heading { margin: 0 0 0.7rem; font-size: 1.05rem; line-height: 1.55; color: var(--ink); }
/* 通知正文支持 Markdown:复用 .prose 排版,字号对齐正文;强调色改青色以符合通知配色(不用红) */
.notice-detail .nd-md { font-size: 0.95rem; }
.notice-detail .nd-md a { color: var(--accent2); border-bottom-color: rgba(14, 124, 107, 0.3); }
.notice-detail .nd-md a:hover { border-bottom-color: var(--accent2); }
.notice-detail .nd-md blockquote { border-left-color: var(--accent2); background: rgba(14, 124, 107, 0.05); }
.notice-detail .nd-md pre { border-left-color: var(--accent2); }
.notice-detail .nd-title { margin: 0.9rem 0 0; font-size: 0.85rem; color: var(--accent2); }
.notice-detail .nd-snippet { margin: 0.6rem 0 0; padding: 0.55rem 0.85rem; border-left: 3px solid var(--rule);
  background: var(--bg); color: var(--muted); font-size: 0.85rem; line-height: 1.75; }
.notice-detail .nd-cta { margin-top: 1.1rem; background: var(--accent2); color: #fbf8ef; border-color: var(--accent2); }
.notice-detail .nd-cta:hover { background: #0b6357; opacity: 1; text-decoration: none; }
.nd-back { color: var(--accent2); }
.nd-back:hover { color: var(--accent2-hover); text-decoration: underline; }

/* ============ 馆员区(curator) ============ */
.badge.danger { background: rgba(185, 28, 28, 0.1); color: var(--danger); }

/* 目录栏:管理员单入口(收起 10 个管理链接,保持前台侧栏简洁) */
.index .curator-entry {
  display: flex; align-items: center; gap: 0.55rem;
  margin: 0.85rem 0.5rem 0; padding: 0.55rem 0.6rem;
  border: 1px solid rgba(176, 68, 46, 0.45); border-radius: 7px;
  background: linear-gradient(135deg, rgba(176, 68, 46, 0.16), rgba(176, 68, 46, 0.05));
  color: #f2e9d6;
  transition: background 0.15s;
}
.index .curator-entry:hover { background: rgba(176, 68, 46, 0.26); text-decoration: none; }
.index .ce-seal {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
  background: var(--accent); color: #fbf8ef;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 0.78rem; font-weight: 700;
  box-shadow: inset 0 0 0 1.5px rgba(251, 248, 239, 0.5);
}
.index .ce-body { display: flex; flex-direction: column; line-height: 1.3; }
.index .ce-title { font-family: var(--serif); font-size: 0.82rem; color: #f2ede0; }
.index .ce-sub { font-family: var(--mono); font-size: 0.5rem; color: #c9a77e; letter-spacing: 0.1em; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.8rem; margin-bottom: 1.4rem; }
.stat-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px;
  padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.stat-card.warn { border-color: var(--warn); background: rgba(180, 83, 9, 0.05); }
.stat-card .num { font-family: var(--serif); font-size: 1.7rem; font-weight: 700; color: var(--accent); }
.stat-card.warn .num { color: var(--warn); }
.stat-card .label { font-size: 0.76rem; color: var(--muted); margin-top: 0.2rem; }

/* 后台表格 */
.admin-table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule);
  border-radius: 10px; box-shadow: var(--shadow); margin-bottom: 1rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.admin-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.72rem;
  padding: 0.55rem 0.8rem; border-bottom: 2px solid var(--rule); letter-spacing: 0.06em; white-space: nowrap; }
.admin-table td { padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.admin-table tr:hover td { background: rgba(176, 68, 46, 0.04); }
.admin-table td .btn { margin-right: 0.4rem; }
.admin-table td .btn:last-child { margin-right: 0; }
.admin-table small.muted { display: block; font-size: 0.7rem; }

/* 内容类型 tab 条 */
.tab-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0 0 1rem; }
.tab-bar .tab { padding: 0.4rem 1rem; border: 1px solid var(--rule); border-radius: 7px;
  background: var(--surface); font-size: 0.82rem; color: var(--ink); }
.tab-bar .tab:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.tab-bar .tab.active { background: var(--accent); color: #fbf8ef; border-color: var(--accent); }

/* 筛选 / 生成表单 */
.filter-form { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.filter-form label { font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 0.4rem; }
.filter-form input, .filter-form select { padding: 0.42rem 0.6rem; border: 1px solid var(--rule);
  border-radius: 6px; background: var(--bg); font-size: 0.84rem; }
.filter-form input:focus, .filter-form select:focus { outline: none; border-color: var(--accent); }
.gen-form { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.gen-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.78rem; color: var(--muted); }
.gen-form input, .gen-form select { padding: 0.45rem 0.6rem; border: 1px solid var(--rule);
  border-radius: 6px; background: var(--bg); font-size: 0.86rem; }

/* 页面级别变更:确认文案输入 */
.level-form { display: flex; gap: 0.4rem; align-items: center; }
.level-form select { padding: 0.4rem 0.55rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg); font-size: 0.84rem; }
.level-form .confirm-input { width: 9.5rem; padding: 0.4rem 0.6rem; border: 1px solid var(--warn);
  border-radius: 6px; background: var(--bg); font-size: 0.8rem; }
.level-form .confirm-input:focus { outline: none; border-color: var(--accent); }

/* 邀请码生成结果 */
.codes { cursor: pointer; user-select: all; }

/* 宽度工具类 */
.w6 { width: 4rem; }
.w10 { width: 8.5rem; }

/* 系统配置 textarea */
.config-form .config-textarea { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--rule);
  border-radius: 6px; background: var(--bg); font-family: var(--mono); font-size: 0.82rem;
  color: var(--ink); resize: vertical; line-height: 1.6; }
.config-form .config-textarea:focus { outline: none; border-color: var(--accent); }
.config-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 0.5rem; }

/* Webhook 机器人配置区块 */
.config-desc { margin: 0 0 0.9rem; line-height: 1.6; font-size: 0.82rem; }
.config-field { display: flex; align-items: flex-start; gap: 0.8rem; margin-bottom: 0.85rem; }
.config-label { flex: 0 0 7.5rem; padding-top: 0.35rem; font-size: 0.82rem; color: var(--muted); }
.config-toggle { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer;
  font-size: 0.82rem; color: var(--ink); }
.config-toggle input { accent-color: var(--accent); }
.config-input { flex: 1; min-width: 0; padding: 0.5rem 0.7rem; border: 1px solid var(--rule);
  border-radius: 6px; background: var(--bg); font-size: 0.82rem; color: var(--ink); }
.config-input:focus { outline: none; border-color: var(--accent); }
.config-select { width: min(26rem, 100%); flex: none; }
.config-checks { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; padding-top: 0.25rem; }
.config-check { display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer;
  font-size: 0.82rem; color: var(--ink); }
.config-check input { accent-color: var(--accent); }

/* 下载冷却紧凑配置区块(单行输入,替代通用 6 行 textarea) */
.config-panel-compact { padding-bottom: 0.9rem; }
.config-panel-compact h2 { margin-bottom: 0.5rem; }
.config-form-inline { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.config-input-short { flex: 0 1 14rem; }
.config-save-hint { font-size: 0.76rem; }

/* 下载冷却单行面板:标题居左,表单居右,整块只占一行高度 */
.config-panel-row { display: flex; align-items: center; justify-content: space-between;
  gap: 0.6rem 1.2rem; flex-wrap: wrap; padding-top: 0.8rem; }
.config-panel-row h2 { margin: 0; }

/* ============ 统一确认弹窗(.archive-dialog,confirm.js 渲染) ============ */
.archive-dialog-mask {
  position: fixed;
  inset: 0;
  background: rgba(42, 39, 32, 0.5);
  z-index: 9999;                 /* 高于后台 sticky 顶栏(z-index:10)与主站导航 */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.archive-dialog-mask.show { opacity: 1; }
.archive-dialog-card {
  width: min(420px, calc(100vw - 2rem));
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(42, 39, 32, 0.22);
  padding: 1.3rem 1.4rem 1.15rem;
  transform: scale(0.95) translateY(6px);
  transition: transform 0.18s ease;
}
.archive-dialog-mask.show .archive-dialog-card { transform: scale(1) translateY(0); }
.archive-dialog-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.archive-dialog-card.danger .archive-dialog-title { color: var(--danger); }
.archive-dialog-message { color: var(--muted); font-size: 0.88rem; line-height: 1.8; }
.archive-dialog-field { margin: 0.85rem 0 0.15rem; }
.archive-dialog-label {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  letter-spacing: 0.03em;
}
.archive-dialog-input {
  width: 100%;
  padding: 0.5rem 0.7rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.archive-dialog-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(176, 68, 46, 0.15); }
.archive-dialog-input.invalid { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.15); }
.archive-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.1rem;
}
.archive-dialog-btn {
  padding: 0.42rem 1.1rem;
  font-family: var(--sans);
  font-size: 0.84rem;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
}
.archive-dialog-btn.cancel:hover { border-color: var(--accent); color: var(--accent); }
.archive-dialog-btn.ok { background: var(--accent); border-color: var(--accent); color: #fbf8ef; }
.archive-dialog-btn.ok:hover { filter: brightness(1.06); }
.archive-dialog-card.danger .archive-dialog-btn.ok { background: var(--danger); border-color: var(--danger); }

/* 轻提示(纯通知,自动消失) */
.archive-toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translate(-50%, -8px);
  background: var(--ink);
  color: var(--surface);
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  font-size: 0.84rem;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  box-shadow: 0 6px 20px rgba(42, 39, 32, 0.25);
  max-width: 90vw;
}
.archive-toast.show { opacity: 1; transform: translate(-50%, 0); }
.archive-toast.danger { background: var(--danger); color: #fbf8ef; }

/* 修改密码弹窗 */
.pw-modal-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(42, 39, 32, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; transition: opacity 0.18s ease;
}
.pw-modal-mask[hidden] { display: none; }
.pw-modal-mask.show { opacity: 1; }
.pw-modal {
  width: min(400px, 100%);
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 12px; padding: 1.4rem 1.6rem 1.3rem;
  box-shadow: var(--shadow);
  transform: scale(0.96) translateY(10px);
  transition: transform 0.18s ease;
}
.pw-modal-mask.show .pw-modal { transform: scale(1) translateY(0); }
.pw-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.3rem; }
.pw-modal-head h3 { font-family: var(--serif); font-size: 1.1rem; margin: 0; }
.pw-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.35rem; line-height: 1; color: var(--muted); padding: 0.15rem;
}
.pw-close:hover { color: var(--ink); }
.pw-form label { display: block; margin: 0.9rem 0 0; font-size: 0.8rem; color: var(--muted); }
.pw-form label small { display: block; margin-top: 0.3rem; color: var(--muted); }
.pw-form input[type="password"] {
  display: block; width: 100%; margin-top: 0.35rem;
  padding: 0.62rem 0.8rem;
  border: 1px solid var(--rule); border-radius: 8px;
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 0.92rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pw-form input[type="password"]:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(176, 68, 46, 0.18);
}
.pw-foot { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.2rem; }

/* ============ SEO 优化:区块标题语义化 + 首页/书架新增区块 ============ */

/* 区块标题由 div 升级为 h2 / h3 后的视觉还原(馆藏登记 / 命名释义 / 书架分组标签) */
h2.ledger-head { margin: 0; font-size: 0.58rem; }
h2.bn-kicker { margin: 0 0 0.7rem; font-size: 0.54rem; }
.zone-group h3.group-label { font-size: 1rem; font-weight: 600; }

/* 五大维度卷宗卡升级为内链(a 标签)后:文字继承墨色,悬停轻强调 */
a.dossier { color: var(--ink); }
a.dossier:hover {
  border-color: rgba(176, 68, 46, 0.45);
  box-shadow: 0 3px 10px rgba(42, 39, 32, 0.1);
  text-decoration: none;
}

/* 面包屑(书架页顶部) */
.crumb { display: flex; align-items: center; gap: 0.35rem; font-size: 0.76rem; color: var(--muted); margin-bottom: 0.7rem; }
.crumb a { color: var(--accent2); }
.crumb a:hover { color: var(--accent); text-decoration: none; }
.crumb .crumb-sep { color: #c4bdab; }

/* 首页 · 最新入库(最近 5 条动态) */
.recent-list {
  list-style: none; margin: 0 0 1.8rem;
  border: 1px solid var(--rule); border-radius: 7px;
  background: var(--surface); box-shadow: var(--shadow);
  padding: 0.2rem 0.9rem;
}
.recent-list li {
  display: flex; align-items: baseline; gap: 0.6rem;
  padding: 0.45rem 0; border-bottom: 1px dashed var(--rule); font-size: 0.82rem;
}
.recent-list li:last-child { border-bottom: none; }
.recent-list a { color: var(--ink); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-list a:hover { color: var(--accent); text-decoration: none; }
.recent-list .rk {
  flex: none; font-size: 0.64rem; color: var(--accent2);
  border: 1px solid rgba(14, 124, 107, 0.3); border-radius: 4px;
  padding: 0.04rem 0.4rem; margin-right: 0.4rem; white-space: nowrap;
}
.recent-list .rd { flex: none; font-family: var(--mono); font-size: 0.68rem; color: var(--muted); }

/* 首页 · 精选推荐(书架精选卡,整体链接 /shelf) */
.featured {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem; margin-bottom: 1.8rem;
}
.featured-card {
  display: flex; flex-direction: column; gap: 0.3rem;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 7px;
  padding: 0.75rem 0.9rem; color: var(--ink); box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.featured-card:hover {
  border-color: rgba(176, 68, 46, 0.45);
  box-shadow: 0 3px 10px rgba(42, 39, 32, 0.1);
  text-decoration: none;
}
.featured-card h3 { font-family: var(--serif); font-size: 0.9rem; margin: 0; color: var(--ink); }
.featured-card p { font-size: 0.74rem; color: var(--muted); line-height: 1.6; margin: 0; }
.featured-card .fc-tag {
  align-self: flex-start; font-size: 0.66rem; color: var(--accent2);
  border: 1px solid var(--rule); border-radius: 4px; padding: 0.05rem 0.45rem;
}

/* 首页 · 研究追踪(最近更新条目,导流 /journal) */
.research-stats { display: flex; flex-direction: column; gap: 0.9rem; margin-bottom: 1.8rem; }
.rs-recent {
  list-style: none; margin: 0;
  border: 1px solid var(--rule); border-radius: 7px;
  background: var(--surface); box-shadow: var(--shadow);
  padding: 0.2rem 0.9rem;
}
.rs-recent li {
  display: flex; align-items: baseline; gap: 0.6rem;
  padding: 0.45rem 0; border-bottom: 1px dashed var(--rule); font-size: 0.82rem;
}
.rs-recent li:last-child { border-bottom: none; }
.rs-recent a { color: var(--ink); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-recent a:hover { color: var(--accent); text-decoration: none; }
.rs-recent .rk {
  flex: none; font-size: 0.64rem; color: var(--accent2);
  border: 1px solid rgba(14, 124, 107, 0.3); border-radius: 4px;
  padding: 0.04rem 0.4rem; white-space: nowrap;
}
.rs-recent .rd { flex: none; font-family: var(--mono); font-size: 0.68rem; color: var(--muted); }
.rs-more { align-self: flex-end; font-size: 0.76rem; color: var(--accent2); }
.rs-more:hover { color: var(--accent); text-decoration: none; }

/* 首页 · 常见问题(原生折叠,无需 JS) */
.faq { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 2rem; }
.faq-item {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 7px;
  padding: 0 0.9rem; box-shadow: var(--shadow);
}
.faq-item summary {
  cursor: pointer; list-style: none; padding: 0.6rem 0;
  font-size: 0.88rem; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 0.5rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: 'Q'; font-family: var(--serif); font-weight: 700; color: var(--accent); font-size: 0.8rem; }
.faq-item p { margin: 0; padding: 0 0 0.7rem 1.3rem; font-size: 0.8rem; color: var(--muted); line-height: 1.75; }

/* 首页 · 末位 CTA 导流 /shelf */
.home-cta { text-align: center; padding: 0.6rem 0 0.4rem; margin-bottom: 1rem; }

/* 书架 · 资源卡「适用场景」一行 */
.shelf-card .scene {
  display: block; margin: 0.35rem 0 0; font-size: 0.72rem; color: var(--ink);
}
.shelf-card .scene em {
  font-style: normal; font-family: var(--mono); font-size: 0.62rem;
  color: var(--accent2); margin-right: 0.3rem;
}

/* 404 页 · 站内检索框 */
.gate-search {
  display: flex; gap: 0.6rem; align-items: end;
  margin-top: 1.2rem; padding-top: 1rem; border-top: 1px dashed var(--rule);
}
.gate-search .field { flex: 1; }
.gate-search .btn { flex: none; letter-spacing: 0.2em; }

/* ============ 威胁情报(intel) ============ */

/* 检索条:复用 .field / .btn,与知识层检索框口径一致;flex-wrap 兜底窄屏 */
.intel-search { display: flex; gap: 0.6rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1.1rem; }

/* 信源筛选 chip:激活态用淡墨底墨字,与纸面背景协调(无彩色填充) */
.chip.intel-src { border-color: var(--rule); }
.chip.intel-src:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }
.chip.intel-src.active { background: rgba(42, 39, 32, 0.06); border-color: var(--ink); color: var(--ink); }
.chip .chip-n {
  font-style: normal; font-family: var(--mono); font-size: 0.62rem;
  background: rgba(122, 116, 102, 0.12); border-radius: 4px;
  padding: 0 0.32rem; margin-left: 0.32rem; color: var(--muted);
}
.chip .chip-code {
  font-style: normal; font-family: var(--mono); font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.08em; color: var(--src, var(--muted));
  margin-right: 0.34rem; opacity: 0.9;
}
.chip.intel-src.active .chip-n,
.chip.active .chip-n { background: rgba(251, 248, 239, 0.25); color: #fbf8ef; }
/* intel 信源 chip 激活态为淡墨底,计数徽章需回墨色(覆盖上面的通用白字规则) */
.chip.intel-src.active .chip-n { background: rgba(42, 39, 32, 0.08); color: var(--ink); }

/* 情报卡:常规横排阅读流 —— 顶部代号印章+信源名,标题,摘要,底部标签/日期/链接 */
.intel-card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--rule); border-radius: 8px;
  padding: 0.78rem 0.95rem 0.6rem;
  box-shadow: var(--shadow); min-width: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.intel-card:hover { border-color: var(--ink); box-shadow: 0 3px 12px rgba(42, 39, 32, 0.1); }
.kb-grid > .intel-card { height: 100%; margin-bottom: 0; }
.intel-meta { display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.34rem; }
.intel-code {
  flex: none; font-family: var(--mono); font-size: 0.58rem; font-weight: 700;
  letter-spacing: 0.1em; line-height: 1; color: var(--src, var(--accent2));
  background: rgba(42, 39, 32, 0.04); border: 1px solid var(--rule);
  border-radius: 3px; padding: 0.18rem 0.3rem;
}
.intel-src-name {
  font-size: 0.72rem; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.intel-zh {
  flex: none; font-size: 0.62rem; line-height: 1; color: var(--accent);
  border: 1px solid rgba(176, 68, 46, 0.4); border-radius: 3px;
  padding: 0.14rem 0.3rem; white-space: nowrap;
}
.intel-ago { margin-left: auto; flex: none; font-family: var(--mono); font-size: 0.62rem; color: var(--muted); }
.intel-card h3 { font-family: var(--serif); font-size: 0.95rem; line-height: 1.42; margin: 0 0 0.26rem; font-weight: 600; }
.intel-card h3 a { color: var(--ink); }
.intel-card h3 a:hover { color: var(--accent); text-decoration: none; }
.intel-sum {
  font-size: 0.78rem; color: var(--muted); line-height: 1.66; margin: 0 0 0.45rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.intel-tags {
  display: flex; flex-wrap: wrap; gap: 0.28rem;
  margin: 0 0 0.5rem;
}
.intel-tag {
  white-space: nowrap; line-height: 1; font-size: 0.64rem; color: var(--muted);
  border: 1px solid var(--rule); border-radius: 999px;
  padding: 0.22rem 0.52rem;
  transition: color 0.15s, border-color 0.15s;
}
.intel-card:hover .intel-tag { color: var(--ink); border-color: rgba(42, 39, 32, 0.22); }
.intel-foot {
  margin-top: auto; padding-top: 0.4rem; border-top: 1px dashed var(--rule);
  display: flex; align-items: baseline; gap: 0.6rem;
  font-size: 0.68rem; color: var(--muted);
}
.intel-foot .intel-date { margin-left: auto; flex: none; font-family: var(--mono); font-size: 0.66rem; }
.intel-link { flex: none; color: var(--accent); font-weight: 600; }
.intel-link:hover { text-decoration: underline; }

/* 游客预览门槛卡:呼应主站 gate 主题,引导登录解锁全部情报 */
.intel-gate {
  margin: 0.4rem 0 1.6rem; padding: 1.6rem 1.3rem 1.4rem;
  background: linear-gradient(180deg, var(--surface), rgba(247, 244, 236, 0.4));
  border: 1px dashed var(--rule); border-radius: 9px;
  text-align: center; position: relative;
}
.intel-gate::before {
  content: ""; position: absolute; left: 50%; top: -1px; transform: translateX(-50%);
  width: 64px; height: 2px; background: var(--accent); border-radius: 2px;
}
.intel-gate-no { font-size: 1.15rem; color: var(--accent); margin-bottom: 0.45rem; line-height: 1; }
.intel-gate-main { margin: 0 0 0.3rem; font-size: 0.92rem; color: var(--ink); }
.intel-gate-main strong { color: var(--accent); font-weight: 700; }
.intel-gate-sub { margin: 0 0 0.95rem; font-size: 0.78rem; color: var(--muted); }
.intel-gate-cta { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   移动端增强:窄屏(≤540px) + 极窄屏(≤380px)
   在既有 760px 抽屉断点之下,补全 flex 容器换行、固定宽元素
   降级、触屏交互优化,确保全站在主流手机分辨率可用无溢出。
   ============================================================ */
@media (max-width: 540px) {
  /* 详情页底部按钮组换行兜底 */
  .back { flex-wrap: wrap; gap: 0.6rem; }
  .back .btn { display: block; width: 100%; text-align: center; }
  /* 首页欢迎语放宽,避免窄屏右侧大块留白 */
  .welcome p { max-width: 100%; }
  /* 搜索条换行后按钮满宽 */
  .repo-search .btn, .intel-search .btn { display: block; width: 100%; }
  .intel-search .field { width: 100%; flex: 1 1 100%; }
  /* PDF 阅览器:工具栏收紧,按钮触控友好评级 */
  .pdf-toolbar { gap: 0.25rem; padding: 0.45rem 0.5rem; }
  .pdf-btn { width: 32px; height: 32px; }
  .pdf-page-input { width: 3rem; height: 32px; }
  .pdf-zoom { min-width: 2.6rem; }
  /* 触屏无滚轮/键盘,隐藏桌面快捷键提示 */
  .pdf-foot { display: none; }
  .pdf-stage { min-height: 320px; padding: 0.8rem 0.6rem; }
  /* 全景图矩阵超窄降一档高度 */
  .matrix-chart { height: 320px; }
  /* 章节标题略缩,避免长标题撑行 */
  .sec h2 { font-size: 1.1rem; }
  .page-head { padding: 1.4rem 0 1rem; }
  .page-head h1 { font-size: 1.5rem; }
}
@media (max-width: 380px) {
  /* 极窄屏:emoji 面板降为 6 列、宽度收窄避免溢出 */
  .emoji-panel { width: 240px; grid-template-columns: repeat(6, 1fr); }
  /* 馆藏卡片网格 minmax 300 在 <380 会挤,降为单列 */
  .doc-list { grid-template-columns: 1fr; }
  /* kb-grid 340 同理降单列 */
  .kb-grid { grid-template-columns: 1fr; }
  /* AI 网站卡片窄屏单列 */
  .ai-grid { grid-template-columns: 1fr; }
  /* 矩阵图再降一档 */
  .matrix-chart { height: 280px; }
  /* PDF 工具栏进一步收紧分组间距 */
  .pdf-toolbar .pdf-grp { gap: 0.2rem; }
}

/* =========================================================
   2026-09 前端优化批次(原型:frontend-optimization-preview.html)
   C1 配色色阶 / K2 方角体系 / S1 侧栏精修(A 变体)
   K1 卡片书脊(B 效果全站统一) / V2 最新入库时间线
   Q1 filehead 搜索 / R 响应式补齐 / I1 加载反馈 / I2 动效规范
   决策记录:侧栏底色不变;侧栏形态仅 A 精修;卡片全站统一 B。
   ========================================================= */

/* ---- C1 配色色阶:主色五档 + 深青三档,全站 hover/浅底/描边统一引用 ---- */
:root {
  --accent-deep: #8f3522;
  --accent-hover: #c25a3c;
  --accent-soft: rgba(176, 68, 46, 0.08);
  --accent-line: rgba(176, 68, 46, 0.35);
  --accent2-hover: #12957f;
  --accent2-soft: rgba(14, 124, 107, 0.07);
  --accent2-line: rgba(14, 124, 107, 0.35);
}
a:hover { color: var(--accent-deep); }
.btn.primary:hover { background: var(--accent-hover); opacity: 1; }
.btn.primary:active { background: var(--accent-deep); }

/* ---- K2 方角体系:卡片/面板/容器 8–16px → 3px 微切 ---- */
/* 保留:按钮/输入 4–6px、徽章/搜索 pill、印章/头像圆形 */
.gate-card, .ledger, .brand-note, .dossier, .featured-card, .recent-list,
.shelf-card, .ai-card, .doc-card, .pdf-viewer, .tool-form, .thread-form,
.card-panel, .stat-card, .matrix-chart, .empty, .profile-card, .shelf-nav,
.archive-dialog-card {
  border-radius: 3px;
}

/* ---- S1 侧栏精修(A 变体):hover 微右移 + 激活项序号点亮 ---- */
.index nav a { transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.16s ease; }
.index nav a:hover { transform: translateX(2px); }
.index nav a.on .no { color: #eabda4; text-shadow: 0 0 8px rgba(234, 189, 164, 0.5); }

/* ---- K1 卡片书脊(B 效果)全站统一 ---- */
/* 有书脊的卷宗卡:hover 书脊收窄 + 标题染朱砂 + 浮起 */
.dossier { transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
.dossier .spine { transition: width 0.22s cubic-bezier(0.2, 0.7, 0.3, 1); }
.dossier:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(42, 39, 32, 0.13);
  border-color: var(--accent-line);
  text-decoration: none;
}
.dossier:hover .spine { width: 2px; }
.dossier h3 { transition: color 0.16s ease; }
.dossier:hover h3 { color: var(--accent); }
/* 无书脊的卡片(精选/文档/书架/AI 网站):左侧补一条 4px 书脊,hover 收窄点亮 */
.featured-card, .doc-card, .shelf-card, .ai-card {
  position: relative; overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.featured-card::before, .doc-card::before, .shelf-card::before, .ai-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--accent-hover), var(--accent));
  opacity: 0.45;
  transition: width 0.22s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.18s ease;
}
.featured-card:hover, .doc-card:hover, .shelf-card:hover, .ai-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(42, 39, 32, 0.13);
  border-color: var(--accent-line);
  text-decoration: none;
}
.featured-card:hover::before, .doc-card:hover::before, .shelf-card:hover::before, .ai-card:hover::before {
  width: 2px; opacity: 1;
}
.featured-card h3, .doc-card h3, .shelf-card h3, .ai-card .ai-card-name { transition: color 0.16s ease; }
.featured-card:hover h3, .doc-card:hover h3, .shelf-card:hover h3 { color: var(--accent); }
/* 键盘可达性:焦点态朱砂描边 */
.dossier:focus-visible, .featured-card:focus-visible, .doc-card:focus-visible,
.shelf-card:focus-visible, .ai-card:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.dossier:active, .featured-card:active, .doc-card:active, .shelf-card:active, .ai-card:active {
  transform: translateY(-1px);
}

/* ---- 影音馆卡片(.vcard):保留原本设计,不与书架优化(方角 + 书脊 B)耦合 ----
   影音馆原本复用 .shelf-card,优化后随书架一起变成 3px 书脊卡;
   此处还原为优化前的圆角(8px)+ 朴素 hover 外观,仅影音馆生效。 */
.vcard {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.vcard:hover { border-color: rgba(176, 68, 46, 0.45); box-shadow: 0 3px 10px rgba(42, 39, 32, 0.1); }
.vcard .shelf-top { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.vcard .stars { margin-left: auto; font-size: 0.7rem; color: var(--muted); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62%; }
.vcard .tag.src-bilibili { background: rgba(0, 161, 214, 0.12); color: #0a8fbe; border-color: rgba(0, 161, 214, 0.30); }
.vcard .tag.src-youtube { background: rgba(230, 33, 23, 0.10); color: #cf2317; border-color: rgba(230, 33, 23, 0.30); }
.vcard .tag.src-other { background: rgba(14, 124, 107, 0.12); color: var(--accent2); border-color: rgba(14, 124, 107, 0.30); }
.vcard h3 { font-family: var(--serif); font-size: 0.92rem; margin-bottom: 0.3rem; line-height: 1.4; }
.vcard h3 a { color: var(--ink); }
.vcard h3 a:hover { color: var(--accent); text-decoration: none; }
.vcard h3 a .arr { color: var(--accent); font-size: 0.78em; margin-left: 0.15rem; }
.vcard h3 a .site-ico { width: 20px; height: 20px; border-radius: 5px; object-fit: contain; vertical-align: -4px; margin-right: 0.3rem; }
.vcard p { font-size: 0.76rem; color: var(--muted); line-height: 1.65; margin: 0 0 0.15rem; }
.vcard p.src { font-family: var(--mono); font-size: 0.68rem; color: var(--accent2); overflow-wrap: anywhere; }
.vcard .meta { margin-top: auto; padding-top: 0.45rem; font-size: 0.72rem; color: var(--muted); border-top: 1px dashed var(--rule); display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }

/* ---- V2 「最新入库」入馆时间线(纯 CSS 重排,模板不变) ---- */
.recent-list {
  border: none; background: transparent; box-shadow: none;
  padding: 0 0 0 1.1rem; position: relative;
}
.recent-list::before {
  content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px;
  width: 1px; background: var(--rule);
}
.recent-list li { position: relative; border-bottom: none; padding: 0.4rem 0 0.4rem 0.6rem; }
.recent-list li::before {
  content: ""; position: absolute; left: -1.05rem; top: 0.82em;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent);
}
.recent-list .rk { border-radius: 3px; }

/* ---- Q1 filehead 常驻搜索(focus 展开,提交走 /search) ---- */
.fh-search {
  display: flex; align-items: center; gap: 0.35rem;
  border: 1px solid var(--rule); border-radius: 20px;
  background: var(--surface); padding: 0.16rem 0.65rem;
  width: 10rem;
  transition: width 0.28s cubic-bezier(0.2, 0.7, 0.3, 1), border-color 0.16s, box-shadow 0.16s;
}
.fh-search:focus-within {
  width: 14.5rem; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(176, 68, 46, 0.12);
}
.fh-search .fs-ico { color: var(--muted); font-size: 0.72rem; transition: color 0.16s; }
.fh-search:focus-within .fs-ico { color: var(--accent); }
.fh-search input {
  border: none; background: none; outline: none; flex: 1; min-width: 0;
  font-family: var(--sans); font-size: 0.72rem; color: var(--ink);
}
.fh-search input::placeholder { color: #b3ab99; }

/* ---- R 响应式补齐:首页网格与窄屏细节(断点 768 / 480) ---- */
@media (max-width: 1024px) {
  /* 侧栏抽屉档提升后,filehead 搜索同步收窄 */
  .fh-search { width: 8.5rem; }
  .fh-search:focus-within { width: 11rem; }
}
@media (max-width: 768px) {
  .dossiers { grid-template-columns: repeat(2, 1fr); }
  .featured { grid-template-columns: repeat(2, 1fr); }
  .brand-note .chars { gap: 1rem; }
}
@media (max-width: 480px) {
  .dossiers, .featured { grid-template-columns: 1fr; }
  .recent-list .rd { display: none; }
  .fh-search { width: 7rem; }
  .fh-search:focus-within { width: 8.5rem; }
  .filehead .fh-date { display: none; }
}

/* ---- I1 加载反馈:骨架屏 + 提交按钮 loading ---- */
.skel {
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(42, 39, 32, 0.06) 25%, rgba(42, 39, 32, 0.12) 50%, rgba(42, 39, 32, 0.06) 75%);
  background-size: 200% 100%;
  animation: jd-shimmer 1.4s ease-in-out infinite;
}
@keyframes jd-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-line { height: 12px; margin-bottom: 0.55rem; }
.btn.loading { opacity: 0.75; pointer-events: none; }
.btn.loading::after {
  content: ""; display: inline-block;
  width: 0.75em; height: 0.75em; margin-left: 0.45em; vertical-align: -0.08em;
  border: 2px solid rgba(251, 248, 239, 0.4); border-top-color: #fbf8ef;
  border-radius: 50%; animation: jd-rot 0.7s linear infinite;
}
.btn.ghost.loading::after, .btn.danger.loading::after {
  border-color: rgba(42, 39, 32, 0.2); border-top-color: var(--accent);
}
@keyframes jd-rot { to { transform: rotate(360deg); } }

/* ---- I2 动效规范(全站遵守,新增动效须对照) ----
   微反馈(hover/边框/底色)  120–180ms  ease
   位移类(抽屉/菜单/toast)  200–250ms  cubic-bezier(0.2, 0.7, 0.3, 1)
   弹感点缀(印章/徽章)      cubic-bezier(0.34, 1.56, 0.64, 1),仅小元素
   循环强调(脉冲/骨架)      1400–1600ms ease-in-out
   无障碍:prefers-reduced-motion 下全部关闭 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ---- K1/K2 扩展:覆盖其余页面卡片 ----
   kb-item(知识库/案例库/研究追踪/搜索结果,自带书脊)
   intel-card(威胁情报,书脊色取信源色 --src)
   attack-group(全景图攻击手法分组) */
.kb-item, .intel-card, .attack-group { border-radius: 3px; }

/* kb-item:与卷宗卡同语言(书脊收窄 + 标题染朱砂 + 浮起) */
.kb-item { transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
.kb-item .spine { transition: width 0.22s cubic-bezier(0.2, 0.7, 0.3, 1); }
.kb-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(42, 39, 32, 0.13);
  border-color: var(--accent-line);
}
.kb-item:hover .spine { width: 2px; }
.kb-item h3, .kb-item h3 a { transition: color 0.16s ease; }
.kb-item:hover h3, .kb-item:hover h3 a { color: var(--accent); text-decoration: none; }
.kb-item:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* intel-card:信源色书脊(--src 来自模板内联变量,缺省回退朱砂) */
.intel-card {
  position: relative; overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.intel-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--src, var(--accent)); opacity: 0.45;
  transition: width 0.22s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.18s ease;
}
.intel-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(42, 39, 32, 0.13);
  border-color: var(--accent-line);
}
.intel-card:hover::before { width: 2px; opacity: 1; }
.intel-card h3 { transition: color 0.16s ease; }
.intel-card:hover h3, .intel-card:hover h3 a { color: var(--accent); }
.intel-card:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* attack-group:头部 ag-head 已有朱砂左条,分组容器仅方角化(见上),ag-item 维持原 hover */

/* ---- K1/K2 扩展·第二批:会客厅 / 个人中心卡片 ---- */
/* 修复:.spine 直接带 d1–d5 类时(沙龙帖、卷宗详情关联卡)命中不了 .dN .spine 后代选择器,书脊一直无色 */
.spine.d1 { background: var(--accent); }
.spine.d2 { background: var(--accent2); }
.spine.d3 { background: var(--warn); }
.spine.d4 { background: var(--ok); }
.spine.d5 { background: #1d4ed8; }

/* task-item(会客厅帖子):原 .task-item .spine 无宽度规则,书脊不可见;
   补 5px 书脊并接入 B 语言(hover 收窄 + 标题染朱砂 + 浮起) */
.task-item {
  border-radius: 3px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.task-item .spine { width: 5px; flex-shrink: 0; transition: width 0.22s cubic-bezier(0.2, 0.7, 0.3, 1); }
.task-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(42, 39, 32, 0.13);
  border-color: var(--accent-line);
}
.task-item:hover .spine { width: 2px; }
.task-item .task-target { transition: color 0.16s ease; }
.task-item:hover .task-target { color: var(--accent); }
.task-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* channel-cell(会客厅频道格):方角 + 统一浮起 + 脊条收窄 */
.channel-cell { border-radius: 3px; }
.channel-cell .pill-spine { transition: width 0.22s cubic-bezier(0.2, 0.7, 0.3, 1); }
.channel-cell:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(42, 39, 32, 0.13);
  border-color: var(--accent-line);
}
.channel-cell:hover .pill-spine { width: 2px; }
.channel-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 右栏频道索引内的行不参与上述「卡片浮起」:保持扁平,仅书签边点亮 */
.salon-panel .channel-cell:hover { transform: none; box-shadow: none; border-color: transparent; }
.salon-panel .channel-cell:hover .pill-spine { width: 2px; }

/* link-chip(个人页关注/粉丝):浮起反馈 */
.link-chip { transition: border-color 0.15s, color 0.15s, transform 0.15s ease, box-shadow 0.15s ease; }
.link-chip:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(42, 39, 32, 0.1); text-decoration: none; }

/* ---- 面板与列表行精修(第三批:展示面板 / 通知 / 动态 / 关注粉丝) ---- */
/* card-panel 标题:朱砂小方块前缀 + 下方细线,档案面板感(前后台通用,后台 config 面板同步生效) */
.card-panel h2 {
  display: flex; align-items: center; gap: 0.5rem;
  padding-bottom: 0.6rem; border-bottom: 1px solid var(--rule);
}
.card-panel h2::before { content: ""; width: 8px; height: 8px; background: var(--accent); flex-shrink: 0; }

/* 个人中心链接列表:hover 右移,与侧栏导航同一语言 */
.link-list a { transition: color 0.15s, padding-left 0.18s ease; }
.link-list a:hover { color: var(--accent); padding-left: 0.6rem; }

/* 关注/粉丝卡(.user-item):方角 + 书脊 B 语言 */
.user-item {
  position: relative; overflow: hidden; border-radius: 3px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.user-item::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--accent-hover), var(--accent));
  opacity: 0.45;
  transition: width 0.22s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.18s ease;
}
.user-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(42, 39, 32, 0.13);
  border-color: var(--accent-line);
}
.user-item:hover::before { width: 2px; opacity: 1; }
.user-item .u-name { transition: color 0.16s ease; }
.user-item:hover .u-name { color: var(--accent); }

/* 通知列表行:hover 浅底 + 左侧青条滑入(通知统一青色;动态 activity-item 保持朱砂) */
.notice-item, .activity-item { position: relative; transition: background 0.15s ease; }
.notice-item::before, .activity-item::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  transition: width 0.18s ease;
}
.notice-item::before { background: var(--accent2); }
.activity-item::before { background: var(--accent); }
.notice-item:hover { background: rgba(14, 124, 107, 0.08); text-decoration: none; }
.activity-item:hover { background: var(--accent-soft); text-decoration: none; }
.notice-item:hover::before, .activity-item:hover::before { width: 3px; }
.notice-link { transition: color 0.15s; }
.notice-item:hover .notice-link { color: var(--accent2); }
.pagination.notices-pagination .pg:hover { border-color: var(--accent2); color: var(--accent2); }

/* ---- 论文追踪卡(paper-card)----
   学术档案气质:维度色书脊 + 顶部维度软签(本色圆点)/相关性评分/相对时间,
   英文主标题 + 中文译题,作者小字,中文摘要优先(未译回退英文),
   底部 arXiv 编号 + 日期 + 分类 + PDF 直链。
   维度色仅落在书脊、软签圆点与文字上,纸面保持安静,避免彩签喧宾夺主。
   接入全站 B 语言:hover 浮起 + 书脊收窄 + 标题染朱砂。 */
.paper-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 6px;
  padding: 1rem 1.15rem 0.8rem 1.3rem;
  box-shadow: var(--shadow); min-width: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.paper-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--dim, var(--accent)); opacity: 0.62;
  transition: width 0.22s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.18s ease;
}
.paper-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(42, 39, 32, 0.14);
  border-color: var(--dim, var(--accent));
}
.paper-card:hover::before { width: 2px; opacity: 1; }
.paper-card:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.kb-grid > .paper-card { height: 100%; margin-bottom: 0; }

/* 顶部元信息:维度软签(本色圆点 + 本色文字)+ 相关性评分 + 相对时间 */
.paper-meta { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }
.paper-dim {
  flex: none; display: inline-flex; align-items: center; gap: 0.34rem;
  font-size: 0.62rem; font-weight: 600; line-height: 1; letter-spacing: 0.02em;
  color: var(--dim, var(--accent)); background: var(--dim, var(--accent));
  box-shadow: inset 0 0 0 999px rgba(255, 253, 248, 0.85);
  border: 1px solid var(--dim, var(--accent)); border-radius: 4px; padding: 0.28rem 0.48rem;
}
.paper-dim::before {
  content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%;
  background: var(--dim, var(--accent));
}
.paper-dim-none { color: var(--dim, var(--accent)); }
.paper-dim-none::before { background: var(--dim, var(--accent)); }
.paper-score {
  flex: none; font-family: var(--mono); font-size: 0.6rem; font-weight: 700; line-height: 1;
  color: var(--accent2); background: rgba(14, 124, 107, 0.08);
  border: 1px solid rgba(14, 124, 107, 0.24); border-radius: 4px;
  padding: 0.26rem 0.4rem; white-space: nowrap; cursor: help;
}
.paper-ago { margin-left: auto; flex: none; font-family: var(--mono); font-size: 0.62rem; color: var(--muted); }

/* 标题:英文为主(衬线),中文译题居下弱化 */
.paper-title { font-family: var(--serif); font-size: 1.02rem; line-height: 1.4; margin: 0 0 0.3rem; font-weight: 600; transition: color 0.16s ease; }
.paper-title a { color: var(--ink); text-decoration: none; }
.paper-card:hover .paper-title, .paper-card:hover .paper-title a { color: var(--accent); }
.paper-title-zh { font-size: 0.82rem; line-height: 1.55; color: var(--muted); margin: 0 0 0.3rem; font-weight: 500; }

/* 作者:小字弱墨,与标题分隔 */
.paper-authors { font-size: 0.7rem; color: var(--muted); margin: 0 0 0.55rem; }

/* 摘要:中文优先,3 行截断保持卡片等高 */
.paper-abstract {
  font-size: 0.8rem; color: var(--ink); line-height: 1.7; margin: 0 0 0.6rem; opacity: 0.9;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* 底部:arXiv 编号 + 日期 + arXiv 分类 + PDF 直链,虚线分隔 */
.paper-foot {
  margin-top: auto; padding-top: 0.55rem; border-top: 1px dashed var(--rule);
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem;
  font-size: 0.66rem; color: var(--muted);
}
.paper-id, .paper-date { flex: none; font-family: var(--mono); }
.paper-cats { display: flex; flex-wrap: wrap; gap: 0.28rem; min-width: 0; }
.paper-cat {
  white-space: nowrap; line-height: 1; font-family: var(--mono); font-size: 0.6rem;
  color: var(--muted); background: rgba(42, 39, 32, 0.03);
  border: 1px solid var(--rule); border-radius: 999px; padding: 0.2rem 0.46rem;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.paper-card:hover .paper-cat { color: var(--ink); border-color: rgba(42, 39, 32, 0.22); background: rgba(42, 39, 32, 0.05); }
.paper-pdf { margin-left: auto; flex: none; color: var(--accent); font-weight: 600; text-decoration: none; }
.paper-pdf:hover { text-decoration: underline; }

/* ---- 安全情报双 Tab(威胁情报 / 论文追踪聚合切换)----
   档案馆风格:等宽英文 kicker + 衬线中文名,激活项左侧朱砂书脊 + 浅底。 */
.intel-tabs {
  display: flex; gap: 0; margin: 0 0 1.2rem;
  border: 1px solid var(--rule); border-radius: 3px; overflow: hidden;
  background: var(--surface);
}
.intel-tab {
  position: relative; flex: 1; display: flex; align-items: baseline; gap: 0.55rem;
  padding: 0.7rem 1rem; color: var(--muted); text-decoration: none;
  border-right: 1px solid var(--rule);
  transition: background 0.15s ease, color 0.15s ease;
}
.intel-tab:last-child { border-right: none; }
.intel-tab::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent); opacity: 0;
  transition: opacity 0.18s ease;
}
.intel-tab:hover { background: rgba(176, 68, 46, 0.04); color: var(--ink); }
.intel-tab.active { background: rgba(176, 68, 46, 0.07); color: var(--accent); }
.intel-tab.active::before { opacity: 1; }
.intel-tab .it-kicker {
  font-family: var(--mono); font-size: 0.58rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.6;
}
.intel-tab .it-name { font-family: var(--serif); font-size: 0.95rem; font-weight: 600; letter-spacing: 0.02em; }
