:root {
  --bg: #0b0c0e;
  --surface: #15161a;
  --surface-2: #1b1d22;
  --line: #26282f;
  --text: #e9ebef;
  --muted: #8b909a;
  --accent: #6b8afd;
  --ok: #4cc38a;
  --warn: #e0a33e;
  --bad: #e5675f;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
.screen { padding: 18px 16px 8px; max-width: 560px; margin: 0 auto; }
.hidden { display: none !important; }

/* 顶部 */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.brand { font-size: 17px; font-weight: 600; letter-spacing: .2px; }
.brand small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.icon-btn { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; font-size: 13px; color: var(--muted); }

/* 账号 */
.accounts { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; scrollbar-width: none; }
.accounts::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font-size: 13px; white-space: nowrap;
}
.chip.active { color: #fff; border-color: var(--accent); background: rgba(107,138,253,.14); }

/* 卡片 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; margin-bottom: 12px; }
.card-title { font-size: 12px; color: var(--muted); letter-spacing: .3px; margin-bottom: 8px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.big { font-size: 22px; font-weight: 600; letter-spacing: .3px; }
.sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.mono { font-variant-numeric: tabular-nums; }

/* 操作 */
.actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 4px 0 16px; }
.action {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; text-align: left; font-size: 14px;
}
.action b { display: block; font-weight: 600; margin-bottom: 2px; }
.action span { color: var(--muted); font-size: 12px; }
.action:active { background: var(--surface-2); }

.btn { border: 0; border-radius: 11px; padding: 11px 16px; font-size: 14px; font-weight: 500; background: var(--surface-2); color: var(--text); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.danger { background: rgba(229,103,95,.15); color: var(--bad); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn:disabled { opacity: .5; }

/* 列表 */
.list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .name { font-weight: 500; }
.item .meta { color: var(--muted); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.dot.g { background: var(--ok); }
.dot.r { background: var(--bad); }
.dot.m { background: #6b7280; }
.dot.b { background: var(--accent); }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

/* 日期条 */
.dates { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.dates::-webkit-scrollbar { display: none; }
.date { flex: 0 0 auto; min-width: 54px; text-align: center; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.date b { display: block; font-size: 15px; }
.date span { font-size: 11px; color: var(--muted); }
.date.active { border-color: var(--accent); background: rgba(107,138,253,.14); }

/* 底部导航 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex;
  background: rgba(15,16,19,.92); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tab { flex: 1; text-align: center; padding: 11px 0 12px; color: var(--muted); font-size: 11px; }
.tab b { display: block; font-size: 15px; margin-bottom: 3px; font-weight: 500; }
.tab.active { color: var(--text); }

/* 登录 */
.login { display: flex; flex-direction: column; justify-content: center; min-height: 78vh; }
.login h1 { font-size: 24px; margin: 0 0 6px; letter-spacing: .3px; }
.login p { color: var(--muted); margin: 0 0 26px; font-size: 13px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 16px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }

/* 抽屉 */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; z-index: 50; }
.sheet { width: 100%; background: var(--surface); border-radius: 18px 18px 0 0; padding: 18px 16px calc(22px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }
.sheet h3 { margin: 0 0 4px; font-size: 16px; }
.sheet .sub { margin-bottom: 16px; }
.sheet .btn { width: 100%; margin-top: 8px; padding: 13px; }

/* 提示 */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(78px + env(safe-area-inset-bottom));
  background: #2a2d34; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px;
  max-width: 86vw; z-index: 80; opacity: 0; transition: opacity .18s;
}
.toast.show { opacity: 1; }
.empty { color: var(--muted); text-align: center; padding: 26px 0; font-size: 13px; }

/* 琴房平面图：x=1..4 从左到右，y 越大越靠上 */
.plan { margin: 2px 0 16px; }
.plan-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.plan-row.gap { margin-bottom: 18px; }
.plan-row:last-child { margin-bottom: 0; }
.plan-cell {
  aspect-ratio: 1 / 1; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; font-size: 14px; font-variant-numeric: tabular-nums;
}
.plan-cell .dot { width: 7px; height: 7px; }
.plan-cell:active { background: var(--surface-2); }
.plan-cell.in_use { border-color: rgba(229,103,95,.45); }
.plan-cell .n { line-height: 1; }
.plan-empty { aspect-ratio: 1 / 1; }
.plan-note { color: var(--muted); font-size: 12px; margin: 14px 0 8px; }
