/* 華醫論健 CIS 10/10 版（正本：../華醫論健_CIS_Design_System.md、../assets/brand-tokens.css，唯讀）
   這裡先放 brand-tokens 的 --hm-* 變數當底，再對應到語意變數；其他 CSS 檔只能用語意變數，禁止寫死色碼。
   Jerry 之後若有新交付版，只要改這個檔案裡 --hm-* 的值或下面的對應關係，版面程式都不用動。 */
:root {
  /* ---- brand-tokens.css 原始變數（照抄，不要改名） ---- */
  --hm-ink-900: #171411;
  --hm-ink-700: #342e29;
  --hm-ink-500: #6f665d;
  --hm-cinnabar-700: #b6222e;
  --hm-cinnabar-800: #941b25;
  --hm-gold-500: #d6b36a;
  --hm-gold-300: #ead6a6;
  --hm-gold-800: #6a4d12;
  --hm-paper-100: #f7f1e3;
  --hm-paper-0: #fffdf8;
  --hm-line-300: #ded3c3;
  --hm-success-700: #2e6b4d;
  --hm-warning-800: #8a5a10;
  --hm-info-700: #315d73;

  --hm-font-display: "Noto Serif TC", "Songti TC", PMingLiU, serif;
  --hm-font-ui: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --hm-text-display: clamp(2.375rem, 5vw, 3.5rem);
  --hm-text-h1: clamp(2rem, 4vw, 2.75rem);
  --hm-text-h2: clamp(1.6875rem, 3vw, 2rem);
  --hm-text-h3: clamp(1.375rem, 2vw, 1.5rem);
  --hm-text-body-lg: clamp(1.1875rem, 1.6vw, 1.25rem);
  --hm-text-body: 1.125rem;
  --hm-text-small: 0.9375rem;

  --hm-space-1: 0.25rem; --hm-space-2: 0.5rem; --hm-space-3: 0.75rem; --hm-space-4: 1rem;
  --hm-space-6: 1.5rem; --hm-space-8: 2rem; --hm-space-12: 3rem; --hm-space-16: 4rem; --hm-space-24: 6rem;

  --hm-radius-button: 0.625rem;
  --hm-radius-card: 1rem;
  --hm-radius-hero: 1.5rem;
  --hm-shadow-card: 0 0.75rem 2.25rem rgb(23 20 17 / 10%);
  --hm-focus-ring: 0 0 0 0.25rem rgb(214 179 106 / 45%);

  --hm-container: 75rem;
  --hm-reading: 45rem;
  --hm-gutter: clamp(1.25rem, 4vw, 2.5rem);

  --hm-duration-fast: 160ms;
  --hm-duration-normal: 220ms;
  --hm-ease-standard: cubic-bezier(0.2, 0, 0, 1);

  /* ---- 語意變數：版面程式只能引用這一層，不能直接用 --hm-* 或色碼 ----
     Jerry 10/31 若交付新 CIS，只改這一段對應（或整個檔案）即可，版面程式不用動。 */
  --brand: var(--hm-cinnabar-700);        /* 主色：華醫朱，CTA／重點 */
  --brand-hover: var(--hm-cinnabar-800);
  --brand-ink: var(--hm-paper-0);         /* 主色底上的文字（紙白） */
  --accent: var(--hm-gold-500);           /* 醫光金：光暈、分隔、典禮感，不用於小字 */
  --accent-ink: var(--hm-gold-800);       /* 金色底上可讀的文字 */
  --bg: var(--hm-paper-100);              /* 宣紙米：大面積底色 */
  --surface: var(--hm-paper-0);           /* 紙白：卡片與閱讀底色 */
  --text: var(--hm-ink-700);              /* 內文 */
  --heading-ink: var(--hm-ink-900);       /* 標題 */
  --muted: var(--hm-ink-500);             /* 次要資訊、日期、註解 */
  --line: var(--hm-line-300);             /* 邊框、表格線 */
  --ok: var(--hm-success-700);
  --warn: var(--hm-warning-800);
  --info: var(--hm-info-700);

  --radius: var(--hm-radius-card);
  --radius-button: var(--hm-radius-button);
  --radius-hero: var(--hm-radius-hero);
  --shadow: var(--hm-shadow-card);
  --focus-ring: var(--hm-focus-ring);

  --font-sans: var(--hm-font-ui);
  --font-serif: var(--hm-font-display);
}

@media (prefers-reduced-motion: reduce) {
  :root { --hm-duration-fast: 0ms; --hm-duration-normal: 0ms; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-sans); font-size: var(--hm-text-body); line-height: 1.75;
  padding: 0 20px;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 24px 0 96px; }
