/* ============================================================
   泉参谋 · 泉参谋控制台 —— 现代设计系统（2026-08-19 重构）
   原则：去边框化 · 大留白 · 无衬线正文 · 纯色金点缀 · 柔和弥散阴影
   文化锚点：钱币浮雕图标 / 楷体印章字（仅品牌与工具印）
   ============================================================ */
:root {
  /* 中性面 */
  --bg: #fafaf9;             /* 页面底 */
  --surface: #ffffff;        /* 卡片/面板 */
  --surface-2: #f4f4f2;      /* 凹槽/悬停 */
  --line: #e9e9e5;           /* 发丝线（少用） */
  --text: #1d1b16;
  --muted: #77726a;
  /* 朱砂（主强调：印泥红）；金只留给钱币图标 */
  --seal: #c5402e;
  --seal-ink: #a33322;
  --seal-soft: #fceeeb;
  --gold: #b8892f;
  --gold-ink: #8a6423;
  --gold-soft: #faf3e2;
  /* 语义 */
  --green: #3f8f3d;
  --red: #cf5240;
  /* 兼容旧引用 */
  --accent: #c5402e;
  --gold-hi: #8a6423;
  --border: #e9e9e5;
  --border-soft: #f0f0ec;
  --bg2: #ffffff;
  --bg3: #f4f4f2;
  --grad-gold: linear-gradient(135deg, #d8ab52 0%, #b8892f 55%, #96701f 100%);
  /* 阴影（弥散、克制） */
  --shadow-sm: 0 1px 2px rgba(29,27,22,.05), 0 1px 3px rgba(29,27,22,.06);
  --shadow-md: 0 2px 6px rgba(29,27,22,.05), 0 8px 24px rgba(29,27,22,.08);
  --shadow-lg: 0 4px 12px rgba(29,27,22,.08), 0 20px 60px rgba(29,27,22,.14);
  --radius: 14px;
  --serif: "STKaiti", "KaiTi", "SimSun", serif;
  --sans: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  color: var(--text);
  font-size: 15px; line-height: 1.7;
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
}

/* 背景铜钱纹饰（保留立体浮雕钱币，作为品牌锚点） */
.bg-decor { position: fixed; right: -110px; top: 6%; width: 400px; height: 400px;
  opacity: .055; pointer-events: none; z-index: 0; }
.bg-decor svg { width: 100%; height: 100%; color: var(--gold); }
.bg-decor .bg-ring2 { display: none; }

/* ---------------- 顶栏：干净白 + 发丝线 ---------------- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 16.5px; font-weight: 650; flex: 1; min-width: 0; letter-spacing: .2px; white-space: nowrap; }
.brand em {
  font-style: normal; font-family: var(--serif); font-size: 12px; font-weight: 500;
  color: #fff; letter-spacing: 2px; padding: 3px 8px; border-radius: 7px;
  background: var(--seal); flex-shrink: 0;
}
.brand-icon { width: 26px; height: 26px; }
.top-actions { display: flex; gap: 6px; align-items: center; }

/* 图标按钮：幽灵态 */
.icon-btn {
  background: transparent; color: var(--muted);
  border: none; border-radius: 10px;
  width: 36px; height: 36px; font-size: 16px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { background: #ececea; }

/* 主按钮：纯色金 */
.btn-primary {
  background: var(--seal); color: #fff;
  border: none; border-radius: 10px; padding: 8px 16px; font-weight: 600;
  cursor: pointer; font-size: 14px; font-family: var(--sans);
  box-shadow: var(--shadow-sm);
  transition: background .15s, transform .1s;
}
.btn-primary:hover { background: #a83524; }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-sm { padding: 6px 13px; font-size: 13px; }

/* 顶栏导航：文字幽灵药丸（桌面全称/手机短词） */
.nav-link {
  display: inline-flex; align-items: center;
  color: var(--text); text-decoration: none; font-size: 13px;
  font-weight: 800; letter-spacing: .5px;
  padding: 7px 12px; border-radius: 9px; font-family: var(--sans);
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link .nl-short { display: none; }
@media (max-width: 899px) {
  .nav-link { padding: 6px 8px; font-size: 12px; }
}

/* 评/院印章：楷体幽灵圆钮 */
.nav-seal {
  width: 36px; height: 36px; border-radius: 9px;
  border: none; background: var(--seal);
  color: #fff; font-family: var(--serif); font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: background .15s, transform .1s;
}
.nav-seal:hover { background: #a83524; }
.nav-seal:active { transform: scale(.95); }

/* ---------------- 悬浮报告钮（2026-10-06 用户要求隐藏，恢复删此规则即可） ---------------- */
#panelfab { display: none !important; }

/* ---------------- 横幅 ---------------- */
.banner {
  background: var(--seal-soft); color: var(--seal-ink);
  padding: 9px 14px; font-size: 13px;
  border-bottom: 1px solid var(--line); text-align: center;
}
.banner.ok { background: #eef5ee; color: var(--green); }
.banner.hidden { display: none; }   /* 2026-10-06 修：健康态空壳条真隐藏，页面整体上移；告警态无hidden类照常弹出 */

/* ---------------- 布局 ---------------- */
.layout { display: flex; flex: 1; min-height: 0; position: relative; z-index: 1; }
.sidebar {
  width: 250px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.sidebar-head {
  padding: 16px 18px 8px; font-size: 12px; color: var(--muted); font-weight: 600;
  letter-spacing: 1.5px;
}
.session-list { flex: 1; overflow-y: auto; padding: 4px 10px; }
.session-item {
  padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: 13.5px;
  color: var(--text); display: flex; align-items: center; gap: 8px; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden;
  transition: background .12s;
}
.session-item .seal, .session-item .seal.round { width: 18px; height: 18px;
  border-radius: 50%; font-size: 10px; border-width: 1px; box-shadow: none; }
.session-item .seal-img { width: 18px; height: 18px; flex-shrink: 0; }
.session-item:hover { background: var(--surface-2); }
.session-item.active { background: var(--seal-soft); color: var(--seal-ink); font-weight: 550; }
.session-item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.session-item .del { visibility: hidden; color: var(--muted); font-size: 12px; }
.session-item:hover .del { visibility: visible; }
.session-item .del:hover { color: var(--red); }
.sidebar-foot { padding: 12px 14px; border-top: 1px solid var(--line); }
.tools-hint { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin-top: 10px; }
.sidebar-mask { display: none; }

/* ---------------- 主区 ---------------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.messages { flex: 1; overflow-y: auto; padding: 24px max(20px, calc(50% - 430px)) 12px; }

/* 欢迎 */
.welcome { text-align: center; padding: 44px 16px 26px; color: var(--muted); }
.welcome-coin { position: relative; width: 116px; height: 116px; margin: 0 auto; }
.welcome-coin img { width: 100%; height: 100%; display: block;
  animation: coinGlow 5s ease-in-out infinite; }
@keyframes coinGlow {
  0%, 100% { filter: drop-shadow(0 6px 14px rgba(197,64,46,.22)); }
  50% { filter: drop-shadow(0 8px 26px rgba(197,64,46,.38)); }
}
.welcome h2 {
  margin: 24px 0 6px; font-size: 30px; font-weight: 800; font-family: var(--sans);
  color: var(--text); letter-spacing: 3px;
}
.welcome h2 small {
  display: block; font-size: 13px; letter-spacing: 5px; margin-top: 10px;
  color: var(--muted); font-weight: 400;
}
.welcome p { font-size: 14.5px; max-width: 420px; margin: 6px auto 0; color: var(--muted); }
.suggest { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 28px; }
.chip {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 18px; font-size: 13.5px; cursor: pointer; font-family: var(--sans);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, background .15s, color .15s;
}
.chip:hover { border-color: var(--seal); background: var(--seal-soft); color: var(--seal-ink); }

/* 消息：现代对话（助手=白卡 / 用户=金晕泡） */
.msg { margin-bottom: 22px; display: flex; gap: 12px; }
.msg.user { flex-direction: row-reverse; }
.msg .avatar { width: 34px; height: 34px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 14px; }
.msg .bubble {
  max-width: 76%; border-radius: 16px; padding: 12px 16px;
  overflow-wrap: break-word; font-size: 15px;
}
.msg.user .bubble {
  background: var(--seal-soft); color: var(--seal-ink);
  border-top-right-radius: 6px;
}
.msg.assistant .bubble {
  max-width: 88%;
  background: transparent;
  padding: 2px 0 0 0;
  border-radius: 0;
}
.bubble img.att-thumb { max-width: 150px; max-height: 150px; border-radius: 12px;
  margin-top: 6px; margin-right: 6px; border: 1px solid var(--line); padding: 2px; background: var(--surface); }

/* markdown-lite */
.md h1, .md h2, .md h3 { margin: 12px 0 6px; font-size: 15.5px; font-family: var(--sans);
  font-weight: 650; color: var(--text); display: inline-block; }
.md p { margin: 7px 0; line-height: 1.75; }
.md ul, .md ol { margin: 6px 0 6px 20px; }
.md li { margin: 4px 0; line-height: 1.7; }
.md code { background: var(--surface-2); border-radius: 5px; padding: 1px 6px; font-size: 13px;
  color: var(--text); }
.md strong { color: var(--text); font-weight: 700; }
.md a { color: var(--seal-ink); }
.md hr { border: none; height: 1px; margin: 12px 0; background: var(--line); }
.md table { border-collapse: collapse; margin: 8px 0; font-size: 13.5px; }
.md th, .md td { border: 1px solid var(--line); padding: 4px 10px; }
.md th { color: var(--seal-ink); font-weight: 600; }

/* ---------------- 印章（文化锚点：扁平楷体印） ---------------- */
.seal {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  border: 1px solid var(--seal); color: var(--seal-ink);
  font-family: var(--serif); font-size: 12.5px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--seal-soft);
}
.msg .avatar .seal.lg { background: var(--seal); color: #fff; border-color: var(--seal); }
.seal.round { border-radius: 50%; }
.seal.lg { width: 28px; height: 28px; font-size: 15px; }
.seal.ok { border-color: var(--green); color: var(--green); background: #eef5ee; }
.seal.err { border-color: var(--red); color: var(--red); background: #fbeeed; }
.coin-spin { display: inline-flex; animation: spin 1.8s linear infinite; }
.coin-spin svg { width: 15px; height: 15px; color: var(--gold); }

/* ---------------- 工具行（原工具卡：极简） ---------------- */
.tool-card {
  position: relative;
  background: var(--surface);
  border-radius: 12px; margin: 2px 0 16px; font-size: 13px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.tool-card .tc-head {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px; cursor: pointer; user-select: none;
}
.tool-card .tc-name { font-weight: 600; color: var(--text); }
.tool-card .tc-args { color: var(--muted); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; flex: 1; font-size: 12.5px; }
.tool-card .tc-time { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.tool-card .tc-sum { padding: 0 14px 10px; color: var(--muted); font-size: 12.5px; }
.tool-card.err .tc-sum { color: var(--red); }
.tc-links { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 10px; }
.tc-links a {
  color: var(--seal-ink); font-size: 12.5px; text-decoration: none;
  padding: 2px 8px; border-radius: 6px;
  transition: background .12s;
}
.tc-links a:hover { background: var(--surface-2); }

/* 状态行 */
.status-line { color: var(--muted); font-size: 12.5px; margin: 2px 0 12px;
  display: flex; align-items: center; gap: 8px; }
.dots::after { content: "…"; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
@keyframes spin { to { transform: rotate(360deg); } }
.cursor-blink { display: inline-block; width: 7px; height: 15px;
  background: var(--seal); vertical-align: -2px; animation: blink 1s infinite;
  margin-left: 2px; border-radius: 1px; }

/* 候选选择题 / 纠错 */
.clarify-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: -6px 0 16px; padding-left: 4px; }
.clarify-q { font-size: 12.5px; color: var(--seal-ink); font-weight: 550; }
.clarify-row .chip { padding: 4px 14px; font-size: 13px; }
.tc-live { padding: 2px 12px 8px 12px; font-size: 12px; color: var(--muted); letter-spacing: .08em; }
.tc-live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--seal); margin-right: 7px; vertical-align: 1px; animation: livepulse 1.3s ease-in-out infinite; }
@keyframes livepulse { 0%, 100% { opacity: .2 } 50% { opacity: 1 } }
.fu-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 4px 16px; }
.fu-lab { font-size: 12px; color: var(--muted); letter-spacing: .12em; }
.fb-seal {
  width: 24px; height: 24px; border-radius: 7px; border: none;
  background: transparent; color: var(--muted); font-family: var(--serif);
  font-size: 12px; cursor: pointer; align-self: flex-end; margin-top: 4px;
  transition: background .15s, color .15s;
}
.fb-seal:hover { background: var(--seal-soft); color: var(--seal-ink); }

/* ---------------- 输入区 ---------------- */
.composer-wrap { padding: 10px max(20px, calc(50% - 430px)) 14px; }
.att-chips { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.att-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 4px 9px; font-size: 12.5px; box-shadow: var(--shadow-sm);
}
.att-chip img { width: 34px; height: 34px; object-fit: cover; border-radius: 7px; }
.att-chip .kind { color: var(--seal-ink); font-weight: 600; cursor: pointer;
  border-bottom: 1px dashed rgba(197,64,46,.45); }
.att-chip .kind:hover { color: var(--seal); }
.att-chip .rm { cursor: pointer; color: var(--muted); }
.att-chip .rm:hover { color: var(--red); }
.att-chip.uploading { opacity: .6; }

.attach-wrap { position: relative; }
/* 输入栏「＋」钮：拍照/传图/实时互动入口（与语音钮同一家族的中性圆钮） */
.attach-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: transparent; color: var(--ink);
  border: 1px solid var(--line);
  cursor: pointer; flex-shrink: 0; padding: 0;
  transition: color .15s, border-color .15s, transform .1s;
}
.attach-btn svg { width: 18px; height: 18px; }
.attach-btn:hover { color: var(--seal); border-color: var(--seal); }
.attach-btn:active { transform: scale(.94); }

/* 识版结果末尾的「进掌眼」CTA（朱印主行动钮） */
.auth-cta {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 0 4px; padding: 12px 16px; width: fit-content;
  background: #c5402e; color: #fff; border: none; border-radius: 12px;
  font-size: 14.5px; font-family: var(--sans); letter-spacing: .5px;
  cursor: pointer; box-shadow: 0 6px 18px rgba(197, 64, 46, .28);
}
.auth-cta:active { transform: scale(.97); }
.auth-cta .ac-seal {
  width: 24px; height: 24px; border-radius: 6px; background: rgba(255, 255, 255, .18);
  display: flex; align-items: center; justify-content: center;
  font-family: KaiTi, STKaiti, serif; font-size: 15px; flex: none;
}

/* ── 识版×掌眼合并卡（2026-10-06）：识版气泡后的掌眼层容器 ── */
.merge-card {
  margin: 10px 0 4px; max-width: 560px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.merge-card .mc-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(197,64,46,.07), rgba(197,64,46,.02));
}
.merge-card .mc-seal {
  width: 22px; height: 22px; border-radius: 6px; background: var(--seal); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: KaiTi, STKaiti, serif; font-size: 14px; flex: none;
}
.merge-card .mc-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.merge-card .mc-body { padding: 12px 14px 14px; }
.merge-card .mc-stage { font-size: 14px; color: var(--text); }
.merge-card .mc-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.merge-card .mc-verdict { font-size: 15px; color: var(--text); }
.merge-card .mc-verdict b { color: var(--seal-ink); font-size: 17px; }
.merge-card .mc-note {
  font-size: 12px; color: var(--muted); margin-top: 8px; padding: 8px 10px;
  background: var(--surface-2); border-radius: 8px;
}
.merge-card .mc-dis { font-size: 11px; color: var(--muted); margin-top: 10px; opacity: .85; }
.merge-card .mc-btn {
  display: inline-block; margin-top: 10px; padding: 8px 18px;
  background: var(--seal); color: #fff; border: none; border-radius: 999px;
  font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.merge-card .mc-btn:active { transform: scale(.97); }
.merge-card .mc-btn.ghost {
  background: transparent; color: var(--seal); border: 1px solid var(--seal);
}
.merge-card .tc-links { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.merge-card .dots::after { content: "…"; animation: mcdots 1.4s infinite steps(4); }
@keyframes mcdots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@media (max-width: 879.98px) {
  .merge-card { max-width: 100%; }
}

.composer {
  display: flex; align-items: flex-end; gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 22px;
  padding: 8px 9px 8px 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.composer:focus-within {
  border-color: var(--seal);
  box-shadow: 0 0 0 3px rgba(197,64,46,.1), var(--shadow-sm);
}
.composer textarea {
  flex: 1; background: transparent; border: none; outline: none; resize: none;
  color: var(--text); font-size: 15px; font-family: var(--sans); max-height: 130px;
  line-height: 1.55; padding: 9px 0; box-sizing: border-box;
}
.composer .btn-primary { width: 38px; height: 38px; padding: 0; font-size: 15px; border-radius: 14px; }
.composer .icon-btn { width: 38px; height: 38px; }
.composer-tip { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 8px;
  letter-spacing: .5px; }

/* ---------------- 藏泉台（右栏） ---------------- */
.workbench { display: none; }

@media (min-width: 880px) {
  .main { flex: 0 0 38%; min-width: 420px; max-width: 660px; }
  .workbench {
    display: flex; flex: 1 1 auto; flex-direction: column;
    min-width: 0; min-height: 0;
    background: var(--bg);
    border-left: 1px solid var(--line);
  }
  /* 2026-10-06 修 D-1：只藏藏泉台收起钮。原 .wb-close 通配把登录面板✕(#ls-close)也藏了 */
  #wb-close { display: none; }
  .panelfab { display: none !important; }
}

/* 880~1100 窄桌面带：压侧栏、聊天列，给资料栏让位 */
@media (min-width: 880px) and (max-width: 1099.98px) {
  .sidebar { width: 196px; }
  .main { flex: 0 0 44%; min-width: 360px; max-width: 520px; }
  .workbench { min-width: 250px; }
}

/* 手机：底部抽屉 */
@media (max-width: 879.98px) {
  .workbench {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 130;
    height: 82vh; max-height: 82vh;
    display: flex; flex-direction: column;
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-radius: 20px 20px 0 0;
    transform: translateY(105%);
    transition: transform .28s cubic-bezier(.32,.72,.33,1);
    box-shadow: var(--shadow-lg);
  }
  .workbench.open { transform: translateY(0); }
  .panelfab {
    position: fixed; right: 14px; bottom: 122px; z-index: 120;
    font-size: 14px; letter-spacing: 2px; font-family: var(--sans);
    color: #fff; background: var(--seal); border: none; border-radius: 999px;
    padding: 11px 20px; cursor: pointer; font-weight: 600;
    box-shadow: 0 6px 20px rgba(197,64,46,.38);
    animation: fabbreath 2.6s ease-in-out infinite;
  }
}
.panelfab.hidden { display: none; }
@keyframes fabbreath {
  0%, 100% { box-shadow: 0 6px 20px rgba(197,64,46,.32); }
  50% { box-shadow: 0 6px 26px rgba(197,64,46,.55); }
}

/* 台头 */
.wb-head { display: flex; align-items: center; gap: 9px; padding: 14px 18px 6px; }
.wb-head .seal { border-radius: 50%; }
.wb-title { font-size: 15px; font-weight: 650; letter-spacing: 4px; color: var(--text); }
.wb-coin { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 13px; }
.wb-close {
  background: transparent; border: none; color: var(--muted);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 13px;
  flex-shrink: 0;
}
.wb-close:hover { background: var(--surface-2); color: var(--text); }

/* 标签页：下划线式 */
.wb-tabs {
  display: flex; gap: 4px; padding: 2px 14px 0;
  border-bottom: 1px solid var(--line);
}
.wb-tab {
  font-size: 13.5px; font-family: var(--sans);
  color: var(--muted); background: transparent;
  border: none; border-bottom: 2px solid transparent; border-radius: 0;
  padding: 8px 13px 9px; cursor: pointer; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.wb-tab:hover { color: var(--text); }
.wb-tab.active {
  color: var(--seal-ink); font-weight: 600;
  border-bottom-color: var(--seal);
}
.wb-tab.dis { opacity: .3; pointer-events: none; }

/* 台身 */
.wb-body { flex: 1; overflow-y: auto; min-height: 0; padding: 18px; }
.wb-pane { display: none; }
.wb-pane.active { display: block; }
.wb-pane .wb-empty { display: none; }
.wb-pane.blank .wb-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 56px 16px; text-align: center;
}
.wb-pane.blank .wb-photos, .wb-pane.blank .wb-dossier,
.wb-pane.blank .wb-grade, .wb-pane.blank .wb-v3d { display: none; }
.wb-pane.blank .wb-empty svg {
  width: 56px; height: 56px; color: var(--gold); opacity: .45; margin-bottom: 8px;
}
.wb-pane.blank .wb-empty .we-t { font-size: 15px; font-weight: 600; color: var(--text); }
.wb-pane.blank .wb-empty .we-s {
  font-size: 12.5px; color: var(--muted); line-height: 1.8; max-width: 300px;
}

/* 参考图网格 */
.wb-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 14px; }
.wb-photo {
  border-radius: 14px; overflow: hidden; background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s;
}
.wb-photo:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.wb-photo .ph-pair { display: grid; grid-template-columns: 1fr 1fr; }
.wb-photo .ph-pair.one { grid-template-columns: 1fr; }
.wb-photo img {
  width: 100%; display: block;
  background: var(--surface-2); cursor: zoom-in;
  /* 上下边缘虚化：标注图上下文字带渐变淡出，币图原大不裁 */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 11%, #000 89%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 11%, #000 89%, transparent 100%);
}
.wb-photo .ph-cap {
  padding: 7px 11px; font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 档案字段 */
.wb-dossier .ds-item { margin-bottom: 14px; }
.wb-dossier .ds-k { font-size: 12.5px; color: var(--seal-ink); font-weight: 600; margin-bottom: 2px; }
.wb-dossier .ds-v { color: var(--text); font-size: 13.5px; line-height: 1.75; }
.wb-dossier .ds-more {
  display: inline-block; margin-top: 8px; color: var(--seal-ink); font-size: 13px;
  text-decoration: none; padding: 5px 12px; border-radius: 8px;
  transition: background .12s;
}
.wb-dossier .ds-more:hover { background: var(--surface-2); }

/* 3D观币 */
.wb-v3d iframe {
  width: 100%; height: min(64vh, 580px);
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
}

/* 评级卡 */
.wb-grade .gr-card {
  border-radius: 16px; padding: 18px 20px;
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.wb-grade .gr-top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.wb-grade .gr-name { font-family: var(--serif); font-size: 17px; color: var(--text); letter-spacing: 1px; }
.wb-grade .gr-score { font-size: 26px; font-weight: 800; color: var(--seal); }
.wb-grade .gr-kv { display: grid; grid-template-columns: 78px 1fr; gap: 4px 12px;
  font-size: 13px; margin: 12px 0 2px; }
.wb-grade .gr-kv .k { color: var(--muted); }
.wb-grade .gr-imgs { margin-top: 10px; }
.wb-grade .gr-imgs img {
  max-width: 49%; border-radius: 10px; border: 1px solid var(--line);
  margin: 4px 2px 0 0; cursor: zoom-in; background: var(--surface-2); padding: 2px;
}

/* 台头更新轻闪 */
.workbench.flash .wb-head { animation: wbflash .9s ease 2; }
@keyframes wbflash { 50% { background: var(--seal-soft); } }

/* 灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(24,22,18,.9);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); cursor: zoom-out;
}
.lightbox.hidden { display: none; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 12px;
  box-shadow: var(--shadow-lg); }
.lb-close {
  position: fixed; top: 18px; right: 18px; width: 38px; height: 38px;
  border-radius: 10px; background: rgba(255,255,255,.12); color: #fff;
  border: none; font-size: 16px; cursor: pointer;
}
.lb-close:hover { background: rgba(255,255,255,.22); }

/* ---------------- 泉友身份 + 登录浮层 ---------------- */
.identity-box {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 12px;
  transition: background .15s;
}
.identity-box:hover { background: var(--surface-2); }
.idb-seal-img { width: 26px; height: 26px; flex-shrink: 0; transition: filter .2s, opacity .2s; }
.idb-seal-img.guest { filter: grayscale(.85); opacity: .5; }
.identity-box .idb-main { flex: 1; min-width: 0; }
.idb-name { font-size: 13.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idb-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.idb-act {
  background: transparent; color: var(--seal-ink);
  border: none; border-radius: 8px;
  padding: 6px 12px; font-size: 12.5px; cursor: pointer; font-family: var(--sans); font-weight: 550;
  flex-shrink: 0;
  transition: background .15s;
}
.idb-act:hover { background: var(--seal-soft); }
.identity-box.logged .idb-act:hover { background: #fbeeed; color: var(--red); }

.login-sheet { position: fixed; inset: 0; z-index: 210; }
.login-sheet.hidden { display: none; }
.ls-mask { position: absolute; inset: 0; background: rgba(24,22,18,.4);
  backdrop-filter: blur(3px); }
.ls-card {
  position: relative; margin: auto; top: 50%; transform: translateY(-50%);
  width: min(92vw, 360px);
  background: var(--surface);
  border-radius: 20px; padding: 20px 22px 22px;
  box-shadow: var(--shadow-lg);
}
.ls-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.ls-title { flex: 1; font-size: 17px; font-weight: 700; letter-spacing: 2px; color: var(--text); }
.ls-modes {
  display: flex; gap: 4px; margin-bottom: 16px; padding: 4px;
  background: var(--surface-2); border-radius: 11px;
}
.ls-mode {
  flex: 1; font-size: 13px; font-family: var(--sans);
  color: var(--muted); background: transparent;
  border: none; border-radius: 8px; padding: 7px 0;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.ls-mode:hover { color: var(--text); }
.ls-mode.active { color: var(--text); background: var(--surface); font-weight: 600;
  box-shadow: var(--shadow-sm); }
.ls-input {
  width: 100%; background: var(--surface-2);
  border: 1px solid transparent; border-radius: 11px; color: var(--text);
  font-size: 15px; padding: 12px 14px; outline: none; letter-spacing: 1px;
  font-family: var(--sans);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.ls-input:focus { background: var(--surface); border-color: var(--seal);
  box-shadow: 0 0 0 3px rgba(197,64,46,.1); }
.ls-code-row { display: flex; gap: 8px; margin: 10px 0 14px; }
.ls-code-row .ls-input { flex: 1; }
.ls-send {
  background: transparent; color: var(--seal-ink);
  border: 1px solid var(--line); border-radius: 11px; padding: 0 14px;
  font-size: 13px; cursor: pointer; white-space: nowrap; font-family: var(--sans); font-weight: 550;
  transition: border-color .15s, background .15s;
}
.ls-send:hover:not(:disabled) { border-color: var(--seal); background: var(--seal-soft); }
.ls-send:disabled { opacity: .45; cursor: not-allowed; }
.ls-submit { width: 100%; padding: 12px 0; font-size: 15px; letter-spacing: 2px;
  border-radius: 12px; }
.ls-tip { margin-top: 12px; font-size: 12px; color: var(--muted);
  text-align: center; }
.ls-tip.err { color: var(--red); }

/* ---------------- 移动端 ---------------- */
@media (max-width: 899px) {
  /* 首屏压缩：欢迎页全要素收进一屏 */
  .welcome { padding: 14px 12px 14px; }
  .welcome-coin { width: 78px; height: 78px; }
  .welcome h2 { margin: 12px 0 2px; font-size: 21px; letter-spacing: 2px; }
  .welcome h2 small { font-size: 11px; letter-spacing: 2px; margin-top: 4px; }
  .welcome p { font-size: 12.5px; margin-top: 2px; }
  .feature-grid { gap: 9px; margin-top: 14px; }   /* 2026-10-06: 不再覆盖列数——全端统一 3+2 六轨宫格 */
  .f-card { padding: 10px 11px; gap: 9px; border-radius: 12px; }
  .f-ic { width: 32px; height: 32px; border-radius: 9px; }
  .f-ic svg { width: 16px; height: 16px; }
  .f-tx b { font-size: 12.5px; }
  .f-tx i { font-size: 10.5px; }
  .topbar { gap: 6px; padding: 8px 12px; }
  .brand { font-size: 15px; gap: 6px; }
  .brand em { font-size: 10px; letter-spacing: 1px; padding: 2px 6px; border-radius: 6px; }
  .nav-seal { width: 34px; height: 34px; font-size: 14px; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 100;
    transform: translateX(-100%); transition: transform .24s cubic-bezier(.32,.72,.33,1);
    width: min(80vw, 300px); box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-mask { display: block; position: fixed; inset: 0;
    background: rgba(24,22,18,.35); z-index: 99; backdrop-filter: blur(2px); }
  .sidebar-mask.hidden { display: none; }
  .messages { padding: 16px 12px; }
  .composer-wrap { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
  .msg .bubble { max-width: 88%; }
  .msg.assistant .bubble { max-width: 94%; }
  #btn-menu { display: block; }
  .top-actions .btn-primary { padding: 6px 9px; }
  .bg-decor { width: 260px; height: 260px; right: -80px; }
}
@media (min-width: 900px) { #btn-menu { display: none; } }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb {
  background: #d8d6cf; border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: #c2c0b8; }
::-webkit-scrollbar-track { background: transparent; }
::selection { background: rgba(197,64,46,.18); }

/* ---------------- 能力卡片宫格（豆包式） ---------------- */

/* 2026-10-06 宫格改版（v2 全端统一）：上行三卡（纲目·版别/在线课堂/古钱杂谈，各占2轨），
 * 下行两卡（拍照识版/购销档案，各占3轨）——两行总宽一致；手机端同为 3+2（用户 2026-10-06 指定） */
.feature-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px;
  max-width: 580px; margin: 30px auto 0; }
.feature-grid .f-card { grid-column: span 2; }
.feature-grid #fc-camera, .feature-grid #fc-collection { grid-column: span 3; }
.f-card {
  display: flex; align-items: center; gap: 7px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 9px 9px; cursor: pointer; text-decoration: none;
  font-family: var(--sans);
  font-size: inherit; line-height: inherit;   /* 2026-10-06 修：<button>卡不继承字体行高，与<a>卡文字高度/间距不一致 */
  box-shadow: var(--shadow-sm);
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.f-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #d8d6cf; }
.f-card:active { transform: scale(.98); }
.f-ic { width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; }
.f-ic svg { width: 14px; height: 14px; }
.f-ic.red { background: var(--seal-soft); color: var(--seal); }
.f-ic.gold { background: var(--gold-soft); color: var(--gold); }
.f-ic.green { background: #ecf4eb; color: var(--green); }
.f-tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.f-tx b { font-size: 12.5px; font-weight: 800; color: var(--text); white-space: nowrap; }
.f-tx i { font-style: normal; font-size: 11.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) {
  /* 2026-10-06: 3+2 宫格全端统一——窄屏三卡行收紧内距，「纲目·版别」标题单行 */
  .f-card { padding: 7px 7px; gap: 6px; }
  .f-ic { width: 26px; height: 26px; border-radius: 8px; }
  .f-ic svg { width: 13px; height: 13px; }
  .f-tx b { font-size: 11px; }
  .f-tx i { font-size: 10px; white-space: normal; }
}
/* 宫卡自适应微调（2026-10-06，必须置于基础规则之后才生效）：
 * 目标=五字标题「纲目·版别」全视口单行不溢出。880~1199 为主列临界带（卡片~105px），≤359 为超窄机 */
@media (min-width: 880px) and (max-width: 1199.98px) {
  .f-card { padding: 7px; gap: 5px; }
  .f-ic { width: 24px; height: 24px; }
}
@media (max-width: 359.98px) {
  .f-card { padding: 6px 8px; }
  .f-ic { display: none; }   /* 超窄机三卡行放不下图标+五字标题：纯文字卡 */
  .f-tx b { font-size: 10.5px; }
}


/* 侧栏顶部：新对话大按钮（豆包式） */
.sidebar-top { padding: 12px 12px 4px; }
.new-chat-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%;
  background: var(--seal); color: #fff; border: none; border-radius: 12px;
  padding: 10px 0; font-size: 14px; font-weight: 600; font-family: var(--sans);
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: background .15s, transform .1s;
}
.new-chat-btn svg { width: 15px; height: 15px; }
.new-chat-btn:hover { background: #a83524; }
.new-chat-btn:active { transform: scale(.98); }

/* ── 语音按钮 + 分享卡 ── */
.mic-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
  cursor: pointer; flex-shrink: 0; transition: all .15s;
}
.mic-btn svg { width: 18px; height: 18px; }
.mic-btn:hover { color: var(--seal); border-color: var(--seal); }
.mic-btn.rec { background: var(--seal); color: #fff; border-color: var(--seal); animation: micpulse 1.2s infinite; }
@keyframes micpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(197,64,46,.35); } 50% { box-shadow: 0 0 0 7px rgba(197,64,46,0); } }
.share-chip { border-color: var(--seal) !important; color: var(--seal-ink) !important; }
.share-modal { position: fixed; inset: 0; z-index: 320; background: rgba(24,22,17,.78);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; }
.share-modal img { width: min(78vw, 420px); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.share-tip { color: #eee7dc; font-size: 14px; letter-spacing: .06em; }

/* ── 取景拍照弹层 ── */
.cam-modal { position: fixed; inset: 0; z-index: 340; background: rgba(18,16,13,.88);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.cam-box { position: relative; width: min(92vw, 560px); background: #000; border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.cam-box video { width: 100%; max-height: 62vh; display: block; background: #000; }
.cam-tip { position: absolute; left: 0; right: 0; top: 14px; text-align: center; color: #fff;
  font-size: 14.5px; letter-spacing: .06em; text-shadow: 0 1px 4px rgba(0,0,0,.7); pointer-events: none; }
.cam-ops { display: flex; align-items: center; justify-content: space-around; padding: 12px 16px 16px; background: #111; }
.cam-switch, .cam-done { border: 1px solid #555; background: transparent; color: #ddd; border-radius: 9px;
  padding: 7px 14px; font-size: 13px; cursor: pointer; font-family: var(--sans); }
.cam-switch:hover, .cam-done:hover { border-color: var(--seal); color: #fff; }
.cam-shot { width: 52px; height: 52px; border-radius: 50%; border: 3px solid #fff; background: rgba(255,255,255,.14);
  cursor: pointer; transition: transform .1s, background .15s; }
.cam-shot:hover { background: rgba(197,64,46,.55); }
.cam-shot:active { transform: scale(.92); }
.cam-close { position: absolute; top: 10px; right: 12px; border: none; background: rgba(0,0,0,.45); color: #fff;
  width: 32px; height: 32px; border-radius: 50%; font-size: 15px; cursor: pointer; }

/* ── 手动裁切弹层 ── */
.crop-modal { position: fixed; inset: 0; z-index: 360; background: rgba(18,16,13,.9);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 18px; }
.crop-stage { position: relative; max-width: min(92vw, 640px); max-height: 60vh; touch-action: none; }
.crop-stage img { max-width: min(92vw, 640px); max-height: 60vh; display: block; border-radius: 10px; user-select: none;
  -webkit-user-drag: none; }
.crop-box { position: absolute; display: none; cursor: move; touch-action: none; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(18,16,13,.62); border: 2px solid rgba(255,255,255,.95); touch-action: none; }
.crop-box:active .crop-ring { border-color: var(--seal); }
.crop-handle { position: absolute; right: -12px; bottom: -12px; width: 26px; height: 26px;
  background: var(--seal); border: 2px solid #fff; border-radius: 5px; cursor: nwse-resize; touch-action: none; }
.crop-tip { color: #eee7dc; font-size: 13px; letter-spacing: .04em; text-align: center; padding: 0 10px; }
.crop-ops { display: flex; gap: 10px; }
.crop-ops button { border: 1px solid #666; background: transparent; color: #ddd; border-radius: 9px;
  padding: 8px 16px; font-size: 13.5px; cursor: pointer; font-family: var(--sans); }
.crop-ops .c-ok { background: var(--seal); border-color: var(--seal); color: #fff; font-weight: 600; }
.crop-ops button:hover { border-color: #fff; color: #fff; }
.crop-close { position: fixed; top: 16px; right: 18px; border: none; background: rgba(0,0,0,.5); color: #fff;
  width: 34px; height: 34px; border-radius: 50%; font-size: 15px; cursor: pointer; z-index: 1; }

.cam-shot:disabled { opacity: .4; cursor: not-allowed; }

/* ================= P2 付费解锁 ================= */
.pay-unlock-btn {
  background: #c5402e; color: #fff; border: none; border-radius: 999px;
  padding: 7px 18px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.pay-unlock-btn:active { transform: scale(.97); }
.pay-free-note { color: #a8a29a; font-size: 12px; margin-left: 10px; }
.pay-modal { position: fixed; inset: 0; z-index: 330; background: rgba(24,22,17,.8);
  display: flex; align-items: center; justify-content: center; }
.pay-box { background: #f7f4ee; border-radius: 18px; padding: 26px 26px 20px;
  width: min(86vw, 340px); text-align: center; position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.pay-close { position: absolute; right: 14px; top: 10px; font-size: 22px;
  color: #a8a29a; cursor: pointer; line-height: 1; }
.pay-title { font-size: 17px; font-weight: 700; color: #26221c; letter-spacing: 2px; }
.pay-price { margin: 8px 0 14px; }
.pay-price b { color: #c5402e; font-size: 34px; }
.pay-price span { color: #a8a29a; font-size: 12px; }
.pay-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.pay-tabs button { border: 1px solid #d8d2c6; background: #fff; color: #77726a;
  border-radius: 999px; padding: 6px 22px; font-size: 13px; cursor: pointer; }
.pay-tabs button.on { background: #26221c; color: #fff; border-color: #26221c; }
.pay-tabs button.off { opacity: .45; cursor: not-allowed; }
.pay-qr { width: 208px; height: 208px; border-radius: 12px; background: #fff; padding: 8px; }
.pay-chg { color: #77726a; font-size: 12px; margin: 10px 0 6px; }
.pay-goto { display: block; color: #8a6423; font-size: 12px; margin-bottom: 6px; }
.pay-status { color: #a8a29a; font-size: 12px; }
.pay-done { color: #c5402e; font-size: 30px; font-weight: 700; padding: 18px 0 6px; }
.pay-done-tip { color: #77726a; font-size: 13px; padding-bottom: 12px; }
.pay-goto.primary { display: block; background: #1677ff; color: #fff; border-radius: 12px;
  padding: 13px 0; font-size: 15px; font-weight: 600; margin: 6px 0 10px; text-decoration: none; }
.pay-goto.primary:active { transform: scale(.98); }

/* ================= 斗泉式识版面板（正/背双槽 + 一键识版） ================= */
.id-sheet { position: fixed; inset: 0; z-index: 320; }
.id-sheet.hidden { display: none; }
.id-mask { position: absolute; inset: 0; background: rgba(24, 22, 17, .72); }
.id-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff; border-radius: 22px 22px 0 0;
  padding: 18px 18px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .22s ease;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .22);
}
.id-sheet.open .id-panel { transform: translateY(0); }
.id-head { display: flex; align-items: center; justify-content: space-between; }
.id-title { font-family: KaiTi, STKaiti, serif; font-size: 19px; font-weight: 700; letter-spacing: 2px; color: var(--ink); }
.id-close { font-size: 18px; color: var(--muted); padding: 4px 8px; cursor: pointer; }
.id-hint { color: #77726a; font-size: 12.5px; margin: 8px 0 14px; line-height: 1.6; }
.id-slots { display: flex; gap: 12px; }
.id-slot {
  flex: 1; aspect-ratio: 1.35; border: 1.5px dashed #d8d2c6; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; position: relative; overflow: hidden; background: #faf8f4;
}
.id-slot .plus { font-size: 30px; color: #c5bfb2; line-height: 1; font-weight: 300; }
.id-slot .slot-name { font-size: 13px; color: #a8a29a; letter-spacing: 1px; }
.id-slot.filled { border-style: solid; border-color: var(--line); background: #fff; }
.id-slot.filled .plus, .id-slot.filled .slot-name { display: none; }
.id-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.id-slot .slot-tag {
  position: absolute; left: 8px; bottom: 8px; z-index: 2;
  background: rgba(28, 25, 20, .62); color: #fff; font-size: 11px;
  padding: 2px 9px; border-radius: 999px; letter-spacing: 1px;
}
.id-slot .slot-rm {
  position: absolute; right: 6px; top: 6px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(28, 25, 20, .62); color: #fff; font-size: 12px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.id-slot.uploading { opacity: .6; }
.id-note { color: #a8a29a; font-size: 11.5px; margin: 10px 2px 12px; }
.id-go {
  width: 100%; border: none; border-radius: 999px; padding: 13px 0;
  font-size: 15.5px; font-weight: 700; letter-spacing: 2px; cursor: pointer;
  background: #c5402e; color: #fff; box-shadow: 0 6px 18px rgba(197, 64, 46, .28);
}
.id-go:disabled { background: #ddd8cd; color: #fff; box-shadow: none; cursor: default; }
.id-go:not(:disabled):active { transform: scale(.98); }

/* 识版面板：拍照/相册分段开关（斗泉式） */
.id-mode { display: flex; gap: 4px; background: #f0ece3; border-radius: 999px; padding: 3px; margin-bottom: 12px; }
.id-mode-btn {
  flex: 1; border: none; background: transparent; border-radius: 999px;
  padding: 8px 0; font-size: 13.5px; color: #a8a29a; cursor: pointer;
  font-family: var(--sans); letter-spacing: 1px; transition: all .15s;
}
.id-mode-btn.on { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }

/* ＋钮弹出菜单：拍照 / 上传图片 */
.attach-pop {
  position: absolute; bottom: 48px; left: 0; z-index: 70;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); min-width: 138px; overflow: hidden; padding: 4px;
}
.attach-pop.hidden { display: none; }
.attach-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: transparent; border: none; color: var(--ink);
  padding: 10px 12px; font-size: 13.5px; font-family: var(--sans);
  cursor: pointer; border-radius: 8px; text-align: left;
}
.attach-pop button:hover { background: var(--surface-2); }
.attach-pop svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.attach-pop button:hover svg { color: var(--seal); }

/* 识版面板双按钮：带图提问（副）+ 一键识版（主） */
.id-actions { display: flex; gap: 10px; }
.id-ask {
  flex: 1; border: 1.5px solid #c5402e; color: #c5402e; background: #fff;
  border-radius: 999px; padding: 13px 0; font-size: 14px; font-weight: 600;
  letter-spacing: 1px; cursor: pointer; font-family: var(--sans);
}
.id-ask:disabled { border-color: #ddd8cd; color: #ddd8cd; cursor: default; }
.id-ask:not(:disabled):active { transform: scale(.97); }
.id-go { flex: 1.5; width: auto; }

/* 空回合重试行（链路断后点它重发） */
.retry-line { color: var(--seal); font-size: 13.5px; cursor: pointer; user-select: none; }
.retry-line:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 会话项重命名钮（与删除钮同款） */
.session-item .ren { flex: none; margin-left: auto; color: var(--muted); cursor: pointer;
  font-size: 12px; padding: 2px 4px; border-radius: 6px; opacity: 0; transition: opacity .12s; }
.session-item:hover .ren, .session-item .ren:active { opacity: 1; }
.session-item .ren:hover { color: var(--seal); }
@media (hover: none) { .session-item .ren { opacity: .55; } }   /* 手机常显半透明 */

/* 掌眼报告下载主按钮（工具卡下方，醒目） */
.report-dl-btn {
  display: block; text-align: center; margin: 10px 0 6px;
  padding: 12px 16px; border-radius: 12px;
  background: linear-gradient(135deg, var(--seal), var(--seal-ink));
  color: #fff; font-size: 14px; font-weight: 700;
  text-decoration: none; letter-spacing: 1px;
  box-shadow: 0 3px 12px rgba(197,64,46,.3);
  transition: transform .12s, box-shadow .12s;
}
.report-dl-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(197,64,46,.4);
  color: #fff;
}

/* ── 本地工作区（2026-10-08 客户端文件夹智能体，纯增量类） ── */
.ws-chip {
  display: flex; align-items: center; gap: 8px;
  margin: 0 2px 8px; padding: 7px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  font-size: 12.5px; color: var(--text); box-shadow: var(--shadow-sm);
}
.ws-chip .ws-ic { flex: none; width: 18px; height: 18px; color: var(--seal); }
.ws-chip .ws-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.ws-chip .ws-mode {
  flex: none; padding: 2px 10px; border-radius: 999px; cursor: pointer;
  background: rgba(197,64,46,.08); color: var(--seal-ink); font-weight: 600;
  border: 1px solid rgba(197,64,46,.25); user-select: none;
}
.ws-chip .ws-mode.ro { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.ws-chip .ws-x {
  flex: none; margin-left: auto; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer;
}
.ws-chip .ws-x:hover { background: var(--surface-2); color: var(--text); }
.ws-chip .ws-hint { color: var(--muted); font-size: 11px; }
@media (max-width: 879.98px) { .ws-chip .ws-name { max-width: 34vw; } }

/* 文件变更卡（folder_write 结果）：ZCode 式 +新增 −删除 + 撤销 */
.file-card {
  margin: 10px 0 4px; max-width: 560px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.file-card .fc-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(138,100,35,.08), rgba(138,100,35,.02));
}
.file-card .fc-seal {
  width: 22px; height: 22px; border-radius: 6px; background: var(--gold-ink, #8a6423); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: KaiTi, STKaiti, serif; font-size: 14px; flex: none;
}
.file-card .fc-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.file-card .fc-title .fc-add { color: var(--ok, #3f7d4e); font-weight: 700; }
.file-card .fc-title .fc-del { color: var(--seal); font-weight: 700; }
.file-card .fc-body { padding: 10px 14px 12px; }
.file-card .fc-file { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.file-card .fc-file:last-of-type { border-bottom: none; }
.file-card .fc-path { font-size: 12.5px; font-family: Consolas, Menlo, monospace; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card .fc-stat { margin-left: auto; flex: none; font-size: 11.5px; }
.file-card .fc-stat .a { color: var(--ok, #3f7d4e); }
.file-card .fc-stat .d { color: var(--seal); }
.file-card .fc-undo {
  margin-top: 8px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--seal);
  background: transparent; color: var(--seal); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.file-card .fc-undo:disabled { border-color: var(--line); color: var(--muted); cursor: default; }
.file-card .fc-undo.ok { border-color: var(--ok, #3f7d4e); color: var(--ok, #3f7d4e); }
.file-card .fc-diff {
  margin-top: 8px; max-height: 220px; overflow: auto; padding: 8px 10px;
  background: var(--surface-2); border-radius: 8px;
  font-family: Consolas, Menlo, monospace; font-size: 11.5px; line-height: 1.55; white-space: pre;
}
.file-card .fc-diff .dl-add { color: var(--ok, #3f7d4e); }
.file-card .fc-diff .dl-del { color: var(--seal); }
.file-card .fc-diff .dl-hdr { color: var(--muted); }
.file-card .fc-note { font-size: 11px; color: var(--muted); margin-top: 8px; opacity: .85; }
@media (max-width: 879.98px) { .file-card { max-width: 100%; } }
.attach-pop button[hidden] { display: none; }   /* hidden属性不被泛型display:flex压掉（2026-10-08 ws入口） */

/* ── 技能面板（2026-10-08 豆包式）：＋弹层=宫格瓦片+能力胶囊 ── */
.attach-pop:has(.ap-grid) { min-width: 0; width: min(360px, calc(100vw - 28px)); padding: 8px; }
.attach-pop .ap-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.attach-pop .ap-grid button {
  flex-direction: column; justify-content: center; gap: 6px;
  padding: 10px 4px 8px; text-align: center; font-size: 12px; line-height: 1.2;
}
.attach-pop .ap-grid button svg { width: 20px; height: 20px; }
.attach-pop .ap-caps {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 4px 4px; margin-top: 6px;
  border-top: 1px dashed var(--line);
}
.ap-cap {
  flex: none; padding: 4px 12px; border-radius: 999px; font-size: 11.5px;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
  cursor: pointer; user-select: none;
}
.ap-cap.on { background: rgba(197,64,46,.08); color: var(--seal-ink); }
@media (max-width: 879.98px) {
  .attach-pop:has(.ap-grid) { width: min(340px, calc(100vw - 24px)); }
  .attach-pop .ap-grid { grid-template-columns: repeat(4, 1fr); }
}
.ws-chip[hidden] { display: none !important; }   /* hidden属性不被display:flex压掉（2026-10-08） */

/* ── 历史会话·多选批量删除（2026-10-08）── */
.sidebar-head { display: flex; align-items: center; justify-content: space-between; }
.sb-manage-btn {
  font-size: 12px; color: var(--seal); cursor: pointer; user-select: none;
  padding: 2px 10px; border-radius: 999px; border: 1px solid rgba(197,64,46,.3);
  background: rgba(197,64,46,.06); line-height: 1.5;
}
.sb-batch {
  display: flex; gap: 6px; padding: 6px 2px 8px;
}
.sb-batch.hidden { display: none; }
.sbb {
  flex: 1; padding: 6px 0; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 12px; cursor: pointer;
}
.sbb:active { transform: scale(.97); }
.sbb.danger { border-color: var(--seal); color: var(--seal); background: rgba(197,64,46,.07); font-weight: 600; }
.sbb:disabled { opacity: .45; cursor: default; }
.session-item .sbck {
  flex: none; width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--line); color: transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1; cursor: pointer; user-select: none;
}
.session-item .sbck.on { background: var(--seal); border-color: var(--seal); color: #fff; }
.session-item .sbck.hidden { display: none; }
