/* 轉次方 網站健檢器 — Design Tokens 依 PRD 3.1 */
:root {
  --brand-yellow: #FFC94D;
  --brand-yellow-light: #FFE9B8;
  --brand-brown: #5B3A21;
  --brand-brown-soft: #8A6647;
  --brand-cream: #FFF8EC;
  --brand-cream-2: #FFF1DA;
  --line: #F3E3C8;
  --brand-orange: #FF7A45;
  --button-shadow: #E5A92E;
  --sev-fail: #C2410C; --sev-fail-bg: #FFE4D6;
  --sev-warn: #8A5A00; --sev-warn-bg: #FFF0C2;
  --sev-pass: #1F6F53; --sev-pass-bg: #DDF3EA;
  --sev-na: #6B5A4A;   --sev-na-bg: #F1EAE0;
  --tag-seo: #1F6F53;
  --tag-geo: #B4441A;
  --tag-shop: #2F55B5;
  --info-bg: #EAF0FF; --info-line: #C9D6FA;
  --white: #fff;
  --shadow-card: 0 10px 30px rgba(91, 58, 33, .08);
  --r-xl: 28px; --r-lg: 24px; --r-md: 22px; --r-row: 18px; --r-pill: 999px;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-num: "Baloo 2", "Noto Sans TC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar-w: 256px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--brand-brown);
  background: var(--brand-cream);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--brand-brown); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.num { font-family: var(--font-num); font-weight: 800; letter-spacing: .01em; }
.mono { font-family: var(--font-mono); font-size: 13px; word-break: break-all; }

/* ---------- 版面 ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--white); border-right: 1px solid var(--line);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 0 6px; }
.brand img { width: 46px; height: 46px; object-fit: contain; }
.brand b { display: block; font-size: 18px; font-weight: 900; line-height: 1.2; }
.brand small { display: block; font-size: 12px; color: var(--brand-brown-soft); font-weight: 500; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-label { font-size: 12px; font-weight: 700; color: var(--brand-brown-soft); padding: 10px 10px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px;
  border-radius: 14px; text-decoration: none; font-weight: 700; font-size: 14px; border: 0; background: none; text-align: left; cursor: pointer;
}
.nav-item:hover { background: var(--brand-cream-2); }
.nav-item[aria-current="page"] { background: var(--brand-yellow); }
.nav-item[aria-disabled="true"] { color: var(--brand-brown-soft); cursor: default; }
.nav-item[aria-disabled="true"]:hover { background: none; }
.nav-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; }
.nav-ico .icon { width: 17px; height: 17px; }
.nav-item .soon { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--brand-brown-soft); background: var(--brand-cream-2); border-radius: var(--r-pill); padding: 1px 8px; }
.plan-card { margin-top: auto; background: var(--brand-cream); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: grid; grid-template-columns: 1fr 76px; gap: 4px 8px; align-items: center; }
.plan-card img { width: 76px; height: 76px; object-fit: contain; grid-row: span 3; }
.plan-card b { font-size: 14px; font-weight: 900; }
.plan-card small { font-size: 12px; color: var(--brand-brown-soft); }
.meter { height: 8px; background: var(--brand-cream-2); border-radius: var(--r-pill); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--brand-yellow); border-radius: inherit; }

.topbar { display: none; }
.main { padding: 28px 36px 48px; min-width: 0; }

/* ---------- 頁首 ---------- */
.crumbs { font-size: 13px; color: var(--brand-brown-soft); display: flex; gap: 6px; align-items: center; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin: 8px 0 22px; }
.head-title { display: flex; align-items: center; gap: 12px; }
.head-title img { width: 50px; height: 50px; object-fit: contain; }
h1.page-title { font-size: 28px; font-weight: 900; margin: 0; line-height: 1.25; }
.subtitle { margin: 2px 0 0; font-size: 13px; color: var(--brand-brown-soft); }
.head-tools { display: flex; gap: 8px; align-items: center; }

