/* 简读 · Liquid Glass
 * Visual language: Kyant0/AndroidLiquidGlass (backdrop blur + vibrancy + lens rim)
 * Motion craft: Emil Kowalski (ease-out, press scale, no transition:all, hover MQ)
 */
:root {
  --bg-0: #04060d;
  --bg-1: #0a1020;
  --text: #f8faff;
  --text-secondary: rgba(236, 242, 255, 0.88);
  --text-tertiary: rgba(220, 230, 248, 0.78);
  --accent: #7eb6ff;
  --accent-2: #9b8cff;
  --accent-ink: #07101f;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --gold: #f0c14d;

  --glass-bg: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(255, 255, 255, 0.06) 42%,
    rgba(255, 255, 255, 0.03) 100%
  );
  --glass-bg-strong: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.08) 45%,
    rgba(255, 255, 255, 0.04) 100%
  );
  --glass-fill: rgba(18, 24, 40, 0.42);
  --glass-fill-deep: rgba(8, 12, 22, 0.55);
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.22);
  --rim: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.62) 0%,
    rgba(255, 255, 255, 0.18) 28%,
    rgba(255, 255, 255, 0.04) 52%,
    rgba(180, 210, 255, 0.22) 100%
  );
  --shadow-glass:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 -1px 0 rgba(0, 0, 0, 0.22) inset,
    0 10px 30px rgba(0, 0, 0, 0.28),
    0 2px 8px rgba(0, 0, 0, 0.18);
  --shadow-float:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 -8px 24px rgba(0, 0, 0, 0.18) inset,
    0 18px 50px rgba(0, 0, 0, 0.35);

  --blur: 28px;
  --blur-sm: 16px;
  --sat: 165%;
  --radius: 22px;
  --radius-sm: 16px;
  --radius-xs: 12px;
  --capsule: 999px;
  --ring: 0 0 0 3px rgba(126, 182, 255, 0.28);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-out-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.22, 1.2, 0.36, 1);
  --dur-fast: 140ms;
  --dur: 180ms;
  --dur-enter: 200ms;
  --dur-exit: 140ms;

  /* Reading body: NSimSun. Small UI chrome uses --font-ui. */
  --font: "NSimSun", "新宋体", "SimSun", "宋体", "Songti SC", serif;
  --font-ui: "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "SF Mono", ui-monospace, Consolas, monospace;
  --shell: 1080px;

}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-0);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  /* Song typeface + antialiased is blurrier on Windows; use ClearType */
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
  overflow-x: hidden;
}

/* Clear UI face for chrome / small labels */
.font-ui,
.topbar,
.tabs,
.tab,
.btn,
.chip,
.seg,
.seg-btn,
.field-label,
.quota-badge,
.cache-note,
.status-chip,
.hot-meta,
.hot-link-hint,
.brief-top,
.brief-meta,
.brief-type,
.clock,
.topbar-meta,
.weather-mini,
.weather-popover,
.weather-day,
.weather-hour,
.weather-stat,
.surface-head h2,
.brand-title,
.brand-copy,
.empty,
.error-box,
.loading,
.placeholder,
.rank-table th,
.match-meta,
.almanac-meta,
.gold-meta,
.train-meta,
.hint,
.badge {
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea {
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  /* size/weight inherit; face stays UI sans for legibility at control sizes */
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
}

button {
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
}

/* ===== Ambient stage (content for glass to "refract") ===== */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  transform: translateZ(0);
  background:
    radial-gradient(1100px 620px at 12% -12%, rgba(64, 120, 255, 0.14), transparent 52%),
    radial-gradient(820px 520px at 92% 0%, rgba(168, 85, 247, 0.10), transparent 48%),
    linear-gradient(180deg, #07101f 0%, #05070f 38%, #04060d 100%);
}

/* Bing daily wallpaper — https://uapis.cn/api/v1/image/bing-daily */
.ambient-photo {
  position: absolute;
  inset: -2%;
  background-color: #0a1020;
  background-image: url("https://uapis.cn/api/v1/image/bing-daily");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: translateZ(0) scale(1.04);
  filter: saturate(1.08) contrast(1.04);
  opacity: 0;
  transition: opacity 320ms var(--ease-out);
  /* Keep wallpaper on its own layer; list paints shouldn't drop it */
  backface-visibility: hidden;
}

.ambient-photo.is-ready {
  opacity: 1;
}

.ambient-photo.is-fallback {
  /* keep CSS url even if JS preload fails */
  opacity: 1;
}

.ambient-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 8, 18, 0.40) 0%, rgba(4, 8, 18, 0.52) 42%, rgba(4, 6, 12, 0.68) 100%);
  z-index: 1;
}

