/* DavidHuangLab — UI v0.1 working defaults.
 * Drop-in replacement for assets/css/style.css; existing HTML hooks retained.
 * Font files/HTML links are supplied by the site, not by this stylesheet.
 */
:root {
  --brand: #1B2BFF;
  --ink: #0E1821;
  --white: #FFFFFF;
  --gray: #8293A1;
  --gray-1: #F2F2F2;
  --gray-2: #F5F5F5;
  --action: #3F5FC4;
  --action-hover: #3653B0;
  --action-active: #2E4799;
  --action-ui: #5B7EE0;
  --accent: #4A6BD0;
  --action-dark: var(--action);
  --muted: #5C6D7B;
  --error: #C62828;
  --success: #1E7A46;
  --warn: #8B5A00;
  --font: "Poppins", "Noto Sans TC", "Noto Sans CJK TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-en: "Poppins", "Noto Sans TC", "Noto Sans CJK TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --s1: 4px;
  --s2: 8px;
  --s3: 16px;
  --s4: 24px;
  --s5: 32px;
  --s6: 48px;
  --s7: 64px;
  --s8: 96px;
  --s9: 128px;
  --content: 1120px;
  --read: 720px;
  --r-input: 8px;
  --r-card: 12px;
  --r-btn: 999px; /* Clamps to half the button height for a capsule. */

  /* Compatibility aliases: --brand now means CI blue, not the CTA fill. */
  --bg: var(--white);
  --header: var(--brand);
  --brand-d: var(--action-dark);
  --teal: var(--action-dark);
  --sun: var(--action);
  --navy: var(--ink);
  --navy2: #1C3142;
  --on-dark: #C5D0D9;
  --blog: var(--gray-2);
  --tint: #EEF2FC;
  --card: var(--white);
  --line: var(--gray-1);
  --radius: var(--r-card);
  --shadow: none;
  --line-green: #06c755;
  --line-hover: #05a648;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 28px;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
svg { max-width: 100%; }
a {
  color: var(--action-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .15s, border-color .15s;
}
a:hover { color: var(--accent); text-decoration-thickness: 2px; }
a:active { color: var(--ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Widths include no internal padding: existing .wrap/.narrow can be combined. */
.wrap { width: calc(100% - 64px); max-width: var(--content); margin-inline: auto; }
.narrow { width: calc(100% - 64px); max-width: var(--read); margin-inline: auto; }
.read { max-width: var(--read); }
.center { text-align: center; }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s4); }
h1, h2, h3, h4 { margin: 0 0 var(--s3); letter-spacing: 0; overflow-wrap: anywhere; }
h1, .h1 { font-size: 48px; line-height: 60px; font-weight: 700; }
h2, .h2 { font-size: 32px; line-height: 44px; font-weight: 700; }
h3, .h3 { font-size: 22px; line-height: 32px; font-weight: 600; }
h4, .h4 { font-size: 18px; line-height: 28px; font-weight: 600; }
.lead { font-size: 18px; line-height: 32px; }
.caption { font-size: 14px; line-height: 22px; color: var(--muted); }
.en { font-family: var(--font-en); }
.eyebrow {
  margin: 0 0 var(--s2);
  font-family: var(--font-en);
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow.light { color: var(--on-dark); }
.sec-title { text-align: center; font-size: 32px; line-height: 44px; font-weight: 700; margin: var(--s7) 0 var(--s5); }
.sec-title:after, .prose h2:after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  background: var(--brand);
  margin: var(--s3) auto 0;
}
.prose h2:after { margin-left: 0; }

/* Buttons: shared capsule radius; primary 48px, small 40px minimum height. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 48px;
  max-width: 100%;
  padding: 10px var(--s4);
  border: 2px solid var(--action);
  border-radius: var(--r-btn);
  background: var(--action);
  color: var(--white);
  font-family: inherit;
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  letter-spacing: .02em;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  box-shadow: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}
.btn:hover { background: var(--action-hover); border-color: var(--action-hover); color: var(--white); }
.btn:active { background: var(--action-active); border-color: var(--action-active); color: var(--white); transform: translateY(1px); }
.btn-ghost, .btn-pill {
  background: var(--white);
  color: var(--action-dark);
  border-color: var(--action);
  border-radius: var(--r-btn);
  box-shadow: none;
}
.btn-ghost { border-color: var(--action); }
.btn-ghost:hover, .btn-pill:hover { background: var(--tint); border-color: var(--action-hover); color: var(--action-dark); box-shadow: none; }
.btn-light { background: var(--white); color: var(--action-dark); border-color: var(--white); border-radius: var(--r-btn); box-shadow: none; }
.btn-light:hover { background: var(--gray-2); border-color: var(--gray-2); color: var(--action-dark); box-shadow: none; }
.btn-ghost:active, .btn-pill:active, .btn-light:active { background: var(--gray-1); color: var(--action-dark); }
.btn-sm { min-height: 40px; padding: 6px var(--s3); font-size: 16px; }
.btn-big { min-height: 56px; padding: 14px var(--s5); font-size: 18px; }
.btn-line { background: var(--line-green); border-color: var(--line-green); border-radius: var(--r-btn); }
.btn-line:hover, .btn-line:active { background: var(--line-hover); border-color: var(--line-hover); color: var(--white); }
.btn svg { flex: none; width: 20px; height: 20px; }
.btn:disabled, .btn[aria-disabled="true"], .mailform button[disabled] {
  background: var(--gray-1);
  border-color: var(--gray-1);
  color: var(--gray);
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
  opacity: 1;
}

/* Header: .hdr-bar may wrap the entire header row; use a top border as strip. */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--white); border-bottom: 1px solid var(--line); box-shadow: none; }
.hdr-bar { background: var(--white); border-top: 8px solid var(--brand); }
.hdr { display: flex; align-items: center; gap: var(--s3); min-height: 72px; padding-block: var(--s2); }
.brand { display: flex; align-items: center; min-width: 0; flex: 1 1 auto; text-decoration: none; margin-right: auto; }
.brand picture { display: block; flex: none; max-width: 100%; }
/* E6 horizontal viewBox 2873×304 → at 48px tall ≈ 454px wide; do not crop */
.brand-logo { height: 48px; width: auto; max-width: min(100%, 454px); object-fit: contain; object-position: left center; }
.hdr-cta { flex-shrink: 0; min-height: 40px; padding: 6px var(--s3); font-size: 16px; border-radius: var(--r-btn); }
.site-nav { background: var(--white); }
.nav-in { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 var(--s2); padding: var(--s2) 0; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: var(--s2) var(--s3);
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--gray); }
.site-nav a.on, .site-nav a[aria-current="page"], .site-nav a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }
.nav-toggle {
  position: relative;
  display: none;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  background: none;
  border: 0;
  border-radius: var(--r-btn);
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); transition: transform .2s, opacity .2s; }

