:root {
  --bg: #0b0f14;
  --bg-card: #121922;
  --border: #1e2a38;
  --text: #e8eef6;
  --muted: #8b9bb0;
  --accent: #3d8bfd;
  --accent-2: #22c55e;
  --danger: #f87171;
  --radius: 14px;
  --font: "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 10% -10%, #1a2a44 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #13261f 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 18px 48px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 13px;
}

.header h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
}

.sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.header-meta {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: right;
  line-height: 1.5;
}

.card {
  background: color-mix(in srgb, var(--bg-card) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

.hidden {
  display: none !important;
}

.field-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.catalog-card,
.schedule-card {
  padding-bottom: 12px;
}

.schedule {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sch-tour {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0a1018;
  overflow: hidden;
}

.sch-tour-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #121a26;
}

.sch-tour-title {
  font-weight: 700;
  font-size: 0.92rem;
}

.sch-tour-range {
  color: var(--muted);
  font-size: 0.75rem;
}

.sch-list {
  display: flex;
  flex-direction: column;
}

.sch-match {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  cursor: pointer;
  background: transparent;
  width: 100%;
  text-align: left;
  color: inherit;
  min-height: auto;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
}

.sch-match:last-child {
  border-bottom: none;
}

.sch-match:hover {
  background: #121a26;
  transform: none;
}

.sch-match.active {
  background: color-mix(in srgb, #1d4ed8 18%, #0a1018);
}

.sch-time {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.sch-teams {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.sch-team {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 650;
}

.sch-team img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
  background: #0b0f14;
}

.sch-score {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: #c6d4e6;
  font-size: 0.9rem;
  min-width: 1.2em;
  text-align: right;
}

.sch-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.sch-state {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  border-radius: 6px;
  padding: 2px 6px;
}

.sch-state.live {
  background: #ef4444;
  color: #fff;
}

.sch-state.soon {
  background: rgba(61, 139, 253, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(61, 139, 253, 0.35);
}

.sch-state.done {
  background: #182231;
  color: var(--muted);
  border: 1px solid var(--border);
}

.sch-bo {
  font-size: 0.72rem;
  color: var(--muted);
}

.hupu-panel {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0a1018;
  padding: 12px;
}

.hupu-panel h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.hupu-msg {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 0 0 8px;
}

.hupu-players {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.hupu-player {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  background: #121a26;
}

.hupu-player .name {
  font-size: 0.8rem;
  font-weight: 650;
}

.hupu-player .score {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fbbf24;
  margin-top: 2px;
}

.hupu-player .team {
  font-size: 0.7rem;
  color: var(--muted);
}

.hupu-comments {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hupu-comment {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.hupu-comment .meta {
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 2px;
}

.hupu-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent);
  font-size: 0.82rem;
}

.catalog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.catalog-head .ghost {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.catalog-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.catalog {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cat-group-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #dbe7f5;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}

.cat-card {
  position: relative;
  border: 1px solid var(--border);
  background: #0a1018;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
  min-height: auto;
  width: 100%;
  color: inherit;
  transition: border-color 0.12s ease, transform 0.12s ease, opacity 0.12s ease;
}

.cat-card:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  transform: translateY(-2px);
}

.cat-card.offline {
  opacity: 0.72;
}

.cat-card.offline:hover {
  opacity: 0.9;
}

.cat-card.active {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35);
}

.cat-cover {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: linear-gradient(135deg, #1a2740, #0f1724);
}

.cat-cover.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.cat-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  border-radius: 6px;
  padding: 2px 6px;
  line-height: 1.3;
}

.cat-badge.live {
  background: #ef4444;
  color: #fff;
}

.cat-badge.off {
  background: rgba(15, 23, 36, 0.82);
  color: #cbd5e1;
  border: 1px solid var(--border);
}

.cat-badge.replay {
  background: rgba(245, 158, 11, 0.9);
  color: #111;
}

.cat-plat {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(15, 23, 36, 0.78);
  border: 1px solid var(--border);
  color: #c6d4e6;
  border-radius: 6px;
  padding: 2px 6px;
}

.cat-body {
  padding: 8px 9px 10px;
}

.cat-role {
  font-size: 0.68rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 2px;
}

.cat-title {
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.2em;
}

.cat-author {
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.preset-btn {
  border: 1px solid var(--border);
  background: #182231;
  color: #c6d4e6;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  min-height: auto;
  white-space: nowrap;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease;
}

.preset-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  transform: translateY(-1px);
}

.preset-btn.active {
  background: linear-gradient(135deg, #1d4ed8, #0e7490);
  border-color: transparent;
  color: #fff;
}

.preset-btn .badge {
  opacity: 0.75;
  font-weight: 500;
  margin-left: 4px;
  font-size: 0.75rem;
}

.field-label.tight {
  margin-top: 12px;
}

.row {
  display: flex;
  gap: 10px;
}

input[type="url"],
input[type="password"],
input[type="text"] {
  width: 100%;
  border: 1px solid var(--border);
  background: #0a1018;
  color: var(--text);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.98rem;
  outline: none;
}

input:focus {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--border));
  box-shadow: 0 0 0 3px rgba(61, 139, 253, 0.18);
}

button {
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  font-weight: 600;
  padding: 0 18px;
  cursor: pointer;
  white-space: nowrap;
  min-height: 46px;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

button.ghost {
  background: #182231;
  border: 1px solid var(--border);
}

button.active {
  background: linear-gradient(135deg, #16a34a, #15803d);
}

.options {
  margin-top: 14px;
}

.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.check input {
  margin-top: 3px;
}

.meta h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  line-height: 1.35;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tag {
  font-size: 0.8rem;
  color: #c6d4e6;
  background: #182231;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
}

.qualities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.copy-row {
  margin-bottom: 14px;
}

.copy-row input[readonly] {
  font-size: 0.82rem;
  color: #c6d4e6;
}

.player-wrap {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

video {
  width: 100%;
  display: block;
  max-height: 480px;
  background: #000;
}

.hint {
  margin: 0;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.85rem;
  background: #0a1018;
}

.error {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 10px;
  padding: 12px 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.footer {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
  padding: 8px 4px;
}

.footer strong {
  color: #cbd5e1;
}

@media (max-width: 640px) {
  .header {
    flex-direction: column;
  }

  .header-meta {
    text-align: left;
  }

  .row {
    flex-direction: column;
  }

  button {
    width: 100%;
    min-height: 44px;
  }
}
