:root {
  --primary: #6366f1;
  --primary-2: #7c3aed;
  --ok: #22c55e;
  --err: #ef4444;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.22), transparent 35%),
    radial-gradient(circle at 90% 10%, rgba(236, 72, 153, 0.20), transparent 35%),
    linear-gradient(140deg, #0b1020, #141b34 45%, #1b1640);
  color: #e8ecff;
  min-height: 100vh;
}

.bg-bubbles::before,
.bg-bubbles::after {
  content: "";
  position: fixed;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  z-index: -1;
  opacity: 0.25;
  filter: blur(2px);
  animation: float 8s ease-in-out infinite;
}
.bg-bubbles::before { background: #93c5fd; top: 12%; left: 8%; }
.bg-bubbles::after { background: #f9a8d4; bottom: 10%; right: 8%; animation-delay: 2s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.main-header {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.main-header h1 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: .4px;
  color: #dbe7ff;
}
.main-header nav {
  display: flex;
  align-items: center;
}
.main-header nav a {
  margin-left: 10px;
  text-decoration: none;
  color: #9fb7ff;
  font-weight: 700;
  font-size: .9rem;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 10px;
}

.card {
  background: rgba(18, 24, 46, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 12px 34px rgba(4, 8, 20, 0.45);
  backdrop-filter: blur(10px);
}
.narrow { max-width: 560px; margin: 0 auto; }

.grid-2 {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.home-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hero-minimal { padding: 14px; }
.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.chip-live {
  font-size: .75rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(239, 68, 68, .2);
  color: #fecaca;
  font-weight: 700;
}
.round-mini {
  font-weight: 800;
  color: #a5b4fc;
}

.live-pick {
  background: linear-gradient(120deg, rgba(59,130,246,.18), rgba(236,72,153,.16));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  padding: 12px;
}
.pick-label { font-size: .75rem; color: #93c5fd; }
.live-name {
  font-size: clamp(1.5rem, 7vw, 2.1rem);
  font-weight: 900;
  line-height: 1.2;
  margin-top: 2px;
}
.pick-meta { margin-top: 4px; color: #cbd5e1; font-size: .9rem; }
.chips-wrap { margin-top: 10px; }

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.mini-action,
.mini-stat {
  background: rgba(15, 23, 42, .45);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  text-decoration: none;
  color: #e2e8f0;
}
.mini-action span,
.mini-stat span { display: block; font-size: 1.1rem; }
.mini-action em { font-style: normal; font-size: .85rem; }
.mini-stat strong { font-size: 1.1rem; }

.toolbar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.toolbar-grid form { margin: 0; }
.toolbar-grid .btn,
.toolbar-grid .row,
.toolbar-grid form button,
.toolbar-grid a.btn { width: 100%; }

.btn {
  border: none;
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn.ghost {
  background: rgba(148, 163, 184, .2);
  color: #e2e8f0;
}
.pulse { animation: pulse 1.2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(99,102,241,0.5); }
  70% { box-shadow: 0 0 0 12px rgba(99,102,241,0); }
  100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); }
}

.form-col, .actions-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

input[type=text],
input[type=password],
input[type=number],
input[type=file],
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  background: rgba(15,23,42,.5);
  color: #e2e8f0;
}
input::placeholder,
textarea::placeholder { color: #94a3b8; }

.checkbox-list {
  max-height: 260px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px dashed rgba(255,255,255,.2);
  border-radius: 10px;
}

.result-box {
  margin-top: 12px;
  background: rgba(15,23,42,.35);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  padding: 10px;
  min-height: 48px;
}
.group {
  border-left: 3px solid #818cf8;
  padding-left: 8px;
  margin-bottom: 8px;
}
.list {
  margin: 10px 0 0;
  padding-left: 18px;
  max-height: 320px;
  overflow: auto;
}

.feed-head { display: flex; justify-content: space-between; align-items: center; }
.feed-head h3 { margin: 0 0 6px; font-size: .95rem; color: #c7d2fe; }
.stream-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  overflow: auto;
}
.stream-item {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(15,23,42,.35);
  border-radius: 10px;
  padding: 8px 10px;
}
.stream-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.stream-icon { opacity: .9; }
.stream-class { color: #93c5fd; font-size: .82rem; }
.stream-sub { margin-top: 4px; font-size: .75rem; color: #94a3b8; }
.stream-extra { margin-top: 6px; color: #e2e8f0; font-size: .85rem; line-height: 1.35; }

.flash-wrap { margin-bottom: 10px; }
.flash {
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 8px;
}
.flash.success { background: rgba(34,197,94,.2); color: #bbf7d0; }
.flash.error { background: rgba(239,68,68,.2); color: #fecaca; }
.success { color: #86efac; }
.error { color: #fca5a5; }
.hint { color: #94a3b8; }
.mt-16 { margin-top: 16px; }

.name-highlight {
  font-weight: 800;
  color: #c4b5fd;
  background: rgba(76, 29, 149, .35);
  padding: 1px 6px;
  border-radius: 8px;
}

.tag {
  display: inline-block;
  margin: 4px 6px 0 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, .18);
  color: #bfdbfe;
  font-weight: 700;
  font-size: 0.82rem;
}

.quick-stats { display:none; }

.seat-grid {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.podium {
  text-align: center;
  font-weight: 800;
  margin-top: 2px;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: linear-gradient(120deg, rgba(234,179,8,.25), rgba(249,115,22,.2));
  color: #fde68a;
  border: 1px solid rgba(250,204,21,.3);
}

.seat-card {
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(15,23,42,.35);
  border-radius: 10px;
  padding: 6px;
  min-height: 86px;
}
.seat-card.empty { opacity: .35; }
.seat-card.me {
  border-color: rgba(99,102,241,.9);
  box-shadow: 0 0 0 1px rgba(99,102,241,.35) inset;
  background: rgba(99,102,241,.18);
}
.seat-no { font-size: .75rem; color: #a5b4fc; font-weight: 800; }
.seat-name {
  margin-top: 2px;
  font-size: .9rem;
  font-weight: 800;
  color: #e2e8f0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}
.seat-meta {
  margin-top: 2px;
  font-size: .72rem;
  color: #93c5fd;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

/* 列数过多时：自动增高信息框（不再强制缩小字体） */
.seat-grid.dense-cols .seat-card {
  min-height: 120px;
  height: auto;
  padding: 8px 6px;
}
.seat-grid.dense-cols .seat-no,
.seat-grid.dense-cols .seat-name,
.seat-grid.dense-cols .seat-meta {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  white-space: normal;
  overflow-wrap: anywhere;
  overflow: visible;
  text-overflow: clip;
  margin-top: 2px;
}
.seat-grid.dense-cols .seat-name {
  font-size: .88rem;
}
.seat-grid.dense-cols .seat-meta {
  font-size: .7rem;
  color: #bfdbfe;
}
.seat-grid.dense-cols .seat-no {
  font-size: .74rem;
  color: #c7d2fe;
}

@media (max-width: 640px) {
  .bg-bubbles { display: none; }
  .main-header { padding: 10px 12px; }
  .main-header h1 { font-size: .92rem; }
  .main-header nav a { margin-left: 8px; font-size: .82rem; }
  .container { padding: 10px; }
  .card { padding: 12px; border-radius: 14px; }
  .quick-grid { grid-template-columns: 1fr 1fr 1fr; }
  .toolbar-grid { grid-template-columns: 1fr; }
  .stream-list { max-height: 56vh; }
  .seat-card { min-height: 88px; padding: 6px; }
  .seat-name { font-size: .82rem; }
  .seat-meta { font-size: .66rem; }

  .seat-grid.dense-cols .seat-card {
    min-height: 132px;
    padding: 6px 4px;
  }
  .seat-grid.dense-cols .seat-name { font-size: .78rem; }
  .seat-grid.dense-cols .seat-meta { font-size: .62rem; }
}

@keyframes popGlow {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(251,191,36,0); }
  30% { transform: scale(1.06) rotate(-1deg); box-shadow: 0 0 28px rgba(251,191,36,.55); }
  60% { transform: scale(1.03) rotate(1deg); box-shadow: 0 0 20px rgba(236,72,153,.45); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(251,191,36,0); }
}

@keyframes neonBlink {
  0%, 100% { border-color: rgba(251,191,36,.95); box-shadow: 0 0 8px rgba(251,191,36,.6); }
  50% { border-color: rgba(236,72,153,.95); box-shadow: 0 0 16px rgba(236,72,153,.7); }
}

@keyframes textSpark {
  0%, 100% { text-shadow: 0 0 0 rgba(251,191,36,0); }
  50% { text-shadow: 0 0 12px rgba(251,191,36,.9), 0 0 18px rgba(236,72,153,.6); }
}

.live-pick.picked-pop {
  animation: popGlow 1.2s ease;
}

.animate-picked {
  animation: textSpark 1s ease-in-out infinite;
}

.seat-card.picked-blink {
  animation: neonBlink .9s infinite;
  background: linear-gradient(120deg, rgba(251,191,36,.22), rgba(236,72,153,.2));
}