/* Image overlays are functional contrast layers, the only gradients retained. */
.hero { position: relative; min-height: min(78vh, 680px); display: grid; align-items: center; color: var(--white); overflow: hidden; background: var(--ink); }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.hero:after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, rgba(14,24,33,.85) 20%, rgba(14,24,33,.25)); pointer-events: none; }
.hero-inner { position: relative; z-index: 1; padding: var(--s8) 0; }
.hero h1 { max-width: var(--read); }
.hero h1 em { font-style: normal; color: #DCE3FA; }
.hero-ctas { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }
.page-hero {
  position: relative;
  color: var(--white);
  padding: var(--s8) 0;
  background: linear-gradient(110deg, rgba(14,24,33,.88), rgba(14,24,33,.35)), var(--bg-img, var(--bg)) center/cover;
  background-color: var(--ink);
}
/* Retain the old --bg image hook on pages that supply an inline style. */
.page-hero[style] { background: linear-gradient(110deg, rgba(14,24,33,.88), rgba(14,24,33,.3)), var(--bg-img, var(--bg)) center/cover; background-color: var(--ink); }
.page-hero h1 { font-size: 48px; line-height: 60px; }
.page-hero p { max-width: var(--read); color: var(--on-dark); }
.page-hero.small { padding: var(--s7) 0; background: var(--ink); color: var(--white); }
.page-hero.small .eyebrow { color: #DCE3FA; }
.page-hero.small .btn-light { background: var(--white); color: var(--action-dark); border-color: var(--white); }
.hero .eyebrow, .page-hero .eyebrow { color: var(--on-dark); }

/* Home and shared panels. */
.highlight { margin-top: -48px; position: relative; z-index: 2; }
.hl-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: none; padding: var(--s5) clamp(24px, 4vw, 48px); }
.hl-tag { display: inline-block; background: var(--gray-1); color: var(--ink); border-radius: var(--r-card); padding: 0 var(--s2); font-size: 13px; line-height: 24px; font-weight: 600; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.feat { background: var(--card); border-radius: var(--r-card); padding: var(--s4); text-decoration: none; color: var(--ink); box-shadow: none; transition: border-color .15s, transform .15s; border: 1px solid var(--line); min-width: 0; }
a.feat:hover { transform: translateY(-2px); border-color: var(--gray); color: var(--ink); }
.feat .ico { font-size: 32px; line-height: 48px; }
.feat p { color: var(--muted); margin: 0; }
.about { margin-top: var(--s7); }
.about-head { display: flex; gap: var(--s5); align-items: center; flex-wrap: wrap; background: var(--gray-1); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s5); }
.about-head .round { width: 152px; height: 152px; border-radius: 50%; object-fit: cover; border: 4px solid var(--white); }
.about-head h2 small { font-size: 14px; line-height: 22px; color: var(--muted); letter-spacing: .08em; margin-left: var(--s2); }
.accordion { margin-top: var(--s4); columns: 2; column-gap: var(--s4); }
.accordion details, .faq details { break-inside: avoid; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); margin-bottom: var(--s3); padding: 0 var(--s4); }
.accordion summary, .faq summary { cursor: pointer; font-weight: 600; padding: var(--s3) var(--s5) var(--s3) 0; list-style: none; position: relative; }
.accordion summary::-webkit-details-marker, .faq summary::-webkit-details-marker { display: none; }
.accordion summary:after, .faq summary:after { content: "+"; position: absolute; right: 0; top: var(--s3); font-size: 22px; color: var(--action-dark); }
details[open]>summary:after { content: "\2013"; }
.accordion ul { padding-left: var(--s4); margin: 0 0 var(--s3); font-size: 16px; }
.accordion a { text-decoration: none; }

/* Social links retain circular icon hit areas, not pill CTA styling. */
.social { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.social a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); color: var(--white); transition: background-color .15s, color .15s; }
.social a:hover { background: var(--action-dark); color: var(--white); }
.social svg { width: 20px; height: 20px; }
.social.dark a { background: var(--white); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.social.dark a:hover { background: var(--action-dark); color: var(--white); border-color: var(--action-dark); }

/* Sessions / signup. */
.sessions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); margin-top: -48px; position: relative; z-index: 2; }
.session { min-width: 0; background: var(--white); border-radius: var(--r-card); padding: var(--s4); box-shadow: none; border: 1px solid var(--line); }
.session ul { list-style: none; padding: 0; margin: var(--s3) 0; font-size: 16px; }
.session p { color: var(--muted); font-size: 16px; }
.session a { font-weight: 700; text-decoration: none; }
.pill { display: inline-block; border-radius: var(--r-card); padding: 0 var(--s2); font-size: 13px; line-height: 24px; font-weight: 600; color: var(--ink); }
.pill.a, .pill.b { background: var(--tint); color: var(--action-dark); } /* A／B 統一同一 tint＋action-dark 方案 */
.detail { margin-top: var(--s7); }
.cal { border-radius: var(--r-card); margin: var(--s3) 0 var(--s4); background: var(--white); }
.facts { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--s2) var(--s3); background: var(--white); padding: var(--s4); border-radius: var(--r-card); border: 1px solid var(--line); }
.facts dt { font-weight: 600; color: var(--action-dark); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.teacher { display: grid; grid-template-columns: minmax(224px, 336px) minmax(0, 1fr); gap: var(--s5); align-items: center; margin-top: var(--s8); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s5); box-shadow: none; }
.teacher img { border-radius: var(--r-card); aspect-ratio: 3/4; object-fit: cover; width: 100%; }
.awards { columns: 2; padding-left: var(--s4); font-size: 16px; color: var(--muted); }
.signup { margin-top: var(--s7); margin-inline: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: clamp(24px, 4vw, 48px); box-shadow: none; width: calc(100% - 64px); max-width: var(--content); }
.placeholder { background: var(--tint); border: 1px dashed var(--gray); border-radius: var(--r-card); padding: var(--s4); margin: var(--s3) 0; }
.form-spec { margin-top: var(--s4); }
.form-spec ol>li { margin-bottom: var(--s2); }
.form-spec ul { color: var(--muted); font-size: 16px; }
.note { font-size: 14px; line-height: 22px; color: var(--muted); background: var(--bg); padding: var(--s3); border-radius: var(--r-input); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); margin-top: var(--s5); }
.box { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s4); font-size: 16px; }
.box h3 { font-size: 22px; line-height: 32px; color: var(--ink); }
.box ul { padding-left: var(--s4); }
.box.accent { background: var(--tint); }

