:root {
    --unhalt-background: #efefef;
    --unhalt-foreground: #171717;
    --unhalt-card: #ffffff;
    --unhalt-card-foreground: #202020;
    --unhalt-primary: #154aa5;
    --unhalt-primary-soft: rgba(21, 74, 165, 0.08);
    --unhalt-muted: #f6f6f6;
    --unhalt-muted-foreground: #6a6a6a;
    --unhalt-border: #d9d9d9;
    --unhalt-radius-sm: 8px;
    --unhalt-radius-md: 16px;
    --unhalt-radius-lg: 28px;
    --unhalt-shadow-soft: 0 10px 30px rgba(17, 24, 39, 0.04);
    --unhalt-shadow-panel: 0 20px 50px rgba(17, 24, 39, 0.045);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--unhalt-foreground);
    background:
        radial-gradient(circle at top right, rgba(21, 74, 165, 0.07), transparent 28%),
        linear-gradient(180deg, #f4f5f7 0%, var(--unhalt-background) 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
textarea {
    font: inherit;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-shell {
    min-height: 100vh;
    padding: 24px 0 40px;
}

.topbar,
.panel,
.post-card,
.tool-card,
.article-panel,
.stat-card {
    border: 1px solid var(--unhalt-border);
    background: var(--unhalt-card);
    box-shadow: var(--unhalt-shadow-soft);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 22px;
    border-radius: 24px;
    margin-bottom: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 154px;
    height: auto;
}

.brand-mark-square {
    width: 56px;
    height: 56px;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand-copy strong {
    font-size: 0.94rem;
    letter-spacing: 0.18em;
}

.brand-copy span {
    color: var(--unhalt-muted-foreground);
    font-size: 0.92rem;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.main-nav a {
    padding: 8px 0;
    color: var(--unhalt-muted-foreground);
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.is-active {
    color: var(--unhalt-foreground);
    border-color: var(--unhalt-primary);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
    gap: 24px;
    margin-bottom: 24px;
}

.panel {
    border-radius: var(--unhalt-radius-lg);
    padding: 28px;
}

.panel.hero-primary {
    box-shadow: var(--unhalt-shadow-panel);
}

.eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--unhalt-muted-foreground);
    margin-bottom: 18px;
}

.hero-title,
.section-title,
.article-title {
    letter-spacing: 0.06em;
    margin: 0;
}

.hero-title {
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    line-height: 1.06;
}

.hero-copy,
.section-copy,
.article-meta,
.footer-note {
    color: var(--unhalt-muted-foreground);
    line-height: 1.8;
}

.hero-actions,
.chip-row,
.stat-row,
.tool-grid,
.post-grid,
.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.button,
.button-secondary,
.filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    border: 1px solid var(--unhalt-border);
    padding: 11px 18px;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.button {
    background: var(--unhalt-primary);
    border-color: var(--unhalt-primary);
    color: #ffffff;
}

.button-secondary,
.filter-chip {
    background: var(--unhalt-card);
    color: var(--unhalt-foreground);
}

.button:hover,
.button-secondary:hover,
.filter-chip:hover,
.filter-chip.is-active {
    transform: translateY(-1px);
    border-color: var(--unhalt-primary);
}

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

.stat-card {
    border-radius: var(--unhalt-radius-md);
    padding: 16px;
}

.stat-card strong {
    display: block;
    margin-top: 6px;
    font-size: 1.2rem;
}

.section {
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-title {
    font-size: clamp(1.4rem, 3vw, 2rem);
}

.post-grid,
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.post-card,
.tool-card {
    border-radius: 24px;
    padding: 22px;
}

.post-card h3,
.tool-card h3 {
    margin: 10px 0 10px;
    font-size: 1.24rem;
    letter-spacing: 0.03em;
}

.post-card p,
.tool-card p {
    margin: 0;
    color: var(--unhalt-muted-foreground);
    line-height: 1.8;
}

.meta-row {
    margin: 14px 0 16px;
    color: var(--unhalt-muted-foreground);
    font-size: 0.92rem;
}

.chip,
.source-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--unhalt-primary-soft);
    color: var(--unhalt-primary);
    font-size: 0.85rem;
}

.source-pill {
    background: var(--unhalt-muted);
    color: var(--unhalt-muted-foreground);
}

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 24px;
}

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

.article-meta {
    margin-top: 12px;
}

.article-body {
    margin-top: 28px;
    line-height: 1.9;
}

.article-body h1,
.article-body h2,
.article-body h3 {
    margin: 28px 0 12px;
    line-height: 1.3;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote,
.article-body pre {
    margin: 0 0 16px;
}

.article-body ul,
.article-body ol {
    padding-left: 24px;
}

.article-body blockquote {
    border-left: 4px solid var(--unhalt-primary);
    padding: 8px 0 8px 16px;
    color: var(--unhalt-muted-foreground);
    background: var(--unhalt-muted);
    border-radius: 0 var(--unhalt-radius-sm) var(--unhalt-radius-sm) 0;
}

.article-body pre,
.tool-demo textarea,
.tool-demo output {
    padding: 16px;
    background: #151820;
    color: #f5f7fb;
    border-radius: var(--unhalt-radius-md);
    overflow: auto;
}

.article-body code {
    font-family: Consolas, Monaco, monospace;
}

.article-body :not(pre) > code {
    padding: 2px 6px;
    background: var(--unhalt-muted);
    border-radius: 6px;
    color: var(--unhalt-primary);
}

.empty-state,
.loading {
    padding: 28px;
    border-radius: 24px;
    border: 1px dashed var(--unhalt-border);
    text-align: center;
    color: var(--unhalt-muted-foreground);
    background: rgba(255, 255, 255, 0.5);
}

.footer {
    margin-top: 16px;
    padding: 18px 0 0;
}

.footer-bar {
    border-top: 1px solid var(--unhalt-border);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 18px;
}

.tool-demo {
    display: grid;
    gap: 14px;
}

.tool-demo textarea {
    width: 100%;
    min-height: 220px;
    border: none;
    resize: vertical;
}

.tool-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.tool-metric {
    border-radius: var(--unhalt-radius-md);
    padding: 16px;
    background: var(--unhalt-card);
    border: 1px solid var(--unhalt-border);
}

.post-stats-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
    margin-top: 16px;
}

.stat-card-value {
    font-size: 1.5rem;
    letter-spacing: 0.03em;
}

.stats-note {
    margin: 18px 0 10px;
    color: var(--unhalt-muted-foreground);
    font-size: 0.92rem;
    line-height: 1.7;
}

.stats-source-list {
    display: grid;
    gap: 10px;
}

.stats-source-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--unhalt-radius-md);
    background: var(--unhalt-muted);
    border: 1px solid var(--unhalt-border);
}

