:root {
  /* 第五屆海報配色（2026-10-27） */
  --ink: #163f45;
  --green: #2a8577;
  --green-dark: #1c6c6b;
  --mint: #b1dcd2;
  --ice: #9cc8ec;
  --orchid: #2f6fa6;
  --paper: #f7fbf9;
  --soft: #56706f;
  --line: #d3e4de;
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; color: var(--ink); background: #e6f2ee; font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif; font-size: 18px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.flow-shell { min-height: 100svh; display: grid; grid-template-columns: minmax(0, 43%) minmax(0, 57%); background: var(--paper); }
.flow-visual { position: sticky; top: 0; min-height: 100svh; overflow: hidden; color: #fff; isolation: isolate; }
.flow-visual > img { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.flow-visual-overlay { position: absolute; z-index: -1; inset: 0; background: linear-gradient(180deg, rgba(18, 70, 78, .72) 0%, rgba(18, 70, 78, .4) 14%, rgba(22, 95, 107, .08) 28%, rgba(22, 95, 107, .18) 48%, rgba(20, 78, 86, .88) 74%, rgba(18, 70, 78, .94) 100%), linear-gradient(90deg, rgba(22, 95, 107, .16), transparent); }
.flow-brand { position: absolute; top: 32px; right: clamp(26px, 4vw, 62px); left: clamp(26px, 4vw, 62px); display: inline-flex; align-items: center; gap: 11px; text-shadow: 0 1px 10px rgba(10, 50, 56, .45); }
.flow-brand > span:last-child { display: grid; gap: 4px; min-width: 0; }
.flow-brand strong { font-family: "Noto Serif TC", serif; font-size: 20px; line-height: 1.2; }
.flow-brand small { font-size: 16px; line-height: 1.2; letter-spacing: .04em; }
.brand-mark { width: 40px; height: 40px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 3px; transform: rotate(-8deg); }
.brand-mark span { display: block; border-radius: 2px 2px 1px 1px; }
.brand-mark span:nth-child(1) { height: 62%; background: var(--mint); }
.brand-mark span:nth-child(2) { height: 100%; background: var(--green); }
.brand-mark span:nth-child(3) { height: 76%; background: var(--ice); }
.flow-visual-copy { position: absolute; right: clamp(28px, 4vw, 62px); bottom: 90px; left: clamp(28px, 4vw, 62px); }
.flow-visual-copy p, .eyebrow { margin: 0; color: var(--mint); font-size: 14px; font-weight: 700; letter-spacing: .16em; }
.flow-visual-copy h1 { margin: 0 0 18px; font-family: "Noto Serif TC", serif; font-size: clamp(44px, 5vw, 72px); line-height: 1.22; }
.flow-visual-copy > span { color: rgba(255,255,255,.78); font-size: 17px; line-height: 1.7; }
.flow-form-panel { min-height: 100svh; display: flex; flex-direction: column; background: var(--paper); }
.flow-header { min-height: 82px; display: flex; align-items: center; justify-content: space-between; padding: 20px clamp(28px, 5vw, 72px); border-bottom: 1px solid #e2ece7; color: var(--soft); font-size: 17px; }
.back-link { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.back-link svg { width: 18px; }
.flow-form-wrap { width: min(100%, 570px); margin: auto; padding: 48px 34px 42px; }
.flow-step-row { display: flex; justify-content: space-between; margin-bottom: 9px; color: var(--soft); font-size: 15px; font-weight: 700; letter-spacing: .08em; }
.flow-progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 42px; }
.flow-progress span { height: 3px; border-radius: 2px; background: #dce8e2; }
.flow-progress .done, .flow-progress .active { background: var(--green); }
.flow-intro h2 { margin: 10px 0 10px; font-family: "Noto Serif TC", serif; font-size: clamp(32px, 3.2vw, 44px); line-height: 1.3; }
.flow-intro > p:last-child { margin: 0; color: var(--soft); font-size: 17px; line-height: 1.8; }
.profile-form, .theme-form, .submission-form { display: grid; gap: 17px; margin-top: 32px; }
.profile-field { display: grid; gap: 8px; border: 0; padding: 0; }
.profile-field > span, .profile-field legend { color: var(--ink); font-size: 17px; font-weight: 700; }
.profile-field input, .profile-field select, .profile-field textarea { width: 100%; border: 1px solid #cfddd7; border-radius: 5px; outline: 0; padding: 0 14px; color: var(--ink); background: #fff; font-size: 17px; }
.profile-field input, .profile-field select { height: 51px; }
.profile-field textarea { padding-top: 13px; resize: vertical; }
.profile-field input:focus, .profile-field select:focus, .profile-field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(47,150,119,.1); }
.profile-field input::placeholder, .profile-field textarea::placeholder { color: #9aa9a5; }
.choice-field { display: grid; gap: 10px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-grid label { position: relative; cursor: pointer; }
.choice-grid input, .theme-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice-grid label > span { min-height: 100px; display: grid; align-content: center; gap: 5px; padding: 15px; border: 1px solid var(--line); border-radius: 5px; }
.choice-grid label > span > svg { width: 20px; color: var(--green-dark); }
.choice-grid strong { font-size: 17px; }
.choice-grid small { color: var(--soft); font-size: 15px; }
.choice-grid input:checked + span { border-color: var(--green); background: #eff7f2; box-shadow: 0 0 0 2px rgba(47,150,119,.1); }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; }
.primary-action { min-height: 52px; display: inline-flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 18px 0 20px; border: 1px solid var(--green); border-radius: 5px; color: #fff; background: var(--green); font-size: 17px; font-weight: 700; cursor: pointer; }
.primary-action svg { width: 17px; }
.primary-action:hover { background: var(--green-dark); }
.secondary-action { display: inline-flex; align-items: center; gap: 7px; color: var(--soft); font-size: 16px; }
.secondary-action svg { width: 16px; }
.flow-footer { display: flex; justify-content: space-between; gap: 18px; padding: 20px clamp(28px, 5vw, 72px); border-top: 1px solid #e2ece7; color: #879792; font-size: 14px; }
.theme-choice { position: relative; display: grid; grid-template-columns: 62px 1fr 20px; align-items: center; gap: 17px; min-height: 130px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.theme-choice:hover { border-color: #9ebeb4; }
.theme-choice input:checked + .theme-choice-icon { color: #fff; background: var(--green); }
.theme-choice-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; color: var(--green-dark); background: var(--mint); }
.theme-choice-icon.blue { background: var(--ice); }
.theme-choice-icon svg { width: 24px; }
.theme-choice small { display: block; color: var(--green-dark); font-size: 15px; font-weight: 700; }
.theme-choice strong { display: block; margin-top: 6px; font-family: "Noto Serif TC", serif; font-size: 22px; }
.theme-choice em { display: block; margin-top: 5px; color: var(--soft); font-size: 15px; font-style: normal; line-height: 1.5; }
.theme-choice-arrow { width: 18px; color: var(--green-dark); }
.upload-box { min-height: 180px; display: grid; place-items: center; align-content: center; gap: 9px; padding: 20px; border: 1px dashed #9dbbb1; border-radius: 5px; color: var(--green-dark); background: #f2f8f4; text-align: center; cursor: pointer; }
.upload-box > svg { width: 28px; }
.upload-box strong { font-size: 17px; }
.upload-box span { color: var(--soft); font-size: 15px; }
.upload-box input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.success-panel { display: grid; justify-items: start; gap: 12px; margin-top: 34px; padding: 28px; border: 1px solid #c7dfd2; border-radius: 5px; background: #eef8f2; }
.success-panel > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green); }
.success-panel > span svg { width: 21px; }
.success-panel h3 { margin: 0; font-family: "Noto Serif TC", serif; font-size: 26px; }
.success-panel p { margin: 0 0 8px; color: var(--soft); font-size: 16px; line-height: 1.7; }
.success-panel[hidden] { display: none; }
.success-panel:focus { outline: none; }
.success-panel h3 { color: var(--green-dark); }
.success-facts { width: 100%; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; padding: 14px 16px; border-radius: 5px; background: #fff; font-size: 16px; }
.success-facts:empty { display: none; }
.success-facts dt { color: var(--soft); }
.success-facts dd { margin: 0; font-weight: 600; word-break: break-all; }
.success-tips { margin: 0; padding-left: 20px; color: var(--ink, #1f2a26); font-size: 16px; line-height: 1.7; }
.success-tips li + li { margin-top: 4px; }
@media (max-width: 520px) { .success-panel { padding: 22px 18px; } .success-facts { grid-template-columns: 1fr; gap: 2px; } .success-facts dd { margin-bottom: 6px; } }

@media (max-width: 940px) {
  .flow-shell { display: block; }
  .flow-visual { position: relative; min-height: 330px; }
  .flow-visual-copy { bottom: 45px; }
  .flow-visual-copy h1 { margin: 10px 0; font-size: 40px; }
  .flow-form-panel { min-height: auto; }
  .flow-form-wrap { padding: 38px 22px 48px; }
}
@media (max-width: 520px) {
  body { min-width: 0; overflow-x: hidden; }
  .flow-header { min-height: 70px; padding: 16px 20px; }
  .flow-visual { min-height: 300px; }
  .flow-visual-overlay { background: linear-gradient(180deg, rgba(18, 70, 78, .78) 0%, rgba(18, 70, 78, .5) 30%, rgba(18, 70, 78, .62) 60%, rgba(18, 70, 78, .9) 100%); }
  .flow-brand { top: 22px; right: 20px; left: 20px; }
  .flow-brand strong, .flow-brand small { font-size: 15px; }
  .flow-visual-copy { right: 20px; bottom: 32px; left: 20px; }
  .choice-grid { grid-template-columns: 1fr; }
  .theme-choice { grid-template-columns: 48px 1fr 18px; gap: 12px; padding: 15px; }
  .theme-choice-icon { width: 44px; height: 44px; }
  .theme-choice strong { font-size: 18px; }
  .theme-choice em { font-size: 14px; }
  .flow-footer { align-items: flex-start; flex-direction: column; padding: 18px 20px; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .primary-action { justify-content: center; }
}

/* ---- 後端接入新增 ---- */
.form-notice { margin: 0; padding: 12px 14px; border-radius: 5px; font-size: 16px; line-height: 1.7; }
.form-notice[data-kind="error"] { color: #8a2f2f; background: #fbeeee; border: 1px solid #efcaca; }
.form-notice[data-kind="info"] { color: var(--green-dark); background: #eef7f2; border: 1px solid #c7dfd2; }
.form-notice[data-kind="warn"] { color: #7a5a12; background: #fdf6e3; border: 1px solid #ecdcae; }
.form-notice[hidden] { display: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-hint { color: var(--soft); font-size: 15px; font-weight: 400; }
.team-box { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 5px; background: #f6faf8; }
.team-box[hidden] { display: none; }
.member-row { display: grid; grid-template-columns: 1fr 110px 36px; gap: 10px; align-items: center; }
.member-row input, .member-row select { height: 44px; width: 100%; border: 1px solid #cfddd7; border-radius: 5px; padding: 0 12px; color: var(--ink); background: #fff; font-size: 17px; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--soft); background: #fff; cursor: pointer; }
.icon-button svg { width: 16px; }
.ghost-action { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px dashed #9dbbb1; border-radius: 5px; color: var(--green-dark); background: transparent; font-size: 16px; font-weight: 700; cursor: pointer; }
.ghost-action svg { width: 15px; }
.primary-action:disabled { opacity: .6; cursor: progress; }
.summary-card { display: grid; gap: 8px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 5px; background: #fff; font-size: 16px; }
.summary-card dl { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; margin: 0; }
.summary-card dt { color: var(--soft); }
.summary-card dd { margin: 0; color: var(--ink); font-weight: 600; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 15px; font-weight: 700; background: #eef7f2; color: var(--green-dark); }
.status-pill.warn { background: #fdf6e3; color: #7a5a12; }
.status-pill.bad { background: #fbeeee; color: #8a2f2f; }
.upload-progress { height: 6px; border-radius: 3px; background: #dce8e2; overflow: hidden; }
.upload-progress > span { display: block; height: 100%; width: 0; background: var(--green); transition: width .2s; }
.upload-progress[hidden] { display: none; }
.upload-status { display: grid; gap: 10px; padding: 16px 18px; border: 1px solid #cfe1d8; border-radius: 6px; background: #f6faf8; }
.upload-status[hidden] { display: none; }
.upload-status .upload-progress { height: 10px; border-radius: 5px; }
.upload-status-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; }
.upload-status-top strong { color: var(--green-dark); font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.upload-status-top > span { color: var(--ink); font-size: 17px; font-variant-numeric: tabular-nums; }
.up-cancel { margin-left: auto; min-height: 36px; padding: 0 14px; border: 1px solid #cfd8d2; border-radius: 5px; background: #fff; color: var(--soft); font: inherit; font-size: 15px; cursor: pointer; }
.up-cancel:hover { color: #b3261e; border-color: #e3b6b2; }
.up-cancel[hidden] { display: none; }
.upload-status-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 14px; color: var(--soft); font-size: 16px; font-variant-numeric: tabular-nums; }
.upload-status-tip { margin: 0; color: var(--soft); font-size: 15px; line-height: 1.7; }
.upload-status-tip b { color: var(--ink); }
.upload-box.is-busy { cursor: progress; opacity: .7; }
.visually-hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-file-name { margin-top: -4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--soft); font-size: 15px; }
.upload-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.up-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid #cfd8d2; border-radius: 5px; background: #fff; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
.up-btn svg { width: 16px; height: 16px; }
.up-btn:hover { border-color: var(--green); color: var(--green-dark); }
.up-btn.primary { border-color: var(--green-dark); background: var(--green-dark); color: #fff; }
.up-btn.primary:hover { color: #fff; filter: brightness(1.08); }
.up-btn.danger { margin-left: auto; color: #b3261e; }
.up-btn.danger:hover { border-color: #e3b6b2; color: #b3261e; }
.up-btn[hidden] { display: none; }
/* 已上傳影片卡片：更換 / 刪除 */
.video-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid #cfe1d8; border-radius: 6px; background: #f6faf8; }
.video-card[hidden] { display: none; }
.video-card > svg { flex: none; width: 28px; height: 28px; color: var(--green-dark); }
.video-card-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.video-card-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 17px; }
.video-card-info span { color: var(--soft); font-size: 15px; }
.video-card-actions { flex: none; display: flex; gap: 8px; }
.vc-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--green); border-radius: 5px; background: #fff; color: var(--green-dark); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.vc-btn svg { width: 16px; height: 16px; }
.vc-btn:hover { background: #eef7f2; }
.vc-btn.danger { border-color: #e3b6b2; color: #b3261e; font-weight: 600; }
.vc-btn.danger:hover { background: #fbeeee; }
.resume-notice .link-btn { padding: 0 2px; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
@media (max-width: 520px) {
  .video-card { flex-wrap: wrap; }
  .video-card-actions { width: 100%; }
  .video-card-actions .vc-btn { flex: 1; justify-content: center; }
  .up-btn { flex: 1 1 auto; justify-content: center; }
  .up-btn.danger { margin-left: 0; }
}
/* 家長／監護人同意書 */
.consent-block { display: grid; gap: 10px; }
.consent-block .profile-field { margin: 0; }
.consent-help { margin: 0; color: var(--soft); font-size: 16px; line-height: 1.7; }
.consent-help a { color: var(--green-dark); font-weight: 700; }
.upload-box.consent-upload { position: relative; min-height: 120px; }
.upload-box[hidden], .upload-progress[hidden] { display: none; }
.consent-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.consent-list li { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 5px; background: #fff; font-size: 16px; }
.consent-list li svg { flex: none; width: 20px; color: var(--green-dark); }
.consent-list .consent-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 600; }
.consent-list small { flex: none; color: var(--soft); font-size: 14px; }
.consent-list li.empty { color: var(--soft); background: #fafbfa; border-style: dashed; }
.consent-list .link { flex: none; padding: 4px 2px; border: 0; background: none; color: var(--green-dark); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.consent-list .link.danger { color: #b3261e; }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; line-height: 1.7; color: var(--ink); cursor: pointer; }
.check-line input { margin-top: 4px; accent-color: var(--green); }
.account-bar { display: flex; align-items: center; gap: 12px; }
.account-bar button { border: 0; padding: 0; color: var(--green-dark); background: none; font-size: 15px; font-weight: 700; cursor: pointer; }
.theme-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 14px; }
.flow-form-wrap.wide { width: min(100%, 640px); }
video.preview { width: 100%; max-height: 300px; border-radius: 5px; background: #000; }
@media (max-width: 520px) {
  .field-row { grid-template-columns: 1fr; }
  .member-row { grid-template-columns: 1fr 90px 36px; }
}

/* 報名完成頁 */
.complete-hero { margin-top: 0; }
.complete-hero .eyebrow { margin: 0; }
.next-steps { margin-top: 20px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.next-steps[hidden] { display: none; }
.next-steps h4 { margin: 0 0 14px; font-size: 17px; }
.next-steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.next-steps li { position: relative; display: grid; gap: 2px; padding-left: 26px; font-size: 16px; }
.next-steps li::before { content: ""; position: absolute; left: 0; top: 3px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #c9d8d0; background: #fff; }
.next-steps li.done::before { border-color: var(--green); background: var(--green); }
.next-steps li.active::before { border-color: var(--green); }
.next-steps li.bad::before { border-color: #b84a4a; background: #b84a4a; }
.next-steps li span { color: var(--soft); line-height: 1.6; }
.form-actions a.secondary-action { text-decoration: none; }
.form-actions [hidden] { display: none !important; }
.summary-card[hidden] { display: none; }
/* 影片格式建議 */
.format-tip { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: 5px; background: #f4f8f6; border: 1px solid var(--line); color: var(--soft); font-size: 15px; line-height: 1.75; }
.format-tip > svg { flex: none; width: 16px; margin-top: 2px; color: var(--green-dark); }
.format-tip b { color: var(--ink); }
.form-notice a { color: inherit; font-weight: 700; }
.flow-footer a { color: inherit; text-decoration: underline; }

/* 触屏：放大可点区域（不影响桌面） */
@media (pointer: coarse) {
  .back-link, .secondary-action { min-height: 44px; }
  .account-bar button { min-height: 40px; padding: 0 6px; font-size: 16px; }
  .flow-footer a { display: inline-flex; align-items: center; min-height: 40px; }
}
