/* ===== CSS Variables ===== */
:root {
    --bg-deep: #050810;
    --bg-surface: #0a0f1a;
    --bg-elevated: #111827;
    --accent-bright: #6e29f6;
    --accent-mid: #5b1fd4;
    --accent-dark: #3b107a;
    --cyan-bright: #00e5cc;
    --cyan-mid: #14b8a6;
    --text-primary: #f0f4ff;
    --text-secondary: #8892b0;
    --text-muted: #5a6480;
    --border-subtle: rgba(136, 146, 176, .15);
    --border-accent: rgba(110, 41, 246, .3);
    --surface-card: rgba(10, 15, 26, .65);
    --surface-card-strong: rgba(10, 15, 26, .8);
    --surface-overlay: rgba(0, 0, 0, .3);
    --surface-interactive: rgba(255, 255, 255, .1);
    --surface-interactive-hover: rgba(255, 255, 255, .2);
    --surface-accent-soft: rgba(110, 41, 246, .15);
    --surface-cyan-soft: rgba(0, 229, 204, .15);
    --hero-title-start: #f0f4ff;
    --hero-title-mid: #3b82f6;
    --hero-title-end: #6e29f6;
    --shadow-accent-soft: rgba(110, 41, 246, .15);
    --shadow-accent-mid: rgba(110, 41, 246, .25);
    --shadow-accent-strong: rgba(110, 41, 246, .35);
    --shadow-cyan-soft: rgba(0, 229, 204, .15);
    --logo-glow: rgba(110, 41, 246, .4);
    --logo-glow-hover: rgba(59, 130, 246, .5);
    --coral-bright: #ff6b6b;
    --font-display: "Clash Display", system-ui, sans-serif;
    --font-body: "Satoshi", system-ui, sans-serif;
    --font-mono: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
}

/* ===== Light Mode ===== */
html[data-theme="light"] {
    --bg-deep: #fcfeff;
    --bg-surface: #ffffff;
    --bg-elevated: #f5f9ff;
    --accent-bright: #7c3aed;
    --accent-mid: #6d28d9;
    --accent-dark: #5b21b6;
    --cyan-bright: #008f87;
    --cyan-mid: #00766e;
    --text-primary: #0b1220;
    --text-secondary: #2e405c;
    --text-muted: #5f7290;
    --border-subtle: rgba(15, 23, 42, .16);
    --border-accent: rgba(124, 58, 237, .34);
    --surface-card: rgba(255, 255, 255, .88);
    --surface-card-strong: rgba(255, 255, 255, .95);
    --surface-overlay: rgba(160, 174, 194, .26);
    --surface-interactive: rgba(15, 23, 42, .1);
    --surface-interactive-hover: rgba(15, 23, 42, .16);
    --surface-accent-soft: rgba(124, 58, 237, .16);
    --surface-cyan-soft: rgba(0, 143, 135, .16);
    --hero-title-start: #5b21b6;
    --hero-title-mid: #7c3aed;
    --hero-title-end: #3b82f6;
    --shadow-accent-soft: rgba(124, 58, 237, .19);
    --shadow-accent-mid: rgba(124, 58, 237, .27);
    --shadow-accent-strong: rgba(124, 58, 237, .33);
    --shadow-cyan-soft: rgba(0, 143, 135, .22);
    --logo-glow: rgba(124, 58, 237, .2);
    --logo-glow-hover: rgba(59, 130, 246, .3);
    --coral-bright: #ee5253;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: background-color .25s ease, color .25s ease;
}

::selection {
    background: var(--accent-bright);
    color: #fff;
}

/* ===== Background Blobs ===== */
.bg-blobs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .5;
    animation: blobFloat 20s ease-in-out infinite alternate;
}

html[data-theme="light"] .blob {
    opacity: .25;
}

.blob-1 {
    width: 300px;
    height: 300px;
    background: var(--accent-bright);
    top: -5%;
    left: 0%;
    animation-duration: 22s;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--surface-overlay);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    position: relative;
    background: var(--surface-card-strong);
    border: 1px solid var(--border-accent);
    border-radius: 20px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.95) translateY(10px);
    transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 24px 80px var(--shadow-accent-mid);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface-interactive);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .2s ease;
}

.modal-close:hover {
    background: var(--surface-interactive-hover);
    color: var(--text-primary);
}

.modal-image-wrapper {
    margin-top: 16px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    background: #fff;
    padding: 16px;
}

