﻿:root {
  --bg: #0f1115;
  --card: #171a21;
  --muted: #8b94a7;
  --text: #e6e8ec;
  --accent: #3b82f6;
  --accent-2: #22c55e;
  --border: #2a2f3a;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  background: rgba(15,17,21,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { font-size: 20px; }
.title { font-weight: 700; letter-spacing: .2px; }

.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search input {
  width: clamp(200px, 28vw, 420px);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}
.filters { display: flex; align-items: center; gap: 8px; }
.filters select, .filters label {
  font-size: 14px;
}
.filters select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}
.tz-switch { display: flex; gap: 12px; padding-left: 6px; border-left: 1px solid var(--border); }
.tz-switch input { accent-color: var(--accent); }

.date-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.date-tabs button {
  appearance: none; border: none; cursor: pointer;
  padding: 8px 12px; border-radius: 999px;
  background: var(--card); color: var(--text);
  transition: background .2s ease, color .2s ease;
  scroll-snap-align: start;
}
.date-tabs button.active { background: var(--accent); color: #fff; }

.events { padding: 16px; max-width: 1100px; margin: 0 auto; }
.day-group { margin-bottom: 24px; }
.day-group .day-title { font-weight: 600; margin: 10px 0 14px; color: var(--muted); }

.event-card {
  display: grid;
  grid-template-columns: 90px 1fr 240px;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.event-card + .event-card { margin-top: 8px; }

.event-card:hover { background: #1e232b; border-color: #39404c; box-shadow: 0 4px 12px rgba(0,0,0,0.25); }

.time { font-weight: 600; color: var(--text); }
.match { display: flex; flex-direction: column; gap: 6px; }
.teams { font-weight: 600; }
.meta { color: var(--muted); font-size: 13px; }

.live-dot {
  display: inline-block;
  width: 10px; height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239,68,68,0.7);
  animation: pulse 1.6s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.6); opacity: 1; }
  50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); opacity: 0.85; }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); opacity: 1; }
}

.right { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.tag {
  font-size: 12px; padding: 6px 8px; border-radius: 999px; border: 1px solid var(--border);
  background: #12151b; color: var(--text);
}
.tag.accent { background: var(--accent); color: white; border-color: transparent; }
.tag.good { background: var(--accent-2); color: white; border-color: transparent; }

/* 频道链接美化：去下划线与悬停背景色 */
a.tag { text-decoration: none; transition: background .2s ease, color .2s ease, box-shadow .2s ease; }
a.tag:hover { background: #1b1f27; }
a.tag.accent:hover { filter: brightness(0.95); }
.tag.accent { background: var(--accent); color: white; border-color: transparent; }
.tag.good { background: var(--accent-2); color: white; border-color: transparent; }

.site-footer {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 18px 16px; border-top: 1px solid var(--border); color: var(--muted);
}
.site-footer a { color: var(--text); }

@media (max-width: 860px) {
  .actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .search input { width: 100%; }
  .filters { flex-wrap: wrap; gap: 8px; }
  .filters select { flex: 1 1 160px; min-width: 140px; }
  .tz-switch { width: 100%; border-left: none; border-top: 1px solid var(--border); padding-left: 0; padding-top: 8px; margin-top: 4px; }
  .date-tabs { padding: 10px 12px; }
  .date-tabs button { padding: 8px 10px; }
  .events { padding: 12px; }
  .event-card { grid-template-columns: 70px 1fr; }
  .right { justify-content: flex-start; grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .event-card { grid-template-columns: 1fr; cursor: pointer; }
  .time { font-weight: 600; margin-bottom: 6px; }
  .right { justify-content: flex-start; gap: 6px; }
  .tag { font-size: 11px; padding: 5px 7px; }
}

@media (min-width: 1280px) {
  .events { max-width: 1200px; }
}

@media (prefers-reduced-motion: reduce) {
  .date-tabs button { transition: none; }
  .live-dot { animation: none; }
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f7fb;
    --card: #fff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --accent: #2563eb;
    --accent-2: #16a34a;
  }
  .topbar { background: rgba(255,255,255,0.8); }
  .tag { background: #f3f4f6; }
  a.tag:hover { background: #e9ecf2; }
  .event-card:hover { background: #eef2f7; border-color: #d7dce5; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
}
