:root {
    --ink: #17211b;
    --muted: #657166;
    --panel: rgba(255, 252, 244, 0.86);
    --line: rgba(23, 33, 27, 0.14);
    --gold: #b56d18;
    --blue: #2f6fb2;
    --green: #4f8a63;
    --red: #c85b48;
    --violet: #7357a6;
    --shadow: 0 24px 66px rgba(45, 54, 44, 0.14);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    background:
        linear-gradient(90deg, rgba(23, 33, 27, 0.045) 1px, transparent 1px),
        linear-gradient(rgba(23, 33, 27, 0.045) 1px, transparent 1px),
        radial-gradient(circle at 14% 8%, rgba(255, 184, 77, 0.2), transparent 28%),
        radial-gradient(circle at 88% 12%, rgba(47, 111, 178, 0.15), transparent 30%),
        linear-gradient(135deg, #fbf0df 0%, #eef4e9 48%, #edf1f6 100%);
    background-size: 42px 42px, 42px 42px, auto, auto, auto;
}

button {
    font: inherit;
    cursor: pointer;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1,
h2,
h3 {
    letter-spacing: 0;
}

.charge-shell {
    width: min(1400px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 48px;
}

.charge-header {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) 120px;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.home-link {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    color: var(--gold);
    border: 1px solid rgba(181, 109, 24, 0.36);
    border-radius: 999px;
    background: rgba(255, 252, 243, 0.74);
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
}

.eyebrow {
    margin-bottom: 8px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.charge-header .header-title {
    margin: 0;
    font-size: 1.8em;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
}

.cloud-toggle-wrap {
    justify-self: end;
    flex-shrink: 0;
}

.display-toggle {
    position: relative;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.display-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.display-toggle i {
    position: relative;
    width: 42px;
    height: 24px;
    border: 1px solid rgba(23, 33, 27, 0.18);
    border-radius: 999px;
    background: rgba(23, 33, 27, 0.14);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.display-toggle i::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 3px 8px rgba(23, 33, 27, 0.18);
    content: "";
    transition: transform 0.2s ease;
}

.display-toggle input:checked + i {
    border-color: rgba(36, 94, 168, 0.42);
    background: var(--blue);
}

.display-toggle input:checked + i::after {
    transform: translateX(18px);
}

.tab-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 252, 244, 0.78);
    box-shadow: 0 16px 40px rgba(45, 54, 44, 0.1);
    backdrop-filter: blur(16px);
}

.tab-button {
    min-height: 42px;
    padding: 0 20px;
    color: var(--muted);
    border: 1px solid transparent;
    border-radius: 15px;
    background: transparent;
    font-size: 14px;
    font-weight: 900;
}

.tab-button.active {
    color: #fffaf0;
    border-color: rgba(23, 33, 27, 0.08);
    background: var(--ink);
    box-shadow: 0 12px 28px rgba(23, 33, 27, 0.18);
}

.tab-panel[hidden] {
    display: none;
}

.feed-sidebar,
.article-card,
.empty-panel {
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.empty-panel h2 {
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.08;
}

.empty-panel p:not(.eyebrow) {
    max-width: 660px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.75;
}

.feed-layout {
    display: grid;
    grid-template-columns: 176px minmax(0, 1fr);
    align-items: start;
    gap: 16px;
}

.feed-sidebar {
    position: sticky;
    top: 24px;
    align-self: start;
    padding: 14px;
    display: grid;
    gap: 14px;
    border-radius: 20px;
}

.category-chips {
    display: grid;
    gap: 8px;
}

.chip,
.category-tag {
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 900;
}

.chip {
    width: 100%;
    min-height: 40px;
    padding: 0 13px;
    color: var(--muted);
    background: rgba(255, 252, 244, 0.72);
    font-size: 14px;
    text-align: left;
}

.chip.active {
    color: #fffaf0;
    background: var(--ink);
}

.feed-count {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.5;
}

.article-feed {
    display: grid;
    align-content: start;
    gap: 14px;
}

.article-empty {
    margin: 0;
    padding: 20px;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    box-shadow: var(--shadow);
    font-size: 14px;
    font-weight: 800;
}

.article-card {
    padding: 20px;
    display: grid;
    grid-template-rows: auto auto auto;
    row-gap: 0;
    color: var(--ink);
    border-radius: 16px;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.article-card:hover,
.article-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(23, 33, 27, 0.26);
    box-shadow: 0 32px 78px rgba(45, 54, 44, 0.2);
    outline: none;
}

.article-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 15ch;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.article-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.article-meta span,
.article-meta strong,
.article-meta time {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.article-meta strong {
    color: var(--muted);
    text-align: center;
}

.article-meta time {
    text-align: right;
}

.category-tag {
    justify-self: end;
    max-width: 15ch;
    padding: 4px 9px;
    overflow: hidden;
    font-size: 12px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-tag.product,
.chip.product.active {
    color: #fffaf0;
    background: var(--blue);
}

.category-tag.application,
.chip.application.active,
.category-tag.partnership,
.chip.partnership.active,
.category-tag.update,
.chip.update.active {
    color: #fffaf0;
    background: var(--blue);
}

.category-tag.benchmark,
.chip.benchmark.active,
.category-tag.compute,
.chip.compute.active,
.category-tag.paper,
.chip.paper.active {
    color: #fffaf0;
    background: var(--green);
}

.category-tag.agent,
.chip.agent.active,
.category-tag.prompt,
.chip.prompt.active,
.category-tag.principle,
.chip.principle.active {
    color: #fffaf0;
    background: var(--violet);
}

.category-tag.opensource,
.chip.opensource.active,
.category-tag.funding,
.chip.funding.active,
.category-tag.executive,
.chip.executive.active {
    color: #fffaf0;
    background: var(--red);
}

.category-tag.policy,
.chip.policy.active,
.category-tag.safety,
.chip.safety.active,
.category-tag.copyright,
.chip.copyright.active,
.category-tag.other,
.chip.other.active {
    color: #fffaf0;
    background: var(--gold);
}

.article-card h3 {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    font-size: 18px;
    line-height: 1.28;
}

.article-card h3 span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fresh-badge {
    flex: 0 0 auto;
    padding: 2px 7px;
    color: #fffaf0;
    border-radius: 999px;
    background: var(--red);
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    font-size: 11px;
    font-weight: 900;
    animation: fresh-float 1.8s ease-in-out infinite;
}

@keyframes fresh-float {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2px);
    }
}

.article-summary {
    display: -webkit-box;
    margin-bottom: 15px;
    overflow: hidden;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.empty-panel {
    padding: 34px;
    border-radius: 28px;
}

@media (max-width: 920px) {
    .feed-layout {
        grid-template-columns: 1fr;
    }

    .feed-sidebar {
        position: static;
    }

    .category-chips {
        display: flex;
        overflow-x: auto;
    }

    .chip {
        width: auto;
        flex: 0 0 auto;
        text-align: center;
    }

    .article-title-row {
        grid-template-columns: minmax(0, 1fr) 12ch;
    }

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

    .article-meta strong,
    .article-meta time {
        text-align: left;
    }

    .category-tag {
        max-width: 12ch;
    }
}

@media (max-width: 640px) {
    .charge-shell {
        width: min(100% - 28px, 1180px);
        padding-top: 20px;
    }

    .charge-header {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .cloud-toggle-wrap {
        grid-column: 1 / -1;
        justify-self: end;
    }

    .tab-bar {
        overflow-x: auto;
    }

    .tab-button {
        flex: 0 0 auto;
    }

    .feed-sidebar,
    .article-card,
    .empty-panel {
        border-radius: 20px;
    }

    .feed-sidebar,
    .article-card,
    .empty-panel {
        padding: 20px;
    }
}