/* Course layouts: retain existing order, ratios and HTML semantics. */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6); align-items: center; margin-top: var(--s7); }
.split>img { border-radius: var(--r-card); box-shadow: none; }
.split.rev>img { order: 2; }
.nums .num { display: flex; gap: var(--s3); align-items: center; margin: var(--s3) 0; }
.nums b { flex: 0 0 40px; height: 40px; border-radius: var(--r-input); background: var(--gray-1); color: var(--action-dark); display: grid; place-items: center; }
.nums p { margin: 0; }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.duo img { border-radius: var(--r-card); aspect-ratio: 4/5; object-fit: cover; width: 100%; }
.ticks { padding-left: 0; list-style: none; }
.ticks li { padding-left: var(--s5); position: relative; margin: var(--s2) 0; }
.ticks li:before { content: "\2714"; position: absolute; left: 0; color: var(--success); }
.units { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.unit { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s4); box-shadow: none; }
.unit small { color: var(--action-dark); font-size: 14px; line-height: 22px; font-weight: 600; }
.unit p { color: var(--muted); font-size: 16px; }
.choose { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.opt { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; box-shadow: none; padding-bottom: var(--s4); }
.opt img { width: 100%; aspect-ratio: 2.2/1; object-fit: cover; }
.opt h3, .opt p, .opt .btn { margin-left: var(--s4); margin-right: var(--s4); }
.opt h3 { margin-top: var(--s4); }
.opt .btn { max-width: calc(100% - 48px); }
.opt p { color: var(--muted); }
.video { position: relative; aspect-ratio: 16/9; border-radius: var(--r-card); overflow: hidden; margin: var(--s5) 0; box-shadow: none; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Gallery. No image scaling: movement is capped at 2px. */
.masonry { columns: 4; column-gap: var(--s3); }
.masonry a { display: block; margin-bottom: var(--s3); break-inside: avoid; border-radius: var(--r-card); }
.masonry img { border-radius: var(--r-card); width: 100%; transition: transform .15s; }
.masonry img:hover { transform: translateY(-2px); }
.notice { background: var(--tint); border-left: 2px solid var(--brand); padding: var(--s3) var(--s4); border-radius: 0 var(--r-input) var(--r-input) 0; margin: var(--s5) 0; }

/* Contact: platform colors are deliberate exceptions to the CI palette. */
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: var(--s4); margin-top: var(--s6); }
.cc { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s4); text-decoration: none; color: var(--ink); box-shadow: none; transition: border-color .15s, transform .15s; }
.cc:hover { transform: translateY(-2px); border-color: var(--c, var(--gray)); color: var(--ink); }
.cc svg { width: 36px; height: 36px; color: var(--c, var(--action-dark)); }
.cc p { color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.cc.fb { --c: #1877f2; }
.cc.line { --c: var(--line-green); }
.cc.mail { --c: var(--action-dark); }
.cc.ig { --c: #d62976; }
.cc.yt { --c: #ff0000; }
.cc .qr { width: 120px; margin-top: var(--s3); }
.mailform { display: grid; gap: var(--s3); background: var(--white); padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: none; min-width: 0; }
.mailform label { display: grid; gap: var(--s2); font-size: 15px; line-height: 22px; font-weight: 600; }
.mailform input, .mailform textarea, .mailform select {
  min-width: 0;
  width: 100%;
  height: 48px;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--ink);
  padding: 0 var(--s3);
  border-radius: var(--r-input);
  border: 1px solid var(--gray);
  background: var(--white);
  transition: border-color .15s;
}
.mailform textarea { height: auto; min-height: 120px; padding-block: 12px; resize: vertical; }
.mailform input::placeholder, .mailform textarea::placeholder { color: var(--gray); opacity: 1; }
.mailform input:hover, .mailform textarea:hover, .mailform select:hover { border-color: var(--ink); }
.mailform input:focus, .mailform textarea:focus, .mailform select:focus { outline: 2px solid var(--brand); outline-offset: 2px; border-color: var(--action-ui); }
.mailform input[aria-invalid="true"], .mailform textarea[aria-invalid="true"], .mailform select[aria-invalid="true"] { border-color: var(--error); }
.mailform fieldset { min-width: 0; border: 1px solid var(--gray); border-radius: var(--r-input); padding: var(--s3) var(--s4); margin: 0; display: grid; gap: var(--s2); }
.mailform legend { font-weight: 600; padding: 0 var(--s2); }
.check-list label, .radio-list label { display: flex; align-items: flex-start; gap: var(--s2); min-height: 40px; font-size: 16px; font-weight: 400; cursor: pointer; line-height: 28px; }
.check-list input, .radio-list input, .mailform input[type="checkbox"], .mailform input[type="radio"] { width: 20px; height: 20px; min-height: 0; margin: 4px 0 0; flex: none; accent-color: var(--action-ui); padding: 0; }
.mailform .note, .mailform .help { color: var(--muted); font-size: 14px; line-height: 22px; font-weight: 400; margin: 0; }
.form-err { color: var(--error); font-size: 14px; line-height: 22px; font-weight: 600; margin: 0; }
.form-thanks { background: var(--white); border: 1px solid var(--line); border-left: 2px solid var(--success); padding: var(--s4); border-radius: var(--r-input); margin: var(--s4) 0; }
.form-thanks h3 { margin: 0 0 var(--s2); }
.form-thanks p { margin: 0; }
.banner-link { display: block; margin: var(--s6) auto 0; max-width: var(--read); text-align: center; text-decoration: none; font-weight: 600; }
.banner-link img { border-radius: var(--r-card); box-shadow: none; margin-bottom: var(--s2); }

/* Blog / reading. Keep .foot's existing footer meaning; no demo .card .foot. */
.filters { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: center; margin: var(--s5) 0 var(--s4); }
.chip { min-height: 40px; border: 1px solid var(--gray); background: var(--white); color: var(--ink); border-radius: var(--r-btn); padding: 4px var(--s3); font: inherit; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.chip.on, .chip:hover { background: var(--tint); color: var(--action-dark); border-color: var(--action-dark); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.card { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: none; transition: border-color .15s, transform .15s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-2px); border-color: var(--gray); color: var(--ink); }
.card-img { aspect-ratio: 4/3; overflow: hidden; background: var(--gray-1); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: var(--s4); }
.card-body small { color: var(--action-dark); font-size: 14px; line-height: 22px; font-weight: 600; }
.card-body h3 { font-size: 22px; line-height: 32px; margin: var(--s2) 0; }
.card-body p { color: var(--muted); font-size: 16px; line-height: 28px; margin: 0; }
.post { padding-top: var(--s5); }
.post h1 { font-size: 48px; line-height: 60px; }
.back { text-decoration: none; font-weight: 600; }
.meta { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; color: var(--muted); font-size: 14px; line-height: 22px; margin-bottom: var(--s5); }
.avatar { width: 32px; height: 32px; border-radius: 50%; }
.tag { display: inline-block; background: var(--tint); color: var(--action-dark); padding: 0 var(--s2); border-radius: var(--r-card); font-size: 13px; line-height: 24px; font-weight: 600; }
.prose { max-width: var(--read); margin-inline: auto; overflow-wrap: anywhere; }
.prose img { border-radius: var(--r-card); margin: var(--s4) auto; }
.prose h2 { margin-top: var(--s6); font-size: 32px; line-height: 44px; }
.prose h3 { margin-top: var(--s5); }
.prose h5, .prose h6 { font-size: 16px; line-height: 28px; font-weight: 600; margin: var(--s3) 0; }
.prose a { word-break: break-word; }
.prose pre { background: var(--ink); color: var(--white); padding: var(--s3); border-radius: var(--r-card); overflow: auto; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.prose td, .prose th { border: 1px solid var(--gray); padding: var(--s2) var(--s3); }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; background: var(--ink); color: var(--white); border-radius: var(--r-card); padding: var(--s5); margin: var(--s7) 0; }
.cta-band h3 { margin: 0; color: var(--white); }
.cta-band p { margin: var(--s2) 0 0; color: var(--on-dark); }

/* Tools and products. */
.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); margin-top: var(--s6); }
.tool { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s4); text-decoration: none; color: var(--ink); box-shadow: none; transition: border-color .15s, transform .15s; }
.tool:hover { transform: translateY(-2px); border-color: var(--gray); color: var(--ink); }
.tool p { color: var(--muted); font-size: 16px; }
.tool span { color: var(--action-dark); font-weight: 600; }
.tool-frame { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: none; overflow: hidden; margin-top: var(--s5); }
.tool-frame iframe { width: 100%; border: 0; display: block; max-height: 85vh; }
.prods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
.prod { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s3); box-shadow: none; text-align: center; }
.prod img { border-radius: var(--r-input); aspect-ratio: 1; object-fit: cover; width: 100%; }
.prod h3 { font-size: 18px; line-height: 28px; margin: var(--s3) 0 var(--s2); }
.prod b { color: var(--action-dark); }

