/* ── 報告頁：像一份文件，不像一個網頁 ── */
.doc-wrap { max-width: 880px; margin: 0 auto; padding: 26px 20px 90px; }

.doc-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--panel); border: 0.5px solid var(--line);
  border-radius: 10px;
}
.doc-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.doc-meta b {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px; letter-spacing: .18em; color: var(--gold-lt);
}
.doc-chars { padding-left: 10px; border-left: 0.5px solid var(--line); }
.doc-actions { display: flex; gap: 8px; }
.btn-ghost {
  background: transparent; border: 0.5px solid var(--line-soft);
  color: var(--text-2); border-radius: 7px; padding: 7px 13px;
  font-size: 12.5px; cursor: pointer; font-family: var(--sans);
  transition: all .14s;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-lt); }
.doc-hint { font-size: 12px; color: var(--muted); margin: 10px 4px 22px; line-height: 1.7; }

.toc {
  background: var(--panel); border: 0.5px solid var(--line);
  border-radius: 10px; padding: 18px 22px; margin-bottom: 26px;
}
.toc h4 {
  font-size: 11.5px; color: var(--gold); letter-spacing: .14em;
  font-weight: 500; margin-bottom: 10px;
}
.toc a {
  display: inline-block; font-size: 13px; color: var(--text-2);
  text-decoration: none; padding: 3px 10px 3px 0; line-height: 1.9;
}
.toc a:hover { color: var(--gold-lt); }

