:root {
  --bg: #0b0f1a;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --text: #e8ecf4;
  --muted: #8b94a8;
  --primary: #7c8cff;
  --primary-2: #a78bfa;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --info: #60a5fa;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 300px at 15% -5%, rgba(124, 140, 255, .22), transparent 70%),
    radial-gradient(500px 300px at 95% 10%, rgba(167, 139, 250, .16), transparent 70%);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.3; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, Consolas, monospace; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px max(16px, env(safe-area-inset-left));
  background: rgba(11, 15, 26, .75); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-logo {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
#topnav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
#topnav a {
  color: var(--muted); padding: 5px 10px; border-radius: 8px; font-size: 14px; position: relative;
}
#topnav a.active, #topnav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; text-align: center;
}

.container { max-width: 980px; margin: 0 auto; padding: 20px 16px 60px; }
.loading { text-align: center; color: var(--muted); padding: 60px 0; }

/* 卡片 */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px;
}
.card.error { border-color: rgba(248, 113, 113, .4); color: var(--bad); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }

.hero { text-align: center; padding: 36px 0 24px; }
.hero h1 { font-size: 28px; background: linear-gradient(90deg, #fff, #c7cdff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .logo { font-size: 44px; margin-bottom: 8px; }
.hero .sub { color: var(--muted); margin: 0; }
.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }

/* 表单 */
input, select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; font: inherit; color: var(--text);
  background: rgba(0, 0, 0, .25); border: 1px solid var(--border); outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
textarea { min-height: 80px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); }
label > input, label > select, label > textarea { margin-top: 4px; }
.row { display: flex; gap: 10px; }
.row > input { flex: 1; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.span-all { grid-column: 1 / -1; }
.checkbox { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.checkbox input { width: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform .05s, filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.15); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-color: transparent; color: #fff; }
.btn.danger { color: var(--bad); border-color: rgba(248, 113, 113, .35); background: rgba(248, 113, 113, .08); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.ghost { background: transparent; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.actions.end { justify-content: flex-end; }

/* 状态标签 */
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; border: 1px solid currentColor; white-space: nowrap;
}
.chip.ok { color: var(--ok); background: rgba(52, 211, 153, .08); }
.chip.warn { color: var(--warn); background: rgba(251, 191, 36, .08); }
.chip.bad { color: var(--bad); background: rgba(248, 113, 113, .08); }
.chip.info { color: var(--info); background: rgba(96, 165, 250, .08); }
.chip.muted { color: var(--muted); }
.tag { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 6px; background: var(--primary); color: #fff; margin-left: 4px; vertical-align: middle; }

/* 车队头部 */
.team-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.team-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.team-title h1 { margin: 0; font-size: 24px; }
.days-big { text-align: right; }
.days-big b { font-size: 34px; line-height: 1; }
.days-big.ok b { color: var(--ok); } .days-big.warn b { color: var(--warn); } .days-big.bad b { color: var(--bad); }
.dates { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 14px; }
.dates div span { display: block; font-size: 12px; color: var(--muted); }
.dates div b { font-size: 16px; }

.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--primary); transition: width .4s; }
.bar > i.ok { background: linear-gradient(90deg, #10b981, #34d399); }
.bar > i.warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar > i.bad { background: linear-gradient(90deg, #ef4444, #f87171); }
.bar > i.period { background: linear-gradient(90deg, var(--primary), var(--primary-2)); }

.notice {
  border-left: 3px solid var(--warn); background: rgba(251, 191, 36, .07);
  padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; white-space: pre-wrap;
}
.notice.global { border-color: var(--info); background: rgba(96, 165, 250, .07); }

/* 席位 */
.seats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.seat { padding: 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); }
.seat.me { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.seat.empty { border-style: dashed; background: transparent; }
.seat-role { font-size: 12px; font-weight: 700; letter-spacing: .5px; margin-bottom: 6px; }
.role-owner { color: #f472b6; } .role-admin { color: var(--warn); } .role-member { color: var(--info); }
.seat-name { font-weight: 600; font-size: 16px; }
.seat-email { color: var(--muted); font-size: 13px; word-break: break-all; }
.seat-meta { color: var(--muted); font-size: 12px; margin-top: 6px; }
.seat-meta span { display: block; white-space: nowrap; }

/* 余量 */
.quotas { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.quota-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.quota-head span:first-child { font-weight: 600; }
.quota-meta { font-size: 12px; margin-top: 4px; min-height: 18px; }

/* 列表与表格 */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { padding: 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); }
.item-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.item-body { white-space: pre-wrap; word-break: break-word; }
.reply { margin-top: 8px; padding: 8px 12px; border-radius: 8px; background: rgba(52, 211, 153, .07); border-left: 3px solid var(--ok); white-space: pre-wrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
td input, td select { padding: 6px 8px; min-width: 70px; }
td input[type=number] { width: 90px; }
td select { min-width: 96px; }
#product-rows input[name=description] { min-width: 220px; }
td input[type=datetime-local] { width: 190px; }

/* 统计 */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(6, 1fr); margin-bottom: 16px; }
a.stat { color: var(--text); }
a.stat:hover { text-decoration: none; border-color: var(--primary); }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* 首页按钮 */
.cta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.btn.big { padding: 14px 18px; font-size: 16px; border-radius: 12px; }

/* 套餐选择 */
.products { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.product { position: relative; display: block; cursor: pointer; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); }
.product input { position: absolute; opacity: 0; pointer-events: none; }
.product:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; background: rgba(124, 140, 255, .1); }
.product b { display: block; font-size: 15px; }
.product .price { color: var(--primary); font-weight: 700; font-size: 18px; margin-top: 4px; }
.product .desc { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.group-title { font-size: 13px; color: var(--muted); margin: 14px 0 8px; font-weight: 600; }
.terms { white-space: pre-wrap; font-size: 13px; color: var(--muted); background: rgba(0, 0, 0, .2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; max-height: 220px; overflow: auto; }

/* 时间线 */
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 14px 6px; }
.timeline li::before { content: ''; position: absolute; left: -25px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--bg); }
.timeline li:last-child { padding-bottom: 0; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 8px; }
.guide { padding: 14px; border-radius: 12px; background: rgba(96, 165, 250, .08); border: 1px solid rgba(96, 165, 250, .3); margin-bottom: 12px; }
.stat { padding: 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border); }
.stat span { display: block; color: var(--muted); font-size: 12.5px; }
.stat b { font-size: 26px; }
.stat.ok b { color: var(--ok); } .stat.warn b { color: var(--warn); } .stat.bad b { color: var(--bad); } .stat.info b { color: var(--info); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters button {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: transparent;
  color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer;
}
.filters button.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.team-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.team-card { display: block; color: var(--text); padding: 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--border); transition: border-color .15s, transform .15s; }
.team-card:hover { text-decoration: none; border-color: var(--primary); transform: translateY(-2px); }
.team-card .tc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.team-card .tc-head b { font-size: 16px; }
.team-card .tc-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 8px; }
.dots { display: flex; gap: 4px; margin-top: 8px; }
.dots i { width: 22px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .12); }
.dots i.on { background: var(--primary); }

.seat-form { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin: 0 0 12px; background: rgba(0, 0, 0, .12); }
.seat-form-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; flex-wrap: wrap; }
fieldset.seat-form { min-width: 0; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  padding: 10px 18px; border-radius: 10px; background: #1f2937; border: 1px solid var(--border);
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 100; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: var(--ok); } .toast.bad { border-color: var(--bad); color: #fecaca; }

.foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 28px; }
.empty-state { text-align: center; color: var(--muted); padding: 30px 0; }
details summary { cursor: pointer; color: var(--muted); }

@media (max-width: 600px) {
  .container { padding: 14px 12px 50px; }
  .hero { padding: 22px 0 14px; }
  .hero h1 { font-size: 23px; }
  .row { flex-direction: column; }
  .days-big { text-align: left; }
  .team-title h1 { font-size: 20px; }
  .brand span:last-child { display: none; }
}