/* Footer / persistent LINE contact. */
.site-footer { background: var(--ink); color: var(--on-dark); margin-top: var(--s8); padding: var(--s7) 0 var(--s4); }
.foot { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: var(--s5); }
.foot>div { min-width: 0; }
.foot h4 { color: var(--white); margin: 0 0 var(--s2); }
.foot a { display: block; color: var(--on-dark); text-decoration: none; margin: var(--s2) 0; font-size: 14px; line-height: 22px; overflow-wrap: anywhere; }
.foot a:hover { color: var(--white); text-decoration: underline; }
.foot .social a { display: grid; margin: 0; }
.foot a.foot-brand { display: inline-block; background: var(--white); border-radius: var(--r-card); padding: var(--s2) var(--s3); margin: 0 0 var(--s3); }
.foot-brand img { height: 64px; width: auto; }
.foot p { font-size: 14px; line-height: 22px; }
.copy { border-top: 1px solid #2A4256; margin-top: var(--s5); padding-top: var(--s3); font-size: 14px; line-height: 22px; color: var(--on-dark); }
.float-line { position: fixed; right: var(--s3); bottom: var(--s3); z-index: 60; min-height: 48px; background: var(--line-green); color: var(--white); border-radius: var(--r-btn); display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); text-decoration: none; font-size: 18px; line-height: 24px; font-weight: 700; box-shadow: none; }
.float-line svg { width: 24px; height: 24px; }
.float-line:hover { color: var(--white); background: var(--line-hover); }

