/* WK TOOL（2026-10-31 他定：視覺延續 gtg-tool.pages.dev；logo 用 WK 不用「光」，以後不只光頭哥的工具）
   深綠主色 #1F5C46、暖灰底、系統字、卡片內框線、按鈕 12 圓角；黃色只留給違規字標記
   放掉 taste：6.C／8 深色模式（一律淺色）、3.A React／Tailwind、3.C 圖示套件（他的規則是 inline SVG） */
:root {
  --accent: #1F5C46;
  --accent-deep: #1F5C46;
  --accent-soft: #E7F0EB;
  --ink: #17181C;
  --ink-2: #4A4C55;
  --ink-3: #6E7079;
  --bg: #F5F4F0;
  --surface: #FFFFFF;
  --line: #E4E1D8;
  --soft: #EEECE5;
  --ok: #1F7A4D;
  --ok-soft: #E6F4EC;
  --danger: #B42318;
  --danger-soft: #FDECEA;
  --warn: #9A6300;
  --warn-soft: #FFF4DC;
  --r: 16px;
  --r-sm: 12px;
  --gutter: 16px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --shadow: 0 1px 0 rgba(23, 24, 28, .04), 0 8px 24px -12px rgba(23, 24, 28, .10), inset 0 0 0 1px var(--line);
  color-scheme: light;
}
html { color-scheme: light; -webkit-text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: border-box; }
/* 字體（2026-10-15 他說「字體粗糙不精緻」後重排）：
   英文數字用 Geist（中文字體附的西文偏寬鈍），中文用 Noto Sans TC；全站最粗只到 600，主次靠字級與顏色，不靠一律加粗；
   標題與欄位標籤加 palt，把全形括號壓成半寬，「（台灣時間）」兩邊不再空一大塊 */
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; font-weight: 400; line-height: 1.75;
  letter-spacing: .01em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  line-break: strict; text-wrap: pretty; overflow-x: clip; }
h1, h2, h3 { margin: 0; line-height: 1.35; text-wrap: balance; font-weight: 600; letter-spacing: 0; }
/* palt 只給標題與標籤：內文的逗號壓成半寬會跟英數黏在一起（2026-10-15 截圖確認） */
h1, h2, h3, .field label, .group-title { font-feature-settings: "palt" 1; }
b, strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
p { margin: 0; }
img { max-width: 100%; display: block; }
a { color: var(--accent-deep); text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; color: inherit; }
.ic { width: 20px; height: 20px; flex: none; display: inline-block; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding-inline: var(--gutter); }
.narrow { max-width: 560px; }
.muted { color: var(--ink-3); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 頂欄 */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .02em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand img { width: 40px; height: 40px; border-radius: 12px; }
.brand > span { display: grid; line-height: 1.3; }
.brand small { font-size: 13px; font-weight: 400; color: var(--ink-3); letter-spacing: 0; }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.who img { width: 30px; height: 30px; border-radius: 50%; }

/* 按鈕：全部膠囊形（圓角規則：按鈕全圓、卡片 16、輸入框 10） */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 22px;
  border-radius: 12px; border: 0; background: var(--accent); color: #fff; font-weight: 700; letter-spacing: 0; text-decoration: none;
  cursor: pointer; white-space: nowrap; transition: transform .15s ease, filter .15s ease; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:focus-visible, .field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: var(--soft); color: var(--ink); }
.btn.ghost:hover { filter: brightness(.97); }
.btn.small { min-height: 44px; padding: 6px 14px; font-size: 14px; }
.btn.line { background: #06C755; color: #fff; }
.btn.line:hover { background: #05B34C; }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px #F1C5C0; }
.btn.block { width: 100%; }
.btn[aria-busy="true"] { pointer-events: none; opacity: .85; }
.btn[aria-busy="true"]::before, .spin { content: ""; width: 18px; height: 18px; border-radius: 50%; display: inline-block;
  border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* 減少動態時只關掉移動，轉圈保留（不然等待時畫面完全不動） */
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .reveal { animation: none !important; } }

/* 表單 */
.field { display: grid; gap: 6px; }
.field label { font-weight: 500; font-size: 15px; color: var(--ink); }
.field .help { font-size: 14px; color: var(--ink-3); }
.field input, .field textarea { width: 100%; min-height: 50px; padding: 12px 14px; border-radius: var(--r-sm);
  border: 1.5px solid #CFCFC8; background: var(--surface); font-size: 16px; }
.field textarea { min-height: 88px; resize: vertical; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: #8A8A90; }
.field .err { font-size: 14px; color: var(--danger); font-weight: 500; display: none; }
.field.bad input, .field.bad textarea { border-color: var(--danger); background: #FFFBFA; }
.field.bad .err { display: block; }
.group { display: grid; gap: 18px; }
.group-title { font-size: 14px; font-weight: 600; letter-spacing: .06em; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }

.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-sm); font-size: 15px; line-height: 1.6; }
.notice .ic { margin-top: 2px; }
.notice.danger { background: var(--danger-soft); color: #7A1810; }
.notice.ok { background: var(--ok-soft); color: #0F4D2E; }
.notice.warn { background: var(--warn-soft); color: #5C3C00; }
.notice[hidden] { display: none; }

/* 載入骨架 */
.skel { background: linear-gradient(90deg, #EEEEEA 25%, #F7F7F4 50%, #EEEEEA 75%); background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.reveal { animation: rise .45s cubic-bezier(.16, 1, .3, 1) both; }

/* 總管理員的「用夥伴看」「後台」與夥伴視角提示條（view.js） */
.tb { display: flex; align-items: center; gap: 6px; }
.tb-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.tb-btn .ic { width: 16px; height: 16px; }
.asbar { background: var(--accent); }
.asbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; font-size: 14px; font-weight: 600; }
.asbar span { display: inline-flex; align-items: center; gap: 6px; }
.asbar .tb-btn { border-color: transparent; }
@media (max-width: 374px) { .tb .tb-btn .ic { display: none; } .tb .tb-btn { padding: 0 10px; } }

/* ── 左上角漢堡選單（2026-10-29 他定）：所有功能都在這裡，選單資料在 view.js 的 menuGroups ── */
.top-l { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ham { width: 40px; height: 40px; margin-left: -4px; border: 0; background: transparent; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--ink); cursor: pointer; flex: none; }
.ham:active { background: #F0F0EC; }
.ham[aria-busy="true"] .ic { opacity: .4; }
#drawer { position: fixed; inset: 0; background: rgba(28, 28, 33, .35); z-index: 50; }
.dr-panel { position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 84vw); background: var(--surface); z-index: 51; overflow-y: auto; padding: 8px 12px 24px; box-shadow: 0 10px 30px rgba(40, 36, 20, .18); display: grid; align-content: start; gap: 6px; }
.dr-head { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 0 4px 0 8px; font-weight: 600; }
.dr-x { width: 44px; height: 44px; border: 0; background: transparent; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--ink-2); cursor: pointer; }
.dr-g { display: grid; gap: 2px; padding: 6px 0; }
.dr-g + .dr-g { border-top: 1px solid var(--line); }
.dr-t { margin: 4px 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.dr-panel a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 10px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 16px; }
.dr-panel a .ic { color: var(--ink-3); }
.dr-panel a[aria-current="page"] { background: var(--accent-soft); font-weight: 600; }
.dr-panel a[aria-current="page"] .ic { color: var(--accent-deep); }
.dr-panel a:active { background: #F0F0EC; }
