/* ============================================================
   产品开发中心 — 设计系统 v3
   品牌：红 (#c8362f) + 米白，沿用看板家族配色，重做信息架构。
   布局：左侧导航 + 顶栏 + KPI 概览 + 工具条 + 内容区（应用外壳）。
   ============================================================ */
:root {
  --bg:        #f1ede4;   /* 应用底色（比面板深一点，让卡片浮起来） */
  --panel:     #ffffff;
  --panel-2:   #faf8f3;
  --panel-3:   #f6f2ea;
  --ink:       #2a2520;
  --ink-2:     #5b5249;
  --muted:     #938a7e;
  --faint:     #b3a99c;
  --line:      #e7e0d5;
  --line-2:    #efe9df;

  --red:       #c8362f;
  --red-700:   #a82a24;
  --red-soft:  #f7e6e3;
  --red-tint:  #fdf4f2;

  --blue:      #2f6da0;  --blue-bg:  #e8f0f7;
  --amber:     #b9791f;  --amber-bg: #faefd8;
  --green:     #2f7a4f;  --green-bg: #e6f2ea;
  --grey:      #8a8178;  --grey-bg:  #efeae2;
  --purple:    #6a4fa0;  --purple-bg:#ece6f7;

  --shadow-sm: 0 1px 2px rgba(45,33,20,.05);
  --shadow:    0 2px 10px rgba(45,33,20,.07);
  --shadow-lg: 0 14px 40px rgba(40,28,16,.18);
  --r:   10px;
  --r-sm: 7px;
  --r-lg: 14px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.55 -apple-system, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d8cfc1; border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #c5bbab; background-clip: padding-box; }

/* ── 应用外壳 ── */
.app { display: grid; grid-template-columns: 232px 1fr; height: 100vh; overflow: hidden; }

/* ── 侧边导航 ── */
.sidebar {
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0; padding: 0;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 16px 16px 14px; border-bottom: 1px solid var(--line-2); }
.logo {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--red), #e0584f); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; box-shadow: 0 3px 8px rgba(200,54,47,.32);
}
.brand-txt .bname { font-size: 15px; font-weight: 800; letter-spacing: .2px; }
.brand-txt .bver { font-size: 10.5px; color: var(--faint); margin-top: 1px; letter-spacing: .3px; }