.ambient .mesh {
  position: absolute;
  /* keep colored wash in the upper stage only — no bottom bloom */
  inset: -18% -12% auto -12%;
  height: 58%;
  z-index: 2;
  background:
    conic-gradient(from 180deg at 50% 40%,
      rgba(96, 165, 250, 0.05),
      rgba(167, 139, 250, 0.06),
      rgba(45, 212, 191, 0.04),
      rgba(251, 146, 60, 0.03),
      rgba(96, 165, 250, 0.05));
  filter: blur(60px) saturate(120%);
  opacity: 0.22;
  animation: mesh-spin 48s linear infinite;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 100%);
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.28;
  will-change: transform;
  mix-blend-mode: screen;
  z-index: 2;
}

.orb-a {
  width: 420px;
  height: 420px;
  left: -120px;
  top: 8%;
  background: radial-gradient(circle at 30% 30%, #60a5fa, #2563eb 55%, transparent 70%);
}

.orb-b {
  width: 360px;
  height: 360px;
  right: -100px;
  top: 18%;
  background: radial-gradient(circle at 40% 40%, #c084fc, #7c3aed 60%, transparent 72%);
}



.noise {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: no-preference) {
  .orb-a { animation: drift-a 22s var(--ease-out-soft) infinite alternate; }
  .orb-b { animation: drift-b 26s var(--ease-out-soft) infinite alternate; }
}

@keyframes mesh-spin {
  from { transform: rotate(0deg) scale(1.05); }
  to { transform: rotate(360deg) scale(1.05); }
}
@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(28px, -24px, 0) scale(1.08); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-22px, 30px, 0) scale(1.06); }
}

/* ===== Shell ===== */
.shell {
  position: relative;
  z-index: 1;
  width: min(100% - 28px, var(--shell));
  margin: 0 auto;
  padding: 22px 0 48px;
}

/* Shared liquid glass recipe
 * IMPORTANT: only a few chrome shells may use real backdrop-filter.
 * List cards (hot/match/brief/history/gold) must NOT ? dozens of blurs
 * sample the full-page Bing wallpaper and make the stage flash / vanish
 * on Cloudflare Pages (GPU compositor thrash).
 */
.liquid-glass,
.surface,
.topbar,
.weather-popover {
  position: relative;
  isolation: isolate;
  background: var(--glass-bg);
  background-color: var(--glass-fill);
  backdrop-filter: blur(var(--blur)) saturate(var(--sat));
  -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--sat));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-glass);
}

.liquid-glass::before,
.surface::before,
.topbar::before,
.weather-popover::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--rim);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
  opacity: 0.9;
}

/* Lightweight list cards: opaque glass look, zero backdrop-filter */
.gold-card,
.match-card,
.hot-item,
.almanac-card,
.history-item,
.brief-item {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(
      155deg,
      rgba(255, 255, 255, 0.14) 0%,
      rgba(255, 255, 255, 0.05) 42%,
      rgba(255, 255, 255, 0.025) 100%
    );
  background-color: rgba(14, 18, 32, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 8px 22px rgba(0, 0, 0, 0.22);
  /* Critical for Pages stability with long lists */
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  /* Offscreen list rows skip paint work */
  content-visibility: auto;
  contain-intrinsic-size: auto 72px;
}

/* Lens-like inner refraction edge (Kyant lens approximation) */
.liquid-glass::after,
.surface::after,
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.28),
    inset 0 -10px 24px rgba(0, 0, 0, 0.12),
    inset 12px 0 18px rgba(140, 190, 255, 0.04),
    inset -12px 0 18px rgba(180, 140, 255, 0.04);
  pointer-events: none;
  z-index: 1;
}

