:root {
  --ink: #15242a;
  --muted: #68777d;
  --line: #dce5e5;
  --paper: #fff;
  --soft: #f2f6f5;
  --deep: #113a41;
  --teal: #087d74;
  --green: #20764e;
  --green-soft: #e8f5ed;
  --red: #b23d38;
  --red-soft: #fbecea;
  --amber: #916414;
  --amber-soft: #fff4d8;
  --blue: #315d91;
  --blue-soft: #eaf1f8;
  --shadow: 0 16px 44px rgba(16, 52, 58, .08);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--soft); font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif; }
.header-inner, main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.manual-header { color: white; background: radial-gradient(circle at 85% 15%, rgba(89, 215, 189, .18), transparent 30%), linear-gradient(135deg, #102f37, #185158); }
.header-inner { padding: 27px 0 33px; }
.header-links { display: flex; gap: 18px; }
.header-links a { color: rgba(255,255,255,.78); font-size: 14px; text-decoration: none; }
.header-links a:hover { color: white; }
.eyebrow { margin: 34px 0 9px; color: #80e0cf; font-size: 12px; font-weight: 800; letter-spacing: .15em; }
.headline-row { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
h1 { margin: 0; font-size: clamp(34px, 6vw, 58px); line-height: 1.05; letter-spacing: -.04em; }
.headline-row p { max-width: 700px; margin: 13px 0 0; color: rgba(255,255,255,.72); line-height: 1.65; }
.overall-badge { flex: 0 0 auto; padding: 10px 15px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; font-size: 14px; font-weight: 800; }
.overall-badge.done { color: #a9efd0; background: rgba(32, 118, 78, .22); }
.overall-badge.has-failure { color: #ffc2bd; background: rgba(178, 61, 56, .22); }
.summary-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 26px; }
.summary-card { padding: 14px 16px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.13); border-radius: 11px; }
.summary-card span { display: block; color: rgba(255,255,255,.65); font-size: 12px; }
.summary-card strong { display: block; margin-top: 5px; font-size: 24px; }
.storage-note { margin: 13px 0 0; color: rgba(255,255,255,.62); font-size: 12px; }
main { padding: 26px 0 58px; }
.session-guide { padding: 18px 21px; background: #eaf3f1; border: 1px solid #c9ded9; border-radius: 13px; }
.session-guide h2 { margin: 0 0 9px; font-size: 17px; }
.session-guide ol { margin: 0; padding-left: 22px; color: #40545a; font-size: 14px; line-height: 1.7; }
.session-guide code { padding: 2px 5px; background: rgba(255,255,255,.7); border-radius: 4px; }
.controls { position: sticky; top: 10px; z-index: 8; display: grid; grid-template-columns: minmax(280px, 1fr) 190px 160px auto; align-items: end; gap: 12px; margin-top: 18px; padding: 14px; background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.controls label span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 750; }
.controls input, .controls select, .case-notes { width: 100%; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; font: inherit; }
.controls input, .controls select { min-height: 42px; padding: 0 11px; }
.controls input:focus, .controls select:focus, .case-notes:focus { outline: 3px solid rgba(8,125,116,.13); border-color: var(--teal); }
.control-actions { display: flex; gap: 7px; }
button { min-height: 40px; padding: 0 12px; color: white; background: var(--deep); border: 1px solid var(--deep); border-radius: 8px; font: inherit; font-size: 13px; font-weight: 750; cursor: pointer; }
button:hover { filter: brightness(1.06); }
.danger-outline { color: var(--red); background: white; border-color: #e4b9b6; }
.visible-count { margin: 22px 2px 10px; color: var(--muted); font-size: 13px; }
.case-list { display: grid; gap: 12px; }
.case-card { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 5px 18px rgba(15,53,60,.04); }
.case-card.status-passed { border-left: 5px solid var(--green); }
.case-card.status-failed { border-left: 5px solid var(--red); }
.case-card.status-blocked { border-left: 5px solid var(--amber); }
.case-heading { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px; padding: 17px 19px 15px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag { display: inline-flex; padding: 4px 7px; color: #52636a; background: #f0f4f3; border-radius: 5px; font-size: 11px; font-weight: 750; }
.tag.id { color: white; background: var(--teal); letter-spacing: .04em; }
.tag.security { color: var(--red); background: var(--red-soft); }
.tag.change { color: var(--amber); background: var(--amber-soft); }
.case-heading h2 { margin: 0; font-size: 17px; line-height: 1.45; }
.scenario-name { margin: 0 0 7px; color: var(--muted); font-size: 12px; }
.actor { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.case-time { color: var(--muted); font-size: 11px; text-align: right; white-space: nowrap; }
.case-details { border-top: 1px solid var(--line); }
.case-details summary { padding: 11px 19px; color: var(--deep); background: #f8faf9; font-size: 13px; font-weight: 800; cursor: pointer; }
.case-content { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 16px 19px 19px; }
.case-section { min-width: 0; padding: 13px 14px; background: #f7faf9; border-radius: 9px; }
.case-section h3 { margin: 0 0 8px; color: var(--deep); font-size: 13px; }
.case-section ol, .case-section ul { margin: 0; padding-left: 21px; color: #405159; font-size: 13px; line-height: 1.65; }
.criterion-box { padding: 13px 14px; border-radius: 9px; font-size: 13px; line-height: 1.65; }
.criterion-box h3 { margin: 0 0 6px; font-size: 13px; }
.criterion-box p { margin: 0; }
.criterion-box.pass { color: #24553d; background: var(--green-soft); border: 1px solid #cce8d7; }
.criterion-box.fail { color: #763632; background: var(--red-soft); border: 1px solid #f0cfcc; }
.case-result { display: grid; grid-template-columns: auto minmax(220px, 1fr); gap: 14px; align-items: start; padding: 14px 19px 18px; border-top: 1px solid var(--line); }
.status-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.status-actions button { color: #53636a; background: white; border-color: var(--line); }
.status-actions button[data-result="passed"].active { color: var(--green); background: var(--green-soft); border-color: #aed8be; }
.status-actions button[data-result="failed"].active { color: var(--red); background: var(--red-soft); border-color: #e8b7b3; }
.status-actions button[data-result="blocked"].active { color: var(--amber); background: var(--amber-soft); border-color: #ead18e; }
.status-actions button[data-result="untested"].active { color: var(--blue); background: var(--blue-soft); border-color: #b9cee3; }
.notes-wrap span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 750; }
.case-notes { min-height: 68px; padding: 9px 10px; resize: vertical; line-height: 1.45; }
.empty { padding: 48px 20px; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 12px; text-align: center; }
footer { padding: 21px; color: var(--muted); border-top: 1px solid var(--line); text-align: center; font-size: 12px; }

@media (max-width: 900px) {
  .controls { position: static; grid-template-columns: 1fr 1fr; }
  .search-field, .control-actions { grid-column: 1 / -1; }
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 650px) {
  .header-inner, main { width: min(100% - 24px, 1180px); }
  .headline-row, .case-heading { grid-template-columns: 1fr; align-items: start; }
  .overall-badge { justify-self: start; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .controls { grid-template-columns: 1fr; }
  .search-field, .control-actions { grid-column: auto; }
  .control-actions { flex-direction: column; }
  .case-content, .case-result { grid-template-columns: 1fr; }
  .case-time { text-align: left; }
}
@media print {
  .controls, .status-actions, .notes-wrap, footer { display: none; }
  body { background: white; }
  .manual-header { color: black; background: white; }
  .headline-row p, .storage-note, .header-links a, .eyebrow { color: #444; }
  .case-details:not([open]) .case-content { display: grid; }
  .case-card { break-inside: avoid; box-shadow: none; }
}
