/* ==========================================================================
   Codex.AI Custom Dark Theme Stylesheet
   ========================================================================== */

/* 全局变量定义 */
:root {
    --primary-bg: #05070a;
    --card-bg: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.08);
    --hover-border: #3b82f6;
    
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 基础复位与根设置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

/* 通用工具类 */
.text-gradient {
    background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-blue {
    color: var(--accent-blue);
}

.w-full {
    width: 100%;
}

.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* 磨砂玻璃卡片 */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
}

/* ==========================================================================
   导航栏样式
   ========================================================================== */
.codex-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s ease;
}

.nav-scrolled {
    background: rgba(5, 7, 10, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.05em;
}

.logo-box {
    width: 2.2rem;
    height: 2.2rem;
    background: var(--accent-blue);
    border-radius: 8px;
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    font-weight: 800;
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
}

.nav-menu a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-menu a:hover {
    color: var(--text-primary);
}

/* 流光炫彩按钮 */
@keyframes flow-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.btn-glow-nav {
    background: linear-gradient(270deg, var(--accent-blue), var(--accent-purple), var(--accent-blue));
    background-size: 200% 200%;
    animation: flow-gradient 4s ease infinite;
    padding: 0.6rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
}

.btn-glow-nav:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

/* ==========================================================================
   Hero 主视觉区域
   ========================================================================== */
.hero-section {
    position: relative;
    padding-top: 10rem;
    padding-bottom: 6rem;
    background: radial-gradient(circle at 50% -20%, #172554 0%, transparent 60%);
    text-align: center;
}

.hero-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1.2rem;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #60a5fa;
    margin-bottom: 2rem;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-blue);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-blue);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto 2.5rem auto;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: 5rem;
}

/* 按钮基础 */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 1rem 2.2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--text-primary);
    color: #000;
}

.btn-primary:hover {
    background-color: #cbd5e1;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

/* 数据看板 */
.metrics-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 3.5rem;
}

.metric-item {
    text-align: center;
}

.metric-val {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   通用 Section 头部布局
   ========================================================================== */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem;
}

.section-header {
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* ==========================================================================
   模型生态组件
   ========================================================================== */
.models-section {
    background: #080a0f;
    border-top: 1px solid var(--border-color);
}

.model-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.model-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.2rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.model-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-5px);
}

.model-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    margin: 0 auto 1.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
}

.gpt-bg { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.deepseek-bg { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.doubao-bg { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.qwen-bg { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

.model-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.model-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ==========================================================================
   核心优势组件
   ========================================================================== */
.features-section {
    background: #05070a;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: var(--hover-border);
    transform: translateY(-5px);
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.75rem;
}

.feature-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.icon-blue { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }
.icon-purple { background: rgba(139, 92, 246, 0.1); color: var(--accent-purple); }
.icon-green { background: rgba(16, 185, 129, 0.1); color: var(--accent-green); }

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==========================================================================
   下载专区
   ========================================================================== */
.download-section {
    background: #080a0f;
    border-top: 1px solid var(--border-color);
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.download-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.download-card:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.05);
}

.platform-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.os-icon {
    font-size: 2.5rem;
}

.platform-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
}

.platform-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.download-info {
    list-style: none;
    margin-bottom: 2.5rem;
}

.download-info li {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.95rem;
}

.download-info li span {
    color: var(--text-secondary);
}

.download-info li strong {
    color: var(--text-primary);
}

.btn-mac:hover {
    border-color: var(--accent-purple);
}

.download-tip {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1rem;
    text-align: center;
}

/* ==========================================================================
   启动指引与高级教程
   ========================================================================== */
.tutorial-section {
    background: #05070a;
}

.tutorial-tabs-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tutorial-step-box {
    display: flex;
    gap: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
}

.step-num {
    font-size: 2.5rem;
    font-weight: 800;
    color: rgba(59, 130, 246, 0.2);
    font-family: 'Inter', monospace;
    line-height: 1;
}

.step-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.step-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.step-content code {
    background: rgba(255, 255, 255, 0.06);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
    color: #f43f5e;
}

/* ==========================================================================
   资讯/帮助专区组件
   ========================================================================== */
.articles-section {
    background: #080a0f;
    border-top: 1px solid var(--border-color);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.article-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.2rem;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.article-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-5px);
}

.article-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 500;
}

.article-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.article-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.read-more {
    font-size: 0.85rem;
    color: var(--accent-blue);
    font-weight: 600;
}

.read-more:hover {
    color: var(--accent-purple);
}

/* ==========================================================================
   页脚样式
   ========================================================================== */
.codex-footer {
    background: #05070a;
    border-top: 1px solid var(--border-color);
    padding: 5rem 2rem 4rem 2rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4rem;
}

.footer-info {
    flex: 1 1 350px;
}

.footer-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    max-width: 320px;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.copyright a:hover {
    color: var(--text-primary);
}

.footer-links-group {
    display: flex;
    gap: 6rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-links h4 {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: var(--text-primary);
}

/* ==========================================================================
   响应式断点适配
   ========================================================================== */
@media (max-width: 1024px) {
    .metrics-panel {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    .model-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .download-grid {
        grid-template-columns: 1fr;
    }
    .articles-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-menu, .nav-actions {
        display: none; /* 移动端隐藏菜单，可根据需求编写汉堡菜单 */
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-buttons {
        flex-direction: column;
    }
    .btn-primary, .btn-secondary {
        width: 100%;
        text-align: center;
    }
    .footer-container {
        flex-direction: column;
        gap: 2rem;
    }
    .footer-links-group {
        flex-direction: column;
        gap: 2rem;
    }
}