:root {
    --canvas: #f4f5f8;
    --surface: #ffffff;
    --surface-raised: #fafaff;
    --ink: #171525;
    --muted: #68677a;
    --faint: #68677a;
    --line: #dedee8;
    --line-strong: #9a99aa;
    --accent: #7c3aed;
    --accent-ink: #ffffff;
    --accent-soft: #eee8ff;
    --shadow: 0 16px 45px rgba(33, 24, 70, 0.08);
    --radius: 14px;
    --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --canvas: #0b0f19;
        --surface: #111827;
        --surface-raised: #151d2d;
        --ink: #eef0f6;
        --muted: #a8adbd;
        --faint: #a8adbd;
        --line: #293246;
        --line-strong: #66728a;
        --accent-soft: #281d49;
        --shadow: 0 16px 45px rgba(0, 0, 0, 0.24);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --canvas: #0b0f19;
    --surface: #111827;
    --surface-raised: #151d2d;
    --ink: #eef0f6;
    --muted: #a8adbd;
    --faint: #a8adbd;
    --line: #293246;
    --line-strong: #66728a;
    --accent-soft: #281d49;
    --shadow: 0 16px 45px rgba(0, 0, 0, 0.24);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    overflow-x: hidden;
    background: var(--canvas);
}

body {
    margin: 0;
    overflow-x: hidden;
    background: var(--canvas);
    color: var(--ink);
    font: 16px/1.7 var(--font-sans);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button,
input {
    font: inherit;
}

.masthead {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.masthead-inner,
.filter-bar,
.page-shell,
.footer-inner {
    width: min(100% - 40px, 760px);
    margin: 0 auto;
}

.masthead-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-mark {
    display: inline-flex;
    min-width: 0;
    max-width: 100%;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.site-mark:hover {
    text-decoration: none;
}

.site-mark-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.site-pulse {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--accent-soft), 0 0 14px var(--accent);
}

.masthead-tools {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.rss-link,
.language-switcher a {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.02em;
}

.rss-link {
    flex: 0 0 auto;
    white-space: nowrap;
}

.rss-link:hover,
.language-switcher a:hover,
.language-switcher .is-current {
    color: var(--accent);
}

.language-switcher {
    display: flex;
    min-width: 0;
    max-width: 190px;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.language-switcher a {
    flex: 0 0 auto;
    white-space: nowrap;
}

.theme-toggle {
    display: inline-grid;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    line-height: 1;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 14px;
    scrollbar-width: thin;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 7px;
    padding: 5px 11px;
    border: 1px solid var(--line);
    border-radius: 99px;
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.filter-chip:hover,
.filter-chip.is-active {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-ink);
    text-decoration: none;
}

.filter-count {
    font-family: var(--font-mono);
    font-size: 10px;
    opacity: 0.75;
}

.page-shell {
    padding-top: 58px;
    padding-bottom: 72px;
}

.feed-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 36px;
}

.feed-heading-compact {
    margin-bottom: 28px;
}

.feed-heading h1,
.article-view h1,
.standard-page h1,
.not-found h1 {
    max-width: 680px;
    margin: 0;
    color: var(--ink);
    font-size: clamp(30px, 5vw, 46px);
    letter-spacing: -0.045em;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.eyebrow {
    margin: 0 0 9px;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.site-topic {
    max-width: 290px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.timeline {
    position: relative;
}

.timeline::before {
    position: absolute;
    top: 28px;
    bottom: 28px;
    left: 112px;
    width: 1px;
    background: var(--line-strong);
    content: "";
}

.timeline-day {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 26px 0 10px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.05em;
}

.timeline-day:first-child {
    margin-top: 0;
}

.timeline-day::before {
    width: 8px;
    height: 8px;
    margin-left: 108px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    background: var(--canvas);
    box-shadow: 0 0 0 4px var(--canvas);
    content: "";
}

.timeline-entry {
    position: relative;
    display: grid;
    grid-template-columns: 94px 36px minmax(0, 1fr);
    gap: 0;
    padding: 14px 0;
}

.entry-time {
    padding-top: 8px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.5;
    text-align: right;
}

.entry-node {
    position: relative;
}

.entry-node::after {
    position: absolute;
    top: 14px;
    left: 16px;
    width: 9px;
    height: 9px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    background: var(--canvas);
    box-shadow: 0 0 0 4px var(--canvas);
    content: "";
}

.entry-card {
    min-width: 0;
    padding: 17px 20px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.entry-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    min-height: 20px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 11px;
}

.entry-category {
    color: var(--accent);
    font-weight: 700;
}

.entry-source {
    color: var(--muted);
}

.entry-title {
    margin: 5px 0 3px;
    font-size: 20px;
    letter-spacing: -0.025em;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.entry-title a {
    color: var(--ink);
}

.entry-title a:hover {
    color: var(--accent);
    text-decoration: none;
}

.entry-summary {
    margin: 6px 0 12px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.entry-more {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
}

.signal-panel {
    margin: 42px 0 0 130px;
    padding: 22px 24px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    background: var(--surface-raised);
}

.signal-label {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.signal-copy {
    margin: 6px 0 15px;
    color: var(--muted);
    white-space: pre-line;
}

.signal-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 13px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.signal-action:hover {
    text-decoration: none;
    filter: brightness(1.08);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 38px 0 0 130px;
}

.pagination-link {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
}

.pagination-state {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 12px;
}

.empty-state {
    margin: 0;
    padding: 35px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
}

.article-view,
.standard-page {
    max-width: 700px;
    margin: 0 auto;
}

.article-kicker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 12px;
}

.article-view h1,
.standard-page h1 {
    font-size: clamp(32px, 6vw, 52px);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 12px;
}

.article-lead {
    margin: 30px 0 0;
    color: var(--muted);
    font-size: 19px;
    line-height: 1.7;
}

.article-body {
    margin-top: 34px;
    color: var(--ink);
    font-size: 17px;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.article-body h2,
.article-body h3 {
    margin-top: 2em;
    line-height: 1.3;
}

.article-body p {
    margin: 0 0 1.2em;
}

.article-body img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.article-body blockquote {
    margin: 1.5em 0;
    padding: 4px 20px;
    border-left: 3px solid var(--accent);
    color: var(--muted);
}

.article-source {
    margin: 34px 0 0;
    padding-top: 18px;
    border-top: 1px dashed var(--line-strong);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.related-stories {
    max-width: 700px;
    margin: 58px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.related-stories h2 {
    margin: 0 0 12px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.related-list {
    display: grid;
    gap: 8px;
}

.related-list a {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    min-width: 0;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    overflow-wrap: anywhere;
}

.related-list a:hover {
    color: var(--accent);
}

.not-found {
    padding: 100px 0;
    text-align: center;
}

.not-found h1 {
    margin-bottom: 28px;
    font-size: clamp(30px, 6vw, 48px);
}

.site-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 24px;
    padding-top: 23px;
    padding-bottom: 28px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

@media (max-width: 620px) {
    .masthead-inner,
    .filter-bar,
    .page-shell,
    .footer-inner {
        width: min(100% - 28px, 760px);
    }

    .masthead-inner {
        min-height: 60px;
        align-items: center;
        gap: 10px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .masthead-tools {
        flex: 1 1 auto;
        gap: 9px;
    }

    .rss-link {
        font-size: 0;
    }

    .rss-link span:first-child {
        font-size: 13px;
    }

    .language-switcher {
        flex: 1 1 auto;
        max-width: none;
        gap: 7px;
    }

    .language-switcher a {
        font-size: 11px;
    }

    .theme-toggle {
        width: 29px;
        height: 29px;
    }

    .page-shell {
        padding-top: 38px;
        padding-bottom: 54px;
    }

    .feed-heading {
        display: block;
        margin-bottom: 28px;
    }

    .site-topic {
        max-width: none;
        margin-top: 17px;
    }

    .timeline::before {
        left: 12px;
    }

    .timeline-day {
        gap: 14px;
        margin-top: 22px;
    }

    .timeline-day::before {
        margin-left: 8px;
    }

    .timeline-entry {
        grid-template-columns: 24px minmax(0, 1fr);
        gap: 14px;
        padding: 10px 0;
    }

    .entry-time {
        grid-column: 2;
        grid-row: 1;
        padding: 0 0 6px;
        text-align: left;
    }

    .entry-node {
        grid-column: 1;
        grid-row: 1 / span 2;
    }

    .entry-node::after {
        top: 6px;
        left: 8px;
    }

    .entry-card {
        grid-column: 2;
        grid-row: 2;
        padding: 15px 16px;
    }

    .entry-title {
        font-size: 18px;
    }

    .signal-panel,
    .pagination {
        margin-left: 0;
    }

    .signal-panel {
        margin-top: 30px;
        padding: 18px;
    }

    .pagination {
        margin-top: 28px;
    }

    .article-view h1,
    .standard-page h1 {
        font-size: 34px;
    }

    .article-body {
        font-size: 16px;
    }
}

@media (max-width: 430px) {
    .masthead-inner {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .site-mark {
        flex: 1 1 100%;
    }

    .masthead-tools {
        width: 100%;
        justify-content: flex-end;
    }

    .language-switcher {
        max-width: none;
    }
}
