/* 隱私權政策、服務條款、資料保護說明共用的版面（/privacy/、/terms/、/trust/）
   明亮、好讀、手機友善，可直接列印或另存 PDF（列印時 /assets/prefs.js 會切回淺色）
   顏色一律用 base.css 的變數，深色模式自動換色 */
body { background: var(--bg); }
.doc-top { position: sticky; top: 0; z-index: 10; background: var(--bg); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.doc-top .in { max-width: 880px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.doc-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; color: var(--ink); }
.doc-brand:hover { color: var(--ink); }
.doc-brand .brand-logo { --bl-h: 30px; }
.doc-brand b { font-size: 15.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-top .btn { flex: none; }

.doc-nav { max-width: 880px; margin: 0 auto; padding: 16px 16px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.doc-nav a { padding: 7px 15px; border-radius: 999px; font-size: 14px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); }
.doc-nav a:hover { border-color: var(--brand-200); color: var(--brand); }
.doc-nav a[aria-current="page"] { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand); font-weight: 600; }

.doc-sheet { max-width: 880px; margin: 0 auto; padding: 16px 16px 56px; }
.doc-paper { background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-md); padding: 36px 40px 40px; }
.doc-paper h1 { font-size: 28px; letter-spacing: .02em; }
.doc-meta { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.doc-paper h2 { font-size: 19px; margin: 34px 0 12px; padding-top: 2px; scroll-margin-top: 70px; display: flex; gap: 2px; align-items: baseline; }
.doc-paper h2 .no { color: var(--brand); font-weight: 600; flex: none; }
.doc-paper h3 { font-size: 16px; margin: 20px 0 8px; }
.doc-paper p, .doc-paper li { font-size: 15.5px; line-height: 1.85; color: var(--ink); }
.doc-paper p { margin: 0 0 10px; }
.doc-paper ul, .doc-paper ol { margin: 0 0 10px; padding-left: 22px; }
.doc-paper li { margin: 3px 0; }
.doc-paper li::marker { color: var(--muted); }
.doc-paper .muted { color: var(--muted); }
.doc-paper a { overflow-wrap: anywhere; }

/* 律師審閱提醒、重點摘要、待填寫欄位 */
.doc-draft { margin: 20px 0 0; padding: 13px 16px; border-radius: 14px; background: var(--amber-bg); color: var(--amber-ink); font-size: 14.5px; line-height: 1.75; border: 1px solid var(--line); border-color: color-mix(in srgb, var(--warn-fill) 35%, var(--line)); }
.doc-draft b { display: block; margin-bottom: 2px; color: var(--amber-ink); }
.doc-summary { margin: 18px 0 0; padding: 16px 20px; border-radius: 16px; background: var(--brand-50); border: 1px solid var(--brand-100); }
.doc-summary b { display: block; margin-bottom: 4px; font-size: 15.5px; color: var(--brand-700); }
.doc-summary ul { margin: 0; }
.doc-summary li { font-size: 15px; line-height: 1.75; }
mark.fill { background: var(--amber-bg); background: color-mix(in srgb, var(--star) 30%, var(--card)); color: var(--amber-ink); padding: 1px 6px; border-radius: 6px; font-weight: 500; }
/* 正式發佈後（doc.js）：填好的法務欄位變回一般文字、範本提醒隱藏 */
mark.filled { background: none; color: inherit; padding: 0; font-weight: inherit; }
.doc-draft[hidden] { display: none; }
.doc-paper .doc-who { margin: 16px 0 0; }

/* 公司資料、聯絡方式 */
.doc-kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 16px; margin: 6px 0 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.doc-kv > div { display: contents; }
.doc-kv dt { color: var(--muted); font-size: 14.5px; line-height: 1.8; }
.doc-kv dd { margin: 0; font-size: 15.5px; line-height: 1.8; min-width: 0; overflow-wrap: anywhere; }
.doc-kv [hidden] { display: none; }
.unset { color: var(--muted); font-size: 14px; }

/* 表格：桌機是表格，手機每一列變成一張卡片 */
.doc-table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 6px 0 14px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; font-size: 15px; }
.doc-table th { text-align: left; font-weight: 600; font-size: 13.5px; color: var(--ink-2); background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.doc-table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; line-height: 1.75; }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table td:first-child { font-weight: 600; min-width: 7.5em; }
.doc-table .code { white-space: nowrap; color: var(--ink-2); }
.doc-table ul { margin: 0; padding-left: 18px; }
.doc-table li { font-size: 15px; line-height: 1.75; margin: 0; }

