/* ==========================================================================
   配色沿用外部 var.css（--mainColor / --formSubTitleColor / --mainBg …），保留 bg.png 背景。
   驗證勾勾(綠/粉)為功能性指示，與各表單一致。
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@100..900&display=swap');

/* ── 功能性 token（非 var.css 色彩計劃，屬語意指示與中性色）── */
:root {
    --ok: #00AA00;
    --req: #ff256e;
    --ink: #202d4a;
    --ink-soft: #ebebeb;
    --line: #ddefee;
    --ring: rgba(3, 135, 191, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans TC', sans-serif;
}

/* ── Page（保留背景圖 bg.png + var.css 底色）── */
body {
    background-image: url(https://www.beyond-coding.org.tw/children-camp/images/bg.png),
        linear-gradient(90deg, var(--mainBg), var(--mainBg));
    min-height: 100vh;
    position: relative;
}

.wrapper {
    max-width: 1200px;
    margin: auto;
    background: #fff;
    box-shadow: 0 0 15px rgba(99, 53, 0, 0.18);
    padding-bottom: 40px;
    position: relative;
    min-height: 100vh;
}

.version {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 14px;
    color: #00d5ff;
    z-index: 9999;
}

/* ==========================================================================
   Header
   ========================================================================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 20px 50px 10px;
    border-bottom: 2px solid var(--formSubTitleColor);
    width: 90%;
    margin: 0 auto;
}

.header img {
    width: 350px;
}

.header h1 {
    color: var(--formSubTitleColor);
    font-size: 30px;
    letter-spacing: 2px;
    font-weight: 700;
    margin: 0;
}

.prev {
    width: 90%;
    margin: 15px auto 0;
    padding: 0 50px;
}

.prev a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--formAddCourseColor);
    font-weight: 500;
    font-size: 18px;
    text-decoration: none;
}

.prev a svg {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    transition: transform 0.4s;
}

.prev a:hover svg {
    transform: translateX(-10px);
}

/* ── 類別大標 + 優惠檔期 + 倒數 ── */
.class_name {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--formSubTitleColor);
    width: 90%;
    margin: 25px auto 0;
    padding: 0 50px 10px;
}

.class_name br {
    display: none;
}

.p_inline {
    display: inline;
}
.remark {
    font-size: 16px;
    font-weight: 500;
    color: var(--formAddCourseColor);
    margin: 12px auto 20px;
    line-height: 1.6;
}
.remark i {
    margin: 0 6px;
}

/* ==========================================================================
   優惠倒數計時（沿用原本樣式 + var.css）
   ========================================================================== */
.salestime {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin: 20px auto 0;
}

.salestime > p {
    font-size: 22px;
    font-weight: 600;
    color: var(--formSubTitleColor);
}

.salestime p span {
    color: var(--formAddCourseColor);
    font-size: 1.1em;
}

.timer {
    background-image: url(https://www.beyond-coding.org.tw/children-camp/images/timer-bg-phone.png);
    background-size: 100%;
    background-repeat: no-repeat;
    width: 450px;
    max-width: 92vw;
    height: 90px;
    padding: 10px 5px;
    margin: 8px auto 0;
}

.timer h2 {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 1px;
    text-align: left;
    line-height: 30px;
    color: #292929;
    padding: 0 0 0 30px;
}

.timer .countdown {
    display: flex;
    justify-content: start;
    align-items: center;
    text-align: center;
    margin: -5px 0 0 30px;
}

.timer .countdown p {
    color: #292929;
    font-weight: 500;
    font-size: 20px;
}

.timer .countdown .date {
    display: flex;
    justify-content: center;
    flex-direction: row;
}

.timer .countdown .date span {
    color: #f6ff00;
    text-shadow: 0 0 5px #202d4a , 0 0 10px #202d4a;
    font-size: 22px;
    font-weight: 600;
    margin: -2px 5px 0;
}

.timer .countdown .date p {
    margin: 0 5px;
}

.timer .timeover {
    color: #292929;
    font-weight: 500;
    font-size: 0.7em;
    text-align: center;
    letter-spacing: 2px;
    margin-top: -20px;
}

/* 倒數防呆：JS 判定已截止時，隱藏數字、放大截止字樣 */
.timer.is-over .countdown {
    display: none;
}

.timer.is-over h2 {
    text-align: center;
    padding: 0;
}

.timer.is-over .timeover {
    font-size: 1.1em;
    padding-top: 12px;
}

/* ==========================================================================
   Section Card
   ========================================================================== */
form {
    padding: 10px 15px;
}

.section-card {
    margin: 0 32px 28px;
    border: 1px solid var(--mainBg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(99, 53, 0, 0.08);
}

.section-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px;
    background: var(--mainBg);
    border-bottom: 1px solid var(--mainBg);
}

.section-head-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #204abe;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    color: #e4f8ff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.section-head-text h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--titleH2);
    letter-spacing: 1px;
    margin: 0;
}

.section-head-text p {
    font-size: 14px;
    color: var(--ink-soft);
    margin: 4px 0 0;
}

.section-body {
    padding: 24px 30px;
    background: #f7feff;
}

.section-divider {
    height: 1px;
    background: var(--line);
    margin: 20px 0;
}

.sub-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--formSubTitleColor);
    letter-spacing: 1px;
    margin-bottom: 15px;
}

