:root {
  --brand: #0028AF;
  --brand-2: #2E6BFF;
  --ink: #0F172A;
  --muted: #64748B;
  --line: #E2E8F0;
  --bg: #F6F8FC;
  --card: #FFFFFF;
  --ok: #15803D;
  --ok-bg: #E7F4EC;
  --testing-bg: #E6EBFA;
  --todo-bg: #EEF1F6;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.07);
  --radius: 16px;
  --container: 880px;
  --font: "Plus Jakarta Sans", "Noto Sans TC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  letter-spacing: 0;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(46, 107, 255, 0.08) 0, rgba(246, 248, 252, 0) 260px),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
}

a {
  color: inherit;
}

.top-bar {
  width: 100%;
  height: 4px;
  background: var(--brand);
}

.page-shell {
  width: min(100% - 40px, var(--container));
  margin: 0 auto;
  padding: 36px 0 56px;
}

/* 寬版（詳細測試表格頁）：避免欄位壓縮換行 */
body.wide .page-shell,
body.wide .site-footer .footer-inner {
  width: min(100% - 56px, 1400px);
  max-width: none;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 64px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--brand);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.site-kicker {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.hero {
  max-width: 720px;
  margin-bottom: 56px;
}

.report-hero {
  margin-bottom: 40px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.15rem, 7vw, 4.1rem);
  font-weight: 800;
  line-height: 1.08;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 800;
  line-height: 1.2;
}

h3 {
  margin-bottom: 12px;
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  font-weight: 800;
  line-height: 1.35;
}

.hero-copy {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 500;
}

.report-section,
.checklist-section {
  margin-top: 48px;
}

.section-heading {
  margin-bottom: 18px;
}

.report-list {
  display: grid;
  gap: 18px;
}

.report-card {
  display: block;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius);
  outline-offset: 5px;
}

.report-card article {
  display: grid;
  gap: 10px;
  padding: 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.report-card:hover article,
.report-card:focus-visible article {
  border-color: rgba(0, 40, 175, 0.36);
  box-shadow: 0 20px 48px rgba(0, 40, 175, 0.11);
  transform: translateY(-2px);
}

.report-card-top,
.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.report-card p {
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 500;
}

.date-badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.date-badge {
  color: var(--brand);
  background: rgba(0, 40, 175, 0.08);
  border: 1px solid rgba(0, 40, 175, 0.12);
}

.status-ok {
  color: var(--ok);
  background: var(--ok-bg);
}

.status-testing {
  color: var(--brand);
  background: var(--testing-bg);
}

.status-todo {
  color: var(--muted);
  background: var(--todo-bg);
}

.card-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--brand);
  font-weight: 800;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0 0 48px;
}