/* ── 文件本體 ── */
.doc {
  background: #fbf8f1;
  color: #1e1c18;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 2.0;
  padding: 58px 62px 66px;
  border-radius: 3px;
  box-shadow: 0 18px 60px rgba(0,0,0,.36);
  word-break: break-word;
}
.doc h1 {
  font-size: 27px; font-weight: 500; letter-spacing: .05em;
  color: #14120e; padding-bottom: 18px; margin-bottom: 34px;
  border-bottom: 1.5px solid #c9a55c;
}
.doc h2 {
  font-size: 19px; font-weight: 500; letter-spacing: .04em;
  color: #14120e; margin: 44px 0 16px;
  padding-left: 13px; border-left: 3px solid #c9a55c;
}
.doc h2:first-of-type { margin-top: 0; }
.doc h3 {
  font-size: 15.5px; font-weight: 600; color: #3a3428;
  margin: 26px 0 8px;
}
.doc h4 { font-size: 14.5px; font-weight: 600; color: #3a3428; margin: 20px 0 6px; }
.doc p { margin: 0 0 1.05em; }
.doc strong { color: #0f0d0a; font-weight: 600; }
.doc em { font-style: italic; color: #4a4438; }
.doc code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px; background: #efe9dc; padding: 1px 5px; border-radius: 3px;
}
.doc ul, .doc ol { margin: 0 0 1.05em; padding-left: 1.5em; }
.doc li { margin-bottom: .4em; }
.doc blockquote {
  margin: 1.2em 0; padding: 4px 0 4px 16px;
  border-left: 2px solid #d8cba9; color: #4a4438;
}
.doc hr { border: none; border-top: 0.5px solid #e0d7c4; margin: 34px 0; }
.doc .t-wrap { overflow-x: auto; margin: 1.2em 0; }
.doc table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
  font-family: var(--sans); line-height: 1.7;
}
.doc th, .doc td {
  border: 0.5px solid #ddd3bd; padding: 7px 10px; text-align: left;
  vertical-align: top;
}
.doc th { background: #f2ecdd; font-weight: 600; color: #2a251c; }
.doc-foot {
  margin-top: 24px; font-size: 12px; color: var(--muted);
  text-align: center; line-height: 1.8;
}

/* ── 生成中 / 失敗 ── */
.state-panel { text-align: center; padding: 54px 30px; }
.state-panel h2 {
  font-family: var(--serif); font-size: 22px; font-weight: 500;
  color: var(--gold-lt); letter-spacing: .06em; margin-bottom: 12px;
}
.state-panel p { font-size: 13.5px; color: var(--text-2); line-height: 1.8; margin-bottom: 8px; }
.state-detail { font-size: 11.5px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.state-count {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px; color: var(--gold) !important; margin-top: 14px !important;
}
.progress {
  height: 3px; background: rgba(201,165,92,.12);
  border-radius: 3px; overflow: hidden; margin: 26px auto 0; max-width: 340px;
}
.progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #b8934c, #e6cf95);
  transition: width .6s ease;
}
.progress-bar.slow { animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
.doc-note { font-size: 12.5px; color: var(--muted); margin-top: 18px !important; }
.doc-note b { color: var(--gold-lt); font-family: ui-monospace, Menlo, monospace; letter-spacing: .14em; }
.state-panel .cta { max-width: 260px; margin: 20px auto 0; }

/* ── 定價 ── */
.hero-sm { margin-bottom: 34px; }
.hero-sm h1 { font-size: 27px; }
.tiers {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 26px;
}
.tier {
  position: relative;
  background: var(--panel); border: 0.5px solid var(--line);
  border-radius: 14px; padding: 28px 26px;
  display: flex; flex-direction: column;
}
.tier-hot { border-color: rgba(201,165,92,.42); background: linear-gradient(180deg, rgba(201,165,92,.055), rgba(201,165,92,.012)); }
.tier-badge {
  position: absolute; top: -10px; left: 26px;
  background: var(--gold); color: #17120a;
  font-size: 10.5px; letter-spacing: .06em;
  padding: 3px 10px; border-radius: 20px;
}
.tier h3 {
  font-family: var(--serif); font-size: 17px; font-weight: 500;
  color: var(--text); letter-spacing: .05em;
}
.tier-price {
  font-family: var(--serif); font-size: 34px; color: var(--gold-lt);
  margin: 10px 0 6px; letter-spacing: .02em;
}
.tier-desc { font-size: 13px; color: var(--text-2); line-height: 1.7; margin-bottom: 18px; }
.tier-feat { list-style: none; margin-bottom: 24px; flex: 1; }
.tier-feat li {
  font-size: 13.5px; color: var(--text-2); line-height: 1.6;
  padding-left: 18px; position: relative; margin-bottom: 9px;
}
.tier-feat li::before {
  content: "·"; position: absolute; left: 4px; top: -1px;
  color: var(--gold); font-size: 18px;
}
.tier-cta { margin-top: auto; }
.note-panel h3 {
  font-size: 13px; color: var(--gold); letter-spacing: .1em;
  font-weight: 500; margin-bottom: 12px;
}
.note-panel p { font-size: 13px; color: var(--muted); line-height: 1.9; margin-bottom: 10px; }
.note-panel b { color: var(--text-2); }
.gate {
  margin-top: 14px; padding-top: 14px;
  border-top: 0.5px solid var(--line-soft);
  font-size: 12px; color: var(--gold) !important;
}

/* ── 取件 ── */
.code-input {
  width: 100%; background: var(--ink); color: var(--gold-lt);
  border: 0.5px solid var(--line); border-radius: 8px;
  padding: 16px; font-size: 24px; text-align: center;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: .3em;
}
.code-input:focus { outline: none; border-color: var(--gold); }
.code-input::placeholder { color: #333b47; letter-spacing: .3em; }
#pickupErr { color: #d99a4e; }

/* ── 條款 ── */
.legal { max-width: 760px; }
.legal section { margin-bottom: 34px; }
.legal h2 {
  font-family: var(--serif); font-size: 17px; font-weight: 500;
  color: var(--gold-lt); letter-spacing: .06em; margin-bottom: 12px;
}
.legal p { font-size: 13.5px; color: var(--text-2); line-height: 1.95; margin-bottom: 10px; }

/* ── 手機 ── */
@media (max-width: 680px) {
  .doc-wrap { padding: 18px 12px 70px; }
  .doc { padding: 34px 22px 40px; font-size: 15px; line-height: 1.95; }
  .doc h1 { font-size: 22px; }
  .doc h2 { font-size: 17px; margin-top: 34px; }
  .tiers { grid-template-columns: 1fr; }
  .doc-bar { padding: 10px 12px; }
  .doc-actions { width: 100%; }
  .doc-actions button { flex: 1; }
}

/* ── 列印 / 存 PDF ── */
@media print {
  @page { margin: 18mm 16mm; }
  body { background: #fff !important; color: #000 !important; }
  .topbar, .foot, .doc-bar, .doc-hint, .toc, .doc-foot, .progress { display: none !important; }
  .doc-wrap { max-width: none; padding: 0; margin: 0; }
  .doc {
    background: #fff !important; color: #000 !important;
    padding: 0 !important; box-shadow: none !important;
    border-radius: 0; font-size: 11pt; line-height: 1.85;
  }
  .doc h1 { font-size: 19pt; border-bottom-color: #999; }
  .doc h2 { font-size: 13.5pt; border-left-color: #999; page-break-after: avoid; }
  .doc h3 { page-break-after: avoid; }
  .doc table { page-break-inside: avoid; }
  .doc th, .doc td { border-color: #bbb; }
  .doc th { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: #000; text-decoration: none; }
}
