:root {
    --surface-base: rgba(255, 255, 255, 0.85);
    --surface-soft: rgba(248, 253, 249, 0.9);
    --border-soft: rgba(120, 192, 152, 0.22);
    --accent-strong: #4caf7a;
    --accent-soft: #8fd5a4;
    --accent-pale: #c6efd5;
    --text-primary: #134a32;
    --text-muted: #528169;
    --chip-bg: rgba(140, 214, 167, 0.18);
    --shadow-soft: 0 16px 40px rgba(31, 74, 53, 0.14);
    color-scheme: light;
}

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

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    background: transparent;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.app {
    width: min(100%, 930px);
    margin: 0 auto;
    padding: 20px 16px 80px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.hero {
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: var(--surface-base);
    border: 1px solid var(--border-soft);
    border-radius: 22px;
    padding: 22px 18px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.badge {
    align-self: flex-start;
    padding: 4px 12px;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--accent-strong);
}

.hero h1 {
    font-size: 1.65rem;
    font-weight: 700;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.96rem;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.refresh {
    padding: 10px 20px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #66bb86, #4caf7a);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(76, 175, 122, 0.36);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.refresh:active {
    transform: scale(0.97);
}

.refresh:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.update-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

.stat-card {
    background: var(--surface-soft);
    border-radius: 18px;
    border: 1px solid rgba(143, 213, 164, 0.24);
    padding: 16px 18px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-label {
    font-size: 0.84rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent-strong);
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.stat-value .unit {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.list-section {
    background: var(--surface-base);
    border: 1px solid var(--border-soft);
    border-radius: 24px;
    padding: 24px 18px 28px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.list-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.list-header h2 {
    font-size: 1.28rem;
    font-weight: 700;
}

.list-tag {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.series-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.loading,
.error-message,
.empty-message {
    padding: 18px 16px;
    text-align: center;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.75);
    border-radius: 14px;
    border: 1px dashed rgba(120, 192, 152, 0.32);
}

.series-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 20px;
    border: 1px solid rgba(120, 192, 152, 0.2);
    padding: 16px;
    box-shadow: 0 14px 32px rgba(31, 74, 53, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.series-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(31, 74, 53, 0.16);
}

.rank-pill {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    color: #ffffff;
    background: linear-gradient(135deg, #7ed49b, #5cc88a);
}

.rank-pill.top-1 {
    background: linear-gradient(135deg, #5cc88a, #3da36b);
}

.rank-pill.top-2 {
    background: linear-gradient(135deg, #72d0a0, #55be85);
}

.rank-pill.top-3 {
    background: linear-gradient(135deg, #8fe0b4, #6fd09a);
}

.series-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.series-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.series-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.series-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
}

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

.metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metric-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.metric-value {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--accent-strong);
}

.progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.progress-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.progress-bar {
    width: 100%;
    height: 6px;
    border-radius: 6px;
    background: rgba(120, 192, 152, 0.18);
    overflow: hidden;
}

.progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(120, 192, 152, 0.9), rgba(76, 175, 122, 0.95));
    width: 0;
    transition: width 0.45s ease;
}

/* Tablet */
@media (min-width: 600px) {
    .app {
        padding: 26px 20px 96px;
        gap: 22px;
    }

    .hero {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 26px 28px;
    }

    .hero h1 {
        font-size: 1.9rem;
    }

    .hero-actions {
        align-items: flex-end;
    }

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

    .series-item {
        grid-template-columns: 70px 1fr;
        padding: 18px 22px;
    }

    .rank-pill {
        width: 54px;
        height: 54px;
        font-size: 1.2rem;
    }

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

/* Desktop */
@media (min-width: 1024px) {
    .app {
        padding: 34px 24px 110px;
    }

    .list-section {
        padding: 30px 32px 36px;
    }

    .series-item {
        grid-template-columns: 96px 1fr;
        padding: 22px 26px;
    }

    .series-name {
        font-size: 1.22rem;
    }

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

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