.url-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; width: 100%; }
.url-input {
  flex: 1 1 320px; min-width: 0; display: flex; align-items: center; gap: 8px; background: var(--white);
  border: 2px solid var(--line); border-radius: var(--r-pill); padding: 0 8px 0 18px; min-height: 52px;
}
.url-input:focus-within { border-color: var(--brand-brown); }
.url-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-family: var(--font-mono); font-size: 14px; padding: 12px 0; }
.url-input select { border: 0; background: var(--brand-cream-2); border-radius: var(--r-pill); padding: 6px 10px; font-size: 13px; font-weight: 700; cursor: pointer; }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px;
  border-radius: var(--r-pill); border: 2px solid var(--brand-brown); background: var(--white);
  font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .08s, box-shadow .08s, background .15s;
}
.btn:hover { background: var(--brand-cream-2); }
.btn-primary { background: var(--brand-yellow); box-shadow: 0 6px 0 var(--button-shadow); margin-bottom: 6px; }
.btn-primary:hover { background: #FFD36E; }
.btn-primary:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--button-shadow); }
.btn-sm { min-height: 40px; padding: 6px 14px; font-size: 13px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--brand-cream-2); }
.btn-icon { width: 44px; padding: 0; position: relative; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.badge-dot { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; background: var(--brand-orange); border-radius: 50%; border: 2px solid #fff; }

/* ---------- 卡片 ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-card); }

/* 分數總覽列 */
.scores { display: grid; grid-template-columns: minmax(300px, 1.15fr) 2.6fr; gap: 16px; margin-bottom: 16px; }
.overall { padding: 22px; display: flex; gap: 20px; align-items: center; }
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .val b { font-family: var(--font-num); font-weight: 800; font-size: 46px; line-height: 1; }
.ring .val small { display: block; font-size: 12px; color: var(--brand-brown-soft); font-weight: 700; margin-top: 2px; }
.overall-meta { display: grid; gap: 6px; font-size: 13px; color: var(--brand-brown-soft); min-width: 0; }
.overall-meta strong { color: var(--brand-brown); font-weight: 700; }
.overall-meta .site { font-family: var(--font-mono); font-size: 13px; color: var(--brand-brown); font-weight: 600; word-break: break-all; }
.mini-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.mini-cards.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mini { padding: 16px; border-radius: var(--r-lg); display: flex; flex-direction: column; gap: 4px; }
.mini .lbl { font-size: 13px; font-weight: 700; display: flex; align-items: flex-start; gap: 6px; min-height: 42px; line-height: 1.5; }
.mini .score { font-family: var(--font-num); font-weight: 800; font-size: 32px; line-height: 1.1; }
.mini .diff { font-size: 12px; font-weight: 700; color: var(--brand-brown-soft); }
.mini .bar { height: 6px; border-radius: var(--r-pill); background: var(--brand-cream-2); overflow: hidden; margin-top: auto; }
.mini .bar i { display: block; height: 100%; border-radius: inherit; }
.diff.up { color: var(--sev-pass); } .diff.down { color: var(--sev-fail); }
.s-good { color: var(--sev-pass); } .s-mid { color: var(--sev-warn); } .s-bad { color: var(--sev-fail); }
.bg-good { background: #3CAA83; } .bg-mid { background: var(--brand-yellow); } .bg-bad { background: var(--brand-orange); }

/* 標籤 */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; border-radius: var(--r-pill); padding: 2px 10px; line-height: 1.6; white-space: nowrap; }
.tag-seo { background: var(--tag-seo); color: #fff; }
.tag-geo { background: var(--tag-geo); color: #fff; }
.tag-shop { background: var(--tag-shop); color: #fff; }
.tag-ecom { background: var(--info-bg); color: var(--tag-shop); border: 1px solid var(--info-line); }
.tag-sub { background: var(--brand-cream-2); color: var(--brand-brown); }
.tag-type { background: var(--brand-cream-2); color: var(--brand-brown); font-weight: 700; }
.sev { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; border-radius: var(--r-pill); padding: 2px 10px; white-space: nowrap; }
.sev .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.sev-fail { color: var(--sev-fail); background: var(--sev-fail-bg); }
.sev-warn { color: var(--sev-warn); background: var(--sev-warn-bg); }
.sev-pass { color: var(--sev-pass); background: var(--sev-pass-bg); }
.sev-na { color: var(--sev-na); background: var(--sev-na-bg); }

/* 小提醒橫幅 */
.tip { display: flex; align-items: center; gap: 16px; background: var(--brand-yellow-light); border-radius: var(--r-lg); padding: 14px 20px 14px 14px; margin-bottom: 20px; }
.tip img { width: 72px; height: 72px; object-fit: contain; flex: none; }
.tip-text { flex: 1; min-width: 0; font-size: 14px; }
.tip-text b { font-size: 16px; font-weight: 900; }
.tip-text b .num { font-size: 22px; color: var(--sev-fail); }

.notice { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--r-row); padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.notice-warn { background: var(--sev-warn-bg); color: #5C3D00; }
.notice-info { background: var(--info-bg); color: #1E3A8A; border: 1px solid var(--info-line); }
.notice details summary { cursor: pointer; font-weight: 700; min-height: 32px; display: flex; align-items: center; }
.notice ul { margin: 6px 0 0; padding-left: 20px; }

/* 層級頁籤 */
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.level-tab {
  text-align: left; cursor: pointer; background: var(--white); border: 2px solid var(--line); border-radius: var(--r-lg);
  padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 76px;
}
.level-tab:hover { background: var(--brand-cream-2); }
.level-tab[aria-pressed="true"] { background: var(--brand-yellow-light); border-color: var(--brand-brown); box-shadow: 0 5px 0 var(--brand-brown); margin-bottom: 5px; }
.level-tab b { display: block; font-size: 19px; font-weight: 900; }
.level-tab small { display: block; font-size: 13px; color: var(--brand-brown-soft); }
.level-tab .count { font-size: 13px; font-weight: 700; white-space: nowrap; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px 12px; }
.level-tab .count .num { font-size: 18px; color: var(--sev-fail); }

/* 控制列 */
.controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 16px; }
.seg { display: inline-flex; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; }
.seg button { border: 0; background: none; border-radius: var(--r-pill); padding: 8px 16px; font-weight: 700; font-size: 14px; cursor: pointer; min-height: 40px; }
.seg button[aria-pressed="true"] { background: var(--brand-brown); color: #fff; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { border: 1.5px solid var(--line); background: var(--white); border-radius: var(--r-pill); padding: 6px 14px; min-height: 40px; font-size: 13px; font-weight: 700; cursor: pointer; }
.pill:hover { border-color: var(--brand-brown-soft); }
.pill[aria-pressed="true"] { background: var(--brand-yellow); border-color: var(--brand-brown); }
.pill .n { font-family: var(--font-num); font-weight: 700; margin-left: 4px; }
.check-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: var(--white); border-radius: var(--r-pill); padding: 6px 14px; min-height: 40px; font-size: 13px; font-weight: 700; cursor: pointer; }
.check-toggle .box { width: 18px; height: 18px; border: 2px solid var(--brand-brown); border-radius: 6px; display: grid; place-items: center; }
.check-toggle .box .icon { width: 13px; height: 13px; stroke-width: 3; opacity: 0; }
.check-toggle[aria-pressed="true"] { background: var(--brand-yellow-light); border-color: var(--brand-brown); }
.check-toggle[aria-pressed="true"] .box { background: var(--brand-brown); color: #fff; }
.check-toggle[aria-pressed="true"] .box .icon { opacity: 1; }
.search { display: flex; align-items: center; gap: 6px; background: var(--white); border: 1.5px solid var(--line); border-radius: var(--r-pill); padding: 0 14px; min-height: 40px; }
.search input { border: 0; outline: 0; background: none; font-size: 13px; width: 180px; }

/* 檢查區塊 */
.blocks { display: grid; gap: 16px; }
.blocks.two { grid-template-columns: 1fr 1fr; align-items: start; }
.block { padding: 20px; border-radius: var(--r-xl); }
.block-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 4px; }
.block-head h2 { font-size: 20px; font-weight: 900; margin: 0; }
.block-head .stat { font-size: 13px; color: var(--brand-brown-soft); font-weight: 700; }
.block-desc { font-size: 13px; color: var(--brand-brown-soft); margin: 0 0 14px; }
.policy { background: var(--info-bg); border: 1px solid var(--info-line); color: #1E3A8A; border-radius: var(--r-row); padding: 12px 16px; font-size: 13px; margin-bottom: 14px; }
.policy b { display: block; font-size: 14px; margin-bottom: 2px; }
.policy ul { margin: 4px 0 0; padding-left: 18px; }
.subcat { font-size: 13px; font-weight: 900; color: var(--tag-shop); margin: 16px 4px 8px; display: flex; align-items: center; gap: 8px; }
.subcat::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.items { display: grid; gap: 10px; }
.item { border: 1px solid var(--line); border-radius: var(--r-row); background: var(--white); }
.item.is-fail { border-left: 5px solid var(--sev-fail); }
.item.is-warn { border-left: 5px solid #E5A92E; }
.item-main { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; padding: 14px 16px; align-items: start; }
.st-ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.st-ico .icon { width: 16px; height: 16px; stroke-width: 2.8; }
.st-fail { background: var(--sev-fail-bg); color: var(--sev-fail); }
.st-warn { background: var(--sev-warn-bg); color: var(--sev-warn); }
.st-pass { background: var(--sev-pass-bg); color: var(--sev-pass); }
.st-na { background: var(--sev-na-bg); color: var(--sev-na); }
.item-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.item-title h3 { font-size: 15px; font-weight: 700; margin: 0; }
.item-title .code { font-family: var(--font-mono); font-size: 11px; color: var(--brand-brown-soft); }
.item-desc { font-size: 13px; color: var(--brand-brown-soft); margin: 4px 0 0; }
.item-value { font-size: 13px; font-weight: 700; color: var(--sev-fail); margin-top: 4px; }
.item-value.ok { color: var(--sev-pass); }
.item-note { font-size: 12px; color: var(--brand-brown-soft); margin-top: 4px; display: flex; gap: 4px; align-items: flex-start; }
.item-note .icon { width: 14px; height: 14px; margin-top: 3px; }
.item-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.expand { border: 1.5px solid var(--line); background: var(--brand-cream); border-radius: var(--r-pill); padding: 6px 12px; min-height: 40px; font-size: 13px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.expand:hover { border-color: var(--brand-brown-soft); }
.expand .icon { width: 16px; height: 16px; transition: transform .2s; }
.expand[aria-expanded="true"] .icon { transform: rotate(180deg); }
.affected { border-top: 1px dashed var(--line); padding: 8px 16px 12px 56px; }
.affected ul { list-style: none; margin: 0; padding: 0; display: grid; }
.affected li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--brand-cream-2); font-size: 13px; }
.affected li:last-child { border-bottom: 0; }
.affected a { font-family: var(--font-mono); font-size: 13px; word-break: break-all; text-decoration: none; display: inline-flex; gap: 4px; align-items: center; min-height: 32px; }
.affected a:hover { text-decoration: underline; }
.affected .val { color: var(--sev-fail); font-weight: 700; text-align: right; }
.affected .detail { grid-column: 2 / -1; font-size: 12px; color: var(--brand-brown-soft); font-family: var(--font-mono); word-break: break-all; }
.show-all { margin-top: 6px; }

/* 依頁面檢視 */
.page-view { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.table-wrap { overflow-x: auto; border-radius: var(--r-xl); }
table.pages { width: 100%; border-collapse: collapse; min-width: 620px; font-size: 14px; }
table.pages th { text-align: left; font-size: 12px; color: var(--brand-brown-soft); font-weight: 700; padding: 0; border-bottom: 1px solid var(--line); }
table.pages th button { border: 0; background: none; font-weight: 700; font-size: 12px; color: inherit; padding: 14px 12px; min-height: 44px; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
table.pages th button .icon { width: 14px; height: 14px; opacity: .35; }
table.pages th[aria-sort] button .icon { opacity: 1; }
table.pages th[aria-sort="ascending"] button .icon { transform: rotate(180deg); }
table.pages td { padding: 10px 12px; border-bottom: 1px solid var(--brand-cream-2); vertical-align: middle; }
table.pages tr.row { cursor: pointer; }
table.pages tr.row:hover td { background: var(--brand-cream); }
table.pages tr.row[aria-selected="true"] td { background: var(--brand-yellow-light); }
table.pages tr.row[aria-selected="true"] td:first-child { box-shadow: inset 5px 0 0 var(--brand-yellow); }
table.pages .page-cell button { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; display: grid; gap: 4px; min-height: 44px; align-content: center; width: 100%; }
table.pages .page-cell .mono { font-size: 12.5px; }
.score-badge { display: inline-block; min-width: 44px; text-align: center; border-radius: var(--r-pill); padding: 2px 10px; font-family: var(--font-num); font-weight: 800; font-size: 15px; }
.sb-good { background: var(--sev-pass-bg); color: var(--sev-pass); }
.sb-mid { background: var(--sev-warn-bg); color: var(--sev-warn); }
.sb-bad { background: var(--sev-fail-bg); color: var(--sev-fail); }
.open-count { font-family: var(--font-num); font-weight: 800; font-size: 16px; }
.table-foot { padding: 12px 16px; font-size: 13px; color: var(--brand-brown-soft); }
.detail-panel { border: 2px solid var(--brand-yellow); border-radius: var(--r-xl); padding: 20px; position: sticky; top: 16px; background: var(--white); box-shadow: var(--shadow-card); }
.detail-panel h2 { font-size: 19px; font-weight: 900; margin: 0 0 6px; }
.detail-panel .mono a { text-decoration: none; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 14px; font-size: 13px; }
.detail-meta select { border: 1.5px solid var(--line); border-radius: var(--r-pill); padding: 4px 10px; background: var(--white); font-size: 12px; font-weight: 700; min-height: 32px; }
.detail-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.detail-list li { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; gap: 4px; font-size: 13px; }
.detail-list .row1 { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.detail-list .row1 b { font-size: 14px; }
.detail-list .val { color: var(--sev-fail); font-weight: 700; }

/* 狀態畫面 */
.state { text-align: center; padding: 48px 24px; display: grid; justify-items: center; gap: 12px; }
.state img { width: 160px; height: 160px; object-fit: contain; }
.state h2 { font-size: 22px; font-weight: 900; margin: 0; }
.state p { margin: 0; color: var(--brand-brown-soft); max-width: 520px; }
.state .url-form { max-width: 640px; margin-top: 8px; }
.state.small { padding: 28px 16px; }
.state.small img { width: 96px; height: 96px; }
.float { animation: float 2.2s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.progress { width: min(520px, 100%); }
.progress-bar { height: 14px; background: var(--brand-cream-2); border-radius: var(--r-pill); overflow: hidden; border: 1px solid var(--line); }
.progress-bar i { display: block; height: 100%; background: var(--brand-yellow); border-radius: inherit; transition: width .3s; }
.progress-text { display: flex; justify-content: space-between; font-size: 13px; margin-top: 6px; color: var(--brand-brown-soft); }
.phases { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; list-style: none; padding: 0; margin: 4px 0 0; }
.phases li { font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: var(--r-pill); background: var(--white); border: 1px solid var(--line); color: var(--brand-brown-soft); }
.phases li.done { background: var(--sev-pass-bg); color: var(--sev-pass); border-color: transparent; }
.phases li.now { background: var(--brand-yellow); color: var(--brand-brown); border-color: var(--brand-brown); }
.skeleton { display: grid; gap: 16px; margin-top: 24px; width: 100%; }
.skel { background: linear-gradient(90deg, var(--brand-cream-2) 0%, #FFF8EC 50%, var(--brand-cream-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-xl); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.page-footnote { margin-top: 28px; font-size: 12px; color: var(--brand-brown-soft); text-align: center; }
.page-footnote a { text-decoration: underline; }

/* 浮出選單／提示 */
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); background: var(--white); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-card); padding: 8px; min-width: 300px; z-index: 30; max-height: 60vh; overflow-y: auto; }
.menu-pop h3 { font-size: 13px; margin: 6px 10px; color: var(--brand-brown-soft); }
.menu-pop button { width: 100%; text-align: left; border: 0; background: none; border-radius: 12px; padding: 10px; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; min-height: 44px; font-size: 13px; }
.menu-pop button:hover, .menu-pop button[aria-current="true"] { background: var(--brand-cream-2); }
.menu-pop .empty { padding: 10px; font-size: 13px; color: var(--brand-brown-soft); }
.rel { position: relative; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--brand-brown); color: #fff; padding: 12px 20px; border-radius: var(--r-pill); font-size: 14px; font-weight: 700; z-index: 50; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); max-width: calc(100vw - 32px); }

/* PDF 報告（列印） */
#report { display: none; }
@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  .app { display: none !important; }
  #report { display: block; color: var(--brand-brown); font-size: 12px; }
  #report .cover { display: flex; align-items: center; gap: 16px; border-bottom: 3px solid var(--brand-yellow); padding-bottom: 12px; margin-bottom: 14px; }
  #report .cover img { width: 60px; height: 60px; }
  #report h1 { font-size: 22px; margin: 0; }
  #report h2 { font-size: 15px; margin: 16px 0 6px; border-left: 5px solid var(--brand-yellow); padding-left: 8px; }
  #report table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
  #report th, #report td { border: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: top; }
  #report th { background: var(--brand-cream-2); }
  #report .big { font-family: var(--font-num); font-size: 40px; font-weight: 800; }
  #report .urls { font-family: var(--font-mono); font-size: 10px; word-break: break-all; color: #555; }
  #report tr { break-inside: avoid; }
}

/* ---------- RWD（PRD 3.6）---------- */
@media (max-width: 1279px) {
  .blocks.two { grid-template-columns: 1fr; }
  .page-view { grid-template-columns: 1fr; }
  .detail-panel { position: static; }
  .scores { grid-template-columns: 1fr; }
}
@media (max-width: 1023px) {
  .mini-cards, .mini-cards.n4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 30% 0 0; max-width: 300px; z-index: 40; transform: translateX(-105%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(91, 58, 33, .35); z-index: 39; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .topbar img { width: 36px; height: 36px; object-fit: contain; }
  .topbar b { font-weight: 900; }
  .main { padding: 18px 16px 40px; }
  h1.page-title { font-size: 24px; }
  .overall { flex-direction: column; text-align: center; }
  .mini-cards, .mini-cards.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .levels { grid-template-columns: 1fr; }
  .tip { flex-wrap: wrap; }
  .tip .btn { width: 100%; }
  .check-toggle { margin-left: 0; }
  .item-main { grid-template-columns: 28px minmax(0, 1fr); }
  .item-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; }
  .affected { padding-left: 16px; }
  .affected li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .affected .val { text-align: left; }
  .affected .detail { grid-column: auto; }
  .search input { width: 120px; }
  .head-tools { width: 100%; justify-content: flex-end; }
  .url-form .btn-primary { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