.side-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 10px 4px; }
.side-group {
  font-size: 11px; font-weight: 700; color: var(--faint); letter-spacing: .8px;
  text-transform: uppercase; padding: 14px 8px 6px;
}
.side-item {
  width: 100%; display: flex; align-items: center; gap: 11px;
  border: none; background: none; cursor: pointer; text-align: left;
  padding: 9px 10px; border-radius: var(--r-sm); color: var(--ink-2);
  font-size: 13.5px; position: relative; transition: background .12s, color .12s;
}
.side-item:hover { background: var(--panel-3); color: var(--ink); }
.side-item .si-ic { font-size: 16px; width: 22px; text-align: center; flex: none; opacity: .85; }
.side-item .si-txt { display: flex; flex-direction: column; line-height: 1.25; font-weight: 600; }
.side-item .si-txt small { font-weight: 400; font-size: 10.5px; color: var(--faint); margin-top: 1px; }
.side-item.active { background: var(--red-tint); color: var(--red-700); }
.side-item.active::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px;
  background: var(--red); border-radius: 0 3px 3px 0;
}
.side-item.active .si-ic { opacity: 1; }
.side-item.active .si-txt small { color: #cf8d88; }
.side-item.act { color: var(--ink-2); }
.side-item.act:hover { background: var(--red-tint); color: var(--red-700); }

.side-foot { border-top: 1px solid var(--line-2); padding: 4px 16px 16px; }
.legend { display: flex; flex-direction: column; gap: 5px; margin: 4px 0 12px; }
.legend .lg { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.ldot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.ldot.A { background: var(--blue); }
.ldot.B { background: var(--green); }
.ldot.C { background: var(--amber); }
.ldot.manual { background: var(--grey); }
.side-count { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ── 主区 ── */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.appbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 22px; background: var(--panel); border-bottom: 1px solid var(--line); flex: none;
}
.appbar-title h1 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: .2px; }
.appbar-title p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.appbar-actions { display: flex; align-items: center; gap: 9px; flex: none; }

/* ── 按钮 ── */
.btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 7px 14px; border-radius: var(--r-sm); cursor: pointer; font-size: 13px; font-weight: 600;
  transition: border-color .12s, background .12s, box-shadow .12s; white-space: nowrap;
}
.btn:hover { border-color: #d0c5b6; background: var(--panel-2); }
.btn.primary { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 0 2px 8px rgba(200,54,47,.25); }
.btn.primary:hover { background: var(--red-700); border-color: var(--red-700); }
.btn.primary.done { background: var(--green-bg); color: var(--green); border-color: var(--green); box-shadow: none; } /* 已诊断：去强调的绿"已完成"态 */
.btn.primary.done:hover { background: var(--green); color: #fff; border-color: var(--green); }
.btn.icon { padding: 7px 11px; font-size: 15px; line-height: 1; }
.btn.mini { font-size: 11px; padding: 3px 9px; font-weight: 600; }
.btn:disabled { opacity: .55; cursor: default; box-shadow: none; }

/* ── KPI 概览条 ── */
.kpis { display: flex; gap: 12px; padding: 14px 22px 4px; flex: none; flex-wrap: wrap; }
.kpi {
  flex: 1 1 0; min-width: 116px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 11px 14px; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 1px; position: relative;
  transition: border-color .12s, box-shadow .12s, transform .08s;
}
.kpi:hover { border-color: #d6ccbd; box-shadow: var(--shadow); }
.kpi:active { transform: translateY(1px); }
.kpi .kpi-num { font-size: 23px; font-weight: 800; line-height: 1.1; letter-spacing: .3px; }
.kpi .kpi-lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi::after { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--line); }
.kpi.do::after     { background: var(--green); }   .kpi.do .kpi-num     { color: var(--green); }
.kpi.maybe::after  { background: var(--amber); }   .kpi.maybe .kpi-num  { color: var(--amber); }
.kpi.skip::after   { background: var(--grey); }    .kpi.skip .kpi-num   { color: var(--grey); }
.kpi.undecided::after { background: var(--blue); } .kpi.undecided .kpi-num { color: var(--blue); }
.kpi.sourced::after { background: var(--amber); }
.kpi.running::after { background: var(--red); }    .kpi.running .kpi-num { color: var(--red); }
.kpi.all::after    { background: var(--ink-2); }
.kpi.active { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-soft); }
.kpi.running .kpi-num::after {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px;
  border-radius: 50%; background: var(--red); vertical-align: middle; animation: pulse 1.3s infinite;
}
@keyframes pulse { 0%,100%{ opacity: 1 } 50%{ opacity: .25 } }

/* ── 工具条（筛选） ── */
.toolbar {
  display: flex; gap: 9px; align-items: center; flex-wrap: wrap;
  padding: 12px 22px; flex: none;
}
.toolbar select, .toolbar input {
  font-size: 12.5px; padding: 6px 9px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--panel); color: var(--ink); font-family: inherit;
}
.toolbar select:focus, .toolbar input:focus { outline: none; border-color: #c9bdac; }
.toolbar .tb-search { min-width: 230px; flex: 0 1 280px; }
.toolbar .tb-spacer { flex: 1; }

/* ── 视图容器：内部滚动，外壳不滚 ── */
.view { flex: 1; min-height: 0; }
.grid-view, .matrix-view { overflow-y: auto; padding: 6px 22px 26px; }
.board-view { overflow: hidden; padding: 6px 22px 18px; }

/* ── 卡片网格视图 ── */
.grid-view .grid-wrap {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px;
}
.grid-empty, .col-empty {
  color: var(--faint); font-size: 12.5px; text-align: center; padding: 26px 8px;
}

/* ── 流水线看板 ── */
.board { display: flex; gap: 13px; height: 100%; overflow-x: auto; padding-bottom: 6px; align-items: stretch; }
.col {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r);
  width: 264px; flex: none; display: flex; flex-direction: column; min-height: 0;
}
.col.phase-start { margin-left: 9px; }
.col.phase-start::before {
  content: ""; position: absolute; margin-left: -13px; width: 1px; align-self: stretch;
}
.col-head { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.col-kicker { font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; margin-bottom: 3px; display: inline-flex; align-items: center; gap: 5px; }
.col-kicker i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.col-head .ch-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.col-head .name { font-weight: 700; font-size: 14px; }
.col-head .name .hint { display: block; font-weight: 400; font-size: 10.5px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.col-head .cnt {
  color: var(--ink-2); font-size: 11.5px; font-weight: 700; background: var(--panel-3);
  border: 1px solid var(--line); border-radius: 20px; padding: 1px 9px; flex: none;
}
.col-body { padding: 9px; display: flex; flex-direction: column; gap: 9px; flex: 1; min-height: 40px; overflow-y: auto; }
.col-body.drag-over { background: var(--red-tint); outline: 2px dashed #e0c0b8; outline-offset: -5px; border-radius: 8px; }

/* 阶段配色（看板列 kicker + 顶部细条 / 卡片阶段药丸） */
.ph-opp     { color: var(--blue);   } .ph-opp i,     .stp.ph-opp     { background: var(--blue);   }
.ph-judge   { color: var(--red);    } .ph-judge i,   .stp.ph-judge   { background: var(--red);    }
.ph-exec    { color: var(--amber);  } .ph-exec i,    .stp.ph-exec    { background: var(--amber);  }
.ph-trigger { color: var(--red-700);} .ph-trigger i, .stp.ph-trigger { background: var(--red-700);}
.ph-loop    { color: var(--green);  } .ph-loop i,    .stp.ph-loop    { background: var(--green);  }
.col[data-phase] .col-head { border-top: 3px solid var(--line); border-radius: var(--r) var(--r) 0 0; }
.col[data-phase="opp"]     .col-head { border-top-color: var(--blue); }
.col[data-phase="judge"]   .col-head { border-top-color: var(--red); }
.col[data-phase="exec"]    .col-head { border-top-color: var(--amber); }
.col[data-phase="trigger"] .col-head { border-top-color: var(--red-700); background: var(--red-tint); }
.col[data-phase="loop"]    .col-head { border-top-color: var(--green); }

/* ── 机会卡（看板/网格共用） ── */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 11px 12px; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color .12s, box-shadow .12s, transform .08s;
}
.card:hover { border-color: #d8cdbd; box-shadow: var(--shadow); }
.board .card { cursor: grab; }
.board .card:active { cursor: grabbing; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card .kw { font-weight: 700; font-size: 14px; line-height: 1.3; min-width: 0; word-break: break-word; }
.card .cn { font-size: 12px; color: var(--muted); margin-top: 1px; }
.vrow { display: flex; align-items: center; gap: 6px; margin: 7px 0 2px; flex-wrap: wrap; }
.vline-in { font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.sigstrip { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0 2px; }
.sig { font-size: 11px; background: var(--panel-3); color: var(--ink-2); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-2); }
.sig b { color: var(--ink); font-weight: 700; }
.scorewhy { font-size: 11px; color: var(--muted); margin: 6px 0 2px; line-height: 1.4; }
.card .meta { display: flex; gap: 6px; align-items: center; margin-top: 9px; flex-wrap: wrap; }

.tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--grey-bg); color: var(--ink-2); font-weight: 600; }
.tag.A { background: var(--blue-bg);  color: var(--blue);  }
.tag.B { background: var(--green-bg); color: var(--green); }
.tag.C { background: var(--amber-bg); color: var(--amber); }
.tag.manual { background: var(--grey-bg); color: var(--grey); }
.tag.score { background: var(--red-soft); color: var(--red); font-weight: 700; }
.tag.prog { background: var(--panel-3); color: var(--muted); }
.tag.mkt { background: var(--purple-bg); color: var(--purple); font-weight: 700; }

/* 卡片阶段药丸（网格视图用，看板里列即阶段不重复显示） */
.st-chip { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; display: inline-flex; align-items: center; gap: 5px; background: var(--panel-3); color: var(--ink-2); border: 1px solid var(--line-2); }
.st-chip .stp { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }

/* 综合分药丸 */
.score-pill { font-weight: 800; font-size: 13px; padding: 2px 10px; border-radius: 20px; line-height: 1.35; flex: none; }
.score-pill.hi  { background: var(--green-bg); color: var(--green); }
.score-pill.mid { background: var(--amber-bg); color: var(--amber); }
.score-pill.lo  { background: var(--grey-bg);  color: var(--grey); }

/* 决策徽章 */
.vbadge { font-size: 11px; padding: 2px 8px; border-radius: 7px; font-weight: 700; vertical-align: middle; }

/* 卡片动作区 */
.card-acts { display: flex; gap: 7px; margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line); }
.card-acts .zap, .card-acts .src { flex: 1; text-align: center; font-size: 12px; padding: 5px 8px; border-radius: var(--r-sm); }
.zap { border: 1px solid var(--red); background: var(--panel); color: var(--red); cursor: pointer; font-weight: 600; transition: background .12s; }
.zap:hover { background: var(--red-tint); }
.zap:disabled { opacity: .55; cursor: default; }
.zap.done { border-color: var(--green); color: var(--green); background: var(--green-bg); } /* 已诊断：红⚡→绿✓，一眼区分 */
.zap.done:hover { background: var(--green); color: #fff; }
.src { border: 1px solid #d8a445; background: var(--panel); color: var(--amber); cursor: pointer; font-weight: 600; transition: background .12s; }
.src:hover { background: var(--amber-bg); }
.src.primary { background: var(--amber); color: #fff; border-color: var(--amber); }
.src.primary:hover { background: #a76c19; }
.src:disabled { opacity: .55; cursor: default; }
/* 「下一环节」推进按钮（绿=前进；紧凑，不抢 ⚡/🏭 主操作） */
.card-acts .adv { flex: 0 0 auto; font-size: 12px; padding: 5px 9px; border-radius: var(--r-sm); border: 1px solid var(--green); background: var(--panel); color: var(--green); cursor: pointer; font-weight: 600; transition: background .12s; }
.card-acts .adv:hover { background: var(--green-bg); }
.card-acts .adv:disabled { opacity: .5; cursor: default; }

/* ── 链路矩阵 ── */
.matrix-view .matrix-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); box-shadow: var(--shadow-sm); }
.matrix-tbl { border-collapse: collapse; font-size: 12px; width: 100%; }
.matrix-tbl th, .matrix-tbl td { border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); padding: 7px 8px; text-align: center; white-space: nowrap; }
.matrix-tbl th { background: var(--panel-2); font-weight: 700; color: var(--ink-2); position: sticky; top: 0; z-index: 2; }
.matrix-tbl th.sticky, .matrix-tbl td.sticky { position: sticky; left: 0; z-index: 1; background: var(--panel); text-align: left; max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.matrix-tbl th.sticky { z-index: 3; background: var(--panel-2); }
.matrix-tbl tr:hover td { background: var(--red-tint); cursor: pointer; }
.matrix-tbl td.nm { font-weight: 700; }
.matrix-tbl td.nm .who { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: 11px; }
.matrix-tbl td.mkt { color: var(--purple); font-weight: 600; }
.matrix-tbl td.mc.done { color: var(--green); font-weight: 800; }
.matrix-tbl td.mc.run { color: var(--amber); }
.matrix-tbl td.prog { color: var(--muted); }

/* ── 抽屉 ── */
.drawer { position: fixed; inset: 0; z-index: 60; background: rgba(40,28,16,.34); display: flex; justify-content: flex-end; backdrop-filter: blur(1.5px); }
.drawer-panel { width: 580px; max-width: 94vw; height: 100vh; background: var(--panel); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slidein .18s ease; }
@keyframes slidein { from { transform: translateX(28px); opacity: .6 } to { transform: none; opacity: 1 } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex: none; }
#d_title { font-weight: 800; font-size: 15px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px 28px; }

/* 弹层/抽屉关闭按钮 */
.x { border: none; background: none; cursor: pointer; font-size: 16px; color: var(--muted); width: 30px; height: 30px; border-radius: 7px; line-height: 1; flex: none; }
.x:hover { background: var(--panel-3); color: var(--ink); }

/* 抽屉紧凑头 */
.dhc-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.dhc-stage { font-weight: 700; font-size: 13px; padding: 3px 10px; background: var(--panel-3); border-radius: 7px; color: var(--ink-2); border: 1px solid var(--line-2); }
.dhc-adv { margin-left: auto; font-size: 12.5px; font-weight: 700; padding: 4px 12px; border-radius: 7px; border: 1px solid var(--green); background: var(--panel); color: var(--green); cursor: pointer; transition: background .12s; }
.dhc-adv:hover { background: var(--green-bg); }
.dhc-adv-done { margin-left: auto; font-size: 12px; color: var(--muted); }

/* 抽屉标签页 */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin: 0 -18px 16px; padding: 0 18px;
  position: sticky; top: -16px; background: var(--panel); z-index: 6; }
.tab { border: none; background: none; padding: 10px 15px 8px; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px; font-weight: 700; font-size: 14px; line-height: 1.15;
  display: flex; flex-direction: column; align-items: center; gap: 1px; }
.tab small { font-weight: 400; font-size: 10px; color: var(--faint); }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--red); border-bottom-color: var(--red); }
.tab.active small { color: #cf8d88; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.section-title { font-weight: 700; font-size: 13.5px; margin: 18px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line); color: var(--ink); }
.section-title:first-child { margin-top: 2px; }

.kv { display: grid; grid-template-columns: 116px 1fr; gap: 5px 12px; font-size: 13px; margin-bottom: 12px; }
.kv .k { color: var(--muted); }

.skill-row { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 13px; border-bottom: 1px dashed var(--line-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #d8d0c5; flex: none; }
.dot.done { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }

.events { font-size: 12px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px 11px; }
.events div { padding: 2px 0; }
.run-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
#runStatus { font-size: 13px; margin-bottom: 4px; }

/* 决策摘要面板 */
.verdict { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.verdict .vhead { display: flex; align-items: center; gap: 8px; }
.verdict .vone { font-weight: 700; font-size: 14px; }
.verdict .vsub { font-size: 12px; color: var(--muted); margin: 10px 0 2px; font-weight: 700; }
.verdict .vsub.risk { color: var(--amber); }
.verdict ul { margin: 2px 0 4px; padding-left: 18px; font-size: 13px; }
.verdict li { margin: 3px 0; }
.verdict .vhint { font-size: 13px; background: var(--red-soft); color: var(--red-700); padding: 7px 10px; border-radius: var(--r-sm); }
.verdict .vmeta { font-size: 11px; color: var(--faint); margin-top: 8px; }

/* 产物下载 */
.arts { display: flex; flex-direction: column; gap: 5px; }
.artlink { font-size: 13px; color: var(--blue); text-decoration: none; padding: 6px 10px; background: var(--blue-bg); border-radius: var(--r-sm); font-weight: 600; }
.artlink:hover { background: #dceaf5; }

/* 1688 寻源面板 */
.srcmeta { font-size: 12px; color: var(--ink-2); margin: 5px 0; line-height: 1.5; }
.srclist { display: flex; flex-direction: column; gap: 7px; margin: 7px 0; }
.srcrow { display: flex; gap: 9px; align-items: flex-start; padding: 8px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--panel-2); }
.srcimg { width: 50px; height: 50px; object-fit: cover; border-radius: 7px; flex: 0 0 auto; background: var(--panel-3); }
.srcimg.ph { background: var(--panel-3); }
.srcinfo { min-width: 0; }
.srctitle { font-size: 12px; line-height: 1.35; word-break: break-all; }
.srctitle a { color: var(--blue); text-decoration: none; }
.srctitle a:hover { text-decoration: underline; }
.srcsub { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* 02B 多平台市调 */
.mp-list { display: flex; flex-direction: column; gap: 8px; margin: 7px 0; }
.mp-plat { border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px 10px; background: var(--panel-2); }
.mp-plat.off { color: var(--muted); }
.mp-name { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.mp-item { font-size: 12px; line-height: 1.45; padding: 3px 0; border-top: 1px dashed var(--line-2); }
.mp-item a { color: var(--blue); text-decoration: none; }
.mp-item a:hover { text-decoration: underline; }
.mp-px { color: var(--muted); }

/* PRD 草稿 */
.prd-sku { border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 9px 11px; margin: 7px 0; background: var(--panel-2); }
.prd-h { font-size: 13px; }
.prd-diff { font-size: 12px; color: var(--ink-2); margin: 5px 0 2px; }
.prd-spec { font-size: 11px; color: var(--muted); }

/* 编辑器 / 录入网格 / 动态行表 */
.editor { margin-top: 10px; border-top: 1px solid var(--line-2); padding-top: 4px; }
.editor .ed-grid, .ed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 7px 0; }
.editor label, .ed-grid label, label.ed-full { display: flex; flex-direction: column; font-size: 12px; color: var(--ink-2); gap: 4px; }
label.ed-full { margin: 7px 0; }
.editor input, .editor select, .ed-grid input, .ed-grid select, label.ed-full input {
  font-size: 12.5px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); color: var(--ink); font-family: inherit;
}
.editor input:focus, .ed-grid input:focus, label.ed-full input:focus { outline: none; border-color: #c9bdac; }
.ed-sub, .editor .ed-sub { font-size: 12px; font-weight: 700; color: var(--ink-2); margin: 12px 0 3px; }
.ed-sub small, label small, .editor small { color: var(--faint); font-weight: 400; }
.ed-tbl { border-collapse: collapse; width: 100%; margin: 5px 0; }
.ed-tbl th { font-size: 11px; color: var(--muted); font-weight: 600; text-align: left; padding: 3px 4px; }
.ed-tbl td { padding: 2px 2px; }
.ed-tbl input { width: 100%; font-size: 12px; padding: 4px 6px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--panel); }

/* 状态行内文字色（JS 内联色仍保留，这里给容器底） */
#triageStatus div, #verdictPanel div, #sourcingStatus div, #multiplatStatus div, #prdStatus div, #chainStatus div, #runStatus div { font-size: 13px; }

/* ── 弹层 ── */
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(40,28,16,.4); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal-box { background: var(--panel); border-radius: var(--r-lg); width: 460px; max-width: 92vw; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .16s ease; }
@keyframes pop { from { transform: scale(.96); opacity: .5 } to { transform: none; opacity: 1 } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; font-size: 15.5px; font-weight: 800; }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.modal-body label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.modal-body label small { color: var(--faint); font-weight: 400; }
.modal-body input, .modal-body select { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 13px; background: var(--panel); color: var(--ink); font-family: inherit; }
.modal-body input:focus, .modal-body select:focus { outline: none; border-color: var(--red); }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 18px; }
.err { color: var(--red); font-size: 12px; min-height: 16px; }

/* ============================================================
   v4 — 大师解读详情 / 数据依据 / 功能说明 / 使用指南 / 卡片精修
   ============================================================ */

/* 决策摘要：详细解读块 */
.run-note { font-size: 13px; color: var(--amber); font-weight: 600; }
.verdict .vsub { margin-top: 12px; }
.vanalysis { font-size: 13px; line-height: 1.75; color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--red); border-radius: var(--r-sm); padding: 10px 13px; margin: 3px 0 2px; }

/* 数据依据（真实 provenance，可折叠） */
.databasis { margin: 12px 0 2px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); overflow: hidden; }
.databasis > summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--ink-2); padding: 8px 11px; background: var(--panel-2); list-style: none; }
.databasis > summary::-webkit-details-marker { display: none; }
.databasis > summary::before { content: "▸ "; color: var(--muted); }
.databasis[open] > summary::before { content: "▾ "; }
.db-body { padding: 9px 11px; display: flex; flex-direction: column; gap: 8px; }
.db-row { font-size: 12px; display: flex; gap: 9px; flex-wrap: wrap; align-items: baseline; }
.db-row .db-src { color: var(--muted); font-weight: 700; flex: none; min-width: 96px; }
.db-row .db-vals { color: var(--ink-2); }
.db-row.gap .db-src, .db-row.gap .db-vals { color: var(--amber); }
.db-grp { border: 1px solid var(--line-2); border-radius: 7px; overflow: hidden; }
.db-grphd { font-size: 11.5px; font-weight: 700; color: var(--ink-2); background: var(--panel-3); padding: 6px 10px; line-height: 1.4; }
.db-sig { display: grid; grid-template-columns: 100px auto 1fr; gap: 9px; align-items: baseline; font-size: 11.5px; padding: 5px 10px; border-top: 1px solid var(--line-2); }
.db-sig .db-k { color: var(--muted); }
.db-sig .db-v { color: var(--red); font-weight: 800; white-space: nowrap; }
.db-sig .db-ep { color: var(--faint); font-size: 10.5px; text-align: right; word-break: break-all; }

