/* ============================================================
   基础样式：设计变量、导航、主题、频道列表、抽屉、通用控件
   ============================================================ */

:root {
  color-scheme: dark;

  --font-sans: "SF Pro Display", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "SF Mono", "Roboto Mono", Consolas, monospace;

  --bg: #080a0f;
  --bg-elevated: #0d1017;
  --panel: rgba(17, 21, 30, 0.82);
  --panel-solid: #11151e;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: #181d27;
  --surface-3: #202633;
  --text: #f5f6fa;
  --text-soft: #c4c9d4;
  --muted: #8b93a4;
  --faint: #616878;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --header-bg: rgba(8, 10, 15, 0.76);
  --nav-active: rgba(255, 255, 255, 0.09);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 12px 34px rgba(0, 0, 0, 0.28);
  --video-bg: #050609;

  --brand: #ff5c57;
  --brand-2: #ff8a4c;
  --accent: #ff5c57;
  --accent-2: #ff8a4c;
  --accent-soft: rgba(255, 92, 87, 0.13);
  --accent-line: rgba(255, 92, 87, 0.34);
  --on-accent: #ffffff;
  --success: #3ddc97;

  --header-h: 72px;
  --page-max: 1440px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 30px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #f4f2ec;
  --bg-elevated: #fffdf8;
  --panel: rgba(255, 253, 248, 0.88);
  --panel-solid: #fffdf8;
  --surface: rgba(19, 22, 29, 0.045);
  --surface-2: #efede6;
  --surface-3: #e5e2da;
  --text: #17191f;
  --text-soft: #414651;
  --muted: #6f7580;
  --faint: #9a9ea7;
  --border: rgba(20, 23, 30, 0.09);
  --border-strong: rgba(20, 23, 30, 0.16);
  --header-bg: rgba(244, 242, 236, 0.82);
  --nav-active: rgba(255, 255, 255, 0.9);
  --shadow-lg: 0 26px 70px rgba(37, 31, 22, 0.13);
  --shadow-md: 0 12px 30px rgba(37, 31, 22, 0.09);
  --video-bg: #0a0b0f;
  --accent-soft: rgba(255, 92, 87, 0.11);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  background:
    radial-gradient(1100px 680px at 82% -16%, rgba(255, 92, 87, 0.12), transparent 62%),
    radial-gradient(900px 640px at -6% 24%, rgba(74, 112, 255, 0.09), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

[data-theme="light"] body {
  background:
    radial-gradient(1000px 620px at 82% -16%, rgba(255, 124, 92, 0.12), transparent 60%),
    radial-gradient(820px 560px at -6% 22%, rgba(82, 117, 255, 0.08), transparent 58%),
    var(--bg);
}

body.is-locked {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection {
  color: #fff;
  background: rgba(255, 92, 87, 0.72);
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--fill {
  fill: currentColor;
  stroke: none;
}

/* ---------- 顶部导航 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(100%, var(--page-max));
  height: 100%;
  padding: 0 28px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  min-height: 44px;
  border-radius: 12px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  filter: drop-shadow(0 5px 12px rgba(214, 0, 20, 0.16));
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-text {
  display: inline-flex;
  align-items: baseline;
}

.brand-name {
  font-size: 16px;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.brand-name-short {
  display: none;
}

.brand-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  margin-left: 1px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 6px;
}

.main-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  height: 38px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 10px;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.nav-item .icon {
  width: 18px;
  height: 18px;
  margin-right: 8px;
}

.nav-item:hover {
  color: var(--text-soft);
}

.nav-item.is-active {
  color: var(--text);
  background: var(--nav-active);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 4px 14px rgba(0, 0, 0, 0.12);
}

.nav-item.is-active .icon {
  color: var(--accent);
}

.nav-label-short {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 120px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.header-status .status-dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.1);
}

.theme-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.theme-toggle:active {
  transform: scale(0.94);
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

/* ---------- 页面骨架 ---------- */

.page {
  width: min(100%, var(--page-max));
  padding: 32px 28px 48px;
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  animation: rise-in 620ms var(--ease) both;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 9px;
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow-line {
  width: 18px;
  height: 1px;
  background: var(--accent);
}

.page-title {
  margin: 0;
  font-size: clamp(30px, 3.3vw, 44px);
  font-weight: 780;
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.page-subtitle {
  margin: 9px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.btn.mobile-channel-trigger {
  display: none;
}

/* ---------- 通用按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 640;
  line-height: 1;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, color 180ms ease;
}

.btn:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
}

.btn:active {
  transform: translateY(1px);
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn-primary {
  color: var(--on-accent);
  background: var(--accent);
  border-color: transparent;
  box-shadow: 0 10px 26px var(--accent-soft);
}

.btn-primary:hover {
  color: var(--on-accent);
  background: var(--accent);
  border-color: transparent;
  filter: brightness(1.06);
}

.btn-ghost {
  background: transparent;
}

.icon-btn {
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border-radius: 11px;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}

[data-theme="light"] .icon-btn:hover {
  background: rgba(20, 23, 30, 0.07);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #ff7a72;
  background: rgba(255, 75, 68, 0.1);
  border: 1px solid rgba(255, 92, 87, 0.2);
  border-radius: 999px;
}

.live-dot {
  position: relative;
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  background: #ff5c57;
  border-radius: 50%;
}

.live-dot::after {
  position: absolute;
  inset: -4px;
  content: "";
  border: 1px solid rgba(255, 92, 87, 0.55);
  border-radius: inherit;
  animation: live-pulse 2s ease-out infinite;
}

/* ---------- 频道面板 ---------- */

.channel-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}

.channel-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.channel-panel__heading {
  min-width: 0;
}

.channel-panel__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.channel-panel__count {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}

.channel-panel__subtitle {
  margin: 3px 0 0;
  font-size: 11px;
  color: var(--faint);
}

.channel-panel__tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.panel-tool {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border-radius: 10px;
  transition: color 160ms ease, background 160ms ease;
}

.panel-tool:hover {
  color: var(--text);
  background: var(--surface);
}

.panel-tool.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.panel-tool.is-active .icon {
  fill: currentColor;
}

.panel-tool .icon {
  width: 18px;
  height: 18px;
}

.drawer-close,
.sheet-handle {
  display: none;
}

.channel-scroll {
  flex: 1;
  min-height: 0;
  padding: 6px 10px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

.channel-scroll::-webkit-scrollbar {
  width: 5px;
}

.channel-scroll::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 999px;
}

.recent-block {
  padding: 10px 8px 6px;
  border-bottom: 1px solid var(--border);
}

.section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 2px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--faint);
}

.section-label .icon {
  width: 13px;
  height: 13px;
}

.recent-list {
  display: flex;
  gap: 7px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.recent-list::-webkit-scrollbar {
  display: none;
}

.recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 4px 10px 4px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 160ms ease, background 160ms ease;
}

.recent-chip:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.recent-chip img {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.channel-group {
  padding: 8px 0 2px;
}

.channel-group__toggle {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  border-radius: 8px;
}

.channel-group__toggle:hover {
  color: var(--text-soft);
  background: var(--surface);
}

.channel-group__name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.channel-group__count {
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--faint);
}

.channel-group__toggle .icon {
  width: 15px;
  height: 15px;
  margin-left: auto;
  transition: transform 220ms var(--ease);
}

.channel-group.is-collapsed .channel-group__toggle .icon {
  transform: rotate(-90deg);
}

.channel-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 2px 0 6px;
  margin: 0;
  list-style: none;
}

.channel-item {
  display: flex;
  align-items: center;
  min-height: 58px;
  border: 1px solid transparent;
  border-radius: 13px;
  transition: background 170ms ease, border-color 170ms ease;
}

.channel-item:hover {
  background: var(--surface);
}

.channel-item.is-active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.channel-item__main {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
  min-width: 0;
  min-height: 56px;
  padding: 7px 2px 7px 9px;
  text-align: left;
  background: transparent;
  border-radius: 12px;
}

.channel-item__logo {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.channel-item__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.channel-item__copy {
  display: block;
  min-width: 0;
}

.channel-item__name {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 620;
  line-height: 1.35;
  color: var(--text-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-item.is-active .channel-item__name {
  color: var(--text);
}

.channel-item__meta {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-size: 10px;
  color: var(--faint);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-item__playing {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: 14px;
  height: 14px;
  margin-left: auto;
}

.channel-item__playing span {
  display: block;
  width: 2px;
  height: 45%;
  background: var(--accent);
  border-radius: 2px;
  animation: equalize 900ms ease-in-out infinite alternate;
}

.channel-item__playing span:nth-child(2) {
  height: 100%;
  animation-delay: -300ms;
}

.channel-item__playing span:nth-child(3) {
  height: 70%;
  animation-delay: -600ms;
}

.channel-item:not(.is-active) .channel-item__playing {
  display: none;
}

.channel-item.is-paused .channel-item__playing span {
  animation-play-state: paused;
}

.channel-item__fav {
  display: grid;
  width: 40px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--faint);
  background: transparent;
  border-radius: 10px;
  transition: color 160ms ease, background 160ms ease;
}

.channel-item__fav:hover {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.06);
}

.channel-item__fav.is-favorite {
  color: #ffc247;
}

.channel-item__fav .icon {
  width: 16px;
  height: 16px;
}

.channel-item__fav.is-favorite .icon {
  fill: currentColor;
}

.favorites-empty {
  padding: 26px 20px;
  text-align: center;
  color: var(--faint);
}

.favorites-empty .icon {
  width: 26px;
  height: 26px;
  margin: 0 auto 10px;
  opacity: 0.65;
}

.favorites-empty p {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
}

.channel-panel__foot {
  padding: 11px 18px 13px;
  font-size: 10px;
  line-height: 1.55;
  color: var(--faint);
  border-top: 1px solid var(--border);
}

/* ---------- 移动端抽屉 ---------- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  background: rgba(0, 0, 0, 0.58);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 240ms ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
}

.sheet-handle {
  width: 38px;
  height: 4px;
  flex: 0 0 auto;
  margin: 9px auto 0;
  background: var(--surface-3);
  border-radius: 999px;
}

/* ---------- 网络提示 / 轻提示 ---------- */

.network-banner {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100vw - 32px);
  min-height: 44px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 560;
  color: #ffd9d4;
  background: rgba(53, 22, 22, 0.94);
  border: 1px solid rgba(255, 120, 104, 0.24);
  border-radius: 12px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.42);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 300ms var(--ease);
}

.network-banner.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.network-banner .icon {
  width: 16px;
  height: 16px;
  color: #ff8b7e;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 130;
  max-width: calc(100vw - 40px);
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 560;
  color: #fff;
  background: rgba(27, 31, 41, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 220ms ease;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.network-banner.is-visible ~ .app-toast {
  bottom: 88px;
}

/* ---------- 微信内置浏览器提示 ---------- */

.wechat-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #ffe2b0;
  background: rgba(58, 40, 10, 0.94);
  border-bottom: 1px solid rgba(255, 190, 80, 0.22);
}

.wechat-banner p {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.wechat-banner strong {
  color: #fff;
  letter-spacing: 0.06em;
}

.wechat-banner .icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #ffc65c;
}

.wechat-banner__close {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: #ffd98f;
  background: transparent;
  border-radius: 8px;
}

.wechat-banner__close:hover {
  background: rgba(255, 255, 255, 0.08);
}

.wechat-banner__close .icon {
  width: 15px;
  height: 15px;
}

[data-theme="light"] .wechat-banner {
  color: #7a4a00;
  background: #fff3da;
  border-bottom-color: rgba(180, 120, 0, 0.18);
}

[data-theme="light"] .wechat-banner strong {
  color: #5a3500;
}

[data-theme="light"] .wechat-banner .icon,
[data-theme="light"] .wechat-banner__close {
  color: #b87400;
}

/* ---------- 分享面板 ---------- */

.share-trigger {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.share-trigger:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.share-trigger .icon {
  width: 18px;
  height: 18px;
}

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  padding: 20px;
  place-items: center;
}

.share-modal[hidden] {
  display: none !important;
}

.share-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 220ms ease;
}

.share-modal.is-open .share-modal__backdrop {
  opacity: 1;
}

.share-dialog {
  position: relative;
  width: min(100%, 380px);
  max-height: calc(100vh - 40px);
  padding: 26px 24px 22px;
  overflow-y: auto;
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 220ms ease, transform 260ms var(--ease);
}

.share-modal.is-open .share-dialog {
  opacity: 1;
  transform: none;
}

.share-dialog__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border-radius: 10px;
}

.share-dialog__close:hover {
  color: var(--text);
  background: var(--surface);
}

.share-dialog__title {
  margin: 0;
  font-size: 20px;
  font-weight: 740;
  letter-spacing: -0.02em;
}

.share-dialog__desc {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.share-qr {
  display: grid;
  width: 196px;
  height: 196px;
  margin: 16px auto 12px;
  padding: 14px;
  place-items: center;
  overflow: hidden;
  background: #fff;
  border-radius: 16px;
}

.share-qr img,
.share-qr canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.share-qr__hint {
  padding: 0 10px;
  font-size: 12px;
  line-height: 1.6;
  color: #7a808c;
  text-align: center;
}

.share-dialog__url {
  display: -webkit-box;
  max-height: 2.9em;
  margin: 0 0 16px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
  color: var(--faint);
  text-align: center;
  word-break: break-all;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.share-dialog__actions {
  display: flex;
  gap: 10px;
}

.share-dialog__actions .btn {
  flex: 1;
}

.share-poster-btn {
  width: 100%;
  margin-top: 10px;
}

.poster-preview {
  display: grid;
  max-height: min(58vh, 470px);
  margin: 18px auto 14px;
  overflow: hidden;
  place-items: center;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 14px;
}

.poster-preview img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(58vh, 470px);
  border-radius: 14px;
}

.poster-preview__hint {
  padding: 46px 18px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ---------- 页脚 ---------- */

.site-footer {
  width: min(100%, var(--page-max));
  padding: 0 28px max(28px, env(safe-area-inset-bottom));
  margin: 0 auto;
  font-size: 11.5px;
  line-height: 1.9;
  color: var(--faint);
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer__items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.site-footer a {
  color: inherit;
  transition: color 160ms ease;
}

.site-footer a:hover {
  color: var(--text-soft);
}

.site-footer__sep {
  margin: 0 8px;
  color: var(--border-strong);
}

.share-dialog__tip {
  margin: 14px 0 0;
  font-size: 11px;
  color: var(--faint);
  text-align: center;
}

/* ---------- 今日节目单 ---------- */

.schedule-card {
  padding: 18px 20px;
  margin-top: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.schedule-card[hidden] {
  display: none !important;
}

.schedule-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.schedule-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.schedule-card__title .icon {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.schedule-card__date {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.schedule-list {
  display: flex;
  max-height: 262px;
  padding: 0 4px 0 0;
  margin: 0;
  overflow-y: auto;
  flex-direction: column;
  list-style: none;
}

.schedule-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  font-size: 13px;
  color: var(--text-soft);
  border-left: 2px solid transparent;
  border-radius: 8px;
}

.schedule-item__time {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}

.schedule-item__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-item__tag {
  flex: 0 0 auto;
  padding: 2px 7px;
  font-size: 10px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.schedule-item.is-past {
  color: var(--faint);
  opacity: 0.62;
}

.schedule-item.is-current {
  color: var(--text);
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.schedule-item.is-current .schedule-item__time {
  color: var(--accent);
}

.schedule-item.is-current .schedule-item__tag {
  color: var(--on-accent);
  background: var(--accent);
  border-color: transparent;
}

.schedule-card__note {
  margin: 10px 0 0;
  font-size: 10.5px;
  color: var(--faint);
}

.volume-bar:disabled,
.radio-volume-bar:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

/* ---------- 动效 ---------- */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes live-pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  70%,
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

@keyframes equalize {
  from { transform: scaleY(0.35); }
  to { transform: scaleY(1); }
}

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

/* ---------- 响应式基础 ---------- */

@media (max-width: 1080px) {
  .header-inner {
    gap: 18px;
  }

  .panel-tool {
    width: 44px;
    height: 44px;
  }

  .recent-chip {
    min-height: 44px;
    padding-right: 12px;
  }

  .channel-group__toggle {
    min-height: 44px;
  }

  .header-actions {
    min-width: auto;
  }

  .nav-item {
    min-width: 108px;
  }

  .btn.mobile-channel-trigger {
    display: inline-flex;
  }

  .drawer-backdrop {
    display: block;
    pointer-events: none;
  }

  .drawer-backdrop.is-open {
    pointer-events: auto;
  }

  .channel-panel {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    width: min(100%, 680px);
    max-height: min(82dvh, 780px);
    margin: 0 auto;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.4);
    transform: translateY(105%);
    transition: transform 340ms var(--ease);
  }

  .channel-panel.is-open {
    transform: translateY(0);
  }

  .sheet-handle {
    display: block;
  }

  .drawer-close {
    display: grid;
  }

  .channel-panel__head {
    padding-top: 12px;
  }

  .channel-scroll {
    max-height: calc(82dvh - 116px);
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  .channel-panel__foot {
    display: none;
  }

  .channel-item {
    min-height: 60px;
  }

  .channel-item__fav {
    width: 44px;
    height: 48px;
  }

  .channel-item__fav .icon {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 720px) {
  :root {
    --header-h: 64px;
  }

  .header-inner {
    gap: 12px;
    padding: 0 16px;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-name {
    font-size: 15px;
  }

  .brand-tag {
    display: none;
  }

  .main-nav {
    margin-left: auto;
    padding: 3px;
    border-radius: 12px;
  }

  .nav-item {
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    font-size: 13px;
    border-radius: 9px;
  }

  .nav-item .icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
  }

  .header-actions {
    gap: 0;
  }

  .header-status {
    display: none;
  }

  .theme-toggle {
    width: 44px;
    height: 44px;
    background: transparent;
    border-color: transparent;
  }

  .page {
    padding: 22px 16px 36px;
  }

  .page-head {
    align-items: center;
    margin-bottom: 16px;
  }

  .eyebrow {
    margin-bottom: 7px;
    font-size: 10px;
  }

  .page-title {
    font-size: 28px;
  }

  .page-subtitle {
    margin-top: 5px;
    font-size: 12px;
  }

  .btn.mobile-channel-trigger {
    flex: 0 0 auto;
    padding: 0 14px;
    font-size: 12px;
  }

  .channel-panel__head {
    padding: 10px 16px 12px;
  }

  .channel-scroll {
    padding-right: 8px;
    padding-left: 8px;
  }

  .network-banner {
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  .wechat-banner {
    padding: 9px 12px;
    font-size: 12px;
  }

  .schedule-card {
    padding: 16px;
    margin-top: 16px;
    border-radius: 16px;
  }

  .schedule-item {
    padding: 8px;
    font-size: 12.5px;
  }

  .share-dialog {
    padding: 24px 20px 20px;
  }

  .share-qr {
    width: 176px;
    height: 176px;
  }

  .site-footer {
    padding: 0 16px max(22px, env(safe-area-inset-bottom));
    font-size: 11px;
  }

  .site-footer__sep {
    margin: 0 5px;
  }
}

@media (max-width: 560px) {
  .header-inner {
    gap: 10px;
  }

  .brand {
    gap: 8px;
  }

  .brand-name {
    font-size: 14px;
  }

  .brand-name-full {
    display: none;
  }

  .brand-name-short {
    display: inline;
  }

  .nav-label-full {
    display: none;
  }

  .nav-label-short {
    display: inline;
  }

  .nav-item {
    padding: 0 9px;
    font-size: 12.5px;
  }

  .nav-item .icon {
    margin-right: 5px;
  }

  .page-head {
    gap: 12px;
  }

  .page-title {
    font-size: 25px;
  }

  .page-subtitle {
    display: none;
  }

  .btn.mobile-channel-trigger {
    min-height: 44px;
  }

  .site-footer {
    padding: 0 14px max(20px, env(safe-area-inset-bottom));
    font-size: 11px;
    line-height: 1.75;
  }

  .site-footer__items {
    flex-direction: column;
    gap: 1px;
  }

  .site-footer__sep {
    display: none;
  }
}

@media (max-width: 350px) {
  .brand-name-short {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