/* ===== Topbar ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  margin-bottom: 14px;
  border-radius: var(--capsule);
  /* visible so weather popover is not clipped; elevated above tabs */
  overflow: visible;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  position: relative;
  z-index: 3;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #dff0ff;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.28), rgba(255,255,255,0.06));
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    0 8px 18px rgba(37, 99, 235, 0.25);
}

.brand-copy {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand-title {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.15;
  background: linear-gradient(180deg, #fff 20%, rgba(220, 235, 255, 0.86));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub { display: none; }

.topbar-meta {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 0;
}

.clock {
  position: relative;
  z-index: 3;
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--capsule);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ===== Weather mini (under clock) ===== */
.weather-mini {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(160deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04));
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(280px, 62vw);
  padding: 6px 10px 6px 8px;
  border-radius: 16px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 6px 16px rgba(0,0,0,0.16);
  transition:
    transform var(--dur-fast) var(--ease-out),
    background-color var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-out);
  text-align: left;
}

.weather-mini:focus-visible {
  outline: none;
  box-shadow: var(--ring), inset 0 1px 0 rgba(255,255,255,0.2);
}

.weather-mini[aria-expanded="true"] {
  border-color: rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(160deg, rgba(255,255,255,0.2), rgba(255,255,255,0.07));
}

.weather-mini[aria-expanded="true"] .weather-mini-chevron {
  transform: rotate(180deg);
}

.weather-mini-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.12);
  overflow: hidden;
}

.weather-mini-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.weather-mini-fallback {
  font-size: 0.95rem;
  line-height: 1;
}

.weather-mini-copy {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.weather-mini-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.weather-mini-temp {
  font-family: var(--mono);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.weather-mini-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.weather-mini-chevron {
  display: grid;
  place-items: center;
  color: rgba(236, 242, 255, 0.72);
  flex: 0 0 auto;
  transition: transform var(--dur) var(--ease-out);
}

.weather-mini.is-error .weather-mini-temp,
.weather-mini.is-error .weather-mini-text {
  color: var(--warn);
}

/* Detail popover */
.weather-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(420px, calc(100vw - 28px));
  max-height: min(72vh, 640px);
  overflow: auto;
  border-radius: 22px;
  padding: 0;
  z-index: 30;
  background: var(--glass-bg);
  background-color: rgba(10, 14, 26, 0.72);
  box-shadow: var(--shadow-float);
  transform-origin: top right;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  /* Exit faster than enter (Emil asymmetric timing) */
  transition:
    opacity var(--dur-exit) var(--ease-out),
    transform var(--dur-exit) var(--ease-out);
}

.weather-popover.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  transition:
    opacity var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out);
}

.weather-popover[hidden] {
  display: none !important;
}

.weather-popover-inner {
  position: relative;
  z-index: 3;
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.weather-loading,
.weather-error {
  padding: 18px 8px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.weather-error {
  color: var(--warn);
}

.weather-location {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 0;
  min-width: 0;
}

.weather-location-pin {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  color: #dcebff;
  background: rgba(126, 182, 255, 0.18);
  border: 1px solid rgba(126, 182, 255, 0.28);
}

.weather-location-text {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.weather-now {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
}

.weather-now-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}

.weather-now-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.weather-now-main {
  min-width: 0;
}

.weather-now-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.weather-now-temp {
  font-family: var(--mono);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #fff;
}

.weather-now-feel {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-tertiary);
}

.weather-now-desc {
  margin-top: 4px;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--text-secondary);
}

.weather-now-meta {
  margin-top: 2px;
  font-size: 0.74rem;
  font-weight: 600;
  color: rgba(220, 230, 248, 0.78);
}

.weather-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.weather-stat {
  padding: 8px 8px 9px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  min-width: 0;
}

.weather-stat-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 650;
  color: rgba(220, 230, 248, 0.72);
  letter-spacing: 0.02em;
  margin-bottom: 3px;
}