/* ==========================================================================
   Field rows & items
   ========================================================================== */
.field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 20px;
}

.field-row:last-child {
    margin-bottom: 0;
}

.field-item {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 15px 0;
}

.field-item.full {
    flex: 1 1 100%;
}

.field-item.third {
    flex: 1 1 30%;
}

.field-item label,
.field-item > label {
    font-size: 18px;
    font-weight: 600;
    line-height: 28px;
    color: var(--ink);
    display: flex;
    align-items: center;
    margin: 0;
}

/* ── 必填驗證 ok icon ── */
.ok {
    position: relative;
    display: inline-flex;
    width: 20px;
    height: 20px;
    margin-right: 6px;
    flex-shrink: 0;
    transform: translateY(-2px);
}

.ok i:nth-child(1) {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    color: var(--req);
    font-size: 15px;
    transition: 0.5s;
}

.ok i:nth-child(2) {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 9;
    transform: rotate(-180deg);
    color: var(--ok);
    font-size: 15px;
    opacity: 0;
    visibility: hidden;
    transition: 0.5s;
}

.field-item:has(input:valid:not(:placeholder-shown)):not(:has(input:invalid)):not(:has(select:invalid)) .ok i:nth-child(1),
.field-item:has(select:valid):not(:has(select:invalid)):not(:has(input:invalid)) .ok i:nth-child(1) {
    opacity: 0;
    visibility: hidden;
    transform: rotate(180deg);
}

.field-item:has(input:valid:not(:placeholder-shown)):not(:has(input:invalid)):not(:has(select:invalid)) .ok i:nth-child(2),
.field-item:has(select:valid):not(:has(select:invalid)):not(:has(input:invalid)) .ok i:nth-child(2) {
    opacity: 1;
    visibility: visible;
    transform: rotate(0deg);
}

/* ── input ── */
.field-item input[type="text"],
.field-item input[type="email"],
.field-item input[type="tel"],
.section-body input[type="text"] {
    width: 100%;
    height: 44px;
    border: 1px solid #a8b7d9;
    border-radius: 8px;
    padding: 5px 15px;
    font-size: 16px;
    color: var(--ink);
    background: #fff;
    transition: 0.3s;
    outline: none;
}

.field-item input[type="text"]:focus,
.field-item input[type="email"]:focus,
.field-item input[type="tel"]:focus,
.section-body input[type="text"]:focus {
    border-color: var(--mainBg);
    box-shadow: 0 0 0 3px var(--ring);
}

/* ── select ── */
.field-item select,
.section-body select {
    width: 100%;
    height: 44px;
    border: 1px solid #a8b7d9;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 16px;
    color: var(--ink);
    background: #fff;
    outline: none;
    transition: 0.3s;
    appearance: auto;
}

.field-item select:focus,
.section-body select:focus {
    border-color: #e4f8ff;
    box-shadow: 0 0 0 3px var(--ring);
}

.date-selects {
    display: flex;
    gap: 15px;
}

.date-selects select {
    flex: 1;
}

.field-item input[type="radio"],
.field-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    accent-color: var(--mainBg);
    cursor: pointer;
}

/* ==========================================================================
   Chip 選擇器（性別 / 午餐 / 校區 / 得知消息 / 是否）
   ========================================================================== */
.yn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.yn-row.wrap-chips {
    gap: 8px;
}

.yn-row.wrap-chips .yn-card {
    flex: 0 0 auto;
    width: auto;
    border-radius: 10px;
    padding: 10px 18px;
}

.yn-card {
    flex: 1;
    border: 1px solid #a8b7d9;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.3s;
    background: #fff;
    min-width: 120px;
}

.yn-card:hover {
    border-color: #e4f8ff;
    box-shadow: 0 3px 8px rgba(191, 91, 3, 0.08);
}

.yn-card input[type="radio"],
.yn-card input[type="checkbox"] {
    display: none;
}

.yn-card p {
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    margin: 0;
}

.yn-card:has(input:checked) {
    border: 2px solid var(--mainBg);
    background: #e4f8ff;
    box-shadow: 0 4px 10px rgba(3, 138, 191, 0.12);
}

.yn-card:has(input:checked) p {
    color: var(--formSubTitleColor);
}

/* 校區 chip */
.yn-card.campus {
    text-align: center;
    justify-content: center;
}

.yn-card.campus p {
    font-size: 18px;
    letter-spacing: 1px;
}