.metric-item {
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.metric-item strong {
  display: block;
  color: var(--brand);
  font-size: 2.35rem;
  font-weight: 800;
  line-height: 1;
}

.checklist-card {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.test-table {
  width: 100%;
  min-width: 1480px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.93rem;
}

/* 看什麼欄：給足寬度避免狂換行 */
.test-table th:nth-child(4),
.test-table td:nth-child(4) {
  min-width: 300px;
}

.test-table th,
.test-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.test-table th {
  color: #334155;
  background: #F1F5F9;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.test-table tbody tr {
  transition: background 160ms ease;
}

.test-table tbody tr:hover {
  background: rgba(0, 40, 175, 0.045);
}

.test-table tbody tr:last-child td {
  border-bottom: 0;
}

.test-table th:first-child,
.test-table td:first-child {
  width: 54px;
  text-align: center;
}

.test-table th:nth-child(2),
.test-table td:nth-child(2) {
  width: 18%;
}

.test-table td:nth-child(2) {
  font-weight: 600;
}

/* staging URL 欄：縮到內容寬、單行不換行 */
.test-table th:nth-child(3),
.test-table td:nth-child(3) {
  width: 1%;
  white-space: nowrap;
}

.test-table th:nth-child(5),
.test-table td:nth-child(5) {
  width: 96px;
  text-align: center;
}

.test-table th:nth-child(6),
.test-table td:nth-child(6) {
  width: 76px;
  text-align: center;
}

.test-table th:nth-child(7),
.test-table td:nth-child(7) {
  width: 18%;
  min-width: 160px;
}

.acceptance-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
}

.acc-check {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.acc-comment,
.feedback-field input,
.feedback-field textarea {
  width: 100%;
  color: var(--ink);
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.acc-comment {
  min-width: 160px;
  padding: 10px 12px;
}

.acc-comment:focus,
.feedback-field input:focus,
.feedback-field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 40, 175, 0.12);
}

.staging-link {
  color: var(--brand);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
  word-break: normal;
}

.staging-link:hover,
.staging-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.table-note {
  color: var(--muted);
  font-weight: 600;
}

.feedback-block {
  margin-top: 32px;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.feedback-heading {
  margin-bottom: 22px;
}

.feedback-heading h2 {
  margin-bottom: 8px;
}

.feedback-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 600;
}

.feedback-field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.feedback-field label {
  color: #334155;
  font-size: 0.9rem;
  font-weight: 800;
}

.feedback-field input,
.feedback-field textarea {
  padding: 12px 14px;
}

.feedback-field textarea {
  min-height: 120px;
  resize: vertical;
}

.feedback-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 20px;
  color: #FFFFFF;
  background: var(--brand);
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.feedback-submit:hover,
.feedback-submit:focus-visible {
  background: #001F87;
  transform: translateY(-1px);
}

.feedback-submit:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

#fb-msg {
  min-height: 1.5em;
  margin: 14px 0 0;
  font-weight: 800;
}

.fb-msg-success {
  color: var(--ok);
}

.fb-msg-error {
  color: #B91C1C;
}

.fb-msg-info {
  color: var(--muted);
}

.callout {
  margin-top: 42px;
  padding: 20px 22px;
  color: var(--brand);
  background: rgba(0, 40, 175, 0.07);
  border: 1px solid rgba(0, 40, 175, 0.13);
  border-radius: var(--radius);
  font-weight: 800;
}

.site-footer {
  width: min(100% - 40px, var(--container));
  margin: 0 auto;
  padding: 28px 0 40px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  font-weight: 600;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

@media (max-width: 700px) {
  .page-shell,
  .site-footer {
    width: min(100% - 28px, var(--container));
  }

  .page-shell {
    padding-top: 28px;
  }

  .site-header,
  .report-header,
  .report-card-top,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    margin-bottom: 48px;
  }

  .hero {
    margin-bottom: 44px;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .report-card article,
  .metric-item {
    padding: 22px;
  }
}

@media print {
  :root {
    --bg: #FFFFFF;
    --shadow: none;
  }

  body {
    background: #FFFFFF;
    color: #000000;
  }

  .top-bar {
    height: 3px;
  }

  .page-shell,
  .site-footer {
    width: 100%;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
  }

  .site-header {
    margin-bottom: 32px;
  }

  .hero,
  .report-hero,
  .metric-strip,
  .report-section,
  .checklist-section {
    margin-bottom: 28px;
  }

  .report-card article,
  .metric-item,
  .checklist-card,
  .feedback-block,
  .callout {
    box-shadow: none;
    break-inside: avoid;
  }

  .report-card,
  .back-link {
    text-decoration: none;
  }

  .checklist-card {
    overflow: visible;
  }

  .test-table {
    min-width: 0;
    font-size: 0.8rem;
  }

  .test-table th,
  .test-table td {
    padding: 10px;
  }

  .test-table th:nth-child(6),
  .test-table td:nth-child(6),
  .test-table th:nth-child(7),
  .test-table td:nth-child(7),
  .feedback-block {
    display: none;
  }

  .staging-link {
    color: #000000;
    text-decoration: underline;
  }
}