.weather-stat-value {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.weather-section-title {
  margin: 2px 2px 0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(230, 238, 255, 0.72);
}

.weather-alarms {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.weather-alarm {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.1);
  color: #ffe7a3;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
}

.weather-days {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.weather-day {
  display: grid;
  grid-template-columns: 64px 28px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
}

.weather-day.is-today {
  background: rgba(126, 182, 255, 0.12);
  border-color: rgba(126, 182, 255, 0.22);
}

.weather-day-date {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.weather-day-week {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

.weather-day-md {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-tertiary);
}

.weather-day-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.weather-day-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.weather-day-temp {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.weather-hours {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(72px, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.weather-hour {
  min-width: 72px;
  padding: 8px 8px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}

.weather-hour-time {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.weather-hour-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  margin: 0 auto 4px;
  display: block;
}

.weather-hour-temp {
  display: block;
  font-family: var(--mono);
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
}

.weather-hour-text {
  display: block;
  margin-top: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.weather-sun {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.weather-sun-item {
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.weather-sun-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 650;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.weather-sun-value {
  display: block;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.weather-updated {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(220, 230, 248, 0.65);
  text-align: right;
  padding: 0 2px;
}

@media (hover: hover) and (pointer: fine) {
  .weather-mini:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background:
      linear-gradient(160deg, rgba(255,255,255,0.18), rgba(255,255,255,0.06));
  }
}

.weather-mini:active {
  transform: scale(0.98);
}


/* ===== Liquid bottom-tabs style bar ===== */
.tabs {
  /* Custom glass bar: no full-bleed ::before rim mask (it washed out labels). */
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 5px;
  margin-bottom: 16px;
  border-radius: var(--capsule);
  overflow: hidden;
  min-height: 56px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03)),
    rgba(10, 14, 26, 0.42);
  background-color: rgba(10, 14, 26, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 10px 28px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
  isolation: isolate;
}

/* Soft top highlight only - never covers text */
.tabs::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), transparent 42%);
  opacity: 0.55;
}

.tab {
  position: relative;
  z-index: 3; /* above glass highlight + indicator */
  flex: 1 1 0;
  min-width: 0;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--capsule);
  color: rgba(236, 242, 255, 0.84);
  font-family: var(--font-ui);
  font-size: clamp(0.78rem, 1.1vw, 0.9rem);
  font-weight: 620;
  letter-spacing: 0.01em;
  line-height: 1.2;
  padding: 0 6px;
  text-align: center;
  -webkit-font-smoothing: antialiased;
  transition:
    color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    text-shadow var(--dur-fast) var(--ease-out);
}

.tab-label {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.tab.active {
  color: #ffffff;
  font-weight: 720;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

.tab:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.tab:active {
  transform: scale(0.98);
}

.tab-indicator {
  position: absolute;
  top: 5px;
  left: 5px;
  height: calc(100% - 10px);
  width: 12%; /* JS overwrites; 7-tab friendly fallback */
  border-radius: var(--capsule);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 255, 255, 0.28), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -8px 16px rgba(0, 0, 0, 0.14),
    0 8px 18px rgba(0, 0, 0, 0.22);
  /* Keep indicator under labels; avoid heavy blur that smears glyphs */
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  transition:
    transform var(--dur) var(--ease-out-soft),
    width var(--dur) var(--ease-out-soft);
  z-index: 1;
  pointer-events: none;
  will-change: transform, width;
}

@media (hover: hover) and (pointer: fine) {
  .tab:not(.active):hover {
    color: var(--text);
  }
}

.panel { display: none; }
.panel.active {
  display: block;
  animation: panel-in var(--dur-enter) var(--ease-out) both;
}
/* Keyboard / high-frequency path: no enter animation */
.panel.active.no-enter {
  animation: none;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== Surface card ===== */
.surface {
  border-radius: var(--radius);
  overflow: hidden;
  background-color: rgba(12, 16, 30, 0.38);
  box-shadow: var(--shadow-float);
}

.surface-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 0;
  position: relative;
  z-index: 3;
}

.surface-head h2 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: #fff;
}

.surface-head p {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
  font-family: var(--font);
  max-width: 52ch;
}

.query {
  padding: 18px 22px 4px;
  position: relative;
  z-index: 3;
}

.fields {
  display: grid;
  gap: 12px;
  align-items: end;
}

.fields-4 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.fields-3 { grid-template-columns: 0.9fr 1.4fr 0.9fr; }
.fields-2 { grid-template-columns: 1.4fr 0.8fr; max-width: 520px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field-label {
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.35;
}

.field-label-spacer {
  visibility: hidden;
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02)),
    rgba(6, 10, 20, 0.45);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -1px 0 rgba(0,0,0,0.18);
  transition:
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out);
}

.field input::placeholder { color: rgba(220, 230, 248, 0.62); }

.field input:focus,
.field select:focus {
  border-color: rgba(126, 182, 255, 0.55);
  box-shadow: var(--ring), inset 0 1px 0 rgba(255,255,255,0.16);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03)),
    rgba(8, 12, 24, 0.62);
}

