/* ===== 全局变量与重置 ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-deep: #0b0f19;
    --bg-card: #0f172a;
    --bg-card-hover: #111c2d;
    --border-default: #1e293b;
    --border-hover: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --accent-blue: #3b82f6;
    --accent-blue-soft: #60a5fa;
    --accent-green: #10b981;
    --accent-purple: #8b5cf6;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-teal: #14b8a6;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --transition: 0.25s ease;
    --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* ===== 导航栏（与首页统一） ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 76px;
    background: rgba(11, 15, 25, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-default);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.nav-logo img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: none;
}

.nav-logo-text {
    font-size: 22px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.nav-right-group {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links {
    display: flex;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    transition: all var(--transition);
    padding: 6px 0;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-blue);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-blue);
    border-radius: 2px;
}

.github-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    color: #ffffff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition);
}

.github-btn:hover {
    background: #273549;
    border-color: var(--border-hover);
}

.github-btn svg {
    fill: currentColor;
    width: 16px;
    height: 16px;
}

/* ===== 案例 Hero ===== */
.cases-hero {
    padding: 160px 24px 40px 24px;
    max-width: 1320px;
    margin: 0 auto;
    text-align: center;
}

.cases-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: var(--accent-purple);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
    font-family: var(--font-mono);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-purple);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px var(--accent-purple);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.cases-hero h1 {
    font-size: 46px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.04em;
    margin: 0 0 20px 0;
    line-height: 1.2;
}

.cases-hero h1 span {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-rose) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 36px auto;
    line-height: 1.7;
}

.hero-stats-row {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.stat-highlight {
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* ===== 案例列表 ===== */
.cases-list-section {
    max-width: 1320px;
    margin: 0 auto 80px auto;
    padding: 0 24px;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 12px;
}

.section-header p {
    font-size: 15px;
    color: var(--text-tertiary);
}

.cases-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* details 卡片样式 */
.case-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}

.case-card[open] {
    border-color: var(--accent-purple);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.1);
}

.case-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 32px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.case-summary::-webkit-details-marker {
    display: none;
}

.case-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.case-icon {
    font-size: 36px;
}

.case-left h3 {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
}

.case-left p {
    font-size: 14px;
    color: var(--text-secondary);
}

.case-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.case-tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.tag-travel { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.tag-business { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.tag-dev { background: rgba(245,158,11,0.15); color: var(--accent-amber); }
.tag-privacy { background: rgba(244,63,94,0.15); color: var(--accent-rose); }

.case-arrow {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 600;
}

/* 案例展开内容 */
.case-content {
    padding: 0 32px 32px 32px;
    border-top: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.content-section h4 {
    font-size: 18px;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 12px;
}

.code-block {
    background: #090d16;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 20px;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    color: #38bdf8;
}

.code-block code span.comment {
    color: #64748b;
}

.speed-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.speed-table th {
    text-align: left;
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-default);
}

.speed-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(30,41,59,0.5);
    color: #cbd5e1;
}

.note {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 8px;
}

.trouble-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trouble-list li {
    font-size: 14px;
    color: var(--text-secondary);
    padding-left: 16px;
    position: relative;
    line-height: 1.6;
}

.trouble-list li::before {
    content: "•";
    color: var(--accent-rose);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.case-meta {
    font-size: 13px;
    color: var(--text-tertiary);
    padding-top: 16px;
    border-top: 1px solid var(--border-default);
}

/* ===== 步骤拆解版块 ===== */
.step-breakdown-section {
    max-width: 1320px;
    margin: 0 auto 80px auto;
    padding: 0 24px;
}

.breakdown-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
}

.breakdown-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 200px;
}

.node-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.breakdown-node h4 {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.breakdown-node p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.breakdown-connector {
    font-size: 28px;
    color: var(--text-tertiary);
    margin: 0 16px;
    padding-bottom: 20px;
}

/* ===== 贡献版块 ===== */
.contribute-case-section {
    max-width: 1320px;
    margin: 0 auto 100px auto;
    padding: 0 24px;
}

.contribute-box {
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.contribute-box p {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 24px auto;
}

.btn-primary {
    background: var(--accent-blue);
    color: #ffffff;
    text-decoration: none;
    padding: 14px 30px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

/* ===== 页脚（与首页统一） ===== */
.footer-new {
    background-color: #090d16;
    border-top: 1px solid var(--border-default);
    padding: 80px 24px 60px 24px;
}

.footer-new-container {
    max-width: 1320px;
    margin: 0 auto;
}

.footer-main-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 50px;
    border-bottom: 1px solid var(--border-default);
    flex-wrap: wrap;
    gap: 48px;
}

.footer-brand-info {
    max-width: 420px;
}

.footer-brand-info h4 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 12px 0;
}

.footer-brand-info p {
    color: var(--text-tertiary);
    font-size: 14px;
    margin: 0;
    line-height: 1.6;
}

.footer-links-group-wrapper {
    display: flex;
    gap: 60px;
    flex-wrap: wrap;
}

.footer-links-cluster {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links-cluster span {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.footer-links-cluster a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color var(--transition);
}

.footer-links-cluster a:hover {
    color: var(--accent-blue);
}

.footer-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 36px;
    font-size: 13px;
    color: #475569;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-meta-row a {
    color: #475569;
    text-decoration: none;
    margin-left: 24px;
    transition: color var(--transition);
}

.footer-meta-row a:hover {
    color: #64748b;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .breakdown-flow {
        flex-direction: column;
        gap: 24px;
    }
    .breakdown-connector {
        transform: rotate(90deg);
        margin: 0;
    }
    .footer-main-row {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    .footer-links-group-wrapper {
        justify-content: center;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 16px;
    }
    .nav-links {
        display: none;
    }
    .cases-hero {
        padding-top: 130px;
    }
    .cases-hero h1 {
        font-size: 32px;
    }
    .hero-stats-row {
        gap: 20px;
    }
    .case-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .case-right {
        align-self: flex-end;
    }
    .footer-meta-row {
        flex-direction: column;
        text-align: center;
    }
    .footer-meta-row div:last-child {
        margin-top: 8px;
    }
    .footer-meta-row a {
        margin: 0 12px;
    }
}