/* ==========================================================================
   TICDA 2026 — 台灣國際疾病分類學會 新版網站樣式
   設計概念：以 logo 的深林綠為底，嫩葉綠與薄荷綠為光源色；
   標題用襯線字體呈現「端莊」，ICD 代碼以等寬字呈現「專業／科技」。
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  /* 色彩（取自 logo） */
  --forest: #013f26;        /* logo 底色 */
  --forest-deep: #01281a;   /* 更深的林綠，用於頁尾與 hero 漸層 */
  --pine: #0b5a37;          /* 次要深綠，互動底色 */
  --leaf: #8be97b;          /* logo 嫩葉綠：主強調色 */
  --mint: #7afecd;          /* logo 圓點薄荷色：科技光點 */
  --sage: #d6ecd9;          /* 淡綠：區塊底色、標籤 */
  --paper: #f3f7f2;         /* 頁面底色（冷調綠白，非米色） */
  --surface: #ffffff;
  --ink: #0e2419;           /* 主要文字 */
  --muted: #4d6558;         /* 次要文字 */
  --line: #d3e1d6;          /* 分隔線 */
  --danger: #b3261e;
  --warn: #8a5a00;
  --ok: #1d6b3f;

  /* 字體 */
  --font-serif: "Noto Serif TC", "Noto Serif CJK TC", "Songti TC", "PMingLiU", serif;
  --font-sans: "Noto Sans TC", "Noto Sans CJK TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-code: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* 字級（1.25 比例） */
  --fs-xs: .8125rem;
  --fs-sm: .9375rem;
  --fs-base: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5625rem;
  --fs-2xl: 1.95rem;
  --fs-3xl: 2.45rem;
  --fs-4xl: clamp(2.2rem, 4.2vw, 3.4rem);

  /* 空間與形狀 */
  --gutter: clamp(16px, 4vw, 40px);
  --container: 1200px;
  --radius-s: 4px;
  --radius-m: 10px;
  --header-h: 72px;
  --shadow-float: 0 18px 40px -18px rgba(1, 40, 26, .45);
  --focus: 0 0 0 3px var(--surface), 0 0 0 5px var(--pine);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--pine); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--forest); text-decoration-thickness: 2px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-s); }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 700; line-height: 1.35; margin: 0 0 .6em; letter-spacing: .02em; }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p { margin: 0 0 1em; }
code, .code { font-family: var(--font-code); font-weight: 500; letter-spacing: .01em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--leaf); color: var(--forest); padding: 8px 14px; border-radius: var(--radius-s); font-weight: 700; }
.skip-link:focus { top: 12px; }

