/* 富康生活家教育平台 — 溫馨明亮專業教育平台風格 */
:root {
  --paper: #f7f9fc;        /* 頁面底色：帶一點綠的白 */
  --paper-2: #eef1f6;
  --card: #ffffff;
  --card-2: #f7f9fc;
  --border: #dfe4ec;
  --border-2: #cbd3df;
  --primary: #1f5fa8;      /* 葉綠：主要按鈕 */
  --primary-hi: #174c88;
  --primary-soft: #e8f0fa; /* 淡芽綠 */
  --honey: #f5a524;        /* 蜂蜜黃：繼續上課、進度 */
  --honey-soft: #fff4df;
  --sky: #2f6ea8;
  --sky-soft: #eef4fa;
  --text: #1a2433;         /* 深綠墨字 */
  --text-2: #3e4a5c;
  --muted: #6b7686;
  --ok: #1f5fa8;
  --ok-soft: #e8f0fa;
  --warn: #f5a524;
  --warn-soft: #fff4df;
  --danger: #c2413a;
  --danger-soft: #fbe9e7;
  --header: #ffffff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 20px rgba(26, 36, 51, .08);
  --shadow-sm: 0 1px 2px rgba(26, 36, 51, .06);
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { font-size: 17.5px; -webkit-text-size-adjust: 100%; }
@media (min-width: 1600px) { html { font-size: 18.5px; } }
@media (max-width: 640px) { html { font-size: 18px; } }
body { margin: 0; background: var(--paper); color: var(--text); font-family: var(--font); line-height: 1.75; min-height: 100vh; overflow-wrap: break-word; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .5em; color: var(--text); }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- layout ---------- */
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 900px) { .container { padding: 0 32px; } }
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--border); backdrop-filter: blur(6px); }
.site-header .bar { height: 72px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 900; font-size: 1.15rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 40px; height: 40px; border-radius: 12px; background: var(--primary); display: grid; place-items: center; color: #fff; font-size: 1rem; font-weight: 900; box-shadow: 0 4px 10px rgba(27, 54, 93, .3); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a, .nav button.link { color: var(--text-2); font-weight: 700; padding: 9px 14px; border-radius: 999px; background: none; border: 0; cursor: pointer; white-space: nowrap; }
.nav a:hover { background: var(--primary-soft); color: var(--primary-hi); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary-hi); }
.nav .sep { width: 1px; height: 26px; background: var(--border); margin: 0 6px; }
.nav a.btn { background: var(--primary); color: #fff; padding: 0 18px; border-radius: 12px; }
.nav a.btn:hover { background: var(--primary-hi); color: #fff; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--honey); color: #ffffff; display: grid; place-items: center; font-weight: 800; font-size: 14px; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--honey); cursor: pointer; flex: none; white-space: nowrap; }
.menu-wrap { position: relative; }
.dropdown { position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 8px; display: none; z-index: 60; }
.dropdown.open { display: block; }
.dropdown .who { padding: 8px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown .who small { color: var(--muted); display: block; }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 12px; border-radius: 10px; color: var(--text); background: none; border: 0; cursor: pointer; font-weight: 600; }
.dropdown a:hover, .dropdown button:hover { background: var(--primary-soft); text-decoration: none; }
.burger { display: none; margin-left: auto; background: var(--primary-soft); border: 0; color: var(--primary-hi); height: 46px; padding: 0 16px; border-radius: 999px; cursor: pointer; font-weight: 800; font-size: 1rem; gap: 6px; align-items: center; }
@media (max-width: 1180px) {
  .burger { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 72px; background: #fff; flex-direction: column; align-items: stretch; padding: 10px 16px 18px; border-bottom: 1px solid var(--border); gap: 4px; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav .sep { display: none; }
  .nav a, .nav button.link { padding: 14px 16px; border-radius: 12px; font-size: 1.05rem; }
  .nav .btn { margin-top: 6px; }
  .nav .menu-wrap .dropdown { position: static; display: block; box-shadow: none; border: 0; padding: 0; margin-top: 6px; border-top: 1px solid var(--border); border-radius: 0; }
  .nav .menu-wrap > .avatar { display: none; }
}
main { min-height: calc(100vh - 72px - 120px); }
.site-footer { border-top: 1px solid var(--border); background: #fff; margin-top: 64px; padding: 28px 0 36px; color: var(--muted); font-size: .92rem; }
.site-footer .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer strong { color: var(--text); }

/* ---------- common ---------- */
.page { padding-top: 40px; padding-bottom: 24px; }
@media (max-width: 640px) { .page { padding-top: 26px; } }
.page-title { font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.5rem); font-weight: 900; margin-bottom: .15em; }
.page-sub { color: var(--muted); margin-bottom: 28px; font-size: 1.02rem; }
.eyebrow { color: var(--primary); font-size: .85rem; font-weight: 700; letter-spacing: .04em; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 24px; border-radius: 14px; border: 2px solid transparent; background: var(--primary); color: #fff; font-weight: 800; font-size: 1.02rem; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .15s, transform .1s, box-shadow .15s; box-shadow: 0 4px 0 #174c88; }
.btn:hover { background: var(--primary-hi); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #174c88; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn .ico { font-size: 1.15em; line-height: 1; }
.btn.block { width: 100%; }
.btn.lg { min-height: 60px; font-size: 1.12rem; padding: 0 30px; border-radius: 16px; }
.btn.sm { min-height: 42px; padding: 0 16px; font-size: .92rem; border-radius: 11px; box-shadow: 0 3px 0 #174c88; }
.btn.honey { background: var(--honey); color: #ffffff; box-shadow: 0 4px 0 #8a5a00; }
.btn.honey:hover { background: #e0941a; }
.btn.outline, .btn.ghost { background: #fff; border-color: var(--border-2); color: var(--text); box-shadow: 0 3px 0 var(--border); }
.btn.outline { border-color: var(--primary); color: var(--primary-hi); box-shadow: 0 3px 0 #c6d8ef; }
.btn.outline:hover, .btn.ghost:hover { background: var(--primary-soft); }
.btn.danger { background: #fff; border-color: #e7b2ae; color: var(--danger); box-shadow: 0 3px 0 #f1cfcc; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ok { background: var(--primary); }
.btn.done { background: var(--primary-soft); color: var(--primary-hi); border-color: #c6d8ef; box-shadow: 0 3px 0 #c6d8ef; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card.pad { padding: 24px; }
@media (max-width: 640px) { .card.pad { padding: 18px; } }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 12px; border-radius: 999px; font-size: .82rem; font-weight: 800; white-space: nowrap; background: var(--card-2); color: var(--text-2); border: 1px solid var(--border); }
.pill.ok { background: var(--ok-soft); color: #174c88; border-color: #c6d8ef; }
.pill.warn { background: var(--warn-soft); color: #8a5a00; border-color: #f6d9a3; }
.pill.blue { background: var(--sky-soft); color: #23557f; border-color: #cfdcec; }
.pill.red { background: var(--danger-soft); color: var(--danger); border-color: #efc4c0; }
.pill.done { background: var(--primary); color: #fff; border-color: var(--primary); }
.progress { height: 10px; background: var(--paper-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; flex: 1; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #3d7cc9); border-radius: 99px; transition: width .4s; }
.progress-row { display: flex; align-items: center; gap: 12px; }
.progress-row .label { font-size: .9rem; color: var(--primary-hi); font-weight: 800; white-space: nowrap; min-width: 56px; text-align: right; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; border: 2px dashed var(--border-2); border-radius: var(--radius); background: #fff; }
.notice { border-radius: var(--radius-sm); padding: 16px 20px; background: var(--sky-soft); border: 1px solid #cfdcec; color: var(--text-2); }
.notice.warn { background: var(--warn-soft); border-color: #f6d9a3; }
.notice.ok { background: var(--ok-soft); border-color: #c6d8ef; }
.grid { display: grid; gap: 24px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
@media (max-width: 640px) { .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }
.spinner { width: 38px; height: 38px; border: 4px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.row-flex { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 22px 0; }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-weight: 800; margin-bottom: 7px; font-size: .98rem; }
.field small { color: var(--muted); display: block; margin-top: 5px; }
.input, select.input, textarea.input { width: 100%; min-height: 54px; padding: 12px 16px; background: #fff; border: 2px solid var(--border-2); border-radius: 12px; color: var(--text); font-size: 17px; }
textarea.input { min-height: 100px; resize: vertical; line-height: 1.6; }
.input::placeholder { color: #97a1b0; }
.input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px var(--primary-soft); }
.input-icon { position: relative; }
.input-icon .input { padding-left: 48px; }
.input-icon svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--primary); }
.check { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 8px 0; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; }
.switch { position: relative; width: 54px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #c5cdd8; border-radius: 99px; transition: .2s; }
.switch span::after { content: ''; position: absolute; width: 26px; height: 26px; top: 3px; left: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { left: 25px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .full { grid-column: 1 / -1; }
.error-text { color: var(--danger); font-size: .95rem; font-weight: 600; margin: 6px 0 10px; min-height: 1em; }

/* ---------- toast / modal ---------- */
#toasts { position: fixed; top: 86px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { background: #fff; border: 1px solid var(--border); border-left: 6px solid var(--sky); padding: 14px 18px; border-radius: 12px; box-shadow: var(--shadow); min-width: 240px; font-weight: 600; animation: toastIn .2s; }
.toast.ok { border-left-color: var(--primary); } .toast.err { border-left-color: var(--danger); }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } }
@media (max-width: 640px) { #toasts { top: auto; bottom: 16px; left: 16px; right: 16px; } .toast { min-width: 0; } }
.modal-back { position: fixed; inset: 0; background: rgba(26, 36, 51, .35); z-index: 150; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 640px; box-shadow: 0 24px 60px rgba(26, 36, 51, .25); }
.modal.wide { max-width: 900px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 1.25rem; }
.modal-body { padding: 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 22px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.x-btn { background: var(--card-2); border: 0; color: var(--text-2); font-size: 1.6rem; cursor: pointer; width: 44px; height: 44px; border-radius: 50%; }
.x-btn:hover { background: var(--primary-soft); }
@media (max-width: 640px) {
  .modal-back { padding: 0; align-items: stretch; }
  .modal { border-radius: 0; min-height: 100vh; }
  .modal-foot .btn { flex: 1; }
}

/* ---------- home cover ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, #ffffff 0%, #ffffff 70%, var(--paper) 100%); border-bottom: 1px solid var(--border); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 32px; align-items: center; padding: 56px 0 44px; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; padding: 32px 0 28px; gap: 8px; } .hero-art { order: -1; max-width: 420px; margin: 0 auto; } }
.hello { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); padding: 6px 16px 6px 8px; border-radius: 999px; font-weight: 700; color: var(--text-2); box-shadow: var(--shadow-sm); }
.hello .dot { width: 30px; height: 30px; border-radius: 50%; background: var(--honey-soft); display: grid; place-items: center; font-size: 1rem; }
.hero h1 { font-size: clamp(2.1rem, 1.3rem + 3vw, 3.5rem); font-weight: 900; margin: 18px 0 6px; letter-spacing: .02em; color: var(--text); }
.hero .subtitle { font-size: clamp(1.1rem, 1rem + .6vw, 1.45rem); color: var(--primary-hi); font-weight: 800; margin-bottom: 14px; }
.hero .intro { max-width: 34em; color: var(--text-2); font-size: 1.06rem; }
.hero .en { color: var(--muted); font-size: .78rem; letter-spacing: .08em; margin-top: 4px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
@media (max-width: 640px) { .hero-actions .btn { flex: 1 1 100%; } }
.hero-progress { margin-top: 22px; max-width: 520px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 18px; box-shadow: var(--shadow-sm); }
.hero-progress b { color: var(--primary-hi); }
.hero-art svg { width: 100%; height: auto; display: block; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 36px 0 8px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step { display: flex; gap: 16px; align-items: flex-start; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.step .n { flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-hi); font-weight: 900; font-size: 1.25rem; display: grid; place-items: center; border: 2px solid #c6d8ef; }
.step.done .n { background: var(--primary); color: #fff; border-color: var(--primary); }
.step b { display: block; font-size: 1.06rem; margin-bottom: 2px; }
.step span { color: var(--muted); font-size: .95rem; }
.section-title { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); font-weight: 900; margin: 0 0 6px; }
.finder { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); margin-top: 28px; }
.finder .input-icon { flex: 1; min-width: 220px; }
.count-chip { color: var(--muted); font-size: .95rem; font-weight: 600; }
.entries { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
@media (max-width: 760px) { .entries { grid-template-columns: 1fr; } }
.entry { display: flex; gap: 16px; align-items: center; padding: 20px; background: #fff; border: 2px solid var(--border); border-radius: var(--radius); color: var(--text); cursor: pointer; text-align: left; box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s; width: 100%; }
.entry:hover { border-color: var(--primary); transform: translateY(-2px); text-decoration: none; }
.entry .ic { flex: none; width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; font-size: 1.8rem; background: var(--primary-soft); }
.entry.b .ic { background: var(--honey-soft); }
.entry b { display: block; font-size: 1.12rem; }
.entry span { color: var(--muted); font-size: .93rem; display: block; }
.entry .go { margin-left: auto; color: var(--primary); font-weight: 800; white-space: nowrap; font-size: .95rem; }
@media (max-width: 480px) { .entry .go { display: none; } }
.continue-bar { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin: 22px 0 0; background: var(--honey-soft); border: 2px solid #f6d9a3; border-radius: var(--radius); flex-wrap: wrap; }
.continue-bar .t { flex: 1; min-width: 200px; }
.continue-bar small { color: #8a5a00; display: block; font-weight: 700; }
.stage { padding: 48px 0 8px; scroll-margin-top: 90px; }
.stage-head { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.stage-head .badge-ic { flex: none; width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 2rem; background: var(--primary-soft); }
.stage-head.b .badge-ic { background: var(--honey-soft); }
.stage-head .txt { flex: 1; min-width: 240px; }
.stage-head .label { color: var(--primary); font-weight: 800; font-size: .9rem; }
.stage-head h2 { font-size: clamp(1.5rem, 1.15rem + 1.4vw, 2.1rem); font-weight: 900; margin: 2px 0 6px; }
.stage-head p { color: var(--text-2); max-width: 40em; margin: 0; }
.stage-progress { align-self: center; min-width: 220px; }
.stage-progress small { display: block; color: var(--muted); font-weight: 700; margin-bottom: 6px; }

/* lesson cards */
.lessons { display: flex; flex-direction: column; gap: 14px; }
.lesson { background: #fff; border: 2px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.lesson.open { border-color: var(--primary); box-shadow: var(--shadow); }
.lesson.done { border-color: #c6d8ef; }
.lesson-head { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 18px 20px; background: none; border: 0; text-align: left; cursor: pointer; color: var(--text); }
.lesson-head:hover { background: #f9fbfd; }
.lesson-no { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 66px; height: 66px; border-radius: 50%; background: var(--paper-2); border: 2px solid var(--border-2); flex: none; }
.lesson-no b { font-size: 1.4rem; font-weight: 900; color: var(--primary-hi); line-height: 1.1; }
.lesson-no small { font-size: .64rem; color: var(--muted); white-space: nowrap; font-weight: 700; }
.lesson.done .lesson-no { background: var(--primary); border-color: var(--primary); }
.lesson.done .lesson-no b, .lesson.done .lesson-no small { color: #fff; }
.lesson-title { font-weight: 800; font-size: clamp(1.04rem, .98rem + .3vw, 1.18rem); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lesson-short { color: var(--muted); font-size: .96rem; margin-top: 3px; display: block; }
.lesson-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-hi); font-weight: 800; font-size: .95rem; white-space: nowrap; border: 2px solid #c6d8ef; }
.lesson.open .lesson-toggle { background: var(--primary); color: #fff; border-color: var(--primary); }
.lesson-toggle .sym { font-size: 1rem; line-height: 1; }
@media (max-width: 640px) {
  .lesson-head { grid-template-columns: auto 1fr; gap: 14px; padding: 16px; }
  .lesson-toggle { grid-column: 1 / -1; justify-content: center; width: 100%; padding: 12px; }
  .lesson-no { width: 56px; height: 56px; }
}
.lesson-body { padding: 0 22px 24px; border-top: 1px solid var(--border); display: none; background: #fbfcfe; }
.lesson.open .lesson-body { display: block; }
.lesson-body .desc { margin: 18px 0 12px; color: var(--text-2); font-size: 1.04rem; max-width: 46em; }
.material { font-size: .92rem; color: var(--muted); margin-bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lesson-body .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
@media (max-width: 640px) { .lesson-body { padding: 0 16px 20px; } .lesson-body .actions .btn { flex: 1 1 100%; } }
.disclaimer { font-size: .88rem; color: #8a5a00; background: var(--honey-soft); border: 1px solid #f6d9a3; padding: 10px 14px; border-radius: 10px; margin-top: 14px; }
.fallback-link { font-size: .9rem; color: var(--muted); margin-top: 10px; display: inline-block; text-decoration: underline; }
.partner-box { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; padding: 28px; align-items: start; background: linear-gradient(135deg, #ffffff, #f4f7fb); }
@media (max-width: 800px) { .partner-box { grid-template-columns: 1fr; padding: 20px; } }
.partner-box h3 { font-size: 1.45rem; }
.how-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.how-list li { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; color: var(--text-2); }
.how-list li i { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; font-style: normal; font-weight: 900; display: grid; place-items: center; font-size: .9rem; }
.tools-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 18px 20px; margin-bottom: 18px; background: var(--sky-soft); border-color: #cfdcec; }
.tools-box .t { flex: 1; min-width: 220px; }
.locked-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 16px; }
.locked-list div { padding: 10px 14px; background: #fff; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); font-size: .92rem; }
.help-fab { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: inline-flex; align-items: center; gap: 8px; height: 56px; padding: 0 22px; border-radius: 999px; background: #fff; border: 2px solid var(--primary); color: var(--primary-hi); font-weight: 900; font-size: 1rem; cursor: pointer; box-shadow: var(--shadow); }
.help-fab:hover { background: var(--primary-soft); }
.help-fab .q { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; }
@media (max-width: 640px) { .help-fab { height: 50px; padding: 0 16px; right: 12px; bottom: 12px; } .help-fab .t { display: none; } }
.guide { display: grid; gap: 14px; }
.guide .g { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; background: var(--paper); border-radius: 14px; border: 1px solid var(--border); }
.guide .g .ic { flex: none; width: 48px; height: 48px; border-radius: 14px; background: #fff; border: 1px solid var(--border); display: grid; place-items: center; font-size: 1.5rem; }
.guide .g b { display: block; }
.guide .g span { color: var(--muted); font-size: .95rem; }
.fake-btn { display: inline-flex; align-items: center; gap: 4px; background: var(--primary); color: #fff; border-radius: 8px; padding: 0 8px; font-size: .85rem; font-weight: 800; white-space: nowrap; }

/* player */
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #14263d; border-radius: 16px; overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .wm { position: absolute; z-index: 3; pointer-events: none; color: rgba(255, 255, 255, .3); font-size: .82rem; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); transition: top 1.5s, left 1.5s; white-space: nowrap; }
.player .ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 20px; color: var(--text); background: radial-gradient(circle at 30% 20%, #f8fafc, transparent 50%), linear-gradient(135deg, #eef2f7, #dde5ef); }
.player .ph .big { font-size: 1.2rem; font-weight: 900; }
.player .ph .muted { color: var(--text-2); }
.player .ph.cover { background-size: cover; background-position: center; color: #fff; cursor: pointer; }
.player .ph.cover::before { content: ''; position: absolute; inset: 0; background: rgba(16, 36, 26, .45); }
.player .ph.cover .big { color: #fff; text-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.player .ph > * { position: relative; }
.play-btn { width: 86px; height: 86px; border-radius: 50%; background: var(--primary); border: 5px solid #fff; color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 30px rgba(27, 54, 93, .45); }
.play-btn:hover { background: var(--primary-hi); }
.resume-tip { position: absolute; z-index: 4; left: 12px; bottom: 56px; background: rgba(255, 255, 255, .95); color: var(--text); padding: 7px 14px; border-radius: 999px; font-size: .88rem; font-weight: 700; }

/* course cards */
.ccard { display: flex; flex-direction: column; overflow: hidden; color: var(--text); transition: transform .15s, box-shadow .15s; }
.ccard:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); }
.cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper-2); display: block; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.gen-cover { position: absolute; inset: 0; padding: 7% 8%; display: flex; flex-direction: column; justify-content: center;
  background: radial-gradient(circle at 88% 18%, #e9dcbc 0 14%, transparent 15%), radial-gradient(ellipse at 70% 120%, #c5d4e6 0 40%, transparent 41%), radial-gradient(ellipse at 10% 130%, #9fb6d1 0 45%, transparent 46%), linear-gradient(160deg, #f3f6fa, #e3eaf3); }
.gen-cover .ey { font-size: .7rem; letter-spacing: .06em; color: var(--primary); font-weight: 800; }
.gen-cover .tt { font-size: clamp(1.35rem, 3vw, 2.1rem); font-weight: 900; line-height: 1.25; margin-top: 6px; color: var(--text); }
.gen-cover .st { font-size: .78rem; color: var(--text-2); margin-top: 8px; max-width: 78%; }
.gen-cover.big .tt { font-size: clamp(1.8rem, 4.5vw, 3rem); }
.gen-cover.big .st { font-size: .98rem; }
.cover .badge { position: absolute; top: 12px; left: 12px; z-index: 2; }
.ccard-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ccard-body h3 { font-size: 1.15rem; font-weight: 900; margin: 0; }
.lecturer { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: .95rem; }
.lecturer .av { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-hi); display: grid; place-items: center; font-size: .78rem; font-weight: 900; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .9rem; }
.stars { color: #e3a21a; letter-spacing: 1px; }
.price { display: flex; align-items: baseline; gap: 10px; margin-top: auto; }
.price b { font-size: 1.3rem; color: var(--text); }
.price s { color: var(--muted); font-size: .9rem; }

/* course detail */
.cd-hero { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 960px) { .cd-hero { grid-template-columns: 1fr; } }
.cd-tabs { position: sticky; top: 72px; z-index: 20; background: var(--paper); border-bottom: 2px solid var(--border); margin: 28px 0 0; display: flex; gap: 4px; overflow-x: auto; }
.cd-tabs a { padding: 14px 16px; color: var(--muted); font-weight: 800; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.cd-tabs a:hover { color: var(--text); text-decoration: none; }
.cd-tabs a.on { color: var(--primary-hi); border-color: var(--primary); }
.cd-section { padding: 32px 0 8px; scroll-margin-top: 140px; }
.cd-section h2 { font-size: 1.45rem; font-weight: 900; }
.plan-card { padding: 22px; margin-bottom: 14px; }
.plan-card .pname { font-weight: 900; font-size: 1.1rem; }
.plan-card .pdesc { color: var(--text-2); font-size: .95rem; white-space: pre-line; margin: 6px 0 12px; }
.sticky-side { position: sticky; top: 150px; }
.includes li { margin-bottom: 4px; color: var(--text-2); }
.points { counter-reset: p; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.points li { counter-increment: p; display: flex; gap: 14px; padding: 16px 18px; background: #fff; border: 1px solid var(--border); border-radius: 14px; }
.points li::before { content: counter(p); flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: .9rem; }
.outline-sec { margin-bottom: 12px; overflow: hidden; }
.outline-sec summary { cursor: pointer; padding: 16px 20px; font-weight: 800; display: flex; justify-content: space-between; gap: 10px; list-style: none; background: var(--card-2); }
.outline-sec summary::-webkit-details-marker { display: none; }
.outline-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); font-size: .97rem; }
.outline-row .n { color: var(--primary); width: 30px; font-weight: 900; }
.outline-row .tt { flex: 1; }
.review { padding: 16px 0; border-bottom: 1px solid var(--border); }
.dist { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-items: center; font-size: .88rem; color: var(--muted); max-width: 360px; }
.mobile-buy { display: none; }
@media (max-width: 960px) {
  .mobile-buy { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--border); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); gap: 12px; align-items: center; box-shadow: 0 -6px 20px rgba(26, 36, 51, .08); }
  .mobile-buy .p { flex: 1; } .sticky-side { position: static; }
}

/* my courses */
.mc-layout { display: grid; grid-template-columns: 1fr 330px; gap: 28px; align-items: start; }
@media (max-width: 1000px) { .mc-layout { grid-template-columns: 1fr; } }
.mc-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; font-weight: 700; }
.mc-filter { padding: 24px; }
.mc-filter h4 { font-size: 1.02rem; margin-bottom: 12px; }
.mc-filter .blk { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.mc-filter .blk:last-child { border: 0; margin: 0; padding: 0; }
.subcard { background: var(--paper); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.mc-card .ccard-body { gap: 14px; }

/* learn page */
.learn-top { height: 66px; background: #fff; display: flex; align-items: center; gap: 14px; padding: 0 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.learn-top .back { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-hi); font-weight: 800; white-space: nowrap; }
.learn-top .back:hover { text-decoration: none; background: #dde6f1; }
.learn-top .ct { font-weight: 900; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.learn-top .pg { display: flex; align-items: center; gap: 10px; width: 230px; font-size: .9rem; color: var(--text-2); font-weight: 700; }
@media (max-width: 640px) { .learn-top .pg { display: none; } .learn-top .back .t { display: none; } }
.learn { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); min-height: calc(100vh - 66px); }
.learn.collapsed { grid-template-columns: minmax(0, 1fr); }
.learn > * { min-width: 0; }
@media (max-width: 1100px) and (min-width: 901px) { .learn { grid-template-columns: 310px minmax(0, 1fr); } }
.side { background: #fff; border-right: 1px solid var(--border); overflow-y: auto; height: calc(100vh - 66px); position: sticky; top: 66px; }
.learn.collapsed .side { display: none; }
.side-head { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.side-head b { flex: 1; font-size: 1.02rem; }
.side-sec > button { width: 100%; text-align: left; background: var(--card-2); border: 0; border-bottom: 1px solid var(--border); padding: 16px 20px; color: var(--text); font-weight: 800; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; }
.side-sec > button .chev { margin-left: auto; transition: transform .2s; color: var(--muted); }
.side-sec.closed > button .chev { transform: rotate(-90deg); }
.side-sec.closed .side-list { display: none; }
.side-item { display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid #edf1f6; color: var(--text-2); cursor: pointer; align-items: flex-start; font-size: .97rem; line-height: 1.55; }
.side-item:hover { background: #f5f8fb; text-decoration: none; color: var(--text); }
.side-item.on { background: var(--honey-soft); color: var(--text); font-weight: 800; box-shadow: inset 5px 0 0 var(--honey); }
.side-item .ic { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid var(--border-2); display: grid; place-items: center; font-size: .75rem; background: #fff; }
.side-item .ic.done { background: var(--primary); border-color: var(--primary); color: #fff; }
.side-item .ic.lock { border: 0; color: var(--muted); background: transparent; }
.side-item .ic.play { border-color: var(--honey); color: #8a5a00; background: #fff; }
.side-item small { display: block; color: var(--muted); font-size: .82rem; font-weight: 500; }
.learn-main { padding: 28px clamp(16px, 3vw, 40px) 80px; min-width: 0; }
.learn-main .inner { max-width: 1180px; margin: 0 auto; }
@media (max-width: 900px) {
  .learn, .learn.collapsed { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-top: 1px solid var(--border); order: 2; }
  .learn.collapsed .side { display: block; }
  .learn-main { padding: 0 0 24px; order: 1; }
  .learn-main .player { border-radius: 0; }
  .learn-main .below { padding: 0 16px; }
  .side-toggle { display: none !important; }
}
.lec-title { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); font-weight: 900; margin: 22px 0 6px; }
.lec-nav { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0 22px; align-items: center; }
@media (max-width: 640px) { .lec-nav .btn { flex: 1 1 calc(50% - 12px); } .lec-nav #markBtn { flex-basis: 100%; order: -1; } .lec-nav .fallback-link { flex-basis: 100%; } }
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; padding: 12px 18px; color: var(--muted); font-weight: 800; cursor: pointer; white-space: nowrap; font-size: 1rem; }
.tabs button.on { color: var(--primary-hi); border-color: var(--primary); }
.note { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.note .ts { color: var(--primary); font-weight: 800; cursor: pointer; white-space: nowrap; }
.encourage { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 14px; background: var(--ok-soft); border: 1px solid #c6d8ef; font-weight: 700; color: #174c88; margin-bottom: 18px; }

/* tables / admin */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th { text-align: left; padding: 13px 14px; background: var(--card-2); color: var(--text-2); font-weight: 800; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #f9fbfd; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .table-wrap .tbl { min-width: 620px; } .tbl td:first-child { min-width: 160px; } }
.admin { display: grid; grid-template-columns: 230px 1fr; gap: 28px; align-items: start; }
@media (max-width: 900px) { .admin { grid-template-columns: 1fr; } }
.admin-nav { padding: 10px; position: sticky; top: 90px; }
@media (max-width: 900px) { .admin-nav { position: static; display: flex; overflow-x: auto; gap: 4px; } }
.admin-nav a { display: block; padding: 12px 14px; border-radius: 10px; color: var(--text-2); font-weight: 700; white-space: nowrap; }
.admin-nav a:hover { background: var(--primary-soft); text-decoration: none; }
.admin-nav a.on { background: var(--primary); color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-bottom: 26px; }
.kpi { padding: 18px 20px; }
.kpi small { color: var(--muted); display: block; font-size: .88rem; font-weight: 700; }
.kpi b { font-size: 1.9rem; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--primary-hi); }
.bar-cell { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.sec-block { margin-bottom: 18px; overflow: hidden; }
.sec-block-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; background: var(--card-2); }
.lec-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.lec-row:last-child { border-bottom: 0; }
.lec-row .tt { flex: 1; min-width: 200px; }
.icon-btn { background: #fff; border: 1px solid var(--border-2); color: var(--text-2); width: 40px; height: 40px; border-radius: 10px; cursor: pointer; font-size: 1rem; }
.icon-btn:hover { background: var(--primary-soft); }
.icon-btn:disabled { opacity: .4; }
.pwd-box { background: var(--honey-soft); border: 2px dashed var(--honey); padding: 14px 18px; border-radius: 12px; font-size: 1.15rem; font-weight: 800; letter-spacing: .03em; }
.stars-input { display: flex; gap: 8px; font-size: 2.4rem; }
.stars-input button { background: none; border: 0; cursor: pointer; color: #d5dbe4; padding: 0; }
.stars-input button.on { color: #e3a21a; }
.faq-item { margin-bottom: 10px; overflow: hidden; }
.faq-item summary { cursor: pointer; padding: 18px 22px; font-weight: 800; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '＋'; color: #fff; background: var(--primary); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.faq-item[open] summary::after { content: '－'; }
.faq-item .a { padding: 0 22px 20px; color: var(--text-2); white-space: pre-line; }
.auth-wrap { max-width: 480px; margin: 48px auto; padding: 0 16px; }
.auth-card { padding: 34px; }
.auth-card .leaf { width: 64px; height: 64px; border-radius: 20px; background: var(--primary-soft); display: grid; place-items: center; font-size: 2rem; margin-bottom: 12px; }
@media (max-width: 640px) { .auth-card { padding: 22px; } .auth-wrap { margin: 24px auto; } }

.guide .g .fake-btn { color: #fff; }
.guide .g .fake-btn.honey { background: var(--honey); color: #ffffff; }
.nav-help { display: none !important; }
@media (max-width: 1180px) { .nav-help { display: block !important; } }
@media (max-width: 900px) { .help-fab { display: none; } .hero .en { display: none; } }


/* ================= 溫馨明亮教育風格 ================= */
:root {
  --blue: #1f5fa8; --blue-hi: #174c88; --blue-soft: #e8f0fa;
  --sun: #f5a524; --sun-hi: #e0941a; --sun-soft: #fff4df; --sun-ink: #3a2200;
  --leaf: #2e9d6b; --leaf-soft: #e6f5ee; --leaf-ink: #1b6b47;
  --sky-soft: #eaf4ff;
  --ink: #1e2b3c; --ink-2: #44546a;
  --shadow: 0 10px 30px rgba(31, 95, 168, .10);
  --shadow-sm: 0 2px 6px rgba(30, 43, 60, .06);
}
body { background: #f7f9fc; color: var(--ink); line-height: 1.75; }
h1, h2, h3 { color: var(--ink); }
.i { flex: none; vertical-align: -3px; }
.site-header { background: rgba(255, 255, 255, .97); border-bottom: 1px solid #e6ebf2; border-top: 0; }
.site-header .bar { height: 70px; }
.brand { font-weight: 800; font-size: 1.12rem; }
.brand .logo { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--blue), #3d7cc9); box-shadow: 0 4px 12px rgba(31, 95, 168, .25); }
.nav a, .nav button.link { border-radius: 10px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); }
.nav a:hover { background: var(--blue-soft); color: var(--blue); }
.nav a.active { background: var(--blue-soft); color: var(--blue); box-shadow: none; border-radius: 10px; }
.nav a.btn { background: var(--blue); color: #fff; border-radius: 10px; padding: 0 18px; }
.nav a.btn:hover { background: var(--blue-hi); color: #fff; }
.burger { border-radius: 10px; background: #fff; border: 1px solid #d5deea; color: var(--ink); font-weight: 700; gap: 8px; }
.avatar { background: var(--sun); color: var(--sun-ink); border: 0; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #ffd38a; width: 40px; height: 40px; }
.dropdown { border-radius: 14px; }
.dropdown a .i, .dropdown button .i { color: var(--blue); }

.btn { border-radius: 10px; box-shadow: 0 2px 0 rgba(23, 76, 136, .25); font-weight: 700; min-height: 50px; padding: 0 22px; gap: 9px; border-width: 1px; background: var(--blue); }
.btn:hover { background: var(--blue-hi); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.lg { min-height: 56px; border-radius: 12px; font-size: 1.06rem; }
.btn.sm { min-height: 40px; border-radius: 9px; box-shadow: none; }
.btn.honey { background: var(--sun); color: var(--sun-ink); box-shadow: 0 2px 0 #c98612; }
.btn.honey:hover { background: var(--sun-hi); }
.btn.outline { background: #fff; border-color: var(--blue); color: var(--blue); box-shadow: none; }
.btn.outline:hover { background: var(--blue-soft); }
.btn.ghost { background: #fff; border-color: #d5deea; color: var(--ink); box-shadow: none; }
.btn.ghost:hover { background: #f2f6fb; }
.btn.danger { box-shadow: none; }
.btn.done { background: var(--leaf-soft); color: var(--leaf-ink); border-color: #b5e0cb; box-shadow: none; }
@media (max-width: 640px) { .btn { min-height: 52px; } }
.link-btn { background: none; border: 0; color: var(--blue); font-weight: 700; cursor: pointer; padding: 0 4px; text-decoration: underline; }
.card { border-radius: 14px; border-color: #e6ebf2; }
.pill { border-radius: 999px; font-weight: 700; padding: 2px 11px; gap: 5px; }
.pill.ok { background: var(--leaf-soft); color: var(--leaf-ink); border-color: #b5e0cb; }
.pill.done { background: var(--leaf); color: #fff; border-color: var(--leaf); }
.pill.temp { background: #f1ecff; color: #5b3fc4; border-color: #d9cdfb; }
.pill.warn { background: var(--sun-soft); color: #8a5a00; border-color: #f6d9a3; }
.pill.blue { background: var(--blue-soft); color: var(--blue); border-color: #c6d8ef; }
.progress { height: 10px; border: 0; background: #e8eef6; }
.progress > i { background: linear-gradient(90deg, var(--leaf), #4cc38a); }
.progress-row .label { color: var(--leaf-ink); }
.input, select.input, textarea.input { border-radius: 10px; border-width: 1px; border-color: #d0dae7; min-height: 52px; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 95, 168, .14); }
.input-icon svg { color: var(--blue); }
.switch input:checked + span { background: var(--blue); }
.empty { border-radius: 14px; border-width: 1px; }
.notice { border-radius: 12px; border: 1px solid #cfe2f6; border-left: 4px solid #3d7cc9; background: var(--sky-soft); }
.notice.warn { background: var(--sun-soft); border-color: #f6d9a3; border-left-color: var(--sun); }
.notice.ok { background: var(--leaf-soft); border-color: #b5e0cb; border-left-color: var(--leaf); }
.notice.temp { background: #f6f2ff; border-color: #e2d8fb; border-left-color: #7c5ce6; }
.modal { border-radius: 18px; }
.x-btn { border-radius: 50%; background: #f2f6fb; }
.toast { border-radius: 12px; border-left-width: 5px; }

/* cover */
.hero { background: linear-gradient(120deg, #fff6ea 0%, #fffaf3 38%, #eef6ff 100%); border-bottom: 1px solid #ebe3d6; position: relative; }
.hero::after { content: ''; position: absolute; right: -120px; top: -140px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(245, 165, 36, .22), transparent 65%); pointer-events: none; }
.hero-grid { grid-template-columns: 1.1fr .9fr; gap: 48px; padding: 60px 0 56px; align-items: center; position: relative; z-index: 1; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; gap: 28px; padding: 32px 0 34px; } }
.hero .en { color: var(--blue); font-size: .8rem; letter-spacing: .06em; font-weight: 700; margin: 0 0 12px; padding: 4px 12px; border: 0; background: #fff; border-radius: 999px; display: inline-block; box-shadow: var(--shadow-sm); }
.hero h1 { font-weight: 800; margin: 0 0 8px; font-size: clamp(2.05rem, 1.3rem + 2.8vw, 3.3rem); color: var(--ink); }
.hero .subtitle { color: var(--blue); font-weight: 700; font-size: clamp(1.1rem, 1rem + .5vw, 1.4rem); }
.hero .intro { color: var(--ink-2); max-width: 36em; }
.hero .hello { display: block; background: #fff; border: 1px solid #f0e2c8; border-left: 4px solid var(--sun); border-radius: 12px; padding: 12px 16px; margin: 18px 0 0; box-shadow: var(--shadow-sm); font-weight: 500; color: var(--ink-2); max-width: 36em; }
.hero-actions { margin-top: 26px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 12px; margin: 30px 0 0; padding: 0; border: 0; }
.hero-stats div { padding: 12px 18px; margin: 0; border: 1px solid #e9e2d4; border-radius: 12px; background: rgba(255, 255, 255, .8); }
.hero-stats dt { color: var(--ink-2); font-size: .85rem; }
.hero-stats dd { margin: 0; font-size: 1.4rem; font-weight: 800; color: var(--blue); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; } .hero-stats div { padding: 10px 12px; } .hero-stats dd { font-size: 1.15rem; } }
.roadmap { background: #fff; border: 1px solid #e6ebf2; border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.rm-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; background: #fbfcfe; border-bottom: 1px solid #edf1f6; font-weight: 800; color: var(--ink); }
.rm-head span:first-child { display: inline-flex; gap: 8px; align-items: center; }
.rm-head .i { color: var(--sun-hi); }
.rm-row { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 18px 20px; background: #fff; border: 0; border-bottom: 1px solid #edf1f6; text-align: left; cursor: pointer; color: var(--ink); }
.rm-row:last-child { border-bottom: 0; }
.rm-row:hover { background: #f8fbff; }
.rm-no { width: 44px; height: 44px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; }
.rm-row:first-of-type .rm-no { background: var(--sun-soft); color: #8a5a00; }
.rm-main b { display: block; font-size: 1.06rem; }
.rm-meta { display: block; color: var(--ink-2); font-size: .9rem; }
.rm-main .progress { display: block; margin-top: 8px; max-width: 260px; height: 8px; }
.rm-state { color: var(--ink-2); font-weight: 700; font-size: .92rem; white-space: nowrap; display: inline-flex; gap: 5px; align-items: center; }
.onboard { padding-top: 46px; }
.section-title { font-weight: 800; color: var(--ink); }
.steps { list-style: none; padding: 0; margin: 18px 0 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; border: 0; background: transparent; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step { border: 1px solid #e6ebf2; border-radius: 14px; box-shadow: var(--shadow-sm); padding: 20px; background: #fff; }
.step .n { width: 42px; height: 42px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); border: 0; font-size: 1.1rem; font-weight: 800; }
.step.done .n { background: var(--leaf); color: #fff; }
.finder { position: sticky; top: 70px; z-index: 15; border-radius: 14px; box-shadow: var(--shadow-sm); margin-top: 24px; flex-wrap: wrap; gap: 10px 12px; }
@media (max-width: 760px) { .finder { position: static; } }
.area-tabs { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
.tab-chip { border: 1px solid #d5deea; background: #fff; color: var(--ink); border-radius: 999px; padding: 7px 16px; font-weight: 700; cursor: pointer; font-size: .95rem; }
.tab-chip:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }

/* areas & units */
.area { padding: 52px 0 6px; scroll-margin-top: 170px; }
.area-head { display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 2px solid #e8eef6; }
.area-txt { flex: 1; min-width: 260px; }
.area-eyebrow { display: inline-block; font-weight: 800; font-size: .88rem; color: #8a5a00; background: var(--sun-soft); border-radius: 999px; padding: 3px 12px; margin-bottom: 8px; }
.area-head h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); font-weight: 800; margin: 0 0 6px; }
.area-head p { color: var(--ink-2); margin: 0; max-width: 46em; }
.area-progress { min-width: 240px; }
.area-progress small { display: block; color: var(--ink-2); font-weight: 700; margin-bottom: 6px; }
.unit { margin: 22px 0 8px; }
.unit-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.unit-head > div:first-child { flex: 1; min-width: 240px; }
.unit-label { display: inline-block; font-size: .82rem; font-weight: 800; color: var(--blue); background: var(--blue-soft); border-radius: 6px; padding: 1px 9px; }
.unit-head h3 { font-size: 1.25rem; font-weight: 800; margin: 6px 0 2px; }
.unit-head p { color: var(--ink-2); margin: 0; font-size: .97rem; }
.unit-meta { display: flex; gap: 8px; align-items: center; }
.code-box { display: grid; grid-template-columns: 1fr auto; gap: 14px 20px; align-items: center; padding: 20px 22px; background: #fff; border: 1px dashed #b9cde6; border-radius: 14px; }
.code-box .error-text { grid-column: 1 / -1; margin: 0; }
@media (max-width: 760px) { .code-box { grid-template-columns: 1fr; } }
.code-txt b { display: flex; gap: 8px; align-items: center; }
.code-txt span { display: block; color: var(--ink-2); font-size: .93rem; margin-top: 4px; }
.code-form { display: flex; gap: 10px; flex-wrap: wrap; }
.code-form .input { width: 200px; min-height: 50px; text-transform: uppercase; letter-spacing: .1em; }
.player .ph .code-form { justify-content: center; }
.lessons { gap: 12px; }
.lesson { border-width: 1px; border-color: #e6ebf2; border-radius: 14px; background: #fff; }
.lesson.open { border-color: var(--blue); box-shadow: var(--shadow); }
.lesson.done { border-color: #c7e6d6; }
.lesson-head { gap: 16px; padding: 16px 20px; }
.lesson-no { border-radius: 50%; width: 52px; height: 52px; background: var(--blue-soft); border: 0; }
.lesson-no b { color: var(--blue); font-weight: 800; font-size: 1.15rem; }
.lesson-no small { display: none; }
.lesson-no .i { color: #fff; width: 22px; height: 22px; }
.lesson.done .lesson-no { background: var(--leaf); }
.lesson-title { font-weight: 700; }
.lesson-toggle { border-radius: 10px; background: var(--blue-soft); color: var(--blue); border: 0; font-weight: 700; padding: 10px 18px; }
.lesson.open .lesson-toggle { background: var(--blue); color: #fff; }
.lesson-body { background: #fcfdff; }
@media (max-width: 640px) { .lesson-no { width: 46px; height: 46px; } }
.extras { margin: 16px 0 4px; border: 1px solid #e6ebf2; border-radius: 12px; overflow: hidden; background: #fff; }
.extras-head { padding: 10px 16px; font-weight: 800; font-size: .92rem; color: var(--ink-2); background: #f7f9fc; border-bottom: 1px solid #edf1f6; }
.extra { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #edf1f6; flex-wrap: wrap; }
.extra:last-child { border-bottom: 0; }
.extra-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); flex: none; }
.extra.pending .extra-ic { background: var(--sun-soft); color: #8a5a00; }
.extra-main { flex: 1; min-width: 180px; }
.extra-main b { display: block; font-weight: 700; }
.extra-main small { display: block; color: var(--ink-2); font-size: .86rem; }
.material .pill .i { color: var(--blue); }
.disclaimer { border-radius: 10px; border-left: 4px solid var(--sun); }
.partner-box { background: linear-gradient(120deg, #fff8ee, #f1f7ff); border-color: #ebe3d6; margin-bottom: 8px; }
.partner-box h3 { font-weight: 800; }
.login-card h3 { display: flex; gap: 8px; align-items: center; font-size: 1.15rem; }
.how-list li i { border-radius: 50%; background: var(--blue); }
.tools-box { background: var(--sky-soft); border-color: #cfe2f6; }
.locked-list { margin-top: 0; }
.locked-list div { border-radius: 10px; display: flex; gap: 8px; align-items: center; background: #fff; }
.help-fab { border-radius: 999px; border: 1px solid #d5deea; color: var(--ink); font-weight: 700; height: 50px; padding: 0 20px; gap: 8px; box-shadow: var(--shadow); background: #fff; }
.help-fab .i { color: var(--blue); }
.guide .g { border-radius: 12px; }
.guide .g .ic { border-radius: 12px; color: var(--blue); width: 46px; height: 46px; background: var(--blue-soft); border: 0; }
.guide .g .ic .i { width: 22px; height: 22px; }
.fake-btn { border-radius: 6px; background: var(--blue); }
.guide .g .fake-btn.honey { background: var(--sun); color: var(--sun-ink); }
.player { border-radius: 14px; background: #14263d; }
.player .ph { color: var(--ink); background: linear-gradient(135deg, #fff7ec, #eaf3ff); }
.player .ph .i { color: var(--blue); }
.player .ph.cover { color: #fff; }
.player .ph.cover .i { color: #fff; }
.play-btn { width: 80px; height: 80px; border: 4px solid #fff; background: var(--blue); box-shadow: 0 8px 24px rgba(31, 95, 168, .45); }
.resume-tip { border-radius: 999px; }
.gen-cover { background: linear-gradient(135deg, #fff6ea 0%, #eef6ff 100%); border-left: 0; }
.gen-cover::after { content: ''; position: absolute; right: 8%; top: 14%; width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle, #ffd27a, rgba(255, 210, 122, 0) 70%); }
.gen-cover .ey { color: var(--blue); letter-spacing: .02em; }
.gen-cover .tt { color: var(--ink); font-weight: 800; }
.ccard-body h3 { font-weight: 800; }
.lecturer .av { background: var(--blue-soft); color: var(--blue); }
.cd-tabs a.on { color: var(--blue); border-color: var(--blue); }
.points li { border-radius: 12px; }
.points li::before { border-radius: 50%; background: var(--blue); }
.outline-row .n { color: var(--blue); }
.learn-top { background: #fff; border-top: 0; border-bottom: 1px solid #e6ebf2; }
.learn-top .back { border-radius: 10px; background: var(--blue-soft); border: 0; color: var(--blue); font-weight: 700; }
.learn-top .back:hover { background: #d9e7f7; }
.side-item.on { background: var(--sun-soft); box-shadow: inset 4px 0 0 var(--sun); color: var(--ink); font-weight: 700; }
.side-item .ic.done { background: var(--leaf); border-color: var(--leaf); }
.side-item .ic.play { border-color: var(--sun-hi); color: #8a5a00; }
.side-item .ic.doc { border: 0; background: var(--blue-soft); color: var(--blue); }
.side-item .ic .i { width: 13px; height: 13px; }
.tabs button.on { color: var(--blue); border-color: var(--blue); }
.continue-bar { border-radius: 14px; border: 1px solid #f6d9a3; border-left: 5px solid var(--sun); background: var(--sun-soft); }
.continue-bar small { color: #8a5a00; }
.kpi b { color: var(--blue); font-weight: 800; }
.admin-nav a { border-radius: 10px; font-weight: 600; }
.admin-nav a.on { background: var(--blue); }
.tbl th { background: #f7f9fc; }
.faq-item summary::after { border-radius: 50%; background: var(--blue); width: 28px; height: 28px; }
.auth-card .leaf { width: 60px; height: 60px; border-radius: 16px; background: var(--sun-soft); color: #8a5a00; }
.auth-card .leaf .i { width: 30px; height: 30px; }
.pwd-box { border-radius: 10px; border-width: 2px; border-color: var(--sun); background: var(--sun-soft); }
.mobile-buy { box-shadow: 0 -4px 14px rgba(30, 43, 60, .08); }
.player .ph > .i { width: 40px; height: 40px; }
.player .ph form, form.ph { margin: 0; }
@media (max-width: 640px) { .rm-head .muted { display: none; } .hero .en { font-size: .72rem; } }

/* ================= v1.4 首頁：上半部 新人區｜會員區，下半部 輪播大圖 ================= */
.home2 { padding-top: 28px; padding-bottom: 56px; }
.zones { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
@media (max-width: 1023px) { .zones { grid-template-columns: minmax(0, 1fr); gap: 20px; } }
.zone { display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid #e6ebf2; border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: 86px; }
.zone-head { padding: 26px 28px 20px; border-bottom: 1px solid #edf1f6; position: relative; }
.zone-new .zone-head { background: linear-gradient(125deg, #fff4e2 0%, #fffaf2 60%, #fff 100%); border-top: 5px solid var(--sun); }
.zone-member .zone-head { background: linear-gradient(125deg, #e9f2fd 0%, #f5f9ff 60%, #fff 100%); border-top: 5px solid var(--blue); }
.zone-badge { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; font-size: .9rem; color: #8a5a00; background: #fff; border: 1px solid #f6d9a3; border-radius: 999px; padding: 4px 14px 4px 10px; }
.zone-badge .i { color: var(--sun-hi); }
.zone-badge.member { color: var(--blue); border-color: #c6d8ef; }
.zone-badge.member .i { color: var(--blue); }
.zone-head h2 { font-size: clamp(1.6rem, 1.25rem + 1.2vw, 2.1rem); font-weight: 800; margin: 10px 0 4px; line-height: 1.35; }
.zone-head > p { color: var(--ink-2); margin: 0; }
.zone-actions { display: flex; gap: 12px 16px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.zone-stat { color: var(--ink-2); font-weight: 700; font-size: .95rem; }
.zone-progress { margin-top: 14px; max-width: 420px; }
.zone-progress small { display: block; color: var(--ink-2); font-weight: 700; margin-bottom: 5px; }
.mini-steps { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mini-steps li { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #efe3cc; border-radius: 999px; padding: 5px 14px 5px 5px; font-weight: 700; font-size: .92rem; color: var(--ink-2); }
.mini-steps .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--sun-soft); color: #8a5a00; font-weight: 800; font-size: .9rem; }
.mini-steps li.done .n { background: var(--leaf); color: #fff; }
.mini-steps li.done .n .i { width: 14px; height: 14px; }
.zone-scroll { padding: 8px 22px 24px; flex: 1; }
@media (min-width: 1024px) {
  .zone-scroll { max-height: 640px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c9d6e6 transparent; }
}
@media (max-width: 640px) { .zone-head { padding: 22px 18px 18px; } .zone-scroll { padding: 6px 14px 18px; } .zone { border-radius: 16px; } }

/* collapsible units inside zones */
.zone .unit { margin: 12px 0 0; border: 1px solid #e6ebf2; border-radius: 14px; background: #fbfcfe; }
.zone .unit.open { background: #fff; border-color: #d3e0f0; }
.unit-h { margin: 0; font-size: 1rem; }
.unit-toggle { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px 12px; align-items: center; padding: 14px 16px; background: none; border: 0; text-align: left; cursor: pointer; color: var(--ink); font: inherit; border-radius: 14px; }
.unit-toggle:hover { background: #f4f8fd; }
.unit-toggle:focus-visible { outline: 3px solid rgba(31, 95, 168, .35); outline-offset: -3px; }
.unit-name { font-weight: 800; font-size: 1.08rem; line-height: 1.45; }
.unit-meta { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.unit-count { color: var(--muted); font-size: .9rem; font-weight: 700; }
.unit-chev { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); transition: transform .2s; }
.unit.open .unit-chev { transform: rotate(180deg); }
.unit-body { display: none; padding: 0 14px 14px; }
.unit.open .unit-body { display: block; }
.unit-desc { color: var(--ink-2); margin: 0 4px 12px; font-size: .96rem; }
.zone .lessons { gap: 10px; }
.zone .lesson-head { padding: 12px 14px; gap: 12px; }
.zone .lesson-no { width: 44px; height: 44px; }
.zone .lesson-toggle { padding: 8px 14px; }
.zone .code-box { grid-template-columns: 1fr; padding: 16px; }
.zone .code-form .input { flex: 1; min-width: 150px; width: auto; }
@media (max-width: 520px) {
  .unit-toggle { grid-template-columns: minmax(0, 1fr) auto; padding: 12px; }
  .unit-toggle .unit-label { grid-column: 1 / -1; justify-self: start; }
  .unit-toggle .unit-name { grid-column: 1; }
  .unit-toggle .unit-meta { grid-column: 1; grid-row: 3; }
  .unit-toggle .unit-chev { grid-column: 2; grid-row: 2 / 4; }
  .unit-body { padding: 0 8px 10px; }
}

/* member zone */
.member-login { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 18px; align-items: start; margin-top: 14px; }
@media (max-width: 1280px) and (min-width: 1024px), (max-width: 600px) { .member-login { grid-template-columns: minmax(0, 1fr); } }
.member-login .login-card { background: #fff; border: 1px solid #d9e5f3; border-radius: 16px; padding: 20px; box-shadow: var(--shadow-sm); }
.member-login .login-card h3 { margin: 0 0 12px; font-size: 1.08rem; }
.member-login .how-list { margin: 0; padding: 16px 18px; background: var(--sky-soft); border-radius: 14px; }
.preview-title { display: flex; gap: 8px; align-items: center; font-size: 1.05rem; margin: 22px 0 10px; color: var(--ink-2); }
.preview-course { border: 1px solid #e6ebf2; border-radius: 14px; padding: 16px 18px; margin-bottom: 12px; background: #fbfcfe; }
.pc-head { display: flex; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; align-items: baseline; }
.pc-head b { font-size: 1.08rem; }
.pc-head span { color: var(--muted); font-weight: 700; font-size: .9rem; }
.preview-course p { margin: 4px 0 10px; color: var(--ink-2); font-size: .95rem; }
.preview-course ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.preview-course li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .95rem; }
.preview-course li em { font-style: normal; font-size: .8rem; font-weight: 700; color: var(--blue); background: var(--blue-soft); border-radius: 999px; padding: 0 8px; }
.member-hello { padding: 16px 28px 0; }
.member-hello p { margin: 0; color: var(--ink-2); }
.member-hello p b { display: block; color: var(--ink); font-size: 1.1rem; }
.member-hello .zone-actions { margin-top: 12px; }
@media (max-width: 640px) { .member-hello { padding: 14px 18px 0; } }
.zone-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin: 16px 28px 0; padding: 5px; background: #f1f5fa; border-radius: 14px; }
@media (max-width: 640px) { .zone-tabs { margin: 14px 18px 0; } }
.zone-tabs button { border: 0; background: none; border-radius: 10px; padding: 10px 12px; cursor: pointer; text-align: center; color: var(--ink-2); font: inherit; line-height: 1.35; }
.zone-tabs button b { display: block; font-size: 1rem; }
.zone-tabs button small { font-size: .82rem; font-weight: 600; }
.zone-tabs button[aria-selected="true"] { background: #fff; color: var(--blue); box-shadow: 0 2px 8px rgba(31, 95, 168, .15); }
.zone-search { margin: 12px 28px 0; }
@media (max-width: 640px) { .zone-search { margin: 12px 18px 0; } }
.zone-member #noResult { margin: 12px 28px 0; padding: 18px; }
.panel-intro { padding: 10px 4px 2px; }
.panel-intro p { margin: 8px 0 0; color: var(--ink-2); font-size: .96rem; }
.zone .tools-box { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 16px; border: 1px solid #cfe2f6; border-radius: 14px; }
.zone .tools-box .t { flex: 1 1 220px; }
.zone .tools-box .t b { display: flex; gap: 6px; align-items: center; }
.tools-links { display: flex; gap: 8px; flex-wrap: wrap; }
.small-notice { margin-top: 14px; font-size: .9rem; }

/* carousel */
.banner { position: relative; margin-top: 28px; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); background: #fff6ea; }
.banner-viewport { overflow: hidden; touch-action: pan-y; }
.banner-track { display: flex; transition: transform .6s cubic-bezier(.4, 0, .2, 1); }
@media (prefers-reduced-motion: reduce) { .banner-track { transition: none; } }
.slide { flex: 0 0 100%; position: relative; aspect-ratio: 16 / 5.6; min-height: 300px; user-select: none; }
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide-txt { position: absolute; left: 0; top: 0; bottom: 0; width: min(560px, 52%); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 32px 0 48px 72px; background: linear-gradient(90deg, rgba(255, 255, 255, .92) 0%, rgba(255, 255, 255, .75) 70%, rgba(255, 255, 255, 0) 100%); }
.slide-txt h2 { margin: 0 0 8px; font-size: clamp(1.5rem, 1rem + 1.8vw, 2.5rem); font-weight: 800; line-height: 1.3; color: var(--ink); }
.slide-txt p { margin: 0 0 18px; color: var(--ink-2); font-size: clamp(1rem, .95rem + .3vw, 1.15rem); }
.banner-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; border-radius: 50%; border: 1px solid #e3e8ef; background: rgba(255, 255, 255, .92); color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); z-index: 2; }
.banner-nav:hover { background: #fff; color: var(--blue); }
.banner-nav.prev { left: 14px; } .banner-nav.next { right: 14px; }
.banner-dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 4px; z-index: 2; }
.banner-dots button { width: 30px; height: 30px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; padding: 0; }
.banner-dots button::before { content: ''; width: 10px; height: 10px; border-radius: 999px; background: rgba(30, 43, 60, .28); transition: width .25s, background .25s; }
.banner-dots button[aria-current="true"]::before { width: 28px; background: var(--blue); }
@media (max-width: 760px) {
  .banner { border-radius: 16px; margin-top: 22px; }
  .slide { aspect-ratio: auto; min-height: 0; display: flex; flex-direction: column; }
  .slide img { position: static; height: 190px; }
  .slide-txt { position: static; width: auto; padding: 18px 20px 54px; background: #fff; }
  .banner-nav { top: 95px; width: 42px; height: 42px; }
  .banner-nav.prev { left: 10px; } .banner-nav.next { right: 10px; }
}
/* admin: home carousel */
.banner-admin { display: grid; gap: 12px; margin-top: 16px; }
.ba-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px; }
.ba-row.off { opacity: .6; }
.ba-row img { width: 200px; height: 70px; object-fit: cover; border-radius: 10px; border: 1px solid #e6ebf2; }
.ba-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ba-preview { border: 1px dashed #c9d6e6; border-radius: 12px; min-height: 90px; display: grid; place-items: center; overflow: hidden; background: #f7f9fc; }
.ba-preview img { width: 100%; aspect-ratio: 16 / 5.6; object-fit: cover; }
@media (max-width: 760px) { .ba-row { grid-template-columns: minmax(0, 1fr); } .ba-row img { width: 100%; height: auto; aspect-ratio: 16 / 5.6; } .ba-act { justify-content: flex-start; } }
/* v1.4 tweaks */
.member-login { display: block; }
.login-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 14px; }
@media (max-width: 1180px) and (min-width: 1024px), (max-width: 560px) { .login-fields { grid-template-columns: minmax(0, 1fr); } }
.mini-steps.member li { border-color: #cfdff2; }
.mini-steps.member .n { background: var(--blue-soft); color: var(--blue); }
.slide-txt { width: min(660px, 56%); padding-left: 88px; }
.slide-txt h2 { font-size: clamp(1.5rem, 1rem + 1.4vw, 2.25rem); }
@media (max-width: 760px) { .slide-txt { width: auto; padding-left: 20px; } }
@media (max-width: 760px) { .slide img { object-position: 82% center; } }

/* ================= v1.5 安麗會員註冊・推薦組織 ================= */
.auth-wrap:has(.signup-card) { max-width: 680px; }
.signup-cta { margin-top: 10px; }
.su-step { border: 1px solid #e6ebf2; border-radius: 14px; padding: 6px 18px 4px; margin: 18px 0 0; background: #fbfcfe; }
.su-step legend { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; padding: 0 8px; color: var(--ink); }
.su-step legend i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: .85rem; }
.sponsor-row { display: flex; gap: 10px; flex-wrap: wrap; }
.sponsor-row .input { flex: 1; min-width: 180px; }
.sp-result { min-height: 0; margin: -4px 0 12px; font-weight: 600; }
.sp-result:empty { display: none; }
.sp-result.ok { display: flex; gap: 6px; align-items: center; color: var(--leaf-ink); background: var(--leaf-soft); border: 1px solid #b5e0cb; border-radius: 10px; padding: 10px 14px; }
.sp-result.err { color: var(--danger); background: var(--danger-soft); border-radius: 10px; padding: 10px 14px; }
.sp-result .i { color: var(--leaf); }
.amway-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 10px 0 0; }
.amway-dl div { background: #f7f9fc; border: 1px solid #e6ebf2; border-radius: 12px; padding: 12px 14px; }
.amway-dl dt { color: var(--ink-2); font-size: .86rem; font-weight: 700; }
.amway-dl dd { margin: 2px 0 0; font-weight: 800; font-size: 1.08rem; }
.amway-dl dd small { display: block; font-weight: 500; color: var(--muted); font-size: .85rem; }
.amway-admin { border-top: 1px solid #e6ebf2; padding-top: 6px; }
.amway-admin h4 { margin: 8px 0 4px; }

/* team page */
.team .team-head { display: flex; justify-content: space-between; gap: 18px 24px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.team .team-head .page-title { margin: 10px 0 4px; }
.team .team-head .page-sub { margin: 0; }
.back-link { display: inline-block; margin-bottom: 10px; font-weight: 700; }
.invite-box { display: grid; gap: 4px; justify-items: start; background: var(--sun-soft); border: 1px solid #f6d9a3; border-radius: 14px; padding: 14px 16px; max-width: 360px; }
.invite-box span { color: var(--ink-2); font-size: .9rem; }
.invite-box .btn { margin-top: 6px; background: #fff; }
.team-locked { text-align: center; }
.team-locked .leaf { width: 60px; height: 60px; margin: 0 auto 10px; border-radius: 16px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.team-locked .invite-box { margin: 18px auto 0; justify-items: center; text-align: center; }
.team-kpis { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.team-toolbar { display: flex; gap: 10px 12px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.team-toolbar .input-icon { flex: 1 1 240px; }
.team-toolbar select.input { width: auto; }
.seg { display: inline-flex; background: #eef2f7; border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 9px; font: inherit; font-weight: 700; color: var(--ink-2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; min-height: 42px; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--blue); box-shadow: 0 2px 6px rgba(31, 95, 168, .15); }
.team-empty p { max-width: 36em; margin: 8px auto 0; }
.row-act { white-space: nowrap; }
@media (max-width: 760px) {
  .team-table { overflow: visible; border: 0; background: transparent; }
  .team-table table, .team-table tbody, .team-table tr, .team-table td { display: block; width: 100%; }
  .team-table thead { display: none; }
  .team-table tr { background: #fff; border: 1px solid #e6ebf2; border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
  .team-table td { border: 0; padding: 5px 0; display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 8px; align-items: center; }
  .team-table td::before { content: attr(data-label); color: var(--muted); font-size: .86rem; font-weight: 700; }
  .team-table td:first-child { grid-template-columns: minmax(0, 1fr); font-size: 1.05rem; }
  .team-table td:first-child::before { display: none; }
  .team-table td.row-act { grid-template-columns: minmax(0, 1fr); padding-top: 8px; }
  .team-table td.row-act .btn { width: 100%; }
  .team-table .bar-cell { min-width: 0; }
  .team-toolbar select.input { flex: 1 1 140px; }
}
/* organization tree */
.org-tree { padding: 14px 16px; overflow-x: auto; }
.org-tree ul { list-style: none; margin: 0; padding-left: 22px; border-left: 2px solid #e3eaf3; margin-left: 15px; }
.org-node > ul { display: none; }
.org-node.open > ul { display: block; }
.org-row { display: grid; grid-template-columns: 30px minmax(150px, 1fr) auto minmax(150px, 220px) 90px; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; min-width: 600px; }
.org-row:hover { background: #f6f9fd; }
.org-row.root { background: var(--sun-soft); margin-bottom: 6px; }
.org-row.hit { background: #fff8e8; box-shadow: inset 3px 0 0 var(--sun); }
.org-tt { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--blue-soft); color: var(--blue); cursor: pointer; display: grid; place-items: center; transition: transform .15s; transform: rotate(-90deg); }
.org-node.open > .org-row .org-tt { transform: none; }
.org-sp { width: 30px; }
.org-name { background: none; border: 0; text-align: left; padding: 0; font: inherit; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; line-height: 1.35; }
button.org-name:hover b { color: var(--blue); text-decoration: underline; }
.org-prog .bar-cell { min-width: 0; }
.org-count { text-align: right; white-space: nowrap; }
@media (max-width: 760px) {
  .table-wrap.team-table .tbl { min-width: 0; }
  .team-table td:first-child { min-width: 0; }
  .team-table tbody tr:hover td { background: transparent; }
  .team-table .cv { min-width: 0; }
}
/* v1.5.1 admin users: inline rank + always-visible actions */
.users-table .tbl td { vertical-align: middle; }
.users-table .u-who { min-width: 190px; max-width: 280px; }
.users-table .u-contact { overflow-wrap: anywhere; }
.rank-select { min-height: 42px; width: auto; min-width: 150px; padding: 0 34px 0 12px; font-weight: 700; }
.rank-select.leader { background-color: var(--sun-soft); border-color: #f2c46b; color: #7a4d00; }
.users-table .sticky-act { position: sticky; right: 0; background: #fff; box-shadow: -8px 0 10px -8px rgba(30, 43, 60, .18); z-index: 1; }
.users-table thead .sticky-act { background: #f7f9fc; }
.users-table tbody tr:hover .sticky-act { background: #f9fbfd; }
.act-col { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.act-col .btn { white-space: nowrap; }
.keep-pw { margin-top: 18px; padding-top: 16px; border-top: 1px dashed #d5deea; text-align: center; }
.keep-pw > span { display: block; color: var(--muted); font-size: .92rem; margin-bottom: 8px; }

/* ================= v1.6 首頁：左右兩張入口圖 ================= */
.entries { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 760px) { .entries { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
.entry-card { position: relative; display: block; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid #e6ebf2; background: #fff; transition: transform .2s, box-shadow .2s; }
.entry-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.entry-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(31, 95, 168, .18); text-decoration: none; }
.entry-card:focus-visible { outline: 4px solid rgba(31, 95, 168, .45); outline-offset: 3px; }
.entry-new { border-top: 5px solid var(--sun); }
.entry-member { border-top: 5px solid var(--blue); }
.entry-go { position: absolute; right: 16px; bottom: 16px; width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--blue); display: grid; place-items: center; box-shadow: var(--shadow-sm); transition: transform .2s; }
.entry-card:hover .entry-go { transform: translateX(4px); }
@media (prefers-reduced-motion: reduce) { .entry-card, .entry-go { transition: none; } .entry-card:hover { transform: none; } }
.zone-page { padding-top: 22px; padding-bottom: 56px; max-width: 1080px; }
.zone-page .zone { scroll-margin-top: 86px; }
.zone-page .zone-scroll { max-height: none; overflow: visible; }
.zone-switch { text-align: center; margin-top: 26px; }
.entry-admin { margin: 14px 0 6px; }
.entry-admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 10px; }
.entry-admin-item { display: grid; gap: 8px; }
.entry-admin-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; border: 1px solid #e6ebf2; }
/* v1.6.1 新人區頁：左文字、右大圖 */
.zone-page.wide { max-width: 1240px; }
.zp-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 28px; align-items: start; }
.zp-side { position: sticky; top: 90px; }
.zp-side img { width: 100%; aspect-ratio: 3 / 4; max-height: calc(100vh - 120px); object-fit: cover; border-radius: 22px; box-shadow: var(--shadow); border: 1px solid #efe3cc; }
@media (max-width: 1023px) {
  .zp-split { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .zp-side { position: static; order: -1; }
  .zp-side img { aspect-ratio: 16 / 10; max-height: 340px; object-position: center 40%; }
}
.entry-admin-item img { object-fit: contain; background: #f7f9fc; }

/* ================= v1.7 品牌標誌：富康生活+教育平台 ================= */
.site-header .bar { height: 84px; }
.brand-logo { padding: 0; gap: 0; flex: none; }
.brand-logo img { height: 66px; width: auto; display: block; max-width: none; }
.brand-logo:hover { text-decoration: none; opacity: .92; }
@media (max-width: 1180px) { .nav { top: 84px; } }
.cd-tabs { top: 84px; }
#toasts { top: 98px; }
.zone, .zone-page .zone { scroll-margin-top: 98px; }
.zp-side { top: 104px; }
.zp-side img { max-height: calc(100vh - 130px); }
.admin-nav { top: 104px; }
@media (max-width: 640px) {
  .site-header .bar { height: 66px; }
  .brand-logo img { height: 48px; }
  .nav { top: 66px; }
  .cd-tabs { top: 66px; }
  #toasts { top: auto; }
}
@media (max-width: 360px) { .brand-logo img { height: 40px; } }
/* v1.7.1 carousel: picture-only slides (picture already contains its own text) */
.slide.image-only .slide-link { position: absolute; inset: 0; display: block; }
.slide.image-only .slide-link:focus-visible { outline: 4px solid rgba(31, 95, 168, .5); outline-offset: -4px; }
@media (max-width: 760px) {
  .slide.image-only { display: block; min-height: 0; aspect-ratio: 16 / 5.6; }
  .slide.image-only img { position: absolute; inset: 0; height: 100%; object-fit: cover; }
  .banner .banner-nav { top: var(--nav-top, 95px); transition: top .35s ease; }
}
.image-only-check { align-items: flex-start; background: var(--sky-soft); border: 1px solid #cfe2f6; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.image-only-check small { font-weight: 400; }
/* each slide keeps its own height; the viewport follows the current slide (JS) */
.banner-track { align-items: flex-start; }
.banner-viewport { transition: height .35s ease; }
@media (prefers-reduced-motion: reduce) { .banner-viewport { transition: none; } }

/* ================= v1.8 管理後台：課程管理 ================= */
.course-steps { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; background: var(--sun-soft); border: 1px solid #f6d9a3; border-radius: 14px; padding: 12px 16px; margin: 6px 0 18px; font-size: .95rem; }
.course-steps span { display: inline-flex; gap: 8px; align-items: center; color: var(--ink-2); }
.course-steps i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: .8rem; font-weight: 800; flex: none; }
.admin-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ac-card { overflow: hidden; display: flex; flex-direction: column; padding: 0; }
.ac-cover { display: block; aspect-ratio: 16 / 7; background: linear-gradient(135deg, #fff6ea, #eaf3ff); overflow: hidden; }
.ac-cover img { width: 100%; height: 100%; object-fit: cover; }
.ac-gen { display: grid; place-items: center; height: 100%; padding: 12px; text-align: center; font-weight: 800; font-size: 1.2rem; color: var(--blue); }
.ac-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ac-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ac-body h3 { margin: 2px 0 0; font-size: 1.12rem; }
.ac-body h3 a { color: var(--ink); }
.ac-act { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: auto; padding-top: 10px; }
.ac-act .spacer { flex: 1; }
.place-field { background: var(--sky-soft); border: 1px solid #cfe2f6; border-radius: 12px; padding: 12px 14px; }
.editor-jump { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: -6px 0 16px; }
.ed-anchor, #edBasic { scroll-margin-top: 100px; }

/* ================= v1.8.3 上課頁：影片不被遮住、字體加大 ================= */
.player .wm { color: rgba(255, 255, 255, .22); font-size: .72rem; transition: opacity .4s; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
#playerBox { scroll-margin-top: 72px; }
.learn-top .ct { font-size: 1.12rem; }
.lec-title { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); line-height: 1.4; }
.learn-main .below { font-size: 1.08rem; }
.learn-main .below .muted, .learn-main .below .small { font-size: .98rem; }
.lec-nav .btn { min-height: 56px; font-size: 1.1rem; }
.tabs button { font-size: 1.1rem; padding: 14px 20px; }
.side-item { font-size: 1.04rem; }
.side-item small { font-size: .9rem; }
@media (max-width: 900px) {
  /* phone: slimmer top bar, and the video stays pinned right below it while reading the description */
  .learn-top { height: 60px; padding: 0 12px; gap: 10px; }
  .learn-top .back { height: 44px; padding: 0 14px; font-size: 1.1rem; }
  .learn-top .ct { font-size: 1.12rem; }
  .learn { min-height: calc(100vh - 60px); }
  #playerBox { position: sticky; top: 60px; z-index: 20; background: #000; scroll-margin-top: 60px; }
  .learn-main .below { padding: 0 18px; font-size: 1.12rem; }
  .lec-title { font-size: 1.55rem; margin-top: 18px; }
  .tabs button { font-size: 1.12rem; }
}
@media (max-width: 900px) and (orientation: landscape) { #playerBox { position: static; } }

/* ================= v1.8.4 手機／平板選單：整頁可捲動，登出一定點得到 ================= */
@media (max-width: 1180px) {
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: #fff; }
  html.menu-open, html.menu-open body { overflow: hidden; }
  .nav.open {
    position: fixed; top: 84px; left: 0; right: 0; bottom: 0; height: auto; max-height: none;
    overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 8px;
    padding: 14px 16px calc(32px + env(safe-area-inset-bottom)); z-index: 60; box-shadow: none; border-top: 1px solid #e6ebf2;
  }
  .nav.open > a, .nav.open > .nav-help { padding: 14px; font-size: 1.08rem; min-height: 56px; border: 1px solid #e6ebf2; justify-content: flex-start; }
  .nav.open > a .i, .nav.open > .nav-help .i { width: 20px; height: 20px; }
  .nav.open > .menu-wrap, .nav.open > .btn { grid-column: 1 / -1; }
  .nav.open .menu-wrap .dropdown { margin-top: 4px; padding-top: 6px; }
  .nav.open .dropdown .who { padding: 10px 4px 12px; }
  .nav.open .dropdown .who b { font-size: 1.1rem; }
  .nav.open .dropdown a, .nav.open .dropdown button { min-height: 54px; font-size: 1.08rem; padding: 12px 14px; }
  .nav.open #logoutBtn { justify-content: center; margin-top: 10px; border: 1px solid #f1c3bf; background: var(--danger-soft); color: var(--danger); font-weight: 800; }
  .nav.open #logoutBtn .i { color: var(--danger); }
  .burger[aria-expanded="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }
}
@media (max-width: 640px) { .nav.open { top: 66px; } }
@media (max-width: 360px) { .nav.open { grid-template-columns: minmax(0, 1fr); } }
@media (max-height: 520px) and (max-width: 1180px) { .nav.open { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .nav.open .nav-help { display: flex !important; align-items: center; gap: 7px; } }
html.menu-open #toasts { display: none; }
#toasts { pointer-events: none; }
#toasts .toast { pointer-events: auto; }