/* 資料保護說明：重點卡片 */
.trust-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 8px 0 6px; }
.trust-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px 14px; background: var(--card); break-inside: avoid; }
.trust-card .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); margin-bottom: 10px; }
.trust-card .ic svg { width: 20px; height: 20px; }
.trust-card h3 { margin: 0 0 6px; font-size: 16.5px; }
.trust-card p, .trust-card li { font-size: 15px; line-height: 1.8; color: var(--ink-2); }
.trust-card ul { padding-left: 18px; margin: 0; }
.trust-card.wide { grid-column: 1 / -1; }
.trust-hero { margin: 18px 0 0; padding: 20px 22px; border-radius: 18px; background: linear-gradient(135deg, var(--brand-50), var(--green-bg)); border: 1px solid var(--brand-100); }
.trust-hero p { margin: 0; font-size: 16px; line-height: 1.85; }
.trust-gap { border-style: dashed; background: var(--surface-2); }

.doc-foot { max-width: 880px; margin: 0 auto; padding: 0 16px 40px; text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.8; }

@media (max-width: 640px) {
  .doc-paper { padding: 24px 18px 28px; border-radius: 18px; }
  .doc-paper h1 { font-size: 24px; }
  .doc-paper h2 { font-size: 18px; margin-top: 28px; }
  .doc-paper p, .doc-paper li { font-size: 15.5px; }
  .doc-nav a { padding: 8px 14px; }
  .doc-kv { grid-template-columns: 76px minmax(0, 1fr); padding: 14px; }
  .doc-table, .doc-table tbody, .doc-table tr, .doc-table td { display: block; width: 100%; }
  .doc-table thead { display: none; }
  .doc-table { border: 0; border-radius: 0; overflow: visible; }
  .doc-table tr { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; padding: 4px 0; background: var(--card); }
  .doc-table td { border: 0; padding: 6px 14px; }
  .doc-table td[data-label]::before { content: attr(data-label); display: block; font-size: 13.5px; font-weight: 500; color: var(--muted); margin-bottom: 1px; }
  .doc-table td:first-child { padding-top: 10px; font-size: 16px; }
  .doc-table td:first-child::before { display: none; }
  .trust-grid { grid-template-columns: minmax(0, 1fr); }
  .doc-top .btn .txt { display: none; }
  .doc-top .btn { min-width: 40px; min-height: 40px; }
}

/* 大字模式（客戶專區或顧問專區選的字體大小，記在這台裝置）：整頁等比例放大；列印時恢復原尺寸 */
html.fs-l { --d-zoom: 1.12; }
html.fs-xl { --d-zoom: 1.25; }
html.fs-l .doc-top, html.fs-l .doc-nav, html.fs-l .doc-sheet, html.fs-l .doc-foot,
html.fs-xl .doc-top, html.fs-xl .doc-nav, html.fs-xl .doc-sheet, html.fs-xl .doc-foot { zoom: var(--d-zoom); }

@media print {
  @page { size: A4; margin: 14mm 13mm; }
  .doc-top, .doc-nav, .doc-sheet, .doc-foot { zoom: 1 !important; }
  body { background: #fff; }
  .doc-top, .doc-nav, .doc-noprint { display: none !important; }
  .doc-sheet { padding: 0; max-width: none; }
  .doc-paper { border: 0; box-shadow: none; padding: 0; border-radius: 0; background: #fff; }
  .doc-paper h2 { break-after: avoid; margin-top: 22px; }
  .doc-paper p, .doc-paper li, .doc-table td { font-size: 11.5pt; }
  .doc-table, .trust-card, .doc-kv { break-inside: avoid; }
  .doc-table th { background: #f2f4f7 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc-draft, .doc-summary, .trust-hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc-foot { padding: 12px 0 0; }
  a { color: inherit; }
}
