:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --secondary: #34a853;
    --accent: #ea4335;
    --warning: #fbbc04;
    --bg: #f8f9fa;
    --bg-card: #ffffff;
    --text: #202124;
    --text-light: #5f6368;
    --border: #dadce0;
    --code-bg: #1e1e2e;
    --code-text: #cdd6f4;
    --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
}

.site-header {
    background: linear-gradient(135deg, var(--primary) 0%, #4285f4 100%);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span { opacity: 0.9; font-weight: 400; font-size: 0.9rem; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
    display: flex;
    gap: 32px;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 96px;
    height: fit-content;
}

.main-content { flex: 1; min-width: 0; }

.footer {
    background: var(--text);
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 32px 24px;
    margin-top: 60px;
    font-size: 0.9rem;
}

.footer a { color: var(--warning); text-decoration: none; }

.nav-menu { list-style: none; }

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.nav-menu a:hover { background: rgba(26,115,232,0.08); color: var(--primary); }
.nav-menu a.active { background: var(--primary); color: white; }
.nav-menu .icon { font-size: 1.2rem; }

.header-nav { display: flex; gap: 4px; }
.header-nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}
.header-nav a:hover { background: rgba(255,255,255,0.15); color: white; }
.header-nav a.active { background: rgba(255,255,255,0.2); color: white; }

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle { color: var(--text-light); font-size: 1.1rem; margin-bottom: 32px; }

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

h2:first-child { margin-top: 0; }

h3 { font-size: 1.15rem; font-weight: 600; margin: 24px 0 12px; color: var(--primary-dark); }

p { margin-bottom: 16px; }

.step-list { list-style: none; counter-reset: step; padding: 0; }
.step-list li {
    counter-increment: step;
    padding: 16px 16px 16px 60px;
    position: relative;
    margin-bottom: 12px;
    background: var(--bg);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}
.step-list li::before {
    content: counter(step);
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 2px;
}
.tag-blue { background: #e8f0fe; color: var(--primary); }
.tag-green { background: #e6f4ea; color: var(--secondary); }
.tag-red { background: #fce8e6; color: var(--accent); }
.tag-yellow { background: #fef7e0; color: #e37400; }

.info-box {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin: 16px 0;
    font-size: 0.95rem;
}
.info-box.tip { background: #e6f4ea; border-left: 4px solid var(--secondary); }
.info-box.warning { background: #fef7e0; border-left: 4px solid var(--warning); }
.info-box.note { background: #e8f0fe; border-left: 4px solid var(--primary); }

.flow-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 24px;
    margin: 20px 0;
}
.flow-box {
    background: linear-gradient(135deg, var(--primary), #4285f4);
    color: white;
    padding: 14px 22px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.flow-arrow { font-size: 1.5rem; color: var(--primary); font-weight: bold; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.95rem;
}
th {
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
}
td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
tr:hover td { background: #f1f3f4; }
code:not(pre code) {
    background: #f1f3f4;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent);
    font-family: "JetBrains Mono", "Fira Code", monospace;
}

pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 20px 24px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 16px 0;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    position: relative;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.code-label {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 0.75rem;
    color: rgba(205,214,244,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.kw { color: #cba6f7; }
.str { color: #a6e3a1; }
.tag-hl { color: #89b4fa; }
.attr { color: #f9e2af; }
.cmt { color: #6c7086; font-style: italic; }
.fn { color: #89dceb; }
.num { color: #fab387; }

.hero {
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 40%, #34a853 100%);
    color: white;
    padding: 80px 24px;
    text-align: center;
}
.hero h1 { font-size: 2.8rem; font-weight: 800; margin-bottom: 16px; }
.hero p { font-size: 1.2rem; opacity: 0.9; max-width: 600px; margin: 0 auto 32px; }
.hero-cards {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 900px;
    margin: 0 auto;
}
.hero-card {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    padding: 24px;
    width: 260px;
    text-align: center;
    transition: var(--transition);
    text-decoration: none;
    color: white;
}
.hero-card:hover { background: rgba(255,255,255,0.25); transform: translateY(-4px); }
.hero-card .hc-icon { font-size: 2.5rem; margin-bottom: 12px; }
.hero-card h3 { font-size: 1.1rem; margin-bottom: 8px; color: white; }
.hero-card p { font-size: 0.9rem; opacity: 0.85; margin: 0; }

.toc { list-style: none; padding: 0; }
.toc li { margin-bottom: 6px; }
.toc a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 6px 12px;
    display: block;
    border-radius: 6px;
    transition: var(--transition);
}
.toc a:hover { background: rgba(26,115,232,0.08); }

@media (max-width: 768px) {
    .container { flex-direction: column; padding: 16px; }
    .sidebar { width: 100%; position: static; }
    .header-nav { display: none; }
    .hero h1 { font-size: 1.8rem; }
    .hero { padding: 48px 16px; }
    .hero-cards { flex-direction: column; align-items: center; }
    .card { padding: 20px; }
    .flow-diagram { flex-direction: column; }
    table { font-size: 0.85rem; }
    th, td { padding: 8px; }
    pre { font-size: 0.8rem; padding: 14px; }
}
