/* ============================================
   Claude Code 教程 - Design System
   Style: Minimalism & Swiss Style
   Colors: Dark theme with Blue accent
   Fonts: JetBrains Mono / IBM Plex Sans
   ============================================ */

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

:root {
    --primary: #3B82F6;
    --primary-hover: #2563EB;
    --primary-glow: rgba(59, 130, 246, 0.15);
    --primary-subtle: rgba(59, 130, 246, 0.08);
    --secondary: #1E293B;
    --bg: #0F172A;
    --bg-card: #1E293B;
    --bg-card-hover: #263148;
    --bg-code: #0D1117;
    --text: #F1F5F9;
    --text-muted: #94A3B8;
    --text-dim: #64748B;
    --border: rgba(148, 163, 184, 0.12);
    --border-strong: rgba(148, 163, 184, 0.2);
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.4);
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--bg-code);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.container {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 50;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: box-shadow var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-lg);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
}

.nav-logo svg {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    cursor: pointer;
}

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

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.nav-mobile {
    display: none;
    flex-direction: column;
    padding: 0 20px 16px;
    gap: 4px;
}

.nav-mobile.active {
    display: flex;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: block;
    }
}

/* ===== Hero ===== */
.hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(15, 23, 42, 0.3) 0%,
            rgba(15, 23, 42, 0.6) 50%,
            var(--bg) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 120px 24px 80px;
}

.hero h1 {
    font-family: var(--font-mono);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    color: var(--text-muted);
    margin-bottom: 32px;
    font-weight: 400;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: white;
    box-shadow: 0 0 32px rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-strong);
}

.btn-outline:hover {
    color: var(--text);
    border-color: var(--primary);
    background: var(--primary-subtle);
}

/* ===== Content Sections ===== */
.content-section {
    margin-bottom: 64px;
}

.section-header {
    margin-bottom: 32px;
}

.section-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-subtle);
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.section-header h2 {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.section-desc {
    color: var(--text-muted);
    margin-top: 6px;
}

/* ===== Step Cards ===== */
.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    transition: border-color var(--transition);
    position: relative;
}

.step-card:hover {
    border-color: var(--border-strong);
}

.step-number {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-subtle);
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.step-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.step-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 28px;
    margin-bottom: 12px;
    color: var(--text);
}

.step-card p {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.step-card ul {
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-left: 20px;
}

.step-card li {
    margin-bottom: 8px;
}

.step-card strong {
    color: var(--text);
}

/* Card illustration */
.card-illustration {
    margin-bottom: 24px;
    border-radius: var(--radius);
    overflow: hidden;
}

.card-illustration img {
    width: 100%;
    height: auto;
    display: block;
}

/* ===== Code Blocks ===== */
.code-block {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
}

.code-lang {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all var(--transition);
    display: flex;
    align-items: center;
}

.copy-btn:hover {
    color: var(--primary);
    background: var(--primary-subtle);
}

.copy-btn.copied {
    color: var(--success);
}

.code-block pre {
    padding: 16px;
    overflow-x: auto;
    line-height: 1.6;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 13.5px;
    background: none;
    border: none;
    padding: 0;
    color: #E2E8F0;
}

/* ===== Image Gallery ===== */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.gallery-img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition);
}

.gallery-img:hover {
    border-color: var(--primary);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.15);
    transform: scale(1.01);
}

/* ===== Callouts ===== */
.callout {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.callout svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.callout-info {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #93C5FD;
}

.callout-info svg {
    color: #60A5FA;
}

.callout-tip {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #86EFAC;
}

.callout-tip svg {
    color: #4ADE80;
}

.callout-warning {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #FCD34D;
}

.callout-warning svg {
    color: #FBBF24;
}

/* ===== Tables ===== */
.table-wrapper {
    overflow-x: auto;
    margin-bottom: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: rgba(255, 255, 255, 0.03);
}

th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.highlight-row td {
    background: var(--primary-subtle) !important;
    color: var(--text);
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.badge-yes {
    background: rgba(34, 197, 94, 0.12);
    color: #4ADE80;
}

.badge-no {
    background: rgba(239, 68, 68, 0.12);
    color: #F87171;
}

/* ===== Part Divider ===== */
.part-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 56px 0 12px;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

.divider-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-subtle);
    padding: 6px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

.divider-note {
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 48px;
}

/* ===== Tabs ===== */
.tab-container {
    margin-bottom: 20px;
}

.tab-buttons {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    background: var(--bg-code);
    padding: 4px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
}

.tab-btn {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dim);
    background: none;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
}

.tab-btn:hover {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
    color: var(--text);
    background: var(--primary-subtle);
}

.tab-panel {
    display: none;
}

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

.tab-panel .code-block {
    border-radius: 0 0 var(--radius) var(--radius);
    border-top: 1px solid var(--border);
}

/* ===== Footer ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    text-align: center;
}

.footer p {
    color: var(--text-dim);
    font-size: 14px;
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 250ms ease;
    cursor: zoom-out;
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background var(--transition);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius);
}

/* ===== Scroll Animations ===== */
.step-card,
.section-header {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 500ms ease, transform 500ms ease;
}

.step-card.visible,
.section-header.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 80px;
    }

    .navbar {
        top: 8px;
        left: 8px;
        right: 8px;
    }

    .hero-content {
        padding: 100px 16px 60px;
    }

    .container {
        padding: 0 16px;
    }

    .step-card {
        padding: 24px 20px;
    }

    .image-gallery {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 13px;
    }

    th,
    td {
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0ms !important;
        animation-duration: 0ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .step-card,
    .section-header {
        opacity: 1;
        transform: none;
    }
}