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

: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;
}
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: var(--index-bg);
  color: var(--index-ink);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 0.8rem 0.9rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.index .brand {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.1rem 0.3rem 0.9rem;
  border-bottom: 1px solid rgba(216, 210, 194, 0.14);
}
.seal {
  width: 46px; height: 46px; 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.65), inset 0 0 0 4px var(--accent);
  letter-spacing: 0.05em;
}
.brand-text {
  font-family: var(--serif); font-size: 0.78rem; line-height: 1.4;
  color: #f2ede0;
}
.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: var(--index-muted); 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: var(--index-muted);
  font-family: var(--mono);
}
.index nav a {
  display: flex; align-items: center; gap: 0.5rem;
  color: #b9b2a0; font-size: 0.78rem;
  padding: 0.42rem 0.5rem; border-radius: 5px;
}
.index nav a:hover { background: rgba(176, 68, 46, 0.12); text-decoration: none; color: #f2ede0; }
.index nav a .no { font-family: var(--mono); font-size: 0.6rem; color: #6f6858; }
/* 侧边栏底部:用户条 + 操作按钮(两行紧凑布局) */
.index .foot {
  margin-top: auto;
  padding: 0.75rem 0.6rem 0.7rem;
  border-top: 1px solid rgba(216, 210, 194, 0.14);
  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: #f2ede0; border: 1px solid rgba(176, 68, 46, 0.5);
  transition: border-color 0.15s, background 0.15s;
}
.index .user-chip:hover { background: rgba(176, 68, 46, 0.12); 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.2); color: #e8b4a0;
}
.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(216, 210, 194, 0.3); color: var(--index-ink);
  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: #f2ede0; 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: 0 0 0.8rem; }
.sec .sub { font-family: var(--mono); font-size: 0.54rem; color: var(--muted); letter-spacing: 0.1em; }

/* 卷宗卡片(彩色装订脊) */
.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; }

/* 错误提示 */
.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;
}

/* ============ 响应式 ============ */
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .index {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center; flex-wrap: wrap; gap: 0.4rem;
  }
  .index .brand { border-bottom: none; }
  .index .cat, .index nav { display: none; }
  .index .foot { margin-top: 0; border-top: none; }
  .welcome { grid-template-columns: 1fr; }
  .wrap { padding: 0 1rem 2rem; }
}

/* ============ 知识层通用组件 ============ */
.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; 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; }

/* 筛选 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; }
.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); }

/* 视角切换 */
.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 .meta { margin-top: 0.5rem; padding-top: 0.45rem; border-top: 1px dashed var(--rule); display: flex; gap: 0.9rem; flex-wrap: wrap; font-size: 0.74rem; color: var(--muted); align-items: center; }
.kb-item .score { margin-left: auto; font-family: var(--mono); }

/* 徽章与标签 */
.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); }
.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;
}

/* 书架卡片 */
.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.8rem; }
.shelf-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 0.9rem 1rem; box-shadow: var(--shadow); }
.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.74rem; color: var(--warn); }
.shelf-card h3 { font-family: var(--serif); font-size: 0.92rem; margin-bottom: 0.3rem; }
.shelf-card p { font-size: 0.76rem; color: var(--muted); line-height: 1.65; }
.shelf-card .meta { margin-top: 0.5rem; font-size: 0.72rem; color: var(--muted); }

/* 馆藏文档卡片 */
.doc-card { display: flex; background: var(--surface); border: 1px solid var(--rule); border-radius: 7px; overflow: hidden; margin-bottom: 0.7rem; box-shadow: var(--shadow); }
.doc-card .doc-side { width: 5px; flex-shrink: 0; background: var(--accent2); }
.doc-card .doc-side.internal { background: var(--warn); }
.doc-card .doc-body { padding: 0.8rem 1rem; flex: 1; min-width: 0; }
.doc-card .meta { display: flex; gap: 0.6rem; align-items: center; font-size: 0.74rem; color: var(--muted); margin-top: 0.4rem; }
.doc-card h3 { font-family: var(--serif); font-size: 0.95rem; margin: 0.3rem 0; }
.doc-card p { font-size: 0.78rem; color: var(--muted); }
.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); }

/* 空状态 */
.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); }

/* ============ 工具台(lab) ============ */
.tool-layout { display: grid; grid-template-columns: 380px 1fr; gap: 1.4rem; align-items: start; }
@media (max-width: 900px) { .tool-layout { grid-template-columns: 1fr; } }

.tool-form {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 9px;
  padding: 1.1rem 1.2rem 1.3rem; box-shadow: var(--shadow);
}
.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); }
.tf-head .tg {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 6px;
  background: var(--accent); color: #fbf8ef;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; font-size: 0.95rem;
}

.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); }