.modal-image {
    width: 100%;
    height: auto;
    display: block;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.blob-2 {
    width: 250px;
    height: 250px;
    background: var(--cyan-bright);
    bottom: -5%;
    right: 0%;
    animation-duration: 26s;
    animation-delay: -5s;
}

.blob-3 {
    width: 200px;
    height: 200px;
    background: #3b82f6;
    top: 40%;
    right: 25%;
    animation-duration: 24s;
    animation-delay: -10s;
}

@keyframes blobFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 20px) scale(.95);
    }

    100% {
        transform: translate(10px, -10px) scale(1.02);
    }
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 999;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-card-strong);
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all .2s ease;
}

.theme-toggle:hover {
    border-color: var(--border-accent);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px var(--shadow-accent-soft);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--cyan-bright);
    outline-offset: 2px;
}

.theme-toggle-icon {
    font-size: 1.1rem;
    line-height: 1;
    color: var(--text-secondary);
    transition: transform .2s ease, color .2s ease;
}

.theme-toggle:hover .theme-toggle-icon {
    color: var(--text-primary);
    transform: rotate(15deg) scale(1.05);
}

/* ===== Container ===== */
.container {
    position: relative;
    z-index: 1;
    max-width: 860px;
    margin: 0 auto;
    padding: 60px 24px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Hero ===== */
.hero {
    text-align: center;
    margin-bottom: 56px;
    animation: fadeInUp .8s ease-out;
}

.logo-icon {
    position: relative;
    width: 120px;
    height: 100px;
    margin: 0 auto;
    animation: float 4s ease-in-out infinite;
    cursor: pointer;
    transition: transform .3s ease;
}

.logo-icon:hover {
    transform: scale(1.08);
    animation: none;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 24px var(--logo-glow));
    transition: filter .3s ease;
}

.logo-icon:hover img {
    filter: drop-shadow(0 0 36px var(--logo-glow-hover));
}

.logo-icon img {
    position: absolute;
    inset: 0;
}

.logo-dark {
    display: block;
}

.logo-light {
    display: none;
}

html[data-theme="light"] .logo-dark {
    display: none;
}

html[data-theme="light"] .logo-light {
    display: block;
}

.title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1;
    margin-bottom: 12px;
}

.title-main {
    background: linear-gradient(135deg, var(--hero-title-start) 0%, var(--hero-title-mid) 40%, var(--hero-title-end) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease infinite;
}

.tagline {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--accent-bright);
    letter-spacing: .15em;
    text-transform: uppercase;
    margin-bottom: 20px;
    animation: fadeInUp .8s ease-out .15s both;
}

.description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.7;
    animation: fadeInUp .8s ease-out .3s both;
}

/* ===== CTA Grid ===== */
.cta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 56px;
    animation: fadeInUp .8s ease-out .55s both;
}

@media(min-width: 640px) {
    .cta-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-card);
    backdrop-filter: blur(12px);
    text-decoration: none;
    color: var(--text-primary);
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
}

.cta:hover {
    transform: translateY(-4px);
    border-color: var(--border-accent);
    box-shadow: 0 12px 40px var(--shadow-accent-soft), inset 0 1px 0 rgba(255, 255, 255, .05);
}

.cta-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-bright);
    transition: transform .25s ease;
}

.cta:hover .cta-icon {
    transform: scale(1.12);
}

.cta-label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
}

.cta-sub {
    font-size: .8rem;
    color: var(--text-muted);
}

.cta-community:hover {
    border-color: var(--coral-bright);
    box-shadow: 0 12px 40px rgba(255, 107, 107, .2);
}

.cta-community:hover .cta-icon {
    color: var(--coral-bright);
}

.cta-docs:hover {
    border-color: var(--cyan-bright);
    box-shadow: 0 12px 40px var(--shadow-cyan-soft);
}

.cta-docs:hover .cta-icon {
    color: var(--cyan-bright);
}

/* ===== Latest Post ===== */
.latest-post {
    margin-bottom: 35px;
    animation: fadeInUp .8s ease-out .6s both;
    text-align: center;
}

.latest-post-card {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-radius: 50px;
    background: var(--surface-card-strong);
    border: 1px solid var(--border-subtle);
    text-decoration: none;
    color: var(--text-primary);
    transition: all .3s ease;
}

.latest-post-card:hover {
    border-color: var(--accent-bright);
    box-shadow: 0 4px 20px var(--shadow-accent-mid);
}

.latest-post-badge {
    padding: 3px 8px;
    border-radius: 12px;
    background: var(--accent-bright);
    color: #fff;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.latest-post-title {
    font-size: .9rem;
    color: var(--text-primary);
}

.latest-post-link {
    color: var(--text-muted);
    transition: color .2s;
}

.latest-post-card:hover .latest-post-link {
    color: var(--accent-bright);
}

