  :root{
    --bg:#f4f6fa; --card:#ffffff; --line:#e3e8f0; --text:#1b2434; --muted:#7a8699;
    --accent:#2563eb; --accent-soft:#eef4ff; --good:#0f9d58; --warn:#d97706; --bad:#dc2626;
    --mono:"SFMono-Regular",Consolas,"Liberation Mono",Menlo,monospace;
  }
  *{box-sizing:border-box}
  body{
    margin:0; background:var(--bg); color:var(--text);
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
    font-size:14px; line-height:1.6;
  }
  header{background:linear-gradient(120deg,#1e3a8a,#2563eb 60%,#3b82f6); color:#fff; padding:26px 28px 24px}
  header h1{margin:0 0 6px; font-size:21px; letter-spacing:.5px}
  header p{margin:0; opacity:.85; font-size:13px}
  .wrap{max-width:1400px; margin:0 auto; padding:22px 20px 60px}
  .layout{display:grid; grid-template-columns:400px minmax(0,1fr); gap:20px; align-items:start}
  @media(max-width:1120px){ .layout{grid-template-columns:1fr} }

  .card{background:var(--card); border:1px solid var(--line); border-radius:12px; margin-bottom:18px; overflow:hidden}
  .card > h2{
    margin:0; padding:13px 18px; font-size:14px; font-weight:600;
    background:#fafbfe; border-bottom:1px solid var(--line); color:#334155;
    display:flex; align-items:center; gap:8px;
  }
  .card > h2 .dot{width:7px;height:7px;border-radius:50%;background:var(--accent); flex:none}
  .card .body{padding:16px 18px}

  .field{margin-bottom:13px}
  .field:last-child{margin-bottom:0}
  .field label{display:flex; justify-content:space-between; align-items:baseline; gap:8px; margin-bottom:5px}
  .field .name{font-size:13px; color:#374151; font-weight:500}
  .field .unit{font-size:11px; color:var(--muted); flex:none}
  .field input{
    width:100%; padding:8px 11px; font-size:14px; font-family:var(--mono);
    border:1px solid var(--line); border-radius:8px; background:#fcfdff; color:var(--text);
    transition:border-color .15s, box-shadow .15s;
  }
  .field input:focus{outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); background:#fff}
  .field .hint{font-size:11px; color:var(--muted); margin-top:3px}
  .field.hero input{border-color:#bfdbfe; background:#f8fbff}

  .kpis{display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:12px; margin-bottom:18px}
  .kpi{border:1px solid var(--line); border-radius:10px; padding:13px 14px; background:#fcfdff}
  .kpi .k-label{font-size:11.5px; color:var(--muted); margin-bottom:5px}
  .kpi .k-value{font-size:20px; font-weight:700; font-family:var(--mono); letter-spacing:-.5px}
  .kpi .k-sub{font-size:11px; color:var(--muted); margin-top:3px}
  .kpi.primary{background:linear-gradient(140deg,#eff6ff,#ffffff); border-color:#bfdbfe}
  .kpi.primary .k-value{font-size:23px}
  .pos{color:var(--good)} .neg{color:var(--bad)}

  .steps{border:1px solid var(--line); border-radius:10px; overflow:hidden}
  .group-head{background:#f1f5f9; padding:8px 14px; font-size:12px; font-weight:600; color:#475569; border-bottom:1px solid var(--line)}
  .step{display:grid; grid-template-columns:210px minmax(0,1fr) 138px; gap:14px; padding:10px 14px; border-bottom:1px solid #f1f5f9; align-items:baseline}
  .step:last-child{border-bottom:none}
  .step .s-name{font-size:12.5px; color:#334155; font-weight:500}
  .step .s-formula{font-family:var(--mono); font-size:11.5px; color:#64748b; word-break:break-word; line-height:1.7}
  .step .s-formula b{color:#1e40af; font-weight:600}
  .step .s-value{font-family:var(--mono); font-size:13px; font-weight:700; text-align:right; white-space:nowrap}
  .step.key{background:#f8fbff}
  .step.key .s-value{font-size:14.5px}
  @media(max-width:760px){
    .step{grid-template-columns:1fr; gap:4px}
    .step .s-value{text-align:left}
  }

  .verdict{border-radius:10px; padding:14px 16px; font-size:13px; margin-bottom:18px; border:1px solid; display:flex; gap:11px; line-height:1.75}
  .verdict.good{background:#f0fdf4; border-color:#bbf7d0; color:#166534}
  .verdict.warn{background:#fffbeb; border-color:#fde68a; color:#92400e}
  .verdict.bad{background:#fef2f2; border-color:#fecaca; color:#991b1b}
  .verdict .v-icon{font-size:17px; line-height:1.4; flex:none; font-weight:700}
  .verdict b{font-weight:700}
  .verdict .fix{margin-top:8px; padding-top:8px; border-top:1px dashed currentColor; opacity:.9; font-size:12.5px}

  table{width:100%; border-collapse:collapse; font-size:12.5px}
  th,td{padding:8px 10px; text-align:right; border-bottom:1px solid #f1f5f9; font-family:var(--mono)}
  th{background:#f8fafc; color:#475569; font-weight:600; font-family:inherit; font-size:12px; white-space:nowrap}
  th:first-child, td:first-child{text-align:left}
  tbody tr:hover{background:#f8fbff}
  td.pos{color:var(--good); font-weight:600}
  td.neg{color:var(--bad); font-weight:600}
  .tbl-note{font-size:11.5px; color:var(--muted); margin:10px 0 0; line-height:1.7}

  .note{font-size:12px; color:var(--muted); line-height:1.9}
  .note code{font-family:var(--mono); background:#f1f5f9; padding:1px 5px; border-radius:4px; color:#334155; font-size:11.5px}
  details{border:1px solid var(--line); border-radius:10px; overflow:hidden}
  details summary{cursor:pointer; padding:11px 16px; font-size:13px; font-weight:600; color:#334155; background:#fafbfe; list-style:none}
  details summary::-webkit-details-marker{display:none}
  details summary::before{content:"▸ "; color:var(--accent)}
  details[open] summary::before{content:"▾ "}
  details .d-body{padding:14px 18px; border-top:1px solid var(--line)}
  /* ---- 图表 ----
     配色只用一条序列色（--accent 蓝，已过色板校验：#2563eb 对白底 5.17:1，
     亮度带/彩度/对比度全过）。当前值、最优点、亏损带都是「标注」而不是第二条序列，
     所以用文字墨色与参考带，不引入第二个类别色 —— 单序列也就不需要图例。 */
  .chart-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(340px,1fr)); gap:22px}
  .chart-fig{margin:0}
  .chart-fig figcaption{display:flex; flex-direction:column; gap:1px; margin-bottom:8px}
  .chart-fig .fig-title{font-size:13px; font-weight:600; color:#334155}
  .chart-fig .fig-sub{font-size:11.5px; color:var(--muted)}
  .chart-wrap{position:relative}
  .chart-wrap svg{display:block; width:100%; height:auto; touch-action:none}
  .chart-wrap svg:focus-visible{outline:2px solid var(--accent); outline-offset:2px; border-radius:6px}
  .chart-tip{
    position:absolute; top:0; left:0; z-index:5; pointer-events:none; opacity:0;
    transform:translate(-50%,-100%); transition:opacity .1s;
    background:#fff; border:1px solid var(--line); border-radius:8px;
    box-shadow:0 4px 14px rgba(27,36,52,.12); padding:8px 11px; min-width:132px;
  }
  .chart-tip.on{opacity:1}
  .chart-tip .t-x{font-size:11px; color:var(--muted); margin-bottom:5px}
  .chart-tip .t-row{display:flex; align-items:baseline; gap:8px; justify-content:space-between; font-size:12px}
  .chart-tip .t-row .k{color:var(--muted); font-size:11px}
  .chart-tip .t-row .v{font-family:var(--mono); font-weight:600}
  .advice{
    border:1px solid #bfdbfe; background:linear-gradient(140deg,#f2f7ff,#fff);
    border-radius:10px; padding:13px 16px; margin-bottom:18px; font-size:13px; line-height:1.85;
  }
  .advice .adv-head{font-size:12px; color:var(--muted); margin-bottom:7px}
  .advice .adv-steps{display:grid; gap:7px}
  .advice .adv-step{display:flex; align-items:baseline; gap:9px; flex-wrap:wrap}
  .advice .adv-i{
    flex:none; width:18px; height:18px; border-radius:50%; background:var(--accent); color:#fff;
    font-size:11px; font-weight:700; display:inline-flex; align-items:center; justify-content:center;
    font-family:var(--mono); position:relative; top:2px;
  }
  .advice .adv-was{color:var(--muted); font-family:var(--mono); font-size:12px}
  .advice .adv-arrow{color:var(--accent); font-weight:700}
  .advice .adv-now{font-family:var(--mono); font-weight:700; font-size:14px}
  .advice .adv-note{margin-top:9px; padding-top:9px; border-top:1px dashed #bfdbfe; font-size:12px; color:#475569}
  @media print{ .chart-tip{display:none} }

  .toolbar{display:flex; gap:10px; margin-bottom:14px}
  .btn{padding:7px 14px; font-size:12.5px; border-radius:8px; border:1px solid var(--line); background:#fff; color:#475569; cursor:pointer; font-family:inherit}
  .btn:hover{border-color:var(--accent); color:var(--accent)}
