
:root {
  --brand: #E94D26;
  --brand-600: #CF3E1A;
  --brand-700: #A93014;
  --brand-50: #FDF2EE;
  --brand-100: #FBE1D7;
  --ink: #332C2B;
  --ink-2: #5B5250;
  --muted: #8C8280;
  --line: #ECE5E2;
  --line-2: #DDD3CF;
  --bg: #FAF7F5;
  --surface: #FFFFFF;
  --ok: #1F8A5B;   --ok-bg: #E6F4EC;
  --warn: #B26B00; --warn-bg: #FFF3DC;
  --info: #2563A8; --info-bg: #E7F0FA;
  --bad: #C2312A;  --bad-bg: #FCE9E7;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(51,44,43,.06), 0 4px 16px rgba(51,44,43,.06);
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-display: "Noto Serif TC", "Noto Sans TC", serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.6; font-size: 15px; }
img { max-width: 100%; display: block; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .02em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 16px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  background: var(--brand); color: #fff; transition: background .15s, border-color .15s, color .15s;
  text-decoration: none !important;
}
.btn:hover { background: var(--brand-600); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--brand-50); border-color: var(--brand); color: var(--brand-700); }
.btn-dark { background: var(--ink); }
.btn-dark:hover { background: #1f1a19; }
.btn-danger { background: transparent; color: var(--bad); border-color: #f0c4c0; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 50px; padding: 0 28px; font-size: 16px; border-radius: 10px; }
.btn-block { width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field > span em { color: var(--brand); font-style: normal; }
.field-hint { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px;
  font: inherit; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
@media (max-width: 640px) {
  .input, select.input, textarea.input { font-size: 16px; }
  .input, select.input { height: 46px; }
  .field > span { font-size: 14.5px; }
  .field-hint { font-size: 13px; }
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
}
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); flex-shrink: 0; }   
@media (max-width: 640px) { .check { font-size: 15px; } .check input { width: 18px; height: 18px; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.card-title { font-size: 17px; font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #F1ECEA; color: var(--ink-2); }
.badge-brand { background: var(--brand-50); color: var(--brand-700); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); background: #FBF9F8; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--brand-50); }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: #cfe0f3; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: #c5e6d3; }
.alert-bad { background: var(--bad-bg); color: var(--bad); border-color: #f3c9c4; }
.form-error { color: var(--bad); font-size: 13px; min-height: 1em; }
#toast-root { position: fixed; z-index: 1000; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.18); animation: toast-in .2s ease-out; }
.toast.bad { background: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.modal-backdrop { position: fixed; inset: 0; background: rgba(35,28,27,.45); z-index: 900; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 880px; }
.modal-head { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 18px; flex: 1; }
.modal-close { background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: #FBF9F8; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 500; word-break: break-all; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li:first-child::before { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
.timeline time { display: block; font-size: 12px; color: var(--muted); }
.thumbs { display: inline-flex; gap: 4px; align-items: center; vertical-align: middle; cursor: pointer; }
.thumbs img { object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #f3efed; }
.thumbs img.dmg { outline: 2px solid var(--bad, #C2312A); outline-offset: 1px; }
.thumbs .more { font-size: 12px; color: var(--muted); padding: 0 4px; }
.gallery-main { width: 100%; max-height: 62vh; object-fit: contain; background: #1c1817; border-radius: 10px; }
.gallery-strip { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.gallery-strip img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; cursor: pointer; opacity: .6; border: 2px solid transparent; }
.gallery-strip img.on { opacity: 1; border-color: var(--brand); }
.choice { display: block; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 14px 16px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--brand); }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.choice.disabled { opacity: .45; cursor: not-allowed; }
.choice.disabled:hover { border-color: var(--line-2); }
.sum { width: 100%; font-size: 14px; border-collapse: collapse; }
.sum td { padding: 6px 0; }
.sum td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.sum tr.total td { border-top: 1px solid var(--line); padding-top: 10px; font-weight: 700; font-size: 16px; }
.sum tr.total td:last-child { color: var(--brand); font-size: 20px; }
.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-list li { display: flex; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fff; }
.notice-list li:last-child { border-bottom: 0; }
.notice-list li.unread { background: var(--brand-50); }
.notice-list li.unread b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-right: 8px; vertical-align: 2px; }
.notice-list time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.steps { display: flex; gap: 0; margin: 4px 0 8px; }
.steps .s { flex: 1; text-align: center; font-size: 12px; color: var(--muted); position: relative; padding-top: 22px; }
.steps .s::before { content: ""; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 12px; height: 12px; border-radius: 50%; background: var(--line-2); z-index: 1; }
.steps .s::after { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px; background: var(--line-2); }
.steps .s:first-child::after { display: none; }
.steps .s.done { color: var(--ink); font-weight: 600; }
.steps .s.done::before, .steps .s.done::after { background: var(--brand); }
.rw-line-gate { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; border: 2px solid #06C755; background: linear-gradient(135deg, #E9FBEF, #fff); }
.rw-line-gate h2 { margin: 0 0 6px; font-size: 21px; color: #05833a; }
.rw-line-gate p { margin: 0; line-height: 1.6; }
.rw-line-gate-icon { font-size: 44px; line-height: 1; }
.rw-line-gate-btn { background: #06C755; border-color: #06C755; color: #fff; white-space: nowrap; }
.rw-line-gate .spacer { min-width: 220px; }
.rw-locked { opacity: .45; filter: grayscale(.7); pointer-events: none; user-select: none; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--brand-100); border-top-color: var(--brand-600); border-radius: 50%; animation: by-spin .8s linear infinite; }
@keyframes by-spin { to { transform: rotate(360deg); } }