/* ===== Section Header ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.claw-accent {
    color: var(--accent-bright);
    font-weight: 700;
}

.section-link {
    font-size: .9rem;
    color: var(--accent-bright);
    text-decoration: none;
    font-weight: 500;
    transition: color .2s ease;
}

.section-link:hover {
    color: var(--cyan-bright);
}

/* ===== Features ===== */
.features {
    margin-bottom: 56px;
    animation: fadeInUp .8s ease-out .65s both;
}

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

@media(min-width: 640px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.feature-card {
    display: block;
    padding: 24px;
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-card);
    backdrop-filter: blur(12px);
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    text-decoration: none;
    color: inherit;
    cursor: default;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-bright);
    box-shadow: 0 12px 40px var(--shadow-accent-soft);
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: var(--surface-accent-soft);
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    color: var(--accent-bright);
}

.feature-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.feature-desc {
    font-size: .9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ===== Quick Start ===== */
.quickstart {
    margin-bottom: 56px;
    animation: fadeInUp .8s ease-out .45s both;
}

.code-block {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--surface-overlay);
    border-bottom: 1px solid var(--border-subtle);
}

.code-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.code-dot:nth-child(1) {
    background: #ff5f57;
}

.code-dot:nth-child(2) {
    background: #febc2e;
}

.code-dot:nth-child(3) {
    background: #28c840;
}

.tab-switch {
    display: flex;
    gap: 4px;
    background: var(--surface-overlay);
    padding: 3px;
    border-radius: 6px;
    margin-left: auto;
}

.tab-btn {
    font-family: var(--font-mono);
    font-size: .75rem;
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s ease;
}

.tab-btn:hover {
    color: var(--text-secondary);
}

.tab-btn.active {
    background: var(--accent-bright);
    color: #fff;
    font-weight: 600;
}

.code-content {
    padding: 16px 20px;
}

.code-panel {
    display: none;
}

.code-panel.active {
    display: block;
}

.code-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-family: var(--font-mono);
    font-size: .88rem;
    line-height: 1.6;
}

.code-line.comment {
    color: var(--text-muted);
    font-style: italic;
}

.code-line.cmd {
    color: var(--text-primary);
}

.code-prompt {
    color: var(--accent-bright);
    user-select: none;
}

.cmd-text {
    color: var(--cyan-bright);
}

.copy-line-btn {
    opacity: .5;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: var(--surface-interactive);
    color: var(--text-muted);
    cursor: pointer;
    transition: all .2s ease;
    flex-shrink: 0;
}

.code-line:hover .copy-line-btn {
    opacity: 1;
}

.copy-line-btn:hover {
    background: var(--surface-interactive-hover);
    color: var(--text-primary);
}

.copy-line-btn.copied {
    opacity: 1;
    background: var(--surface-cyan-soft);
    color: var(--cyan-bright);
}

.copy-line-btn svg {
    width: 14px;
    height: 14px;
}

.quickstart-note {
    margin-top: 16px;
    margin-bottom: 16px;
    font-size: .9rem;
    color: var(--text-muted);
    text-align: center;
}


/* ===== Footer ===== */
.footer {
    margin-top: auto;
    padding-top: 40px;
    text-align: center;
    font-size: .9rem;
    color: var(--text-muted);
    animation: fadeInUp .8s ease-out .75s both;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    column-gap: 8px;
    row-gap: 8px;
    margin-bottom: 16px;
    font-size: .95rem;
}

.footer-separator {
    color: var(--text-muted);
    margin: 0 4px;
}

.footer a {
    color: var(--accent-bright);
    text-decoration: none;
    transition: color .2s ease;
}

.footer a:hover {
    color: var(--cyan-bright);
}

.footer .disclaimer {
    margin-top: 12px;
    font-size: .8rem;
    opacity: .7;
}

/* ===== Models Showcase (Infinite Scroll) ===== */
.models-showcase {
    margin-top: 64px;
    margin-bottom: 56px;
    animation: fadeInUp .8s ease-out .7s both;
    overflow: hidden;
    margin-left: -24px;
    margin-right: -24px;
    padding: 0 24px;
}

.models-showcase .section-header {
    padding: 0 24px;
}

.models-track {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-left: -24px;
    margin-right: -24px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.models-track:focus-within .models-row {
    animation-play-state: paused;
}

.models-row {
    display: flex;
    gap: 16px;
    width: max-content;
    padding: 4px 0;
}

.row-1 {
    animation: scroll-left 60s linear infinite;
}

.row-2 {
    animation: scroll-right 70s linear infinite;
}

.models-row:hover {
    animation-play-state: paused;
}

.model-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    min-width: 220px;
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-card-strong);
    backdrop-filter: blur(8px);
    text-decoration: none;
    color: var(--text-primary);
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    flex-shrink: 0;
}

.model-card:hover {
    border-color: var(--accent-bright);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-accent-soft);
}

