:root {
    --bg: #f8fafc;
    --panel: rgba(255, 255, 255, 0.95);
    --panel-strong: #ffffff;
    --ink: #0f172a;
    --muted: #64748b;
    --line: rgba(148, 163, 184, 0.25);
    --accent: #3b82f6;
    --accent-deep: #2563eb;
    --accent-soft: rgba(59, 130, 246, 0.12);
    --teal: #0ea5e9;
    --navy: #1e3a8a;
    --shadow: 0 24px 64px rgba(15, 23, 42, 0.08);
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 14px;
    --content-width: 1240px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 28%),
        radial-gradient(circle at left 18%, rgba(14, 165, 233, 0.06), transparent 24%),
        linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%);
    font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

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

button {
    font: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

code {
    padding: 0.14rem 0.4rem;
    border-radius: 999px;
    background: rgba(16, 37, 63, 0.07);
    font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.9em;
}

.page-shell {
    width: min(var(--content-width), calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0 72px;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.sidebar {
    position: sticky;
    top: 16px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    height: fit-content;
    padding: 20px 18px;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-weight: 700;
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    overflow: hidden;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), #60a5fa);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-links {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
}

.nav-links a {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border-radius: 14px;
    color: var(--muted);
    transition: 0.2s ease;
}

.nav-links a:hover {
    color: var(--accent-deep);
    background: var(--accent-soft);
}

.content-shell {
    min-width: 0;
}

.section-card {
    padding: 30px;
}

.section-kicker {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.primary-button,
.secondary-button,
.action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    font-weight: 700;
    transition: 0.2s ease;
}

.primary-button,
.action-link {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 14px 28px rgba(59, 130, 246, 0.15);
}

.primary-button:hover,
.action-link:hover {
    transform: translateY(-1px);
    background: var(--accent-deep);
}

.secondary-button {
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.secondary-button:hover {
    border-color: var(--accent);
    color: var(--accent-deep);
}

.section {
    margin-bottom: 28px;
}

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

.section-head h2 {
    margin-top: 10px;
    font-size: 2rem;
    letter-spacing: -0.04em;
}

.section-head p {
    max-width: 44ch;
    color: var(--muted);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.skill-card,
.project-card,
.info-card,
.stack-card {
    border-radius: var(--radius-md);
    border: 1px solid rgba(186, 230, 253, 0.6);
    background: rgba(255, 255, 255, 0.62);
}

.skill-card {
    padding: 20px;
}

.skill-card h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.skill-card p {
    color: var(--muted);
    font-size: 0.95rem;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.tag {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(16, 37, 63, 0.07);
    color: var(--navy);
    font-size: 0.84rem;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.project-card {
    padding: 22px;
    transition: 0.2s ease;
    cursor: pointer;
}

.project-card:hover,
.project-card.active {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(61, 44, 26, 0.08);
}

.project-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.project-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(16, 37, 63, 0.08);
    color: var(--navy);
    font-size: 0.82rem;
    font-weight: 700;
}

.project-route {
    color: var(--accent-deep);
    font-size: 0.9rem;
    font-weight: 700;
}

.project-card h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
}

.project-card p {
    color: var(--muted);
    min-height: 4.6em;
}

.project-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.hint {
    color: var(--muted);
    font-size: 0.85rem;
}

.demo-shell {
    padding: 10px 0 0;
}

.demo-slide {
    display: none;
}

.demo-slide.active {
    display: block;
}

.demo-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.demo-header h3 {
    font-size: 1.65rem;
    margin-bottom: 6px;
}

.demo-header p {
    max-width: 62ch;
    color: var(--muted);
}

.metric-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.metric-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(16, 37, 63, 0.08);
    color: var(--navy);
    font-size: 0.9rem;
    font-weight: 700;
}

.demo-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.95fr);
    gap: 18px;
}

.interactive-panel,
.info-card,
.stack-card {
    padding: 20px;
}

.interactive-panel {
    border-radius: var(--radius-md);
    border: 1px solid rgba(186, 230, 253, 0.6);
    background: rgba(255, 255, 255, 0.56);
}

.console-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.console-head h4 {
    font-size: 1.08rem;
    margin-bottom: 4px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(26, 108, 105, 0.12);
    color: var(--teal);
    font-weight: 700;
    white-space: nowrap;
}

.mode-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}

