/* 羽球會報名 · 最終版 — 手機優先，微信 WebView 兼容 */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1a2233;
  --muted: #6b7688;
  --line: #e4e8ef;
  --green: #12855f;
  --green-bg: #e6f7f0;
  --amber: #9a6b00;
  --amber-bg: #fff6df;
  --red: #c0392b;
  --blue: #1c6ef2;
  --blue-dark: #1257c4;
}

html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang HK", "PingFang TC", "Microsoft JhengHei",
    "Noto Sans TC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

.wrap { max-width: 560px; margin: 0 auto; padding: 14px 14px 90px; }

/* ---------- header ---------- */
h1.club { font-size: 1.35rem; margin: 8px 0 2px; }
.sub { color: var(--muted); font-size: .86rem; margin-bottom: 10px; }

/* ---------- identity ---------- */
.id-chip {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 12px; margin-bottom: 10px; font-size: .92rem;
}
.id-chip .who { font-weight: 600; }
.linklike {
  background: none; border: none; color: var(--blue); font-size: .9rem;
  padding: 6px 8px; cursor: pointer;
}
.week-line { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; margin-bottom: 12px;
}
.panel h2 { font-size: 1.02rem; margin-bottom: 10px; }
.panel label { display: block; font-size: .88rem; color: var(--muted); margin: 10px 0 4px; }
.panel input[type=text], .panel input[type=password], .panel select, .panel textarea {
  width: 100%; font-size: 1.02rem; padding: 11px 12px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fbfcfe;
}
.panel textarea { min-height: 220px; font-size: .95rem; line-height: 1.7; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: block; width: 100%; margin-top: 12px;
  padding: 13px 16px; font-size: 1.05rem; font-weight: 600;
  border: none; border-radius: 12px; cursor: pointer;
  background: var(--blue); color: #fff;
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .55; }
.btn.ghost { background: #eef1f6; color: var(--ink); }
.btn.danger { background: #fdeceb; color: var(--red); }
.btn.small { width: auto; display: inline-block; padding: 9px 14px; font-size: .92rem; margin-top: 8px; }

/* ---------- event cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; margin-bottom: 14px;
}
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-top h3 { font-size: 1.06rem; }
.cap-count { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.cap-count b { color: var(--ink); }

.progress {
  position: relative; height: 22px; border-radius: 8px; overflow: hidden;
  background: #edf0f5; margin: 10px 0 4px; font-size: .78rem;
}
.progress .bar {
  position: absolute; inset: 0 auto 0 0; width: 0;
  background: linear-gradient(90deg, #2f9e6e, #12855f);
  transition: width .4s ease;
}
.progress span {
  position: relative; z-index: 1; display: block; text-align: center;
  line-height: 22px; color: #3d4a5d; font-weight: 600;
}

.locked-line {
  margin-top: 10px; font-size: .95rem; color: #5a6577;
  background: #f2f4f8; border-radius: 10px; padding: 10px 12px;
}
.cd { font-size: 1.22rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.mine-ok  { margin-top: 10px; padding: 9px 12px; border-radius: 10px; background: var(--green-bg); color: var(--green); font-weight: 600; font-size: .95rem; }
.mine-wl  { margin-top: 10px; padding: 9px 12px; border-radius: 10px; background: var(--amber-bg); color: var(--amber); font-weight: 600; font-size: .95rem; }
.notice   { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: var(--amber-bg); color: var(--amber); font-size: .84rem; }
.re-canc  { margin-top: 8px; color: var(--muted); font-size: .82rem; }
.standing { color: var(--muted); font-size: .8rem; margin-top: 8px; }

/* ---------- roster ---------- */
.roster { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.roster-head { display: flex; justify-content: space-between; align-items: center; }
.roster-head .t { font-size: .88rem; color: var(--muted); }
.roster select {
  font-size: .82rem; padding: 5px 8px; border: 1px solid var(--line);
  border-radius: 8px; background: #fbfcfe; color: var(--ink);
}
.roster .line { font-size: .9rem; margin-top: 8px; word-break: break-all; }
.roster .line .tag { font-weight: 700; }
.roster .line.g .tag { color: var(--green); }
.roster .line.a .tag { color: var(--amber); }
.roster .li { font-size: .92rem; padding: 2.5px 0 2.5px 10px; }
.roster .li .wlmark { font-size: .72rem; color: var(--amber); }
.roster .none { color: var(--muted); font-size: .86rem; margin-top: 8px; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  max-width: 86vw; background: #232b3b; color: #fff; font-size: .92rem;
  padding: 11px 18px; border-radius: 12px; opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease; z-index: 99; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: #7c2d24; }

/* ---------- admin ---------- */
.tabs { display: flex; gap: 6px; margin: 10px 0 12px; flex-wrap: wrap; }
.tabs button {
  flex: 1 1 auto; padding: 10px 6px; font-size: .88rem; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card); color: var(--ink); cursor: pointer; white-space: nowrap;
}
.tabs button.on { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.metrics { display: flex; gap: 8px; margin-bottom: 10px; }
.metrics div {
  flex: 1; background: #f2f4f8; border-radius: 10px; padding: 8px; text-align: center; font-size: .8rem; color: var(--muted);
}
.metrics div b { display: block; font-size: 1.15rem; color: var(--ink); }
table.rost { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.rost th, table.rost td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; }
table.rost th { color: var(--muted); font-weight: 600; font-size: .78rem; }
table.rost input[type=checkbox] { width: 18px; height: 18px; }
.evrow { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--card); }
.evrow .ttl { font-weight: 700; margin-bottom: 6px; }
.evrow .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.evrow label { font-size: .76rem; color: var(--muted); display: block; }
.evrow input, .evrow select { width: 100%; padding: 8px; font-size: .92rem; border: 1px solid var(--line); border-radius: 8px; }
.err-text { color: var(--red); font-size: .88rem; margin-top: 8px; }
.status-line { font-size: .88rem; color: var(--muted); margin: 6px 0; }

footer.page { color: var(--muted); font-size: .78rem; margin-top: 18px; text-align: center; }
