/* 免費版（index.html）專屬樣式：步驟導覽、分流問題、分數結果卡、CTA 卡片 */
/* 共用元件（.btn / .chip / .item / .badge / .summary-card / .category 等）沿用 css/styles.css */

.app-free { max-width: 760px; }

/* ───────── 步驟導覽 ───────── */
.stepper {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 6px;
  box-shadow: var(--shadow-sm);
}
.step-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 8px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 0.82rem;
  cursor: pointer;
}
.step-item:hover { background: var(--color-muted-bg); }
.step-item.active { background: var(--color-primary); color: #fff; }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  font-size: 0.72rem;
}
.step-item.active .step-num { background: rgba(255, 255, 255, 0.25); }

/* ───────── 提示框 ───────── */
.tip-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-text-muted);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}
.tip-box p { margin: 0; }
.tip-box-accent { border-left-color: var(--color-primary); color: var(--color-text); background: #eff6ff; }

/* ───────── Step 1 標頭：免費直接開始／Email 解鎖完整報告 提示（audit-gate-flip） ───────── */
.intro-gate-note {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 6px 0 0;
}

/* ───────── 分流問題 ───────── */
.segmentation-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.segmentation-card h2 { margin-top: 0; font-size: 1.05rem; }
.segmentation-question { margin-bottom: 14px; }
.segmentation-question:last-of-type { margin-bottom: 0; }
.segmentation-label { font-size: 0.85rem; font-weight: 500; margin-bottom: 8px; }

/* ───────── 動作按鈕 ───────── */
.step-actions { display: flex; justify-content: center; margin: 22px 0; }
.step-actions-split { justify-content: space-between; }
.btn-lg { padding: 12px 28px; font-size: 0.95rem; }

.full-version-link { text-align: center; color: var(--color-text-muted); font-size: 0.85rem; margin-bottom: 12px; }

/* ───────── 健檢清單頁的分類標頭（無收合，靜態顯示） ───────── */
.category-header-static { cursor: default; }
.category-header-static:hover { background: none; }

/* ───────── SVG Circular Progress Ring ───────── */
.score-ring {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}
.score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-bg {
  fill: none;
  stroke: var(--color-muted-bg);
  stroke-width: 12;
}
.ring-value {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: calc(326.7 * (1 - var(--score, 0) / 100));
  transition: stroke-dashoffset 0.6s ease;
}
.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.ring-label strong {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-text);
}
.ring-label span {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 3px;
}

/* ───────── Report Summary Card ───────── */
.report-summary-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.summary-main {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 20px;
}
.summary-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.summary-band-label {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
}
.summary-band-sub {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: -4px;
}

/* ───────── Status Chip Grid ───────── */
.status-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}
.status-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  background: var(--color-muted-bg);
  text-align: center;
}
.status-chip strong {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-text);
}
.status-chip span {
  font-size: 0.66rem;
  color: var(--color-text-muted);
  margin-top: 3px;
  white-space: nowrap;
}
.status-chip--done strong   { color: var(--color-success); }
.status-chip--issue strong  { color: var(--color-danger); }
.status-chip--unsure strong { color: var(--color-warning); }

/* ───────── Category Progress List ───────── */
.category-list {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.category-row {
  display: grid;
  grid-template-columns: 160px 1fr 44px 72px;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-muted-bg);
}
.category-row:last-child { border-bottom: none; }
.category-row-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.progress-track {
  height: 8px;
  background: var(--color-muted-bg);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}
.category-row-pct {
  font-size: 0.82rem;
  font-family: var(--font-display);
  font-weight: 600;
  text-align: right;
  color: var(--color-text-muted);
}
.badge-score-danger  { background: var(--color-danger-bg);  color: var(--color-danger);  }
.badge-score-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-score-success { background: var(--color-success-bg); color: var(--color-success); }

/* ───────── Diagnosis Insight Card ───────── */
.insight-card {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--color-text);
}
.insight-card p { margin: 0; }

/* ───────── Issue Cards ───────── */
.issue-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.issue-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-danger);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: start;
}
.issue-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-danger);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.issue-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.issue-title {
  font-size: 0.92rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}
.issue-section {
  font-size: 0.84rem;
  color: var(--color-text-muted);
  margin-top: 4px;
  line-height: 1.55;
}
.issue-section strong {
  color: var(--color-text);
  font-weight: 600;
}

/* ───────── Unsure Callout ───────── */
.unsure-callout {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 0.87rem;
  line-height: 1.65;
  color: #78350f;
}
.unsure-callout-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: #92400e;
}
.unsure-callout p { margin: 0; }

