:root {
  /* 配色对齐 ECharts 主题 metrics/v5.json：主蓝 #5470c6 / 绿 #3ba272 / 黄 #fac858 / 红 #ee6666 / 文字灰 #6E7079 / 边框 #E0E6F1 */
  --bg: #ffffff;
  --bg-soft: #f5f7fb;
  --bg-sub: #fafbfd;
  --border: #E0E6F1;
  --border-strong: #A4B1D7;
  --text: #1f2329;
  --text-dim: #6E7079;
  --text-faint: #9aa0ad;
  --accent: #5470c6;
  --accent-soft: #eef1fb;
  --success: #3ba272; --success-bg: #e9f6ef;
  --partial: #c8881a; --partial-bg: #fdf3e0;
  --failed: #e1564f;  --failed-bg: #fcecec;
  --notrun: #A4B1D7;  --notrun-bg: #eef1f7;
  --unknown:#c7ccd6;  --unknown-bg:#f2f4f8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-md: 0 4px 16px -4px rgba(16,24,40,.12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.header-inner { max-width: 1280px; margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo { font-weight: 800; font-size: 17px; padding: 9px 13px; border-radius: 10px; background: linear-gradient(135deg, #5470c6, #73c0de); color: #fff; }
.brand-text h1 { margin: 0; font-size: 20px; font-weight: 700; }
.brand-text p { margin: 2px 0 0; color: var(--text-dim); font-size: 12.5px; }
.header-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.gen-at { color: var(--text-faint); font-size: 12px; }
.repo-link { color: var(--text-dim); font-size: 12.5px; }

/* Controls */
.controls { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.controls-inner { max-width: 1280px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.control-group { display: flex; align-items: center; gap: 9px; }
.control-group.grow { flex: 1; justify-content: flex-end; min-width: 160px; }
.control-group > label { color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.select { appearance: none; background: var(--bg); color: var(--text); border: 1px solid var(--border-strong); border-radius: 9px; padding: 7px 32px 7px 11px; font-size: 13.5px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%235b6472' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.select:hover { border-color: var(--accent); }
.tabs, .chips { display: flex; gap: 3px; background: var(--bg-soft); padding: 3px; border-radius: 9px; border: 1px solid var(--border); }
.tab, .chip { border: 0; background: transparent; color: var(--text-dim); padding: 6px 13px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 500; }
.tab:hover, .chip:hover { color: var(--text); }
.tab.active { background: var(--accent); color: #fff; }
.chip.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.chip[data-result="success"].active { color: var(--success); }
.chip[data-result="partial"].active { color: var(--partial); }
.chip[data-result="failed"].active { color: var(--failed); }
.search { background: var(--bg); border: 1px solid var(--border-strong); color: var(--text); border-radius: 9px; padding: 7px 12px; font-size: 13.5px; width: 100%; max-width: 260px; }
.search:focus { outline: none; border-color: var(--accent); }

.container { max-width: 1280px; margin: 0 auto; padding: 26px 24px 70px; }

/* Stats dashboard */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 30px; }
.stat { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 17px; box-shadow: var(--shadow); }
.stat .v { font-size: 25px; font-weight: 750; letter-spacing: -.5px; }
.stat .v small { font-size: 14px; font-weight: 600; color: var(--text-faint); }
.stat .k { color: var(--text-dim); font-size: 12px; margin-top: 3px; }
.stat .sub { margin-top: 7px; font-size: 11.5px; color: var(--text-faint); display: flex; gap: 8px; flex-wrap: wrap; }
.stat .sub b { font-weight: 600; }
.s-succ { color: var(--success); } .s-part { color: var(--partial); } .s-fail { color: var(--failed); }

/* Scenario block */
.scenario-block { margin-bottom: 38px; }
.scenario-head { display: flex; align-items: baseline; gap: 11px; margin: 0 0 4px; padding-bottom: 8px; border-bottom: 2px solid var(--text); }
.scenario-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.scenario-head .pill { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.scenario-head .legend { margin-left: auto; color: var(--text-faint); font-size: 12px; }

/* Community group */
.community { margin-top: 20px; }
.community-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.community-head .name { font-size: 14.5px; font-weight: 700; }
.community-head .count { color: var(--text-faint); font-size: 12px; }
.community-head .mini { margin-left: auto; font-size: 12px; color: var(--text-faint); }

/* Table */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--bg); }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
thead th { background: var(--bg-soft); color: var(--text-dim); font-weight: 600; text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 12px; }
thead th.num, tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody td { padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--accent-soft); }
tbody tr:last-child td { border-bottom: 0; }
.ctbl { table-layout: fixed; }
.ctbl td, .ctbl th { overflow: hidden; text-overflow: ellipsis; }
.repo-cell { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.repo-cell .scn { display: block; font-weight: 400; color: var(--text-faint); font-size: 11px; margin-top: 1px; }
.phase-cell { font-variant-numeric: tabular-nums; }
.phase-cell .m { font-weight: 600; }
.phase-cell .m.zero { color: var(--text-faint); font-weight: 400; }
.phase-cell::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: var(--unknown); }
.phase-cell.success::before { background: var(--success); }
.phase-cell.partial::before { background: var(--partial); }
.phase-cell.failed::before  { background: var(--failed); }
.phase-cell.not_run::before { background: var(--notrun); }

.badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge.success { color: var(--success); background: var(--success-bg); }
.badge.partial { color: var(--partial); background: var(--partial-bg); }
.badge.failed  { color: var(--failed);  background: var(--failed-bg); }
.badge.unknown { color: var(--text-dim); background: var(--unknown-bg); }
.badge.not_run { color: var(--notrun); background: var(--notrun-bg); }
.ut-pass { color: var(--success); font-weight: 600; }
.ut-fail { color: var(--failed); font-weight: 600; }
.defect-n { color: var(--partial); font-weight: 600; }
.link-arrow { color: var(--text-faint); }

.empty { text-align: center; color: var(--text-dim); padding: 60px 0; }

/* Detail page */
.detail { max-width: 1000px; margin: 0 auto; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; font-size: 13.5px; }
.detail-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.detail-head .dh-id h1 { margin: 0; font-size: 24px; }
.detail-head .dh-id .meta { color: var(--text-dim); font-size: 13px; margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; }
.detail-head .dh-id .meta .cm { font-weight: 600; color: var(--text); }
.detail-head .spacer { flex: 1; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 24px; }
.dcard { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; background: var(--bg); box-shadow: var(--shadow); }
.dcard h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-faint); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--text-dim); } .kv .val { font-weight: 600; text-align: right; word-break: break-word; }
.codeblock { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; white-space: pre-wrap; word-break: break-all; color: #2a3550; margin-top: 6px; }
.errblock { background: var(--failed-bg); border-color: #f3c9c9; color: #8a2b2b; }

/* phase timeline (detail) */
.timeline { display: flex; flex-direction: column; gap: 8px; }
.tl-row { display: grid; grid-template-columns: 110px 70px 1fr; align-items: center; gap: 12px; }
.tl-row .tl-name { font-weight: 600; font-size: 13px; }
.tl-row .tl-min { font-variant-numeric: tabular-nums; color: var(--text-dim); font-size: 13px; }
.tl-bar { height: 8px; border-radius: 4px; background: var(--bg-soft); overflow: hidden; }
.tl-bar > i { display: block; height: 100%; border-radius: 4px; }
.bar-success { background: var(--success); } .bar-partial { background: var(--partial); } .bar-failed { background: var(--failed); } .bar-not_run, .bar-unknown { background: var(--notrun); }

.section { margin-bottom: 26px; }
.section > h2 { font-size: 15px; margin: 0 0 12px; }
.dtable { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.dtable th { background: var(--bg-soft); text-align: left; padding: 8px 12px; font-size: 12px; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.dtable td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; white-space: normal; word-break: break-word; overflow-wrap: anywhere; }
.dtable tr:last-child td { border-bottom: 0; }
.lvl { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.lvl-重要 { color: var(--failed); background: var(--failed-bg); }
.lvl-一般 { color: var(--partial); background: var(--partial-bg); }
.lvl-提示 { color: var(--text-dim); background: var(--unknown-bg); }
.history-list { display: flex; flex-direction: column; gap: 6px; }
.hist { display: grid; grid-template-columns: 90px 60px 1fr 90px; gap: 12px; align-items: center; padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; cursor: pointer; }
.hist:hover { background: var(--accent-soft); }
.summary-text { background: var(--bg-soft); border-left: 3px solid var(--accent); padding: 12px 16px; border-radius: 0 8px 8px 0; color: var(--text-dim); font-size: 13.5px; }

.site-footer { border-top: 1px solid var(--border); }
.site-footer p { max-width: 1280px; margin: 0 auto; padding: 18px 24px; color: var(--text-faint); font-size: 12px; }
code { background: var(--bg-soft); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
@media (max-width: 640px) { .control-group.grow { justify-content: flex-start; } .header-meta { align-items: flex-start; } }

/* ── icons ── */
.ico { vertical-align: -2px; color: var(--text-faint); flex-shrink: 0; }
.stat-h { display: flex; align-items: center; gap: 7px; color: var(--text-dim); }
.stat-h .ico { color: var(--accent); }
.stat-h .k { font-size: 12px; }
.stat .stat-h + .v { margin-top: 6px; }
.scenario-head h2 .ico, .section > h2 .ico, .chart-card h3 .ico, .dcard h3 .ico { color: var(--accent); }
.community-head .mini .s-succ, .community-head .mini .s-part, .community-head .mini .s-fail { font-size: 9px; }

/* ── charts ── */
.charts { display: grid; grid-template-columns: minmax(190px, 0.85fr) 1.5fr 1.5fr; align-items: start; gap: 16px; margin-bottom: 30px; }
.chart-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.chart-card h3 { margin: 0 0 14px; font-size: 13px; font-weight: 600; color: var(--text-dim); display: flex; align-items: center; gap: 7px; }
.donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut-legend { display: flex; flex-direction: column; gap: 7px; }
.donut-legend .lg { font-size: 12.5px; color: var(--text-dim); display: flex; align-items: center; gap: 7px; }
.donut-legend .lg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.donut-legend .lg b { color: var(--text); margin-left: 2px; }
.hbars, .pbars { display: flex; flex-direction: column; gap: 7px; }
.hbar { display: grid; grid-template-columns: 92px 1fr 56px; align-items: center; gap: 10px; cursor: pointer; font-size: 12.5px; }
.hbar:hover .hbar-l { color: var(--accent); }
.hbar-l { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track, .pbar-track { height: 14px; background: var(--bg-soft); border-radius: 4px; overflow: hidden; }
.hbar-track > i, .pbar-track > i { display: block; height: 100%; border-radius: 4px; }
.hbar-v { text-align: right; color: var(--text); font-weight: 600; } .hbar-v small, .pbar-v small { color: var(--text-faint); font-weight: 400; }
.pbar-row { display: grid; grid-template-columns: 92px 1fr 56px; align-items: center; gap: 10px; font-size: 12.5px; }
.pbar-l { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbar-v { text-align: right; font-weight: 600; }

/* ── detail extras ── */
.badge.big { font-size: 13px; padding: 6px 14px; }
.dcard h3 { display: flex; align-items: center; gap: 7px; }
.detail-head .dh-id h1 { display: flex; align-items: center; gap: 8px; }
.dtable .src { color: var(--text-faint); font-size: 12px; }
.timeline .tl-row { grid-template-columns: 96px 64px 1fr 72px; }
.timeline .tl-row .ci-pr { grid-column: 2 / -1; justify-self: start; margin-top: 2px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--accent, #2f6feb); text-decoration: none; }
.timeline .tl-row .ci-pr:hover { text-decoration: underline; }
.ci-verdict { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius); font-size: 13px; line-height: 1.6; }
.ci-verdict.ok { background: rgba(46, 160, 67, 0.12); border: 1px solid rgba(46, 160, 67, 0.4); }
.log-list { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.log-row { display: flex; gap: 11px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.log-row:last-child { border-bottom: 0; }
.log-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--notrun); }
.log-row.ok .log-dot { background: var(--success); } .log-row.bad .log-dot { background: var(--failed); }
.log-body { min-width: 0; flex: 1; }
.log-step { font-weight: 600; font-size: 13px; }
.log-cmd { display: block; font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: #2a3550; background: var(--bg-soft); padding: 4px 8px; border-radius: 6px; margin: 4px 0; word-break: break-all; }
.log-out { font-size: 12px; color: var(--text-dim); word-break: break-word; }
@media (max-width: 900px) { .charts { grid-template-columns: 1fr; } }

/* ── full report (rendered markdown / json) ── */
.full-report { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; background: var(--bg); }
.full-report .md-h { margin: 16px 0 8px; line-height: 1.3; }
.full-report h1.md-h { font-size: 19px; } .full-report h2.md-h { font-size: 16px; border-bottom: 1px solid var(--border); padding-bottom: 5px; }
.full-report h3.md-h { font-size: 14px; } .full-report h4.md-h { font-size: 13px; color: var(--text-dim); }
.full-report .md-p { margin: 7px 0; color: var(--text); font-size: 13.5px; line-height: 1.7; }
.full-report .md-ul, .full-report .md-ol { margin: 7px 0; padding-left: 22px; }
.full-report .md-ul li, .full-report .md-ol li { margin: 4px 0; font-size: 13.5px; line-height: 1.65; }
.full-report .md-q { margin: 8px 0; padding: 6px 14px; border-left: 3px solid var(--accent); background: var(--bg-soft); color: var(--text-dim); border-radius: 0 6px 6px 0; }
.full-report .md-code { background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 8px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; overflow-x: auto; line-height: 1.5; }
.full-report .md-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 12.5px; }
.full-report .md-table th, .full-report .md-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.full-report .md-table th { background: var(--bg-soft); }
.full-report code { background: var(--bg-soft); padding: 1px 5px; border-radius: 4px; font-size: 12px; color: #b4317a; }
.full-report hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.full-report .json-dump { font-family: ui-monospace, Consolas, monospace; font-size: 12px; white-space: pre; color: #1f2d3d; margin: 0; }
.dtable td strong { color: var(--failed); }

/* defect jump-to-report + hints */
.section > h2 .hint, .chart-card h3 .hint { font-size: 11px; font-weight: 400; color: var(--text-faint); margin-left: 8px; }
tr.jumpable { cursor: pointer; }
tr.jumpable:hover { background: var(--accent-soft); }
tr.jumpable td:first-child::after { content: " ↓"; color: var(--accent); font-size: 11px; }
.full-report .md-h.flash { background: #fff7d6; transition: background .4s; border-radius: 6px; padding: 2px 6px; }
.lvl-严重 { color: #fff; background: var(--failed); }

/* ECharts 容器 */
.echart { width: 100%; height: 300px; }
.charts .chart-card { display: flex; flex-direction: column; }
.echart.tall { height: 300px; }

/* ── 底部 TTFHW issue 表 ── */
.issues-section { margin-top: 40px; padding-top: 24px; border-top: 2px solid var(--text); }
.issues-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.issues-head h2 { margin: 0; font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.issues-filter { display: flex; align-items: center; gap: 7px; }
.issues-filter label { color: var(--text-dim); font-size: 12.5px; font-weight: 600; }
.issues-filter .select { height: 30px; padding: 0 26px 0 10px; font-size: 12.5px; }
.issues-meta { color: var(--text-faint); font-size: 12.5px; margin-left: auto; }
.issues-section table { min-width: 880px; }
.issues-section .issue-title a { font-weight: 600; }
.issues-section .issue-plat { display: block; color: var(--text-faint); font-size: 11px; margin-top: 1px; font-variant-numeric: tabular-nums; }
.issues-section .issue-sym { white-space: normal; max-width: 340px; color: var(--text-dim); font-size: 12.5px; }
.issues-section .issue-src { white-space: normal; max-width: 200px; color: var(--text-faint); font-size: 12px; word-break: break-all; }
.issues-section td { vertical-align: top; }
.issues-section .issue-cr { white-space: nowrap; }
.issues-section .issue-comm { font-weight: 600; color: var(--text); }
.issues-section .issue-sep { color: var(--text-faint); margin: 0 2px; }
.issues-section .issue-repo { color: var(--text-dim); }
.empty.mini { padding: 28px 8px; font-size: 12.5px; color: var(--text-faint); text-align: center; }
.issues-section .lvl-严重 { color: #fff; background: var(--failed); }
