﻿/* =====================================================================
   賽事報名 - 前台樣式（後台請用根目錄 admin.css）
   風格：明亮暖色系 × 科技感（橘金漸層、細格線背景、柔光陰影）
   手機優先，RWD 斷點：560px / 860px
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700;900&family=Rajdhani:wght@600;700&display=swap');

:root {
    --bg: #fff8f1;
    --bg-2: #fff1e4;
    --card: #ffffff;
    --text: #2a1c13;
    --muted: #8a7062;
    --line: #f3e2d4;
    --line-strong: #e9cdb6;
    --brand: #ff6a2b;
    --brand-2: #ffaa1d;
    --brand-3: #ff3f7a;
    --brand-dark: #e2541a;
    --brand-soft: #fff0e3;
    --grad: linear-gradient(120deg, #ff5a2c 0%, #ff8a1f 48%, #ffb627 100%);
    --grad-hot: linear-gradient(120deg, #ff3f7a 0%, #ff6a2b 55%, #ffaa1d 100%);
    --ok: #12a150;
    --ok-soft: #e3f8ec;
    --warn: #c77700;
    --warn-soft: #fff4d6;
    --err: #e23b3b;
    --err-soft: #ffe8e6;
    --info: #3e63dd;
    --info-soft: #eaf0ff;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(120, 60, 20, .05), 0 12px 32px -14px rgba(255, 110, 40, .28);
    --shadow-hover: 0 2px 4px rgba(120, 60, 20, .06), 0 18px 40px -14px rgba(255, 110, 40, .42);
    --font: 'Noto Sans TC', 'Microsoft JhengHei', -apple-system, 'Segoe UI', Arial, sans-serif;
    --font-tech: 'Rajdhani', 'Noto Sans TC', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    line-height: 1.65;
    font-size: 16px;
    background-color: var(--bg);
    background-image:
        radial-gradient(900px 420px at 100% -10%, rgba(255, 170, 29, .20), transparent 60%),
        radial-gradient(700px 380px at -10% 10%, rgba(255, 90, 44, .12), transparent 60%),
        linear-gradient(rgba(255, 140, 60, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 140, 60, .055) 1px, transparent 1px);
    background-size: auto, auto, 28px 28px, 28px 28px;
    background-attachment: fixed;
    min-height: 100vh;
}
a { color: var(--brand-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-3); }
img, svg { max-width: 100%; }

/* ---------- 頁首 ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--line);
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--grad-hot); opacity: .85; }
.topbar-inner { max-width: 1080px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 900; font-size: 1.08rem; text-decoration: none; letter-spacing: .02em; }
.brand:hover { color: var(--text); }
.brand-mark {
    display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
    background: var(--grad-hot); color: #fff; font-family: var(--font-tech); font-size: 1.25rem; font-weight: 700;
    box-shadow: 0 6px 16px -6px rgba(255, 80, 60, .7), inset 0 0 0 1px rgba(255, 255, 255, .35);
}
.nav { display: flex; flex-wrap: wrap; gap: 2px; }
.nav a { color: #5b4234; text-decoration: none; padding: 7px 12px; border-radius: 999px; font-size: .94rem; font-weight: 500; transition: background .15s, color .15s; }
.nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.nav a.active { background: var(--grad); color: #fff; box-shadow: 0 6px 14px -8px rgba(255, 100, 30, .9); }
.nav-toggle, .nav-burger { display: none; }

/* ---------- 版面 ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 16px 64px; }
.wrap.narrow-wrap { max-width: 760px; }
h1 { font-size: 1.65rem; margin: 0 0 6px; font-weight: 900; letter-spacing: .01em; }
h1 + .muted { margin-top: 0; }
h2 { font-size: 1.18rem; margin: 0 0 14px; font-weight: 700; }
h3 { font-size: 1.04rem; margin: 0 0 8px; }
.page-head { margin-bottom: 18px; }
.page-head .eyebrow { display: inline-block; font-family: var(--font-tech); font-size: .82rem; letter-spacing: .18em; text-transform: uppercase; color: var(--brand); margin-bottom: 2px; }
.muted { color: var(--muted); font-size: .9rem; }
.hint { color: var(--muted); font-size: .84rem; margin-top: 4px; }

.card {
    position: relative; background: var(--card); border-radius: var(--radius); padding: 22px; margin-bottom: 18px;
    border: 1px solid var(--line); box-shadow: var(--shadow);
}
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.card.accent::before { content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 3px; border-radius: 0 0 4px 4px; background: var(--grad-hot); }

.section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 1.12rem; font-weight: 700; }
.section-title .step {
    display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 9px;
    background: var(--grad); color: #fff; font-family: var(--font-tech); font-weight: 700; font-size: 1.05rem;
}
.section-title .aside { margin-left: auto; font-weight: 400; }

/* ---------- 訊息 ---------- */
.msg { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 500; border: 1px solid transparent; }
.msg ul { margin: 6px 0 0; padding-left: 20px; font-weight: 400; }
.msg.ok { background: var(--ok-soft); color: #0b6b36; border-color: #bfeccf; }
.msg.err { background: var(--err-soft); color: #9b1c1c; border-color: #ffc9c3; }
.msg.info { background: var(--info-soft); color: #2a45a6; border-color: #cfdcff; }
.msg.warn { background: var(--warn-soft); color: #8a5300; border-color: #ffe39a; }

/* ---------- 表單 ---------- */
.form-row { margin-bottom: 14px; }
.form-row > label, .field > label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .92rem; color: #4d362a; }
.fgrid { display: grid; gap: 12px 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.fgrid .span-2 { grid-column: span 2; }
.fgrid .span-all { grid-column: 1 / -1; }
.field { min-width: 0; }
.req { color: var(--brand-3); margin-left: 3px; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], select, textarea {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
    font-size: 1rem; background: #fffdfb; font-family: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height: 90px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #f0b893; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(255, 106, 43, .16); }
input[readonly] { background: #fbf3ec; color: var(--muted); }
input.invalid, select.invalid { border-color: var(--err); box-shadow: 0 0 0 3px rgba(226, 59, 59, .12); }
.addr-grid { display: grid; gap: 8px; grid-template-columns: 1.1fr 1fr .8fr; }
.addr-grid .addr-line { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: flex-start; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); flex: none; }

/* ---------- 按鈕 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; border-radius: 12px; padding: 10px 20px;
    font-size: 1rem; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center; font-family: inherit; letter-spacing: .02em;
    background: var(--grad); color: #fff; box-shadow: 0 8px 18px -10px rgba(255, 90, 30, .9); transition: transform .12s, box-shadow .15s, filter .15s;
}
.btn:hover { color: #fff; filter: brightness(1.05) saturate(1.05); box-shadow: 0 12px 24px -10px rgba(255, 80, 30, .95); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: #fff; color: #5b3a28; border: 1.5px solid var(--line-strong); box-shadow: none; }
.btn.secondary:hover { color: var(--brand-dark); border-color: var(--brand); background: var(--brand-soft); }
.btn.ghost { background: transparent; color: var(--brand-dark); box-shadow: none; border: 1.5px dashed #f4b58e; }
.btn.ghost:hover { background: var(--brand-soft); color: var(--brand-dark); }
.btn.danger { background: linear-gradient(120deg, #ef4444, #f97316); }
.btn.small { padding: 6px 12px; font-size: .88rem; border-radius: 10px; }
.btn.block { display: flex; width: 100%; }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; transform: none; filter: grayscale(.3); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid var(--line-strong); background: #fff; color: #a0715a; cursor: pointer; font-size: 1rem; }
.icon-btn:hover { color: var(--err); border-color: #ffb4a8; background: var(--err-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; align-items: center; }
.actions.end { justify-content: flex-end; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }

/* ---------- 卡片清單 / 徽章 ---------- */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.comp-card { transition: transform .15s, box-shadow .2s; }
.comp-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.comp-card h3 { margin: 10px 0 8px; font-size: 1.15rem; font-weight: 900; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.badge.open { background: var(--ok-soft); color: #0b6b36; }
.badge.open::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(18, 161, 80, .2); }
.badge.soon { background: var(--warn-soft); color: #8a5300; }
.badge.closed { background: #f1ebe6; color: #6d5a4f; }
.st-paid { background: var(--ok-soft); color: #0b6b36; }
.st-pending { background: var(--warn-soft); color: #8a5300; }
.st-refund { background: var(--info-soft); color: #2a45a6; }
.st-closed { background: #f1ebe6; color: #6d5a4f; }
.st-review { background: #efe9ff; color: #5b3fc4; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: .78rem; font-weight: 700; background: var(--brand-soft); color: var(--brand-dark); }
.tag.alt { background: #efe9ff; color: #5b3fc4; }
.tag.gray { background: #f1ebe6; color: #6d5a4f; }
.num-tech { font-family: var(--font-tech); font-weight: 700; letter-spacing: .02em; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }
table.list { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .95rem; }
table.list th, table.list td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.list th { background: var(--bg-2); color: #6b4a37; font-weight: 700; white-space: nowrap; font-size: .88rem; }
table.list th:first-child { border-top-left-radius: 10px; }
table.list th:last-child { border-top-right-radius: 10px; }
table.list tbody tr:hover td { background: #fffaf5; }
table.list tr.hl td { background: #fff3e6; }
.num { text-align: right !important; white-space: nowrap; }
.total-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding-top: 14px; margin-top: 6px; border-top: 2px dashed var(--line-strong); font-size: 1.1rem; font-weight: 700; }
.total-bar .amount { font-family: var(--font-tech); font-size: 1.6rem; background: var(--grad-hot); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* 手機版：表格轉卡片（table.rtable + td[data-label]） */
@media (max-width: 720px) {
    table.rtable thead { display: none; }
    table.rtable, table.rtable tbody, table.rtable tr, table.rtable td { display: block; width: 100%; }
    table.rtable tr { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; padding: 6px 4px; background: #fff; }
    table.rtable td { border: none; padding: 6px 10px; display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; }
    table.rtable td::before { content: attr(data-label); color: var(--muted); font-size: .84rem; font-weight: 700; }
    table.rtable td.num { text-align: left !important; }
}

/* ---------- 鍵值清單 ---------- */
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; word-break: break-word; }

/* ---------- 報名表：組別選擇 ---------- */
.ev-filter { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 12px; }
.ev-info { display: none; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: linear-gradient(120deg, #fff4e8, #fffaf2); border: 1px solid #ffd9b8; }
.ev-info.show { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.ev-info .fee { margin-left: auto; font-family: var(--font-tech); font-size: 1.35rem; font-weight: 700; color: var(--brand-dark); }

/* ---------- 報名表：人員卡片 ---------- */
.people { display: grid; gap: 12px; }
.person {
    position: relative; border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 14px 12px; background: #fffdfb;
    transition: border-color .15s, box-shadow .15s;
}
.person:focus-within { border-color: #ffbe93; box-shadow: 0 8px 22px -14px rgba(255, 110, 40, .55); }
.person.is-alt { background: #fbf9ff; border-style: dashed; border-color: #d8ccff; }
.person-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.person-no { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 8px; background: var(--text); color: #fff; font-family: var(--font-tech); font-weight: 700; }
.person.is-alt .person-no { background: #6f55d8; }
.person-head .grow { flex: 1; }
.person-head select { width: auto; padding: 5px 10px; font-size: .88rem; }
.add-person { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.counter { font-family: var(--font-tech); font-weight: 700; font-size: 1.05rem; color: var(--brand-dark); }

/* ---------- 同意條款 ---------- */
.consent-box { max-height: 180px; overflow: auto; white-space: pre-line; font-size: .9rem; color: #5b4234; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }

/* ---------- 名單挑選視窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-end; justify-content: center; background: rgba(42, 28, 19, .38); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal.open { display: flex; }
.modal-panel { width: 100%; max-width: 560px; max-height: 86vh; display: flex; flex-direction: column; background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .2); }
.modal-head { padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 8px 10px; overflow: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.pick-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; cursor: pointer; }
.pick-item:hover { background: var(--brand-soft); }
.pick-item input { width: 18px; height: 18px; accent-color: var(--brand); }
.pick-item .sub { color: var(--muted); font-size: .84rem; }
.pick-item.used { opacity: .45; }
@media (min-width: 640px) { .modal { align-items: center; } .modal-panel { border-radius: 20px; } }

/* 服裝尺寸 */
.size-wrap { display: flex; align-items: center; gap: 10px; }
.size-wrap select { flex: 1; min-width: 0; }
.size-chart-link { flex: none; font-size: .88rem; white-space: nowrap; }
.size-chart-modal .modal-panel { max-width: 760px; }
.size-chart-modal .modal-body { padding: 12px; }
.size-chart-modal .modal-body img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 10px; }


/* ---------- 錯誤訊息彈出視窗（MemberUi.Msg / MsgList 的 err） ---------- */
.msg-modal { z-index: 200; align-items: center; }
.msg-modal .modal-panel { max-width: 460px; border-radius: 20px; margin: 0 14px; }
.msg-modal .modal-head h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 1.1rem; }
.msg-modal .msg-ic { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--err); color: #fff; font-weight: 900; flex: none; }
.msg-modal .modal-body { padding: 14px 18px; color: #9b1c1c; line-height: 1.7; }
.msg-modal .modal-body ul { margin: 6px 0 0; padding-left: 20px; }
.msg-modal .modal-foot .btn { min-width: 110px; }

/* ---------- 訂單繳費方式 ---------- */
.pay-options { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.pay-option { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px; background: #fffdfb; }
.pay-option h3 { margin: 0 0 4px; font-size: 1.05rem; }
.pay-option > .muted { margin: 0 0 12px; font-size: .9rem; }
.pay-more summary { cursor: pointer; color: var(--brand-dark); font-weight: 700; }
.pay-more[open] summary { margin-bottom: 4px; }
.bank-box { white-space: pre-line; background: var(--bg-2); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-size: 1rem; line-height: 1.7; }
.pay-card h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.field input[readonly] { background: var(--bg-2); color: #6b4a37; cursor: not-allowed; }

/* ---------- 繳費條碼（沿用） ---------- */
.barcode-box { text-align: center; padding: 16px 0; }
.barcode-box svg { max-width: 100%; height: auto; }
.barcode-label { font-family: Consolas, monospace; font-size: 1rem; letter-spacing: 1px; }

/* 舊版成員列（保留相容） */
.member-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; }
.member-row .btn { padding: 8px 12px; }

/* ---------- RWD ---------- */
@media (max-width: 860px) {
    .topbar { background: rgba(255, 255, 255, .97); }
    .nav-burger { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: #fff; cursor: pointer; }
    .nav-burger span, .nav-burger span::before, .nav-burger span::after { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; position: relative; content: ""; transition: transform .2s; }
    .nav-burger span::before { position: absolute; top: -6px; }
    .nav-burger span::after { position: absolute; top: 6px; }
    .nav { display: none; width: 100%; flex-direction: column; gap: 2px; padding: 6px 0 4px; }
    .nav a { padding: 10px 12px; border-radius: 10px; }
    .nav-toggle:checked ~ .nav { display: flex; }
    .nav-toggle:checked + .nav-burger span { background: transparent; }
    .nav-toggle:checked + .nav-burger span::before { transform: translateY(6px) rotate(45deg); }
    .nav-toggle:checked + .nav-burger span::after { transform: translateY(-6px) rotate(-45deg); }
}
@media (max-width: 560px) {
    .wrap { padding: 16px 12px 48px; }
    .card { padding: 16px; border-radius: 14px; }
    h1 { font-size: 1.35rem; }
    .member-row { grid-template-columns: 1fr; }
    .kv { grid-template-columns: 1fr; }
    .kv dt { margin-top: 6px; }
    .fgrid { grid-template-columns: 1fr; }
    .fgrid .span-2 { grid-column: auto; }
    .addr-grid { grid-template-columns: 1fr 1fr; }
    .addr-grid .zip { grid-column: 1 / -1; }
    .actions .btn { flex: 1 1 auto; }
    .ev-info .fee { margin-left: 0; }
}
@media print {
    .topbar, .actions, .no-print, .modal { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; border-color: #ddd; }
}