.yn-card.campus:has(input:checked) {
    background: var(--campus-color, #e4f8ff);
    border-color: var(--campus-color, #e4f8ff);
}

.yn-card.campus:has(input:checked) p {
    color: #fff;
}

/* 隱藏校區（例：重慶）— 不顯示按鈕 */
.yn-card.campus-hidden {
    display: none;
}

/* ==========================================================================
   開課狀態表（courseIntro，預設隱藏，toggle.js 顯示）
   ========================================================================== */

/* ==========================================================================
   選課區塊（chooseCourse，預設隱藏，toggle.js 顯示為 block）
   ========================================================================== */

.choose-hint {
    width: 100%;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
    margin: 25px auto 0;
}

/* ==========================================================================
   方案 / 加購（直式卡片）
   ========================================================================== */
.plan-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.plan-card {
    border: 1px solid #a8b7d9;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: 0.3s;
    background: #fff;
}

.plan-card:hover {
    border-color: #e4f8ff;
    box-shadow: 0 3px 8px rgba(191, 91, 3, 0.08);
}

.plan-card input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--mainBg);
    flex-shrink: 0;
    cursor: pointer;
}

.plan-card p {
    font-size: 17px;
    font-weight: 500;
    color: var(--ink);
    margin: 0;
    cursor: pointer;
}

.plan-card:has(input:checked) {
    border: 2px solid var(--mainBg);
    background: #e4f8ff;
    box-shadow: 0 4px 10px rgba(191, 91, 3, 0.12);
}

.plan-card:has(input:checked) p {
    color: var(--mainBg);
    font-weight: 700;
}

/* 加購 banner 圖 */

/* ==========================================================================
   繳費方式 — 2x2 Grid
   ========================================================================== */

.pay-card {
    border: 1px solid #a8b7d9;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: 0.3s;
    background: #fff;
}

.pay-card:hover {
    border-color: #e4f8ff;
    box-shadow: 0 3px 8px rgba(3, 69, 191, 0.15);
}

.pay-card:has(input:checked) {
    border: 2px solid var(--mainBg);
    background: #e4f8ff;
    box-shadow: 0 5px 15px rgba(3, 69, 191, 0.15);
}

.pay-card input[type="radio"] {
    display: none;
}

.pay-card>i {
    font-size: 20px;
    color: rgb(100, 144, 153);
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: #ddf2f3;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.pay-card:has(input:checked)>i {
    background: var(--mainBg);
    color: #fff;
}

.pay-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
}

.pay-sub {
    font-size: 14px;
    color: var(--ink);
    margin-top: 2px;
}

/* ==========================================================================
   送出按鈕
   ========================================================================== */

/* ==========================================================================
   Modal
   ========================================================================== */
.modal-header {
    background: var(--mainBg);
    border-bottom: 1px solid var(--formSubTitleColor);
}

.modal-title {
    color: var(--mainLight);
    font-weight: 700;
    font-size: 20px;
}

.modal .modal-content i{
    color: #e4f8ff;
    cursor: pointer;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .wrapper {
        margin: 0;
        border-radius: 0;
        padding-bottom: 20px;
        box-shadow: none;
    }
    .timer {
        display: flex;
        justify-content: flex-start;
        align-items: flex-start;
        flex-direction: column;
    }
    .timer h2 {
        font-size: 0.7em;
        margin-left: 5px;
        margin-top: -10px;
    }
    .timer .countdown .date span {
        font-size: 18px;
    }
    .timer .countdown .date p {
        margin: 0 5px;
        font-size: 15px;
    }
    .timer .timeover {
        margin-top: -5px;
        margin-left: 5px;
        font-size: 0.6em;
    }

    .header {
        flex-direction: column;
        text-align: center;
        padding: 30px 15px 15px;
        gap: 10px;
    }

    .header img {
        margin: 0 auto;
        width: 250px;
    }

    .header h1 {
        font-size: 24px;
    }

    .prev {
        padding: 0 15px;
    }

    .class_name {
        padding: 0 15px 10px;
        font-size: 20px;
    }

    .section-card {
        margin: 0 5px 15px;
        border-radius: 10px;
    }

    .section-body {
        padding: 15px 12px;
    }

    .field-row {
        gap: 12px;
    }

    .field-item {
        flex: 1 1 100% !important;
    }

    .yn-row {
        flex-direction: column;
    }

    .yn-row.wrap-chips {
        flex-direction: row;
    }

    .yn-row.wrap-chips .yn-card {
        width: calc(50% - 4px);
        box-sizing: border-box;
    }

    .yn-card {
        width: 100%;
    }
}

@media (max-width: 450px) {
    .salestime > p {
        font-size: 18px;
    }
    .timer {
        margin-top: -10px;
        width: 100%;
        height: 78px;
    }
    .prev a{
        font-size: 16px;
    }
    .lang-toggle {
        font-size: 10px !important;
    }
    .section-head-text h3 {
        font-size: 20px;
        font-weight: 600;
    }
}
/* ==========================================================================
   中／英切換按鈕
   ========================================================================== */
.lang-toggle {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 9999;
    background: var(--mainLight);
    color: var(--mainBg);
    border: none;
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 229, 255, 0.25);
    transition: 0.3s;
}
.lang-toggle:hover { 
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 255, 251, 0.35);
}
.lang-toggle.is-en { 
    background: var(--mainLight);
}