.model-logo {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.model-logo-dark {
    display: block;
}

.model-logo-light {
    display: none;
}

html[data-theme="light"] .model-logo-dark {
    display: none;
}

html[data-theme="light"] .model-logo-light {
    display: block;
}

.model-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.model-name {
    font-family: var(--font-display);
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.2;
}

.model-lab {
    font-size: .75rem;
    color: var(--text-muted);
    font-weight: 400;
}

@media(max-width:480px) {
    .models-showcase {
        margin-left: -16px;
        margin-right: -16px;
        padding: 0 16px;
    }

    .models-showcase .section-header {
        padding: 0 16px;
    }

    .models-track {
        margin-left: -16px;
        margin-right: -16px;
    }

    .model-card {
        min-width: 180px;
        padding: 10px 14px;
        gap: 10px;
    }

    .model-logo {
        width: 22px;
        height: 22px;
    }

    .model-name {
        font-size: .85rem;
    }

    .model-lab {
        font-size: .7rem;
    }
}

/* ===== Animations ===== */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

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

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes scroll-left {
    0% {
        transform: translate(0);
    }

    100% {
        transform: translate(-50%);
    }
}

@keyframes scroll-right {
    0% {
        transform: translate(-50%);
    }

    100% {
        transform: translate(0);
    }
}

@media(prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ===== Responsive ===== */
@media(max-width: 480px) {
    .container {
        padding: 40px 16px 32px;
    }

    .logo-icon {
        width: 90px;
        height: 90px;
    }

    .cta {
        padding: 20px 12px;
    }

    .cta-label {
        font-size: .9rem;
    }

    .feature-card {
        padding: 18px;
    }

    .code-header {
        gap: 8px;
    }

    .code-content {
        padding: 12px 14px;
        font-size: .78rem;
    }

    .footer-nav {
        gap: 6px;
        font-size: .85rem;
    }
}

/* ============================================================ */
/* ===== Capability Grid (首页能力矩阵) ===== */
/* ============================================================ */

.capability-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 18px;
}

@media(min-width: 640px) {
    .capability-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

.capability-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-card);
    backdrop-filter: blur(12px);
    text-decoration: none;
    color: var(--text-primary);
    overflow: hidden;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    animation: fadeInUp .7s ease-out both;
    opacity: 0;
    min-width: 320px;
    flex-shrink: 0;
}

.capability-card:nth-child(1) { animation-delay: .05s; }
.capability-card:nth-child(2) { animation-delay: .13s; }
.capability-card:nth-child(3) { animation-delay: .21s; }
.capability-card:nth-child(4) { animation-delay: .29s; }
.capability-card:nth-child(5) { animation-delay: .37s; }
.capability-card:nth-child(6) { animation-delay: .45s; }

.capability-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-bright);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 
                inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.capability-card:hover .capability-nodes {
    color: var(--text-secondary);
    transform: translateY(-1px);
}

.capability-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--surface-accent-soft);
}