.field select option { color: #111; }

/* Liquid button — capsule + press scale (Emil + Kyant LiquidButton) */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--capsule);
  font-weight: 680;
  letter-spacing: 0.01em;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform var(--dur-fast) var(--ease-out),
    filter var(--dur-fast) var(--ease-out),
    opacity var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-primary {
  color: var(--accent-ink);
  background: linear-gradient(135deg, #a8d0ff 0%, #8ea2ff 48%, #9b8cff 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -6px 14px rgba(37, 99, 235, 0.18),
    0 12px 28px rgba(91, 157, 255, 0.28);
}

.btn-primary > * { position: relative; z-index: 2; }

.btn-inline {
  flex: 0 0 auto;
  min-width: 112px;
  margin-top: 2px;
}

.field-submit .btn { width: 100%; }

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover:not(:disabled) {
    filter: brightness(1.05);
  }
}

/* Chips as mini liquid capsules */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--capsule);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
  color: var(--text-secondary);
  font-size: 0.88rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14);
  transition:
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

.chip:active { transform: scale(0.97); }

.chip:focus-visible {
  outline: none;
  box-shadow: var(--ring), inset 0 1px 0 rgba(255,255,255,0.14);
}


.chip.active,
.chip-platform.active {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.28);
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(255,255,255,0.22), transparent 55%),
    linear-gradient(180deg, rgba(126, 182, 255, 0.28), rgba(126, 182, 255, 0.08));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.3),
    0 8px 18px rgba(37, 99, 235, 0.16);
}

@media (hover: hover) and (pointer: fine) {
  .chip:hover {
    color: var(--text);
    border-color: rgba(126, 182, 255, 0.35);
    background: rgba(126, 182, 255, 0.12);
  }
}

.result {
  padding: 14px 18px 22px;
  min-height: 168px;
  position: relative;
  z-index: 3;
  /* Isolate heavy list paints from fixed ambient wallpaper */
  contain: layout style;
}

.result-flush { padding-top: 18px; }

.empty,
.error-box,
.loading,
.placeholder {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 132px;
  padding: 28px 16px;
  text-align: center;
  color: rgba(232, 238, 252, 0.82);
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 560;
  letter-spacing: 0.01em;
  line-height: 1.5;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.02));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.error-box {
  border-style: solid;
  border-color: rgba(251, 113, 133, 0.32);
  color: #ffd0da;
  background: rgba(251, 113, 133, 0.1);
}

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--capsule);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 0.86rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.pill strong {
  color: var(--text);
  font-weight: 680;
}

.data-table-wrap {
  overflow: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 12px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  top: 0;
  background: rgba(12, 18, 32, 0.82);
  backdrop-filter: blur(12px);
  color: var(--text-tertiary);
  font-size: 0.84rem;
  font-weight: 620;
  letter-spacing: 0.02em;
  z-index: 1;
}

.data-table tbody tr {
  transition: background-color var(--dur-fast) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
  }
}

.train-no {
  font-family: var(--mono);
  font-weight: 720;
  color: #c7ddff;
}

.seat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seat-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.86rem;
}

.seat-tag .n { color: var(--text-tertiary); }
.seat-tag .v { font-family: var(--mono); font-weight: 700; }
.seat-tag.sold .v { color: var(--danger); }
.seat-tag.few .v { color: var(--warn); }

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 620;
  border: 1px solid transparent;
}

.status-ok {
  color: #a7f3d0;
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.22);
}
.status-warn {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.22);
}
.status-bad {
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.22);
}
.status-info {
  color: #bfdbfe;
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.22);
}

