/* 家長端共用樣式。大螢幕(tv.html)有自己的深色樣式。 */
:root {
  --bg: #f6f3ec;
  --card: #ffffff;
  --ink: #1c2233;
  --muted: #6b7183;
  --line: #e7e3da;
  --field: #faf8f4;
  --brand: #262d63;
  --brand-soft: #eceefa;
  --gold: #f5b301;
  --gold-soft: #fff4cf;
  --danger: #b3261e;
  --danger-soft: #fbeceb;
  --ok: #1f7a4d;
  --r: 16px;
  --shadow: 0 1px 2px rgba(28, 34, 51, .05), 0 6px 20px rgba(28, 34, 51, .06);
}
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.55; font-size: 16px;
  padding: 16px 16px 40px; max-width: 680px; margin: 0 auto;
}
h1 { font-size: 24px; line-height: 1.3; margin: 8px 0 6px; letter-spacing: .01em; }
h2 { font-size: 18px; margin-bottom: 10px; }
h3 { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .06em; margin: 22px 0 10px; }
a { color: var(--brand); text-underline-offset: 3px; }
.hint { font-size: 14px; color: var(--muted); margin-bottom: 12px; }

/* ---------- 卡片 ---------- */
section, form.card, .card {
  background: var(--card); border-radius: var(--r); padding: 20px; margin-bottom: 16px;
  box-shadow: var(--shadow); border: 1px solid rgba(28, 34, 51, .04);
}

/* ---------- 表單 ---------- */
label.f, .field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
input[type=text], input[type=password], input[type=number] {
  font: inherit; font-size: 16px; font-weight: 400; color: var(--ink);
  padding: 11px 12px; min-height: 46px; width: 100%; min-width: 0;
  background: var(--field); border: 1.5px solid var(--line); border-radius: 12px;
  transition: border-color .15s, background .15s;
}
input::placeholder { color: #a9adba; }
input:hover { border-color: #d3cec2; }
input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(38, 45, 99, .28); outline-offset: 2px;
}
input:focus { border-color: var(--brand); background: #fff; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--brand); }

button { font: inherit; cursor: pointer; color: inherit; }
button:disabled { opacity: .45; cursor: default; }
button.primary, button.plain, button.danger {
  min-height: 46px; padding: 10px 22px; border-radius: 12px; font-size: 16px; font-weight: 600;
}
button.primary { border: 0; background: var(--brand); color: #fff; }
button.primary:hover { background: #1c2250; }
button.plain { border: 1.5px solid var(--line); background: #fff; }
button.plain:hover { border-color: #cfc9bb; }
button.danger { border: 0; background: var(--danger-soft); color: var(--danger); }

.msg { font-size: 14px; min-height: 1.5em; margin-top: 10px; color: var(--ok); }
.msg.err { color: var(--danger); }
.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 28px; letter-spacing: .18em; font-weight: 700; color: var(--brand); }
nav.links { text-align: center; font-size: 14px; margin: 16px 0; }
nav.links a { margin: 0 10px; }

/* ---------- 分頁按鈕(首頁、加入頁) ---------- */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; background: #ebe7dd; padding: 5px; border-radius: 14px; }
.tabs button { min-height: 42px; padding: 8px; font-size: 15px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; }
.tabs button[aria-selected=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(28, 34, 51, .12); }

/* ---------- 主選單:桌機在上方,手機在底部 ---------- */
.appnav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.appnav .brand { font-weight: 800; font-size: 18px; text-decoration: none; color: var(--ink); display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.appnav .brand small { font-weight: 500; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appnav .tabs2 { display: flex; gap: 4px; }
.appnav .tabs2 a {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px;
  text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.appnav .tabs2 a:hover { background: #ebe7dd; }
.appnav .tabs2 a.on { background: var(--brand); color: #fff; }
@media (max-width: 620px) {
  body.app { padding-bottom: 96px; }
  .appnav .tabs2 {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; gap: 0; justify-content: space-around;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .appnav .tabs2 a { flex: 1; flex-direction: column; gap: 2px; font-size: 12px; padding: 6px 4px; min-height: 52px; justify-content: center; }
  .appnav .tabs2 a .nav-ico { font-size: 20px; line-height: 1; }
  .appnav .tabs2 a.on { background: var(--brand-soft); color: var(--brand); }
}

/* ---------- 清單列(帳號頁) ---------- */
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row button { min-height: 38px; padding: 6px 14px; font-size: 14px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