/* ---------- 3. Buttons & form controls ---------- */
.btn {
  --btn-bg: var(--forest); --btn-fg: #fff; --btn-bd: var(--forest);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em; white-space: nowrap;
  min-height: 44px; padding: .55em 1.25em;
  font: 500 var(--fs-sm)/1.2 var(--font-sans); letter-spacing: .04em;
  color: var(--btn-fg); background: var(--btn-bg); border: 1px solid var(--btn-bd);
  border-radius: var(--radius-s); cursor: pointer; text-decoration: none;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn:hover { --btn-bg: var(--pine); --btn-bd: var(--pine); color: #fff; text-decoration: none; }
.btn svg { width: 1.1em; height: 1.1em; }
.btn--leaf { --btn-bg: var(--leaf); --btn-fg: var(--forest); --btn-bd: var(--leaf); }
.btn--leaf:hover { --btn-bg: #a6f297; --btn-bd: #a6f297; color: var(--forest); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--forest); --btn-bd: var(--forest); }
.btn--ghost:hover { --btn-bg: var(--forest); color: #fff; }
.btn--ghost-light { --btn-bg: transparent; --btn-fg: #eafff0; --btn-bd: rgba(139, 233, 123, .6); }
.btn--ghost-light:hover { --btn-bg: rgba(139, 233, 123, .14); --btn-bd: var(--leaf); color: #fff; }
.btn--danger { --btn-bg: #fff; --btn-fg: var(--danger); --btn-bd: #e6b8b4; }
.btn--danger:hover { --btn-bg: var(--danger); --btn-bd: var(--danger); color: #fff; }
.btn--sm { min-height: 34px; padding: .35em .85em; font-size: var(--fs-xs); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }

.field { display: grid; gap: 6px; margin-bottom: 18px; align-content: start; }
.field > label, .field > .label { font-weight: 500; font-size: var(--fs-sm); }
.field .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: var(--fs-xs); color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  font: inherit; font-size: var(--fs-sm); color: var(--ink);
  background: #fff; border: 1px solid #b9ccbf; border-radius: var(--radius-s);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px rgba(11, 90, 55, .18); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.field .error { color: var(--danger); font-size: var(--fs-xs); }
.choice { display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-sm); margin: 4px 0; }
.choice input { margin-top: .35em; accent-color: var(--pine); width: 16px; height: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; align-items: start; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- 4. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  min-height: var(--header-h);
  background: var(--forest);
  border-bottom: 1px solid rgba(139, 233, 123, .18);
  color: #e6f5ea;
}
.site-header__inner { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; flex-shrink: 0; }
.brand img { height: 46px; width: auto; }
.brand:hover { color: #fff; text-decoration: none; }
.brand__name { font-family: var(--font-serif); font-size: 1.02rem; line-height: 1.25; letter-spacing: .08em; }
.brand__name small { display: block; font-family: var(--font-sans); font-size: .68rem; letter-spacing: .06em; color: rgba(214, 236, 217, .72); }

.nav { margin-left: auto; }
.nav__list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.nav__item { position: relative; }
.nav__link {
  display: flex; align-items: center; gap: 4px;
  height: var(--header-h); padding: 0 11px;
  color: #dcefe1; font-size: var(--fs-sm); letter-spacing: .04em;
  text-decoration: none; background: none; border: 0; cursor: pointer; font-family: inherit;
  position: relative;
}
.nav__link::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 16px; height: 2px; background: var(--leaf); transform: scaleX(0); transform-origin: left; transition: transform .2s; }
.nav__link:hover, .nav__item:focus-within > .nav__link { color: #fff; text-decoration: none; }
.nav__link:hover::after, .nav__link[aria-current="true"]::after { transform: scaleX(1); }
.nav__link svg { width: 12px; height: 12px; opacity: .7; }
.nav__menu {
  position: absolute; top: calc(100% - 8px); left: 0; min-width: 220px;
  list-style: none; margin: 0; padding: 8px;
  background: #fff; border-radius: var(--radius-m); box-shadow: var(--shadow-float);
  border-top: 3px solid var(--leaf);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .15s, transform .15s, visibility .15s;
}
.nav__item:hover > .nav__menu, .nav__item.is-open > .nav__menu { opacity: 1; visibility: visible; transform: none; }
.nav__menu a { display: block; padding: 9px 12px; color: var(--ink); font-size: var(--fs-sm); text-decoration: none; border-radius: var(--radius-s); }
.nav__menu a:hover, .nav__menu a[aria-current="page"] { background: var(--sage); color: var(--forest); }
.nav__menu a .ext { font-size: .75em; color: var(--muted); margin-left: 4px; }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: 8px; }
.header-actions .btn { min-height: 38px; }
.nav-toggle { display: none; margin-left: auto; width: 44px; height: 44px; background: transparent; border: 1px solid rgba(139, 233, 123, .4); border-radius: var(--radius-s); color: #fff; cursor: pointer; }
.nav-toggle svg { width: 22px; height: 22px; }

.brand__name { display: none; }
.nav__link { white-space: nowrap; }
@media (max-width: 1024px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav {
    position: fixed; inset: var(--header-h) 0 0 0; margin: 0;
    background: var(--forest-deep); overflow-y: auto; padding: 12px var(--gutter) 40px;
    transform: translateX(100%); transition: transform .25s; visibility: hidden;
  }
  .nav.is-open { transform: none; visibility: visible; }
  .nav__list { flex-direction: column; align-items: stretch; }
  .nav__link { height: auto; padding: 14px 4px; width: 100%; justify-content: space-between; border-bottom: 1px solid rgba(214, 236, 217, .12); font-size: var(--fs-base); }
  .nav__link::after { display: none; }
  .nav__menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; background: transparent; border: 0; padding: 0 0 8px 12px; display: none; }
  .nav__item.is-open > .nav__menu { display: block; }
  .nav__menu a { color: #cfe6d5; }
  .nav__menu a:hover, .nav__menu a[aria-current="page"] { background: rgba(139, 233, 123, .12); color: #fff; }
  .header-actions { margin-left: 0; }
  .header-actions .btn--ghost-light { display: none; }
  body.nav-open { overflow: hidden; }
}

/* ---------- 5. Notice bar (首頁置頂公告) ---------- */
.notice-bar { background: var(--leaf); color: var(--forest); font-size: var(--fs-sm); }
.notice-bar .container { display: flex; align-items: center; gap: 12px; padding-block: 10px; }
.notice-bar strong { font-weight: 700; white-space: nowrap; }
.notice-bar a { color: var(--forest); font-weight: 700; }
.notice-bar--warn { background: #ffe39a; }
.notice-bar__close { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--forest); font-size: 1.3rem; line-height: 1; width: 32px; height: 32px; }

/* ---------- 6. Home hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #eafff0;
  background:
    radial-gradient(900px 520px at 85% 10%, rgba(122, 254, 205, .12), transparent 60%),
    radial-gradient(700px 480px at 10% 100%, rgba(139, 233, 123, .10), transparent 60%),
    linear-gradient(180deg, var(--forest) 0%, var(--forest-deep) 100%);
}
.hero::before { /* 細網格：病歷編碼表的格線意象 */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(139, 233, 123, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 233, 123, .07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.hero__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 56px; align-items: center; padding-block: 72px 56px; }
.hero__org { font-size: var(--fs-sm); letter-spacing: .3em; color: var(--mint); margin-bottom: 14px; }
.hero__title { font-size: var(--fs-4xl); line-height: 1.2; letter-spacing: .06em; margin-bottom: 18px; color: #fff; }
.hero__motto { display: flex; gap: 22px; margin-bottom: 22px; font-family: var(--font-serif); font-size: var(--fs-lg); color: var(--leaf); letter-spacing: .3em; }
.hero__lead { max-width: 34em; color: #cfe6d5; font-size: var(--fs-base); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero__visual { position: relative; }
.hero__visual img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-m); border: 1px solid rgba(139, 233, 123, .35); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); }
.hero__visual::before { content: ""; position: absolute; inset: -14px 14px 14px -14px; border: 1px solid rgba(122, 254, 205, .35); border-radius: var(--radius-m); pointer-events: none; }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; padding-block: 48px 40px; gap: 36px; }
  .hero__visual { max-width: 420px; }
}
@media (max-width: 520px) { .hero__motto { gap: 12px; letter-spacing: .15em; } }

/* ---------- 7. Page hero (內頁) ---------- */
.page-hero { position: relative; color: #fff; background: var(--forest) center / cover no-repeat; isolation: isolate; }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgba(1, 40, 26, .96) 0%, rgba(1, 63, 38, .86) 45%, rgba(1, 63, 38, .55) 100%); }
.page-hero .container { padding-block: 56px 44px; }
.page-hero h1 { color: #fff; margin: 0; letter-spacing: .08em; }
.page-hero p { margin: 10px 0 0; color: #cfe6d5; max-width: 40em; }
.breadcrumb { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 14px; font-size: var(--fs-xs); color: rgba(214, 236, 217, .8); }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; opacity: .6; }
.breadcrumb a { color: var(--leaf); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; color: #fff; }

/* ---------- 8. Section layout (側欄＋內文) ---------- */
.page-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; padding-block: 48px 88px; align-items: start; }
.page-body--wide { grid-template-columns: minmax(0, 1fr); }
.subnav { position: sticky; top: calc(var(--header-h) + 24px); }
.subnav__title { font-family: var(--font-serif); font-size: var(--fs-lg); margin: 0 0 12px; padding-bottom: 12px; border-bottom: 2px solid var(--forest); }
.subnav ul { list-style: none; margin: 0; padding: 0; }
.subnav a { display: block; padding: 10px 12px 10px 14px; color: var(--muted); text-decoration: none; border-left: 2px solid var(--line); font-size: var(--fs-sm); }
.subnav a:hover { color: var(--forest); border-left-color: var(--pine); background: rgba(214, 236, 217, .5); }
.subnav a[aria-current="page"] { color: var(--forest); font-weight: 700; border-left: 4px solid var(--leaf); padding-left: 12px; background: var(--sage); }
@media (max-width: 900px) {
  .page-body { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-block: 28px 64px; }
  .subnav { position: static; }
  .subnav__title { display: none; }
  .subnav ul { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .subnav a { white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; background: #fff; }
  .subnav a[aria-current="page"] { border: 1px solid var(--forest); background: var(--forest); color: #fff; padding-left: 14px; }
}

/* ---------- 9. Prose (內文) ---------- */
.prose { max-width: 46em; }
.prose--full { max-width: none; }
.prose h2 { font-size: var(--fs-xl); margin-top: 2em; padding-left: 14px; border-left: 4px solid var(--leaf); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: var(--fs-lg); margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.prose img { border-radius: var(--radius-m); border: 1px solid var(--line); margin: 1.2em 0; }
.prose .lead { font-size: var(--fs-lg); font-family: var(--font-serif); line-height: 1.7; color: var(--forest); }
.prose blockquote { margin: 1.5em 0; padding: 16px 20px; background: var(--sage); border-left: 4px solid var(--forest); border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.signature { font-family: var(--font-serif); font-size: var(--fs-lg); text-align: right; margin-top: 2em; color: var(--forest); }

/* 條文（章程、辦法）：左欄條號、右欄內文 */
.articles { margin: 0; }
.articles__chapter { font-family: var(--font-serif); font-size: var(--fs-lg); color: var(--forest); background: var(--sage); padding: 10px 16px; margin: 32px 0 0; border-radius: var(--radius-s); }
.articles__chapter:first-child { margin-top: 0; }
.article { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 20px; padding: 16px 4px; border-bottom: 1px solid var(--line); }
.article dt { font-family: var(--font-serif); font-weight: 700; color: var(--pine); white-space: nowrap; }
.article dd { margin: 0; }
.article dd ol { list-style: none; padding-left: 0; margin: .4em 0 0; }
.article dd ol li { padding-left: 2.2em; text-indent: -2.2em; }
@media (max-width: 640px) { .article { grid-template-columns: 1fr; gap: 4px; } }

/* 資訊卡：繳費帳號等重點資訊 */
.info-block { border: 1px solid var(--line); border-left: 4px solid var(--forest); background: #fff; padding: 18px 22px; border-radius: var(--radius-s); margin: 1.2em 0; }
.info-block h3, .info-block h4 { font-size: var(--fs-base); margin: 0 0 .6em; font-family: var(--font-sans); }
.info-block dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; margin: 0; }
.info-block dt { color: var(--muted); }
.info-block dd { margin: 0; font-weight: 500; }
.info-block--leaf { border-left-color: var(--leaf); background: #f7fcf6; }

/* 步驟流程（入會流程等真正的順序） */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 1.5em 0; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 28px 64px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 42px; height: 42px; display: grid; place-items: center;
  font-family: var(--font-code); font-size: var(--fs-sm); color: var(--forest);
  background: var(--sage); border: 1px solid var(--forest); border-radius: 50%;
}
.steps > li::after { content: ""; position: absolute; left: 21px; top: 46px; bottom: 4px; width: 1px; background: var(--line); }
.steps > li:last-child::after { display: none; }
.steps .step-media { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; align-items: start; }
.steps .step-media img { margin: 0; border-radius: var(--radius-m); border: 1px solid var(--line); cursor: zoom-in; }
@media (max-width: 640px) { .steps .step-media { grid-template-columns: 1fr; } .steps .step-media img { max-width: 240px; } }

/* ---------- 10. Tables ---------- */
.table-wrap { overflow-x: auto; margin: 1em 0 1.5em; border: 1px solid var(--line); border-radius: var(--radius-m); background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table thead th { background: var(--forest); color: #fff; font-weight: 500; letter-spacing: .04em; white-space: nowrap; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody tr:hover > td { background: #f7fbf6; }
.table th[scope="row"] { background: var(--sage); color: var(--forest); font-weight: 700; white-space: nowrap; }
.table .nowrap { white-space: nowrap; }
.table .num { font-family: var(--font-code); white-space: nowrap; }

/* 狀態標記 */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; font-size: var(--fs-xs); border-radius: 999px; background: var(--sage); color: var(--forest); white-space: nowrap; font-weight: 500; }
.tag--open { background: var(--leaf); color: var(--forest); }
.tag--soon { background: #e3f4ff; color: #0a4a73; }
.tag--closed { background: #eceeed; color: #5b6660; }
.tag--pending { background: #fff1c7; color: var(--warn); }
.tag--danger { background: #fbe3e1; color: var(--danger); }
.tag--dark { background: var(--forest); color: #fff; }

/* 下載連結 */
.download { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; color: var(--forest); text-decoration: none; font-weight: 500; }
.download svg { width: 20px; height: 20px; color: var(--pine); }
.download:hover { border-color: var(--forest); background: var(--sage); text-decoration: none; }
.download small { color: var(--muted); font-weight: 400; }

/* ---------- 11. Home sections ---------- */
.section { padding-block: 80px; }
.section--white { background: #fff; }
.section--forest { background: var(--forest); color: #e6f5ea; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--muted); }
.section--forest .section-head h2 { color: #fff; }
.section--forest .section-head p { color: #cfe6d5; }

.home-split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 48px; }
@media (max-width: 900px) { .home-split { grid-template-columns: 1fr; } }

/* 公告列表：以列而非卡片呈現，像公文收文簿 */
.news-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--forest); }
.news-item { display: grid; grid-template-columns: 7.2em minmax(0, 1fr) auto; gap: 18px; align-items: baseline; padding: 18px 4px; border-bottom: 1px solid var(--line); }
.news-item time { font-family: var(--font-code); font-size: var(--fs-sm); color: var(--muted); }
.news-item__title { margin: 0; font-family: var(--font-sans); font-size: var(--fs-base); font-weight: 500; line-height: 1.6; }
.news-item__title a, .news-item__title button { color: var(--ink); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; text-align: left; cursor: pointer; }
.news-item__title a:hover, .news-item__title button:hover { color: var(--pine); text-decoration: underline; }
.news-item .tag { align-self: center; }
@media (max-width: 640px) { .news-item { grid-template-columns: 1fr auto; gap: 4px 12px; } .news-item time { grid-column: 1 / -1; } }

/* 近期行程 */
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.agenda__date { text-align: center; border: 1px solid var(--forest); border-radius: var(--radius-s); overflow: hidden; align-self: start; }
.agenda__date span { display: block; background: var(--forest); color: #fff; font-size: var(--fs-xs); padding: 2px 0; }
.agenda__date strong { display: block; font-family: var(--font-code); font-size: 1.4rem; color: var(--forest); padding: 4px 0; }
.agenda h3 { font-family: var(--font-sans); font-size: var(--fs-base); font-weight: 500; margin: 0 0 4px; }
.agenda p { margin: 0; font-size: var(--fs-sm); color: var(--muted); }

/* 服務入口：真正的導覽，所以用等寬磚格 */
.service-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: rgba(139, 233, 123, .22); border: 1px solid rgba(139, 233, 123, .22); border-radius: var(--radius-m); overflow: hidden; }
.service { display: grid; gap: 10px; align-content: start; padding: 26px 24px 28px; background: var(--forest); color: #e6f5ea; text-decoration: none; position: relative; min-height: 172px; }
.service:hover { background: var(--pine); color: #fff; text-decoration: none; }
.service svg { width: 30px; height: 30px; color: var(--leaf); }
.service h3 { font-family: var(--font-sans); font-size: var(--fs-base); font-weight: 700; margin: 0; color: #fff; }
.service p { margin: 0; font-size: var(--fs-sm); color: #bcd8c4; line-height: 1.6; }
.service .tag { position: absolute; top: 18px; right: 18px; background: rgba(122, 254, 205, .14); color: var(--mint); }
@media (max-width: 900px) { .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .service-grid { grid-template-columns: 1fr; } .service { min-height: 0; } }

.line-cta { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 48px; align-items: center; }
.line-cta__qr { background: #fff; padding: 18px; border-radius: var(--radius-m); border: 1px solid var(--line); }
@media (max-width: 760px) { .line-cta { grid-template-columns: 1fr; } .line-cta__qr { max-width: 240px; } }

.mission { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.mission li { list-style: none; padding: 20px 20px 20px 0; border-bottom: 1px solid var(--line); }
.mission strong { display: block; font-family: var(--font-serif); font-size: var(--fs-lg); color: var(--forest); margin-bottom: 4px; }
.mission span { color: var(--muted); font-size: var(--fs-sm); }

/* ---------- 12. Generic content blocks ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 28px; }
.panel + .panel { margin-top: 24px; }
.split > .panel + .panel { margin-top: 0; }
.panel--soft { background: var(--sage); border-color: transparent; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.toolbar .input { max-width: 280px; min-height: 40px; }
.segmented { display: inline-flex; border: 1px solid var(--forest); border-radius: var(--radius-s); overflow: hidden; }
.segmented button { min-height: 38px; padding: 0 16px; border: 0; background: #fff; color: var(--forest); cursor: pointer; font: inherit; font-size: var(--fs-sm); }
.segmented button + button { border-left: 1px solid var(--forest); }
.segmented button[aria-pressed="true"] { background: var(--forest); color: #fff; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed #b9ccbf; border-radius: var(--radius-m); background: #fff; }
.placeholder-note { display: flex; gap: 14px; align-items: flex-start; padding: 16px 20px; border-radius: var(--radius-m); background: #eef6ff; border: 1px solid #bcd8f0; color: #0a3d61; font-size: var(--fs-sm); margin-bottom: 24px; }
.placeholder-note svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; }
.placeholder-note p:last-child { margin: 0; }

/* 課程列表 */
.course-list { display: grid; gap: 16px; }
.course { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 22px 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); }
.course__date { font-family: var(--font-code); color: var(--forest); line-height: 1.3; }
.course__date strong { display: block; font-size: 1.35rem; }
.course__date span { font-size: var(--fs-xs); color: var(--muted); }
.course h3 { font-family: var(--font-sans); font-size: var(--fs-lg); font-weight: 700; margin: 0 0 6px; }
.course__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--fs-sm); color: var(--muted); margin: 0; }
.course__meta b { color: var(--ink); font-weight: 500; }
.course__desc { font-size: var(--fs-sm); margin: 8px 0 0; }
.course__actions { display: grid; gap: 8px; justify-items: end; }
@media (max-width: 760px) { .course { grid-template-columns: 1fr; gap: 12px; } .course__actions { justify-items: start; grid-auto-flow: column; } }

/* 商品（專書／課程） */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.product { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.product__img { aspect-ratio: 4 / 3; background: var(--forest); display: grid; place-items: center; color: var(--leaf); overflow: hidden; }
.product__img img { width: 100%; height: 100%; object-fit: cover; }
.product__img svg { width: 56px; height: 56px; }
.product__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product__body h3 { font-family: var(--font-sans); font-size: var(--fs-base); font-weight: 700; margin: 0; }
.product__body p { font-size: var(--fs-sm); color: var(--muted); margin: 0; }

/* 聯絡資訊 */
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; margin-bottom: 40px; }
.contact-grid > div { background: #fff; padding: 24px; }
.contact-grid svg { width: 26px; height: 26px; color: var(--pine); margin-bottom: 10px; }
.contact-grid h2 { font-family: var(--font-sans); font-size: var(--fs-sm); font-weight: 500; color: var(--muted); margin: 0 0 4px; border: 0; padding: 0; }
.contact-grid p { margin: 0; font-size: var(--fs-lg); font-weight: 500; word-break: break-all; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

/* 影音播放器（示意） */
.player { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; }
.player__screen { aspect-ratio: 16 / 9; background: var(--forest-deep); border-radius: var(--radius-m); display: grid; place-items: center; color: #cfe6d5; text-align: center; padding: 24px; position: relative; overflow: hidden; }
.player__screen::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(139, 233, 123, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(139, 233, 123, .06) 1px, transparent 1px); background-size: 32px 32px; }
.player__screen > * { position: relative; }
.player__screen svg { width: 56px; height: 56px; color: var(--leaf); margin: 0 auto 12px; }
.chapters { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.chapters h3 { font-family: var(--font-sans); font-size: var(--fs-sm); margin: 0; padding: 14px 18px; background: var(--forest); color: #fff; }
.chapters ol { list-style: none; margin: 0; padding: 0; }
.chapters li { display: flex; justify-content: space-between; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.chapters li span:last-child { color: var(--muted); font-family: var(--font-code); font-size: var(--fs-xs); }
.progress { height: 6px; background: var(--sage); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--pine); }
@media (max-width: 900px) { .player { grid-template-columns: 1fr; } }
/* 第十版：影片佔滿播放區（不留邊框）、全螢幕按鈕、較窄螢幕把單元清單移到影片下方 */
.player__main { min-width: 0; }
.player__screen.has-video { padding: 0; display: block; background: #000; border-radius: 0; overflow: visible; } /* 2026/10/10：不裁切 Vimeo 右下角的全螢幕鍵 */
.player__screen.has-video::before { display: none; }
.player__screen.has-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.player__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
.player__bar[hidden] { display: none; }
.player__bar .hint { margin: 0; font-size: var(--fs-xs); }
/* 2026/10/10：放大播放＝影片填滿瀏覽器視窗（不進入系統全螢幕，Vimeo 控制列都看得到） */
.player__screen.is-zoom { position: fixed; z-index: 9998; inset: 56px 12px 12px; width: auto; height: auto; aspect-ratio: auto; }
.player-zoom-bg { position: fixed; inset: 0; z-index: 9997; background: rgba(0, 0, 0, .82); }
.player-zoom-close { position: fixed; z-index: 9999; top: 12px; right: 16px; }
body.no-scroll { overflow: hidden; }
#learn-app .player { grid-template-columns: 1fr; } /* 影片放在整個內容寬度，單元清單移到下方 */
@media (max-width: 640px) { .player__bar .hint { display: none; } }

/* 會員中心 / 帳號頁 */
.auth-wrap { max-width: 460px; margin: 56px auto 88px; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 36px 32px; box-shadow: var(--shadow-float); }
.auth-card h1 { font-size: var(--fs-2xl); }
.auth-card .brand-mark { width: 88px; margin-bottom: 18px; border-radius: var(--radius-s); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs button { padding: 10px 16px; border: 0; background: none; cursor: pointer; font: inherit; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--forest); border-bottom-color: var(--leaf); font-weight: 700; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.dash-tile { display: grid; gap: 6px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); color: var(--ink); text-decoration: none; }
.dash-tile svg { width: 26px; height: 26px; color: var(--pine); }
.dash-tile strong { font-size: var(--fs-base); }
.dash-tile span { font-size: var(--fs-sm); color: var(--muted); }
.dash-tile:hover { border-color: var(--forest); text-decoration: none; }

/* ---------- 13. Modal / toast / lightbox ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(1, 30, 19, .6); backdrop-filter: blur(2px); }
.modal[hidden] { display: none; }
.modal__box { width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: var(--radius-m); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .5); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 26px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.modal__head h2 { font-size: var(--fs-xl); margin: 0; }
.modal__head time { display: block; font-family: var(--font-code); font-size: var(--fs-xs); color: var(--muted); margin-bottom: 4px; }
.modal__close { width: 40px; height: 40px; flex-shrink: 0; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; cursor: pointer; font-size: 1.4rem; line-height: 1; color: var(--ink); }
.modal__body { padding: 22px 26px 28px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 26px; border-top: 1px solid var(--line); background: var(--paper); position: sticky; bottom: 0; }
.lightbox .modal__box { width: auto; max-width: min(1000px, 100%); background: transparent; box-shadow: none; }
.lightbox img { max-height: calc(100vh - 80px); width: auto; margin: 0 auto; border-radius: var(--radius-m); }
.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: grid; gap: 10px; }
.toast { min-width: 240px; max-width: 360px; padding: 12px 16px; border-radius: var(--radius-s); background: var(--forest); color: #fff; font-size: var(--fs-sm); box-shadow: var(--shadow-float); border-left: 4px solid var(--leaf); }
.toast--error { background: #5b1410; border-left-color: #ff8a80; }

/* ---------- 14. Footer ---------- */
.site-footer { background: var(--forest-deep); color: #bcd8c4; font-size: var(--fs-sm); }
.site-footer a { color: #dcefe1; text-decoration: none; }
.site-footer a:hover { color: var(--leaf); text-decoration: underline; }
.footer-top { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 32px; padding-block: 56px 40px; }
.footer-brand img { width: 140px; border-radius: var(--radius-s); margin-bottom: 16px; }
.footer-brand address { font-style: normal; line-height: 1.9; }
.site-footer h2 { font-family: var(--font-sans); font-size: var(--fs-sm); font-weight: 700; color: #fff; margin: 0 0 14px; letter-spacing: .08em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-bottom { border-top: 1px solid rgba(139, 233, 123, .15); }
.footer-bottom .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 18px; font-size: var(--fs-xs); }
@media (max-width: 900px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-top { grid-template-columns: 1fr; gap: 28px; } }

.fab-help { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; background: var(--leaf); color: var(--forest); font-weight: 700; font-size: var(--fs-sm); text-decoration: none; box-shadow: var(--shadow-float); }
.fab-help svg { width: 20px; height: 20px; }
.fab-help:hover { background: #a6f297; color: var(--forest); text-decoration: none; }
body.is-admin .fab-help { bottom: 76px; }

/* ---------- 15. Admin bar & inline editing (前台) ---------- */
.admin-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 150; background: #111e17; color: #dcefe1; font-size: var(--fs-sm); border-top: 2px solid var(--leaf); }
.admin-bar .container { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-block: 10px; }
.admin-bar__who { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; }
.admin-bar__who::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--leaf); box-shadow: 0 0 0 4px rgba(139, 233, 123, .2); }
body.is-admin { padding-bottom: 60px; }
body.is-editing [data-edit] { outline: 2px dashed var(--leaf); outline-offset: 6px; border-radius: 2px; min-height: 2em; position: relative; }
body.is-editing [data-edit]:focus { outline-style: solid; outline-color: var(--pine); background: rgba(214, 236, 217, .25); }
body.is-editing [data-edit]::before { content: "可編輯：" attr(data-edit-label); position: absolute; top: -28px; left: -6px; font: 500 11px/1 var(--font-sans); background: var(--leaf); color: var(--forest); padding: 4px 6px; border-radius: 3px; pointer-events: none; white-space: nowrap; }
.page-hero [data-edit] { color: inherit; }

/* ---------- 16. Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .subnav, .fab-help, .admin-bar, .notice-bar { display: none !important; }
  .page-hero { background: none !important; color: var(--ink); }
  .page-hero::before { display: none; }
  .page-hero h1 { color: var(--ink); }
  .page-body { display: block; }
}

/* ---------- 17. Video facade ---------- */
.video-facade { position: relative; display: grid; place-items: center; align-content: center; gap: 6px; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: var(--radius-m); cursor: pointer; font: inherit; color: #e6f5ea; background: radial-gradient(600px 300px at 70% 20%, rgba(122, 254, 205, .18), transparent 60%), linear-gradient(160deg, var(--forest), var(--forest-deep)); margin: 1em 0; }
.video-facade__play { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--leaf); color: var(--forest); transition: transform .15s; }
.video-facade__play svg { width: 30px; height: 30px; margin-left: 4px; }
.video-facade:hover .video-facade__play { transform: scale(1.06); }
.video-facade small { color: rgba(214, 236, 217, .7); }

/* ---------- 18. Admin ---------- */
.admin-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }
.admin-side { background: #123528; padding: 20px 12px 40px; border-right: 1px solid rgba(139, 233, 123, .12); }
/* 2026/10/10：左側選單與頁尾用不同底色，頁尾上方加一條分隔線 */
body[data-section="admin"] .site-footer { border-top: 4px solid var(--leaf); }
/* 2026/10/09 學會意見：左側選單與右側內容各自捲動 */
@media (min-width: 901px) {
  .admin-side { position: sticky; top: var(--header-h); align-self: start; height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(214,236,217,.35) transparent; }
}
.admin-side__label { font-size: var(--fs-xs); color: rgba(214, 236, 217, .55); margin: 18px 12px 6px; }
.admin-side__label:first-child { margin-top: 0; }
.admin-side a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: #cfe6d5; text-decoration: none; border-radius: var(--radius-s); font-size: var(--fs-sm); }
.admin-side a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.admin-side a:hover { background: rgba(139, 233, 123, .08); color: #fff; }
.admin-side a[aria-current="page"] { background: rgba(139, 233, 123, .14); color: #fff; box-shadow: inset 3px 0 0 var(--leaf); }
.admin-side .badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--leaf); color: var(--forest); font-size: 11px; font-weight: 700; text-align: center; line-height: 20px; }
/* 2026/10/10（第十二版）：選單分組收合＋搜尋 */
.admin-side__search { position: relative; margin: 0 0 12px; }
.admin-side__search svg { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: rgba(214, 236, 217, .6); pointer-events: none; }
.admin-side__search input { width: 100%; padding: 8px 10px 8px 32px; border: 1px solid rgba(214, 236, 217, .22); border-radius: var(--radius-s); background: rgba(255, 255, 255, .06); color: #fff; font: inherit; font-size: var(--fs-sm); }
.admin-side__search input::placeholder { color: rgba(214, 236, 217, .5); }
.admin-side__search input:focus { outline: none; border-color: var(--leaf); background: rgba(255, 255, 255, .1); }
.side-group { margin-top: 4px; }
.side-group__head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; border: 0; border-radius: var(--radius-s); background: transparent; color: rgba(214, 236, 217, .75); font: inherit; font-size: var(--fs-xs); letter-spacing: .04em; cursor: pointer; text-align: left; }
.side-group__head:hover { background: rgba(139, 233, 123, .06); color: #fff; }
.side-group__head > span:first-child { flex: 1; }
.side-group__head .badge { margin-left: 0; }
.side-group__head svg { width: 16px; height: 16px; transition: transform .15s; }
.side-group.is-open .side-group__head svg { transform: rotate(180deg); }
.side-group__body { display: none; padding-left: 6px; }
.side-group.is-open .side-group__body, .admin-side.is-searching .side-group__body { display: block; }
.side-empty { margin: 8px 12px; color: rgba(214, 236, 217, .6); font-size: var(--fs-sm); }
.admin-side [hidden] { display: none !important; }
.admin-main { padding: 32px clamp(16px, 3vw, 40px) 88px; min-width: 0; }
.admin-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.admin-head h1 { font-size: var(--fs-2xl); margin: 0; }
.admin-head p { margin: 4px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 20px; text-decoration: none; color: var(--ink); }
.stat:hover { border-color: var(--forest); text-decoration: none; }
.stat span { font-size: var(--fs-sm); color: var(--muted); }
.stat strong { display: block; font-family: var(--font-code); font-size: 2rem; color: var(--forest); line-height: 1.2; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.rte { min-height: 220px; max-height: 420px; overflow: auto; padding: 12px 14px; border: 1px solid #b9ccbf; border-radius: 0 0 var(--radius-s) var(--radius-s); background: #fff; font-size: var(--fs-sm); line-height: 1.7; }
.rte:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px rgba(11, 90, 55, .18); }
.rte h3 { font-size: var(--fs-base); }
.builder { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 24px; align-items: start; }
.builder-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 10px; padding: 14px; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--leaf); border-radius: var(--radius-s); margin-bottom: 10px; }
.builder-row .field { margin: 0; }
.builder-row .span-all { grid-column: 1 / -1; }
.builder-row .row-actions { align-self: end; }
.builder-preview { position: sticky; top: calc(var(--header-h) + 20px); max-height: calc(100vh - var(--header-h) - 40px); overflow: auto; }
.kv { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: var(--fs-sm); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
@media (max-width: 1100px) { .builder { grid-template-columns: 1fr; } .builder-preview { position: static; max-height: none; } }
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { display: flex; gap: 4px; overflow-x: auto; padding: 8px; position: sticky; top: var(--header-h); z-index: 20; }
  .admin-side__label { display: none; }
  .admin-side a { white-space: nowrap; }
  .admin-side__search, .side-group__head, .side-empty { display: none; }
  .admin-side__me { white-space: nowrap; margin: 0; flex-shrink: 0; }
  .side-group, .side-group__body, .side-group.is-open .side-group__body { display: contents; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) { .hero__title { font-size: clamp(1.7rem, 8.2vw, 2.4rem); letter-spacing: .02em; } }

/* ---------- 19. 帳號選單（頭像＋名稱） ---------- */
.account { position: relative; }
.account__btn { display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 5px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(139, 233, 123, .35); border-radius: 999px; color: #fff; cursor: pointer; font: inherit; }
.account__btn:hover, .account.is-open .account__btn { background: rgba(139, 233, 123, .14); border-color: var(--leaf); }
.account__btn > svg { width: 12px; height: 12px; opacity: .75; }
.account__avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--leaf); color: var(--forest); font-family: var(--font-serif); font-weight: 700; font-size: 1rem; flex-shrink: 0; }
.account__avatar--admin { background: var(--mint); }
.account__name { display: grid; text-align: left; font-size: var(--fs-sm); line-height: 1.25; white-space: nowrap; }
.account__name small { font-size: 11px; color: rgba(214, 236, 217, .72); }
.account__dd { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: 8px; background: #fff; border-radius: var(--radius-m); box-shadow: var(--shadow-float); border-top: 3px solid var(--leaf); opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .15s, transform .15s, visibility .15s; z-index: 60; }
.account__dd::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; } /* 滑鼠移動時的緩衝區 */
.account.is-open .account__dd { opacity: 1; visibility: visible; transform: none; }
.account__dd a, .account__dd button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; border-radius: var(--radius-s); color: var(--ink); font: inherit; font-size: var(--fs-sm); text-decoration: none; cursor: pointer; text-align: left; }
.account__dd a:hover, .account__dd button:hover { background: var(--sage); color: var(--forest); }
.account__dd svg { width: 18px; height: 18px; color: var(--pine); }
.account__dd hr { margin: 6px 0; }
.account__note { margin: 4px 12px 6px; font-size: var(--fs-xs); color: var(--muted); }
@media (max-width: 1024px) {
  .account__name, .account__btn > svg { display: none; }
  .account__btn { padding: 3px; }
}

/* ---------- 20. 表單分段、入會資格 ---------- */
.form-section { font-family: var(--font-sans); font-size: var(--fs-base); font-weight: 700; color: var(--forest); margin: 28px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.quals { display: grid; gap: 12px; }
.qual { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; }
.qual__more { padding: 8px 0 0 26px; }
.qual__certs { display: grid; gap: 2px; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--sage); font-size: var(--fs-xs); }
.chip button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; cursor: pointer; line-height: 1; }
.privacy-warn { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius-s); background: #fbe3e1; color: #7a1c16; font-size: var(--fs-sm); }
.privacy-warn svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; }

/* ---------- 21. 會員中心 ---------- */
.dash { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
.dash__side { position: sticky; top: calc(var(--header-h) + 20px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px; }
.dash__me { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.dash__me strong { display: block; font-size: var(--fs-sm); }
.dash__me small { color: var(--muted); font-size: var(--fs-xs); }
.dash__side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-s); color: var(--ink); text-decoration: none; font-size: var(--fs-sm); }
.dash__side nav a svg { width: 18px; height: 18px; color: var(--pine); }
.dash__side nav a:hover { background: var(--sage); }
.dash__side nav a[aria-current="page"] { background: var(--forest); color: #fff; }
.dash__side nav a[aria-current="page"] svg { color: var(--leaf); }
.dash__main { min-width: 0; }
.cert-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 24px; border-radius: var(--radius-m); color: #eafff0; background: linear-gradient(135deg, var(--forest), var(--pine)); margin-bottom: 14px; }
.cert-card__label { margin: 0; color: var(--leaf); font-size: var(--fs-sm); }
.cert-card__no { margin: 4px 0 8px; font-family: var(--font-serif); font-size: var(--fs-xl); color: #fff; }
.note-list { display: grid; gap: 12px; }
.note-card { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--leaf); border-radius: var(--radius-s); padding: 14px 18px; }
.note-card header { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 6px; }
.note-card header time { margin-left: auto; font-size: var(--fs-xs); color: var(--muted); font-family: var(--font-code); }
.note-card p { margin: 0 0 10px; font-size: var(--fs-sm); }
@media (max-width: 900px) { .dash { grid-template-columns: minmax(0, 1fr); } .dash__side { position: static; min-width: 0; } .dash__main { min-width: 0; } .dash__side nav { display: flex; overflow-x: auto; gap: 4px; } .dash__side nav a { white-space: nowrap; } }

/* ---------- 22. 疾病分類 QA ---------- */
.qa-id { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.qa-id strong { display: block; } .qa-id small { color: var(--muted); font-size: var(--fs-xs); }
.qa-id__roles { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.qa-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 2px solid var(--forest); margin-bottom: 24px; }
.qa-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--radius-s) var(--radius-s) 0 0; color: var(--muted); text-decoration: none; white-space: nowrap; font-size: var(--fs-sm); }
.qa-tabs a svg { width: 18px; height: 18px; }
.qa-tabs a:hover { background: var(--sage); color: var(--forest); }
.qa-tabs a[aria-current="page"] { background: var(--forest); color: #fff; }
.qa-tabs a[aria-current="page"] svg { color: var(--leaf); }
.qa-tabs a.is-locked { opacity: .55; }
.qa-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.qa-head h2 { font-size: var(--fs-xl); margin: 0; }
.qa-head small { color: var(--muted); }
.qnav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.qnav button { padding: 6px 12px; border: 1px solid var(--line); background: #fff; border-radius: 999px; cursor: pointer; font: inherit; font-size: var(--fs-sm); }
.qnav button[aria-current="true"] { background: var(--forest); color: #fff; border-color: var(--forest); }
.qnav .ok { color: var(--ok); font-weight: 700; } .qnav .warn { color: #c77700; font-weight: 700; }
.qnav button[aria-current="true"] .ok, .qnav button[aria-current="true"] .warn { color: var(--leaf); }
.ticket__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ticket__head small { color: var(--muted); }
.ticket h3 { font-family: var(--font-sans); font-size: var(--fs-lg); margin: 4px 0 12px; }
.ticket__desc { margin: 14px 0; padding: 14px 16px; background: var(--paper); border-radius: var(--radius-s); white-space: pre-wrap; font-size: var(--fs-sm); }
.ticket-list { display: grid; gap: 12px; }
.ticket-list .panel { padding: 0; }
.ticket__toggle { display: grid; grid-template-columns: 11em minmax(0, 1fr) auto auto; gap: 14px; align-items: center; width: 100%; padding: 16px 20px; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.ticket__toggle:hover { background: #f7fbf6; }
.ticket__body { padding: 0 20px 20px; }
.replies { display: grid; gap: 10px; }
.reply { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; }
.reply header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: var(--fs-sm); }
.reply header time { margin-left: auto; color: var(--muted); font-size: var(--fs-xs); }
.reply p { margin: 8px 0 0; white-space: pre-wrap; font-size: var(--fs-sm); }
.reply--empty { background: var(--paper); border-style: dashed; }
.lead-box { border-left: 4px solid #c77700; }
.attach { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: var(--fs-sm); }
.attach li { display: flex; align-items: center; gap: 6px; }
.attach svg { width: 16px; height: 16px; color: var(--pine); }
.attach small { color: var(--muted); }
.res-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.kb { display: grid; gap: 14px; }
.kb__item header { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: var(--fs-sm); color: var(--muted); }
.kb__item h3 { font-family: var(--font-sans); font-size: var(--fs-lg); margin: 8px 0; }
.kb__q { white-space: pre-wrap; font-size: var(--fs-sm); }
.publish { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.publish .input { min-height: 40px; }
.journal { display: grid; gap: 10px; }
.jq summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; cursor: pointer; }
.jq__body { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.jq__body h4 { font-family: var(--font-sans); font-size: var(--fs-sm); color: var(--pine); margin: 10px 0 4px; }
.jq__body p { white-space: pre-wrap; }
@media (max-width: 760px) { .ticket__toggle { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- 23. ICD 電子書 ---------- */
.ebook { display: flex; flex-direction: column; height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h)); background: var(--paper); }
.eb-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 10px clamp(12px, 2vw, 24px); background: #fff; border-bottom: 1px solid var(--line); position: relative; z-index: 30; }
.eb-top__title { display: flex; align-items: center; gap: 10px; }
.eb-top__title strong { font-family: var(--font-serif); color: var(--forest); white-space: nowrap; }
.eb-top__title .select { min-height: 34px; width: auto; padding: 4px 8px; font-size: var(--fs-xs); }
.eb-search { position: relative; flex: 1 1 260px; max-width: 360px; }
.eb-book { width: auto; max-width: 100%; min-height: 38px; flex: 0 1 auto; font-size: var(--fs-sm); }
.eb-top .eb-top__title { margin-left: auto; }
.eb-top .eb-top__title strong { font-size: var(--fs-sm); }
.eb-search .input { min-height: 38px; }
.eb-results { position: absolute; right: 0; left: 0; top: calc(100% + 6px); max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow-float); padding: 8px; z-index: 40; min-width: 320px; }
.eb-results h3 { font-family: var(--font-sans); font-size: var(--fs-xs); color: var(--muted); margin: 8px 8px 4px; }
.eb-results ul { list-style: none; margin: 0; padding: 0; }
.eb-results a { display: flex; gap: 10px; padding: 7px 8px; border-radius: var(--radius-s); color: var(--ink); text-decoration: none; font-size: var(--fs-sm); }
.eb-results a:hover, .eb-results a:focus { background: var(--sage); }
.eb-results .num { color: var(--pine); min-width: 5.5em; }
.eb-results small { color: var(--muted); min-width: 5.5em; }
.eb-body { display: grid; grid-template-columns: 260px minmax(0, 1fr) 300px; flex: 1; min-height: 0; }
.eb-nav, .eb-notes { overflow-y: auto; background: #fff; border-right: 1px solid var(--line); padding: 12px; }
.eb-notes { border-right: 0; border-left: 1px solid var(--line); }
.eb-nav__tabs { display: flex; gap: 2px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.eb-nav__tabs button { flex: 1; padding: 8px 4px; border: 0; background: none; cursor: pointer; font: inherit; font-size: var(--fs-xs); color: var(--muted); border-bottom: 2px solid transparent; }
.eb-nav__tabs button[aria-selected="true"] { color: var(--forest); border-bottom-color: var(--leaf); font-weight: 700; }
.eb-letters { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.eb-letters a { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--line); border-radius: var(--radius-s); text-decoration: none; color: var(--forest); font-family: var(--font-code); }
.eb-letters a:hover { border-color: var(--forest); }
.eb-letters a[aria-current] { background: var(--forest); color: #fff; border-color: var(--forest); }
.eb-toc, .eb-toc ol { list-style: none; margin: 0; padding: 0; }
.eb-toc ol { padding-left: 12px; margin: 2px 0 6px; border-left: 1px solid var(--line); }
.eb-toc a { display: block; padding: 6px 8px; border-radius: var(--radius-s); color: var(--ink); text-decoration: none; font-size: var(--fs-xs); line-height: 1.45; }
.eb-toc a:hover { background: var(--sage); }
.eb-toc a[aria-current] { background: var(--sage); color: var(--forest); font-weight: 700; }
.eb-toc .num { display: inline-block; min-width: 3.2em; color: var(--pine); font-family: var(--font-code); margin-right: 4px; }
.eb-toc small { display: block; color: var(--muted); font-family: var(--font-code); }
.eb-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.eb-list li { display: flex; align-items: flex-start; gap: 4px; }
.eb-list a { flex: 1; display: block; padding: 7px 8px; border-radius: var(--radius-s); color: var(--ink); text-decoration: none; font-size: var(--fs-xs); background: var(--paper); }
.eb-list a small { display: block; color: var(--muted); }
.eb-list a:hover { background: var(--sage); }
.eb-list .x { border: 0; background: none; cursor: pointer; font-size: 1.1rem; color: var(--muted); }
.eb-empty { color: var(--muted); font-size: var(--fs-sm); padding: 12px 4px; }
.eb-content { overflow-y: auto; padding: 20px clamp(16px, 3vw, 36px) 80px; }
.eb-page { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.eb-page h1 { font-size: var(--fs-xl); margin: 0; }
.eb-page p { margin: 4px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.eb-pager { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: var(--fs-sm); color: var(--muted); }
.eb-pager a { font-family: var(--font-code); }
.eb-chap { margin-bottom: 12px; font-size: var(--fs-sm); }
.eb-chap summary { cursor: pointer; color: var(--pine); }
.eb-sec { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-bottom: 12px; }
.eb-sec > .tn { flex: 1 1 100%; }
.code-link { font-family: var(--font-code); font-weight: 500; color: var(--pine); text-decoration: none; background: rgba(139, 233, 123, .18); padding: 0 4px; border-radius: 3px; white-space: nowrap; }
.code-link:hover { background: var(--leaf); color: var(--forest); text-decoration: none; }
.nemod { color: var(--muted); }
.see { color: #6b4a00; font-size: .95em; }
.see a { color: #6b4a00; }
.manif { font-style: italic; }
.ix-list, .ix-list ul { list-style: none; margin: 0; padding: 0; }
.ix-list > li { padding: 6px 0; border-bottom: 1px solid var(--line); content-visibility: auto; contain-intrinsic-size: auto 40px; }
.ix-list ul { padding-left: 22px; border-left: 1px dotted #b9ccbf; margin-left: 4px; }
.ix { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 2px 4px; border-radius: 4px; font-size: var(--fs-sm); }
.ix-list > li > .ix .ix__t { font-weight: 700; color: var(--forest); }
.ix:hover { background: #f7fbf6; }
.is-hit > .ix, tr.is-hit, .dx.is-hit > .dx__row { background: #fff3a8 !important; box-shadow: inset 3px 0 0 #e6b800; }
.eb-table th[scope="row"] { font-weight: 400; background: #fff; color: var(--ink); white-space: normal; min-width: 260px; }
.eb-table .main { font-weight: 700; color: var(--forest); }
.eb-table thead th { position: sticky; top: 0; font-size: var(--fs-xs); white-space: normal; }
.eb-table tr { content-visibility: auto; contain-intrinsic-size: auto 42px; }
.nbtn { display: inline-flex; align-items: center; gap: 2px; width: auto; height: 26px; padding: 0 6px; border: 1px solid transparent; border-radius: 4px; background: none; color: #9aa9a0; cursor: pointer; opacity: 0; font-size: 11px; }
.nbtn svg { width: 14px; height: 14px; }
.ix:hover .nbtn, .dx__row:hover .nbtn, tr:hover .nbtn, .nbtn:focus-visible, .nbtn.has, .eb-sec .nbtn, .pcs-head .nbtn, .pdef .nbtn { opacity: 1; }
.nbtn:hover { border-color: var(--line); color: var(--pine); background: #fff; }
.nbtn.has { color: var(--forest); background: var(--leaf); }
.dx { margin-left: calc(var(--lvl) * 22px); }
.dx-list > .dx { border-top: 1px solid var(--line); padding: 8px 0; content-visibility: auto; contain-intrinsic-size: auto 60px; }
.dx__row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 4px 6px; border-radius: 4px; }
.dx__code { font-family: var(--font-code); font-weight: 500; color: var(--forest); min-width: 5.2em; }
.dx-list > .dx > .dx__row .dx__desc { font-weight: 700; }
.dx__desc { flex: 1 1 280px; font-size: var(--fs-sm); }
.bill { font-size: 11px; padding: 1px 6px; border-radius: 999px; background: #e6f6e6; color: var(--ok); white-space: nowrap; }
.bill--7 { background: #fff1c7; color: var(--warn); }
.tn { display: flex; gap: 10px; margin: 4px 0 4px 6px; font-size: var(--fs-xs); }
.tn ul { margin: 0; padding-left: 1.1em; }
.tn__tag { flex-shrink: 0; min-width: 9.5em; font-weight: 700; padding: 1px 8px; border-radius: 3px; height: fit-content; }
.tn--inc .tn__tag { background: #e3f4ff; color: #0a4a73; }
.tn--ex1 .tn__tag { background: #fbe3e1; color: var(--danger); }
.tn--ex2 .tn__tag { background: #ffe8cc; color: #8a4a00; }
.tn--cf .tn__tag, .tn--uac .tn__tag, .tn--ca .tn__tag { background: #ece6ff; color: #4b2a99; }
.tn--nt .tn__tag, .tn--sn .tn__tag, .tn--sd .tn__tag { background: var(--sage); color: var(--forest); }
.tn--it { list-style: none; padding-left: 5.8em; margin: 2px 0; font-size: var(--fs-xs); color: var(--muted); }
.tn--sd dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; }
.tn--sd dt { font-family: var(--font-code); font-weight: 700; }
.tn--sd dd { margin: 0; }
.pcs-group h2 { font-family: var(--font-sans); font-size: var(--fs-base); margin: 20px 0 10px; }
.pcs-ops { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.pcs-ops a { display: flex; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; color: var(--ink); text-decoration: none; font-size: var(--fs-sm); }
.pcs-ops a:hover { border-color: var(--forest); background: var(--sage); }
.pcs-ops .num { color: var(--pine); }
.pcs-head { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 18px; margin-bottom: 12px; }
.pcs-head dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.pcs-head dt { font-size: var(--fs-xs); color: var(--muted); }
.pcs-head dd { margin: 0; font-weight: 700; }
.pcs-def { margin: 10px 0 0; font-size: var(--fs-sm); }
.pcs-builder { position: sticky; top: -20px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; margin-bottom: 12px; background: var(--forest); color: #cfe6d5; border-radius: var(--radius-m); }
.pcs-builder output { font-size: 1.5rem; color: var(--leaf); letter-spacing: .15em; }
.pcs-builder small { flex: 1 1 200px; }
.pcs-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; margin-bottom: 12px; }
.pcs-col { background: #fff; padding: 8px; }
.pcs-col h3 { font-family: var(--font-sans); font-size: var(--fs-xs); color: var(--muted); margin: 0 0 6px; }
.pcs-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pcs-col button { display: flex; gap: 8px; width: 100%; padding: 5px 6px; border: 1px solid transparent; border-radius: 3px; background: none; text-align: left; cursor: pointer; font: inherit; font-size: var(--fs-xs); }
.pcs-col button:hover { background: var(--sage); }
.pcs-col button[aria-pressed="true"] { background: var(--leaf); border-color: var(--forest); font-weight: 700; }
.pcs-col .num { color: var(--pine); min-width: 1.2em; }
.pdef > div { display: grid; grid-template-columns: 14em minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.pdef dt { font-weight: 700; color: var(--forest); } .pdef dd { margin: 0; }
.eb-notes__head h2 { font-size: var(--fs-lg); margin: 0; }
.eb-notes__head small { color: var(--muted); font-size: var(--fs-xs); }
.eb-notes__sub { font-family: var(--font-sans); font-size: var(--fs-sm); margin: 20px 0 8px; }
.eb-anchor { margin: 14px 0 10px; padding: 10px 12px; background: var(--sage); border-radius: var(--radius-s); font-size: var(--fs-sm); }
.eb-anchor small { display: block; color: var(--muted); font-size: 11px; }
.eb-anchor a { color: var(--forest); font-weight: 700; }
.eb-note { padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--leaf); border-radius: var(--radius-s); margin-bottom: 8px; font-size: var(--fs-sm); }
.eb-note p { margin: 0 0 6px; }
.eb-note footer { display: flex; gap: 8px; align-items: center; font-size: var(--fs-xs); color: var(--muted); }
.eb-note footer time { margin-right: auto; }
.eb-note footer button { border: 0; background: none; color: var(--pine); cursor: pointer; font-size: var(--fs-xs); text-decoration: underline; }
#eb-note-form .textarea { min-height: 110px; margin-bottom: 8px; }
@media (max-width: 1200px) { .eb-body { grid-template-columns: 220px minmax(0, 1fr) 260px; } }
@media (max-width: 960px) {
  .ebook { height: auto; }
  .eb-body { grid-template-columns: 1fr; }
  .eb-nav { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--line); }
  .eb-content { overflow: visible; }
  .eb-notes { border-left: 0; border-top: 2px solid var(--leaf); }
  .pcs-row { grid-template-columns: 1fr 1fr; }
  .pcs-head dl { grid-template-columns: 1fr; }
  .nbtn { opacity: 1; }
  .eb-search { max-width: none; }
  .eb-top { position: sticky; top: 0; gap: 8px; }
  .eb-book { flex: 1 1 100%; }
  .eb-top .eb-top__title { margin-left: 0; }
  .eb-results { max-height: 55vh; min-width: 0; }
}

/* ---------- 24. 通知數字、會員中心提醒 ---------- */
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--leaf); color: var(--forest); font-size: 11px; font-weight: 700; text-align: center; line-height: 20px; font-family: var(--font-sans); }
.account__avatar { position: relative; }
.account__dot { position: absolute; top: -6px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e5484d; color: #fff; font: 700 11px/18px var(--font-sans); text-align: center; box-shadow: 0 0 0 2px var(--forest); }
.account__dd a .badge, .dash__side nav a .badge { margin-left: auto; background: #e5484d; color: #fff; }
.dash__side nav a[aria-current="page"] .badge { background: var(--leaf); color: var(--forest); }
.dash-alerts { display: grid; gap: 8px; margin: 0 0 24px; }
.dash-alerts a { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-m); background: #fff6d6; border: 1px solid #efd27a; color: #5a3d00; text-decoration: none; font-size: var(--fs-sm); }
.dash-alerts a:hover { background: #ffefb8; }
.dash-alerts svg { width: 20px; height: 20px; flex-shrink: 0; }
.course__login { display: block; margin-top: 6px; font-size: var(--fs-xs); color: var(--muted); }
tr.is-unread td { font-weight: 700; }
tr.is-hl td { background: #fff8d6; }

/* ---------- 25. 客服訊息對話 ---------- */
.inbox { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.inbox__list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-m); background: #fff; overflow: hidden; }
.inbox__list li + li { border-top: 1px solid var(--line); }
.inbox__list a { position: relative; display: grid; gap: 2px; padding: 12px 40px 12px 14px; color: var(--ink); text-decoration: none; font-size: var(--fs-sm); }
.inbox__list a:hover { background: var(--paper); }
.inbox__list a.is-active { background: var(--sage); box-shadow: inset 3px 0 0 var(--forest); }
.inbox__list a.is-unread strong { color: var(--forest); }
.inbox__list .badge { position: absolute; right: 12px; top: 14px; background: #e5484d; color: #fff; }
.inbox__cat { font-size: var(--fs-xs); color: var(--pine); }
.inbox__list small { color: var(--muted); font-size: var(--fs-xs); }
.inbox__thread { border: 1px solid var(--line); border-radius: var(--radius-m); background: #fff; padding: 18px 20px; }
.inbox__thread > header { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; color: var(--muted); font-size: var(--fs-sm); }
.thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.thread__msg { max-width: 88%; padding: 10px 14px; border-radius: 12px; font-size: var(--fs-sm); }
.thread__msg p { margin: 4px 0 0; white-space: normal; }
.thread__msg--user { justify-self: end; background: var(--paper); border: 1px solid var(--line); border-bottom-right-radius: 4px; }
.thread__msg--admin { justify-self: start; background: #e9f7ec; border: 1px solid #b8e0c1; border-bottom-left-radius: 4px; }
.thread__who { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--forest); font-size: var(--fs-xs); }
.thread__who svg { width: 14px; height: 14px; }
.thread__who time { font-weight: 400; color: var(--muted); }
.thread__reply { display: grid; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.thread__reply .textarea { min-height: 80px; }
.thread__reply .btn { justify-self: end; }
@media (max-width: 800px) { .inbox { grid-template-columns: 1fr; } }

/* ---------- 26. 甄審報名進度、繳費 ---------- */
.stepper { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin: 18px 0; padding: 0; counter-reset: s; }
.stepper__item { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; font-size: var(--fs-xs); color: var(--muted); }
.stepper__item::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.stepper__item:first-child::before { display: none; }
.stepper__dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--line); font-weight: 700; font-family: var(--font-code); color: var(--muted); }
.stepper__dot svg { width: 16px; height: 16px; }
.stepper__item.is-done .stepper__dot { background: var(--forest); border-color: var(--forest); color: var(--leaf); }
.stepper__item.is-done::before, .stepper__item.is-current::before, .stepper__item.is-warn::before { background: var(--forest); }
.stepper__item.is-current .stepper__dot { border-color: var(--forest); color: var(--forest); box-shadow: 0 0 0 4px rgba(139, 233, 123, .35); }
.stepper__item.is-current, .stepper__item.is-done { color: var(--ink); }
.stepper__item.is-warn .stepper__dot { border-color: #d49b00; color: #8a5a00; background: #fff6d6; }
.reg-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px 22px; margin-bottom: 20px; }
.reg-card__head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.reg-card__head h3 { margin: 2px 0 4px; font-size: var(--fs-lg); }
.reg-card__no { margin: 0; font-size: var(--fs-xs); color: var(--muted); }
.reg-card__meta { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.reg-card__hint { font-size: var(--fs-sm); color: var(--muted); background: var(--paper); padding: 10px 14px; border-radius: var(--radius-s); }
.reg-card__alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-s); background: #fff6d6; border: 1px solid #efd27a; color: #5a3d00; font-size: var(--fs-sm); margin: 12px 0; }
.reg-card__alert--bad { background: #fbe3e1; border-color: #f0b4ae; color: var(--danger); }
.reg-card__alert > svg { width: 20px; height: 20px; flex-shrink: 0; }
.reg-card__ticket { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--radius-s); background: linear-gradient(120deg, #e9f7ec, #f3fbf5); border: 1px solid #b8e0c1; margin: 12px 0; }
.reg-card__ticket > svg { width: 28px; height: 28px; color: var(--forest); }
.reg-card__ticket > div { flex: 1; min-width: 200px; }
.reg-card__hist { margin-top: 12px; font-size: var(--fs-sm); }
.reg-card__hist summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--pine); }
.reg-card__hist summary svg { width: 16px; height: 16px; }
.reg-card__hist ul { margin: 8px 0 0; padding-left: 1.2em; color: var(--muted); }
.reg-card__hist time { font-family: var(--font-code); margin-right: 8px; }
/* 2026/10/09：待處理款項收合 */
.pay-fold { border: 1px solid var(--line); border-radius: var(--radius-s); margin: 10px 0; background: #fff; }
.pay-fold > summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.pay-fold > summary::-webkit-details-marker { display: none; }
.pay-fold > summary::before { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: none; }
.pay-fold[open] > summary::before { transform: rotate(45deg); }
.pay-fold__title { flex: 1 1 240px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pay-fold__title svg { width: 1.1em; height: 1.1em; vertical-align: -.2em; margin-right: 4px; }
.pay-fold__title small { color: var(--muted); }
.pay-fold__amt { font-weight: 700; }
.pay-fold__body { padding: 0 16px 14px; }
.pay-fold__body .pay { margin-top: 0; }
.pay-fold--void { background: #f7f8f7; }
.pay-fold--void > summary .pay-fold__title { flex-direction: row; align-items: center; }
.void-list { list-style: none; margin: 0; padding: 0 16px 12px; }
.void-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.pay { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px 16px; margin: 12px 0; background: #fcfdfc; }
.pay--ok { border-color: #b8e0c1; background: #f3fbf5; }
.pay__head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.pay__amount { font-family: var(--font-code); font-size: 1.5rem; margin: 4px 0 8px; color: var(--forest); }
.pay__warn { display: flex; gap: 8px; align-items: flex-start; color: var(--danger); font-size: var(--fs-sm); }
.pay__warn svg { width: 18px; height: 18px; flex-shrink: 0; }
.pay__bank { font-size: var(--fs-sm); }
.pay__form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.pay__form .field { margin: 0; }
@media (max-width: 640px) { .pay__form { grid-template-columns: 1fr; } .stepper__label { font-size: 10px; } }
.upload-preview__grid, .doc-thumbs { display: flex; flex-wrap: wrap; gap: 12px; }
.upload-preview figure, .doc-thumb { margin: 0; width: 160px; }
.upload-preview img, .doc-thumb img { width: 160px; height: 110px; object-fit: contain; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-s); display: block; }
.upload-preview figcaption, .doc-thumb figcaption { font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; }
.upload-preview .is-file, .doc-thumb--file a { display: grid; place-items: center; gap: 4px; width: 160px; height: 110px; border: 1px dashed var(--line); border-radius: var(--radius-s); font-size: var(--fs-xs); text-align: center; padding: 8px; word-break: break-all; }
.doc-thumb a[data-zoom] { display: block; cursor: zoom-in; }
.doc-thumb svg, .upload-preview .is-file svg { width: 28px; height: 28px; color: var(--pine); }
.file-field { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border: 1px dashed #b9ccbf; border-radius: var(--radius-s); background: #fff; }
.file-field__cur { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); flex: 1; min-width: 160px; }
.file-field__cur svg { width: 18px; height: 18px; color: var(--pine); }
.seal-prev { height: 56px; }
a.is-missing { color: var(--muted); text-decoration: line-through; cursor: not-allowed; }
.mail-preview { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px; background: var(--paper); }

/* ---------- 27. 列印文件：收據、准考證、筆記 ---------- */
.is-print-page { background: #e8eee9; }
.is-print-page .site-header, .is-print-page .site-footer, .is-print-page .fab-help, .is-print-page .notice-bar { display: none !important; }
.print-bar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px var(--gutter); background: var(--forest); color: #fff; }
.print-bar span { display: block; font-size: var(--fs-xs); color: rgba(214, 236, 217, .8); }
.doc { position: relative; width: min(210mm, calc(100% - 32px)); margin: 28px auto 60px; padding: 18mm 16mm; background: #fff; color: #111; box-shadow: 0 10px 30px -12px rgba(1, 40, 26, .35); font-family: "Noto Serif TC", "PMingLiU", serif; line-height: 1.7; overflow: hidden; }
.doc__watermark { position: absolute; inset: 0; display: grid; place-items: center; font: 700 min(26vw, 150px)/1 var(--font-sans); letter-spacing: .12em; color: rgba(1, 63, 38, .06); pointer-events: none; transform: rotate(-12deg); }
.doc > *:not(.doc__watermark) { position: relative; }
.doc--receipt { min-height: 140mm; }
.receipt__title { text-align: center; }
.receipt__title h1 { font-size: 1.6rem; margin: 0; letter-spacing: .06em; }
.receipt__title h2 { font-size: 1.5rem; margin: 2px 0 0; letter-spacing: .2em; }
.receipt__no { display: grid; grid-template-columns: auto auto; justify-content: end; gap: 0 4px; margin: 18px 0; font-size: 1rem; }
.receipt__no dt { text-align: right; } .receipt__no dd { margin: 0; }
.receipt__payer p, .receipt__detail p { margin: 2px 0; font-size: 1.05rem; }
.receipt__detail { margin: 18px 0 28px; }
.receipt__sign { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 1rem; }
.receipt__org { margin-left: auto; }
.seal-img { max-height: 90px; max-width: 150px; }
.receipt__org .seal-img { max-height: 150px; }
.seal-slot { display: inline-grid; place-items: center; width: 70px; height: 70px; border: 1.5px dashed #c9a3a3; color: #b98b8b; font-size: .85rem; border-radius: 4px; }
.receipt__org .seal-slot { width: 130px; height: 130px; }
.receipt__foot { margin-top: 18px; font-size: .95rem; }
.receipt__foot p { margin: 0; }
.doc--ticket { font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif; }
.ticket__title { text-align: center; font-size: 1.5rem; margin: 0 0 12px; font-weight: 500; }
.ticket__top { display: grid; grid-template-columns: 1fr 42mm; gap: 16px; }
.ticket__logo { display: block; margin-bottom: 8px; height: auto; }
.doc--ticket p { margin: 6px 0; font-size: .98rem; }
.ticket__photo { width: 42mm; height: 56mm; border: 1px solid #ccc; display: grid; place-items: center; overflow: hidden; background: #f5f5f5; }
.ticket__photo img { width: 100%; height: 100%; object-fit: cover; }
.ticket__notes { border-top: 1px solid #333; margin-top: 10px; padding-top: 6px; }
.ticket__notes h2 { font-size: 1rem; margin: 0; font-weight: 500; }
.ticket__notes ol { margin: 4px 0 0; padding-left: 1.6em; font-size: .9rem; line-height: 1.6; }
.ticket__foot { margin-top: 14px; padding: 10px; text-align: center; background: #6fa9a5; color: #fff; font-size: 1rem; }
.doc--notes { font-family: var(--font-sans); }
.notes__head { display: flex; gap: 16px; align-items: center; border-bottom: 2px solid var(--forest); padding-bottom: 12px; margin-bottom: 16px; }
.notes__head h1 { font-size: 1.4rem; margin: 0; color: var(--forest); }
.notes__head p { margin: 2px 0 0; color: #555; font-size: .9rem; }
.notes__group h2 { font-size: 1.1rem; margin: 18px 0 8px; padding: 4px 10px; background: var(--sage); color: var(--forest); border-radius: 4px; }
.notes__item { padding: 8px 0 10px; border-bottom: 1px solid #e3e9e5; break-inside: avoid; }
.notes__item h3 { font-size: 1rem; margin: 0; }
.notes__item h3 .num { color: var(--pine); margin-right: 6px; }
.notes__item p { margin: 4px 0; font-size: .95rem; }
.notes__item small { color: #777; }
.notes__foot { margin-top: 24px; font-size: .8rem; color: #777; text-align: center; }
@media print {
  @page { size: A4; margin: 12mm; }
  .no-print, .print-bar { display: none !important; }
  .is-print-page { background: #fff; }
  .doc { width: auto; margin: 0; padding: 0; box-shadow: none; }
  .doc__watermark { font-size: 120px; }
  .ticket__foot { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .notes__group h2 { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- 28. 電子書：主階層限定搜尋、目前位置 ---------- */
.sbtn { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 8px; border: 1px solid #b9d8c1; border-radius: 999px; background: #f1faf3; color: var(--pine); font: inherit; font-size: 11px; cursor: pointer; opacity: .75; }
.sbtn svg { width: 12px; height: 12px; }
.sbtn:hover, .sbtn:focus-visible { opacity: 1; background: var(--leaf); color: var(--forest); border-color: var(--leaf); }
.eb-scope { position: sticky; top: 0; z-index: 4; margin: 0 0 12px; padding: 12px 14px; background: #f1faf3; border: 1px solid #b9d8c1; border-radius: var(--radius-m); box-shadow: 0 6px 14px -10px rgba(1, 40, 26, .4); }
.eb-scope__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs-sm); }
.eb-scope__head svg { width: 16px; height: 16px; color: var(--pine); }
.eb-scope__head strong { color: var(--forest); font-size: var(--fs-base); }
.eb-scope__head small { color: var(--muted); }
.eb-scope__head .btn { margin-left: auto; }
.eb-scope__row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.eb-scope__row .input { flex: 1; min-width: 220px; min-height: 40px; }
.eb-scope__n { font-size: var(--fs-xs); color: var(--muted); }

.eb-ctx { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 0 8px; padding: 6px 12px; background: rgba(255, 255, 255, .96); border: 1px solid var(--line); border-left: 3px solid var(--leaf); border-radius: var(--radius-s); font-size: var(--fs-sm); backdrop-filter: blur(4px); }
.eb-ctx__lab { font-size: var(--fs-xs); color: var(--muted); margin-right: 4px; }
.eb-ctx a { color: var(--forest); text-decoration: none; font-weight: 500; }
.eb-ctx a:first-of-type { font-weight: 700; }
.eb-ctx a:hover { text-decoration: underline; }
.eb-ctx > span[aria-hidden] { color: var(--muted); }
.eb-ctx .sbtn { margin-left: auto; opacity: 1; }
.is-match > .ix, tr.is-match { background: #f3fbe9; }
.ix__t mark { background: #ffe066; color: inherit; padding: 0 1px; border-radius: 2px; }
/* ==========================================================================
   Rich-text editor (assets/js/editor.js) — class prefix .ed-
   可附加到 main.css 之後；只依賴 main.css 第 1 節的 design tokens。
   ========================================================================== */
.ed {
  --ed-bd: #b9ccbf;
  --ed-hover: #e6f0e8;
  --ed-on: #d6ecd9;
  position: relative;
  display: block;
  min-width: 0;
}
.ed-toolbar {
  position: sticky; top: var(--ed-sticky-top, 0px); z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0;
  padding: 5px 6px;
  background: var(--paper);
  border: 1px solid var(--ed-bd); border-bottom-color: var(--line);
  border-radius: var(--radius-s) var(--radius-s) 0 0;
  font-family: var(--font-sans); font-size: 13px; line-height: 1;
}
.ed-toolbar:has(.is-open) { z-index: 25; }
.ed-group { display: flex; align-items: center; gap: 1px; padding: 0 5px; }
.ed-group + .ed-group { border-left: 1px solid var(--line); }
.ed-group:first-child { padding-left: 0; }

.ed-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 30px; height: 30px; padding: 0 6px;
  border: 1px solid transparent; border-radius: var(--radius-s);
  background: transparent; color: var(--ink);
  font: inherit; font-size: 13px; line-height: 1; cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s;
}
.ed-btn:hover { background: #fff; border-color: var(--line); color: var(--forest); }
.ed-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--pine); position: relative; z-index: 1; }
.ed-btn[aria-pressed="true"], .ed-btn[aria-checked="true"], .ed-drop.is-open > .ed-btn, .ed-btn.is-active {
  background: var(--ed-on); border-color: #a9cdb1; color: var(--forest);
}
.ed-btn:disabled { opacity: .38; cursor: default; background: transparent; border-color: transparent; }
.ed-btn--text { padding: 0 8px; }
.ed-btn--wide { min-width: 82px; justify-content: space-between; }
.ed-btn--accent { color: var(--pine); border-color: #a9cdb1; background: #fff; }
.ed-ico { width: 17px; height: 17px; flex: none; }
.ed-caret { width: 12px; height: 12px; flex: none; opacity: .7; }
.ed-drop__txt { white-space: nowrap; }

/* 下拉 */
.ed-drop { position: relative; display: inline-flex; }
.ed-drop--split .ed-split-main { border-top-right-radius: 0; border-bottom-right-radius: 0; padding-right: 3px; }
.ed-drop--split .ed-split-arrow { min-width: 16px; padding: 0 2px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.ed-drop--split:hover > .ed-btn:not(:disabled) { border-color: var(--line); background: #fff; }
.ed-panel {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 30;
  background: #fff; border: 1px solid var(--ed-bd); border-radius: var(--radius-s);
  box-shadow: 0 10px 28px -12px rgba(1, 40, 26, .35), 0 2px 6px rgba(1, 40, 26, .06);
  font-size: 13px; line-height: 1.4; color: var(--ink);
}
.ed-menu { min-width: 150px; padding: 4px; display: grid; }
.ed-menu--narrow { min-width: 96px; max-height: 320px; overflow: auto; }
.ed-menu--row { display: flex; min-width: 0; gap: 2px; }
.ed-menu__item {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  width: 100%; padding: 7px 10px; border: 0; border-radius: 3px;
  background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.ed-menu__item small { color: var(--muted); font-size: 11px; }
.ed-menu__item:hover, .ed-menu__item:focus-visible { background: var(--ed-hover); outline: none; }
.ed-menu__item.is-current { background: var(--ed-on); color: var(--forest); font-weight: 700; }
.ed-menu__item.is-current::after { content: "✓"; font-size: 12px; }
.ed-menu__item.ed-danger { color: var(--danger); }
.ed-menu__item.ed-danger:hover { background: #fbecea; }
.ed-menu__item + .ed-danger:not(.ed-danger + .ed-danger) { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 3px 3px; padding-top: 9px; }
.ed-prev-h2 { font-family: var(--font-serif); font-size: 19px; font-weight: 700; }
.ed-prev-h3 { font-family: var(--font-serif); font-size: 16px; font-weight: 700; }
.ed-prev-h4 { font-family: var(--font-serif); font-size: 14px; font-weight: 700; }
.ed-prev-blockquote { border-left: 3px solid var(--forest); padding-left: 8px !important; margin-left: 2px; background: var(--sage) !important; }

/* 顏色 */
.ed-color-a { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 2px; }
.ed-color-a b { font-family: var(--font-serif); font-size: 15px; line-height: 1; margin-top: -2px; }
.ed-color-bar { display: block; width: 16px; height: 3px; margin-top: 1px; border-radius: 1px; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .25); }
.ed-colors { display: flex; gap: 18px; padding: 12px 14px 14px; }
.ed-colors__col { width: 184px; }
.ed-colors__col + .ed-colors__col { padding-left: 18px; border-left: 1px solid var(--line); }
.ed-colors__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ed-colors__head strong { font-size: 13px; color: var(--forest); }
.ed-colors__reset {
  padding: 3px 8px; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--paper); color: var(--ink); font: inherit; font-size: 12px; cursor: pointer;
}
.ed-colors__reset:hover { border-color: var(--pine); color: var(--pine); background: #fff; }
.ed-colors__sub { margin: 9px 0 5px; font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.ed-swatches { display: grid; grid-template-columns: repeat(8, 20px); gap: 3px; }
.ed-sw {
  width: 20px; height: 20px; padding: 0; border: 0; border-radius: 2px; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
  transition: transform .08s;
}
.ed-sw:hover, .ed-sw:focus-visible { transform: scale(1.18); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--forest); outline: none; position: relative; z-index: 1; }

/* 表格選擇器 */
.ed-tpick { padding: 10px; }
.ed-tpick__grid { display: grid; grid-template-columns: repeat(10, 16px); gap: 2px; outline: none; border-radius: 2px; }
.ed-tpick__grid:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--pine); }
.ed-tpick__cell { width: 16px; height: 16px; border: 1px solid #c9d8cd; background: #fff; border-radius: 1px; cursor: pointer; }
.ed-tpick__cell.is-on { background: var(--sage); border-color: var(--pine); }
.ed-tpick__lbl { margin-top: 8px; text-align: center; font-family: var(--font-code); font-size: 13px; color: var(--forest); }

/* 彈出表單（連結、圖片） */
.ed-pop { width: min(340px, 86vw); padding: 12px 14px; display: grid; gap: 10px; }
.ed-field { display: grid; gap: 4px; }
.ed-field > span { font-size: 12px; color: var(--muted); }
.ed-input {
  width: 100%; height: 34px; padding: 0 10px;
  border: 1px solid var(--ed-bd); border-radius: var(--radius-s);
  font: inherit; font-size: 13px; color: var(--ink); background: #fff;
}
.ed-input:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px rgba(11, 90, 55, .16); }
.ed-check { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.ed-check input { accent-color: var(--pine); width: 15px; height: 15px; margin: 0; }
.ed-err { margin: 0; padding: 6px 8px; border-radius: var(--radius-s); background: #fbecea; color: var(--danger); font-size: 12px; }
.ed-pop__foot { display: flex; justify-content: flex-end; gap: 6px; padding-top: 2px; }
.ed-pbtn {
  height: 32px; padding: 0 14px; border: 1px solid var(--forest); border-radius: var(--radius-s);
  background: var(--forest); color: #fff; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.ed-pbtn:hover { background: var(--pine); border-color: var(--pine); }
.ed-pbtn:disabled { opacity: .6; cursor: progress; }
.ed-pbtn--ghost { background: #fff; color: var(--forest); border-color: var(--ed-bd); }
.ed-pbtn--ghost:hover { background: var(--paper); color: var(--forest); border-color: var(--forest); }
.ed-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -2px 0 2px; }
.ed-tabs [role="tab"] {
  padding: 6px 10px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer;
}
.ed-tabs [aria-selected="true"] { color: var(--forest); border-bottom-color: var(--forest); font-weight: 700; }
.ed-file { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.ed-file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ed-file__btn { flex: none; padding: 6px 12px; border: 1px dashed var(--pine); border-radius: var(--radius-s); color: var(--pine); background: var(--paper); font-size: 13px; }
.ed-file:hover .ed-file__btn, .ed-file input:focus-visible + .ed-file__btn { background: var(--sage); border-style: solid; }
.ed-file__name { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 編輯區 */
.ed-stage { position: relative; }
.ed .ed-area {
  min-height: 260px; max-height: 640px; overflow: auto; resize: vertical;
  border-radius: 0 0 var(--radius-s) var(--radius-s);
  border-top: 0;
}
.ed .ed-area > :last-child { margin-bottom: 0; }
.ed .ed-area h2 { font-size: var(--fs-xl); }
.ed .ed-area h3 { font-size: var(--fs-lg); }
.ed .ed-area h4 { font-size: var(--fs-base); }
.ed .ed-area ul, .ed .ed-area ol { padding-left: 1.6em; margin: 0 0 1em; }
.ed .ed-area blockquote { margin: 1em 0; padding: 10px 16px; background: var(--sage); border-left: 4px solid var(--forest); border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.ed .ed-area img { display: inline-block; max-width: 100%; height: auto; cursor: pointer; }
.ed .ed-area img[style*="display: block"] { display: block; }
.ed .ed-area a { color: var(--pine); text-decoration: underline; }
.ed .ed-area hr { margin: 1.2em 0; }
.ed .ed-area::after { content: ""; display: table; clear: both; }
.ed-source {
  display: block; width: 100%; min-height: 260px; padding: 12px 14px; resize: vertical;
  border: 1px solid var(--ed-bd); border-top: 0; border-radius: 0 0 var(--radius-s) var(--radius-s);
  background: #0f2a1d; color: #d9f5de; caret-color: var(--leaf);
  font-family: var(--font-code); font-size: 13px; line-height: 1.6; tab-size: 2;
}
.ed-source:focus { outline: none; box-shadow: 0 0 0 3px rgba(11, 90, 55, .25); }
.ed.is-source .ed-toolbar { background: #e9efe9; }

/* 圖片選取 */
.ed-imgsel { position: absolute; pointer-events: none; outline: 2px solid var(--pine); outline-offset: 1px; box-shadow: 0 0 0 4px rgba(139, 233, 123, .35); }
.ed-imgbar {
  position: absolute; z-index: 6; display: flex; align-items: center; gap: 2px; padding: 4px;
  background: var(--forest); border-radius: var(--radius-s); box-shadow: var(--shadow-float);
  font-size: 12px; white-space: nowrap;
}
.ed-imgbar button {
  display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 26px; padding: 0 7px;
  border: 0; border-radius: 3px; background: transparent; color: #e6f5ea; font: inherit; cursor: pointer;
}
.ed-imgbar button .ed-ico { width: 15px; height: 15px; }
.ed-imgbar button:hover, .ed-imgbar button:focus-visible { background: rgba(139, 233, 123, .18); color: #fff; outline: none; }
.ed-imgbar button[aria-pressed="true"] { background: var(--leaf); color: var(--forest); }
.ed-imgbar button.ed-danger { color: #ffb4ab; }
.ed-imgbar button.ed-danger:hover { background: #b3261e; color: #fff; }
.ed-imgbar__lbl { color: rgba(230, 245, 234, .7); padding: 0 4px 0 6px; }
.ed-sep { width: 1px; height: 18px; background: rgba(230, 245, 234, .22); margin: 0 3px; }

/* 表格：編輯區與一般頁面內容共用 */
.rte-table, .prose table.rte-table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: inherit; }
.rte-table td, .rte-table th { border: 1px solid var(--line); padding: 6px 10px; vertical-align: top; min-width: 2em; }
.rte-table th { background: var(--paper); font-weight: 700; text-align: left; }
.ed .ed-area .rte-table td, .ed .ed-area .rte-table th { border-color: #c3d5c8; }
.ed .ed-area .rte-table td:focus-within, .ed .ed-area .rte-table th:focus-within { background: #f6fbf6; }

@media (max-width: 640px) {
  .ed-group { padding: 0 3px; }
  .ed-btn { min-width: 32px; height: 32px; }
  .ed-colors { flex-direction: column; gap: 12px; }
  .ed-colors__col + .ed-colors__col { padding-left: 0; border-left: 0; padding-top: 12px; border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) { .ed-btn, .ed-sw { transition: none; } }
/* 以上 editor.css 由編輯器元件併入 */
.eb-ctx.is-empty { visibility: hidden; }
@media (max-width: 640px) { .reg-card__head { flex-direction: column-reverse; } .reg-card { padding: 16px; } }
.nowrap { white-space: nowrap; }

/* ===== 29. 第四版（2026/10）：提示框、通知、課程報名選項、學分證書、證照、商店 ===== */
.callout { border: 1px solid var(--line, #d3e1d6); border-left: 4px solid var(--green-600, #0b5a37); background: #f3f8f3; border-radius: 6px; padding: 12px 14px; margin: 0 0 16px; font-size: .95rem; line-height: 1.7; }
.callout--warn { border-left-color: #c98a00; background: #fff8e6; }
.callout--danger { border-left-color: #b3261e; background: #fdeeee; }
.callout > svg { width: 1.15em; height: 1.15em; vertical-align: -.2em; margin-right: 4px; flex: none; }
/* 結業證書（直式 A4，依學會樣式） */
.doc--cert { min-height: 270mm; padding: 16mm 20mm 14mm; font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif; display: flex; flex-direction: column; }
.doc--cert .doc__watermark { color: rgba(200, 40, 40, .07); }
.cert__logo { height: auto; width: 180px; }
.cert__org, .cert__title { text-align: center; color: #6b1a28; font-weight: 700; margin: 0; }
.cert__org { font-size: 1.9rem; margin-top: 22px; letter-spacing: .04em; }
.cert__title { font-size: 1.9rem; margin-top: 14px; letter-spacing: .12em; }
.cert__body { font-size: 1.45rem; font-weight: 700; line-height: 2.1; margin: 48px 0 0; }
.cert__sign { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; font-size: 1.3rem; font-weight: 700; }
.cert__sign b { font-size: 1.7rem; margin-left: 6px; }
.cert__seal .seal-img { max-height: 200px; max-width: 220px; }
.cert__seal .seal-slot { width: 170px; height: 170px; }
.cert__date { text-align: center; font-size: 1.4rem; font-weight: 700; letter-spacing: .08em; margin: auto 0 0; padding-top: 24px; }
.cert__no { text-align: right; font-size: .8rem; color: #777; margin: 6px 0; }
.cert__foot { background: #6fa9a5; color: #fff; text-align: center; padding: 10px; font-size: 1.1rem; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
/* 證照（橫式 A4，依學會證照樣式：灰色外框＋綠色粗框＋內細線、上下花飾） */
.doc--license { width: min(297mm, calc(100% - 32px)); padding: 6mm; font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif; }
.license__outer { border: 1px solid #c9cfcb; padding: 5mm; background: #fff; }
.license__frame { position: relative; border: 9px solid #2f6b4a; box-shadow: inset 0 0 0 7px #fff, inset 0 0 0 8.5px #8fa79a; padding: 10mm 24mm 10mm; min-height: 172mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.license__frame > *:not(.doc__watermark) { position: relative; }
.license__frame .doc__watermark { color: rgba(47, 107, 74, .07); font-size: 170px; letter-spacing: .2em; transform: none; }
.license__flourish { display: block; width: 300px; height: 40px; margin: 0 auto; }
.license__flourish--bottom { transform: scaleY(-1); margin-top: 8mm; }
.license__head { display: flex; align-items: center; gap: 24px; margin-top: 2mm; }
.license__logo { background: #0f4a2c; border-radius: 4px; padding: 4px 8px; line-height: 0; }
.license__logo img { height: 66px; width: auto; }
.license__head h1 { flex: 1; text-align: center; font-size: 2.45rem; font-weight: 700; color: #1f3d5c; letter-spacing: .14em; margin: 0 120px 0 0; font-family: "Noto Sans TC", sans-serif; }
.license__no { text-align: right; font-size: .82rem; color: #1f3d5c; margin: 2px 0 14px; }
.license__who { display: grid; gap: 10px; font-size: 1.32rem; margin: 0 0 12px 12mm; color: #1b2a33; }
.license__who div { display: flex; }
.license__who dt { min-width: 7.2em; } .license__who dd { margin: 0; }
.license__body { font-size: 1.32rem; line-height: 1.8; margin: 6px 0 0 12mm; max-width: 78%; color: #1b2a33; font-family: "Noto Serif TC", serif; }
.license__sign { text-align: center; margin-top: 18px; font-size: 1.18rem; font-weight: 700; letter-spacing: .12em; color: #1b2a33; }
.license__sign p { margin: 0; }
.license__date { font-size: .86rem !important; font-weight: 400; margin-top: 12px !important; letter-spacing: .06em; }
.license__seal { position: absolute !important; right: 22mm; bottom: 16mm; }
.license__seal .seal-img { max-height: 140px; }
.license__seal .seal-slot { width: 120px; height: 120px; }
@media print {
  .doc--cert, .doc--license { padding: 0; }
  .doc--license { width: auto; }
}
@media print { @page landscape { size: A4 landscape; margin: 8mm; } .doc--license { page: landscape; } }
/* 通知列表 */
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.notif-list li { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-m); background: #fff; }
.notif-list li.is-unread { border-left: 4px solid var(--pine); background: #f6fbf6; }
.notif-list time { display: block; font-size: var(--fs-xs); color: var(--muted); }
.notif-list p { margin: 6px 0 0; font-size: var(--fs-sm); }
/* 課程：各身分費用表、講義與直播 */
.fee-table { margin-top: 8px; font-size: var(--fs-sm); }
.fee-table summary { cursor: pointer; color: var(--pine); font-weight: 500; }
.fee-table table { border-collapse: collapse; margin: 8px 0 4px; }
.fee-table th, .fee-table td { border: 1px solid var(--line); padding: 4px 10px; text-align: right; }
.fee-table th[scope="row"], .fee-table thead th:first-child { text-align: left; white-space: nowrap; }
.fee-table p { margin: 4px 0 0; color: var(--muted); font-size: var(--fs-xs); }
.en-extra { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 6px; font-size: var(--fs-sm); }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px 18px; }
/* 商品價格 */
.product__body { padding: 16px; flex: 1; }
.product__body h3 { font-size: var(--fs-lg); margin: 6px 0; }
.product__body > p { font-size: var(--fs-sm); color: var(--muted); }
.product__foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 16px; }
.price-list { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 8px 0; font-size: var(--fs-sm); }
.price-list dd { margin: 0; font-weight: 700; color: var(--forest); }
.price-tiers { font-size: var(--fs-xs); color: var(--pine); display: flex; gap: 4px; align-items: flex-start; }
.price-tiers svg { width: 14px; height: 14px; flex: none; margin-top: 3px; }
/* 後台：群發信件、出席匯入、證書範本 */
.bulk-preview { max-height: 160px; overflow: auto; font-size: var(--fs-xs); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: #fafcfa; }
.att-table input.input { padding: 4px 6px; min-height: 0; height: 32px; width: 6.5em; }
.att-table td, .att-table th { white-space: nowrap; }
.course > div { min-width: 0; }
.page-content { min-width: 0; }
.fee-table { max-width: 100%; overflow-x: auto; }
@media (max-width: 760px) { .course__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } }
.subnav { min-width: 0; }

/* ===== 30. 第五版（2026/10/03） ===== */
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { padding-right: 46px; width: 100%; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 34px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 6px; }
.pw-eye svg { width: 20px; height: 20px; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--forest); background: var(--sage); }
.pw-eye.is-on { color: var(--pine); }
.pw-eye.is-on::after { content: ''; position: absolute; width: 22px; height: 2px; background: currentColor; transform: rotate(-40deg); }
.att-table input[type="time"] { width: 8.5em; }
.void-stamp { position: absolute !important; top: 14mm; right: 14mm; z-index: 2; border: 4px solid #c62828; color: #c62828; padding: 6px 18px; font: 700 1.9rem/1.1 var(--font-sans); transform: rotate(-8deg); text-align: center; background: rgba(255, 255, 255, .85); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.void-stamp small { display: block; font-size: .7rem; font-weight: 500; }
.units { list-style: none; margin: 0; padding: 0; }
.unit { display: grid; gap: 4px; width: 100%; text-align: left; padding: 12px 18px; border: 0; border-bottom: 1px solid var(--line); background: #fff; font: inherit; cursor: pointer; color: var(--ink); }
.unit:hover, .unit.is-active { background: var(--sage); }
.unit.is-active { box-shadow: inset 4px 0 0 var(--pine); }
.unit__t { font-weight: 700; }
.unit .progress { height: 6px; }
.quiz { padding-left: 1.4em; }
.quiz li { margin-bottom: 16px; }
.quiz__opts { display: grid; gap: 4px; }
.course.is-hl { box-shadow: 0 0 0 3px var(--leaf); }
.file-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); margin-right: 8px; vertical-align: middle; }
.chapters .units li { padding: 0; display: block; border: 0; }
.tpl-blank { color: #b33; }
.admin-side__me { display: flex; gap: 8px; align-items: center; margin: 0 0 6px; padding: 8px 12px; color: #d6ecd9; font-size: var(--fs-sm); }
.admin-side__me svg { width: 18px; height: 18px; }
.admin-side__me small { display: block; color: #8be97b; font-size: var(--fs-xs); }
.opt-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.opt-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; gap: 8px; align-items: start; }
.opt-letter { font-weight: 700; color: var(--pine); padding-top: 10px; text-align: center; }
.opt-list .textarea { min-height: 44px; }
.opt-ans { padding-top: 8px; white-space: nowrap; }
/* 證書：使用學會提供的原圖底稿時，只套印文字 */
.cert-bg { position: absolute !important; inset: 0; width: 100%; height: 100%; object-fit: fill; z-index: 0; }
.has-bg { position: relative; }
.license__outer.has-bg { border: 0; padding: 0; }
.has-bg .license__frame { border: 0; box-shadow: none; background: transparent; }
.has-bg .license__flourish, .has-bg .license__logo, .has-bg .doc__watermark, .doc--cert.has-bg .cert__logo, .doc--cert.has-bg .cert__foot { visibility: hidden; }
.doc--license .license__outer.has-bg { aspect-ratio: 297 / 210; }
.doc--cert.has-bg { aspect-ratio: 210 / 297; }

/* ===== 31. 活動月曆（2026/10/05） ===== */
.cal { margin-bottom: 40px; }
.cal__bar-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.cal__nav { display: flex; align-items: center; gap: 8px; }
.cal__nav .btn--ghost { min-width: 40px; font-size: 1.2rem; }
.cal__title { margin: 0 6px; font-size: 1.6rem; min-width: 7.5em; text-align: center; }
.cal__title small { display: block; font: 500 var(--fs-xs) var(--font-sans); color: var(--muted); letter-spacing: .1em; }
.cal__pick .select { min-height: 40px; }
.cal__months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; margin-bottom: 14px; }
.cal__months button { position: relative; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 7px 0; font: inherit; font-size: var(--fs-sm); color: var(--ink); cursor: pointer; }
.cal__months button:hover { border-color: var(--pine); }
.cal__months button[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: #fff; font-weight: 700; }
.cal__months i { position: absolute; top: 4px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--leaf); }
.cal__grid { border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; background: #fff; }
.cal__dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--forest); color: #fff; font-size: var(--fs-sm); font-weight: 700; text-align: center; }
.cal__dow span { padding: 8px 0; }
.cal__dow .is-weekend { color: var(--leaf); }
.cal__week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: 28px repeat(var(--lanes, 0), 26px) minmax(24px, auto); row-gap: 3px; border-top: 1px solid var(--line); min-height: 96px; }
.cal__day { grid-row: 1 / -1; display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; border-left: 1px solid var(--line); padding: 4px 6px 4px; min-width: 0; }
.cal__day:first-child { border-left: 0; }
.cal__day.is-weekend { background: #f8fbf8; }
.cal__day.is-out { background: #f4f6f5; }
.cal__day.is-out .cal__num { color: #a6b2ab; }
.cal__num { font-size: var(--fs-sm); font-weight: 700; color: var(--ink); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal__day.is-today .cal__num { background: var(--pine); color: #fff; }
.cal__more { align-self: flex-start; border: 0; background: none; padding: 0; font: inherit; font-size: 11px; color: var(--pine); cursor: pointer; text-decoration: underline; }
.cal__bar { position: relative; z-index: 1; margin: 0 4px; padding: 0 8px; height: 24px; border: 0; border-left: 4px solid var(--bd); border-radius: 5px; background: var(--bg); color: var(--fg);
  font: 600 12px/24px var(--font-sans); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; min-width: 0; }
.cal__bar:hover, .cal__bar:focus-visible { filter: brightness(.96); outline: 2px solid var(--bd); outline-offset: 0; }
.cal__bar.is-light { background: repeating-linear-gradient(135deg, var(--bg), var(--bg) 6px, #fff 6px, #fff 9px); font-weight: 500; }
.cal__bar.is-planned { background: #fff; border: 1px dashed var(--bd); border-left: 4px solid var(--bd); font-weight: 500; }
.cal__bar.is-active { background: var(--bd); color: #fff; font-weight: 700; }
.cal__bar.is-done { background: #eceeed; color: #6b7570; border-left-color: #a5aea9; font-weight: 400; text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.cal__bar.is-internal { box-shadow: inset 0 -2px 0 #b3261e; }
.cal__legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.cal__legend .cal__chip { --bg: #e3efe6; --fg: #0b3d24; --bd: #0b5a37; font-weight: 500; font-size: var(--fs-xs); }
.cal__chip.is-planned { background: #fff; border: 1px dashed var(--bd); border-left: 4px solid var(--bd); }
.cal__chip.is-active { background: var(--bd); color: #fff; }
.cal__chip.is-done { background: #eceeed; color: #6b7570; border-left-color: #a5aea9; }
.cal__chip.is-internal { background: #fff; box-shadow: inset 0 -2px 0 #b3261e; }
.cal__bar.cont-l { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-width: 0; padding-left: 12px; }
.cal__bar.cont-r { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal__bar.cont-l::before { content: '◂'; position: absolute; left: 2px; font-size: 10px; opacity: .6; }
.cal__list { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.cal__list h3 { font-size: var(--fs-base); font-family: var(--font-sans); margin: 8px 0 4px; }
.cal__list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cal__list li button { display: grid; grid-template-columns: 10px 8.5em minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer; color: var(--ink); }
.cal__list li button:hover { border-color: var(--pine); }
.cal__list li i, .cal__daylist i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cal__date { font-family: var(--font-code); color: var(--muted); font-size: var(--fs-xs); }
.cal__list small, .cal__daylist small { color: var(--muted); font-size: var(--fs-xs); }
.cal__undated li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border: 1px dashed var(--line); border-radius: 6px; font-size: var(--fs-sm); }
.cal__chip { display: inline-block; padding: 2px 10px; border-left: 4px solid var(--bd); background: var(--bg); color: var(--fg); border-radius: 4px; font-size: var(--fs-sm); font-weight: 700; }
.cal__daylist { list-style: none; padding: 0; display: grid; gap: 8px; }
.cal__daylist li { display: flex; gap: 8px; align-items: center; }
@media (max-width: 700px) {
  .cal__months { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .cal__title { font-size: 1.3rem; min-width: 0; }
  .cal__week { grid-template-rows: 24px repeat(var(--lanes, 0), 18px) minmax(14px, auto); min-height: 70px; }
  .cal__bar { font-size: 0; height: 14px; margin: 0 1px; padding: 0; border-left-width: 3px; }
  .cal__bar.cont-l::before { display: none; }
  .cal__day { padding: 2px 3px; }
  .cal__more { font-size: 10px; text-decoration: none; }
  .cal__list li button { grid-template-columns: 10px minmax(0, 1fr); }
  .cal__list li button .cal__date { grid-column: 2; }
  .cal__list li button > span:not(.cal__date), .cal__list li button small { grid-column: 2; }
}

/* ===== 32. 全站搜尋（2026/10/05） ===== */
.search-btn { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(214, 236, 217, .35); border-radius: 50%; background: transparent; color: #e6f5ea; cursor: pointer; margin-left: 4px; }
.search-btn svg { width: 19px; height: 19px; }
.search-btn:hover, .search-btn:focus-visible { background: var(--leaf); color: var(--forest); border-color: var(--leaf); }
.search-dlg { position: fixed; inset: 0; z-index: 200; display: none; justify-content: center; align-items: flex-start; padding: 8vh 16px 16px; background: rgba(1, 30, 18, .55); backdrop-filter: blur(2px); }
.search-dlg.is-open { display: flex; }
.search-dlg__box { width: min(720px, 100%); max-height: 80vh; display: flex; flex-direction: column; background: #fff; border-radius: 14px; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .45); overflow: hidden; }
.search-dlg__bar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.search-dlg__bar svg { width: 22px; height: 22px; color: var(--pine); flex: none; }
.search-dlg__bar input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 1.1rem; padding: 6px 0; background: transparent; }
.search-dlg kbd { font: 600 11px var(--font-code); padding: 2px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; color: var(--muted); background: #f6f8f6; }
.search-dlg__res { overflow: auto; padding: 6px 10px 10px; }
.search-dlg__res h3 { font: 700 var(--fs-xs) var(--font-sans); color: var(--muted); letter-spacing: .08em; margin: 12px 8px 4px; }
.search-dlg__res ul { list-style: none; margin: 0; padding: 0; }
.search-dlg__res a { display: grid; gap: 2px; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.search-dlg__res a strong { font-weight: 700; }
.search-dlg__res a small { color: var(--pine); font-size: var(--fs-xs); }
.search-dlg__res a span { color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; }
.search-dlg__res a:hover, .search-dlg__res a.is-sel { background: var(--sage); }
.search-dlg__res mark { background: #fff1a8; color: inherit; padding: 0 1px; border-radius: 2px; }
.search-dlg__hint { padding: 10px; color: var(--muted); font-size: var(--fs-sm); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.search-dlg__hint button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: var(--fs-sm); cursor: pointer; color: var(--forest); }
.search-dlg__hint button:hover { border-color: var(--pine); background: var(--sage); }
.search-dlg__empty { padding: 18px 10px; color: var(--muted); }
.search-dlg__foot { margin: 0; padding: 8px 16px; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted); background: #fafcfa; }
@media (max-width: 700px) { .search-dlg { padding-top: 12px; } .search-dlg__foot { display: none; } .search-btn { width: 36px; height: 36px; } }

/* 33. 頁首寬度（加入搜尋鈕後，1025～1440px 收緊間距，避免水平捲動） */
@media (min-width: 1025px) and (max-width: 1440px) {
  .site-header__inner { gap: 12px; }
  .nav__link { padding: 0 7px; letter-spacing: .02em; }
  .nav__link::after { left: 7px; right: 7px; }
  .header-actions { margin-left: 0; gap: 6px; }
  .search-btn { width: 36px; height: 36px; margin-left: 0; }
}
@media (min-width: 1025px) and (max-width: 1240px) {
  .nav__link { padding: 0 5px; font-size: .84rem; letter-spacing: 0; }
  .nav__link svg { display: none; }
  .header-actions .btn--ghost-light { padding-inline: 10px; }
}

/* 34. 主選單 7 項（2026/10/06）：下拉選單文字不換行、字距放寬 */
.nav__menu { min-width: 200px; }
.nav__menu a { white-space: nowrap; }
@media (min-width: 1025px) { .nav__list { gap: 6px; } .nav__link { padding: 0 12px; letter-spacing: .06em; } .nav__link::after { left: 12px; right: 12px; } }
@media (min-width: 1025px) and (max-width: 1240px) { .nav__list { gap: 0; } .nav__link { padding: 0 8px; letter-spacing: .03em; } .nav__link::after { left: 8px; right: 8px; } }
@media (max-width: 1024px) { .nav__menu a { white-space: normal; } }
@media (max-width: 1100px) and (min-width: 901px) { .footer-top { grid-template-columns: 1fr 1fr 1fr; } }
.site-footer .ext-link { white-space: nowrap; }

/* ===== 第八版（2026/10/06）：團體會員入會申請書、上課證書身分證字號、推派代表 ===== */
.cert__who { font-size: 1.15rem; font-weight: 700; margin: 18px 0 0; }
.doc--groupapp { font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif; font-size: .95rem; }
.groupapp__head { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 4px; }
.groupapp__head h1 { font-size: 1.35rem; margin: 0; letter-spacing: .04em; }
.groupapp__no { text-align: right; margin: 0 0 6px; font-size: .85rem; color: #555; }
.groupapp__table { width: 100%; border-collapse: collapse; margin-bottom: 10px; table-layout: fixed; }
.groupapp__table th, .groupapp__table td { border: 1px solid #333; padding: 6px 8px; text-align: left; vertical-align: middle; word-break: break-all; }
.groupapp__table th { font-weight: 500; text-align: center; background: #f6f8f6; width: 7.5em; }
.groupapp__table caption { caption-side: top; border: 1px solid #333; border-bottom: 0; padding: 6px; font-weight: 700; }
.groupapp__reps th { width: auto; }
.groupapp__reps td { height: 2.2em; }
.groupapp__sign { margin-top: 14px; }
.groupapp__sign p { margin: 10px 0; font-weight: 700; }
.groupapp__line { display: inline-block; width: 220px; border-bottom: 1px solid #333; margin: 0 8px; vertical-align: bottom; }
.groupapp__sign small { font-weight: 400; color: #555; }
.groupapp__notes { font-size: .85rem; border-top: 1px solid #999; margin-top: 12px; padding-top: 6px; }
.groupapp__notes p { margin: 0; }
.groupapp__notes ol { margin: 4px 0 0; padding-left: 1.6em; line-height: 1.6; }
.rep.panel { margin: 0 0 12px; padding: 12px 16px; }
.rep legend { padding: 0 6px; font-weight: 700; }

/* ===== 第八版之二：學會原圖底稿證書（2026/10/06 附圖）===== */
.doc--bgcert { padding: 0 !important; background: none; box-shadow: none; border: 0; min-height: 0; display: block; }
.doc--license.doc--bgcert { width: min(297mm, calc(100% - 32px)); }
.doc--cert.doc--bgcert { width: min(190mm, calc(100% - 32px)); }
.bgcert { position: relative; container-type: inline-size; background: #fff; box-shadow: 0 2px 14px rgba(0, 0, 0, .12); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.bgcert__img { display: block; width: 100%; height: auto; }
.bgcert > :not(.bgcert__img) { position: absolute; margin: 0; }
.bgcert .tpl-blank { color: #999; }
/* 證照（底圖 2000×1414） */
.bgcert--license { color: #1b2a33; font-family: "Noto Serif TC", "PMingLiU", "MingLiU", serif; }
.bgL__no { left: 65.2%; top: 26.3%; font-size: 1.32cqw; letter-spacing: .06em; color: #1f3d5c; }
.bgL__text { left: 16%; top: 25.6%; right: 9%; font-size: 3.05cqw; line-height: 1.37; }
.bgL__text p { margin: 0; }
.bgL__sign { left: 0; right: 0; top: 70.4%; text-align: center; font-size: 2.55cqw; font-weight: 700; letter-spacing: .08em; line-height: 1.5; color: #1f3d5c; }
.bgL__sign p { margin: 0; }
.bgL__sign p + p { letter-spacing: .14em; }
.bgL__y, .bgL__m, .bgL__d { top: 83.3%; font-size: 1.75cqw; transform: translateX(-50%); color: #1f3d5c; }
.bgL__y { left: 46.9%; } .bgL__m { left: 52.4%; } .bgL__d { left: 58%; }
.bgL__seal { left: 75.7%; top: 66%; width: 17.6%; }
.bgL__seal .seal-img { width: 100%; max-width: none; max-height: none; height: auto; display: block; }
/* 結業證書（底圖 604×799） */
.bgcert--course { color: #1b1b1b; font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif; font-weight: 700; }
.bgC__body { left: 10%; right: 10%; top: 34%; font-size: 3.55cqw; line-height: 2.05; }
.bgC__body p { margin: 0; }
.bgC__lead { margin-bottom: 1.6em !important; }
.bgC__who { font-size: 2.9cqw; line-height: 1.6; margin: .2em 0 1em !important; }
.bgC__sign { left: 10%; top: 72.5%; font-size: 3.4cqw; }
.bgC__sign b { font-size: 4.4cqw; margin-left: .2em; }
.bgC__seal { left: 55.5%; top: 59%; width: 33%; }
.bgC__seal .seal-img { width: 100%; max-width: none; max-height: none; height: auto; display: block; }
.bgC__date { left: 0; right: 0; top: 84.6%; text-align: center; font-size: 3.6cqw; letter-spacing: .1em; }
.bgC__no { right: 10%; top: 89.6%; font-size: 1.6cqw; font-weight: 400; color: #777; }
@media print {
  .bgcert { box-shadow: none; }
  .doc--license.doc--bgcert { width: 266mm; margin: 0 auto; } .doc--bgcert .bgcert { break-inside: avoid; }
  .doc--cert.doc--bgcert { width: 186mm; margin: 0 auto; }
}
.bgC__body.has-who { top: 31%; }
.bgC__body.has-who .bgC__lead { margin-bottom: .3em !important; }
.bgC__body.has-who .bgC__who { margin: 0 0 1em !important; }
@media print { .is-print-page .skip-link, .is-print-page .admin-bar { display: none !important; } }
@media print { html, body.is-print-page { height: auto !important; min-height: 0 !important; } .is-print-page main, .is-print-page .print-app { min-height: 0 !important; } .doc--bgcert { margin: 0 auto !important; } }
@media print { body.is-print-page { padding: 0 !important; margin: 0 !important; } }

/* 2026/10/09：課程頁「已報名者入口」（會員／非會員／LINE@） */
.entry-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0 0 20px; }
.entry { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--green-600, #0b5a37); border-radius: var(--radius-s); background: #fff; color: inherit; text-decoration: none; }
.entry:hover, .entry:focus-visible { background: #f4f8f5; }
.entry span { font-size: var(--fs-sm); color: var(--muted); }

/* 2026/10/09：後台總覽「準備提醒」 */
.reminder-panel h2 svg { width: 1.1em; height: 1.1em; vertical-align: -.2em; margin-right: 6px; color: #b3261e; }
.reminder-list { list-style: none; margin: 0; padding: 0; }
.reminder-list li { display: grid; grid-template-columns: 7em 1fr auto; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); align-items: baseline; }
.reminder-list small { color: var(--muted); }
@media (max-width: 640px) { .reminder-list li { grid-template-columns: 1fr; gap: 2px; } }

/* 2026/10/09：出題題庫（後台、出題系統） */
.qb-form .qb-opts { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 6px; }
.qb-form .qb-opts li { display: flex; gap: 8px; align-items: center; }
.qb-ans { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; min-width: 3.2em; cursor: pointer; }
.qb-ans input { width: 18px; height: 18px; }
.qb-case-table td { padding: 4px; }
.qb-case-table .select, .qb-case-table .input { min-height: 34px; }
.qb-sum { font-size: var(--fs-sm); line-height: 1.6; max-width: 46em; }
.qb-filters .select, .qb-filters .input { width: auto; min-height: 38px; max-width: 220px; }
.qb-plan__head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 8px; }
.qb-plan__head h2 { font-size: var(--fs-lg); margin: 0 0 4px; }
.qp-items td { vertical-align: top; padding: 6px 4px; }
.qp-items .input, .qp-items .select { min-height: 36px; }
.qp-writers { display: grid; gap: 6px; min-width: 170px; }
.qp-writers .select { min-height: 36px; padding-block: 4px; font-size: var(--fs-sm); }
/* 第十二版：組卷選題頁、題目閱覽、出題文件、公文、日期篩選 */
.filter-date { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--muted); }
.filter-date .input { min-height: 40px; width: auto; }
.pp-info { margin-bottom: 14px; }
.pp-secbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 10px; }
.pp-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.pp-chip.is-active { border-color: var(--forest); background: var(--forest); color: #fff; }
.pp-chip .badge { min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--leaf); color: var(--forest); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.pp-sec { padding: 12px 14px; margin: 0 0 14px; }
.pp-tabs { margin: 4px 0 12px; }
.pp-tabs .badge { display: inline-block; min-width: 22px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--leaf); color: var(--forest); font-size: 12px; font-weight: 700; line-height: 20px; }
.pp-bank { max-height: 62vh; overflow: auto; }
.pp-bank thead th { position: sticky; top: 0; z-index: 1; }
.pp-bank tr.is-picked td { background: #eef7ef; }
.pp-picked { margin: 0 0 18px; }
.pp-picked h3 { font-size: var(--fs-base); margin: 0 0 8px; }
.pp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pp-list li { display: grid; grid-template-columns: 2.4em 1fr auto; gap: 8px; align-items: start; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; }
.pp-no { font-weight: 700; color: var(--muted); }
.pp-sticky { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-s); box-shadow: 0 -4px 14px rgba(0,0,0,.06); }
.qd-stem { white-space: pre-wrap; margin: 12px 0; line-height: 1.8; }
.qd-opts { padding-left: 1.6em; line-height: 1.8; }
.qd-opts li.is-ans { font-weight: 700; color: var(--forest); }
.qb-doc-list { display: grid; gap: 8px; }
.qb-doc-row { display: grid; grid-template-columns: 9em 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; }
@media (max-width: 700px) { .qb-doc-row, .pp-list li { grid-template-columns: 1fr; } .pp-sticky { flex-direction: column; align-items: stretch; } }
.qb-preview { font-size: var(--fs-sm); }
.qw-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.qw-item { border-top: 1px solid var(--line); padding: 12px 0; }
.qw-item__head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.qw-qs { margin: 10px 0 0; padding-left: 1.4em; display: grid; gap: 10px; }
.qw-qs li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.qw-docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.qw-doc { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px; }
.qw-submit { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.qw-submit [aria-disabled="true"] { opacity: .6; }

/* 2026/10/10：QA 知識庫搜尋 */
.kb-results { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.kb-results li { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface); }
.kb-results li a { color: var(--ink); text-decoration: none; }
.kb-results li a:hover strong { text-decoration: underline; }
.kb-results li p { margin: 6px 0 0; font-size: var(--fs-sm); line-height: 1.6; overflow-wrap: anywhere; }
.kb-results small { display: block; margin-top: 2px; }
.kb-note { line-height: 1.7; overflow-wrap: anywhere; }
.kb-pre { background: var(--paper); padding: 8px 12px; border-radius: 6px; white-space: pre-wrap; font-size: var(--fs-sm); }

/* 2026/10/13 公文附錄頁（課程內容、課程表） */
.od-apx-b { border: 1px solid var(--line, #d9dee5); border-radius: 8px; padding: 10px 12px; margin: 0 0 10px; background: var(--surface, #fff); }
.od-apx-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: var(--fs-sm); }
.od-apx-h .row-actions { gap: 4px; }
.od-grid { border-collapse: collapse; width: 100%; min-width: 420px; }
.od-grid td { border: 1px solid var(--line, #d9dee5); padding: 2px; vertical-align: top; }
.od-grid tr:first-child td { background: #f1f4f8; }
.od-grid tr:first-child textarea { font-weight: 700; }
.od-grid textarea { width: 100%; min-width: 90px; min-height: 2.2em; border: 0; padding: 4px 6px; resize: vertical; background: transparent; font-size: var(--fs-sm); }
.od-apx-b > .textarea { min-height: 0; }
.od-apx-b > .textarea[rows="1"] { height: auto; }

/* 第十六版（2026/11/12）：分步驟編輯表單（admin-steps.js） */
.steps-top { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.steps-top .stepper { flex: 1; display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; overflow-x: auto; }
.steps-top .stepper li { flex: 1 1 0; min-width: 84px; position: relative; }
.steps-top .stepper li + li::before { content: ''; position: absolute; top: 17px; left: -50%; right: 50%; height: 2px; background: var(--line); z-index: 0; }
.steps-top .stepper__btn { position: relative; z-index: 1; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 2px 4px; background: none; border: 0; cursor: pointer; color: var(--muted); font: inherit; font-size: var(--fs-sm); }
.steps-top .stepper__num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface, #fff); border: 2px solid var(--line); font-weight: 700; color: var(--muted); }
.steps-top .stepper__label { line-height: 1.3; text-align: center; }
.steps-top .stepper__btn:hover .stepper__label, .stepper__btn:focus-visible .stepper__label { color: var(--ink, inherit); text-decoration: underline; }
.steps-top .stepper__btn.is-current { color: var(--ink, inherit); font-weight: 700; }
.steps-top .stepper__btn.is-current .stepper__num { background: var(--pine); border-color: var(--pine); color: #fff; }
.steps-top .stepper__btn.is-done .stepper__num { background: var(--ok); border-color: var(--ok); color: transparent; position: relative; }
.steps-top .stepper__btn.is-done .stepper__num::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.steps-top .stepper__btn.is-error .stepper__num { border-color: var(--danger, #c0392b); color: var(--danger, #c0392b); }
.steps-mode { flex: none; white-space: nowrap; }
.step-pane__title { margin: 0 0 14px; font-size: var(--fs-lg); }
.step-pane__title small { display: block; margin-top: 4px; font-size: var(--fs-sm); font-weight: 400; color: var(--muted); }
.step-review { margin-bottom: 16px; }
.step-review__group { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; }
.step-review__group h4 { display: flex; justify-content: space-between; align-items: center; margin: 0 0 6px; font-size: var(--fs-base, 1rem); }
.step-review__group dl { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 4px 12px; margin: 0; font-size: var(--fs-sm); }
.step-review__group dt { color: var(--muted); }
.step-review__group dd { margin: 0; word-break: break-word; }
@media (max-width: 640px) {
  .steps-top { flex-direction: column; }
  .steps-top .stepper__label { font-size: 12px; }
  .step-review__group dl { grid-template-columns: 1fr; }
  .step-review__group dt { margin-top: 6px; }
}

.modal__head { z-index: 3; } /* 第十六版：步驟列不要蓋過視窗標題 */

/* 第十八版（2026/11/26）：QA 知識樹、代碼索引、相關筆記與關係圖 */
.kb-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.kb-tree details { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 8px; background: var(--surface); }
.kb-tree summary { cursor: pointer; padding: 10px 14px; display: flex; align-items: center; gap: 8px; min-height: 44px; }
.kb-tree__grp { margin: 0 12px 8px !important; }
.kb-tree ul { margin: 0; padding: 4px 18px 12px 34px; }
.kb-tree li { margin: 6px 0; line-height: 1.5; }
.kb-letters { margin: 10px 0 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.kb-codegrp h3 { margin: 16px 0 6px; font-size: var(--fs-lg); }
.kb-code { cursor: pointer; border: 1px solid var(--line); font: inherit; font-family: var(--font-code); font-size: var(--fs-sm); margin: 0 4px 6px 0; min-height: 32px; }
.kb-code:hover, .kb-code:focus-visible { border-color: var(--pine); }
.kb-related li { margin: 6px 0; }
.kb-graph { margin: 6px 0 12px; }
.kb-graph svg { width: 100%; height: auto; max-height: 320px; background: var(--paper); border-radius: 8px; }
.kb-graph line { stroke: var(--line); stroke-linecap: round; }
.kb-graph__me circle { fill: var(--pine); }
.kb-graph__node circle { fill: var(--sage); stroke: var(--pine); stroke-width: 1.5; }
.kb-graph__node { cursor: pointer; }
.kb-graph__node:hover circle, .kb-graph__node:focus circle { fill: var(--leaf); }
.kb-graph text { font-size: 12px; fill: var(--ink); }

/* 第十九版：會員身分與權限 */
.roles-sum { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.roles-sum__item { display: flex; flex-direction: column; align-items: flex-start; min-width: 110px; padding: 10px 14px; border: 1px solid var(--line, #d9dee5); border-radius: 10px; background: var(--surface, #fff); cursor: pointer; font: inherit; color: inherit; text-align: left; }
.roles-sum__item span { font-size: var(--fs-sm); color: var(--muted); }
.roles-sum__item strong { font-size: 1.5rem; line-height: 1.2; }
.roles-sum__item:hover, .roles-sum__item.is-on { border-color: var(--brand, #1f5fa8); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand, #1f5fa8) 20%, transparent); }
.roles-table .select--sm { min-height: 36px; padding-block: 4px; max-width: 160px; }
.roles-toggle { margin: 0; white-space: nowrap; }
.roles-toggle input:checked + span { font-weight: 700; color: var(--brand, #1f5fa8); }


/* 第二十版：帳號設定的 LINE 綁定步驟 */
.steps-mini { margin: 8px 0 12px; padding-left: 1.3em; }
.steps-mini li { margin: 4px 0; }

/* ==========================================================================
   第二十二版（2026/12/02）介面整理：統一的紀錄列、表格、詳細內容
   ========================================================================== */
:root { --side-w: 172px; }

/* 紀錄列：左邊是什麼、右邊狀態＋動作（同寬對齊） */
.rec-list { display: grid; gap: 12px; margin: 0 0 24px; }
.rec { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); column-gap: 24px; align-items: center; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.rec__main { min-width: 0; }
.rec__title { margin: 0; font-family: var(--font-sans); font-size: var(--fs-base); line-height: 1.5; letter-spacing: 0; }
.rec__meta { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--muted); line-height: 1.6; }
.rec__meta b { color: var(--ink); font-weight: 500; }
.rec__side { display: grid; gap: 8px; justify-items: stretch; }
.rec__side .tag { justify-self: end; white-space: normal; }
.cr-extra { display: none; color: var(--muted); font-size: var(--fs-xs); }
.show-extra .cr-extra { display: block; }
.list-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin: 0 0 8px; }
.list-head .note-sm { margin: 0; }
.rec__side .btn, .docrow__act .btn { width: 100%; justify-content: center; padding-inline: 8px; white-space: nowrap; }
.rec__body, .rec__more { grid-column: 1 / -1; min-width: 0; }
.rec__body { margin-top: 14px; }
.rec__body > :last-child { margin-bottom: 0; }
.rec__more { margin-top: 12px; }
.rec--quiet { background: transparent; }
.rec .stepper { margin: 4px 0 14px; }
.rec .progress { max-width: 420px; }
.rec__next { margin: 0 0 12px; font-size: var(--fs-sm); }

/* 文件列：收據、准考證等，按鈕與上方右欄對齊 */
.docrow { display: grid; grid-template-columns: 24px minmax(0, 1fr) var(--side-w); column-gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.docrow > svg { width: 22px; height: 22px; color: var(--pine); }
.docrow__text { min-width: 0; }
.docrow__text strong { display: block; font-size: var(--fs-sm); line-height: 1.5; }
.docrow__text small { color: var(--muted); font-size: var(--fs-xs); line-height: 1.5; display: block; }
.docrow__act { margin-left: 12px; }

/* 詳細內容 */
.more > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; list-style: none; color: var(--pine); font-size: var(--fs-sm); font-weight: 500; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid; border-bottom: 2px solid; transform: rotate(-45deg); transition: transform .15s; }
.more[open] > summary::before { transform: rotate(45deg) translate(-1px, -1px); }
.more > summary:hover { text-decoration: underline; }
.more__body { padding: 12px 0 2px; font-size: var(--fs-sm); }
.more__body > :last-child { margin-bottom: 0; }
.more__body .row-actions { margin-top: 12px; }
.more__body ul.plain { margin: 8px 0 0; padding-left: 1.2em; color: var(--muted); }
.more--block { margin: 0 0 24px; }
@media (prefers-reduced-motion: reduce) { .more > summary::before { transition: none; } }

.empty--sm { padding: 20px; font-size: var(--fs-sm); margin: 0 0 24px; }
.sec-title { font-family: var(--font-sans); font-size: var(--fs-lg); font-weight: 700; letter-spacing: 0; margin: 28px 0 12px; color: var(--ink); }
.sec-title:first-child { margin-top: 0; }
.note-sm { color: var(--muted); font-size: var(--fs-sm); margin: 0 0 16px; max-width: 46em; }

/* 表格：全站同一種樣子 */
.table thead th { background: var(--sage); color: var(--forest); font-weight: 700; letter-spacing: 0; padding-block: 10px; font-size: var(--fs-xs); }
.table th[scope="row"] { background: transparent; white-space: normal; min-width: 7em; }
.table th, .table td { vertical-align: middle; }
.table .num { font-family: inherit; font-variant-numeric: tabular-nums; }
.table td.act, .table th.act { width: 1%; white-space: nowrap; text-align: right; }
.table td small { color: var(--muted); }
@media (max-width: 640px) {
  .table-wrap:has(> .is-stack) { border: 0; background: none; overflow: visible; }
  .table.is-stack, .table.is-stack tbody { display: block; }
  .table.is-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table.is-stack tbody tr { display: block; padding: 10px 14px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
  .table.is-stack tbody td, .table.is-stack tbody th { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 10px; padding: 4px 0; border: 0; text-align: left; width: auto; white-space: normal; word-break: break-word; }
  .table.is-stack tbody td::before, .table.is-stack tbody th::before { content: attr(data-label); color: var(--muted); font-size: var(--fs-xs); font-weight: 400; }
  .table.is-stack tbody td:not([data-label]), .table.is-stack tbody td:empty { display: none; }
  .table.is-stack tbody td[colspan] { display: block; }
  .table.is-stack tbody td > * { justify-self: start; }
}

/* 篩選列、分頁 */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 16px; }
.filter-bar label { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.filter-bar label .input { width: auto; min-height: 40px; }
.segmented { max-width: 100%; overflow-x: auto; }
.segmented button { white-space: nowrap; flex: none; }
.kb-tabs { display: flex; width: max-content; }
.kb-tabs svg { width: 18px; height: 18px; flex: none; }
.segmented button[aria-selected="true"] { background: var(--forest); color: #fff; }
.subtabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 0 0 20px; }
.subtabs button { flex: none; padding: 10px 16px; min-height: 44px; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; background: none; font: inherit; font-size: var(--fs-sm); color: var(--muted); cursor: pointer; }
.subtabs button[aria-selected="true"] { color: var(--forest); font-weight: 700; border-bottom-color: var(--pine); }
.subpane { max-width: 720px; }
.subpane .panel { margin: 0; }

/* 繳費 */
.pay { background: none; border: 0; padding: 0; margin: 0; }
.pay__amount { font-family: inherit; font-variant-numeric: tabular-nums; font-weight: 700; }
.pay__bank { padding: 14px 16px; background: var(--paper); border-radius: var(--radius-s); }
.pay__form { border-top: 0; padding-top: 0; margin-top: 16px; }
.pay-fold { border-radius: var(--radius-m); margin: 0 0 12px; }
.pay-fold > summary { padding: 16px 20px; }
.pay-fold__body { padding: 0 20px 18px; }
.pay-fold__amt { font-family: inherit; font-variant-numeric: tabular-nums; }

/* 會員中心 */
.dash .admin-head { margin-bottom: 20px; padding-bottom: 14px; }
.dash__side nav .nav-group { margin: 12px 0 2px; padding: 0 10px; font-size: var(--fs-xs); color: var(--muted); }
.dash__side nav a { padding: 7px 10px; }
.todo { display: grid; gap: 8px; margin: 0 0 28px; padding: 0; list-style: none; }
.todo a { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 18px; background: #fff8e0; border: 1px solid #ecd68d; border-radius: var(--radius-m); color: #4d3500; text-decoration: none; font-size: var(--fs-sm); }
.todo a:hover { background: #fff1c7; }
.todo svg { width: 20px; height: 20px; }
.todo__go { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.facts > a { padding: 18px 20px; color: var(--ink); text-decoration: none; }
.facts > a + a { border-left: 1px solid var(--line); }
.facts > a:hover strong { text-decoration: underline; }
.facts span { display: block; font-size: var(--fs-sm); color: var(--muted); }
.facts strong { display: block; font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.facts .progress { margin-top: 8px; }
.links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin: 0; padding: 0; list-style: none; }
.links a { display: flex; align-items: center; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; }
.links a:hover { color: var(--pine); text-decoration: underline; }
.links svg { width: 20px; height: 20px; color: var(--pine); flex: none; }
.reg-card { padding: 18px 20px; margin-bottom: 12px; }
.reg-card__head h3 { font-family: var(--font-sans); font-size: var(--fs-base); letter-spacing: 0; }
.kb__item > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; cursor: pointer; list-style: none; padding: 16px 20px; }
.kb__item > summary::-webkit-details-marker { display: none; }
.kb__item > summary strong { font-size: var(--fs-base); line-height: 1.5; }
.kb__item > summary small { color: var(--muted); grid-column: 1; }
.kb__item > summary .tag { grid-row: 1 / 3; grid-column: 2; }
.kb__item.panel { padding: 0; }
.kb__item__body { padding: 0 20px 18px; }
.kb > .kb__item + .kb__item { margin-top: 10px; }

/* 聯絡客服：一般寬度縮成圓形圖示，不蓋住右側的按鈕與狀態 */
@media (max-width: 1560px) {
  .fab-help { width: 48px; height: 48px; padding: 0; right: 14px; justify-content: center; border-radius: 50%; }
  .fab-help span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .fab-help:hover span, .fab-help:focus-visible span { width: auto; height: auto; clip: auto; overflow: visible; right: 56px; padding: 4px 12px; border-radius: 6px; background: var(--forest); color: #fff; white-space: nowrap; font-size: var(--fs-sm); }
}
@media (max-width: 900px) { .dash__side nav .nav-group { display: none; } main { padding-bottom: 64px; } }
@media (max-width: 640px) {
  .rec { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .rec__side { margin-top: 12px; text-align: left; }
  .rec__side .tag { justify-self: start; }
  .docrow { grid-template-columns: 24px minmax(0, 1fr); row-gap: 10px; }
  .docrow__act { grid-column: 1 / -1; margin: 0; }
  .facts { grid-template-columns: 1fr; }
  .facts > a { padding: 12px 16px; }
  .facts > a + a { border-left: 0; border-top: 1px solid var(--line); }
  .links { grid-template-columns: 1fr; }
  .rec .stepper__label { font-size: var(--fs-xs); line-height: 1.3; }
  .kb-tabs { width: auto; }
  .kb-tabs button { padding-inline: 10px; }
  .kb-tabs svg { display: none; }
  .more > summary { min-height: 44px; }
  .btn--sm { min-height: 44px; }
  .notif-list li { flex-direction: column; }
}
.panel > summary svg { width: 18px; height: 18px; vertical-align: -.2em; margin-right: 6px; }
/* 會員中心、QA 平台是操作頁：橫幅縮小，讓內容往上 */
body[data-page="account/dashboard.html"] .page-hero .container, body[data-page="qa/index.html"] .page-hero .container { padding-block: 20px; }
body[data-page="account/dashboard.html"] .page-hero h1, body[data-page="qa/index.html"] .page-hero h1 { font-size: var(--fs-xl); margin: 0; }
body[data-page="account/dashboard.html"] .page-body, body[data-page="qa/index.html"] .page-body { padding-top: 28px; }
.empty > svg { width: 40px; height: 40px; color: var(--muted); }
.empty h3 { font-size: var(--fs-lg); margin: 8px 0 4px; }