/* Gold */
.gold-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.gold-card {
  border-radius: 18px;
  padding: 14px 14px 12px;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-out);
}

.gold-card:active { transform: scale(0.985); }

@media (hover: hover) and (pointer: fine) {
  .gold-card:hover {
    transform: translateY(-2px);
  }
  .gold-card:hover:active {
    transform: translateY(0) scale(0.985);
  }
}

.gold-brand {
  font-weight: 400;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
  font-size: 1.02rem;
}

.gold-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.gold-row strong {
  color: var(--gold);
  font-family: var(--mono);
  font-weight: 740;
}

/* History */
.almanac-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.almanac-card {
  border-radius: 16px;
  padding: 14px;
  overflow: hidden;
}

.almanac-card-wide {
  grid-column: 1 / -1;
}

.almanac-card h3 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 620;
  font-family: var(--font-ui);
}

.almanac-card p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--text);
  word-break: break-word;
}

.yi, .ji {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.6;
}

.yi { color: #a7f3d0; }
.ji { color: #fecdd3; }

.history-date-bar {
  margin-bottom: 12px;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px 14px;
  align-items: start;
  padding: 14px;
  border-radius: 16px;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-out);
}

.history-item.has-thumb {
  grid-template-columns: 76px 72px minmax(0, 1fr);
}

.history-item:active { transform: scale(0.985); }

@media (hover: hover) and (pointer: fine) {
  .history-item:hover {
    transform: translateY(-1px);
  }
  .history-item:hover:active {
    transform: translateY(0) scale(0.985);
  }
}

.history-year {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 48px;
  font-family: var(--mono);
  font-weight: 700;
  color: #c7ddff;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.history-year span {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.history-year small {
  margin-top: 4px;
  font-size: 0.74rem;
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
}

.history-thumb-wrap {
  width: 72px;
  height: 54px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.history-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.history-body {
  min-width: 0;
}

.history-event {
  margin: 0;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
}

.history-details {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* Hot */
.hot-query { padding-top: 14px; }

.hot-platforms {
  margin-top: 0;
}

.hot-list {
  display: grid;
  gap: 8px;
}

.hot-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition:
    transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.hot-item:active { transform: scale(0.985); }

@media (hover: hover) and (pointer: fine) {
  .hot-item:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.2);
  }
  .hot-item:hover:active {
    transform: translateY(0) scale(0.985);
  }
}

.hot-rank {
  font-family: var(--mono);
  font-weight: 800;
  color: var(--text-tertiary);
  padding-top: 2px;
}

.hot-rank.top {
  color: #fbbf24;
}

.hot-body { min-width: 0; }

.hot-title {
  margin: 0;
  font-weight: 400;
  font-size: 1rem;
}

.hot-desc {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hot-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  color: var(--text-tertiary);
  font-size: 0.84rem;
  white-space: nowrap;
}

.hot-heat {
  color: #fda4af;
  font-family: var(--mono);
  font-weight: 700;
}

.hot-link-hint {
  opacity: 0.7;
}

/* Segmented control */
.seg {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  margin-top: 12px;
  border-radius: var(--capsule);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  width: 100%;
  max-width: 360px;
}

.seg-btn {
  min-height: 36px;
  border-radius: var(--capsule);
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 600;
  transition:
    color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

.seg-btn.active {
  color: var(--text);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255,255,255,0.26), transparent 55%),
    rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.28),
    0 8px 16px rgba(0,0,0,0.18);
}

.seg-btn:active { transform: scale(0.98); }

.seg-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}


@media (hover: hover) and (pointer: fine) {
  .seg-btn:not(.active):hover {
    color: var(--text);
  }
}

/* Football */
.football-query {
  padding-top: 14px;
  padding-bottom: 0;
}

.football-leagues { margin-top: 0; }

.match-day { margin-bottom: 14px; }

.match-day-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 4px 2px 10px;
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.match-day-head strong {
  color: var(--text);
  font-size: 0.95rem;
}

.match-list {
  display: grid;
  gap: 8px;
}

.match-card {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-out);
}

.match-card:active { transform: scale(0.985); }

