/* ==========================================================
   数智工作台 · 在线工具样式
   与站点主样式共用色板：#051C2C / #1E5EFF / 金 #C9A227
   ========================================================== */
.tool-shell { background: #F5F7FA; border-top: 1px solid var(--line); padding: 56px 0 72px; }
.tool-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.tool-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--gold, #B88639); margin-bottom: 12px; }
.tool-back:hover { text-decoration: underline; color: var(--gold-dk, #966D2B); }
.tool-head h2 { font-size: 28px; line-height: 1.3; font-weight: 700; color: var(--ink); margin-top: 10px; }
.tool-head p { font-size: 14px; color: var(--text-2); margin-top: 8px; max-width: 620px; line-height: 1.7; }

.tool-grid { display: grid; grid-template-columns: 380px minmax(0,1fr); gap: 24px; align-items: start; }
/* 网格子项允许收缩：宽表格/长内容在 1fr 轨道内被约束，不再把整栏撑出视口 */
.tool-grid > * { min-width: 0; max-width: 100%; }
.tool-panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.tool-panel h3 { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 18px; }

/* 输入项 */
.fld { margin-bottom: 14px; }
.fld label { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.fld label b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.fld input[type="number"], .fld input[type="text"], .fld select {
  width: 100%; padding: 9px 11px; border: 1px solid #D5DCE6; border-radius: 6px;
  font-size: 14px; color: var(--ink); background: #fff; font-variant-numeric: tabular-nums;
}
.fld input:focus, .fld select:focus { outline: 2px solid rgba(30,94,255,.35); border-color: #1E5EFF; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 结果区 */
.res-main { background: var(--ink); color: #fff; border-radius: 10px; padding: 26px 24px; margin-bottom: 16px; }
.res-main .lbl { font-size: 12.5px; color: rgba(255,255,255,.6); letter-spacing: .04em; }
.res-main .val { font-size: 42px; font-weight: 800; line-height: 1.15; margin: 6px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.res-main .val small { font-size: 16px; font-weight: 600; margin-left: 6px; color: rgba(255,255,255,.7); }
.res-main .sub { font-size: 12.5px; color: rgba(255,255,255,.55); }
.res-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.kpi .k { font-size: 11.5px; color: var(--text-3); margin-bottom: 5px; }
.kpi .v { font-size: 19px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* 敏感性表 */
table.sens { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
table.sens th, table.sens td { padding: 8px 10px; text-align: right; border: 1px solid #E6EAF0; }
table.sens th { background: #F7F9FC; color: var(--text-2); font-weight: 600; }
table.sens td.rowh { background: #F7F9FC; color: var(--text-2); font-weight: 600; text-align: left; }
table.sens td.mid { outline: 2px solid #1E5EFF; outline-offset: -2px; font-weight: 700; }

.scen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.scen .s { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fff; }
.scen .s .t { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.scen .s .n { font-size: 18px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.scen .s.hl { border-color: #1E5EFF; background: #F2F6FF; }

/* 诊断题 */
.q { padding: 14px 0; border-bottom: 1px dashed #E3E8EF; }
.q:last-child { border-bottom: 0; }
.q .qt { font-size: 13.5px; color: var(--ink); line-height: 1.6; margin-bottom: 9px; }
.q .qt span { color: var(--text-3); font-size: 12px; margin-right: 6px; font-weight: 700; }
.opts { display: flex; gap: 6px; flex-wrap: wrap; }
.opts label { position: relative; }
.opts input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opts span {
  display: inline-block; padding: 6px 12px; border: 1px solid #D5DCE6; border-radius: 20px;
  font-size: 12.5px; color: var(--text-2); cursor: pointer; transition: all .15s;
}
.opts input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }

/* 分数条 */
.dims { display: grid; gap: 12px; }
.dim { display: grid; grid-template-columns: 76px 1fr 52px; align-items: center; gap: 12px; }
.dim .dn { font-size: 13px; color: var(--text-2); }
.dim .bar { height: 10px; border-radius: 6px; background: #E8EDF4; overflow: hidden; }
.dim .bar i { display: block; height: 100%; border-radius: 6px; transition: width .35s ease; }
.dim .dv { font-size: 14px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }

/* 建议清单 */
.advice { list-style: none; padding: 0; margin: 0; }
.advice li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid #EEF1F6; }
.advice li:last-child { border-bottom: 0; }
.advice b { color: #B4443C; font-variant-numeric: tabular-nums; }
.advice p { font-size: 12.5px; color: var(--text-2); line-height: 1.7; margin: 3px 0 0; }
.advice strong { font-size: 13.5px; color: var(--ink); font-weight: 600; }

/* 按钮组 */
.tool-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.tool-actions .btn { font-size: 13.5px; padding: 10px 20px; }
.btn-line { background: #fff; border: 1px solid #C9D2DE; color: var(--ink); }
.btn-line:hover { border-color: var(--ink); }

/* 提示条 */
.hint { font-size: 12px; color: var(--text-3); line-height: 1.7; margin-top: 14px; padding-left: 12px; border-left: 2px solid #DCE3EC; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 3px 8px; border-radius: 4px; background: #EAF0FF; color: #1E5EFF; }

/* 提纲输出 */
.outline { background: #FBFCFE; border: 1px solid #E6EAF0; border-radius: 8px; padding: 18px 20px; font-size: 13px; line-height: 1.85; color: var(--text-2); white-space: pre-wrap; max-height: 360px; overflow: auto; }
.outline strong { color: var(--ink); }

@media (max-width: 980px) {
  .tool-grid { grid-template-columns: 1fr; }
  .res-kpis { grid-template-columns: repeat(2, 1fr); }
  .scen { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .res-main .val { font-size: 34px; }
  .fld-row { grid-template-columns: 1fr; }
  .dim { grid-template-columns: 64px 1fr 44px; }
}

/* 打印：只留工具区 */
@media print {
  body > header, .site-footer, .to-top, .scroll-progress, .subnav,
  .page-hero, .cta-band, #botRoot, .tool-head .btn, .tool-actions,
  .tool-panel--input, .hint, section.section, .masthead { display: none !important; }
  .tool-shell { padding: 0; background: #fff; border: 0; }
  .tool-grid { grid-template-columns: 1fr; }
  .res-main { background: #fff !important; color: #051C2C !important; border: 1px solid #ccc; }
  .res-main .lbl, .res-main .sub { color: #555 !important; }
  .res-main .val small { color: #333 !important; }
  table.sens th, table.sens td { border-color: #bbb; }
  .print-only { display: block !important; }
  /* 打印时隐藏浮动徽章与账户弹窗；下载闸门在打印前已通过注册校验 */
  .mf-badge { display: none !important; }
  .mf-modal { display: none !important; }
}
.print-only { display: none; }

/* ===== 九模块诊断 ===== */
.dm { border-top: 1px solid #E6EAF0; padding: 18px 0 6px; }
.dm:first-child { border-top: 0; }
.dm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.dm-code { font-size: 11.5px; font-weight: 700; color: #fff; background: var(--ink); border-radius: 4px; padding: 2px 6px; letter-spacing: .04em; }
.dm-head h4 { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0; }
.dm-w { font-size: 11.5px; color: var(--text-3); margin-left: auto; }
.grade { display: inline-block; font-weight: 700; }
.grade.g { color: #7FD4A6; }
.grade.y { color: #F0C674; }
.grade.r { color: #F09B93; }
table.sens td.g { background: #EAF6EF; color: #1B7F4D; font-weight: 700; }
table.sens td.y { background: #FDF6E7; color: #8A6A12; font-weight: 700; }
table.sens td.r { background: #FBEBEA; color: #B4443C; font-weight: 700; }
table.sens td.na { color: var(--text-3); }
.red-item { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px dashed #E3E8EF; cursor: pointer; }
.red-item:last-child { border-bottom: 0; }
.red-item input { margin-top: 3px; }
.red-item strong { display: block; font-size: 13px; color: var(--ink); font-weight: 600; }
.red-item em { display: block; font-style: normal; font-size: 12px; color: var(--text-3); line-height: 1.6; margin-top: 3px; }
@media print { .dm .opts { display: none; } }

/* ===== 三法联动估值器 ===== */
.v3-step { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px 24px 10px; margin-bottom: 18px; }
.v3-step-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.v3-num { font-size: 11.5px; font-weight: 700; color: #fff; background: #1E5EFF; border-radius: 4px; padding: 3px 9px; letter-spacing: .08em; white-space: nowrap; }
.v3-step-head h3 { font-size: 17px; font-weight: 700; color: var(--ink); margin: 0; }
.v3-step-head .why { font-size: 12.5px; color: var(--text-3); margin-left: auto; }
.v3-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.v3-advice { border: 1px solid #E6EAF0; border-radius: 8px; padding: 16px 18px; margin-bottom: 16px; background: #F7F9FC; }
.v3-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.v3-chip { font-size: 12px; font-weight: 600; color: #051C2C; background: #fff; border: 1px solid #C9D4E4; border-radius: 999px; padding: 4px 12px; }
.v3-chip.primary { background: #051C2C; color: #fff; border-color: #051C2C; }
.v3-advice p { font-size: 13px; color: var(--text-2); line-height: 1.7; margin: 0 0 8px; }
table.mref { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 4px; }
table.mref th, table.mref td { padding: 7px 10px; border: 1px solid #E6EAF0; text-align: left; background: #fff; }
table.mref th { background: #F7F9FC; font-weight: 600; color: var(--text-2); }
.v3-mode { display: flex; gap: 0; border: 1px solid #D5DCE6; border-radius: 6px; overflow: hidden; margin-bottom: 14px; }
.v3-mode label { flex: 1; text-align: center; font-size: 12.5px; padding: 8px 4px; cursor: pointer; color: var(--text-2); background: #fff; border-right: 1px solid #D5DCE6; }
.v3-mode label:last-child { border-right: 0; }
.v3-mode input { display: none; }
.v3-mode input:checked + span { font-weight: 700; color: #1E5EFF; }
.v3-mode label:has(input:checked) { background: #EEF3FF; }
.v3-buildup { border: 1px dashed #C9D4E4; border-radius: 8px; padding: 14px 14px 2px; margin-bottom: 14px; background: #FBFCFE; }
.v3-buildup .bu-out { font-size: 13px; color: var(--ink); margin: 10px 0 12px; }
.v3-buildup .bu-out b { color: #1E5EFF; font-size: 16px; }
.cmp-row { display: grid; grid-template-columns: 150px 1fr 110px; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 12.5px; }
.cmp-row .n { color: var(--text-2); }
.cmp-row .bar { height: 14px; border-radius: 4px; background: #E9EEF6; position: relative; overflow: hidden; }
.cmp-row .bar i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; }
.cmp-row.c-dcf .bar i { background: #1E5EFF; }
.cmp-row.c-mk .bar i { background: #C9A227; }
.cmp-row .v { text-align: right; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.v3-final { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; }
.v3-final .f { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: #F7F9FC; }
.v3-final .f.hl { background: var(--ink); border-color: var(--ink); color: #fff; }
.v3-final .f.hl .k { color: rgba(255,255,255,.6); }
.v3-final .f.hl .v { color: #fff; }
.v3-final .k { font-size: 11.5px; color: var(--text-3); margin-bottom: 5px; }
.v3-final .v { font-size: 21px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.v3-note { font-size: 12.5px; color: var(--text-3); line-height: 1.7; margin: 8px 0 16px; }
.v3-kicker { font-size: 11.5px; letter-spacing: .1em; color: var(--text-3); text-transform: uppercase; font-weight: 700; margin-bottom: 8px; }
@media (max-width: 720px) {
  .tool-grid, .tool-grid.v3 { grid-template-columns: 1fr; }
  .v3-inline { grid-template-columns: 1fr; }
  .cmp-row { grid-template-columns: 96px 1fr 92px; }
  .v3-final { grid-template-columns: 1fr; }
}

/* ---------- 企业诊断（全案 / 分模块） ---------- */
.df-scope { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.df-scope button {
  padding: 7px 12px; border: 1px solid #D5DCE6; background: #fff; border-radius: 999px;
  font-size: 12.5px; color: var(--text-2); cursor: pointer; transition: all .16s ease;
}
.df-scope button:hover { border-color: var(--ink); color: var(--ink); }
.df-scope button.is-on { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }

.df-mod { margin-bottom: 22px; }
.df-mod-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.df-mod-tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 600;
  background: rgba(5,28,44,.06); color: var(--ink); letter-spacing: .04em;
}
.df-mod-h h4 { font-size: 14px; font-weight: 700; color: var(--ink); margin: 0; }

.df-dim { border-top: 1px solid #EEF1F6; padding: 12px 0 4px; }
.df-dim-h { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.df-dim-h b { font-size: 11.5px; color: #8A94A6; font-weight: 700; letter-spacing: .04em; }
.df-w { margin-left: auto; font-size: 11.5px; color: #98A2B3; font-weight: 500; }

.df-bars { display: flex; flex-direction: column; gap: 14px; }
.df-bar-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--ink); }
.df-bar-h b { font-variant-numeric: tabular-nums; }
.df-track { height: 8px; background: #EEF1F6; border-radius: 999px; overflow: hidden; margin: 6px 0 4px; }
.df-track i { display: block; height: 100%; border-radius: 999px; transition: width .3s ease; }
.df-track i.bg-green { background: #1B7F4D; }
.df-track i.bg-amber { background: #C08A20; }
.df-track i.bg-red { background: #B4443C; }
.df-track i.bg-none { background: #CBD3DF; }
.df-bar p { font-size: 11.5px; color: #98A2B3; margin: 0; line-height: 1.6; }

.cell-green { color: #1B7F4D; font-weight: 600; }
.cell-amber { color: #A97716; font-weight: 600; }
.cell-red { color: #B4443C; font-weight: 600; }

@media (max-width: 720px) {
  .df-scope button { flex: 1 1 auto; text-align: center; }
}