.mode-tab {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(186, 230, 253, 0.4);
    background: rgba(255, 255, 255, 0.72);
    color: var(--muted);
    transition: 0.2s ease;
}

.mode-tab.active,
.mode-tab:hover {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.stage {
    padding: 18px;
    border-radius: 18px;
    background: rgba(240, 249, 255, 0.95);
    border: 1px solid rgba(186, 230, 253, 0.6);
}

.stage-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.stage-meta {
    color: var(--navy);
    font-size: 0.92rem;
    font-weight: 700;
}

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

.preview-card {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(186, 230, 253, 0.5);
}

.preview-card > span {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.9rem;
}

.preview-card-large {
    height: 100%;
}

.preview-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    overflow: hidden;
    border-radius: 14px;
    background: rgba(16, 37, 63, 0.06);
}

.preview-frame-tall {
    min-height: 360px;
}

.preview-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inspect-stage {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.95fr);
    gap: 14px;
}

.audit-readout {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.audit-grid,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.audit-box,
.stat-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 88px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(186, 230, 253, 0.5);
}

.audit-box strong,
.stat-box strong {
    font-size: 1rem;
    color: var(--navy);
}

.audit-box span,
.stat-box span {
    color: var(--muted);
    font-size: 0.88rem;
}

.audit-log {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 194px;
    padding: 14px;
    border-radius: 16px;
    background: #10253f;
    color: #d6f4ee;
    font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.84rem;
}

.audit-line {
    opacity: 0.94;
}

.progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.progress-bar {
    flex: 1;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(16, 37, 63, 0.09);
}

.progress-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #93c5fd);
    transition: width 0.2s ease;
}

.progress-text {
    color: var(--muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.sample-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.sample-chip {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(186, 230, 253, 0.5);
}

.sample-chip strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.92rem;
}

.sample-chip span {
    color: var(--muted);
    font-size: 0.88rem;
}

.info-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-card h4,
.stack-card h4 {
    font-size: 1.02rem;
    margin-bottom: 8px;
}

.info-card p,
.stack-card p {
    color: var(--muted);
}

.steps-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.steps-list li {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(240, 249, 255, 0.95);
    border: 1px solid rgba(186, 230, 253, 0.5);
    color: var(--muted);
}

.steps-list strong {
    color: var(--ink);
}

.detail-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-item {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(240, 249, 255, 0.95);
    border: 1px solid rgba(186, 230, 253, 0.5);
}

.detail-item strong {
    display: block;
    margin-bottom: 4px;
    color: var(--ink);
}

.detail-item span {
    color: var(--muted);
}

.split-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.route-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.route-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(240, 249, 255, 0.95);
    border: 1px solid rgba(186, 230, 253, 0.5);
}

.route-item span {
    color: var(--muted);
}

.api-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.api-list code {
    border-radius: 12px;
    padding: 0.55rem 0.8rem;
}

@media (max-width: 1180px) {
    .page-shell {
        grid-template-columns: 1fr;
    }

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

    .portfolio-grid,
    .split-stack,
    .sample-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .demo-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .page-shell {
        width: min(var(--content-width), calc(100% - 24px));
        padding-top: 16px;
    }

    .sidebar,
    .section-head,
    .demo-header,
    .console-head,
    .project-actions,
    .stage-head,
    .route-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-metrics,
    .portfolio-grid,
    .skills-grid,
    .preview-grid,
    .inspect-stage,
    .audit-grid,
    .stats-grid,
    .sample-strip,
    .split-stack {
        grid-template-columns: 1fr;
    }

    .preview-frame,
    .preview-frame-tall {
        min-height: 240px;
    }
}

@media (max-width: 560px) {
    .section-card {
        padding: 22px;
    }

    .brand-copy small {
        display: none;
    }
}

.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal-up.in-view {
    opacity: 1;
    transform: translateY(0);
}