.wide { max-width: var(--hm-container); }
h1, h2, h3 { margin: 0; line-height: 1.3; font-family: var(--font-serif); color: var(--heading-ink); text-wrap: balance; }
h1 { font-size: var(--hm-text-h1); }
h2 { font-size: var(--hm-text-h2); }
h3 { font-size: var(--hm-text-h3); }
p { margin: 0; }
a { color: var(--brand); }
.muted { color: var(--muted); }
.small { font-size: var(--hm-text-small); }
.body-lg { font-size: var(--hm-text-body-lg); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px;
}
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---- 按鈕（CIS 7.1）---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 0 24px; border-radius: var(--radius-button);
  font-size: 1.0625rem; font-weight: 700; font-family: var(--font-sans);
  text-decoration: none; cursor: pointer; border: none;
  transition: background var(--hm-duration-fast) var(--hm-ease-standard);
}
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.btn-secondary { background: var(--surface); color: var(--heading-ink); border: 1px solid var(--hm-ink-700); }
.btn-block { width: 100%; }

/* ---- 表單（CIS 7.3）---- */
label { display: block; font-size: 0.9375rem; font-weight: 700; color: var(--heading-ink); margin-bottom: 6px; }
.field { margin-bottom: 20px; }
input[type="text"], input[type="tel"], input[type="email"], select, textarea {
  width: 100%; min-height: 52px; font-size: 1.125rem; font-family: var(--font-sans);
  padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-button);
  background: var(--surface); color: var(--text);
}
textarea { min-height: 96px; padding: 12px 14px; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: var(--focus-ring); border-color: var(--accent); }
.hint { font-size: var(--hm-text-small); color: var(--muted); margin-top: 6px; }
.error-text { font-size: var(--hm-text-small); color: var(--brand); margin-top: 6px; }
.checkbox-row { display: flex; gap: 10px; align-items: flex-start; }
.checkbox-row input[type="checkbox"] { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.checkbox-row .checkbox-label { font-size: var(--hm-text-body); font-weight: 400; color: var(--text); }

/* ---- 狀態標籤（CIS 7.4）---- */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: var(--hm-text-small); font-weight: 700; }
.tag-ok { background: #e5f0ea; color: var(--ok); }
.tag-warn { background: var(--hm-gold-300); color: var(--accent-ink); }
.tag-off { background: var(--hm-line-300); color: var(--heading-ink); }

/* ---- Hero（CIS 5.2）：紙白到淡金的柔和徑向光暈 ---- */
.hero {
  background: radial-gradient(circle at 50% 20%, var(--hm-gold-300) 0%, var(--surface) 65%);
  border-radius: var(--radius-hero); padding: 48px 24px; text-align: center;
}
.hero img.logo { width: 240px; max-width: 70%; height: auto; margin: 0 auto 16px; display: block; }

header.site { max-width: var(--hm-container); margin: 0 auto; padding: 20px; display: flex; align-items: center; justify-content: space-between; }
header.site img.logo { width: 180px; height: auto; display: block; }

footer.site {
  max-width: 720px; margin: 48px auto 0; padding: 24px 0 48px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: var(--hm-text-small); text-align: center;
}
footer.site a { color: var(--info); }

.agenda-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.agenda-item:last-child { border-bottom: none; }
.agenda-time { flex: none; width: 110px; color: var(--muted); font-variant-numeric: tabular-nums; }

.speaker-card { display: flex; gap: 16px; align-items: flex-start; }
.speaker-card img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; background: var(--hm-line-300); }

.qr-box { text-align: center; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.qr-box img { width: 200px; height: 200px; }

/* 電腦上點 LINE oaMessage 連結叫不出 LINE app，旁邊附一組 QR 讓手機掃（只在滑鼠型裝置顯示） */
.lineqr { display: none; align-items: center; gap: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--heading-ink); margin-top: 12px; }
.lineqr svg { width: 110px; height: 110px; flex: none; }
@media (hover: hover) and (pointer: fine) { .lineqr { display: flex; } }

.ticket-seat-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--surface); }
.step-list { padding-left: 0; margin: 0; list-style: none; }
.step-list li { padding: 2px 0; color: var(--muted); }
.step-list li.active { color: var(--heading-ink); font-weight: 700; }

/* ---- 後台（內部工具，桌面優先，仍沿用語意變數）---- */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px 80px; }
.tab-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tab-btn { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; font-family: var(--font-sans); font-size: 14px; color: var(--heading-ink); }
.tab-btn.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
table.admin-table th, table.admin-table td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
table.admin-table th { background: var(--bg); font-weight: 700; }
table.admin-table tr:hover td { background: rgba(0,0,0,.015); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 6px; }
.admin-field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
