:root { 
    --primary: #00ff9d; 
    --accent: #ff0055;
    --bg: #0a0a0a; 
    --card: #141414; 
    --text: #e0e0e0; 
    --timeline-line: #333;
}

body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', 'Microsoft JhengHei', sans-serif; margin: 0; padding: 0; }

/* === 頂部播放器 === */
.player-header {
    background: linear-gradient(180deg, #1a1a1a 0%, var(--bg) 100%);
    padding: 40px 20px;
    text-align: center;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

h1 { margin: 0 0 10px 0; letter-spacing: 2px; text-transform: uppercase; font-size: 1.8em; color: #fff; }
.live-tag { background: var(--accent); color: white; padding: 2px 6px; border-radius: 4px; font-size: 0.6em; vertical-align: text-top; animation: pulse 2s infinite; }

.now-playing-card {
    background: #222;
    border: 1px solid #444;
    border-radius: 12px;
    padding: 20px;
    max-width: 500px;
    margin: 20px auto 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: relative; /* 給 Overlay 定位用 */
}

.track-info { margin-bottom: 15px; }
.status-label { font-size: 0.8em; font-weight: bold; letter-spacing: 1px; margin-bottom: 5px; color: #888; text-transform: uppercase; }
.track-title { font-size: 1.2em; font-weight: bold; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

audio { width: 100%; height: 30px; outline: none; margin-bottom: 10px; border-radius: 15px; }

/* 強制播放按鈕 (當自動播放失敗時顯示) */
.play-overlay {
    background: rgba(0, 255, 157, 0.9);
    color: #000;
    font-weight: bold;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 10px;
    animation: pulse 1.5s infinite;
}

.latency-controls { margin-top: 5px; display: flex; justify-content: center; align-items: center; gap: 10px; }
.sync-btn { background: #333; color: #fff; border: 1px solid #555; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 0.8em; transition: background 0.2s; }
.sync-btn:hover { background: var(--primary); color: #000; border-color: var(--primary); }

/* === 番組表 (NHK Style) === */
.schedule-container { max-width: 800px; margin: 40px auto; padding: 0 20px; }
.schedule-header { border-left: 4px solid var(--primary); padding-left: 15px; margin-bottom: 30px; font-size: 1.5em; font-weight: bold; }

.timeline { position: relative; }
.timeline::before { content: ''; position: absolute; left: 60px; top: 0; bottom: 0; width: 2px; background: var(--timeline-line); }

.program-row { display: flex; margin-bottom: 0; position: relative; }
.time-col { width: 60px; text-align: right; padding-right: 15px; font-family: monospace; font-size: 1.1em; color: #888; padding-top: 15px; }
.content-col { flex: 1; padding: 15px; margin-left: 15px; background: var(--card); border-radius: 8px; margin-bottom: 10px; border-left: 4px solid #444; transition: transform 0.2s; }

/* 類型樣式 */
.type-news .content-col { border-left-color: #0066ff; background: linear-gradient(90deg, #101825 0%, #141414 100%); }
.type-music .content-col { border-left-color: #aa00ff; }

.prog-title { font-weight: bold; font-size: 1.1em; margin-bottom: 4px; }
.prog-desc { font-size: 0.85em; color: #aaa; }
.prog-duration { font-size: 0.8em; color: #666; float: right; }

/* 現正播放高亮 */
.program-row.active .content-col { border: 1px solid var(--primary); box-shadow: 0 0 15px rgba(0, 255, 157, 0.1); }
.program-row.active .time-col { color: var(--primary); font-weight: bold; }

.footer { text-align: center; margin-top: 50px; padding: 20px; color: #555; font-size: 0.9em; border-top: 1px solid #222; }
.footer a { color: #777; text-decoration: none; margin: 0 10px; }
.footer a:hover { color: var(--primary); }

@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.8; } 100% { opacity: 1; } }