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

:root {
    --primary: #1F76D2;
    --primary-light: #4A90E2;
    --secondary: #564EFF;
    --accent: #FF6B35;
    --bg: #f5f7fa;
    --card-bg: #fff;
    --text: #1a1a1a;
    --text-light: #666;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --code-bg: #f8f8f8;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1F76D2 0%, #564EFF 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 12px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Main */
main {
    padding: 40px 0;
}

section {
    margin-bottom: 60px;
}

section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--text);
    border-bottom: 3px solid var(--primary);
    padding-bottom: 12px;
    display: inline-block;
}

section h3 {
    font-size: 1.4rem;
    margin-top: 28px;
    margin-bottom: 16px;
    color: var(--primary);
    font-weight: 600;
}

section h4 {
    font-size: 1.1rem;
    margin-top: 16px;
    margin-bottom: 12px;
    color: var(--text);
    font-weight: 600;
}

section p {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 16px;
    line-height: 1.8;
}

/* Intro */
.intro {
    margin-bottom: 40px;
}

/* Featured Tool */
.featured-tool {
    background: var(--card-bg);
    padding: 40px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
    border-top: 4px solid var(--primary);
}

.featured-tool h2 {
    margin-bottom: 12px;
}

.featured-tool > .container > p {
    margin-bottom: 24px;
    font-size: 1.05rem;
    color: var(--text-light);
}

/* Snippet Viewer */
.snippet-viewer {
    margin-top: 20px;
}

.viewer-controls {
    background: var(--code-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.viewer-controls label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.viewer-controls select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    color: var(--text);
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.viewer-controls select:focus {
    outline: none;
    border-color: var(--primary);
}

.initial-message {
    background: var(--code-bg);
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
}

.snippet-header {
    background: #f0f4ff;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    margin-bottom: 20px;
}

.snippet-header h3 {
    margin-top: 0;
    color: var(--primary);
}

.snippet-header p {
    margin-bottom: 0;
}

.snippet-code {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.code-header {
    background: var(--text);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.copy-btn {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

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

.snippet-code pre {
    padding: 16px;
    overflow-x: auto;
    margin: 0;
}

.snippet-code code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text);
}

.snippet-explanation,
.snippet-tips {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.snippet-explanation h4,
.snippet-tips h4 {
    margin-top: 0;
}

.snippet-explanation ul,
.snippet-tips ul {
    list-style: none;
    padding: 0;
}

.snippet-explanation li,
.snippet-tips li {
    padding: 8px 0;
    padding-left: 20px;
    color: var(--text-light);
    position: relative;
}

.snippet-explanation li:before {
    content: "→ ";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

.snippet-tips li:before {
    content: "💡 ";
    position: absolute;
    left: 0;
}

/* Grids */
.basics-grid,
.best-practices-grid,
.pitfalls-grid,
.resources-grid,
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.basic-card,
.practice-card,
.pitfall-card,
.resource-card,
.tool-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.basic-card:hover,
.practice-card:hover,
.pitfall-card:hover,
.resource-card:hover,
.tool-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.basic-card h4,
.practice-card h4,
.pitfall-card h4,
.resource-card h4,
.tool-card h4 {
    color: var(--primary);
    margin-top: 0;
}

.basic-card p,
.practice-card p,
.pitfall-card p,
.resource-card p,
.tool-card p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.resource-card h4 a,
.tool-card h4 a {
    color: var(--primary);
    text-decoration: none;
}

.resource-card h4 a:hover,
.tool-card h4 a:hover {
    text-decoration: underline;
}

/* FAQs */
.faqs {
    background: var(--card-bg);
    padding: 40px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.faqs h2 {
    margin-bottom: 30px;
}

.faq-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-item h3 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 12px;
}

.faq-item p {
    margin-bottom: 0;
}

/* Footer */
.footer {
    background: var(--text);
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 60px;
}

.footer p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    section h2 {
        font-size: 1.6rem;
    }

    section h3 {
        font-size: 1.2rem;
    }

    .basics-grid,
    .best-practices-grid,
    .pitfalls-grid,
    .resources-grid,
    .tools-grid {
        grid-template-columns: 1fr;
    }

    .code-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .snippet-code code {
        font-size: 0.8rem;
    }
}
