:root {
    --bg: #07111f;
    --surface: rgba(15, 29, 48, 0.82);
    --surface-solid: #102039;
    --line: rgba(148, 163, 184, 0.18);
    --text: #edf5ff;
    --muted: #9fb0c6;
    --accent: #61dafb;
    --accent-strong: #36bffa;
    --warm: #fbbf24;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 8%, rgba(54, 191, 250, 0.12), transparent 32rem),
        radial-gradient(circle at 88% 24%, rgba(139, 92, 246, 0.1), transparent 28rem),
        var(--bg);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    line-height: 1.72;
}

a {
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.page-glow {
    position: fixed;
    z-index: -1;
    width: 22rem;
    height: 22rem;
    border-radius: 999px;
    filter: blur(90px);
    opacity: 0.12;
    pointer-events: none;
}

.page-glow-one {
    top: 28%;
    left: -10rem;
    background: #38bdf8;
}

.page-glow-two {
    right: -8rem;
    bottom: 10%;
    background: #8b5cf6;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 5vw;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 17, 31, 0.82);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    gap: 0.7rem;
    align-items: center;
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 0.65rem;
    color: #06101e;
    background: linear-gradient(135deg, #a5f3fc, #38bdf8);
    box-shadow: 0 8px 28px rgba(56, 189, 248, 0.28);
}

.topbar-label {
    color: var(--muted);
    font-size: 0.88rem;
}

.page-shell {
    width: min(1180px, 90vw);
    margin: 0 auto;
}

.hero {
    max-width: 800px;
    padding: 6.5rem 0 4rem;
}

.eyebrow {
    display: inline-flex;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 1.2rem;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.status-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.12);
}

.hero h1 {
    max-width: 780px;
    margin: 0;
    font-size: clamp(2.4rem, 6vw, 5.2rem);
    line-height: 1.05;
    letter-spacing: -0.045em;
}

.hero p {
    max-width: 680px;
    margin: 1.6rem 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.18rem);
}

.state-card {
    display: grid;
    min-height: 240px;
    margin-bottom: 6rem;
    place-items: center;
    align-content: center;
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.state-card[hidden],
#article-view[hidden] {
    display: none;
}

.state-card p {
    color: var(--muted);
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(97, 218, 251, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.state-error {
    padding: 2rem;
    text-align: center;
}

.state-error h2 {
    margin-bottom: 0;
}

.state-error button {
    padding: 0.72rem 1.1rem;
    border: 0;
    border-radius: 0.75rem;
    color: #06101e;
    background: var(--accent);
    font-weight: 700;
    cursor: pointer;
}

.article-header {
    padding: clamp(2rem, 6vw, 4.8rem);
    border: 1px solid var(--line);
    border-radius: 1.8rem;
    background:
        linear-gradient(140deg, rgba(54, 191, 250, 0.08), transparent 45%),
        var(--surface);
    box-shadow: var(--shadow);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.2rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.article-meta span:first-child {
    color: var(--accent);
    font-weight: 700;
}

.article-header h2 {
    max-width: 960px;
    margin: 1.3rem 0;
    font-size: clamp(1.8rem, 4.5vw, 3.5rem);
    line-height: 1.22;
    letter-spacing: -0.028em;
}

.lead {
    max-width: 850px;
    margin: 0;
    color: #c8d7e9;
    font-size: clamp(1.03rem, 2vw, 1.22rem);
}

.source-button {
    display: inline-flex;
    gap: 0.6rem;
    align-items: center;
    margin-top: 2rem;
    padding: 0.78rem 1rem;
    border: 1px solid rgba(97, 218, 251, 0.35);
    border-radius: 0.8rem;
    color: var(--accent);
    text-decoration: none;
    transition: 160ms ease;
}

.source-button:hover {
    color: #06101e;
    background: var(--accent);
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1.5rem;
    padding: 1.5rem 0 5rem;
}

.main-column {
    display: grid;
    gap: 1rem;
}

.analysis-card,
.archive-sticky,
.source-footer {
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    background: var(--surface);
    box-shadow: 0 14px 45px rgba(0, 0, 0, 0.16);
}

.analysis-card {
    padding: clamp(1.4rem, 4vw, 2.4rem);
}

.analysis-highlight {
    background:
        linear-gradient(145deg, rgba(139, 92, 246, 0.08), transparent 55%),
        var(--surface);
}

.section-heading {
    display: flex;
    gap: 0.9rem;
    align-items: baseline;
    margin-bottom: 1.2rem;
}

.section-heading h3 {
    margin: 0;
    font-size: 1.28rem;
}

.section-number {
    color: var(--accent);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.75rem;
    font-weight: 700;
}

.outline-list,
.fact-list,
.question-list {
    display: grid;
    gap: 0.8rem;
    margin: 0;
    padding-left: 1.35rem;
}

.outline-list li::marker,
.fact-list li::marker,
.question-list li::marker {
    color: var(--accent-strong);
}

.prose-block h4,
.analysis-section h4 {
    margin: 1.4rem 0 0.35rem;
    color: #dff7ff;
}

.prose-block h4:first-child {
    margin-top: 0;
}

.prose-block p,
.analysis-section p {
    margin: 0;
    color: #bfd0e4;
}

.analysis-sections,
.impact-list {
    display: grid;
    gap: 1rem;
}

.analysis-section,
.impact-item {
    padding: 1rem 1.1rem;
    border-left: 3px solid rgba(97, 218, 251, 0.6);
    border-radius: 0 0.75rem 0.75rem 0;
    background: rgba(6, 16, 30, 0.42);
}

.analysis-section h4 {
    margin-top: 0;
}

.impact-item strong {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--warm);
}

.impact-item p {
    margin: 0;
    color: #bfd0e4;
}

.archive-sticky {
    position: sticky;
    top: 82px;
    overflow: hidden;
}

.archive-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
}

.archive-heading small {
    color: var(--muted);
    font-weight: 500;
}

.archive-list {
    display: grid;
}

.archive-item {
    display: block;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    transition: background 150ms ease;
}

.archive-item:last-child {
    border-bottom: 0;
}

.archive-item:hover,
.archive-item[aria-current="page"] {
    background: rgba(97, 218, 251, 0.08);
}

.archive-item time {
    color: var(--accent);
    font-size: 0.72rem;
}

.archive-item span {
    display: -webkit-box;
    margin-top: 0.32rem;
    overflow: hidden;
    color: #d6e4f3;
    font-size: 0.88rem;
    line-height: 1.48;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.archive-empty {
    padding: 1.2rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.source-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 1.4rem;
}

.source-footer p {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.source-footer a {
    flex: none;
    color: var(--accent);
    font-size: 0.88rem;
}

.site-footer {
    padding: 2rem 5vw 3rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
    font-size: 0.8rem;
}

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

    .archive-panel {
        order: -1;
    }

    .archive-sticky {
        position: static;
    }

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

    .archive-item {
        border-right: 1px solid var(--line);
    }
}

@media (max-width: 560px) {
    .topbar {
        padding: 0 1rem;
    }

    .topbar-label {
        display: none;
    }

    .page-shell {
        width: min(100% - 1.4rem, 1180px);
    }

    .hero {
        padding: 4.5rem 0 2.8rem;
    }

    .article-header {
        border-radius: 1.25rem;
    }

    .archive-list {
        grid-template-columns: 1fr;
    }

    .archive-item {
        border-right: 0;
    }

    .source-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .spinner {
        animation-duration: 1.8s;
    }
}
