/* 課堂點名系統 — 共用樣式（Minimal / Swiss：高對比、清楚層次、適合投影） */
:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #526077;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --brand: #2456d6;
  --brand-dark: #1a3f9e;
  --brand-ink: #ffffff;
  --brand-soft: #eaf0fe;
  --navy: #1e3a5f;
  --present: #157a3c;
  --present-bg: #dcf5e4;
  --absent: #c42727;
  --absent-bg: #fde4e4;
  --excused: #4f5f77;
  --excused-bg: #e7ecf3;
  --pending: #8792a6;
  --pending-bg: #f1f4f8;
  --warn-bg: #fff7e8;
  --warn-line: #f2d49b;
  --warn-ink: #7a4a00;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 14px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .18);
  --ring: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent);
  --ease: cubic-bezier(.2, .7, .3, 1);
  font-family: "Noto Sans TC", "Microsoft JhengHei UI", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
button, input, select { font: inherit; color: inherit; }
.en { color: var(--muted); font-weight: 400; font-size: .8em; margin-left: .3em; letter-spacing: .01em; }
:focus-visible { outline: none; box-shadow: var(--ring); }

/* 按鈕 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-height: 40px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink); padding: .45em 1.05em;
  border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; font-weight: 600; box-shadow: var(--shadow-sm);
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
  touch-action: manipulation;
}
.btn:hover { border-color: #94a3b8; background: #f8fafc; color: var(--ink); }
.btn:active { background: #f1f5f9; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--brand-ink); }
.btn.danger { color: var(--absent); border-color: color-mix(in srgb, var(--absent) 35%, white); }
.btn.danger:hover { background: var(--absent-bg); border-color: var(--absent); color: var(--absent); }
.btn.big { font-size: 1.05em; min-height: 48px; padding: .6em 1.4em; }
.btn.sm { min-height: 34px; padding: .25em .8em; font-size: .88em; }
.btn:disabled, .btn:disabled:hover { opacity: .45; cursor: not-allowed; background: var(--card); border-color: var(--line-2); }
.btn.primary:disabled, .btn.primary:disabled:hover { background: var(--brand); border-color: var(--brand); }

/* 表單 */
input[type=text], input[type=password], input[type=number], input:not([type]), select {
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: .5em .8em; min-height: 42px;
  background: #fff; min-width: 0; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input:hover, select:hover { border-color: #94a3b8; }
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input:disabled { background: var(--pending-bg); color: var(--muted); cursor: not-allowed; }
input[type=checkbox] { width: 1.05em; height: 1.05em; accent-color: var(--brand); cursor: pointer; }
select { cursor: pointer; }
label.field { display: grid; gap: .35em; font-weight: 600; color: var(--ink-2); align-content: start; }
label.field small { font-weight: 400; color: var(--muted); }

/* 版面元件 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.35rem; box-shadow: var(--shadow); }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.hidden, [hidden] { display: none !important; }

/* 狀態色 */
.st-present { background: var(--present-bg); color: var(--present); }
.st-absent { background: var(--absent-bg); color: var(--absent); }
.st-excused { background: var(--excused-bg); color: var(--excused); }
.st-pending { background: var(--pending-bg); color: var(--pending); }
.pill { display: inline-flex; align-items: center; gap: .3em; padding: .15em .7em; border-radius: 99px; font-size: .85em; font-weight: 700; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 8px); background: var(--ink); color: #fff;
  padding: .7em 1.3em; border-radius: var(--radius-sm); opacity: 0; pointer-events: none; z-index: 99; box-shadow: var(--shadow-lg);
  transition: opacity .2s var(--ease), transform .2s var(--ease); font-weight: 600;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 2.2em;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23526077' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right .7em center / 1em no-repeat;
}