/* 分段说明（section-title 下一行：是什么·数据源·何时用·成本） */
.sechelp { font-size: 11.5px; line-height: 1.6; color: var(--ink-2); background: var(--panel-2);
  border: 1px solid var(--line-2); border-left: 3px solid #e3d9c8; border-radius: var(--r-sm); padding: 7px 10px; margin: -4px 0 10px; }

/* 卡面：大师解读 hint */
.vmore { font-size: 10.5px; color: var(--red); font-weight: 700; margin-left: auto; white-space: nowrap; opacity: .9; }

/* ── 使用指南弹层 ── */
.guide-box { width: 740px; max-width: 95vw; }
.guide-body { max-height: 78vh; overflow-y: auto; }
.g-intro { font-size: 13px; line-height: 1.75; color: var(--ink-2); margin: 0 0 12px; }
.g-intro b { color: var(--ink); }
.g-flow { font-size: 12.5px; font-weight: 700; color: var(--red-700); background: var(--red-tint);
  border: 1px solid var(--red-soft); border-radius: var(--r-sm); padding: 11px 13px; line-height: 1.9; margin-bottom: 16px; }
.g-sec { margin: 0 0 16px; }
.g-sec h4 { margin: 0 0 8px; font-size: 13.5px; font-weight: 800; color: var(--ink); }
.g-sec ul { margin: 0; padding-left: 19px; font-size: 12.5px; line-height: 1.8; color: var(--ink-2); }
.g-sec li { margin: 4px 0; }
.g-sec li b { color: var(--ink); }
.g-pill { display: inline-block; background: var(--green-bg); color: var(--green); font-weight: 800; font-size: 11px; padding: 1px 9px; border-radius: 20px; }
.g-badge { display: inline-block; background: var(--green-bg); color: var(--green); font-weight: 700; font-size: 11px; padding: 1px 8px; border-radius: 6px; }
.g-tbl { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 4px; }
.g-tbl th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 700; padding: 7px 9px; border-bottom: 1.5px solid var(--line); background: var(--panel-2); }
.g-tbl td { padding: 7px 9px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); vertical-align: top; line-height: 1.5; }
.g-tbl td:first-child { font-weight: 700; color: var(--ink); white-space: nowrap; }
.g-tbl td:last-child { white-space: nowrap; color: var(--red); font-weight: 700; }
.g-redline { font-size: 12.5px; line-height: 1.65; color: var(--ink-2); background: var(--red-tint);
  border: 1px solid var(--red-soft); border-radius: var(--r-sm); padding: 11px 13px; }
