/* 主題 C「信箋」：襯線標題、細線、深藍主色、金色點綴、小圓角、無陰影 */
:root {
  --navy: #0f4c81; --navy-dark: #0a3661; --gold: #c19a3f; --gold-ink: #8a6a1f;
  --ink: #0b1a2b; --ink-700: #2c3e54; --ink-500: #5b6b80; --line: #e2eaf2; --line-strong: #c1ccda;
  --soft: #f5f8fb; --paper: #fff; --danger: #b3261e;
  --serif: 'Noto Serif TC', serif; --sans: 'Noto Sans TC', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #eef1f4; color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); margin: 0; }
[hidden] { display: none !important; }

.shell { max-width: 960px; margin: 0 auto; min-height: 100dvh; background: var(--paper); display: flex; flex-direction: column; }
.masthead { display: flex; align-items: flex-end; gap: 12px; padding: 18px 20px 14px; border-bottom: 2px solid var(--navy); }
.masthead img { width: 38px; height: 30px; object-fit: contain; }
.masthead .brand { flex: 1; min-width: 0; }
.masthead small { display: block; font-size: 11px; letter-spacing: 2px; color: var(--ink-500); }
.masthead h1 { font-size: 22px; color: var(--navy); }
.masthead .who { font-size: 13px; color: var(--ink-500); text-align: right; }
.tabs { display: flex; gap: 24px; padding: 0 20px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a, .tabs button { flex: none; height: 48px; display: flex; align-items: center; padding: 0; border: 0; border-bottom: 3px solid transparent;
  background: none; color: var(--ink-500); font-size: 15px; text-decoration: none; cursor: pointer; }
.tabs [aria-current='page'], .tabs [aria-pressed='true'] { border-bottom-color: var(--gold); color: var(--ink); font-weight: 700; }
.tabs .push { margin-left: auto; }
main { flex: 1; padding: 20px; }
.narrow { max-width: 520px; margin: 0 auto; }

.section { font-family: var(--serif); font-size: 17px; font-weight: 700; margin: 22px 0 6px; display: flex; align-items: center; gap: 8px; }
.section:first-child { margin-top: 0; }
.section .grow { flex: 1; }
.hint { font-size: 13px; color: var(--ink-500); }

.field { display: flex; align-items: center; min-height: 56px; border-bottom: 1px solid var(--line); gap: 8px; flex-wrap: wrap; }
.field label { width: 104px; flex: none; font-size: 14px; color: var(--ink-500); }
.field input, .field select { flex: 1; min-width: 0; height: 48px; border: 0; background: transparent; font-size: 17px; font-weight: 500; outline: none; }
.field:focus-within { border-bottom-color: var(--navy); }
.field .err { flex-basis: 100%; font-size: 13px; color: var(--danger); padding: 0 0 8px 112px; }
.field.bad { border-bottom-color: var(--danger); }

.btn { min-height: 48px; padding: 0 18px; border-radius: 6px; border: 1px solid var(--navy); background: var(--paper); color: var(--navy);
  font-size: 16px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.btn.primary { background: var(--navy); color: #fff; font-weight: 700; letter-spacing: 1px; }
.btn.primary:hover { background: var(--navy-dark); }
.btn.small { min-height: 46px; padding: 0 12px; font-size: 14px; border-color: var(--line-strong); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.rec { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.actions .btn { flex: 1 1 160px; min-height: 54px; }

.note { margin-top: 16px; padding: 12px 14px; border-left: 3px solid var(--gold); background: var(--soft); font-size: 14px; color: var(--ink-700); }
.note.bad { border-left-color: var(--danger); color: var(--danger); }

.summary { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: baseline; }
.summary strong { font-family: var(--serif); font-size: 22px; }

.progress { display: flex; align-items: center; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--line); }
.progress .name { width: 112px; flex: none; font-weight: 500; }
.progress .state { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-700); }
.progress .bar { height: 4px; background: var(--line); margin-top: 6px; }
.progress .bar i { display: block; height: 4px; background: var(--navy); transition: width .6s; }
.progress.failed .state { color: var(--ink-500); }
.progress .amount { font-family: var(--serif); font-weight: 700; white-space: nowrap; }

.table-wrap { overflow-x: auto; margin-top: 12px; }
table.compare { width: 100%; min-width: 620px; border-collapse: collapse; }
.compare th, .compare td { padding: 12px 6px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 15px; color: var(--ink-700); }
.compare thead th { border-top: 1px solid var(--navy); border-bottom: 1px solid var(--navy); color: var(--navy); font-size: 14px; }
.compare th:first-child, .compare td:first-child { text-align: left; position: sticky; left: 0; background: var(--paper); width: 150px; }
.compare td:first-child b { display: block; font-weight: 500; color: var(--ink); font-size: 14px; }
.compare small { display: block; font-size: 12px; color: var(--ink-500); font-weight: 400; }
.compare tfoot td { background: var(--soft); border-bottom: 2px solid var(--navy); font-family: var(--serif); font-size: 19px; font-weight: 700; color: var(--ink); }
.compare tfoot td:first-child { background: var(--soft); font-size: 15px; padding-left: 8px; }
.compare .low { color: var(--gold-ink); }

.record { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.record a { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.record b { font-size: 17px; }
.record .meta { font-size: 13px; color: var(--ink-500); }
.empty { padding: 48px 0; text-align: center; color: var(--ink-500); }

.login { max-width: 400px; margin: 8vh auto 0; }

@media (max-width: 560px) {
  .masthead { padding: 16px 16px 12px; }
  .tabs { padding: 0 16px; gap: 20px; }
  main { padding: 16px; }
  .field label { width: 92px; }
  .field .err { padding-left: 100px; }
  .progress .name { width: 96px; }
}
