/* intel_v2 · unified design system
   One stylesheet, no build step, no frameworks. Owner visual refresh 2026-11-07.
   Rules: consistent type scale, 8px spacing rhythm, one accent, quiet shadows. */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #e5e8ed;
  --line-strong: #d6dce5;
  --ink: #17212f;
  --ink-2: #3b4656;
  --muted: #737e8d;
  --accent: #2458c8;
  --accent-hover: #1949ad;
  --accent-soft: #eaf0fd;
  --accent-weak: #f5f8ff;
  --danger: #b23b3b;
  --danger-soft: #fdecec;
  --warn: #8a6413;
  --warn-soft: #fff5d8;
  --success: #1c7a55;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 22px rgba(16,24,40,.05);
  --shadow-sm: 0 1px 3px rgba(16,24,40,.06);
  --topbar-h: 60px;
  --side-w: 216px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  padding-bottom: 76px; /* room for the fixed compare tray */
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: .1px;
}
a { color: var(--accent); }
h1, h2, h3 { letter-spacing: -.2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 20px;
  padding: 0 24px;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700;
         font-size: 16px; white-space: nowrap; letter-spacing: .2px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(145deg, var(--accent), #4c82e8);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; box-shadow: var(--shadow-sm);
}
.cmdbox {
  flex: 1; max-width: 620px; display: flex; align-items: center; gap: 9px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 11px; transition: border-color .15s, box-shadow .15s;
}
.cmdbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cmdkey {
  font-size: 11px; color: var(--muted); border: 1px solid var(--line-strong);
  border-radius: 5px; padding: 1px 6px; background: var(--panel); font-weight: 600;
}
.cmdbox input { flex: 1; border: 0; outline: 0; background: transparent;
                font: inherit; font-size: 14px; color: var(--ink); }
.cmdbox input::placeholder { color: #98a1ae; }
.topright { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbtn {
  color: var(--ink-2); font-size: 13px; text-decoration: none;
  padding: 6px 10px; border-radius: 8px; position: relative;
}
.topbtn:hover { background: var(--bg); color: var(--accent); }
.badge {
  position: absolute; top: -1px; right: 0; min-width: 16px; height: 16px;
  border-radius: 8px; background: var(--danger); color: #fff;
  font-size: 10px; line-height: 16px; text-align: center; padding: 0 4px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; cursor: pointer;
  border: 1px solid #d7e2fb;
}
.avatar-menu { position: relative; }
.avatar-menu > summary { list-style: none; }
.avatar-menu > summary::-webkit-details-marker { display: none; }
.menu {
  position: absolute; right: 0; top: 40px; min-width: 190px; z-index: 45;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); padding: 6px;
}
.menu .menu-head { padding: 7px 10px 9px; font-size: 12px; color: var(--muted);
                   border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.menu a { display: block; padding: 8px 10px; border-radius: 7px;
          color: var(--ink-2); text-decoration: none; font-size: 13px; }
.menu a:hover { background: var(--accent-weak); color: var(--accent); }

/* ---------- layout ---------- */
.layout { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.sidebar {
  width: var(--side-w); flex: 0 0 var(--side-w);
  background: var(--panel); border-right: 1px solid var(--line);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 3px;
}
.nav-item {
  display: flex; align-items: center; min-height: 38px;
  padding: 8px 13px; border-radius: 9px;
  color: var(--ink-2); text-decoration: none; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent);
                   font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.nav-sep { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.nav-foot { margin-top: auto; padding: 10px 13px; font-size: 11.5px;
            color: var(--muted); line-height: 1.5; }
.main { flex: 1; padding: 30px 34px 70px; min-width: 0; position: relative; }
.content { max-width: 1280px; margin: 0 auto; }

/* ---------- page content ---------- */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.3; }
.stage-tag {
  font-size: 11px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border: 1px solid #d9e5fb;
  border-radius: 999px; padding: 3px 10px; letter-spacing: .3px;
}
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.card h2 { margin: 0 0 14px; font-size: 17px; font-weight: 650; }
.card h3 { margin: 0 0 10px; font-size: 15px; font-weight: 650; }
.empty-state {
  background: var(--panel); border: 1px dashed var(--line-strong);
  border-radius: var(--radius); padding: 34px 30px; max-width: 760px;
  box-shadow: var(--shadow-sm);
}
.empty-state h2 { margin: 0 0 8px; font-size: 18px; }
.muted { color: var(--muted); }
.flash {
  background: var(--accent-weak); border: 1px solid #d3e0fa;
  color: var(--accent); border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 16px; font-size: 14px;
}
.form-error {
  background: var(--danger-soft); color: var(--danger); border: 1px solid #f3cccc;
  border-radius: var(--radius-sm); padding: 9px 12px; margin-bottom: 14px; font-size: 14px;
}
.btn, .linkbtn {
  border: 1px solid var(--line-strong); background: var(--panel);
  color: var(--accent); border-radius: var(--radius-sm);
  padding: 7px 14px; font: inherit; font-size: 13.5px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center;
  gap: 6px; min-height: 34px; transition: background .15s, border-color .15s;
}
.btn:hover, .linkbtn:hover { background: var(--accent-weak); border-color: var(--accent); }
.btn.small { padding: 4px 10px; min-height: 28px; font-size: 12.5px; }
.linkbtn { padding: 4px 9px; min-height: 26px; font-size: 12px; }
.btn-primary, .card-form button, .chat-input button {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.btn-primary:hover, .card-form button:hover, .chat-input button:hover {
  background: var(--accent-hover); border-color: var(--accent-hover); color: #fff;
}

/* ---------- tables ---------- */
.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.grid th, .grid td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.grid th {
  color: var(--muted); font-weight: 600; font-size: 12.5px;
  background: #fbfcfd; letter-spacing: .3px; white-space: nowrap;
}
.grid tbody tr:nth-child(even) { background: #fafbfc; }
.grid tbody tr:hover { background: var(--accent-weak); }
.grid td.clip { max-width: 230px; overflow: hidden; text-overflow: ellipsis;
                white-space: nowrap; }
.grid td.namecol { max-width: 330px; font-weight: 550; }
.companyname { color: var(--accent); text-decoration: none; }
.companyname:hover { text-decoration: underline; }
.pager { display: flex; align-items: center; gap: 10px; margin-top: 16px;
         flex-wrap: wrap; font-size: 13.5px; }
.colopts { display: flex; flex-wrap: wrap; gap: 7px 16px; margin: 10px 0 12px; }
.colopts label { font-size: 13px; color: var(--ink-2); white-space: nowrap;
                 display: inline-flex; align-items: center; gap: 4px; }
.colpicker { margin-bottom: 14px; font-size: 13.5px; background: var(--panel);
             border: 1px solid var(--line); border-radius: var(--radius-sm);
             padding: 10px 14px; }
.colpicker > summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.colpicker form { padding-top: 8px; }
.viewform { margin-bottom: 14px; }
.viewform input, .filterbar input, .filterbar select, .filterbar button,
.card-form input, .card-form select, .card-form button, .batchbar button,
.viewform button {
  font: inherit; font-size: 13.5px; padding: 7px 11px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--ink); min-height: 34px;
}
.filterbar input::placeholder { color: #9aa3af; }
.filterbar input:focus, .card-form input:focus, .chat-input input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.filterbar button, .batchbar button, .viewform button { cursor: pointer;
  color: var(--accent); font-weight: 550; }
.filterbar button:hover, .batchbar button:hover, .viewform button:hover {
  background: var(--accent-weak); border-color: var(--accent); }
.inline { display: inline-flex; align-items: center; gap: 5px; margin-right: 6px; }
.inline select { font: inherit; font-size: 12px; padding: 2px 4px; }
.card-form {
  display: flex; flex-wrap: wrap; align-items: center; gap: 9px;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line);
}
.card-form h3 { flex: 0 0 100%; margin: 0; }
.card-form textarea { width: 100%; font: inherit; padding: 9px 11px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.placeholder-list { margin: 0; padding-left: 20px; columns: 2; }

/* ---------- reserved slots ---------- */
.offline-hint {
  position: fixed; top: calc(var(--topbar-h) + 8px); right: 16px; z-index: 30;
  background: var(--warn-soft); color: var(--warn); border: 1px solid #eddba6;
  border-radius: var(--radius-sm); padding: 7px 13px; font-size: 12.5px;
  box-shadow: var(--shadow-sm);
}
.compare-tray {
  position: fixed; bottom: 20px; right: 24px; max-width: 270px;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow); border-radius: 10px;
  padding: 10px 15px; font-size: 13.5px; z-index: 25;
}
.compare-tray a { text-decoration: none; font-weight: 600; }

/* ---------- watermark (quieter so it never fights the content) ---------- */
.watermark {
  position: fixed; inset: 0; z-index: 10;
  pointer-events: none; user-select: none; -webkit-user-select: none;
  display: grid; grid-template-columns: repeat(4, 1fr);
  align-content: space-around; justify-items: center;
  transform: rotate(-22deg) scale(1.35); overflow: hidden;
}
.watermark span { color: #2b3a4d; opacity: .028; font-size: 12px;
                  white-space: nowrap; letter-spacing: 1px; }

/* ---------- login / first-run setup ---------- */
.login-body { display: flex; align-items: center; justify-content: center;
              min-height: 100vh; background: var(--bg); }
.login-card {
  width: 380px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 32px; box-shadow: var(--shadow);
}
.login-card h1 { margin: 0 0 6px; font-size: 23px; }
.login-sub { margin: 0 0 24px; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.login-card label { display: block; font-size: 12.5px; color: var(--ink-2);
                    margin-bottom: 14px; font-weight: 550; }
.login-card input {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font: inherit; font-size: 14px; min-height: 40px;
}
.login-card button {
  width: 100%; padding: 10px; margin-top: 8px;
  background: var(--accent); color: #fff; border: 0;
  border-radius: var(--radius-sm); font: inherit; font-weight: 600; cursor: pointer;
}
.login-card button:hover { background: var(--accent-hover); }

/* ---------- command center / company page ---------- */
.cmdbox { position: relative; }
.cmd-results {
  position: absolute; top: 42px; left: 0; right: 0; z-index: 40;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow);
  max-height: min(460px, 62vh); overflow: auto; padding: 6px;
}
.cmd-hit { display: block; padding: 9px 11px; border-radius: 7px;
           text-decoration: none; color: var(--ink-2); font-size: 13.5px; }
.cmd-hit:hover { background: var(--accent-soft); color: var(--accent); }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { text-decoration: none; }
.company-head { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
                font-size: 13px; color: var(--ink-2); }
.company-head span { background: var(--panel); border: 1px solid var(--line);
                     border-radius: 999px; padding: 4px 11px; }
.contact-hint { background: var(--warn-soft); color: var(--warn);
                border: 1px solid #eddba6; border-radius: 999px; padding: 4px 11px; }
.lensbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.lens { padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 999px;
        text-decoration: none; color: var(--ink-2); background: var(--panel); font-size: 13.5px; }
.lens:hover { border-color: var(--accent); color: var(--accent); }
.lens.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.block-card { background: var(--panel); border: 1px solid var(--line);
              border-radius: var(--radius); padding: 16px 20px; margin-bottom: 12px;
              box-shadow: var(--shadow-sm); }
.block-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.block-head h2 { margin: 0; font-size: 16px; font-weight: 650; flex: 1; }
.tag { font-size: 11px; border-radius: 5px; padding: 2px 7px; white-space: nowrap; font-weight: 600; }
.tag-ok { background: var(--accent-soft); color: var(--accent); }
.tag-warn { background: var(--danger-soft); color: var(--danger); }
.tag-muted { background: var(--bg); color: var(--muted); }
.srclink { color: var(--accent); text-decoration: none; font-size: 12px;
           border-bottom: 1px solid #c9d8f4; }
.gate-block { background: var(--danger-soft); border: 1px solid #f0cccc;
              border-radius: var(--radius); padding: 26px; color: var(--danger); }
.qbar { display: flex; flex-wrap: wrap; gap: 8px; }
.qbtn { padding: 6px 13px; border: 1px solid var(--line-strong); border-radius: 999px;
        background: var(--panel); color: var(--accent); font: inherit;
        font-size: 13px; cursor: pointer; min-height: 32px; }
.qbtn:hover { background: var(--accent-soft); border-color: var(--accent); }
.actionbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.filterbar { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 14px;
             align-items: center; }
.batchbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 14px; }
.timeline { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.9; }
.bindbar { display: flex; align-items: center; gap: 8px;
           background: var(--accent-weak); border: 1px solid #dbe6fb;
           color: var(--ink-2); border-radius: var(--radius-sm);
           padding: 10px 14px; margin-bottom: 16px; font-size: 13.5px; }
.chip-company { background: var(--panel); border: 1px solid #d3e0fa;
                color: var(--accent); border-radius: 999px; padding: 4px 12px;
                text-decoration: none; font-weight: 600; font-size: 13px; }

/* ---------- conversation workspace (阶段 8) ---------- */
.chat-status {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px;
}
.chat-status .muted { font-size: 12.5px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%;
              background: var(--success); box-shadow: 0 0 0 3px #e3f4ec; }
.chat-panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden; display: flex; flex-direction: column;
}
.chat-scroll { padding: 22px 24px; min-height: 240px; max-height: 56vh;
               overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.chat-row { display: flex; align-items: flex-start; gap: 10px; }
.chat-row.me { justify-content: flex-end; }
.avatar-mini {
  flex: 0 0 34px; height: 34px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.bubble { max-width: 760px; border-radius: 12px; padding: 12px 16px; font-size: 14.5px; }
/* 补丁 c9-2：研究任务卡住进对话流 —— 去掉气泡的底色/圆角，整卡全宽 */
.bubble-job { background: none; border-radius: 0; padding: 0; max-width: 100%;
              flex: 1 1 auto; box-shadow: none; }
.chat-scroll .job-card { margin: 0; width: 100%; }
/* c19：过程页「怎么调的」折叠块 —— 提示词与发送材料 */
.prompt-details { margin-top: 6px; }
.prompt-details summary { cursor: pointer; }
.prompt-pre { max-width: 640px; max-height: 260px; overflow: auto;
              white-space: pre-wrap; word-break: break-all; font-size: 12px;
              line-height: 1.5; background: #f5f6f8; padding: 8px 10px;
              border-radius: 6px; border: 1px solid #e3e5ea; margin: 4px 0 8px; }
.bubble.user { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble.assistant { background: var(--bg); border: 1px solid var(--line);
                    border-bottom-left-radius: 4px; }
.chat-answer-head { font-weight: 650; font-size: 15px; margin-bottom: 8px; }
.chat-answer.is-blocked .chat-answer-head { color: var(--danger); }
.chat-facts { margin: 0 0 8px; padding-left: 18px; }
.chat-facts li { margin-bottom: 6px; line-height: 1.7; }
.fact-block { display: inline-block; font-size: 11px; color: var(--accent);
              background: var(--accent-soft); border-radius: 5px;
              padding: 1px 7px; margin-right: 8px; vertical-align: 1px; }
.fact-value { color: var(--ink); }
.fact-meta { display: inline-block; margin-left: 8px; font-size: 12px; color: var(--muted); }
.chat-hint { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.chat-actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.chat-empty { text-align: center; padding: 18px 10px; }
.chat-empty h2 { margin: 0 0 10px; font-size: 18px; }
.chat-empty p { margin: 0 auto 18px; max-width: 560px; color: var(--muted); font-size: 13.5px; }
.chat-empty .qbar { justify-content: center; }
.chat-suggest { border-top: 1px solid var(--line); padding: 12px 24px;
                background: #fcfdff; }
.chat-suggest > .muted { display: block; font-size: 12px; margin-bottom: 8px; }
.chat-input { display: flex; gap: 10px; padding: 14px 24px;
              border-top: 1px solid var(--line); background: var(--panel); }
.chat-input input { flex: 1; font: inherit; font-size: 14.5px; padding: 9px 13px;
                    border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.chat-input button { padding: 9px 22px; font-weight: 600; cursor: pointer;
                     border-radius: var(--radius-sm); font: inherit; font-size: 14px; }
.chat-foot { margin-top: 10px; font-size: 12.5px; }

/* ---------- command center hints / cell-level 补查 ---------- */
.cmd-head { padding: 7px 10px 3px; font-size: 11.5px; font-weight: 600;
            letter-spacing: .04em; color: var(--muted); }
.cmd-results .cmd-head:first-child { font-size: 12.5px; color: var(--ink); }
.cell-enrich { border: 0; background: transparent; padding: 0 3px;
               font: inherit; font-size: 11.5px; color: var(--accent, #2f6bff);
               cursor: pointer; opacity: .55; white-space: nowrap; }
.cell-enrich:hover { opacity: 1; text-decoration: underline; }
.grid td.clip .cell-enrich { vertical-align: middle; }

.chat-lead {
  margin: 6px 0 10px; padding: 8px 12px; border-radius: 8px;
  background: var(--bg); border-left: 3px solid var(--line);
  line-height: 1.7; color: var(--ink);
}
.chat-lead .muted { display: inline; font-size: 12px; }

/* ---------- enrich job status ---------- */
.job-card { border-left: 3px solid var(--accent, #2f6bff); }
.job-card h2 { display: flex; align-items: center; gap: 10px; }
.job-detail { margin: 6px 0 10px; line-height: 1.7; }
.job-why { margin: 4px 0 8px; padding: 7px 12px; background: #fff8ea;
           border: 1px solid #f2dfb8; border-radius: var(--radius-sm, 8px);
           font-size: 13.5px; line-height: 1.6; }
.job-next { background: #f7f9ff; border: 1px solid var(--line);
            border-radius: var(--radius-sm, 8px); padding: 10px 16px; margin: 8px 0; }
.job-next ol { margin: 6px 0; padding-left: 20px; line-height: 1.7; }
.job-refresh { margin-left: 6px; }

/* ---------- decisions / bell / compare ---------- */
.small { font-size: 12.5px; }
.muted.small { color: var(--muted); }
ul.tight { margin: 0; padding-left: 18px; }
ul.tight li { margin: 3px 0; line-height: 1.55; }
.linkbtn.primary { color: var(--accent, #2f6bff); font-weight: 600; }
.switch { display: inline-flex; align-items: center; gap: 6px;
          font-size: 13px; color: var(--muted); cursor: pointer; }
.switch input { accent-color: var(--accent, #2f6bff); }
details > summary { cursor: pointer; color: var(--accent, #2f6bff);
                    font-size: 13px; padding: 2px 0; }
details > summary:hover { text-decoration: underline; }
.card .grid td { vertical-align: top; }
.card .grid td .inline { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.card .grid form.inline button.linkbtn { white-space: nowrap; }
.ruling-table table { table-layout: fixed; }
.ruling-table th:nth-child(1) { width: 17%; }
.ruling-table th:nth-child(2) { width: 38%; }
.ruling-table th:nth-child(3) { width: 29%; }
.ruling-table th:nth-child(4) { width: 16%; }
.ruling-table td { overflow-wrap: anywhere; }
.ruling-table form.inline { flex-wrap: nowrap; }
.ruling-table td:last-child { min-width: 132px; }
.card > p.muted { max-width: 900px; line-height: 1.7; }

/* ---------- structured chat answer (2026-11-08) ---------- */
.chat-sec { margin: 14px 0 0; padding: 12px 14px; border: 1px solid var(--line);
            border-radius: 10px; background: #fff; }
.chat-sec > h3 { margin: 0 0 10px; font-size: 14.5px; font-weight: 650; }
.chat-sub { margin: 12px 0 0; }
.chat-sub h4 { margin: 0 0 6px; font-size: 13.5px; font-weight: 650; }
.chat-note { margin: 0 0 8px; font-size: 12.5px; line-height: 1.65; color: var(--muted); }
.chat-summary { margin: 0 0 10px; padding: 9px 11px; border-radius: 7px;
                background: #eef4ff; font-size: 13.5px; line-height: 1.8; }
.chat-alert { margin: 8px 0 0; padding: 10px 12px; border-left: 3px solid #d98b0b;
              background: #fff8e8; border-radius: 6px; }
.chat-alert b { font-size: 13.5px; }
.chat-alert p { margin: 5px 0 0; font-size: 13px; line-height: 1.7; }
.chat-facts { list-style: none; margin: 0; padding: 0; }
.chat-facts li { margin-bottom: 0; }
.fact-group + .fact-group { margin-top: 12px; }
.fact-group-title { font-size: 13px; font-weight: 650; margin-bottom: 6px; }
.fact-group-title .muted { font-weight: 400; margin-left: 6px; }
.fact-item { border-bottom: 1px dashed var(--line); padding: 7px 0 9px; }
.fact-item:last-child { border-bottom: 0; }
.fact-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 3px; }
.fact-block { font-size: 11.5px; padding: 1px 6px; border-radius: 4px;
              background: var(--bg); color: var(--muted); }
.fact-attr { font-size: 13.5px; }
.fact-date { margin-left: auto; font-size: 12px; color: var(--muted); }
.fact-value { font-size: 13.5px; line-height: 1.8; overflow-wrap: anywhere; }
.fact-src { margin-top: 3px; font-size: 12px; color: var(--muted); }
.chat-industry { background: #f8fbff; border-color: #d9e7f8; }
.peer-list, .src-list, .q-list { margin: 0; padding-left: 18px;
                                 font-size: 13px; line-height: 1.9; }
.peer-list li a { font-weight: 600; }
.peer-list li .muted { margin-left: 8px; font-size: 12px; }
.industry-brief { margin: 0; padding: 9px 11px; background: #fff;
                  border: 1px dashed #c9dcf3; border-radius: 6px;
                  font-size: 13px; line-height: 1.8; }
.chat-metrics { font-size: 12.5px; margin-top: 4px; table-layout: fixed; }
.chat-metrics th, .chat-metrics td { padding: 5px 7px; }
.chat-metrics td { overflow-wrap: anywhere; vertical-align: top; }
.chat-metrics th:nth-child(1) { width: 42%; }
.chat-metrics th:nth-child(2) { width: 30%; }
.chat-metrics th:nth-child(3) { width: 28%; }
.industry-grid { table-layout: fixed; }
.industry-grid th:nth-child(1) { width: 40%; }
.industry-grid th:nth-child(2) { width: 22%; }
.industry-grid th:nth-child(3) { width: 18%; }
.industry-grid th:nth-child(4) { width: 20%; }
.industry-grid td { vertical-align: top; }
.nowrap { white-space: nowrap; }
.chat-model { background: #fafafa; }
.chat-model ul { margin: 0; padding-left: 18px; font-size: 12.8px; line-height: 1.85; }
.chat-next ol { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.85; }
.chat-hint { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.tag { display: inline-block; font-size: 11px; padding: 1px 6px;
       border-radius: 4px; line-height: 1.5; }
.tag-warn { background: #fff0d9; color: #a25c00; }
.tag-ok { background: #e4f5e9; color: #1c7a3c; }
.tag-muted { background: var(--bg); color: var(--muted); }

/* ---------- identity candidates (system proposes, human picks) ---------- */
.claim-attr {
  display: block; font-size: 11.5px; line-height: 1.5; color: var(--muted);
  letter-spacing: .02em;
}
.claim-value { display: block; line-height: 1.6; }
.identity-card { border-left: 3px solid #2f6f4f; }
.identity-card .ok-line {
  margin: 2px 0 10px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: #eef7f1; color: #1f5138; line-height: 1.7; font-size: 13px;
}
.identity-card .warn-line {
  margin: 8px 0 10px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: #fff6e6; color: #7a4a06; line-height: 1.7; font-size: 13px;
}
.identity-grid { table-layout: fixed; width: 100%; }
.identity-grid th, .identity-grid td { padding: 7px 9px; vertical-align: top; }
.identity-grid th:nth-child(1), .identity-grid td:nth-child(1) { width: 34%; }
.identity-grid th:nth-child(2), .identity-grid td:nth-child(2) { width: 13%; }
.identity-grid th:nth-child(3), .identity-grid td:nth-child(3) { width: 10%; }
.identity-grid th:nth-child(4), .identity-grid td:nth-child(4) { width: 12%; }
.identity-grid th:nth-child(5), .identity-grid td:nth-child(5) { width: 31%; }
.identity-grid td code { font-size: 11.5px; overflow-wrap: anywhere; }
.identity-grid form.inline { display: inline-block; margin: 0 6px 4px 0; }
.identity-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 12px 0 8px;
}
.manual-identity { margin-top: 6px; }
.manual-identity summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.manual-identity .card-form { margin-top: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .main { padding: 22px 20px 60px; }
  .topbar { padding: 0 14px; gap: 12px; }
  .topbtn { padding: 5px 7px; }
}
@media (max-width: 760px) {
  .sidebar { width: 140px; flex-basis: 140px; padding: 14px 8px; }
  .nav-item { padding: 8px 10px; font-size: 13px; min-height: 34px; }
  .brand span { display: none; }
  .compare-tray { right: 16px; max-width: 220px; }
  .watermark { grid-template-columns: repeat(2, 1fr); }
  .bubble { max-width: 100%; }
  .chat-scroll, .chat-suggest, .chat-input { padding-left: 14px; padding-right: 14px; }
}

/* ---------- 阶段 9 · 内部资料库（本机只读索引） ---------- */
.lib-search {
  display: flex; gap: 10px; align-items: center; margin: 4px 0 14px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow-sm);
}
.lib-search input {
  flex: 1; min-width: 0; font: inherit; font-size: 15px; color: var(--ink);
  border: 0; outline: 0; background: transparent; padding: 6px 2px;
}
.lib-search input::placeholder { color: #98a1ae; }
.lib-search select {
  font: inherit; font-size: 13px; color: var(--ink-2); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 7px 9px;
}
.lib-statbar {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.lib-stat { display: flex; flex-direction: column; line-height: 1.25; }
.lib-stat b { font-size: 18px; letter-spacing: -.3px; }
.lib-stat span { font-size: 12px; color: var(--muted); }
.lib-statbar form { margin-left: auto; }
.btn.primary, .btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn.primary:hover, .btn-primary:hover { background: var(--accent-hover); color: #fff; }
.lib-companybar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--accent-weak); border: 1px solid #d3e0fa;
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: 13px;
}
.lib-companybar .btn { margin-left: auto; }
.lib-result-head { font-size: 13px; color: var(--ink-2); margin: 4px 2px 10px; }
.lib-result-head b { font-size: 15px; color: var(--ink); }
.lib-hit {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.lib-hit:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.lib-hit-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.lib-title { font-weight: 650; font-size: 15px; color: var(--ink); text-decoration: none; }
.lib-title:hover { color: var(--accent); text-decoration: underline; }
.lib-meta { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.lib-path {
  font-size: 11.5px; color: var(--muted); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.lib-path.full { white-space: normal; word-break: break-all; }
.lib-snip { margin: 7px 0 2px; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.lib-snip mark { background: #fff2b8; color: var(--ink); border-radius: 3px; padding: 0 2px; }
.lib-hit-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.lib-hit-foot .inline { margin: 0; }
.lib-linked { font-size: 12px; color: var(--success); font-weight: 600; }
.lib-roots { margin-top: 18px; }
.lib-roots summary { cursor: pointer; font-weight: 650; font-size: 14px; }
.lib-roottable { margin: 12px 0; width: 100%; }
.lib-roottable td { font-size: 12.5px; vertical-align: middle; }
.lib-rootpath { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; color: var(--muted); max-width: 420px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-rootacts { white-space: nowrap; }
.lib-rootacts form { display: inline; }
.linkbtn.danger { color: var(--danger); }
.lib-foot { margin-top: 16px; }
.lib-sec-head { display: flex; align-items: center; gap: 12px; }
.lib-sec-head h2 { flex: 1; margin: 0; }
.doc-links { list-style: none; padding: 0; margin: 10px 0 4px; }
.doc-links li {
  padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.doc-links li:last-child { border-bottom: 0; }
.doc-links .tag { margin-left: 2px; }
.doc-meta {
  display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted);
  margin: -4px 0 12px;
}
.doc-text {
  white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.75;
  color: var(--ink-2); background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 16px; max-height: 460px; overflow: auto;
  font-family: -apple-system, "PingFang SC", sans-serif;
}
.lib-note {
  background: var(--warn-soft); border: 1px solid #ecd9a4; color: var(--warn);
  border-radius: var(--radius-sm); padding: 10px 13px; font-size: 13px; margin-bottom: 12px;
}
.lib-note.warn { background: var(--danger-soft); border-color: #f0c9c9; color: var(--danger); }
.job-progress {
  height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; margin: 8px 0 2px;
}
.job-progress span {
  display: block; height: 100%; width: 0; background: var(--accent);
  border-radius: 999px; transition: width .4s ease;
}
.lib-mini { list-style: none; padding: 0; margin: 6px 0 2px; }
.lib-mini li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.lib-mini li:last-child { border-bottom: 0; }
.lib-mini-title { font-weight: 600; font-size: 13.5px; }
.lib-mini-meta { font-size: 11.5px; color: var(--muted); margin-left: 8px; }
.lib-mini-snip { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.chat-internal { border-top: 1px solid var(--line); }

/* ---------- 市场 / 品类问题：数据缺口 ---------- */
.chat-gaps { border-top: 1px solid var(--line); }
.gap-list { list-style: none; padding: 0; margin: 8px 0 4px; }
.gap-list li {
  padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px;
  line-height: 1.65;
}
.gap-list li:last-child { border-bottom: 0; }
.gap-why { color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }
.gap-how { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.chat-points { margin: 8px 0 10px; padding-left: 20px; color: var(--ink-2); }
.chat-points li { margin: 4px 0; font-size: 13.5px; line-height: 1.65; }

/* ---------- 研究（R2）：事实 + 角标 + 原文摘录 ---------- */
.research-block { margin-top: 10px; }
.res-h { font-size: 13.5px; margin: 14px 0 6px; color: var(--ink); }
.fact-list { list-style: none; padding: 0; margin: 0; }
.fact-list li {
  padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px;
  line-height: 1.7;
}
.fact-list li:last-child { border-bottom: 0; }
.fact-attr {
  display: inline-block; font-size: 11.5px; color: var(--ink-2);
  background: var(--bg); border: 1px solid var(--line); border-radius: 4px;
  padding: 0 5px; margin-right: 6px;
}
.fact-quote {
  margin-top: 3px; padding-left: 10px; border-left: 2px solid var(--line);
  color: var(--muted); font-size: 12.5px; line-height: 1.6;
}
.cite {
  font-size: 11.5px; font-weight: 700; color: var(--accent);
  text-decoration: none; margin-left: 3px; vertical-align: super;
}
.cite:hover { text-decoration: underline; }
.cite.mute { color: var(--muted); }
.res-stats {
  margin: 10px 0 2px; font-size: 12px; color: var(--muted);
}
.chat-input button.ghost {
  background: transparent; color: var(--accent); border: 1px solid var(--accent);
}
.chat-input button.ghost:hover { background: var(--accent-weak); }
.job-stop { margin-left: auto; }

/* ---------- R4/R5：分块研究记录 / 评测 ---------- */
.block-research { margin: 2px 0 8px; }
.block-research a { color: var(--accent); }
.eval-q { margin-bottom: 14px; }
.eval-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.eval-head b { font-size: 14.5px; }
.eval-score { display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.eval-score input[name="reason"] {
  flex: 1; min-width: 180px; font: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 6px 9px; background: var(--bg); color: var(--ink);
}
.status-msg { font-size: 12px; color: var(--success); }
.chat-registry h3.warn-line { color: var(--warn); }
.chat-registry .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pending-line {
  margin: 6px 0 10px; padding: 8px 12px; font-size: 13px;
  background: var(--warn-soft); border: 1px solid #ecd9a4; color: var(--warn);
  border-radius: var(--radius-sm);
}
.adopt-list { list-style: none; padding: 0; margin: 8px 0 12px; }
.adopt-list li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.adopt-list li:last-child { border-bottom: 0; }
.adopt-list .linkbtn { margin-right: 6px; }

/* ---------- R11 答案格式：答案 / 主要信息源 / 折叠依据 ---------- */
.res-conclusion {
  font-size: 14.5px; line-height: 1.75; color: var(--ink);
  margin: 4px 0 10px;
}
.synth-sec { margin: 12px 0; }
.synth-sec h4 {
  margin: 0 0 4px; font-size: 13px; color: var(--ink-2); font-weight: 650;
}
.synth-sec p { margin: 0; font-size: 13.5px; line-height: 1.75; }
.chat-sources .src-list li { font-size: 13px; line-height: 1.7; }
.res-internal {
  margin: 10px 0 2px; padding: 7px 10px; font-size: 12.5px; color: var(--ink-2);
  background: var(--bg); border: 1px dashed var(--line); border-radius: var(--radius-sm);
}
.res-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; }
.res-details > summary {
  cursor: pointer; font-size: 13px; color: var(--accent); padding: 4px 0;
}
.res-details[open] > summary { margin-bottom: 6px; }
.chat-draft-done { margin: 6px 0 2px; }

/* R12-0 A1: 主要信息源与正文角标共用编号；内部资料不占编号 */
.chat-sources .src-list { padding-left: 22px; }
.chat-sources .src-list .src-internal { list-style: none; margin-left: -18px; }
.chat-sources .src-list .src-internal a { color: var(--ink-2); }

/* R12-2 研究简报（折叠区内） */
.brief-grid { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; font-size: 12.5px; }
.brief-grid dt { color: var(--ink-2); font-weight: 600; }
.brief-grid dd { margin: 0; color: var(--ink); line-height: 1.6; word-break: break-word; }

/* R13-4 Google AI 模式线索（只在「展开看依据」里，不占主要信息源） */
.chat-aimode { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line);
               border-radius: var(--radius-sm); background: var(--bg); }
.chat-aimode h3 { margin: 0 0 6px; font-size: 13.5px; font-weight: 650; }
.chat-aimode h4 { margin: 12px 0 5px; font-size: 12.5px; color: var(--ink-2); font-weight: 650; }
.aimode-raw { margin: 6px 0; }
.aimode-raw > summary { cursor: pointer; font-size: 12.5px; color: var(--accent); }
.aimode-text { margin: 6px 0 0; padding: 8px 10px; max-height: 320px; overflow: auto;
               white-space: pre-wrap; word-break: break-word; font-size: 12.5px;
               line-height: 1.65; color: var(--ink-2); background: #fff;
               border: 1px solid var(--line); border-radius: var(--radius-sm); }
.aimode-unverified { margin-top: 10px; padding: 8px 10px; font-size: 12.5px;
                     border-left: 3px solid #d9a441; background: #fffaf0; }
.aimode-unverified b { color: #8a5a12; }
.aimode-unverified .gap-list { margin: 5px 0 0; padding-left: 18px; }

/* R16a: auxiliary info is folded and never reads as an answer. */
.aux-info { margin-top: 10px; padding: 8px 10px; font-size: 12.5px;
            border: 1px solid var(--line); border-radius: var(--radius-sm);
            background: #fafbfc; }
.aux-info > summary { cursor: pointer; color: var(--ink-2); font-weight: 650; }
.aux-info table { margin-top: 8px; }
.item-list { margin-top: 5px; font-size: 11.5px; line-height: 1.7;
             color: var(--ink-2); }
.item-list .ok { color: #1d7a45; }
.giant-alert { padding: 8px 16px; font-size: 13px; font-weight: 650;
               color: #9b2c1f; background: #ffe9e6;
               border-bottom: 1px solid #f3b8ae; }
.giant-alert form { margin-left: 10px; }
.giant-alert .linkbtn { color: #9b2c1f; text-decoration: underline; }

/* c27：证据状态三档 + 建档防污染警示 */
.doc-meta .verdict-ok { color: #1a7f4b; font-weight: 600; }
.doc-meta .verdict-warn { color: #9a6b00; font-weight: 600; }
.doc-meta .verdict-bad { color: #b3261e; font-weight: 600; }
.adopt-guard { background: #fff3f0; border: 1px solid #f0c4bc;
               border-radius: 8px; padding: 10px 12px; font-size: 13.5px;
               margin: 8px 0; }
.adopt-confirm { display: inline-flex; gap: 6px; align-items: center;
                 font-size: 13.5px; margin-right: 10px; }

/* c46-3（所有者报告：research 详情页宽屏被挤压）——防御性兜底：
   答案/研判/过程卡片在宽屏始终吃满 .content 行宽；表格不许塌缩成窄列。 */
.chat-sec, .answer-table, .card .grid { width: 100%; }
.answer-table th:first-child, .answer-table td:first-child { width: 22%; }

/* ===================== c48 UI 与排版全面优化 ===================== */
/* P1a-3 核心研判报告：语义化 Markdown、白底浅蓝左边框 */
.report-card { border-left: 3px solid #4c82e8; background: #fff;
  padding: 16px 20px; font-size: 15px; line-height: 1.7; }
.report-card > h3 { font-size: 16px; margin-bottom: 10px; }
.report-block { margin: 0 0 18px; }
.report-block > p { margin: 0 0 10px; }
.report-block h4 { margin: 14px 0 6px; font-size: 14.5px; font-weight: 650; }
.report-block ul, .report-block ol { margin: 6px 0 10px; padding-left: 22px; }
.report-block li { margin: 3px 0; }
/* c59b（模块 C）：并行引擎章节短标题 + 富 Markdown 表格/引用/行内码 */
.report-block p .chip-doc, .report-block li .chip-doc,
.report-block td .chip-doc { display: inline-block; padding: 0 5px;
  margin: 0 1px; font-size: 12px; vertical-align: baseline; line-height: 1.5; }
.state-badge { display: inline-block; margin: 0 0 12px; padding: 4px 10px;
  border-radius: 12px; font-size: 12.5px; font-weight: 650; }
.state-badge.degraded { background: #fff4d6; color: #8a5a00;
  border: 1px solid #e6b422; }
.state-badge.failed { background: #ffe4e4; color: #a11;
  border: 1px solid #e55; }
.report-chapter-title { margin: 0 0 10px; padding: 6px 10px; font-size: 15.5px;
  font-weight: 700; color: var(--brand, #2456a6);
  border-left: 3px solid var(--brand, #2456a6); background: #f6f9ff;
  border-radius: 3px; }
.md-table-wrap { overflow-x: auto; margin: 10px 0 14px;
  -webkit-overflow-scrolling: touch; }
.md-table { border-collapse: collapse; width: 100%; font-size: 13px;
  line-height: 1.6; }
.md-table th, .md-table td { border: 1px solid var(--line-strong, #cbd5e1);
  padding: 7px 10px; text-align: left; vertical-align: top; }
.md-table thead th { background: #eef3fb; font-weight: 650;
  color: #1e3a6b; white-space: nowrap; }
.md-table tbody tr:nth-child(even) { background: #f8fafc; }
.md-table tbody tr:hover { background: #f1f6ff; }
.report-block blockquote { margin: 10px 0; padding: 8px 12px;
  color: var(--text-muted); background: #f6f8fc;
  border-left: 3px solid var(--line-strong, #cbd5e1); border-radius: 4px; }
.report-block code { font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; padding: 1px 5px; background: #eef2f7;
  border-radius: 3px; }
.report-src { margin-top: 10px; display: flex; flex-wrap: wrap;
  align-items: center; gap: 2px; }
.cite-fact { display: inline-flex; padding: 1px 8px; border-radius: 6px;
  background: #eef3ff; color: #2c55c8; font-size: 12px;
  margin-right: 4px; font-weight: 600; white-space: nowrap; }
/* c60b（B2.3）：私有证据紫徽章 / 用户陈述灰绿徽章（与蓝色 [Fn] 清晰区分） */
.cite-priv { display: inline-flex; padding: 1px 8px; border-radius: 6px;
  background: #f3ecff; color: #6d3bbf; font-size: 12px;
  margin-right: 4px; font-weight: 600; white-space: nowrap;
  border: 1px solid #e2d3fb; }
.cite-user { display: inline-flex; padding: 1px 8px; border-radius: 6px;
  background: #eef7f3; color: #2c7a5b; font-size: 12px;
  margin-right: 4px; font-weight: 600; white-space: nowrap;
  border: 1px solid #d5ebe1; }
button.cite-priv, button.cite-user { cursor: pointer; font: inherit;
  font-size: 12px; }
.chip-ctx { display: inline-flex; padding: 2px 10px; border-radius: 999px;
  background: #eaf7f0; color: #1a7f4b; font-size: 12px;
  margin: 0 6px 4px 0; white-space: nowrap; }
/* P1b-5 .conf 与三级认识论胶囊（此前完全缺失样式 → 文本粘连） */
.conf { display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 999px; font-size: 12px; margin: 0 6px 4px 0;
  white-space: nowrap; background: #f1f3f7; color: #5a6472; }
.conf.ok { background: #e4f5ea; color: #1a7f4b; }
.conf.warn { background: #fdf1e2; color: #9a6b00; }
.conf.bad { background: #fbeaea; color: #b3322e; }
.epi { display: inline-flex; align-items: center; padding: 2px 9px;
  border-radius: 999px; font-size: 12px; margin: 0 6px 4px 0;
  white-space: nowrap; font-weight: 600; }
.epi-fact { background: #e4f5ea; color: #1a7f4b; }
.epi-clue { background: #fdf1e2; color: #9a6b00; }
.epi-judgment { background: #eaf1fd; color: #2c55c8; }
/* P1a-4 事实证据表 */
.fact-table .th-no, .fact-table td.fact-no { width: 60px; white-space: nowrap;
  font-weight: 650; color: #2c55c8; }
.fact-more summary { cursor: pointer; color: var(--muted); padding: 6px 0; }
/* P1b-6 /jobs 列宽：不劈字 */
.jobs-table th:nth-child(1), .jobs-table td:nth-child(1) { min-width: 142px; white-space: nowrap; }
.jobs-table th:nth-child(4), .jobs-table td:nth-child(4) { min-width: 78px; white-space: nowrap; }
.jobs-table th:nth-child(6), .jobs-table td:nth-child(6) { min-width: 76px; white-space: nowrap; }
.jobs-table td.nowrap { white-space: nowrap; }
td.nowrap { white-space: nowrap; }
/* P1b-7 检索计划 chips */
.plan-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-chip { margin: 0; }
/* P0-1 气泡放宽：内嵌表格可读 */
.bubble { max-width: min(960px, 100%); }
.bubble.assistant { max-width: min(960px, 100%); }
/* P2 窄屏：侧栏收起为顶部折叠导航 */
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidebar { position: relative; width: 100%; flex-basis: auto;
    height: auto; padding: 8px 12px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .main { padding: 16px 14px 60px; }
  .content { max-width: 100%; }
  .bubble { max-width: 100%; }
  .grid { font-size: 13px; }
}

/* ===================== c49 本地资料夹 ===================== */
.chip-doc { display: inline-flex; padding: 2px 10px; border-radius: 999px;
  background: #f0eefc; color: #5b3fbf; font-size: 12px;
  margin: 0 6px 4px 0; white-space: nowrap; }
.folders-table td, .docs-table td { vertical-align: top; }
.ask-ta { width: 100%; max-width: 720px; min-height: 84px;
  padding: 10px 12px; font-size: 14px; line-height: 1.6;
  border: 1px solid var(--line-strong); border-radius: 10px;
  resize: vertical; font-family: inherit; }

/* ===================== c50 目录树索引 + 扫描诊断 ===================== */
.scan-diag { margin-top: 6px; color: var(--text-muted); }
.scan-zero { background: #fff4f2; border: 1px solid #f3c1b8;
  color: #a5371f; border-radius: 8px; padding: 6px 10px;
  font-size: 13px; margin: 6px 0; }
.chip-skip, .chip-skip-ok { display: inline-block; padding: 1px 8px;
  border-radius: 999px; font-size: 12px; margin: 0 4px 2px 0;
  background: #fdf0e6; color: #9a5b16; white-space: nowrap; }
.chip-skip-ok { background: #ecf7ee; color: #2c7a3f; }
.mat-tree { margin-top: 6px; }
.mat-tree summary { cursor: pointer; color: var(--link, #2456a6);
  font-size: 13px; }
.tree-pre { margin: 8px 0 0; padding: 10px 12px; background: #f7f9fc;
  border: 1px solid var(--line-strong); border-radius: 8px;
  font-size: 12.5px; line-height: 1.55; max-height: 420px;
  overflow: auto; white-space: pre-wrap; word-break: break-all; }

/* c50-5 两阶段扫描进度 */
.stage-run { display: inline-block; padding: 1px 10px; border-radius: 999px;
  background: #e8f1fd; color: #1d5bb8; font-size: 12.5px; margin: 0 6px 2px 0;
  animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.scan-err summary { color: #a5371f; font-size: 13px; cursor: pointer; }

/* ===================== c51-U Wave 1：商业副驾报告页 ===================== */
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 10px 0 14px; }
.report-actions .toast { color: #1a7a3c; font-size: 13px; margin-left: 6px;
  opacity: 0; transition: opacity .25s; }
.report-actions .toast.show { opacity: 1; }
.report-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line-strong);
  margin: 10px 0 16px; }
.tab-btn { background: transparent; border: 0; border-bottom: 2px solid transparent;
  padding: 9px 16px; cursor: pointer; font-size: 14px; color: var(--text-muted); }
.tab-btn.active { color: var(--brand, #2456a6); border-bottom-color: var(--brand, #2456a6);
  font-weight: 600; }
.report-cols { display: flex; gap: 20px; align-items: flex-start; }
.report-main { flex: 1; min-width: 0; }
.report-side { width: 260px; flex: 0 0 260px; position: sticky; top: 80px; }
.side-card { background: #fff; border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.side-card h4 { margin: 0 0 8px; font-size: 13px; }
.outline-link { display: block; padding: 5px 4px; color: var(--text-muted);
  font-size: 12.5px; text-decoration: none; border-radius: 5px; }
.outline-link:hover { background: #f2f6fd; color: var(--brand, #2456a6); }
.stat-mini { list-style: none; margin: 0; padding: 0; font-size: 12.5px;
  color: var(--text-muted); }
.stat-mini li { padding: 4px 0; border-bottom: 1px dashed var(--line-strong); }
.stat-mini b { color: var(--text); }
button.cite-fact, button.chip-doc, button.cite-priv, button.cite-user { cursor: pointer; font: inherit; }
button.cite-fact:hover, button.chip-doc:hover { filter: brightness(.95);
  text-decoration: underline; }
.ev-drawer-mask { position: fixed; inset: 0; background: rgba(15,23,42,.28);
  z-index: 95; }
.ev-drawer { position: fixed; right: 0; top: 0; bottom: 0; width: 440px;
  max-width: 92vw; background: rgba(255,255,255,.97); z-index: 96;
  box-shadow: -8px 0 32px rgba(15,23,42,.16); display: flex;
  flex-direction: column; }
.ev-drawer-head { display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line-strong); }
.ev-drawer-head h3 { margin: 0; font-size: 15px; }
.ev-drawer-body { padding: 16px 18px; overflow: auto; font-size: 13px; }
.ev-drawer blockquote { margin: 10px 0; padding: 10px 12px; background: #f6f8fc;
  border-left: 3px solid var(--brand, #2456a6); border-radius: 4px; }

/* ---- c57：页内「追问 / 继续深挖」互动小窗（复用 ev-drawer 视觉体系）---- */
.fu-mask { position: fixed; inset: 0; background: rgba(15,23,42,.28); z-index: 91; }
.fu-drawer { position: fixed; right: 0; top: 0; bottom: 0; width: 460px;
  max-width: 92vw; background: rgba(255,255,255,.98); z-index: 92;
  box-shadow: -8px 0 32px rgba(15,23,42,.18); display: flex;
  flex-direction: column; }
.fu-drawer[hidden], .fu-mask[hidden] { display: none !important; }
.fu-head { display: flex; justify-content: space-between; align-items: center;
  gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line-strong); }
.fu-head-t h3 { margin: 0 0 2px; font-size: 15px; }
.fu-head-t .fu-title { margin: 0; max-width: 300px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.fu-body { flex: 1; overflow: auto; padding: 12px 18px; font-size: 13px; }
.fu-chips { margin-bottom: 12px; padding: 10px 12px; background: #f6f8fc;
  border-radius: 8px; }
.fu-chips-head { display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; }
.fu-chip-list { display: flex; flex-direction: column; gap: 6px; }
.fu-chip { text-align: left; font: inherit; font-size: 13px; padding: 7px 10px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 7px;
  cursor: pointer; }
.fu-chip:hover { border-color: var(--brand, #2456a6); background: #f0f5fd; }
.fu-msgs { display: flex; flex-direction: column; gap: 10px; }
.fu-msg { max-width: 92%; padding: 8px 11px; border-radius: 10px;
  line-height: 1.55; word-break: break-word; }
.fu-msg p { margin: 0 0 4px; }
.fu-msg p:last-child { margin-bottom: 0; }
.fu-msg ul, .fu-msg ol { margin: 4px 0 4px 16px; padding: 0; }
.fu-user { align-self: flex-end; background: #e8f0fe; border: 1px solid #c9dcfa; }
.fu-assistant { align-self: flex-start; background: #f6f8fc;
  border: 1px solid var(--line-strong); }
.fu-meta { margin-top: 6px; }
.fu-deep-now { margin-top: 6px; }
.fu-task-card { margin-top: 8px; padding: 9px 11px; background: #f0f7f1;
  border: 1px solid #bfe0c8; border-radius: 8px; }
.fu-task-card p { margin: 4px 0 6px; }
.fu-foot { border-top: 1px solid var(--line-strong); padding: 10px 18px 12px;
  background: #fff; }
.fu-foot textarea { width: 100%; box-sizing: border-box; font: inherit;
  font-size: 13px; padding: 8px 10px; border: 1px solid var(--line-strong);
  border-radius: 8px; resize: vertical; }
.fu-btns { display: flex; gap: 8px; margin-top: 8px; }
.fu-entry-card button { margin-top: 6px; }
.fu-thumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 8px; background: #f6f8fc; border-radius: 8px; margin-bottom: 8px; }
.fu-thumb { position: relative; width: 84px; text-align: center; cursor: pointer; }
.fu-thumb img { width: 84px; height: 64px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--line-strong); display: block; }
.fu-thumb-name { display: block; font-size: 11px; color: #475569;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-thumb-x { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px;
  border-radius: 50%; border: none; background: rgba(15,23,42,.6); color: #fff;
  font-size: 11px; line-height: 18px; cursor: pointer; padding: 0; }
.fu-img-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.fu-msg .fu-thumb { width: 96px; }
.fu-msg .fu-thumb img { width: 96px; height: 72px; }
.fu-lightbox { position: fixed; inset: 0; background: rgba(15,23,42,.72);
  z-index: 98; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; padding: 24px; }
.fu-lightbox[hidden] { display: none !important; }
.fu-lightbox img { max-width: 88vw; max-height: 78vh; border-radius: 10px;
  box-shadow: 0 12px 48px rgba(0,0,0,.4); background: #fff; }
@media (max-width: 1099px) {
  .report-cols { display: block; }
  .report-side { width: 100%; flex: none; position: static; margin-top: 12px; }
}
@media print {
  .sidebar, .topbar, .report-actions, .report-tabs, #tab-evidence,
  #tab-process, .ev-drawer, .ev-drawer-mask, .fu-drawer, .fu-mask, .proc-step, .plan-chips { display: none !important; }
  #tab-report { display: block !important; }
  .report-cols { display: block; }
  .report-side { display: none; }
  .report-block { break-inside: avoid; page-break-inside: avoid; }
  .main, .content { max-width: 100%; padding: 0; }
}

/* c51-U Wave 1：实时进度 + 快捷追问胶囊 */
.live-progress { text-align: center; padding: 36px 24px; }
.breath-ring { width: 110px; height: 110px; margin: 22px auto; border-radius: 50%;
  border: 4px solid #dbe8fb; border-top-color: #2456a6;
  animation: breath 1.4s linear infinite; display: flex; align-items: center;
  justify-content: center; font-size: 12px; color: #2456a6; }
@keyframes breath { to { transform: rotate(360deg); } }
.lp-steps { list-style: none; max-width: 520px; margin: 16px auto; padding: 0;
  text-align: left; font-size: 13px; }
.lp-steps li { padding: 7px 10px; border-bottom: 1px dashed var(--line-strong); }
.lp-steps li.done { color: #1a7a3c; }
.ask-guide { display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  padding: 10px 14px; background: #f2f6fd; border-radius: 8px; font-size: 13px; }
.ask-step.active { color: #2456a6; font-weight: 700; }
.ask-arrow { color: var(--text-muted); }
.quick-opts { margin: 6px 0 8px; display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center; }
.quick-opt.picked { background: #dbeafe; }

/* ===================== c51-U Wave 2：工作台 + 导航瘦身 ===================== */
.nav-group.primary-group { border-bottom: 1px solid var(--line-strong);
  padding-bottom: 8px; margin-bottom: 6px; }
.nav-more summary { font-size: 11px; color: var(--text-muted); cursor: pointer;
  padding: 4px 10px; letter-spacing: .05em; }
.topright .linkbtn { font-size: 12px; margin-right: 4px; }
.chat-workspace { display: flex; gap: 14px; height: calc(100vh - 120px);
  min-height: 560px; overflow: hidden; }
.chat-main-area { flex: 1; min-width: 0; display: flex; flex-direction: column;
  overflow: hidden; }
.chat-sidebar { flex: 0 0 216px; width: 216px; background: #fff;
  border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 12px 10px; overflow: auto; }
.cs-new { display: block; text-align: center; margin-bottom: 10px; }
.cs-head { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.chat-side-item { display: flex; gap: 6px; align-items: center; padding: 7px 6px;
  border-radius: 6px; font-size: 12.5px; color: var(--text); text-decoration: none; }
.chat-side-item:hover, .chat-side-item.active { background: #f2f6fd; }
.cs-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px;
  background: #9aa4b2; }
.cs-dot.done { background: #2c9e5b; }
.cs-dot.run { background: #2456a6; }
.cs-dot.wait { background: #e2a33a; }
.cs-q { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-foot { margin-top: 10px; border-top: 1px dashed var(--line-strong);
  padding-top: 8px; }
.chat-workspace .chat-panel { flex: 1; min-height: 0; display: flex;
  flex-direction: column; overflow: hidden; }
.chat-workspace .chat-scroll { flex: 1; min-height: 0; max-height: none;
  overflow: auto; }
.chat-workspace .chat-input { flex: 0 0 auto; }
.result-card { border-left: 3px solid #2456a6; }
.result-card h4 { margin: 8px 0 6px; font-size: 14px; }
.result-card p { font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.result-card-top { margin-bottom: 4px; }
@media (max-width: 900px) {
  .chat-workspace { display: block; height: auto; overflow: visible; }
  .chat-sidebar { width: 100%; margin-bottom: 10px; }
  .chat-workspace .chat-scroll { max-height: 56vh; }
}
/* 修复：class 的 display 会覆盖 UA 的 [hidden]{display:none}——必须显式 !important */
.ev-drawer[hidden], .ev-drawer-mask[hidden], .tab-panel[hidden] { display: none !important; }

/* c52 Research Brief 可观测面板 */
.brief-block { margin: 10px 0; padding: 10px 12px; background: #f5f9ff;
  border-left: 3px solid #2456a6; border-radius: 4px; }
.brief-pre { margin: 6px 0 0; padding: 8px 10px; background: #fff;
  border: 1px solid var(--line-strong); border-radius: 6px;
  font-size: 12.5px; line-height: 1.6; white-space: pre-wrap;
  word-break: break-all; max-height: 360px; overflow: auto; }

/* c55：内部资料胶囊完整文件名换行（不再 [:40] 截断） */
button.chip-doc { white-space: normal; word-break: break-all;
  text-align: left; max-width: 100%; line-height: 1.5; }

/* c56（指令 §C1）：三 Tab 主内容区宽度保障——根治切换时塌缩成 503px 窄条
   （桌面主宽 ≥1000px；宽表格横向滚动不撑破、不裁切）。 */
#tab-report, #tab-evidence, #tab-process { width: 100%; min-width: 0; }
#tab-report > .card, #tab-evidence > .card, #tab-process > .card {
  overflow-x: auto; max-width: 100%; }
.tab-panel:not([hidden]) { display: block !important; }
@media (min-width: 1100px) {
  .main, .content { min-width: 1000px; }
}