.g-redline b { color: var(--red-700); }

/* ── 卡片再精修 ── */
.card:hover { transform: translateY(-2px); }
.card .vrow { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 7px; padding: 6px 9px; }

/* ── 批量动作（多选卡 → 批量诊断/寻源）── */
.card-top .cardsel { flex: 0 0 auto; width: 15px; height: 15px; margin: 2px 2px 0 0; cursor: pointer; accent-color: var(--red, #c0392b); }
.card-top .kw { flex: 1; }
.batchbar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 10px; max-width: 92vw;
  background: var(--panel, #fffdfb); border: 1px solid var(--line, #e6ddd3);
  box-shadow: 0 8px 30px rgba(60,40,30,.18); border-radius: 12px; padding: 9px 14px;
}
.batchbar.hidden { display: none; }
.batchbar .bb-n, .batchbar .bb-run { font-size: 13px; color: var(--ink, #3a322c); white-space: nowrap; }
.batchbar .bb-n b, .batchbar .bb-run b { color: var(--red-700, #b03028); }
.batchbar .bb-act {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px;
  border: 1px solid var(--line-2, #ead9cf); background: var(--panel-2, #fbf6f0);
  border-radius: 9px; padding: 6px 12px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--ink, #3a322c);
}
.batchbar .bb-act small { font-weight: 400; font-size: 10.5px; color: var(--muted, #8a8178); }
.batchbar .bb-act:hover:not(:disabled) { border-color: var(--red, #c0392b); }
.batchbar .bb-act:disabled { opacity: .45; cursor: not-allowed; }
.batchbar .bb-clear { border: none; background: none; color: var(--muted, #8a8178); font-size: 12px; cursor: pointer; text-decoration: underline; }
