:root {
    --bg-color: #050505;
    --card-bg: #111111;
    --neon-blue: #00f3ff;
    --neon-magenta: #ff00ff;
    --text-primary: #e0e0e0;
    --text-dim: #888;
    --border-glow: rgba(0, 243, 255, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Noto Sans TC', 'Orbitron', sans-serif;
    overflow-x: hidden;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 50% 50%, rgba(0, 243, 255, 0.05) 0%, transparent 70%),
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 100%, 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 100;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glow);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.logo .glitch {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--neon-blue);
    text-transform: uppercase;
    position: relative;
    font-family: 'Orbitron', sans-serif;
}

.subtitle {
    display: block;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 5px;
}

.status-panel {
    display: flex;
    gap: 20px;
}

.status-item .label {
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-right: 8px;
}

.status-item .online {
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
}

/* 匯率卡片 */
.ticker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.ticker-card {
    background: var(--card-bg);
    border: 1px solid #333;
    padding: 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ticker-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--neon-blue);
    opacity: 0;
    transition: 0.3s;
}

.ticker-card:hover {
    border-color: var(--neon-blue);
    transform: translateY(-5px);
    box-shadow: 0 0 15px var(--border-glow);
}

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

.ticker-card.active {
    border-color: var(--neon-magenta);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.2);
}

.ticker-card .symbol {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.ticker-card .name {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 15px;
}

.ticker-card .rate {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--neon-blue);
    font-family: 'Orbitron', sans-serif;
}

/* 圖表區域 */
.chart-section {
    background: var(--card-bg);
    border: 1px solid #333;
    padding: 20px;
    border-radius: 8px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h2 {
    font-size: 1.1rem;
    color: var(--neon-blue);
    letter-spacing: 1px;
}

.btn {
    background: transparent;
    border: 1px solid #444;
    color: var(--text-dim);
    padding: 5px 12px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: 0.3s;
    font-family: 'Orbitron', sans-serif;
}

.btn:hover, .btn.active {
    border-color: var(--neon-blue);
    color: var(--neon-blue);
}

.chart-container {
    height: 400px;
    position: relative;
}

/* 頁尾 */
footer {
    margin-top: 50px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #222;
}

footer p {
    font-size: 0.8rem;
    color: var(--text-dim);
    letter-spacing: 2px;
}

.tech-lines {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon-blue), transparent);
    margin-top: 10px;
    opacity: 0.3;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: var(--neon-blue);
    letter-spacing: 5px;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* --- 新增組件樣式 --- */

.top-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 15px;
    margin-bottom: 25px;
}

.news-alert-box {
    background: rgba(255, 0, 0, 0.05);
    border: 1px solid rgba(255, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.news-alert-box.danger {
    background: rgba(255, 0, 0, 0.15);
    border-color: #ff4444;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.1);
}

.alert-title { color: #ff4444; font-size: 0.75rem; font-weight: bold; letter-spacing: 2px; }
.countdown { font-size: 2.8rem; font-family: 'Orbitron', sans-serif; color: #fff; margin: 5px 0; text-shadow: 0 0 10px rgba(255,255,255,0.2); }
.news-info { font-size: 0.85rem; color: #aaa; text-align: center; line-height: 1.4; }

.strength-meter-box {
    background: var(--card-bg);
    border: 1px solid #222;
    padding: 15px;
    border-radius: 8px;
}

.section-title {
    font-size: 0.85rem;
    color: var(--neon-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    border-left: 3px solid var(--neon-blue);
    padding-left: 10px;
    font-weight: bold;
}

.strength-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.strength-item {
    text-align: center;
    padding: 10px 5px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    border: 1px solid #222;
}

.strength-name { font-size: 0.7rem; color: #666; font-family: 'Orbitron', sans-serif; }
.strength-val { font-size: 1.1rem; font-weight: bold; margin-top: 5px; font-family: 'Orbitron', sans-serif; }
.strength-val.strong { color: #ff4444; text-shadow: 0 0 8px rgba(255, 68, 68, 0.3); }
.strength-val.weak { color: #00ff88; text-shadow: 0 0 8px rgba(0, 255, 136, 0.3); }

.analysis-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 30px;
}

.volatility-box, .matrix-box {
    background: var(--card-bg);
    border: 1px solid #222;
    padding: 15px;
    border-radius: 8px;
}

.vol-list { display: flex; flex-direction: column; gap: 10px; }
.vol-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    padding-bottom: 6px;
    border-bottom: 1px solid #222;
}

.vol-symbol { color: #aaa; font-family: 'Orbitron', sans-serif; }
.vol-val { color: var(--neon-blue); font-weight: bold; }

.matrix-table table { width: 100%; border-collapse: collapse; }
.matrix-table th { text-align: left; font-size: 0.75rem; color: #444; padding: 8px; border-bottom: 2px solid #222; }
.matrix-table td { padding: 12px 8px; font-size: 0.9rem; border-bottom: 1px solid #1a1a1a; font-family: 'Orbitron', sans-serif; }

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 0 auto;
}
.dot-bull { background: #ff4444; box-shadow: 0 0 8px #ff4444; }
.dot-bear { background: #00ff88; box-shadow: 0 0 8px #00ff88; }
.dot-neutral { background: #333; }

@media (max-width: 900px) {
    .top-row, .analysis-row {
        grid-template-columns: 1fr;
    }
    .strength-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
