:root {
  --navy: #0b3a6a;
  --navy-2: #0f4c81;
  --blue: #0369a1;
  --blue-2: #0284c7;
  --blue-3: #38bdf8;
  --gold: #c9a227;
  --gold-2: #e8d48b;
  --bg: #eef3f8;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe7f2;
  --ok: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --party: #b91c1c;
  --shadow: 0 10px 30px rgba(11, 58, 106, 0.08);
  --radius: 18px;
  --tab-h: calc(64px + env(safe-area-inset-bottom));
  --top-h: 56px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
html { scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar, *::-webkit-scrollbar { display: none; width: 0; height: 0; }
body {
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 50% -120px, #1a5fa8 0%, var(--navy) 42%, #071f3c 100%);
  color: var(--ink);
  min-height: 100%;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }

.app-shell {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 30px 80px rgba(0,0,0,.25);
}
.app-body {
  padding: 12px 14px calc(var(--tab-h) + 16px);
  min-height: 100dvh;
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 14px;
  background: linear-gradient(180deg, rgba(11,58,106,.96), rgba(11,58,106,.88));
  color: #fff;
  backdrop-filter: blur(12px);
}
.topbar h1 { font-size: 16px; font-weight: 700; margin: 0; letter-spacing: .04em; }
.topbar .sub { font-size: 11px; opacity: .78; }
.icon-btn {
  width: 40px; height: 40px; border: 0; border-radius: 12px;
  background: rgba(255,255,255,.12); color: #fff;
  display: grid; place-items: center; cursor: pointer;
}

.hero {
  margin: -12px -14px 14px;
  padding: 18px 16px 22px;
  background: linear-gradient(135deg, #0b3a6a 0%, #0369a1 58%, #0e7490 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; right: -40px; top: -30px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,212,139,.35), transparent 70%);
}
.hero .kicker { font-size: 12px; letter-spacing: .18em; color: var(--gold-2); text-transform: uppercase; }
.hero h2 { margin: 6px 0 4px; font-size: 20px; font-weight: 800; letter-spacing: .02em; }
.hero p { margin: 0; font-size: 12px; opacity: .86; }
.cd-pill {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 12px; padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.14); font-size: 12px;
}

.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.kpi {
  background: var(--card); border-radius: 16px; padding: 14px 14px 12px;
  box-shadow: var(--shadow); min-height: 86px;
}
.kpi b { display: block; font-size: 26px; line-height: 1.1; color: var(--navy); font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; color: var(--muted); }
.kpi.alert b { color: var(--danger); }

.card {
  background: var(--card); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow); margin-bottom: 12px;
}
.card-h {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; gap: 8px;
}
.card-h h3 { margin: 0; font-size: 15px; color: var(--navy); }
.muted { color: var(--muted); font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.station-bar { margin: 8px 0 12px; }
.station-name { font-size: 13px; font-weight: 600; }
.bar {
  height: 8px; border-radius: 99px; background: #e2e8f0; overflow: hidden; margin-top: 6px;
}
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--blue-3)); border-radius: 99px; }
.seg { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.chip, .seg a, .seg button {
  border: 1px solid var(--line); background: #fff; color: var(--navy);
  border-radius: 999px; padding: 8px 12px; font-size: 12px; white-space: nowrap;
  min-height: 36px;
}
.chip.on, .seg a.on, .seg button.on { background: var(--navy); color: #fff; border-color: var(--navy); }

.person {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.person:last-child { border-bottom: 0; }
.avatar {
  width: 48px; height: 48px; border-radius: 14px; object-fit: cover;
  background: linear-gradient(135deg, #dbeafe, #93c5fd); color: var(--navy);
  display: grid; place-items: center; font-weight: 700;
}
.person .name { font-weight: 700; font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag {
  font-size: 10px; padding: 2px 6px; border-radius: 6px;
  background: #e0f2fe; color: var(--blue); font-weight: 600;
}
.tag.party { background: #fee2e2; color: var(--party); }
.tag.gold { background: #fef3c7; color: #92400e; }
.tag.ok { background: #d1fae5; color: #047857; }
.tag.warn { background: #ffedd5; color: #c2410c; }
.tag.mute { background: #f1f5f9; color: #64748b; }

.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.s-present { background: var(--ok); }
.s-absent { background: var(--danger); }
.s-leave { background: var(--warn); }
.s-late { background: #7c3aed; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 14px; border-radius: 12px; border: 0;
  background: var(--navy); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer;
}
.btn.ghost { background: #e8eef6; color: var(--navy); }
.btn.ok { background: var(--ok); }
.btn.warn { background: var(--warn); }
.btn.danger { background: var(--danger); }
.btn.gold { background: linear-gradient(90deg, #b45309, var(--gold)); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 10px; font-size: 12px; border-radius: 10px; }
.icon-round {
  width: 44px; height: 44px; border-radius: 14px; border: 0;
  background: #e8eef6; color: var(--navy); display: grid; place-items: center; cursor: pointer;
}
.icon-round.call { background: #dcfce7; color: #166534; }

.search {
  width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid var(--line);
  padding: 0 14px; background: #fff; font-size: 15px; outline: none;
}
.search:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(3,105,161,.12); }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

.timeline { position: relative; padding-left: 18px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: #dbeafe;
}
.t-item { position: relative; padding: 0 0 14px 8px; }
.t-item::before {
  content: ""; position: absolute; left: -16px; top: 8px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px #dbeafe;
}
.t-time { font-size: 12px; color: var(--blue); font-weight: 700; }
.t-title { font-size: 14px; font-weight: 700; margin: 2px 0; }
.agenda-card {
  background: #fff; border-radius: 16px; padding: 12px; margin-bottom: 10px;
  border: 1px solid var(--line);
}
.agenda-card .when { font-size: 12px; color: var(--blue); font-weight: 700; }
.check-item {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  border-bottom: 1px solid var(--line);
}
.check-item input { width: 20px; height: 20px; accent-color: var(--navy); }

.tabbar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(430px, 100%);
  height: var(--tab-h);
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  z-index: 30;
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 11px; color: #94a3b8; min-height: 44px;
}
.tabbar a.active { color: var(--navy); font-weight: 700; }
.tabbar svg { width: 22px; height: 22px; }

.login-wrap {
  min-height: 100dvh; display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(165deg, #071f3c 0%, #0b3a6a 46%, #0369a1 100%);
  color: #fff; padding: 24px 20px 28px;
}
.login-mark { font-size: 12px; letter-spacing: .28em; color: var(--gold-2); }
.login-wrap h1 { font-size: 28px; margin: 8px 0 4px; }
.login-card {
  background: #fff; color: var(--ink); border-radius: 22px; padding: 18px;
  margin-top: 28px; box-shadow: var(--shadow);
}
.quick-users { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.quick-users button { min-height: 34px; }

.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.more-item {
  background: #fff; border-radius: 16px; padding: 16px 14px; min-height: 96px;
  box-shadow: var(--shadow);
}
.more-item strong { display: block; margin: 8px 0 4px; font-size: 15px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 12px); transform: translateX(-50%);
  background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 13px; display: none; z-index: 50; white-space: nowrap;
}
.empty { text-align: center; color: var(--muted); padding: 28px 8px; }
.progress-ring { font-variant-numeric: tabular-nums; }
.warn-banner {
  background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa;
  border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 10px;
}
.ok-banner { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; border-radius: 12px; padding: 10px 12px; }
.modal-bg {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; z-index: 40;
  align-items: flex-end; justify-content: center;
}
.modal-bg.show { display: flex; }
.sheet {
  width: min(430px, 100%); background: #fff; border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
}
@media (min-width: 860px) {
  body { padding: 24px 0; }
  .app-shell { min-height: calc(100dvh - 48px); border-radius: 28px; overflow: hidden; }
}
textarea.search { min-height: 88px; padding: 10px 14px; resize: vertical; }