.cap-logo {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.cap-logo-dark {
    display: none;
}

.cap-logo-light {
    display: block;
}

html[data-theme="dark"] .cap-logo-dark {
    display: block;
}

html[data-theme="dark"] .cap-logo-light {
    display: none;
}

.capability-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.capability-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

.capability-count {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(120deg, var(--accent-bright), var(--cyan-bright));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.cap-count {
    /* number filled by JS */
}

.cap-count-unit {
    font-size: .72rem;
    font-weight: 500;
    -webkit-text-fill-color: var(--text-muted);
    color: var(--text-muted);
}

.capability-nodes {
    font-size: .76rem;
    color: var(--text-muted);
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .25s ease, transform .25s ease;
}

.cap-subtitle {
    text-align: center;
    font-size: .82rem;
    color: var(--text-muted);
    margin: 4px 0 8px;
    line-height: 1.5;
}

/* ===== Subhead divider ===== */
.subhead {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 30px 0 14px;
    color: var(--text-muted);
    font-size: .78rem;
    letter-spacing: .04em;
}

.subhead::before,
.subhead::after {
    content: "";
    flex: 0 1 60px;
    height: 1px;
    background: var(--border-subtle);
}

/* ===== Responsive: capability + nodes ===== */
@media(max-width: 480px) {
    .capability-card {
        padding: 16px 16px 16px 22px;
        gap: 12px;
    }
    .capability-icon {
        width: 38px;
        height: 38px;
    }
    .cap-logo {
        width: 22px;
        height: 22px;
    }
    .capability-count {
        font-size: 1rem;
    }
}

/* ============================================================ */
/* ===== Local→Cloud Flow Demo（ComfyUI 风工作流上云动画） ===== */
/* ============================================================ */

.flow-demo {
    --flow-exec: #2ee06a;        /* ComfyUI 执行态绿 */
    --flow-exec-soft: rgba(46, 224, 106, .18);
    --flow-exec-glow: rgba(46, 224, 106, .55);
    --flow-cloud-bg: rgba(82, 168, 255, .10);
    --flow-cloud-border: rgba(82, 168, 255, .40);
    --flow-cloud-glow: rgba(82, 168, 255, .20);
    margin-top: 24px;
    animation: fadeInUp .8s ease-out .6s both;
}

/* 外层固定取景框 = 本地/云端变色层（不随镜头缩放，固定在视口） */
.flow-viewport {
    position: relative;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    aspect-ratio: 16 / 8;
    overflow: hidden;
    border-radius: 18px;
    border: none;
    background: transparent;
    transition: background .55s cubic-bezier(.65, 0, .35, 1),
                box-shadow .55s cubic-bezier(.65, 0, .35, 1);
}

/* 云端态：外层 fx 框变浅蓝色（on/run1-3）——固定不缩放 */
.flow-scene[data-phase="on"] .flow-viewport,
.flow-scene[data-phase="run1"] .flow-viewport,
.flow-scene[data-phase="run2"] .flow-viewport,
.flow-scene[data-phase="run3"] .flow-viewport {
    background: var(--flow-cloud-bg);
    box-shadow: inset 0 0 28px var(--flow-cloud-glow);
}

/* 角标锚定外层视口（不随镜头缩放） */
.ws-badge {
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 3;
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: .03em;
    padding: 2px 8px;
    border-radius: 20px;
    transition: opacity .4s ease;
}

.ws-badge-local {
    color: var(--text-muted);
    background: var(--surface-interactive);
    opacity: 0;
}

.ws-badge-cloud {
    color: #9cc8ff;
    background: rgba(82, 168, 255, .16);
    border: 1px solid var(--flow-cloud-border);
    opacity: 0;
}

.flow-scene[data-phase="local"] .ws-badge-local,
.flow-scene[data-phase="handoff"] .ws-badge-local,
.flow-scene[data-phase="zoomout"] .ws-badge-local { opacity: 1; }

.flow-scene[data-phase="on"] .ws-badge-cloud,
.flow-scene[data-phase="run1"] .ws-badge-cloud,
.flow-scene[data-phase="run2"] .ws-badge-cloud,
.flow-scene[data-phase="run3"] .ws-badge-cloud { opacity: 1; }

/* 舞台：镜头缩放层，居中铺满视口，承载两条叠放的工作流。
   transform-origin 固定 50%/50%，translate + scale，easeInOutCubic 顺滑切换。 */
.flow-stage {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4%;
    transform-origin: 50% 50%;
    transition: transform .8s cubic-bezier(.65, 0, .35, 1);
    will-change: transform;
}

/* ---- 镜头运镜：translate 让目标节点居中 + scale 放大特写 ---- */
.flow-scene[data-phase="local"] .flow-stage    { transform: scale(.85) translateX(0); }
.flow-scene[data-phase="on"] .flow-stage       { transform: scale(1.02) translateX(0); }
.flow-scene[data-phase="run1"] .flow-stage     { transform: scale(1.7) translateX(28%); }
.flow-scene[data-phase="run2"] .flow-stage     { transform: scale(1.7) translateX(0); }
.flow-scene[data-phase="run3"] .flow-stage     { transform: scale(1.75) translateX(-28%); }
.flow-scene[data-phase="handoff"] .flow-stage  { transform: scale(1.75) translateX(-28%); }
.flow-scene[data-phase="zoomout"] .flow-stage  { transform: scale(.85) translateX(0); }

/* workspace：纯节点容器，无边框无背景（背景色归外层视口管）。
   两条工作流叠放重合，可见性由下方工作流切换段控制。 */
.flow-workspace {
    position: absolute;
    inset: 4%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2%;
    padding: 14px 15%;
}

/* ---- ComfyUI 风方形节点（匹配实际 ComfyUI 暗色主题） ---- */
.cf-node {
    position: relative;
    flex: 0 0 auto;
    width: clamp(60px, 22%, 96px);
    height: clamp(60px, 60%, 96px);
    border-radius: 8px;
    border: 1px solid #3a3a3a;
    background: #353535;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
    display: flex;
    flex-direction: column;
    /* 不设 overflow:hidden —— cf-exec 需要用 inset:-3px 外扩渲染绿色描边 */
    transition: border-color .35s ease, box-shadow .35s ease;
    z-index: 2; /* 确保节点渲染在连线之上 */
}

/* 标题栏：ComfyUI 深灰底 + 白字，不同节点同色 */
.cf-head {
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 0 7px;
    font-size: .56rem;
    font-weight: 600;
    letter-spacing: .01em;
    color: #ddd;
    background: #232323;
    border-radius: 8px 8px 0 0;
    white-space: nowrap;
    overflow: hidden;
}

/* 所有节点标题栏统一深灰色，不再按节点编号变色 */
.cf-node[data-node="2"] .cf-head { background: #232323; }

/* 节点 body：深色底 + 微弱横线条纹模拟控件行 */
.cf-body {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 0 0 8px 8px;
    background:
        #353535;
}

/* ComfyUI 执行态：纯绿 #0f0 描边（3px），匹配源码 strokeStyles['running'] 
   { color: '#0f0', lineWidth: 3 }  —— 包裹整个节点（含标题栏） */
.cf-exec {
    position: absolute;
    inset: -3px;
    border: 3px solid #0f0;
    border-radius: 10px;
    box-shadow: 0 0 18px rgba(0, 255, 0, .5), 0 0 6px rgba(0, 255, 0, .3);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    z-index: 5;
}

/* 进度条：ComfyUI 源码在节点 body 顶部绘制（y=0, height=6），
   这里放在标题栏下方（top:18px = cf-head 高度），高度 4px。 */
.cf-prog {
    position: absolute;
    left: 0;
    right: 0;
    top: 18px;
    height: 4px;
    background: rgba(0, 255, 0, .08);
    overflow: hidden;
}

.cf-prog span {
    display: block;
    height: 100%;
    width: 0;
    background: #0f0;
    box-shadow: 0 0 8px rgba(0, 255, 0, .6);
}

/* ---- 节点执行态：绿色框 + 进度条填充（仅云端工作流）----
   delay 0.6s 让镜头 zoom-in 到位后再亮绿框、跑进度 */
.flow-scene[data-phase="run1"] .flow-ws-cloud .cf-node[data-node="1"] .cf-exec { opacity: 1; transition: opacity .25s ease .6s; }
.flow-scene[data-phase="run2"] .flow-ws-cloud .cf-node[data-node="2"] .cf-exec { opacity: 1; transition: opacity .25s ease .6s; }
.flow-scene[data-phase="run3"] .flow-ws-cloud .cf-node[data-node="3"] .cf-exec { opacity: 1; transition: opacity .25s ease .6s; }

.flow-scene[data-phase="run1"] .flow-ws-cloud .cf-node[data-node="1"] .cf-prog span {
    width: 100%; transition: width 1.2s cubic-bezier(.16, 1, .3, 1) .6s;
}
.flow-scene[data-phase="run2"] .flow-ws-cloud .cf-node[data-node="2"] .cf-prog span {
    width: 100%; transition: width 1.3s cubic-bezier(.16, 1, .3, 1) .6s;
}
.flow-scene[data-phase="run3"] .flow-ws-cloud .cf-node[data-node="3"] .cf-prog span {
    width: 100%; transition: width 1.6s cubic-bezier(.16, 1, .3, 1) .6s;
}

/* 已执行节点保留淡绿边（云端工作流 run 进度痕迹） */
.flow-scene[data-phase="run2"] .flow-ws-cloud .cf-node[data-node="1"],
.flow-scene[data-phase="run3"] .flow-ws-cloud .cf-node[data-node="1"],
.flow-scene[data-phase="run3"] .flow-ws-cloud .cf-node[data-node="2"],
.flow-scene[data-phase="run3"] .flow-ws-cloud .cf-node[data-node="3"],
.flow-scene[data-phase="handoff"] .flow-ws-cloud .cf-node[data-node="1"],
.flow-scene[data-phase="handoff"] .flow-ws-cloud .cf-node[data-node="2"],
.flow-scene[data-phase="handoff"] .flow-ws-cloud .cf-node[data-node="3"] {
    border-color: var(--flow-exec-soft);
}

/* 本地态：本地工作流可见时节点1 轻脉冲 */
.flow-scene[data-phase="local"] .flow-ws-local .cf-node[data-node="1"],
.flow-scene[data-phase="zoomout"] .flow-ws-local .cf-node[data-node="1"] {
    animation: cfPulse 1.6s ease-in-out infinite;
}
@keyframes cfPulse {
    0%, 100% { box-shadow: 0 3px 10px rgba(0, 0, 0, .25); }
    50% { box-shadow: 0 3px 10px rgba(0, 0, 0, .25), 0 0 12px var(--shadow-accent-mid); }
}

/* ---- 工作流切换：纯垂直平移（ON: ↓ 云端降入 / handoff: ↑ 本地升入）----
   不使用淡入淡出，仅靠 translateY 滑动 + 非线性缓动，viewport overflow:hidden 自然裁切。 */
.flow-ws-cloud,
.flow-ws-local {
    position: absolute;
    inset: 4%;
    transition: transform 1s cubic-bezier(.65, 0, .35, 1);
    will-change: transform;
}

/* 默认 / local：本地居中，云端藏在上方 */
.flow-ws-local { z-index: 1; transform: translateY(0); }
.flow-ws-cloud { z-index: 2; transform: translateY(-115%); }

.flow-scene[data-phase="local"] .flow-ws-local { transform: translateY(0); }
.flow-scene[data-phase="local"] .flow-ws-cloud { transform: translateY(-115%); }

/* ON：云端↓滑入居中，本地↓滑出到下方 */
.flow-scene[data-phase="on"] .flow-ws-cloud { transform: translateY(0); }
.flow-scene[data-phase="on"] .flow-ws-local { transform: translateY(115%); }

/* 云端运行期（run1-3）：保持 ON 态 */
.flow-scene[data-phase="run1"] .flow-ws-cloud,
.flow-scene[data-phase="run2"] .flow-ws-cloud,
.flow-scene[data-phase="run3"] .flow-ws-cloud { transform: translateY(0); }
.flow-scene[data-phase="run1"] .flow-ws-local,
.flow-scene[data-phase="run2"] .flow-ws-local,
.flow-scene[data-phase="run3"] .flow-ws-local { transform: translateY(115%); }

/* handoff：云端↑滑出到上方，本地↑滑入居中 —— 与 ON 方向对称 */
.flow-scene[data-phase="handoff"] .flow-ws-cloud { transform: translateY(-115%); }
.flow-scene[data-phase="handoff"] .flow-ws-local { transform: translateY(0); }

/* zoomout / → local：本地保持居中，云端保持在上方，零切换无缝循环 */
.flow-scene[data-phase="zoomout"] .flow-ws-local { transform: translateY(0); }
.flow-scene[data-phase="zoomout"] .flow-ws-cloud { transform: translateY(-115%); }

/* ---- 钉图层：镜像 workspace 布局，图钉在节点3 位置 ----
   与 workspace 同 inset/justify，三个 pin-spacer 占位对齐节点1/2/3，
   .cf-pin 落在第三个槽位（= 节点3 内部），随镜头缩放，但不随工作流淡入淡出。 */
.pin-rail {
    position: absolute;
    inset: 4%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2%;
    padding: 14px 15%;
    pointer-events: none;
    z-index: 3;
}

.pin-spacer {
    flex: 0 0 auto;
    width: clamp(60px, 22%, 96px);
}

/* 生成图（钉在节点3 槽位）：节点大小占位框，内部图缩到节点中心小缩略图，
   不铺满节点 → 不会盖住节点头/边框。run3 出图后保持，handoff 静止不动。 */
.cf-pin {
    position: relative;
    flex: 0 0 auto;
    width: clamp(60px, 22%, 96px);
    height: clamp(60px, 60%, 96px);
    border: none;
    background: transparent;
    opacity: 0;
    transform: scale(.5);
    transition: opacity .45s ease, transform .5s cubic-bezier(.34, 1.56, .64, 1);
}

/* 节点内的小缩略图（约占节点 70%，居中，落在 body 区） */
.cf-pin::after {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    top: 26px;
    bottom: 4px;
    border-radius: 4px;
    background: linear-gradient(135deg, #6e29f6, #00e5cc 55%, #ff8a5c);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35), 0 0 14px var(--shadow-accent-mid);
    transition: box-shadow .4s ease;
}

/* run3 末尾出图（钉在节点3 位），handoff 保持不动 */
.flow-scene[data-phase="run3"] .cf-pin {
    opacity: 1;
    transform: scale(1);
    transition: opacity .45s ease .55s, transform .5s cubic-bezier(.34, 1.56, .64, 1) .55s;
}
.flow-scene[data-phase="handoff"] .cf-pin {
    opacity: 1;
    transform: scale(1);
}

/* zoomout：图随镜头一起 zoom-out 缩放（在 stage 内）。
   延迟至镜头落定 + 短暂停留后再淡出（delay 1.1s），图全程贴合节点内部。 */
.flow-scene[data-phase="zoomout"] .cf-pin {
    opacity: 0;
    transform: scale(1);
    transition: opacity .4s ease 1.1s, transform .8s cubic-bezier(.65, 0, .35, 1);
}

/* ---- 节点连线（ComfyUI 柔性曲线） ---- */
.cf-conn {
    flex: 1 1 auto;
    position: relative;
    height: 16px; /* 控制曲线下垂的深度 */
    min-width: 14px;
    background: transparent;
    z-index: 1; /* 连线在节点下方 */
}

/* 用 border-bottom 和 border-radius 画出下垂的柔性曲线
   水平两端正好位于 center，中间下垂 */
.cf-conn::after {
    content: "";
    position: absolute;
    left: -5px; /* 延伸到节点插槽中心 */
    right: -5px;
    top: 0;
    height: 100%;
    border-bottom: 2px solid #aaa;
    border-radius: 50%;
}

/* 节点插槽点：移入节点内部，显示在左右边缘 */
.cf-node::before,
.cf-node::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid #111;
    transform: translateY(-50%);
    z-index: 10;
}

/* 输入插槽（左侧，灰色） */
.cf-node::before {
    left: -4px;
    background: #a8a8a8;
}

/* 输出插槽（右侧，ComfyUI蓝） */
.cf-node::after {
    right: -4px;
    background: #4ab3f2;
}

/* 头尾节点隐藏多余插槽 */
.cf-node[data-node="1"]::before { display: none; }
.cf-node[data-node="3"]::after { display: none; }

/* ---- 生成图像：位于节点3 内部，随节点缩放、随工作流切换移动 ---- */
/* ---- 开关行（视口内左上角） ---- */
.flow-switch-row {
    position: absolute;
    top: 8px;
    left: 12px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flow-switch {
    position: relative;
    width: 62px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border-subtle);
    border-radius: 32px;
    background: var(--surface-interactive);
    cursor: default;
    transition: background .4s cubic-bezier(.16, 1, .3, 1),
                border-color .4s cubic-bezier(.16, 1, .3, 1),
                box-shadow .4s cubic-bezier(.16, 1, .3, 1);
}

.fs-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: left .5s cubic-bezier(.34, 1.56, .64, 1), background .4s ease;
}

.fs-text {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .04em;
    transition: opacity .3s ease;
}

.fs-off { right: 9px; color: var(--text-muted); opacity: 1; }
.fs-on  { left: 10px; color: var(--text-primary); opacity: 0; }

/* 开启态（on/run1-3/handoff）：云端运行期间开关保持 ON */
.flow-scene[data-phase="on"] .flow-switch,
.flow-scene[data-phase="run1"] .flow-switch,
.flow-scene[data-phase="run2"] .flow-switch,
.flow-scene[data-phase="run3"] .flow-switch,
.flow-scene[data-phase="handoff"] .flow-switch,
.flow-scene[data-phase="zoomout"] .flow-switch {
    background: var(--surface-accent-soft);
    border-color: var(--accent-bright);
    box-shadow: 0 0 18px var(--shadow-accent-mid);
}

.flow-scene[data-phase="on"] .fs-knob,
.flow-scene[data-phase="run1"] .fs-knob,
.flow-scene[data-phase="run2"] .fs-knob,
.flow-scene[data-phase="run3"] .fs-knob,
.flow-scene[data-phase="handoff"] .fs-knob,
.flow-scene[data-phase="zoomout"] .fs-knob {
    left: 33px;
    background: var(--accent-bright);
}

.flow-scene[data-phase="on"] .fs-off,
.flow-scene[data-phase="run1"] .fs-off,
.flow-scene[data-phase="run2"] .fs-off,
.flow-scene[data-phase="run3"] .fs-off,
.flow-scene[data-phase="handoff"] .fs-off,
.flow-scene[data-phase="zoomout"] .fs-off { opacity: 0; }

.flow-scene[data-phase="on"] .fs-on,
.flow-scene[data-phase="run1"] .fs-on,
.flow-scene[data-phase="run2"] .fs-on,
.flow-scene[data-phase="run3"] .fs-on,
.flow-scene[data-phase="handoff"] .fs-on,
.flow-scene[data-phase="zoomout"] .fs-on { opacity: 1; }

.flow-switch-label {
    font-size: .8rem;
    font-weight: 500;
    color: var(--accent-bright);
}

/* ---- 副文案 ---- */
.flow-caption {
    text-align: center;
    font-size: .82rem;
    color: var(--text-secondary);
    margin-top: 12px;
}

/* ---- 响应式 ---- */
@media(max-width: 640px) {
    .flow-viewport {
        aspect-ratio: 16 / 10;
    }
    .flow-workspace {
        gap: 1%;
        padding: 12px 12px;
    }
    /* 特写降级，避免裁掉节点（沿用 translateX 居中法） */
    .flow-scene[data-phase="run1"] .flow-stage { transform: scale(1.4) translateX(26%); }
    .flow-scene[data-phase="run2"] .flow-stage { transform: scale(1.4) translateX(0); }
    .flow-scene[data-phase="run3"] .flow-stage { transform: scale(1.45) translateX(-26%); }
    .flow-scene[data-phase="handoff"] .flow-stage { transform: scale(1.45) translateX(-26%); }
    .flow-scene[data-phase="local"] .flow-stage { transform: scale(.92); }
    .flow-scene[data-phase="zoomout"] .flow-stage { transform: scale(.92); }
    .cf-conn { min-width: 8px; }
}