/* Existing page modes. Light cards keep dark text inside the dark page. */
.mode-light { background: var(--white); }
.mode-blog { background: var(--blog); }
.mode-blog .card { border: 1px solid var(--line); box-shadow: none; }
.mode-blog .card:hover { border-color: var(--gray); box-shadow: none; }
.mode-blog .post { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s5) clamp(24px, 4vw, 48px); margin-top: var(--s5); }
.mode-dark { background: var(--navy2); color: var(--on-dark); }
.mode-dark main h1, .mode-dark main h2, .mode-dark main h3 { color: var(--white); }
.mode-dark .page-hero.small { background: var(--navy); }
.mode-dark .notice { background: var(--navy); border-left-color: var(--brand); color: var(--on-dark); }
.mode-dark .masonry img { box-shadow: none; }
.mode-dark .site-footer { margin-top: var(--s7); border-top: 1px solid #2A4256; }
.mode-dark main :is(.hl-card, .feat, .about-head, .accordion details, .faq details, .session, .facts, .teacher, .signup, .box, .unit, .opt, .cc, .mailform, .form-thanks, .card, .tool, .prod) { color: var(--ink); }
.mode-dark main :is(.hl-card, .feat, .about-head, .accordion details, .faq details, .session, .facts, .teacher, .signup, .box, .unit, .opt, .cc, .mailform, .form-thanks, .card, .tool, .prod) :is(h1, h2, h3),
.mode-dark.mode-blog main .post :is(h1, h2, h3) { color: var(--ink); }
.mode-dark main .prose { color: var(--on-dark); }
.mode-dark main .mode-blog .prose { color: var(--ink); }
.mode-dark main a:not(.btn):not(.feat):not(.cc):not(.card):not(.tool):not(.float-line) { color: #DCE3FA; }
.mode-dark main :is(.hl-card, .feat, .about-head, .accordion details, .faq details, .session, .facts, .teacher, .signup, .box, .unit, .opt, .cc, .mailform, .form-thanks, .card, .tool, .prod) a:not(.btn) { color: var(--action-dark); }

/* GIF/MP4 and vertical videos retain their existing sizing behavior. */
video.gif-video { display: block; max-width: 100%; height: auto; border-radius: var(--r-card); margin: var(--s4) auto; background: #000; }
picture { display: contents; }
.video-pair { display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: center; }
.video.vertical { aspect-ratio: 9/16; width: min(100%, 340px); margin: var(--s3) 0; }
.split>.video { margin: 0; }

/* Tablet <=1024, mobile <=768: no legacy 820/720/560/400 breakpoints. */
@media (max-width: 1024px) {
  .brand-logo { height: 44px; }
  .features, .sessions, .units, .cards, .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prods { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .masonry { columns: 3; }
  .foot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot>div:first-child { grid-column: 1/-1; }
}
@media (max-width: 768px) {
  .wrap, .narrow, .signup { width: calc(100% - 32px); }
  h1, .h1, .hero h1, .page-hero h1, .post h1 { font-size: 32px; line-height: 44px; }
  h2, .h2, .sec-title, .prose h2 { font-size: 24px; line-height: 34px; }
  .hdr { min-height: 64px; gap: var(--s2); flex-wrap: wrap; }
  .brand { flex: 1 1 auto; min-width: 0; max-width: calc(100% - 120px); }
  .brand-logo { height: 44px; max-width: 100%; }
  .hdr-cta { padding-inline: var(--s2); }
  .nav-toggle { display: flex; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; border-bottom: 1px solid var(--gray); box-shadow: none; max-height: calc(100vh - var(--header-h-measured, 80px)); max-height: calc(100dvh - var(--header-h-measured, 80px)); overflow-y: auto; overscroll-behavior: contain; }
  .nav-open .site-nav { display: block; }
  .nav-in { flex-direction: column; align-items: stretch; padding: var(--s2) var(--s3) var(--s3); }
  .site-nav a { padding: var(--s3); font-size: 16px; border-bottom: 2px solid transparent; }
  .site-nav a.on, .site-nav a[aria-current="page"], .site-nav a[aria-current="true"] { border-bottom-color: var(--brand); background: var(--gray-2); }
  /* Reposition strokes for the structural X; no translation exceeds 2px. */
  .nav-open .nav-toggle span:nth-child(1) { position: absolute; top: 23px; left: 12px; transform: rotate(45deg); }
  .nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-open .nav-toggle span:nth-child(3) { position: absolute; top: 23px; left: 12px; transform: rotate(-45deg); }
  .hero-inner, .page-hero, .page-hero.small { padding-block: var(--s7); }
  .features, .sessions, .units, .cards, .tools, .grid2, .choose, .split, .teacher { grid-template-columns: minmax(0, 1fr); }
  .teacher, .signup, .mailform, .about-head, .mode-blog .post { padding: var(--s4); }
  .teacher img { max-width: 280px; }
  .split.rev>img { order: 0; }
  .accordion, .awards { columns: 1; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts dt { margin-top: var(--s2); }
  .prods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .masonry { columns: 2; }
  .foot { grid-template-columns: minmax(0, 1fr); }
  .cta-band { align-items: flex-start; padding: var(--s4); }
  .float-line span { display: none; }
  .float-line { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; transform: none !important; scroll-behavior: auto !important; }
  /* Preserve a usable open/close state with text strokes when motion is off. */
  .nav-open .nav-toggle span:nth-child(1), .nav-open .nav-toggle span:nth-child(3) { opacity: 0; }
  .nav-open .nav-toggle span:nth-child(2) { opacity: 1; position: relative; height: 24px; background: none; }
  .nav-open .nav-toggle span:nth-child(2)::after { content: "\00D7"; position: absolute; inset: 0; color: var(--ink); font-size: 28px; line-height: 24px; text-align: center; }
}


/* ===== 2026-10-27 官網改版（IA／首頁／行事曆／作品／標籤） ===== */
/* 首頁・開課資訊：招生日期加大 */
.hl-card h2 { margin-top: var(--s2); }
.hl-dates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); margin: var(--s4) 0 var(--s3); }
.hl-date { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s1); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s3) var(--s4); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; min-width: 0; }
.hl-date:hover { border-color: var(--action); transform: translateY(-2px); color: var(--ink); }
.hl-date .hl-date-date, .hl-date .hl-date-title { font-size: clamp(22px, 2vw, 26px); line-height: 1.4; font-weight: 700; letter-spacing: -.01em; color: var(--ink); overflow-wrap: anywhere; }
.hl-date-date { font-family: var(--font-en); font-variant-numeric: tabular-nums; }
.hl-date-title { margin-top: var(--s2); }
.hl-date .hl-date-meta { margin-top: auto; padding-top: var(--s2); color: var(--muted); font-size: 15px; line-height: 22px; }
.hl-where { margin: 0; color: var(--muted); }
.hl-tag { background: var(--action); color: var(--white); font-size: 14px; line-height: 28px; padding: 0 var(--s3); border-radius: var(--r-btn); }
.feat-meta { display: block; margin-top: var(--s3); font-size: 14px; font-weight: 600; color: var(--action-dark); }
.small-note { color: var(--muted); font-size: 15px; margin-top: var(--s4); }

/* 經歷 accordion：收合時露出 1～2 項預覽；hover 提示 */
.accordion summary { display: flex; flex-direction: column; gap: 2px; }
.acc-name { font-weight: 600; }
.acc-peek { display: flex; flex-direction: column; gap: 2px; font-weight: 400; font-size: 14px; line-height: 22px; color: var(--muted); }
.acc-peek span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-peek span::before { content: "・"; color: var(--action); }
.acc-peek em { font-style: normal; font-size: 13px; color: var(--action-dark); font-weight: 600; }
.accordion details[open] .acc-peek { display: none; }
.accordion details { transition: border-color .15s, background-color .15s; }
@media (hover: hover) {
  .accordion details:not([open]):hover { border-color: var(--action); background: var(--tint); }
  .accordion details:not([open]):hover .acc-name { color: var(--action-dark); }
}

/* 冬季頁：行事曆 HTML 表格（取代 png） */
.cal-wrap { margin: var(--s4) 0; }
.cal-table { width: 100%; border-collapse: separate; border-spacing: var(--s2) 0; table-layout: fixed; }
.cal-table caption { caption-side: bottom; text-align: left; font-size: 14px; color: var(--muted); padding: var(--s2) var(--s2) 0; }
.cal-table th { background: var(--ink); color: var(--white); border-radius: var(--r-card) var(--r-card) 0 0; padding: var(--s2) var(--s2); font-weight: 600; vertical-align: top; }
.cal-table th:nth-child(odd) { background: var(--action); }
.cal-table th b { display: block; font-family: var(--font-en); font-size: 20px; line-height: 28px; }
.cal-table th small { display: block; font-size: 13px; line-height: 18px; font-weight: 500; opacity: .9; }
.cal-table td { background: var(--white); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r-card) var(--r-card); padding: var(--s3) var(--s2); vertical-align: middle; text-align: center; }
.cal-table td ul { list-style: none; margin: 0; padding: 0; font-size: 16px; line-height: 26px; font-weight: 500; color: var(--ink); }
.cal-list { display: none; list-style: none; margin: 0; padding: 0; }
.cal-note { font-size: 14px; color: var(--muted); margin: var(--s2) var(--s2) 0; }
@media (max-width: 760px) {
  .cal-table { display: none; }
  .cal-list { display: grid; gap: var(--s2); }
  .cal-list > li { display: grid; grid-template-columns: 96px 1fr; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; background: var(--white); }
  .cal-list > li:nth-child(odd) .cal-day { background: var(--action); }
  .cal-day { background: var(--ink); color: var(--white); padding: var(--s2); display: flex; flex-direction: column; justify-content: center; text-align: center; }
  .cal-day b { font-family: var(--font-en); font-size: 18px; }
  .cal-day small { font-size: 12px; line-height: 16px; opacity: .9; }
  .cal-list ul { list-style: none; margin: 0; padding: var(--s2) var(--s3); font-size: 15px; line-height: 24px; align-self: center; }
}

