/* ===== 基础重置 ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --brand-green: #10B981;
    --brand-green-light: #34D399;
    --brand-green-dark: #059669;
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --bg-primary: #f8f9fa;
    --bg-white: #ffffff;
    --border-light: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* ===== 导航栏 ===== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
    border-bottom: 1px solid var(--border-light);
}

.nav-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 0.8;
}

.logo-img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.logo-tagline {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: 0.02em;
    padding: 0.15rem 0.5rem;
    background: #f0fdf4;
    border-radius: var(--radius-sm);
    border: 1px solid #a7f3d0;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--brand-green);
    letter-spacing: -0.02em;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* 语言切换器 */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-light);
}

.lang-btn {
    background: none;
    border: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.lang-btn:hover {
    color: var(--brand-green);
}

.lang-btn.active {
    color: var(--brand-green);
    background: #f0fdf4;
}

.lang-divider {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--brand-green);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* ===== 主体区域 ===== */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.25rem 3rem 0.5rem;
    gap: 4rem;
    min-height: calc(100vh - 80px);
}

.hero-left {
    flex: 1;
    max-width: 520px;
}

.version-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    padding: 0.3rem 0.6rem;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    width: fit-content;
    transition: all 0.3s ease;
}

.version-badge a {
    color: var(--brand-green);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.version-badge a:hover {
    color: var(--brand-green-dark);
    text-decoration: underline;
}

.version-loading {
    color: var(--text-muted);
}

.brand-name {
    font-size: 4rem;
    font-weight: 700;
    color: var(--brand-green);
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 0.75rem;
}

.slogan {
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    letter-spacing: -0.01em;
}

/* ===== 卡片区域 ===== */
.cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card {
    display: block;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem 1.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--brand-green);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--brand-green);
}

.card:hover::before {
    transform: scaleY(1);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--brand-green);
    margin-bottom: 0.5rem;
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== 右侧视觉区 ===== */
.hero-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    max-width: 660px;
}

.visual-card {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.visual-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #10B981 0%, #059669 50%, #047857 100%);
    overflow: hidden;
}

.visual-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%);
}

.rays {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    transform: translate(-50%, -50%);
    background:
        repeating-conic-gradient(
            from 0deg,
            transparent 0deg,
            transparent 8deg,
            rgba(255,255,255,0.08) 8deg,
            rgba(255,255,255,0.08) 10deg
        );
    animation: rotateRays 60s linear infinite;
}

@keyframes rotateRays {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.visual-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    padding-top: 45%;
    color: white;
}

.visual-gif-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 60%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 3;
}

.visual-gif {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-sm);
    transition: opacity 0.5s ease;
}

.visual-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: opacity 0.5s ease;
}

.visual-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 1.25rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: opacity 0.5s ease;
}

.visual-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: white;
    transition: gap 0.3s ease;
    width: fit-content;
}

.visual-link:hover {
    gap: 0.75rem;
}

.visual-link::after {
    content: '→';
    transition: transform 0.3s ease;
}

.visual-link:hover::after {
    transform: translateX(4px);
}

/* ===== 弹窗 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    position: relative;
}

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

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

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

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-right: 2rem;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.install-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-green);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.step-content {
    flex: 1;
}

.step-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 0.25rem;
}

.step-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.step-hint a {
    color: var(--brand-green);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.step-hint a:hover {
    color: var(--brand-green-dark);
}

.code-hint {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: none;
    padding: 0;
    margin-top: 0.25rem;
}

.copy-terminal-link {
    color: var(--brand-green);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
    transition: color 0.2s ease;
    cursor: pointer;
    margin-left: 0.5rem;
}

.copy-terminal-link:hover {
    color: var(--brand-green-dark);
}

.modal-tips {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    line-height: 1.5;
}

/* ===== 文档弹窗 ===== */
.docs-modal-content {
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
}

.docs-body {
    overflow-y: auto;
    max-height: calc(80vh - 120px);
    padding-right: 0.5rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.docs-body h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand-green);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-light);
}

.docs-body h2 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.docs-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.docs-body pre {
    background: #1a1a1a;
    color: #e4e4e4;
    padding: 1rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 1rem 0;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.85rem;
}

.docs-body code {
    background: #f0fdf4;
    color: var(--brand-green-dark);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.85rem;
}

.docs-body pre code {
    background: none;
    color: #e4e4e4;
    padding: 0;
}

.docs-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.docs-body th,
.docs-body td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.docs-body th {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-primary);
}

.docs-body tr:hover {
    background: var(--bg-primary);
}

.docs-body blockquote {
    border-left: 4px solid var(--brand-green);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.docs-body strong {
    color: var(--brand-green);
    font-weight: 600;
}

.docs-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.copy-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2000;
    white-space: nowrap;
}

.copy-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ===== 赞助弹窗 ===== */
.sponsor-modal-content {
    max-width: 600px;
}

.modal-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
    margin-top: -0.5rem;
}

.sponsor-options {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.sponsor-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.sponsor-option:hover {
    transform: translateY(-4px);
}

.sponsor-qr {
    width: 140px;
    height: 140px;
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    border: 2px dashed var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    overflow: hidden;
}

.sponsor-qr-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: calc(var(--radius-md) - 2px);
}

.sponsor-option:hover .sponsor-qr {
    border-color: var(--brand-green);
}

.sponsor-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ===== 友情链接 ===== */
.footer-links {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-white);
}

.footer-links-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.footer-link {
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--brand-green);
}

/* ===== 粒子背景 ===== */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--brand-green);
    border-radius: 50%;
    opacity: 0.5;
    animation: floatParticle 12s infinite linear;
    box-shadow: 0 0 10px 4px rgba(16, 185, 129, 0.5);
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.4;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(-10vh) translateX(30px);
        opacity: 0;
    }
}

/* ===== 滚动入场动画 ===== */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        text-align: center;
        gap: 3rem;
        padding: 0.25rem 1.5rem 0.5rem;
    }

    .hero-left {
        max-width: 100%;
    }

    .hero-right {
        max-width: 100%;
        width: 100%;
        justify-content: center;
    }

    .visual-card {
        max-width: 480px;
    }

    .cards {
        align-items: center;
    }

    .card {
        max-width: 400px;
        width: 100%;
    }

    .card::before {
        display: none;
    }
}

@media (max-width: 640px) {
    .navbar {
        padding: 1rem 1.5rem;
    }

    .nav-right {
        gap: 1.25rem;
    }

    .nav-link {
        font-size: 0.85rem;
    }

    .hero {
        padding: 0.25rem 1.5rem 0.5rem;
    }

    .brand-name {
        font-size: 2.75rem;
    }

    .slogan {
        font-size: 1.25rem;
        margin-bottom: 2rem;
    }

    .visual-card {
        aspect-ratio: 1/1;
    }

/* ===== 底部 ===== */
.footer {
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

.footer-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.footer-text a {
    color: var(--brand-green);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-text a:hover {
    color: var(--brand-green-dark);
    text-decoration: underline;
}

    .visual-content {
        padding: 1.5rem;
    }

    .visual-title {
        font-size: 1.25rem;
    }
}