@media (hover: hover) and (pointer: fine) {
  .match-card:hover {
    transform: translateY(-1px);
  }
  .match-card:hover:active {
    transform: translateY(0) scale(0.985);
  }
}

.match-time {
  display: grid;
  gap: 4px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.86rem;
}

.match-stage {
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 560;
  color: var(--text-tertiary);
}

.match-teams {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.match-team {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 400;
}

.match-team img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
}

.match-team span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-score {
  display: grid;
  justify-items: end;
  gap: 6px;
  font-family: var(--mono);
  font-weight: 780;
  font-size: 0.95rem;
  white-space: nowrap;
}

.match-status {
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.match-status.live {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.25);
}
.match-status.done {
  color: var(--text-tertiary);
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.08);
}
.match-status.soon {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.22);
}

.rank-table-wrap {
  overflow: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.rank-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 0.9rem;
}

.rank-table th,
.rank-table td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  white-space: nowrap;
}

.rank-table th {
  position: sticky;
  top: 0;
  background: rgba(12, 18, 32, 0.82);
  backdrop-filter: blur(12px);
  color: var(--text-tertiary);
  font-size: 0.84rem;
  font-weight: 620;
  z-index: 1;
}

.rank-team {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
}

.rank-team img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255,255,255,0.06);
}

.rank-pos {
  font-family: var(--mono);
  font-weight: 800;
  color: var(--text-secondary);
}

.rank-pos.top { color: #86efac; }

.rank-points {
  font-family: var(--mono);
  font-weight: 800;
  color: #fbbf24;
}

.cache-note {
  margin-top: 10px;
  color: var(--text-tertiary);
  font-size: 0.84rem;
}

.football-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 3;
}

.quota-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  white-space: nowrap;
  user-select: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14);
}

.quota-badge strong {
  color: var(--text);
  font-weight: 680;
}

.quota-badge.is-low {
  border-color: rgba(251, 191, 36, 0.35);
  color: #fbbf24;
}

.quota-badge.is-empty {
  border-color: rgba(248, 113, 113, 0.4);
  color: #f87171;
}

.quota-badge.is-empty strong { color: #fca5a5; }

/* Stagger enter (Emil) ? opacity-first to avoid promoting dozens of layers */
.stagger-enter {
  opacity: 0;
  animation: stagger-in var(--dur-enter) var(--ease-out) forwards;
  pointer-events: auto;
}

/* Only first few items may use tiny travel; long lists stay opacity-only */
.stagger-enter.is-motion {
  transform: translateY(6px);
}

@keyframes stagger-in {
  to {
    opacity: 1;
    transform: none;
  }
}

/* Responsive */
@media (max-width: 900px) {
  .fields-4,
  .fields-3 {
    grid-template-columns: 1fr 1fr;
  }

  .history-item {
    grid-template-columns: 64px 1fr;
  }

  .history-item.has-thumb {
    grid-template-columns: 64px 60px minmax(0, 1fr);
  }

  .history-thumb-wrap {
    width: 60px;
    height: 46px;
  }

  .almanac-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 16px, var(--shell));
    padding-top: 14px;
  }

  .topbar {
    border-radius: 20px;
    padding: 10px 12px;
    align-items: flex-start;
  }

  .topbar-meta {
    align-items: flex-end;
  }

  .weather-mini {
    max-width: min(220px, 58vw);
    padding: 5px 8px 5px 6px;
  }

  .weather-mini-temp {
    font-size: 0.9rem;
  }

  .weather-mini-text {
    font-size: 0.74rem;
  }

  .weather-popover {
    right: 0;
    left: auto;
    width: min(420px, calc(100vw - 24px));
    max-height: min(70vh, 560px);
    transform-origin: top right;
  }

  .weather-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weather-day {
    grid-template-columns: 56px 24px 1fr auto;
  }


  .tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    min-height: 52px;
  }

  .tabs::-webkit-scrollbar { display: none; }

  .tab {
    flex: 0 0 auto;
    padding-inline: 14px;
    white-space: nowrap;
    font-size: 0.86rem;
  }

  .tab-indicator { display: none; }

  .tab.active {
    color: #fff;
    background:
      radial-gradient(120% 100% at 50% 0%, rgba(255,255,255,0.24), transparent 55%),
      rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.24);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
  }

  .surface-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .fields-4,
  .fields-3,
  .fields-2 {
    grid-template-columns: 1fr;
  }

  .match-card {
    grid-template-columns: 56px 1fr;
  }

  .match-score {
    grid-column: 1 / -1;
    grid-auto-flow: column;
    justify-content: space-between;
    align-items: center;
  }
}

