/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: #0A0A0A;
    color: #F2F2F7;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* 背景质感 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(168, 85, 247, 0.03) 0%, transparent 50%),
        linear-gradient(135deg, #0A0A0A 0%, #111111 100%);
    z-index: -1;
}

/* Light theme background + header readability tweaks */
@media (max-width: 2000px) and (prefers-color-scheme: light) {
  html:not([data-theme]) body::before {
    background:
      radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
      radial-gradient(circle at 75% 75%, rgba(168, 85, 247, 0.04) 0%, transparent 50%),
      linear-gradient(135deg, #F7F7FA 0%, #FFFFFF 100%);
  }

  html:not([data-theme]) .header {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow:
      0 8px 24px rgba(0,0,0,0.08),
      inset 0 1px 0 rgba(255,255,255,0.9);
  }

  html:not([data-theme]) .header h1 {
    /* Force solid black, disable any gradient text */
    background: none !important;
    background-image: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: #000000 !important;
    color: #000000 !important;
    font-weight: 700;
    text-shadow: none;
  }

  /* Light theme card elevation to improve separation */
  html:not([data-theme]) .now-playing,
  html:not([data-theme]) .scene-selector,
  html:not([data-theme]) .scene-header,
  html:not([data-theme]) .track-item,
  html:not([data-theme]) .broadcast-card {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
  }

  html:not([data-theme]) .track-item:hover,
  html:not([data-theme]) .broadcast-card:hover {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
  }

  html:not([data-theme]) .scene-tabs {
    background: rgba(248, 249, 252, 0.86);
    border-bottom-color: rgba(0, 0, 0, 0.08);
  }

  /* Player controls high-contrast in light theme */
  html:not([data-theme]) .time-display { color: #475467; }
  html:not([data-theme]) .control-btn {
    background: #F2F4F7;
    border-color: #D0D5DD;
    color: #101828;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  }
  html:not([data-theme]) .control-btn:hover {
    background: #FFFFFF;
    color: #101828;
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.12);
  }
  html:not([data-theme]) .volume-control { color: #101828; }
  html:not([data-theme]) .volume-control i { color: #667085; }
  html:not([data-theme]) #volumeValue { color: #475467; }
  html:not([data-theme]) .volume-slider {
    height: 6px;
    background: #E5E7EB;
    border: 1px solid #D0D5DD;
    border-radius: 999px;
  }
  html:not([data-theme]) .volume-slider::-webkit-slider-thumb {
    border: 2px solid #FFFFFF;
    box-shadow: 0 1px 2px rgba(16,24,40,0.16), 0 0 0 1px rgba(16,24,40,0.06) inset;
  }
  html:not([data-theme]) .progress-bar { background: #E7E7EA; }
  html:not([data-theme]) .progress-fill { box-shadow: none; }

  /* Emphasize STOP button for clarity */
  html:not([data-theme]) #stopBtn {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    border-color: rgba(220, 38, 38, 0.25);
    color: #FFFFFF;
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.3), inset 0 1px 0 rgba(255,255,255,0.25);
  }
  html:not([data-theme]) #stopBtn:hover {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.35), inset 0 1px 0 rgba(255,255,255,0.3);
  }
  html:not([data-theme]) #stopBtn i { color: #FFFFFF; }
}

/* When user explicitly chooses light theme via toggle, apply the same light tweaks */
html[data-theme="light"] .header {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
}
html[data-theme="light"] .header h1 {
  background: none !important;
  background-image: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  -webkit-text-fill-color: #000000 !important;
  color: #000000 !important;
  font-weight: 700;
  text-shadow: none;
}
html[data-theme="light"] .now-playing:not(.now-playing--mini),
html[data-theme="light"] .scene-selector,
html[data-theme="light"] .scene-header,
html[data-theme="light"] .track-item,
html[data-theme="light"] .broadcast-card {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
}
html[data-theme="light"] .track-item:hover,
html[data-theme="light"] .broadcast-card:hover {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
}
html[data-theme="light"] .scene-tabs {
  background: rgba(248, 249, 252, 0.86);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .now-playing.now-playing--mini {
  background: rgba(248, 249, 252, 0.86);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
}
html[data-theme="light"] .bottom-tabbar-inner {
  background: rgba(248, 249, 252, 0.86);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 40px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
html[data-theme="light"] .bottom-tabbar .scene-tab {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.06);
}
html[data-theme="light"] .bottom-tabbar .scene-tab:hover {
  background: rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .time-display { color: #475467; }
html[data-theme="light"] .control-btn {
  background: #F2F4F7; border-color: #D0D5DD; color: #101828; box-shadow: 0 1px 2px rgba(16,24,40,0.06);
}
html[data-theme="light"] .control-btn:hover {
  background: #FFFFFF; color: #101828; box-shadow: 0 4px 12px rgba(16,24,40,0.12);
}
html[data-theme="light"] .volume-control { color: #101828; }
html[data-theme="light"] .volume-control i { color: #667085; }
html[data-theme="light"] #volumeValue { color: #475467; }
html[data-theme="light"] .volume-slider { height: 6px; background: #E5E7EB; border: 1px solid #D0D5DD; border-radius: 999px; }
html[data-theme="light"] .volume-slider::-webkit-slider-thumb { border: 2px solid #FFFFFF; box-shadow: 0 1px 2px rgba(16,24,40,0.16), 0 0 0 1px rgba(16,24,40,0.06) inset; }
html[data-theme="light"] .progress-bar { background: #E7E7EA; }
html[data-theme="light"] .progress-fill { box-shadow: none; }
html[data-theme="light"] #stopBtn { background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%); border-color: rgba(220,38,38,0.25); color:#fff; box-shadow: 0 6px 16px rgba(220,38,38,0.3), inset 0 1px 0 rgba(255,255,255,0.25); }
html[data-theme="light"] #stopBtn:hover { background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%); box-shadow: 0 10px 24px rgba(220,38,38,0.35), inset 0 1px 0 rgba(255,255,255,0.3); }
html[data-theme="light"] #stopBtn i { color: #FFFFFF; }

/* 页面容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 48px;
    position: relative;
    background: var(--color-surface);
    border: 1px solid color-mix(in oklab, var(--color-bg), white 12%);
    border-radius: 20px;
    padding: 72px 40px 40px;
    backdrop-filter: blur(18px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 color-mix(in oklab, white 18%, transparent);
}

/* App logo in title */
.header h1 .app-logo {
    width: 32px;
    height: 32px;
    vertical-align: -6px; /* align with text baseline */
    margin-right: 10px;
    border-radius: 8px; /* retain soft corners if any */
}
@media (min-width: 640px) {
  .header h1 .app-logo { width: 36px; height: 36px; vertical-align: -8px; }
}

/* Theme toggle button */
.theme-toggle-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: var(--color-text);
    cursor: pointer;
    transition: transform var(--dur-press) var(--ease-press),
                background var(--dur-enter) var(--ease-enter),
                border-color var(--dur-enter) var(--ease-enter);
}
.theme-toggle-btn:hover { transform: scale(1.03); background: rgba(255,255,255,0.1); }
.theme-toggle-btn:active { transform: scale(0.98); }
.theme-toggle-btn i { pointer-events: none; }

/* Theme menu (dropdown) */
.theme-menu {
    position: fixed; /* on top and not clipped */
    top: 66px;
    right: 18px;
    z-index: 2147483647; /* maximum layering */
    display: none;
    padding: 0; /* no outer frame */
    border: none;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    width: 44px; /* one column width equals icon size */
    pointer-events: auto;
}
.theme-menu[data-open="true"] { display: grid; grid-auto-flow: row; row-gap: 10px; justify-items: center; }
.theme-menu .theme-menu-item {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%; /* circle */
    border: none;
    background: transparent; /* icons only by default */
    color: #EAEAEA;
    cursor: pointer;
    font-size: 18px;
}
.theme-menu .theme-menu-item:hover,
.theme-menu .theme-menu-item:focus-visible {
    background: rgba(255,255,255,0.12);
    outline: none;
    outline: none;
}

/* PWA install button removed — rely on system prompt */

/* Light theme surface for menu when following system or forcing light */
@media (prefers-color-scheme: light) {
  html:not([data-theme]) .theme-menu {
    background: transparent; /* no outer frame in light */
    box-shadow: none;
  }
  html:not([data-theme]) .theme-menu .theme-menu-item { color: #101828; background: transparent; }
  html:not([data-theme]) .theme-menu .theme-menu-item:hover,
  html:not([data-theme]) .theme-menu .theme-menu-item:focus-visible {
    background: rgba(16,24,40,0.12);
  }
}
html[data-theme="light"] .theme-menu { background: transparent; box-shadow: none; }
html[data-theme="light"] .theme-menu .theme-menu-item { color: #101828; }
html[data-theme="light"] .theme-menu .theme-menu-item:hover,
html[data-theme="light"] .theme-menu .theme-menu-item:focus-visible {
  background: rgba(16,24,40,0.12);
}

/* Light theme version for better contrast (only when not forcing theme) */
@media (prefers-color-scheme: light) {
  html:not([data-theme]) .theme-toggle-btn {
    border-color: rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.9);
    color: #101828;
  }
}

/* Explicit theme overrides for toggle button */
html[data-theme="light"] .theme-toggle-btn {
  border-color: rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.9);
  color: #101828;
}
html[data-theme="dark"] .theme-toggle-btn {
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--color-text);
}

/* On smaller screens, give a bit more top space to avoid overlap */
@media (max-width: 640px) {
  .header { padding-top: 88px; }
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 200;
    margin-bottom: 12px;
    color: #F2F2F7;
    letter-spacing: -0.8px;
    background: linear-gradient(135deg, #F2F2F7 0%, #A1A1AA 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header h1 i {
    background: linear-gradient(135deg, #6366F1 0%, #A855F7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-right: 16px;
    font-size: 2rem;
}

.header p {
    color: var(--color-text-muted);
    font-size: 1rem;
    font-weight: 400;
}

/* 音频选择器样式 */
.audio-selector {
    margin-bottom: 48px;
}

.file-upload-area {
    background: rgba(255, 255, 255, 0.04);
    border: 2px dashed rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
}

.file-upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.file-upload-area:hover {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.file-upload-area:hover::before {
    opacity: 1;
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 
        0 8px 24px rgba(99, 102, 241, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.file-upload-area:hover .upload-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 
        0 12px 32px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.file-upload-area h3 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: #F2F2F7;
    letter-spacing: -0.5px;
}

.file-upload-area p {
    color: #8E8E93;
    font-size: 1rem;
    margin-bottom: 24px;
}

#audioFileInput {
    display: none;
}

.browse-btn {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 
        0 4px 16px rgba(99, 102, 241, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.browse-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 24px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #5B5BF7 0%, #7C3AED 100%);
}

.selected-files {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.file-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.file-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: #F2F2F7;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.8rem;
    color: #8E8E93;
}

.file-actions {
    display: flex;
    gap: 8px;
}

.file-play-btn {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.file-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.file-remove-btn {
    background: rgba(239, 68, 68, 0.8);
    border: none;
    border-radius: 8px;
    padding: 8px;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-remove-btn:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.05);
}

/* 拖拽悬停效果 */
.file-upload-area.drag-over {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.15), rgba(30, 144, 255, 0.15));
    border-color: #8A2BE2;
    transform: scale(1.02);
    box-shadow: 0 8px 32px rgba(138, 43, 226, 0.3);
}

.file-upload-area.drag-over .upload-icon {
    transform: scale(1.2) rotate(10deg);
    color: #8A2BE2;
}

/* 消息提示动画 */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Safari文件选择指导样式 */
.safari-file-guide .guide-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.safari-file-guide .fab {
    font-size: 24px;
    color: #ffffff;
}

.safari-file-guide h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
}

.safari-file-guide p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.3;
}

.safari-file-guide .guide-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.safari-file-guide .guide-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 情景选择器样式 */
.scene-selector {
    margin-bottom: 48px;
    background: var(--color-surface);
    border: 1px solid color-mix(in oklab, var(--color-bg), white 12%);
    border-radius: 20px;
    backdrop-filter: blur(18px);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 color-mix(in oklab, white 18%, transparent);
}

/* 情景标签页 */
.scene-tabs {
    display: flex;
    background: color-mix(in oklab, var(--color-bg), black 6%);
    border-bottom: 1px solid color-mix(in oklab, var(--color-bg), white 12%);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

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

.scene-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: transparent;
    border: none;
    color: #8E8E93;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    min-width: 80px;
    gap: 8px;
}

.scene-tab i {
    font-size: 1.2rem;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.scene-tab span {
    font-size: 0.8rem;
    font-weight: 500;
}

.scene-tab:hover {
    color: var(--color-text);
    background: color-mix(in oklab, var(--color-surface), white 6%);
}

.scene-tab.active {
    color: var(--color-primary-500);
    background: color-mix(in oklab, var(--color-primary-500), transparent 85%);
    border-bottom-color: var(--color-primary-500);
}

.scene-tab.active i {
    color: #6366F1;
    transform: scale(1.1);
}

/* 底部固定标签栏（移动端） */
.bottom-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 12px calc(env(safe-area-inset-bottom, 0px) + 12px);
    background: transparent;
    display: none; /* 默认桌面隐藏 */
    z-index: 30;
}

.bottom-tabbar-inner {
    margin: 0 auto;
    max-width: 680px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    background: rgba(10, 10, 10, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 28px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.35), inset 0 1px 0 color-mix(in oklab, white 18%, transparent);
    padding: 10px;
}

.bottom-tabbar .scene-tab {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 16px;
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform var(--dur-press) var(--ease-press),
                background var(--dur-enter) var(--ease-enter),
                box-shadow var(--dur-enter) var(--ease-enter);
}

.bottom-tabbar .scene-tab i { margin: 0; font-size: 1.1rem; }
.bottom-tabbar .scene-tab span { font-size: 0.85rem; }
.bottom-tabbar .scene-tab:hover { background: rgba(255, 255, 255, 0.1); }
.bottom-tabbar .scene-tab:active { transform: translateY(1px) scale(0.99); }

/* 更接近示例图的绿色主色胶囊高亮 */
.bottom-tabbar .scene-tab.active {
    color: #ffffff;
    border-color: transparent;
}

/* 场景色映射：行李=绿色、延误=橙色、韩亚=紫色 */
.bottom-tabbar .scene-tab.active[data-scene="normal"] {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.bottom-tabbar .scene-tab.active[data-scene="delay"] {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.bottom-tabbar .scene-tab.active[data-scene="other"] {
    background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* 响应式：移动端显示底部栏，隐藏顶部 tabs；为内容预留底部空间 */
@media (max-width: 768px) {
    .bottom-tabbar { display: block; }
    .scene-selector .scene-tabs { display: none; }
    .container { padding-bottom: 96px; }
}

/* 情景内容区域 */
.scene-content {
    padding: 24px;
}

.scene-panel {
    display: none;
    animation: fadeInUp 0.4s ease-out;
}

.scene-panel.active {
    display: block;
}

/* 情景头部 */
.scene-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--color-surface);
    border-radius: 16px;
    border: 1px solid color-mix(in oklab, var(--color-bg), white 12%);
}

.scene-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 
        0 4px 16px rgba(99, 102, 241, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* 行李广播分类特定样式 */
.scene-panel[data-scene="normal"] .scene-icon {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    box-shadow: 
        0 4px 16px rgba(16, 185, 129, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.scene-panel[data-scene="normal"] .scene-header {
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.05);
}

.scene-panel[data-scene="normal"] .track-item {
    border-color: rgba(16, 185, 129, 0.15);
}

.scene-panel[data-scene="normal"] .track-item:hover {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
}

.scene-panel[data-scene="normal"] .track-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

/* 行李广播播放按钮样式 */
.scene-panel[data-scene="normal"] .play-btn {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    box-shadow: 
        0 4px 16px rgba(16, 185, 129, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.scene-panel[data-scene="normal"] .play-btn:hover {
    background: linear-gradient(135deg, #0D9488 0%, #047857 100%);
    box-shadow: 
        0 8px 24px rgba(16, 185, 129, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.scene-panel[data-scene="normal"] .play-btn.playing {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    animation: luggagePulse 2s infinite;
}

@keyframes luggagePulse {
    0%, 100% { 
        box-shadow: 
            0 4px 16px rgba(5, 150, 105, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% { 
        box-shadow: 
            0 8px 32px rgba(5, 150, 105, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

.scene-info h3 {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 4px;
}

.scene-info p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* 音轨列表 */
.scene-tracks {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.track-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: var(--color-surface);
    border: 1px solid color-mix(in oklab, var(--color-bg), white 12%);
    border-radius: 12px;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.track-item:hover {
    background: color-mix(in oklab, var(--color-surface), white 6%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: color-mix(in oklab, var(--color-bg), white 18%);
}

.track-icon {
    width: 40px;
    height: 40px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366F1;
    font-size: 1rem;
    margin-right: 16px;
    flex-shrink: 0;
}

.track-details {
    flex: 1;
    min-width: 0;
}

.track-details h4 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 4px;
}

.track-details p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-item .play-btn {
    padding: 10px 16px;
    font-size: 0.9rem;
    min-width: 80px;
    margin-left: 16px;
}

/* 广播网格布局 */
.broadcast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

/* 广播卡片样式 */
.broadcast-card {
    background: var(--color-surface);
    border: 1px solid color-mix(in oklab, var(--color-bg), white 12%);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    backdrop-filter: blur(18px);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 color-mix(in oklab, white 18%, transparent);
}

.broadcast-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.04) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.broadcast-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px color-mix(in oklab, var(--color-primary-500), transparent 80%),
        inset 0 1px 0 color-mix(in oklab, white 20%, transparent);
    background: color-mix(in oklab, var(--color-surface), white 6%);
}

.broadcast-card:hover::before {
    opacity: 1;
}

/* 卡片图标 */
.card-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #A855F7 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: white;
    box-shadow: 
        0 4px 20px rgba(99, 102, 241, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.broadcast-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 
        0 8px 32px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* 卡片文字 */
.broadcast-card h3 {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--color-text);
    letter-spacing: -0.4px;
}

.broadcast-card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.4;
    font-weight: 400;
}

/* 播放按钮 */
.play-btn {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 
        0 4px 16px rgba(99, 102, 241, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    z-index: 1;
    min-width: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.play-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
}

.play-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 24px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #5B5BF7 0%, #7C3AED 100%);
}

.play-btn:hover::before {
    width: 120px;
    height: 120px;
}

.play-btn.playing {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    animation: subtlePulse 2s infinite;
}

@keyframes subtlePulse {
    0%, 100% { 
        box-shadow: 
            0 4px 16px rgba(239, 68, 68, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% { 
        box-shadow: 
            0 8px 32px rgba(239, 68, 68, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

/* 播放器状态区域 */
.now-playing {
    background: var(--color-surface);
    backdrop-filter: blur(18px);
    border: 1px solid color-mix(in oklab, var(--color-bg), white 14%);
    border-radius: var(--radius-lg);
    padding: var(--space-32);
    box-shadow: var(--shadow-lg), inset 0 1px 0 color-mix(in oklab, white 22%, transparent);
    animation: slideUp var(--dur-enter) var(--ease-enter) 0.1s both;
    /* 置顶便于手机操作 */
    position: sticky;
    top: calc(env(safe-area-inset-top, 0px) + var(--space-8));
    z-index: 20;
    margin-bottom: var(--space-24);
    transition: padding var(--dur-level) var(--ease-level), border-radius var(--dur-level) var(--ease-level), box-shadow var(--dur-level) var(--ease-level), background var(--dur-level) var(--ease-level);
}

/* 迷你模式（滚动后收缩） */
.now-playing.now-playing--mini { padding: 12px; border-radius: var(--radius-md); background: rgba(10, 10, 10, 0.15); border: 1px solid rgba(255, 255, 255, 0.06); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 10px 40px rgba(0,0,0,0.35), inset 0 1px 0 color-mix(in oklab, white 18%, transparent); }

.now-playing.now-playing--mini .playing-icon { width: 28px; height: 28px; font-size: 0.9rem; }

.now-playing.now-playing--mini #currentTrack { font-size: var(--fs-16); margin-bottom: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.now-playing.now-playing--mini .status-text { display: none; }

.now-playing.now-playing--mini .progress-bar { height: 2px; margin-bottom: 2px; }
.now-playing.now-playing--mini .time-display { display: none; }

.now-playing.now-playing--mini .controls { display: none; }

.now-playing.now-playing--mini .control-btn .btn-text { display: none; }

.now-playing.now-playing--mini .control-btn { padding: 6px 8px; }

.now-playing.now-playing--mini .volume-control i { font-size: 0.85rem; }

.now-playing.now-playing--mini .volume-slider {
    width: 70px;
}

.now-playing.now-playing--mini .playing-header { margin-bottom: var(--space-4); }
.now-playing.now-playing--mini .playing-icon i { animation: none; }

/* 迷你模式下的操作区与按钮 */
.mini-actions { display: inline-flex; align-items: center; gap: 8px; }
.mini-pp-btn {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--color-text);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--dur-enter) var(--ease-enter), border-color var(--dur-enter) var(--ease-enter), transform var(--dur-press) var(--ease-press);
}
.mini-pp-btn:hover { background: rgba(255, 255, 255, 0.06); box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
.mini-pp-btn:active { transform: scale(0.98); }
.mini-pp-btn:focus-visible { outline: 2px solid rgba(99, 102, 241, 0.6); outline-offset: 2px; }
.now-playing.now-playing--mini .mini-pp-btn { display: inline-flex; }

.expand-toggle-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 8px 10px;
    color: var(--color-text);
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 8px;
    transition: background var(--dur-enter) var(--ease-enter), border-color var(--dur-enter) var(--ease-enter), transform var(--dur-press) var(--ease-press);
}
.expand-toggle-btn:hover { background: rgba(255, 255, 255, 0.06); }
.expand-toggle-btn:active { transform: scale(0.98); }
.expand-toggle-btn:focus-visible { outline: 2px solid rgba(99, 102, 241, 0.6); outline-offset: 2px; }
.now-playing.now-playing--mini .expand-toggle-btn { display: inline-flex; }
.now-playing.now-playing--mini .expand-toggle-btn .btn-text { display: none; }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 播放信息 */
.playing-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.playing-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.playing-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-600) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    box-shadow: 
        0 4px 16px rgba(99, 102, 241, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.playing-animation {
    animation: rotate 2s linear infinite;
}

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

.playing-text {
    flex: 1;
    min-width: 0; /* 允许省略号生效 */
}

/* 条形可视化（Bar Visualizer） */
.bar-visualizer {
    display: none;
    height: 16px;
    gap: 2px;
    align-items: flex-end;
    justify-content: flex-start;
    margin: 0 12px;
    opacity: 0.95;
}
.now-playing.now-playing--mini .bar-visualizer { display: flex; }
.bar-visualizer.center { align-items: center; }
.bar-visualizer .bar {
    width: 4px;
    height: 20%;
    background: linear-gradient(180deg, var(--color-primary-500), var(--color-primary-600));
    border-radius: 999px;
    transform-origin: bottom center;
    transition: height 80ms linear, opacity 120ms ease;
}
.bar-visualizer.center .bar { transform-origin: center center; }

#currentTrack {
    font-size: var(--fs-18);
    font-weight: 500;
    color: var(--color-text);
    display: block;
    margin-bottom: 6px;
    letter-spacing: -0.4px;
}

.status-text {
    color: var(--color-text-muted);
    font-size: var(--fs-14);
    font-weight: 400;
}

/* 迷你切换按钮 */
.mini-toggle-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 8px 12px;
    color: var(--color-text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.mini-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.now-playing.now-playing--mini .mini-toggle-btn .btn-text {
    display: none;
}

.now-playing.now-playing--mini .mini-toggle-btn {
    padding: 6px 8px;
}

.mini-toggle-btn[aria-pressed="true"] {
    outline: 1px solid rgba(99, 102, 241, 0.6);
}

/* 迷你强制但手动展开时的样式恢复 */
.now-playing.now-playing--mini.now-playing--expanded {
    padding: 16px 20px;
}
.now-playing.now-playing--mini.now-playing--expanded .status-text { display: inline; }
.now-playing.now-playing--mini.now-playing--expanded .time-display { display: flex; }
.now-playing.now-playing--mini.now-playing--expanded .controls { display: flex; }
.now-playing.now-playing--mini.now-playing--expanded .mini-pp-btn { display: none; }
.now-playing.now-playing--mini.now-playing--expanded .expand-toggle-btn i { transform: none; }

/* 进度条 */
.progress-container {
    margin-bottom: 20px;
}

.progress-container { padding: 6px 0; }
.progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary-500) 0%, var(--color-primary-600) 100%);
    border-radius: 999px;
    width: 0%;
    transition: width 0.1s ease;
    position: relative;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: var(--fs-14);
    line-height: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--color-text);
    margin-left: 8px;
}
.badge.lang { background: rgba(99, 102, 241, 0.15); border-color: rgba(99, 102, 241, 0.35); }

.progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: #6366F1;
    border-radius: 50%;
    box-shadow: 
        0 0 12px rgba(99, 102, 241, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.time-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #8E8E93;
    font-size: 0.9rem;
    font-weight: 400;
}

/* 控制区域 */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px 24px;
    color: #F2F2F7;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(8px);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-2px);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* 音量控制 */
.volume-control {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #F5F5F7;
}

.volume-control i {
    color: #8E8E93;
    font-size: 1rem;
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 
        0 0 12px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    box-shadow: 
        0 0 16px rgba(99, 102, 241, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#volumeValue {
    font-size: 0.85rem;
    color: #8E8E93;
    min-width: 30px;
    text-align: right;
}

/* 系统音量优先：隐藏独立音量控制条 */
.volume-control { display: none !important; }

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .header {
        padding: 24px;
        margin-bottom: 32px;
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
    
    .scene-selector {
        margin-bottom: 32px;
    }
    
    .scene-tabs {
        padding: 0 8px;
    }
    
    .scene-tab {
        padding: 12px 8px;
        min-width: 70px;
        gap: 4px;
    }
    
    .scene-tab i {
        font-size: 1rem;
        margin-bottom: 2px;
    }
    
    .scene-tab span {
        font-size: 0.7rem;
    }
    
    .scene-content {
        padding: 16px;
    }
    
    .scene-header {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .scene-icon {
        width: 40px;
        height: 40px;
    }
    
    .scene-info h3 {
        font-size: 1.1rem;
    }
    
    .scene-info p {
        font-size: 0.8rem;
    }
    
    .track-item {
        padding: 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .track-icon {
        margin-right: 0;
        align-self: center;
    }
    
    .track-details {
        text-align: center;
    }
    
    .track-details h4 {
        font-size: 0.95rem;
    }
    
    .track-item .play-btn {
        margin-left: 0;
        align-self: center;
    }
    
    .broadcast-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .broadcast-card {
        padding: 24px;
    }
    
    .controls {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .volume-control {
        justify-content: space-between;
    }
    
    .volume-slider {
        width: 100px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 20px;
        margin-bottom: 24px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .broadcast-card {
        padding: 20px;
    }
    
    .now-playing {
        padding: 20px;
    }
    
    .controls {
        gap: 12px;
    }
    
    .play-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* 加载动画 */
.fade-in {
    animation: fadeInUp 0.4s ease-out;
}

.fade-in-delay-1 {
    animation: fadeInUp 0.4s ease-out 0.1s both;
}

.fade-in-delay-2 {
    animation: fadeInUp 0.4s ease-out 0.2s both;
}

.fade-in-delay-3 {
    animation: fadeInUp 0.4s ease-out 0.3s both;
}

/* 情景切换动画 */
.scene-transition-in {
    animation: sceneSlideIn 0.5s ease-out;
}

@keyframes sceneSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 按钮文本 */
.btn-text {
    font-weight: 500;
}

/* iOS 专用文件选择样式 */
.ios-file-upload-area {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.1) 0%, rgba(0, 82, 204, 0.1) 100%);
    border: 2px dashed rgba(0, 122, 255, 0.4);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.ios-file-upload-area .upload-icon {
    background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
    color: white;
}

.ios-upload-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.ios-upload-btn {
    background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 
        0 4px 16px rgba(0, 122, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
    justify-content: center;
}

.ios-upload-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 24px rgba(0, 122, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #0051D5 0%, #003D99 100%);
}

.ios-upload-btn:active {
    transform: translateY(0) scale(0.98);
}

/* 拖拽上传区域 */
.drop-zone {
    background: rgba(255, 255, 255, 0.04);
    border: 2px dashed rgba(99, 102, 241, 0.4);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone.dragover {
    background: rgba(99, 102, 241, 0.1);
    border-color: #6366F1;
    transform: scale(1.02);
}

.drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.drop-content i {
    font-size: 2.5rem;
    color: #6366F1;
}

.drop-content h4 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #F2F2F7;
    margin-bottom: 4px;
}

.drop-content p {
    color: #8E8E93;
    font-size: 0.9rem;
}

/* iOS 移动端优化 */
@media (max-width: 768px) {
    .ios-upload-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .ios-upload-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .drop-zone {
        padding: 24px;
        min-height: 100px;
    }
    
    .drop-content i {
        font-size: 2rem;
    }
    
    .drop-content h4 {
        font-size: 1rem;
    }
}

/* 通知系统样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(139, 92, 246, 0.9) 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    backdrop-filter: blur(20px);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.3s ease;
    max-width: 300px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
}

.notification-content i {
    font-size: 1rem;
    flex-shrink: 0;
}

.notification-info {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(139, 92, 246, 0.9) 100%);
}

.notification-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9) 0%, rgba(5, 150, 105, 0.9) 100%);
}

.notification-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.9) 100%);
}

.notification-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.9) 0%, rgba(217, 119, 6, 0.9) 100%);
}

/* 自定义文件项样式 */
.custom-file-item {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.custom-file-item:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.5);
}

.custom-file-item .file-icon {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    color: white;
}

.custom-file-item .file-size {
    color: #6366F1;
    font-weight: 500;
}

/* 移动端文件选择提示 */
.mobile-file-hint {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95) 0%, rgba(139, 92, 246, 0.95) 100%);
    color: white;
    padding: 24px;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    z-index: 10001;
    max-width: 320px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* iOS文件选择状态指示器 */
.ios-file-status {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.9) 0%, rgba(0, 82, 204, 0.9) 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideUp 0.3s ease;
}

.ios-file-status i {
    animation: rotate 1s linear infinite;
}

.ios-file-status.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9) 0%, rgba(5, 150, 105, 0.9) 100%);
}

.ios-file-status.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.9) 100%);
}

/* iOS文件选择按钮增强 */
.ios-upload-enhanced {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.1) 0%, rgba(0, 82, 204, 0.1) 100%);
    border: 2px solid rgba(0, 122, 255, 0.4);
    border-radius: 16px;
    padding: 20px;
    margin: 10px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ios-upload-enhanced:hover {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.2) 0%, rgba(0, 82, 204, 0.2) 100%);
    border-color: rgba(0, 122, 255, 0.6);
    transform: translateY(-2px);
}

.ios-upload-enhanced:active {
    transform: translateY(0);
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.3) 0%, rgba(0, 82, 204, 0.3) 100%);
}

.ios-upload-enhanced .ios-upload-content {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.ios-upload-enhanced .ios-upload-icon {
    font-size: 1.5rem;
    color: rgba(0, 122, 255, 0.8);
}

.ios-upload-enhanced .ios-upload-text {
    font-weight: 500;
    color: white;
}

.ios-upload-enhanced .ios-upload-subtext {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

/* iOS文件选择加载动画 */
.ios-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hint-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.hint-content i {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
    margin-top: 2px;
}

.hint-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
}

.hint-content p {
    font-size: 0.9rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 4px;
}

.hint-content p:last-child {
    margin-bottom: 0;
}

.hint-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.hint-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* 延误广播分类特定样式 */
.scene-panel[data-scene="delay"] .scene-icon {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    box-shadow: 
        0 4px 16px rgba(245, 158, 11, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.scene-panel[data-scene="delay"] .scene-header {
    border-color: rgba(245, 158, 11, 0.2);
    background: rgba(245, 158, 11, 0.05);
}

.scene-panel[data-scene="delay"] .track-item {
    border-color: rgba(245, 158, 11, 0.15);
}

.scene-panel[data-scene="delay"] .track-item:hover {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.3);
}

.scene-panel[data-scene="delay"] .track-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
}

/* 延误原因图标特殊样式 */
.scene-panel[data-scene="delay"] .track-icon i.fa-tools {
    color: #D97706;
}

.scene-panel[data-scene="delay"] .track-icon i.fa-plane-arrival {
    color: #DC2626;
}

.scene-panel[data-scene="delay"] .track-icon i.fa-cloud-rain {
    color: #2563EB;
}

.scene-panel[data-scene="delay"] .track-icon i.fa-broadcast-tower {
    color: #7C3AED;
}

/* 延误广播播放按钮样式 */
.scene-panel[data-scene="delay"] .play-btn {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    box-shadow: 
        0 4px 16px rgba(245, 158, 11, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.scene-panel[data-scene="delay"] .play-btn:hover {
    background: linear-gradient(135deg, #E88A0A 0%, #C26804 100%);
    box-shadow: 
        0 8px 24px rgba(245, 158, 11, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.scene-panel[data-scene="delay"] .play-btn.playing {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    animation: delayPulse 2s infinite;
}

@keyframes delayPulse {
    0%, 100% { 
        box-shadow: 
            0 4px 16px rgba(220, 38, 38, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% { 
        box-shadow: 
            0 8px 32px rgba(220, 38, 38, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

/* iOS 文件帮助样式 */
.ios-file-help {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.95) 0%, rgba(0, 82, 204, 0.95) 100%);
    color: white;
    padding: 28px;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    z-index: 10002;
    max-width: 360px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.help-content {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.help-content i {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
    margin-top: 4px;
}

.help-content h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: white;
    line-height: 1.3;
}

.help-content p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 10px;
}

.help-content p:last-child {
    margin-bottom: 0;
}

.help-content strong {
    color: rgba(255, 255, 255, 1);
    font-weight: 600;
}

.help-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.help-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* iOS 文件选择指导样式 */
.ios-file-guide {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.98) 0%, rgba(0, 82, 204, 0.98) 100%);
    color: white;
    padding: 32px;
    border-radius: 24px;
    backdrop-filter: blur(20px);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.15);
    z-index: 10003;
    max-width: 400px;
    width: 92%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    opacity: 1;
    transition: all 0.3s ease;
}

.guide-container {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.guide-icon {
    background: rgba(255, 255, 255, 0.2);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.guide-icon i {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.95);
}

.guide-container h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
    margin-bottom: 20px;
    line-height: 1.3;
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.08);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.step-number {
    background: rgba(255, 255, 255, 0.9);
    color: rgba(0, 122, 255, 1);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 1rem;
    font-weight: 500;
    color: white;
    margin-bottom: 6px;
    line-height: 1.3;
}

.step-content p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    margin: 0;
}

.guide-tips {
    background: rgba(255, 255, 255, 0.06);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 20px;
}

.guide-tips h4 {
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 12px;
}

.guide-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guide-tips li {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    line-height: 1.4;
}

.guide-tips li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: rgba(0, 122, 255, 0.8);
    font-size: 1rem;
}

.guide-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    line-height: 1;
}

.guide-close:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
    color: white;
}

/* 移动端特定的优化 */
@media (max-width: 768px) {
    .mobile-file-hint {
        width: 85%;
        padding: 20px;
        border-radius: 16px;
    }
    
    .hint-content {
        gap: 12px;
    }
    
    .hint-content i {
        font-size: 1.2rem;
    }
    
    .hint-content h4 {
        font-size: 1rem;
        margin-bottom: 6px;
    }
    
    .hint-content p {
        font-size: 0.85rem;
    }
    
    .hint-close {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    /* 延误广播移动端优化 */
    .scene-panel[data-scene="delay"] .track-item {
        padding: 18px 16px;
    }
    
    .scene-panel[data-scene="delay"] .track-icon {
        width: 36px;
        height: 36px;
    }
    
    .scene-panel[data-scene="delay"] .track-icon i {
        font-size: 0.9rem;
    }
    
    .scene-panel[data-scene="delay"] .track-details h4 {
        font-size: 0.95rem;
    }
    
    .scene-panel[data-scene="delay"] .track-details p {
        font-size: 0.8rem;
    }
    
    /* iOS 帮助移动端优化 */
    .ios-file-help {
        width: 85%;
        padding: 24px;
        border-radius: 16px;
    }
    
    .help-content {
        gap: 16px;
    }
    
    .help-content i {
        font-size: 1.5rem;
        margin-top: 2px;
    }
    
    .help-content h3 {
        font-size: 1.1rem;
        margin-bottom: 16px;
    }
    
    .help-content h4 {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .help-content p {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .guide-close {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .guide-container {
        gap: 16px;
    }
    
    .guide-icon {
        width: 48px;
        height: 48px;
    }
    
    .guide-icon i {
        font-size: 1.5rem;
    }
    
    .step {
        padding: 12px;
        gap: 10px;
    }
    
    .step-number {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
    
    .step-content h4 {
        font-size: 0.95rem;
        margin-bottom: 4px;
    }
    
    .step-content p {
        font-size: 0.8rem;
    }
    
    .guide-tips {
        padding: 12px;
        margin-bottom: 16px;
    }
    
    .guide-tips h4 {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
    
    .guide-tips li {
        font-size: 0.8rem;
        margin-bottom: 6px;
        padding-left: 16px;
    }
    
    .guide-close {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
}
:root {
    /* Colors */
    --color-bg: #0F1117;
    --color-surface: rgba(255, 255, 255, 0.04);
    --color-surface-strong: rgba(255, 255, 255, 0.06);
    --color-text: #F2F2F7;
    --color-text-muted: #8E8E93;
    --color-primary-500: #6366F1;
    --color-primary-600: #8B5CF6;
    --color-danger-500: #EF4444;
    --color-danger-600: #DC2626;

    /* Radii */
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;

    /* Spacing */
    --space-4: 4px;
    --space-6: 6px;
    --space-8: 8px;
    --space-10: 10px;
    --space-12: 12px;
    --space-16: 16px;
    --space-20: 20px;
    --space-24: 24px;
    --space-32: 32px;

    /* Shadows */
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.2);

    /* Font sizes */
    --fs-14: 0.875rem;
    --fs-16: 1rem;
    --fs-18: 1.125rem;
    --fs-20: 1.25rem;
}

/* Apple Liquid Glass 2025 Tokens (OKLCH) with graceful fallback */
@supports (color: oklch(0 0 0)) {
  :root {
    /* Core tokens */
    --brand: oklch(0.65 0.12 25);
    --bg: oklch(0.98 0.01 250);
    --bg-dark: oklch(0.18 0.02 250);
    --text-dark: oklch(0.12 0.03 250);
    --text-light: oklch(0.98 0.02 250 / 0.92);
    --glass-dark: color-mix(in oklab, var(--bg-dark), white 12%);
    --glass-light: color-mix(in oklab, var(--bg), black 6%);
  }

  /* System theme — dark */
  @media (prefers-color-scheme: dark) {
    :root {
      --color-bg: var(--bg-dark);
      --color-text: var(--text-light);
      --color-surface: color-mix(in oklab, var(--bg-dark), white 6%);
      --color-surface-strong: color-mix(in oklab, var(--bg-dark), white 9%);
      --color-primary-500: var(--brand);
      --color-primary-600: color-mix(in oklab, var(--brand), black 8%);
    }
  }

  /* System theme — light */
  @media (prefers-color-scheme: light) {
    :root {
      --color-bg: var(--bg);
      --color-text: var(--text-dark);
      --color-surface: color-mix(in oklab, var(--bg), black 4%);
      --color-surface-strong: color-mix(in oklab, var(--bg), black 7%);
      --color-primary-500: var(--brand);
      --color-primary-600: color-mix(in oklab, var(--brand), black 12%);
    }
  }
}

/* Explicit theme override via [data-theme] — has higher priority and bypasses system */
@supports (color: oklch(0 0 0)) {
  :root[data-theme="dark"] {
    --color-bg: var(--bg-dark);
    --color-text: var(--text-light);
    --color-surface: color-mix(in oklab, var(--bg-dark), white 6%);
    --color-surface-strong: color-mix(in oklab, var(--bg-dark), white 9%);
    --color-primary-500: var(--brand);
    --color-primary-600: color-mix(in oklab, var(--brand), black 8%);
    color-scheme: dark;
  }
  :root[data-theme="light"] {
    --color-bg: var(--bg);
    --color-text: var(--text-dark);
    --color-surface: color-mix(in oklab, var(--bg), black 4%);
    --color-surface-strong: color-mix(in oklab, var(--bg), black 7%);
    --color-primary-500: var(--brand);
    --color-primary-600: color-mix(in oklab, var(--brand), black 12%);
    color-scheme: light;
  }
}

/* Override global background with explicit theme if set */
html[data-theme="light"] body::before {
  background:
    radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(168, 85, 247, 0.04) 0%, transparent 50%),
    linear-gradient(135deg, #F7F7FA 0%, #FFFFFF 100%);
}
html[data-theme="dark"] body::before {
  background:
    radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(168, 85, 247, 0.03) 0%, transparent 50%),
    linear-gradient(135deg, #0A0A0A 0%, #111111 100%);
}

/* Motion tokens */
:root {
    --dur-enter: 220ms;
    --dur-level: 280ms;
    --dur-press: 140ms;
    --ease-enter: cubic-bezier(0.2,0.8,0.2,1);
    --ease-level: cubic-bezier(0.4,0,1,1);
    --ease-press: cubic-bezier(0.2,0.8,0.2,1);
    /* Hint UA components to support both themes */
    color-scheme: light dark;
}

/* Fallback system theme (non-OKLCH browsers) */
@media (prefers-color-scheme: light) {
  :root {
    --color-bg: #F7F7FA;
    --color-surface: #FFFFFFEE; /* semi-opaque white */
    --color-surface-strong: #FFFFFFFF;
    --color-text: #0F1117;
    --color-text-muted: #667085;
    /* keep primary brand consistent */
    --color-primary-500: #6366F1;
    --color-primary-600: #575AE9;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
    .progress-fill { transition: none; }
}

body {
    color: var(--color-text);
    background: var(--color-bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Roboto, Helvetica, Arial, sans-serif;
}
