:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --text: #191919;
    --muted: #6b6b6b;
    --line: #e7e7e5;
    --line-strong: #d9d9d6;
    --accent: #2f6feb;
    --radius: 10px;
}

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

body {
    font-family: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
}

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.header {
    padding: 10px 0 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.header h1 {
    font-size: clamp(1.75rem, 3vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.subtitle {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.95rem;
}

.loading {
    text-align: left;
    padding: 30px 0;
    color: var(--muted);
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--line);
    border-top: 2px solid var(--text);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 0 10px;
}

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

.main-content {
    display: grid;
    gap: 16px;
}

.card,
.zone-card,
.chart-container,
.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.indicator-cards {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 12px;
}

.card {
    padding: 16px;
}

.current-indicator h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.indicator-value {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 8px 0 6px;
}

.investment-zone {
    margin-top: 8px;
}

.zone-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 10px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
}

.zone-advice {
    margin-top: 8px;
    font-weight: 600;
}

.last-update {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.85rem;
}

.price-info h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.price-grid {
    display: grid;
    gap: 8px;
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--line);
    padding-top: 8px;
}

.price-item label {
    color: var(--muted);
    font-size: 0.9rem;
}

.price-item span {
    font-weight: 600;
    font-size: 0.95rem;
}

.investment-zones h2,
.charts-section h2,
.statistics h2 {
    font-size: 1.05rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.zones-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.zone-card {
    padding: 12px;
}

.zone-card h3 {
    font-size: 0.92rem;
    margin-bottom: 6px;
}

.zone-card p {
    font-size: 0.9rem;
    margin-bottom: 4px;
    font-weight: 600;
}

.zone-card small {
    color: var(--muted);
    font-size: 0.82rem;
}

.bottom-zone { border-left: 3px solid #1f8b4c; }
.dca-zone { border-left: 3px solid #2f6feb; }
.wait-zone { border-left: 3px solid #b67600; }
.overvalued-zone { border-left: 3px solid #b42318; }

.chart-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.chart-btn {
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--text);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 7px 12px;
    cursor: pointer;
}

.chart-btn:hover {
    border-color: #c9c9c5;
}

.chart-btn.active {
    background: #f5f5f4;
    border-color: #c9c9c5;
}

.chart-container {
    height: 380px;
    padding: 10px;
}

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

.stat-card {
    padding: 12px;
}

.stat-card h3 {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.1;
}

.stat-percentage {
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 3px;
}

.footer {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.82rem;
}

.footer p {
    margin: 3px 0;
}

.error-box {
    border: 1px solid #efc7c4;
    background: #fff6f6;
    border-radius: var(--radius);
    padding: 14px;
    max-width: 460px;
}

.error-message {
    color: #a32116;
    font-size: 0.95rem;
    font-weight: 600;
}

.reload-btn {
    margin-top: 10px;
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--text);
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
}

.reload-btn:hover {
    background: #f5f5f4;
}

@media (max-width: 860px) {
    .indicator-cards {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 640px) {
    .container {
        padding: 16px 12px 36px;
    }

    .zones-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .chart-controls {
        flex-direction: column;
    }

    .chart-btn {
        width: 100%;
    }

    .chart-container {
        height: 310px;
    }

    .price-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
}