@media (max-width: 640px) {
  .football-actions {
    width: 100%;
    justify-content: space-between;
  }

  .hot-item {
    grid-template-columns: 28px 1fr;
  }

  .hot-meta {
    grid-column: 2;
    flex-direction: row;
    justify-content: flex-start;
  }
}



/* AI Brief */
.aibrief-query {
  padding-top: 14px;
}

.brief-list {
  display: grid;
  gap: 10px;
}

.brief-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur-fast) var(--ease-out);
}

.brief-item:active {
  transform: scale(0.985);
}

@media (hover: hover) and (pointer: fine) {
  .brief-item:hover {
    transform: translateY(-1px);
  }
  .brief-item:hover:active {
    transform: translateY(0) scale(0.985);
  }
}

.brief-item.no-thumb {
  grid-template-columns: minmax(0, 1fr);
}

.brief-thumb-wrap {
  width: 96px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.brief-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brief-body {
  min-width: 0;
}

.brief-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-family: var(--font-ui);
}

.brief-type {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(126, 182, 255, 0.28);
  background: rgba(126, 182, 255, 0.12);
  color: #c7ddff;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.brief-time {
  color: var(--text-tertiary);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.brief-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  font-weight: 400;
}

.brief-summary {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.brief-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  color: var(--text-tertiary);
}

.brief-author {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brief-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.brief-link:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .brief-item {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .brief-thumb-wrap {
    width: 72px;
    height: 56px;
  }

  .brief-summary {
    -webkit-line-clamp: 2;
  }
}

/* Typography helpers - small UI copy stays crisp; body reading uses NSimSun */
.hot-meta,
.cache-note,
.quota-badge,
.status-chip,
.field-label,
.rank-table th,
.pill,
.meta-bar,
.btn,
.chip,
.seg-btn,
.tab,
.match-status,
.match-stage,
.match-time,
.seat-tag {
  font-family: var(--font-ui);
  letter-spacing: 0.02em;
}

/* Reading content: real 新宋体, no fake-bold (synthetic bold looks muddy) */
.hot-title,
.hot-desc,
.history-event,
.history-details,
.gold-brand,
.gold-row,
.match-team,
.almanac-card,
.table-wrap td,
.result-table td {
  font-family: var(--font);
  font-weight: 400;
  -webkit-font-smoothing: auto;
}

.hot-title,
.history-event,
.gold-brand,
.match-team {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  letter-spacing: 0.01em;
}

.hot-desc,
.history-details,
.gold-row {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* Numbers / codes stay mono for scanning */
.train-no,
.history-year,
.hot-heat,
.clock,
.rank-pos,
.rank-points,
.match-score {
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ambient .mesh,
  .orb-a,
  .orb-b,
  .panel.active,
  .stagger-enter,
  .spinner {
    animation: none !important;
  }

  .ambient-photo {
    transition: none !important;
    transform: none;
    opacity: 1;
  }

  .tab,
  .tab-indicator,
  .btn,
  .chip,
  .seg-btn,
  .gold-card,
  .match-card,
  .hot-item,
  .history-item,
  .brief-item,
  .weather-mini,
  .weather-popover,
  .weather-mini-chevron {
    transition: none !important;
  }

  .btn:active:not(:disabled),
  .chip:active,
  .tab:active,
  .seg-btn:active,
  .gold-card:active,
  .match-card:active,
  .hot-item:active,
  .history-item:active,
  .brief-item:active,
  .weather-mini:active {
    transform: none;
  }
}

/* Fallback when backdrop-filter unsupported */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .surface,
  .topbar,
  .weather-popover,
  .gold-card,
  .match-card,
  .hot-item,
  .almanac-card,
  .history-item,
  .field input,
  .field select {
    background-color: rgba(16, 22, 36, 0.92);
  }
}
