:root {
    --code-bg: #f0f4f9;
    --code-border: #e2e8f0;

    --code-grid-line: rgba(0, 0, 0, 0.03);

    --code-glow-blue: rgba(26, 115, 232, 0.06);
    --code-glow-green: rgba(52, 211, 153, 0.05);

    --code-input-bg: rgba(255, 255, 255, 0.6);
    --code-input-border: rgba(0, 0, 0, 0.06);
    --code-input-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);

    --code-label: rgba(0, 0, 0, 0.25);
    --code-text: rgba(0, 0, 0, 0.6);

    --code-cursor: rgba(0, 0, 0, 0.2);
}

.hero {
    padding: 2.5rem 0 1.5rem;
    position: relative;
    overflow: hidden;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-left .badge {
    display: inline-block;
    background: var(--color-accent-light);
    color: var(--color-accent);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.7rem;
    border-radius: 40px;
    margin-bottom: 0.5rem;
}

.hero-left h1 {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1px;
    margin-bottom: 0.4rem;
}

.hero-left h1 .highlight {
    color: var(--color-accent);
}

.hero-left .sub-text {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.8rem;
    max-width: 90%;
}

.hero-left .hero-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.hero-left .hero-stats span {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.hero-left .hero-stats strong {
    color: var(--color-text-primary);
    font-weight: 700;
}

.hero-left .hero-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.hero-right {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-right .bubble {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1/1;
    background: radial-gradient(circle at 30% 30%, var(--color-accent-light), #d2e3fc);
    border-radius: 40% 60% 30% 70% / 50% 40% 60% 50%;
    box-shadow: inset 0 0 40px rgba(26, 115, 232, 0.06);
    animation: morph 8s ease-in-out infinite alternate;
}

@keyframes morph {
    0% {
        border-radius: 40% 60% 30% 70% / 50% 40% 60% 50%;
    }

    50% {
        border-radius: 60% 40% 70% 30% / 40% 60% 50% 50%;
    }

    100% {
        border-radius: 30% 70% 50% 50% / 60% 30% 70% 40%;
    }
}

/* ============================================================
        产品展示 (带截图预览)
        ============================================================ */
.products-section {
    padding: 0.5rem 0 1.5rem;
}

.products-section .section-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: 0.8rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.product-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: 0.3s;
    box-shadow: var(--shadow-card);
}

.product-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-4px);
}

.product-card .preview {
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

.preview-code {
    background: var(--code-bg);
    border-bottom: 1px solid var(--code-border);
    position: relative;
    overflow: hidden;
}

.preview-code .grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--code-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--code-grid-line) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.preview-code .glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}

.preview-code .glow.g1 {
    width: 160px;
    height: 160px;
    background: var(--code-glow-blue);
    top: -20px;
    right: -20px;
}

.preview-code .glow.g2 {
    width: 120px;
    height: 120px;
    background: var(--code-glow-green);
    bottom: -10px;
    left: 20px;
}

.preview-code .processor {
    position: relative;
    z-index: 1;
    width: 88%;
    max-width: 360px;
}

.preview-code .input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 6px 12px;
    background: var(--code-input-bg);
    border-radius: 8px;
    border: 1px solid var(--code-input-border);
    box-shadow: var(--code-input-shadow);
}


.preview-code .input-row .label {
    font-size: 9px;
    color: var(--code-label);
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
}

.preview-code .input-row .text {
    flex: 1;
    font-size: 11px;
    color: var(--code-text);
    font-weight: 400;
    font-family: 'SF Mono', 'Fira Code', monospace;
    text-align: right;
}