/* ───────── CTA Card (dark) ───────── */
.cta-card {
  background: #111827;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 20px;
  color: #fff;
}
.cta-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: #fff;
}
.cta-card-body {
  font-size: 0.9rem;
  color: #d1d5db;
  line-height: 1.65;
  margin: 0 0 20px;
}
.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 26px;
  background: #fff;
  color: #111827;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.cta-button:hover {
  background: #f3f4f6;
  text-decoration: none;
  transform: translateY(-1px);
}

/* ───────── Report Header subtitle ───────── */
.report-subtitle {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin: 2px 0 0;
}

/* 免費版狀態欄（已確認/不確定/待修正/不適用）按鈕配色 */
.status-btn.active-confirmed { background: var(--color-success-bg); color: var(--color-success); border-color: var(--color-success-bg); }
.status-btn.active-unsure { background: var(--color-warning-bg); color: var(--color-warning); border-color: var(--color-warning-bg); }
.status-btn.active-needs_fix { background: var(--color-danger-bg); color: var(--color-danger); border-color: var(--color-danger-bg); }

/* ───────── 報告抬頭 ───────── */
.report-header {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--color-border);
}
.report-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.report-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
}
.report-date {
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.report-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.report-tag {
  display: inline-block;
  background: var(--color-muted-bg);
  color: var(--color-text-muted);
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
}

/* ───────── 報告區塊標題 ───────── */
.report-block-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  margin: 0 0 10px;
}

/* ───────── 統計 Stat Grid ───────── */
.stat-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.stat-box {
  flex: 1;
  min-width: 52px;
  background: var(--color-muted-bg);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
}
.stat-num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-text);
}
.stat-tag {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  margin-top: 3px;
}
.stat-box.stat-done .stat-num { color: var(--color-success); }
.stat-box.stat-issue .stat-num { color: var(--color-danger); }
.stat-box.stat-unsure .stat-num { color: var(--color-warning); }

/* ───────── 操作工具列 ───────── */
.report-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 22px;
}
.report-action-btn {
  flex: 1;
  min-width: 120px;
  justify-content: center;
}

@media (max-width: 720px) {
  .summary-main {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .summary-side { align-items: center; }
  .status-chip strong { font-size: 1.1rem; }
  .status-chip span { font-size: 0.6rem; }
  .category-row {
    grid-template-columns: 1fr 1fr 36px 60px;
  }
  .category-row-name { grid-column: 1 / -1; white-space: normal; }
  .issue-card { grid-template-columns: 36px 1fr; gap: 10px; }
}

@media (max-width: 480px) {
  .status-chip { padding: 8px 2px; }
  .status-chip strong { font-size: 1rem; }
  .report-action-btn { min-width: calc(50% - 4px); font-size: 0.8rem; padding: 8px 10px; }
  .step-item span:not(.step-num) { display: none; }
  .cta-card { padding: 20px 16px; }
  .cta-button { width: 100%; justify-content: center; }
}

@media print {
  .stepper, .step-actions, .report-actions, .back-bar,
  .gate-card, .modal-overlay { display: none !important; }
  html, body { background: #fff !important; color: #111827 !important; }
  .app, .app-free { max-width: 100%; padding: 0; }
  .report-header { border-bottom: 1px solid #ccc; }
  .report-summary-card, .ring-value, .progress-fill,
  .issue-number, .issue-card, .status-chip,
  .cta-card, .insight-card, .unsure-callout {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .issue-card, .report-summary-card, .category-list,
  .issue-cards-list { break-inside: avoid; }
}

/* ───────── Email 牆（gate-card）───────── */
.gate-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  max-width: 480px;
  margin: 60px auto 0;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.gate-card h1,
.gate-card h3 {
  font-size: 1.45rem;
  margin: 0 0 12px;
}
/* 結果頁鎖區內嵌解鎖卡（audit-gate-flip）：沿用 gate-card 樣式語彙，
   但不用滿版置中的頁面級留白，改為區塊內嵌 */
.gate-card.result-gate {
  margin: 0 auto 20px;
  max-width: 100%;
}
.gate-card > p:not(.gate-note) {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0 0 22px;
}
.gate-note {
  font-size: 0.76rem;
  color: var(--color-text-muted);
  margin: 14px 0 0;
}
.gate-embed {
  margin: 0 0 16px;
}
.gate-embed iframe {
  display: block;
  width: 100%;
  height: 130px;
  border: 0;
  border-radius: var(--radius-md);
  background: #fff;
}

/* ───────── 返回主站連結 ───────── */
.back-bar {
  font-size: 0.82rem;
  margin-bottom: 16px;
}
.back-bar a {
  color: var(--color-text-muted);
}
.back-bar a:hover {
  color: var(--color-text);
  text-decoration: none;
}

/* gate-card / back-bar hidden in print is already handled by the unified @media print block above */