/* ==========================================================================
   營隊開課「可點選偽表格」＋名額＋加購區＋套票視窗（冬令營大改版）
   —— 每一行一個設定，方便人工維護
   ========================================================================== */

/* 校區課表預設隱藏，由 toggle.js 依所選校區顯示 */
.campCourse {
    display: none;
}
.week-addon[hidden] {
    display: none !important;
}

/* ── 偽表格容器 ── */
.camp-thead,
.camp-row {
    display: grid;
    grid-template-columns: 1.05fr 1fr 1fr 1fr;
}
.camp-th {
    padding: 14px 10px;
    text-align: center;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 1px;
}
.camp-week {
    border-top: 1px solid var(--line, #e3e8f0);
    position: relative;
}
.camp-row {
    position: relative;
}

/* ── 日期格 ── */
.camp-date {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 10px;
    text-align: center;
    font-weight: 700;
    color: #4a5a78;
    background: #f6f9fc;
    font-size: 16px;
}

/* ── 課程格（可點選）── */
.camp-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 150px;
    padding: 24px 12px 20px;
    border-left: 1px solid var(--line, #eef1f7);
    cursor: pointer;
    transition: 0.2s;
    text-align: center;
}
.camp-cell input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.camp-cell:hover {
    background: #f2f7ff;
}
.camp-cell:has(input:checked) {
    background: #eaf3f8;
    box-shadow: inset 0 0 0 3px var(--campus-color, #008141);
}

/* 角標（代號）— 電腦版放大 */
.cell-badge {
    position: absolute;
    top: 7px;
    right: 9px;
    font-size: 16px;
    font-weight: 800;
    color: var(--campus-color, #008141);
}
.cell-logo {
    max-width: 152px;
    max-height: 66px;
    object-fit: contain;
}

/* 名額狀態徽章 */
.cell-status {
    position: absolute;
    top: 7px;
    left: 9px;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 8px;
}
.camp-cell.is-soon .cell-status {
    background: #fff3cd;
    color: #9a6a12;
}
.camp-cell.is-last .cell-status {
    background: #ffe0e0;
    color: #c0392b;
}

/* 額滿：不可點 + 校區標準色覆蓋(opacity 0.4) + 「額滿」字壓在覆蓋層之上 */
.camp-cell.is-full {
    cursor: not-allowed;
}
.camp-cell.is-full .cell-status {
    display: none;
}
.camp-cell.is-full::before {
    /* 覆蓋色＝校區標準色，透明度 0.4（可自行調整數字）*/
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: var(--campus-color, #008141);
    opacity: 0.4;
}
.camp-cell.is-full::after {
    content: "額滿";
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 4px;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* 清除選項鈕：絕對定位於日期格左上，選了該列才出現 */

/* ── 每週加購區 ── */
.week-addon {
    padding: 16px 18px;
    background: #f5f9ff;
    border-top: 2px dashed var(--campus-color, #008141);
}
.addon-head {
    font-size: 17px;
    font-weight: 800;
    color: var(--ink, #202d4a);
}
.addon-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 4px 0 10px;
    color: #5a6a85;
    font-weight: 600;
    font-size: 14px;
}
.addon-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.addon-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--line, #e3e8f0);
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
}
.addon-item:has(input:checked) {
    border: 2px solid var(--ink, #202d4a);
    background: #eef2f9;
}
.addon-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--ink, #202d4a);
    flex-shrink: 0;
}

/* 本週小計 */
.addon-week-total {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #cfd8e8;
    text-align: right;
    font-weight: 700;
    color: var(--ink, #202d4a);
}
.addon-week-total-num {
    font-size: 20px;
    font-weight: 800;
    color: #e0002c;
}

/* ── 套票方案加購視窗（深藍色票，教材圖文比照 member）── */

/* 單報方案動態檔期字 */
.single-plan-text .salesname,
.single-plan-text .salesdate {
    font-weight: 800;
    color: #c0392b;
}

/* ── Modal 應繳金額（紅字放大）+ 計算備註（灰字）── */

/* ── RWD：≤768 改直列排版 ── */
@media (max-width: 768px) {
    .camp-thead {
        display: none;
    }
    .camp-row {
        grid-template-columns: 1fr;
    }
    /* 手機版縮小 logo 與課名，避免遮住右上角代號 */
    .camp-cell .cell-logo {
        max-width: 76px;
        max-height: 44px;
    }
    .camp-cell .cell-name {
        font-size: 15px;
    }
    .cell-badge {
        top: 8px;
        right: 12px;
        font-size: 13px;
    }
    .cell-status {
        position: static;
        margin-left: auto;
    }
    /* 清除鈕壓在最上方日期色條右側，不覆蓋下方課程訊息 */
}

/* ==========================================================================
   RWD 微調（平板 / 手機）— 本區為後補覆寫，勝過上方同名規則
   ========================================================================== */
/* 平板：偽表格 logo 與課名縮小，代號(角標)維持不變 */
@media (min-width: 769px) and (max-width: 1024px) {
    .cell-logo {
        max-width: 112px;
        max-height: 52px;
    }
    .cell-name {
        font-size: 17px;
    }
}

/* 手機微調 */
@media (max-width: 768px) {
    /* 地址：第三格(手寫)斷行至下一列，避免被擠成一小塊 */
    .date-selects {
        flex-direction: row;
        gap: 8px;
        flex-wrap: wrap;
    }
    #connection-address {
        flex: 1 1 100%;
        margin-top: 8px;
    }
    /* 偽表格每格上下 padding 拉大，減少壅擠 */
    .camp-cell {
        flex-direction: row;
        justify-content: flex-start;
        gap: 14px;
        min-height: auto;
        padding: 14px 56px 14px 12px;
        border-left: none;
        border-top: 1px solid var(--line, #eef1f7);
        padding-top: 20px;
        padding-bottom: 20px;
    }
    /* 本週小計 / 金額文字縮小 */
    .addon-week-total {
        font-size: 14px;
    }
    .addon-week-total-num {
        font-size: 16px;
    }
    /* 教材選擇：圖在上、文字在下，圖縮小約 80px */
    .material-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .material-row .addon-mini-img {
        width: 72px;
        height: auto;
    }
}

/* Modal 總計金額縮小（各裝置一致）*/

/* 教材列文字群組（checkbox+文字）：桌機與圖並排，手機時位於圖下方 */
.material-row .mat-text {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* ==========================================================================
   購物車式流程：方案閘門 / 兩段式預覽 / 報名鈕 / 購物車（大改版）
   ========================================================================== */
/* 方案未選前鎖住校區 */
.plan-gate-hint {
    color: #c0392b;
    font-weight: 600;
    font-size: 15px;
    margin: 4px 0 10px;
}
#campusMount.is-locked {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.4);
}

/* 格子預覽 / 已報名 高亮 */
.camp-cell.is-preview {
    background: #fff8e6;
    box-shadow: inset 0 0 0 3px #f0b429;
}
.camp-cell.is-committed,
.camp-cell:has(input:checked) {
    background: #eaf3f8;
    box-shadow: inset 0 0 0 3px var(--campus-color, #008141);
}

/* 每週預覽區（點格子後出現） */
.week-preview {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 20px;
    padding: 16px 18px;
    background: #fffdf5;
    border-top: 2px dashed var(--campus-color, #008141);
}
.week-preview .wp-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 160px;
}
.week-preview .wp-course {
    font-size: 17px;
    font-weight: 800;
    color: var(--ink, #202d4a);
}
.week-preview .wp-date {
    font-size: 14px;
    color: #5a6a85;
}
.week-preview .wp-price {
    display: flex;
    align-items: baseline;
    gap: 12px;
}
.commitBtn {
    margin-left: auto;
    border: none;
    cursor: pointer;
    background: var(--campus-color, #16233f);
    color: #fff;
    border-radius: 24px;
    padding: 10px 26px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    transition: 0.2s;
}
.commitBtn:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

/* 移除此梯 */
.removeWeek {
    margin-top: 12px;
    border: 1px solid #f0b4b4;
    background: #fff;
    color: #c0392b;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.removeWeek:hover {
    background: #fff0f0;
}

/* 購物車固定按鈕（右下）+ 價格色塊 */
.cart-fab {
    position: fixed;
    right: 50px;
    bottom: 50px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
}
.cart-fab:hover {
    transform: translateY(-2px);
}
.cart-fab img {
    width: 62px;
    height: 62px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}
.cart-fab.has-items .cart-total {
    background: #e0002c;
}

/* 購物車 modal 內容 */
.cart-empty {
    color: #5a6a85;
    text-align: center;
    padding: 20px 0;
}
.cart-planline {
    font-weight: 800;
    color: var(--ink, #202d4a);
    background: #eef2f9;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
}
.cart-week {
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.cart-week-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 800;
    color: var(--ink, #202d4a);
    margin-bottom: 8px;
}
.cart-del-week {
    border: 1px solid #f0b4b4;
    background: #fff;
    color: #c0392b;
    border-radius: 16px;
    padding: 3px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.cart-lines {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cart-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    color: #33405a;
}
.cart-line .cart-del-line {
    margin-right: 8px;
    border: none;
    background: #f3f5f9;
    color: #c0392b;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    line-height: 1;
    font-size: 12px;
    cursor: pointer;
}
.cart-week-sub {
    text-align: right;
    margin-top: 8px;
    color: var(--ink, #202d4a);
}
.cart-grandtotal {
    text-align: right;
    font-size: 20px;
    font-weight: 800;
    color: #e0002c;
    border-top: 2px solid #e3e8f0;
    padding-top: 12px;
    margin-top: 6px;
}

/* 手機：購物車按鈕縮小、靠邊 */
@media (max-width: 768px) {
    .cart-fab img {
        width: 52px;
        height: 52px;
    }
    .week-preview .wp-sale {
        font-size: 20px;
    }
}

/* ==========================================================================
   需求修改 v2：預覽價字級 / 取消選取 / 購物車色塊 / 跨校區鎖 / 教材圖 / 折扣區
   （本區為最後覆寫，勝過上方同名規則）
   ========================================================================== */
/* 預覽：原價劃線、優惠價字級縮小 */
.week-preview .wp-orig {
    font-size: 15px;
    color: #9aa4b5;
    text-decoration: line-through;
}
.week-preview .wp-sale {
    font-size: 20px;
    font-weight: 800;
    color: #e0002c;
}

/* 取消選取（次要按鈕） */
.cancelPreview {
    border: 1px solid #cfd8e8;
    background: #fff;
    color: #5a6a85;
    border-radius: 24px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.cancelPreview:hover {
    background: #f3f5f9;
}

/* 購物車價格色塊：電腦大一些 */

/* 跨校區防重：已在他校報名的該週整列鎖住 */
.camp-row.week-locked {
    opacity: 0.5;
    filter: grayscale(0.5);
}
.camp-row.week-locked .camp-cell {
    pointer-events: none;
    cursor: not-allowed;
}
.camp-row.week-locked .camp-date::after {
    content: "已於其他校區選取";
    display: block;
    font-size: 12px;
    color: #c0392b;
    margin-top: 4px;
}

/* 套票 / member 加購區教材圖（比照 member 尺寸，避免原圖過大） */
.week-addon .material-row .addon-mini-img {
    width: 110px;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

/* 購物車折扣區 */
.cart-discounts {
    border-top: 1px dashed #e3e8f0;
    margin-top: 10px;
    padding-top: 10px;
}
.cart-discounts-title {
    font-weight: 800;
    color: var(--ink, #202d4a);
    margin-bottom: 6px;
}
.cart-discount-line span:last-child {
    color: #e0002c;
    font-weight: 700;
}

/* 手機微調：購物車色塊縮小、報名鈕不滿版、教材圖再小 */
@media (max-width: 768px) {
    .commitBtn {
        margin-left: 0;
        width: auto;
        padding: 10px 20px;
    }
    .week-addon .material-row .addon-mini-img {
        width: 72px;
    }
}

/* ==========================================================================
   點數制套票：預覽動作列 / 套票扣點+單價購買 按鈕 / 剩餘點數
   ========================================================================== */
.wp-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
    flex-wrap: wrap;
    align-items: center;
}
.wp-actions .commitBtn {
    margin-left: 0;
}
/* 套票扣點：實心；單價購買：外框 */
/* 套票剩餘點數提示 */
@media (max-width: 768px) {
    .wp-actions {
        width: 100%;
        margin-left: 0;
    }
    .wp-actions .commitBtn,
    .wp-actions .cancelPreview {
        flex: 1;
    }
}

/* ==========================================================================
   購物車 open/close 圖切換 + 電腦版加大 + 加購問號 tooltip
   ========================================================================== */
/* 兩張圖：預設(0元)顯示 close，有課程(has-items)顯示 open */
.cart-fab .cart-ico-open {
    display: none;
}
.cart-fab.has-items .cart-ico-close {
    display: none;
}
.cart-fab.has-items .cart-ico-open {
    display: block;
}
/* 電腦版價格色塊字放大 */
.cart-fab .cart-total {
    margin-top: -6px;
    min-width: 96px;
    text-align: center;
    background: var(--ink, #202d4a);
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    border-radius: 14px;
    padding: 4px 10px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

/* 加購「?」說明 icon + tooltip（hover 逾 1 秒才顯示）*/
.addon-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    color: var(--formSubTitleColor, #0387bf);
    cursor: help;
}
.addon-help > i {
    font-size: 16px;
}
.addon-help:hover .addon-tip,
.addon-help:focus .addon-tip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.2s ease 1s, visibility 0s linear 1s, transform 0.2s ease 1s;
}

@media (max-width: 768px) {
    .cart-fab .cart-total {
        font-size: 13px;
        min-width: 78px;
    }
}

/* ==========================================================================
   v3 微調：tooltip 不被裁切 / 購物車圖加大 / 點數字級 / 移除全部
   ========================================================================== */
/* tooltip 被 .camp-table 的 overflow:hidden 裁掉 → 改為 visible，
   並把圓角改標在表頭，維持外觀 */
.camp-table {
    width: 100%;
    background: #fff;
    border: 1px solid var(--line, #e3e8f0);
    border-radius: 14px;
    overflow: visible;
    margin-top: 6px;
    box-shadow: 0 6px 18px rgba(32, 45, 74, 0.06);
}
.camp-thead {
    background: var(--campus-color, #008141);
    color: #fff;
    border-radius: 14px 14px 0 0;
}
.addon-tip {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    width: 280px;
    max-width: min(320px, 88vw);
    background: #202d4a;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.6;
    text-align: left;
    padding: 10px 12px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.2s ease, visibility 0s linear 0.2s, transform 0.2s ease;
    z-index: 30;
    pointer-events: none;
    white-space: normal;
}

/* 購物車書包圖：電腦版加大（原本 .cart-fab img 被更具體的 .cart-fab .cart-ico 蓋過，
   所以你改 img 沒反應；這裡直接改 .cart-ico）*/

/* 套票剩餘點數：字小、細 */
.plan-points {
    display: inline-block;
    font-weight: 300;
    color: var(--ink, #202d4a);
    background: #eef2f9;
    border: 1px solid #d7deea;
    border-radius: 10px;
    padding: 8px 14px;
    margin: 0 0 12px;
    font-size: 13px;
}

/* 購物車「移除全部」：紅框紅字、無色塊（放 footer 左下）*/
.cart-clear-all:hover {
    background: #fff0f2;
}

@media (max-width: 768px) {
    /* 手機 tooltip：置中、限制寬度，避免超出畫面被切 */
    .addon-tip {
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(4px);
        width: min(300px, 90vw);
    }
    .addon-help:hover .addon-tip,
    .addon-help:focus .addon-tip {
        transform: translateX(-50%) translateY(0);
    }
}

/* ==========================================================================
   v4 微調：時時學語言 radio / 課名粗細 / 移除全部粗細 / 購物車圖尺寸收尾
   ========================================================================== */
/* 時時學：勾選後彈出的語言選擇（Scratch / Minecraft 擇一）*/

/* 表格課名：粗細 500 */
.cell-name {
    font-weight: 500;
    font-size: 20px;
    color: var(--ink, #202d4a);
    line-height: 1.35;
}

/* 移除全部：字重 400 */
.cart-clear-all {
    background: none;
    border: 1.5px solid #e0002c;
    color: #e0002c;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: 0.2s;
}

/* 購物車書包圖：電腦版 110（此為最終規則）；手機維持較小，放在最後才不會被上面的桌機規則蓋到 */
.cart-fab .cart-ico {
    width: 110px;
    height: 110px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}
@media (max-width: 768px) {
    .cart-fab .cart-ico {
        width: 58px;
        height: 58px;
    }
}

/* ==========================================================================
   v5：電腦版梯次格子間距內縮（logo↔課名 更近、上下 padding 更小）
   ========================================================================== */
@media (min-width: 769px) {
    .camp-cell {
        gap: 5px;
        padding-top: 14px;
        padding-bottom: 12px;
        min-height: 118px;
    }
}

/* ==========================================================================
   Wizard 4 步驟：步驟樹 / panel 切換 / 底部按鈕 / 付款直列 / step2 優惠 / 鎖列
   ========================================================================== */
.wizard-step[hidden] {
    display: none !important;
}

/* 步驟樹 */
.step-tree {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    max-width: 760px;
    margin: 22px auto 8px;
    padding: 0 20px;
}
.step-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}
.step-node.is-clickable {
    cursor: pointer;
}
.step-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #d7deea;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    transition: 0.2s;
}
.step-name {
    font-size: 13px;
    color: #8a93a6;
    white-space: nowrap;
}
.step-node.is-done .step-dot {
    background: #2e9b5b;
}
.step-node.is-active .step-dot {
    background: var(--ink, #202d4a);
    box-shadow: 0 0 0 4px rgba(32, 45, 74, 0.15);
}
.step-node.is-active .step-name {
    color: var(--ink, #202d4a);
    font-weight: 800;
}
.step-line {
    flex: 1;
    height: 3px;
    background: #d7deea;
    margin: 20px 6px 0;
    min-width: 24px;
}

/* 底部導覽按鈕 */
.wizard-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 6px 32px 30px;
}
.wizard-foot-left {
    display: inline-block;
}
.wiz-btn {
    border: none;
    border-radius: 26px;
    padding: 12px 26px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.wiz-next {
    background: var(--ink, #202d4a);
    color: #fff;
}
.wiz-next:hover {
    filter: brightness(1.1);
}
.wiz-back {
    background: #fff;
    color: #5a6a85;
    border: 1.5px solid #cfd8e8;
}
.wiz-back:hover {
    background: #f3f5f9;
}
.wiz-submit {
    background: #2e9b5b;
    color: #fff;
    font-size: 18px;
    padding: 14px 34px;
}
.wiz-submit:hover {
    filter: brightness(1.08);
}

/* 付款方式：直列 */
.pay-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pay-list .pay-card {
    width: 100%;
}

/* step2 優惠列 + 總計 */
.discount-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 0;
}
.discount-input {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.discount-input label {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}
/* 團報 / 舊生推薦：勾勾放大 */
.discount-input input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--ink, #202d4a);
    cursor: pointer;
    flex: 0 0 auto;
}
.discount-input input[type="text"] {
    width: 200px;
}
/* 套票方案時：整列（文字＋輸入框＋勾勾）一起變灰＝刻意不能按 */
.discount-row.is-disabled {
    opacity: 0.45;
}
.discount-row.is-disabled,
.discount-row.is-disabled label,
.discount-row.is-disabled input {
    color: #8a93a6;
    cursor: not-allowed;
}
.discount-amt {
    font-weight: 800;
    color: #e0002c;
    min-width: 64px;
    text-align: right;
    font-size: 18px;
}
.step2-grandtotal {
    text-align: right;
    font-size: 22px;
    font-weight: 800;
    color: #e0002c;
    border-top: 2px solid #e3e8f0;
    padding-top: 14px;
    margin-top: 14px;
}

/* 報名後：同一週其他兩格灰掉鎖住（沿用滿班色，但無「額滿」字）*/
.camp-row.week-committed .camp-cell:not(.is-committed) {
    pointer-events: none;
}
.camp-row.week-committed .camp-cell:not(.is-committed)::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: var(--campus-color, #008141);
    opacity: 0.4;
}

/* 驗證未填：閃紅框 */
.field-item.field-invalid {
    outline: 2px solid #e0002c;
    outline-offset: 4px;
    border-radius: 8px;
}

/* 手機：日期列可點收合 + wizard 各項微調 */
@media (max-width: 768px) {
    .camp-date {
        background: var(--campus-color, #008141);
        color: #fff;
        font-size: 17px;
        padding: 12px;
        cursor: pointer;
        position: relative;
    }
    .camp-date::after {
        content: "▾";
        margin-left: 8px;
        font-size: 14px;
    }
    .camp-date.collapsed::after {
        content: "▸";
    }
    /* 報名後另外兩格直接隱藏 */
    .camp-row.week-committed .camp-cell:not(.is-committed) {
        display: none;
    }

    /* 4. 步驟圈圈縮小 */
    .step-tree {
        padding: 0 8px;
    }
    .step-dot {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    .step-node.is-active .step-dot {
        box-shadow: 0 0 0 3px rgba(32, 45, 74, 0.15);
    }
    .step-line {
        margin-top: 14px;
    }
    .step-name {
        font-size: 11px;
    }

    /* 5. 購物車移到左下角（避免擋住 step1 的「確認購物車」按鈕）*/
    .cart-fab {
        right: auto;
        bottom: 50px;
        left: 50px;
    }

    /* 6. step2 總金額字體縮小 */
    .step2-grandtotal {
        font-size: 16px;
        padding-top: 10px;
        margin-top: 10px;
    }
    .step2-total {
        font-size: 18px;
    }

    /* 7. 底部按鈕全部置中直排（文字長會斷行，故不再一左一右）*/
    .wizard-foot {
        margin: 6px 16px 24px;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .wizard-foot-left {
        display: none;
    }
    .wiz-btn {
        padding: 11px 18px;
        font-size: 15px;
        width: auto;
        text-align: center;
        justify-content: center;
    }
}
/* ==========================================================================
   Minecraft 共享帳號 modal（時時學無 Minecraft 梯次時，於「確認購物車」跳出）
   ========================================================================== */
.mc-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 28, 46, 0.55);
    padding: 20px;
}
.mc-modal[hidden] {
    display: none;
}
.mc-modal-box {
    background: #fff;
    border-radius: 16px;
    max-width: 460px;
    width: 100%;
    padding: 26px 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.mc-modal-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--ink, #202d4a);
    margin: 0 0 12px;
}
.mc-modal-text {
    font-size: 15px;
    line-height: 1.7;
    color: #42506a;
    margin: 0 0 18px;
}
.mc-modal-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.mc-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1.5px solid #cfd8e8;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    transition: 0.15s;
    margin: 0;
}
.mc-opt:hover {
    background: #f3f6fb;
}
.mc-opt input {
    width: 20px;
    height: 20px;
    accent-color: var(--ink, #202d4a);
    flex: 0 0 auto;
}
.mc-opt:has(input:checked) {
    border-color: var(--ink, #202d4a);
    background: #eef2f9;
}
.mc-modal-foot {
    text-align: right;
}
.mc-confirm {
    background: var(--ink, #202d4a);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 11px 30px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}
.mc-confirm:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
/* 購物車 Minecraft 帳號項目的刪除鈕（沿用刪除梯次樣式）*/
.cart-del-mc {
    border: 1px solid #f0b4b4;
    background: #fff;
    color: #c0392b;
    border-radius: 16px;
    padding: 3px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

/* ── 購物車 FAB RWD 修正：平板起移到左邊、手機貼近左緣（避免擋到下一步/送出）── */
@media (min-width: 769px) and (max-width: 1024px) {
    .cart-fab { right: auto; left: 40px; }
}
@media (max-width: 768px) {
    .cart-fab { right: auto; left: 10px; bottom: 16px; }
}

/* ── 手機：底部按鈕改成與產品頁一致（滿版、字 18px、直排置中）── */
@media (max-width: 768px) {
    .wizard-foot { flex-direction: column; align-items: center; gap: 10px; margin: 6px 16px 24px; }
    .wizard-foot .wiz-btn { width: 100%; font-size: 18px; padding: 14px 18px; justify-content: center; text-align: center; }
}