.preview-code .input-row .cursor {
    display: inline-block;
    width: 2px;
    height: 16px;
    background: var(--code-cursor);
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.preview-code .core {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.preview-code .particle-stream {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.preview-code .particle {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(26, 115, 232, 0.2);
    animation: flow 1.8s ease-in-out infinite;
}

.preview-code .particle:nth-child(1) {
    animation-delay: 0s;
}

.preview-code .particle:nth-child(2) {
    animation-delay: 0.4s;
}

.preview-code .particle:nth-child(3) {
    animation-delay: 0.8s;
}

.preview-code .particle:nth-child(4) {
    animation-delay: 1.2s;
}

.preview-code .particle:nth-child(5) {
    animation-delay: 1.6s;
}

@keyframes flow {
    0% {
        opacity: 0.1;
        transform: translateX(0) scale(0.8);
    }

    50% {
        opacity: 1;
        transform: translateX(20px) scale(1.2);
    }

    100% {
        opacity: 0.1;
        transform: translateX(40px) scale(0.8);
    }
}

/* 核心处理器 (中间) */
.preview-code .core-chip {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(26, 115, 232, 0.08), rgba(26, 115, 232, 0.02));
    border: 1.5px solid rgba(26, 115, 232, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(26, 115, 232, 0.04);
}

.preview-code .core-chip .icon {
    font-size: 20px;
    color: rgba(26, 115, 232, 0.3);
}

.preview-code .core-chip .pulse-ring {
    position: absolute;
    inset: -6px;
    border-radius: 18px;
    border: 1px solid rgba(26, 115, 232, 0.06);
    animation: pulse-ring 2.5s ease-out infinite;
}

.preview-code .core-chip .pulse-ring:nth-child(2) {
    animation-delay: 0.8s;
}

.preview-code .core-chip .pulse-ring:nth-child(3) {
    animation-delay: 1.6s;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* 输出结果 (右侧) */
.preview-code .output-group {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preview-code .output-group .output-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.preview-code .output-group .output-row .algo {
    font-size: 8px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    min-width: 28px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.preview-code .output-group .output-row .value {
    font-size: 10px;
    font-weight: 400;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: rgba(0, 0, 0, 0.3);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-code .output-group .output-row .value.highlight {
    color: #0d9e6b;
    opacity: 0.8;
}

/* 底部工具标签 */
.preview-code .toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.preview-code .toolbar span {
    font-size: 8px;
    font-weight: 500;
    padding: 2px 10px;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.5);
    color: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.04);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    letter-spacing: 0.2px;
    transition: 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.preview-code .toolbar span.active {
    background: rgba(26, 115, 232, 0.08);
    color: rgba(26, 115, 232, 0.7);
    border-color: rgba(26, 115, 232, 0.1);
}

.product-card .info {
    padding: 0.8rem 1rem 1rem;
}

.product-card .info .name {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.product-card .info .desc {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-top: 0.1rem;
}

.tag-prod {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.05rem 0.5rem;
    border-radius: 40px;
    white-space: nowrap;
}

.tag-prod-released {
    background: #e6f7f0;
    color: #0d9e6b;
}

.tag-prod-wip {
    background: #fef3e0;
    color: #f59e0b;
}

.bottom-section {
    padding: 0.5rem 0 1.5rem;
}

.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 2rem;
    align-items: stretch;
}

/* ---- 左侧 ---- */
.left-block {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.left-block .block-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
}

.left-block .block-card .block-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.left-block .block-card .block-title i {
    color: var(--color-accent);
}

/* 开源项目 */
.repo-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--color-border);
}

.repo-item:last-child {
    border-bottom: none;
}

.repo-item .repo-icon {
    color: var(--color-accent);
    font-size: 0.8rem;
    width: 18px;
}

.repo-item .repo-name {
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--color-text-primary);
}

.repo-item .repo-desc {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-left: auto;
}

.repo-item:hover .repo-name {
    color: var(--color-accent);
}

/* ---------- 服务能力列表 ---------- */
.service-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.service-item:last-child {
    border-bottom: none;
}

.service-item .service-icon {
    color: #1a73e8;
    font-size: 0.8rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.service-item .service-info {
    flex: 1;
    min-width: 0;
}

.service-item .service-info .service-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #0b1a33;
}

.service-item .service-info .service-desc {
    font-size: 0.78rem;
    color: #4a5a72;
    line-height: 1.4;
}

.block-footer {
    padding-top: 0.8rem;
    margin-top: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.block-footer .cta-text {
    font-size: 0.82rem;
    color: var(--color-text-secondary);
}

.block-footer .cta-text i {
    color: var(--color-accent);
}

.block-footer .btn-cta {
    display: inline-block;
    padding: 0.3rem 1.2rem;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
}

.block-footer .btn-cta:hover {
    border: 1px solid var(--color-border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-accent);
}

.right-block {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.4rem;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
}

.right-block .block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.right-block .block-header .block-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.right-block .block-header .block-title i {
    color: var(--color-accent);
}

.right-block .block-header .more-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-accent);
}

.right-block .block-header .more-link:hover {
    text-decoration: underline;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.news-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    transition: 0.15s;
    border-bottom: 1px solid var(--color-border);
}

.news-item:last-child {
    border-bottom: none;
}

.news-item:hover {
    background: var(--color-surface-hover);
}

.news-item .ni-date {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    flex-shrink: 0;
    min-width: 56px;
    padding-top: 1px;
}

.news-item .ni-tag {
    font-size: 0.55rem;
    font-weight: 600;
    padding: 0.05rem 0.45rem;
    border-radius: 40px;
    background: var(--color-accent-light);
    color: var(--color-accent);
    flex-shrink: 0;
    margin-top: 1px;
    min-width: 3.5rem;
    text-align: center;
}

.news-item .ni-body {
    flex: 1;
    min-width: 0;
}

.news-item .ni-body .ni-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--color-text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-item .ni-body .ni-summary {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-item .ni-arrow {
    color: var(--color-text-muted);
    font-size: 0.7rem;
    flex-shrink: 0;
    transition: 0.2s;
    padding-top: 2px;
}

.news-item:hover .ni-arrow {
    color: var(--color-accent);
    transform: translateX(3px);
}

@media (max-width: 1024px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }

    .hero-left .sub-text {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-left .hero-stats {
        justify-content: center;
    }

    .hero-left .hero-buttons {
        justify-content: center;
    }

    .hero-right .bubble {
        max-width: 160px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bottom-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .left-block {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0.8rem;
    }

    .left-block .block-card {
        padding: 0.8rem 1rem;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 1.5rem 0 0.8rem;
    }

    .hero-left h1 {
        font-size: 1.6rem;
    }

    .hero-left .sub-text {
        font-size: 0.85rem;
    }

    .hero-left .hero-stats {
        gap: 1rem;
        font-size: 0.7rem;
        flex-wrap: wrap;
    }

    .hero-right .bubble {
        max-width: 120px;
    }

    .products-section {
        padding: 0.2rem 0 1rem;
    }

    .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }

    .product-card .preview {
        height: 90px;
    }

    .product-card .info {
        padding: 0.5rem 0.6rem 0.7rem;
    }

    .product-card .info .name {
        font-size: 0.82rem;
    }

    .product-card .info .desc {
        font-size: 0.7rem;
    }

    .bottom-section {
        padding: 0.2rem 0 1rem;
    }

    .bottom-grid {
        gap: 1rem;
    }

    .left-block {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .right-block {
        padding: 0.8rem 1rem;
    }

    .news-item {
        flex-wrap: wrap;
        gap: 0.3rem;
        padding: 0.3rem 0.4rem;
    }

    .news-item .ni-date {
        min-width: 44px;
        font-size: 0.65rem;
    }

    .news-item .ni-body .ni-title {
        font-size: 0.8rem;
        white-space: normal;
    }

    .news-item .ni-body .ni-summary {
        font-size: 0.7rem;
        white-space: normal;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .news-item .ni-arrow {
        display: none;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
    }

    .product-card .preview {
        height: 70px;
    }

    .product-card .info .desc {
        display: none;
    }

    .preview-code .mock-code .line {
        height: 4px;
    }

    .preview-music .mock-music .note {
        font-size: 12px;
    }
}