.stats-source-item strong {
    font-size: 0.94rem;
    line-height: 1.5;
}

.stats-source-item span {
    color: var(--unhalt-muted-foreground);
    font-size: 0.9rem;
    white-space: nowrap;
}

.tool-shell {
    overflow: hidden;
}

.tool-frame-intro {
    margin-bottom: 24px;
}

.tool-stage-section {
    margin-bottom: 24px;
}

.tool-embed-shell {
    border: 1px solid var(--unhalt-border);
    background: var(--unhalt-card);
    box-shadow: var(--unhalt-shadow-panel);
    border-radius: var(--unhalt-radius-lg);
    padding: 12px;
}

.tool-embed-shell-wide {
    padding: 10px;
}

.tool-embed {
    width: 100%;
    display: block;
    border: 0;
    border-radius: calc(var(--unhalt-radius-lg) - 8px);
    background: #0f1318;
}

.tool-embed-tall {
    min-height: 78vh;
}

.tool-embed-game {
    min-height: 86vh;
}

body.tool-fullscreen {
    background: #101214;
}

body.tool-fullscreen .topbar,
body.tool-fullscreen .tool-frame-intro,
body.tool-fullscreen .footer {
    display: none;
}

body.tool-fullscreen .site-shell {
    padding: 0;
}

body.tool-fullscreen .container {
    width: 100%;
    max-width: none;
}

body.tool-fullscreen .tool-stage-section {
    margin: 0;
}

body.tool-fullscreen .tool-embed-shell,
body.tool-fullscreen .tool-embed {
    border-radius: 0;
    border: 0;
    box-shadow: none;
    padding: 0;
}

body.tool-fullscreen .tool-embed-game {
    min-height: 100vh;
    height: 100vh;
}

@media (max-width: 980px) {
    .hero,
    .article-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .site-shell {
        padding-top: 16px;
    }

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

    .quick-stats,
    .tool-metrics {
        grid-template-columns: 1fr;
    }

    .panel,
    .article-panel,
    .post-card,
    .tool-card {
        padding: 20px;
    }

    .brand-mark {
        width: 132px;
    }

    .brand-mark-square {
        width: 48px;
        height: 48px;
    }

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