/* 教學小工具：即將推出卡 */
.tool.soon { border-style: dashed; background: var(--gray-2); cursor: default; }
.tool.soon:hover { transform: none; border-color: var(--line); }
.tool.soon span { color: var(--muted); }
.soon-tag { display: inline-block; font-size: 12px; font-weight: 600; color: var(--action-dark); background: var(--tint); border-radius: var(--r-btn); padding: 0 var(--s2); line-height: 22px; }

/* 部落格：卡片標籤／chip 計數 */
.card-tags { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s3); }
.card-tags span { font-size: 13px; line-height: 22px; font-weight: 600; color: var(--action-dark); background: var(--tint); border-radius: var(--r-btn); padding: 0 var(--s2); }
.chip small { font-size: 12px; opacity: .7; margin-left: 2px; }
a.tag { text-decoration: none; margin-left: var(--s1); }

/* 學生作品 */
.works { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); margin-top: var(--s4); }
.work { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; display: flex; flex-direction: column; }
.work-img { aspect-ratio: 4/3; background: var(--gray-1); display: grid; place-items: center; overflow: hidden; }
.work-img img { width: 100%; height: 100%; object-fit: cover; }
.work-img span { font-family: var(--font-en); font-weight: 600; color: var(--gray); font-size: 14px; letter-spacing: .05em; }
.work-body { padding: var(--s3); }
.work-body h3 { font-size: 18px; line-height: 26px; margin: var(--s1) 0; }
.work-body p { font-size: 14px; line-height: 22px; color: var(--muted); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.works-unique { display: inline-block; border-left: 2px solid var(--action); padding: var(--s2) var(--s3); font-weight: 600; }
.works-status { color: var(--muted); text-align: center; margin: var(--s4) 0 var(--s2); }
.works-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); margin: var(--s3) 0 var(--s5); }
.works-pagination .btn { min-width: 44px; min-height: 44px; padding: var(--s2) var(--s3); }
.works-pagination [aria-current="page"] { background: #3F5FC4; border-color: #3F5FC4; color: var(--white); }
#projects { scroll-margin-top: 0; }
.chip[disabled] { cursor: default; opacity: .6; }
.reels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.reel .video { margin: 0 0 var(--s2); }
.reel h3 { font-size: 17px; line-height: 26px; margin: 0; }
.duo.one { grid-template-columns: minmax(0, 1fr); }
.duo.one img { aspect-ratio: 4/3; }
@media (max-width: 960px) { .works { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .works { grid-template-columns: repeat(2, minmax(0, 1fr)); } .reels, .hl-dates { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .brand-logo { height: 38px; } .works { grid-template-columns: minmax(0, 1fr); } }

/* 1D Game bilingual layout: all new product-page styles stay scoped here. */
.page-1dgame .page-hero.small { background: var(--tint); color: var(--ink); }
.page-1dgame .page-hero h1 { font-size: 48px; line-height: 60px; }
.page-1dgame .page-hero .lead { font-size: 18px; line-height: 30px; color: #5C6D7B; }
.page-1dgame .page-hero .eyebrow { font-size: 14px; line-height: 22px; color: #5C6D7B; }
.page-1dgame main h2 { font-size: 22px; line-height: 32px; font-weight: 600; margin: var(--s5) 0 var(--s3); }
.page-1dgame main p, .page-1dgame main li { font-size: 16px; line-height: 28px; }
.page-1dgame .section-en { display: block; font-size: 14px; line-height: 22px; color: #5C6D7B; font-weight: 400; }
.page-1dgame .onedgame-section { margin-block: var(--s6); }
.page-1dgame .bi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); margin-bottom: var(--s4); }
.page-1dgame .bi > * { min-width: 0; margin-block: 0; overflow-wrap: anywhere; }
.page-1dgame .bi-en { color: #5C6D7B; }
.page-1dgame .shipping-callout { border-left: 2px solid #3F5FC4; background: var(--gray-2); padding: var(--s3) var(--s4); margin-block: var(--s5); }
.page-1dgame .shipping-callout p { margin: 0; }
.page-1dgame .shipping-callout [lang="en"] { color: #5C6D7B; }
.page-1dgame .prod-price { color: var(--action); font-weight: 600; margin: var(--s2) 0; }
.page-1dgame .shipping-badge { display: inline-block; padding: var(--s1) var(--s2); border-radius: var(--r-btn); background: var(--tint); color: var(--muted); font-size: 14px; line-height: 22px; }
.page-1dgame .btn { border-radius: var(--r-btn); }
.page-1dgame .btn span[lang="en"] { font-size: 14px; font-weight: 400; }
@media (max-width: 640px) {
  .page-1dgame .page-hero h1 { font-size: 32px; line-height: 44px; }
  .page-1dgame .bi { grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
  .page-1dgame .prods { grid-template-columns: minmax(0, 1fr); }
  .page-1dgame .row { align-items: stretch; flex-direction: column; }
}

/* dhl-mime-fix-20261027 */

/* ===== 2026-10-28 UX 三件（報名動線／課程卡資訊／手機品牌＋表單） ===== */
/* 錨點不被 sticky header 遮住（桌機 header＋導覽約 140px；手機導覽收合約 76px） */
html { scroll-padding-top: calc(var(--header-h-measured, 144px) + 12px); }
#signup, #course-a, #course-b, #signup-rules { scroll-margin-top: 0; }
@media (max-width: 768px) { html { scroll-padding-top: calc(var(--header-h-measured, 76px) + 12px); } }

/* 手機 ≤480：M mark 旁補中文品牌名；>480 不顯示，不影響垂直／水平 Logo */
.brand-name { display: none; }
@media (max-width: 480px) {
  .brand { gap: var(--s2); }
  .brand picture { flex: none; }
  .brand-name { display: block; font-size: clamp(15px, 4.4vw, 18px); line-height: 1.2; font-weight: 700; color: var(--brand); letter-spacing: .02em; min-width: 0; }
}
@media (max-width: 480px) {
  .hdr { flex-wrap: nowrap; }
  .brand { max-width: none; flex: 1 1 auto; }
  .brand-name span { white-space: nowrap; }
}
@media (max-width: 359px) {
  .brand-name { font-size: 14px; line-height: 18px; }
  .brand-name > span { display: block; }
  .hdr-cta { font-size: 15px; padding-inline: 10px; }
  .brand-logo { height: 32px; }
}

/* 課程卡：適合／先修／費用 */
.hl-facts { list-style: none; margin: var(--s2) 0 0; padding: var(--s2) 0 0; border-top: 1px solid var(--line); width: 100%; display: grid; gap: 6px; font-size: 15px; line-height: 22px; color: var(--ink); }
.hl-facts li { display: grid; grid-template-columns: 3em minmax(0, 1fr); column-gap: var(--s2); }
.hl-facts b { color: var(--action-dark); font-weight: 600; }
.hl-facts small { grid-column: 2; display: block; color: var(--muted); font-size: 13px; line-height: 20px; }
.hl-date .hl-date-meta { margin-top: auto; }
.session-links { display: flex; flex-wrap: wrap; gap: var(--s3); }
.session ul li { margin-bottom: 4px; }

/* cta-band 雙按鈕 */
.cta-band-btns { margin-top: 0; }

/* 報名區：必要提醒 → 表單 → 完整規則可展開 */
.signup-lead { color: var(--muted); }
.must-know { background: var(--tint); border-radius: var(--r-card); padding: var(--s3) var(--s4); margin: var(--s4) 0; }
.must-know h3 { font-size: 20px; line-height: 28px; margin: 0 0 var(--s2); }
.must-know ul { margin: 0; padding-left: var(--s4); font-size: 15px; line-height: 24px; }
.must-know li + li { margin-top: 6px; }
.signup-rules { margin-top: var(--s5); border: 1px solid var(--line); border-radius: var(--r-card); padding: 0 var(--s4); }
.signup-rules > summary { cursor: pointer; font-weight: 600; padding: var(--s3) var(--s5) var(--s3) 0; list-style: none; position: relative; }
.signup-rules > summary::-webkit-details-marker { display: none; }
.signup-rules > summary::after { content: "+"; position: absolute; right: 0; top: var(--s3); font-size: 22px; color: var(--action-dark); }
.signup-rules[open] > summary::after { content: "\2013"; }
.signup-rules .grid2 { margin: 0 0 var(--s4); }

/* 表單：外層 .signup 已是卡片，內層不再重複框線與留白 */
.signup .mailform { padding: 0; border: 0; border-radius: 0; gap: var(--s3); }
.form-step { display: flex; align-items: center; gap: var(--s2); margin: var(--s3) 0 0; font-size: 18px; font-weight: 700; color: var(--ink); }
.form-step b { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #3F5FC4; color: var(--white); font-size: 15px; font-family: var(--font-en); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.form-row { align-items: start; }
.form-row label { align-content: start; }
.course-pick label > span { display: flex; flex-direction: column; line-height: 24px; }
.course-pick label > span small { font-size: 14px; line-height: 22px; color: var(--muted); }
@media (max-width: 768px) {
  .signup { padding: var(--s3); width: calc(100% - 24px); }
  .signup .mailform { padding: 0; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .mailform fieldset { padding: var(--s2) var(--s3); }
  .check-list label, .radio-list label { font-size: 15px; line-height: 24px; }
  .must-know { padding: var(--s3); }
  .must-know ul { padding-left: 20px; }
  .signup-rules { padding: 0 var(--s3); }
  .site-footer { padding-bottom: 72px; }
  .float-line { bottom: calc(var(--s3) + env(safe-area-inset-bottom, 0px)); }
}
/* LINE 浮鈕：報名區／表單在畫面中時淡出避讓（報名區內已有 LINE 連結） */
.float-line { transition: opacity .2s, transform .2s; }
.line-dodge .float-line { opacity: 0; pointer-events: none; transform: translateY(12px); }


/* parity-fix: product cards as links + product detail + maker hub */
a.prod-link { display:block; color:inherit; text-decoration:none; }
a.prod-link:hover h3 { color: var(--action-dark); }
.prod-more { display:inline-block; margin-top: var(--s2); font-size:14px; font-weight:600; color: var(--action-dark); }
.product-grid { display:grid; gap: var(--s5); grid-template-columns: 1.1fr 1fr; align-items:start; }
@media (max-width: 860px){ .product-grid { grid-template-columns: 1fr; } }
.product-media { margin:0; border-radius: var(--r-card); overflow:hidden; border:1px solid var(--line); }
.product-media img { display:block; width:100%; height:auto; }
.mailform label.chk { display:flex; align-items:flex-start; gap: var(--s2); font-weight:500; }
.mailform label.chk input { margin-top: 2px; }
.maker-hub { display:grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: var(--s4) 0; }
.maker-hub a { display:block; padding: var(--s3); border:1px solid var(--line); border-radius: var(--r-card); text-decoration:none; color: var(--ink); background: var(--white); }
.maker-hub a:hover { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.maker-hub a strong { display:block; margin-bottom: 4px; }
.maker-hub a span { color: var(--muted); font-size: 14px; line-height: 1.4; }
.site-nav .nav-more summary { list-style:none; cursor:pointer; color: var(--muted); padding: var(--s2) var(--s3); font-size:16px; font-weight:500; }
.site-nav .nav-more[open] summary, .site-nav .nav-more summary:hover { color: var(--ink); }
.site-nav .nav-more .nav-sub { display:flex; flex-wrap:wrap; gap: 0 var(--s2); padding: 0 0 var(--s2); justify-content:center; }
.site-nav .nav-more .nav-sub a { font-size: 14px; }
#ardublock-downloads[hidden] { display:none !important; }


/* 2026-10-29 improvements */
.foot a.foot-brand.foot-brand-e6 { background: transparent; border-radius: 0; padding: 14px 0; margin: 0 0 var(--s3); }
.foot-brand-e6 img { height: auto; width: min(420px, 100%); }
.hero-entries { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.hero-entries a { color: var(--white); text-decoration: none; border: 1px solid rgba(255,255,255,.7); border-radius: 999px; padding: 8px 18px; font-weight: 500; }
.hero-entries a:hover, .hero-entries a:focus-visible { background: var(--white); color: var(--ink); }
.hub-group { margin: var(--s5) 0 var(--s2); }
.maker-hub a span { display: block; color: var(--muted, #4a5866); font-size: .95em; line-height: 1.5; }
.notice.archived { border-left: 4px solid #8293A1; padding-left: var(--s3); }

/* Course overview and footer line wrapping. */
.feat-static, .feat-static:hover { cursor: default; transform: none; border-color: var(--line); transition: none; }
.arduino-overview { scroll-margin-top: 0; }
.arduino-overview > .wrap + .wrap { margin-top: var(--s7); }
.arduino-overview .work-img img { object-fit: contain; }
.foot > div:first-child { text-align: left; }
.foot a.foot-brand.foot-brand-e6 { display: block; padding-inline: 0; margin-inline: 0; width: min(420px, 100%); }
.foot-brand-e6 img { display: block; width: 100%; height: auto; }
.foot .foot-tagline { display: flex; flex-wrap: wrap; margin-inline: 0; padding-inline: 0; text-align: left; }
.foot-tagline > span { white-space: nowrap; }
.foot .social { justify-content: flex-start; margin-inline: 0; padding-inline: 0; }

/* Line-break readability: avoid single-character last lines (2026-10-30) */
h1,h2,h3,h4,h5,h6,caption,figcaption,.eyebrow,.btn,.feat-meta,.hl-date-title,.hl-date-meta{text-wrap:balance}
p,li,dd,dt,td,th,small,label,blockquote,.note,.help{text-wrap:pretty}
.nw{white-space:nowrap;overflow-wrap:normal;word-break:normal}
.must-know ul.sub{padding-left:20px;margin:4px 0 0;list-style:disc}
.must-know ul.sub li+li{margin-top:2px}
/* 2027winter v3: batch date table + video caption */
.batch-dates{width:100%;border-collapse:collapse;margin:var(--s3) 0 6px;font-size:15px;line-height:24px}
.batch-dates caption{text-align:left;font-weight:700;margin-bottom:6px}
.batch-dates th,.batch-dates td{padding:8px 10px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
.batch-dates th{white-space:nowrap;width:1%}
.batch-note{margin:0 0 var(--s3);font-size:15px}
.video-caption{margin:var(--s4) 0 8px;font-size:14px;font-weight:700;color:var(--muted,#555)}
@media (max-width:520px){.batch-dates th,.batch-dates td{display:block;width:auto;padding:4px 0}.batch-dates th{border-bottom:0;padding-top:10px}}

/* Keep the resource menu out of the desktop navigation's document flow. */
.site-nav .nav-more { position: relative; min-width: 0; }
.site-nav .nav-more summary { line-height: 24px; border-bottom: 2px solid transparent; }
.site-nav .nav-more summary::-webkit-details-marker { display: none; }
.site-nav .nav-more .nav-sub { position: absolute; right: 0; top: 100%; z-index: 55; width: 420px; max-width: calc(100vw - 32px); padding: 12px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); justify-content: flex-start; }
.site-nav .nav-more:not([open]) .nav-sub { display: none; }
@media (min-width: 1101px) {
  .nav-in { flex-wrap: nowrap; gap: 0; }
  .nav-in > a, .site-nav .nav-more summary { white-space: nowrap; padding-inline: 12px; }
}
/* Use the existing mobile menu before all nine items would become crowded. */
@media (max-width: 1100px) {
  .nav-toggle { display: flex; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; max-height: calc(100vh - var(--header-h-measured, 80px)); max-height: calc(100dvh - var(--header-h-measured, 80px)); overflow-y: auto; overscroll-behavior: contain; border-bottom: 1px solid var(--gray); }
  .nav-open .site-nav { display: block; }
  .nav-in { flex-direction: column; align-items: stretch; gap: 0; padding: var(--s2) var(--s3) var(--s3); }
  .site-nav a, .site-nav .nav-more summary { display: block; padding: var(--s3); }
  .site-nav .nav-more .nav-sub { position: static; width: auto; max-width: 100%; display: flex; flex-direction: column; padding: 0 0 0 var(--s3); border: 0; }
}
.work-meta { color: var(--muted); font-size: 14px; line-height: 22px; }
.video-caption + .video{margin-top:0}
/* v4 第二輪：手機選單遮罩與浮動 LINE 避讓。 */
.nav-backdrop { display: none; }
@media (max-width: 1100px) {
  body.nav-open { overflow: hidden; }
  .nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 40; margin: 0; padding: 0; border: 0; border-radius: 0; background: rgba(14, 24, 33, .45); cursor: pointer; }
  .site-nav .nav-more .nav-sub a { padding-block: 10px; }
  .nav-open .float-line { visibility: hidden; pointer-events: none; }
}
@media (max-width: 768px) {
  .float-line { width: 44px; height: 44px; min-height: 44px; padding: 10px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  main { padding-bottom: 60px; }
  .site-footer { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
  .faq summary, .accordion summary { padding-right: 44px; }
  .line-mobile-dodge .float-line { visibility: hidden; opacity: 0; pointer-events: none; }
}

/* v6 mobile QA: preserve short terms and accessible hit areas. */
.hl-where, .faq summary, .session-table tbody th, .session h3,
.opt h3, .hl-tag, .pill { text-wrap: balance; }
.site-header .hdr-cta { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.social a { width: 44px; height: 44px; min-width: 44px; min-height: 44px; flex-shrink: 0; }
.site-footer a:not(.foot-brand):not(.social a) { display: inline-block; min-height: 44px; padding-block: 11px; }
.foot a:not(.foot-brand):not(.social a) { display: block; margin-block: 0; }
.winter-preview-actions > a, .winter-anchor-nav a { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
.check-list label, .radio-list label, .mailform label:has(input[type="checkbox"]) { min-height: 44px; padding-block: 8px; cursor: pointer; }
.contact-page .float-line { display: none; }
@media (max-width: 768px) {
  body:has(.float-line):not(.contact-page) main { padding-bottom: 88px; }
  body:has(.float-line):not(.contact-page) .site-footer { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  .line-mobile-dodge .float-line { transition: none; }
}