/* 任务状态徽章 */
.status { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 10px; font-size: 0.68rem; border: 1px solid var(--rule); }
.st-pending { color: #8a6d1a; border-color: #d8b43a; background: rgba(216, 180, 58, 0.1); }
.st-running { color: var(--accent); border-color: var(--accent); background: rgba(176, 68, 46, 0.08); }
.st-done { color: var(--accent2); border-color: var(--accent2); background: rgba(14, 124, 107, 0.08); }
.st-failed { color: var(--danger); border-color: var(--danger); background: rgba(185, 28, 28, 0.07); }

/* 越狱免责声明 */
.callout-warn {
  border-left: 4px solid var(--accent); background: rgba(176, 68, 46, 0.06);
  padding: 0.7rem 0.9rem; border-radius: 0 7px 7px 0;
  font-size: 0.83rem; color: var(--ink); margin-bottom: 1.1rem; line-height: 1.7;
}
.checkline { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.8rem; color: var(--ink); line-height: 1.6; cursor: pointer; }
.checkline input { margin-top: 0.2rem; accent-color: var(--accent); }
.checkline em { color: var(--accent); font-style: normal; }

/* 任务进度条 */
.task-progress { margin: 0.4rem 0 1.2rem; }
.task-progress .bar {
  height: 12px; background: var(--bg3, #e9e4d6); border: 1px solid var(--rule);
  border-radius: 8px; overflow: hidden;
}
.task-progress .fill { height: 100%; background: var(--accent); border-radius: 8px; transition: width 0.4s ease; }
.task-progress .pg-line { font-size: 0.8rem; color: var(--muted); margin: 0.5rem 0 0; }
.task-progress .pg-pct { font-family: var(--mono); color: var(--accent); }

/* 报告页指标卡 */
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.8rem; margin-bottom: 1rem; }
.metric {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px;
  padding: 0.8rem 1rem; box-shadow: var(--shadow);
}
.metric .m-label { display: block; font-size: 0.72rem; color: var(--muted); margin-bottom: 0.3rem; }
.metric .m-value { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; color: var(--accent); }

/* 登记簿式表格(报告明细) */
.ledger { width: 100%; border-collapse: collapse; margin-bottom: 1.1rem; font-size: 0.84rem; }
.ledger th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 0.72rem;
  padding: 0.4rem 0.7rem; border-bottom: 2px solid var(--rule);
  letter-spacing: 0.08em;
}
.ledger td { padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--rule); }
.ledger tr:hover td { background: rgba(176, 68, 46, 0.04); }

.sample {
  background: var(--surface); border-left: 4px solid var(--accent2);
  padding: 0.7rem 1rem; margin: 0 0 1.2rem; border-radius: 0 6px 6px 0;
  font-size: 0.84rem; color: var(--ink); line-height: 1.8;
}
.jail-sample { border: 1px solid var(--rule); border-radius: 7px; padding: 0.7rem 0.9rem; margin-bottom: 0.7rem; background: var(--surface); }
.jail-sample .q { margin: 0.4rem 0 0.2rem; font-size: 0.82rem; }
.jail-sample .a { margin: 0; font-size: 0.82rem; color: var(--accent2); }

/* ============ 会客厅(salon) ============ */
.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.8rem; margin-bottom: 1.4rem; }
.channel-card {
  display: flex; background: var(--surface); border: 1px solid var(--rule);
  border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); transition: border-color 0.15s;
}
.channel-card:hover { border-color: var(--accent); text-decoration: none; }
.channel-card .body { padding: 0.8rem 0.95rem; flex: 1; }
.channel-card h3 { margin: 0 0 0.3rem; font-size: 1rem; }
.channel-card .meta { margin: 0; font-size: 0.76rem; color: var(--muted); }
.channel-card .sep { margin: 0 0.35rem; }
.channel-card .online { color: var(--accent2); }

.salon-layout { display: grid; grid-template-columns: 1fr; gap: 1.4rem; align-items: start; }

.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 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.68rem; color: var(--accent2); background: rgba(14, 124, 107, 0.08); padding: 0.05rem 0.45rem; border-radius: 8px; }
.c-time { font-size: 0.7rem; color: var(--muted); }
.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; }
.c-content { margin: 0; font-size: 0.86rem; line-height: 1.75; white-space: pre-wrap; }

/* ============ 个人空间(借阅卡 / 阅览者) ============ */
.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; }
.badge-warn { display: inline-block; min-width: 1.15rem; margin-left: 0.25rem; padding: 0 0.3rem;
  border-radius: 9px; background: var(--accent); color: #fbf8ef; font-size: 0.66rem; line-height: 1.15rem;
  text-align: center; vertical-align: middle; }
.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; margin: 0; font-size: 0.88rem; line-height: 1.6; }
.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; }

/* ============ 馆员区(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: rgba(176, 68, 46, 0.1); color: #f2ede0;
  transition: background 0.15s;
}
.index .curator-entry:hover { background: rgba(176, 68, 46, 0.22); 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: var(--index-muted); 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; }

/* ============ 统一确认弹窗(.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; }
