/* ========================================
   CY ScrExt Hub - Tutorial Page Styles
   Black & White Minimal Design
   ======================================== */

/* ==========================================
   Base Reset & Variables
   ========================================== */
:root {
    --primary: #0a0a0a;
    --primary-dark: #000000;
    --primary-light: #404040;
    --accent: #525252;
    --accent-light: #a3a3a3;
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f5f5f5;
    --text-primary: #0a0a0a;
    --text-secondary: #525252;
    --text-muted: #a3a3a3;
    --border: #e5e5e5;
    --border-light: #f0f0f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
    --shadow-md: 0 2px 4px 0 rgb(0 0 0 / 0.05);
    --shadow-lg: 0 4px 12px 0 rgb(0 0 0 / 0.08);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
}

/* ==========================================
   Hero Section
   ========================================== */
.tutorial-hero {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #262626 100%);
    position: relative;
    overflow: hidden;
    min-height: 300px;
}

.tutorial-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
}

.tutorial-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, var(--bg-secondary), transparent);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 1.5rem;
}

.hero-badge i {
    font-size: 0.9rem;
    opacity: 0.8;
}

.tutorial-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
}

.tutorial-hero h1 span {
    background: linear-gradient(135deg, #ffffff, #d4d4d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.7;
    max-width: 2xl;
    margin-bottom: 2rem;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.82rem;
    font-weight: 500;
}

.meta-tag i {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ==========================================
   Download Bar
   ========================================== */
.download-bar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.download-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.download-bar-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.download-bar-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.download-bar-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.download-bar-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.download-bar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.87rem;
    transition: all 0.25s ease;
    border: none;
    cursor: pointer;
}

.dl-btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.dl-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.dl-btn-secondary {
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.dl-btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    color: var(--primary);
}

.dl-btn i {
    font-size: 0.9rem;
}

/* ==========================================
   Tab Bar
   ========================================== */
.tab-bar {
    position: sticky;
    top: 64px;
    z-index: 40;
    background: white;
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(8px);
}

.tab-bar-inner {
    display: flex;
    gap: 4px;
}

.tutorial-tab {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tutorial-tab:hover {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

.tutorial-tab.active {
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tutorial-tab i {
    font-size: 0.85rem;
}

/* ==========================================
   Tab Content
   ========================================== */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   TOC Sidebar
   ========================================== */
.toc-section {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.toc-title {
    padding: 14px 18px;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    background: var(--bg-secondary);
}

.toc-list {
    list-style: none;
    padding: 8px;
    margin: 0;
}

.toc-list li {
    margin: 2px 0;
}

.toc-list a {
    display: block;
    padding: 8px 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.toc-list a:hover {
    color: var(--primary);
    background: var(--bg-tertiary);
    border-left-color: var(--primary-light);
}

.toc-list a.active {
    color: var(--primary);
    font-weight: 600;
    background: var(--bg-tertiary);
    border-left-color: var(--primary);
}

/* ==========================================
   Tutorial Sections
   ========================================== */
.tutorial-section {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    padding: 2.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.tutorial-section:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 1.75rem;
}

.section-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    background: var(--text-primary);
    color: white;
}

.section-number.api-num {
    background: linear-gradient(135deg, #404040, #0a0a0a);
}

.section-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.api-perm-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 16px;
    background: #fef3c7;
    color: #92400e;
    margin-top: 0.5rem;
}

.section-body {
    color: var(--text-secondary);
    line-height: 1.75;
    font-size: 0.95rem;
}

.subsection-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.75rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.subsection-title::before {
    content: '';
    width: 3px;
    height: 18px;
    background: var(--text-primary);
    border-radius: 2px;
}

/* ==========================================
   Callout Boxes
   ========================================== */
.callout {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
    line-height: 1.65;
}

.callout-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.callout-body {
    font-size: 0.9rem;
    flex: 1;
}

.callout-body strong {
    color: var(--text-primary);
}

.callout-info {
    background: #f5f5f5;
    border-left: 3px solid #0a0a0a;
}
.callout-info .callout-icon {
    background: #e5e5e5;
    color: #0a0a0a;
}

.callout-success {
    background: #f5f5f5;
    border-left: 3px solid #404040;
}
.callout-success .callout-icon {
    background: #e5e5e5;
    color: #404040;
}

.callout-warning {
    background: #f5f5f5;
    border-left: 3px solid #737373;
}
.callout-warning .callout-icon {
    background: #e5e5e5;
    color: #737373;
}

.callout-tip {
    background: #f5f5f5;
    border-left: 3px solid #a3a3a3;
}
.callout-tip .callout-icon {
    background: #e5e5e5;
    color: #a3a3a3;
}

/* ==========================================
   Code Blocks
   ========================================== */
.code-block-wrapper {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    margin: 1.5rem 0;
}

.code-block-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: #0a0a0a;
    border-bottom: 1px solid #262626;
}

.code-lang {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.code-filename {
    font-size: 0.74rem;
    color: #cbd5e1;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    flex: 1;
}

.code-copy-btn {
    padding: 4px 12px;
    font-size: 0.72rem;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid #475569;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-color: #64748b;
}

.code-copy-btn.copied {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.code-block-wrapper pre {
    margin: 0;
    padding: 0;
    background: #171717;
}

.code-block-wrapper code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    padding: 20px;
    display: block;
}

/* ==========================================
   Inline Code
   ========================================== */
code:not(pre code) {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.82em;
    padding: 3px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-weight: 500;
}

kbd {
    display: inline-block;
    padding: 2px 8px;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* ==========================================
   Feature Grid
   ========================================== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin: 1.5rem 0;
}

.feature-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    transition: all 0.25s ease;
    text-align: center;
}

.feature-card:hover {
    background: white;
    border-color: var(--border);
    transform: translateY(-2px);
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.feature-card span {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ==========================================
   Data Table
   ========================================== */
.data-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin: 1.5rem 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    background: var(--bg-secondary);
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

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

.data-table tr:hover td {
    background: var(--bg-tertiary);
}

/* ==========================================
   Step List
   ========================================== */
.step-list {
    counter-reset: step-counter;
    margin: 1.5rem 0;
}

.step-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px dashed var(--border);
}

.step-item:last-child {
    border-bottom: none;
}

.step-badge {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.step-content h4 {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.step-content p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==========================================
   Key Points Grid
   ========================================== */
.key-points-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin: 1.5rem 0;
}

.key-point-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 18px;
    transition: all 0.25s ease;
}

.key-point-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.key-point-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.key-point-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.key-point-list li {
    padding: 5px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding-left: 16px;
    position: relative;
}

.key-point-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
}

/* ==========================================
   Color Palette
   ========================================== */
.color-palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin: 1.5rem 0;
}

.palette-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.palette-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.palette-colors {
    height: 36px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: linear-gradient(to right, var(--c1), var(--c2), var(--c3));
}

.palette-name {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.palette-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ==========================================
   Block Types Grid
   ========================================== */
.block-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 1.5rem 0;
}

.block-type-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    transition: all 0.25s ease;
}

.block-type-card:hover {
    border-color: var(--primary);
    background: white;
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.block-type-shape {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 16px;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.command-shape {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-radius: 8px;
}

.reporter-shape {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 16px;
}

.boolean-shape {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    clip-path: polygon(10% 0%, 90% 0%, 100% 50%, 90% 100%, 10% 100%, 0% 50%);
    padding: 10px 24px;
}

.hat-shape {
    background: linear-gradient(135deg, #ec4899, #db2777);
    border-radius: 16px 16px 0 16px;
}

.block-type-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.block-type-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ==========================================
   API Category Grid
   ========================================== */
.api-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin: 1.5rem 0;
}

.api-category-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    transition: all 0.25s ease;
}

.api-category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border);
}

.api-cat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.15rem;
    margin: 0 auto 12px;
}

.api-category-card h4 {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.api-category-card p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 10px;
}

.api-count {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    padding: 3px 10px;
    border-radius: 16px;
}

/* ==========================================
   Permission Levels
   ========================================== */
.permission-levels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin: 1.5rem 0;
}

.perm-level {
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid;
}

.perm-low {
    background: #fafafa;
    border-color: #d4d4d4;
}

.perm-med {
    background: #f5f5f5;
    border-color: #a3a3a3;
}

.perm-high {
    background: #262626;
    border-color: #0a0a0a;
}

.perm-badge {
    display: inline-block;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 5px 14px;
    border-radius: 16px;
    margin-bottom: 10px;
}

.perm-low .perm-badge { background: #0a0a0a; color: white; }
.perm-med .perm-badge { background: #525252; color: white; }
.perm-high .perm-badge { background: white; color: #0a0a0a; }

.perm-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.perm-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.perm-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 5px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.6);
}

.perm-low .perm-tag { color: #404040; }
.perm-med .perm-tag { color: #525252; }
.perm-high .perm-tag { color: #d4d4d4; background: rgba(0, 0, 0, 0.3); }

/* ==========================================
   API Method Cards
   ========================================== */
.api-method-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 1.5rem 0;
}

.api-method {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all 0.25s ease;
}

.api-method:hover {
    border-color: var(--primary);
    background: white;
    box-shadow: var(--shadow-sm);
}

.method-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.method-name {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: 6px;
}

.method-perm {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 14px;
}

.perm-green { background: #e5e5e5; color: #0a0a0a; }
.perm-yellow { background: #d4d4d4; color: #404040; }
.perm-red { background: #a3a3a3; color: white; }

.method-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.method-params,
.method-return {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 10px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    margin-top: 8px;
}

.method-params strong,
.method-return strong {
    color: var(--text-primary);
}

/* ==========================================
   FAQ
   ========================================== */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 1.5rem 0;
}

.faq-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.25s ease;
}

.faq-item[open] {
    background: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.faq-question {
    list-style: none;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    user-select: none;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question i {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.25s ease;
}

.faq-item[open] .faq-question i {
    transform: rotate(90deg);
    color: var(--primary);
}

.faq-question:hover {
    color: var(--primary);
    background: var(--bg-tertiary);
}

.faq-answer {
    padding: 0 18px 16px 44px;
    font-size: 0.87rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==========================================
   Quick Reference Card
   ========================================== */
.quick-ref-card {
    background: linear-gradient(135deg, #0a0a0a, #262626);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin: 1.5rem 0;
}

.quick-ref-title {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-ref-title i {
    color: #fbbf24;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 1024px) {
    .tutorial-section {
        padding: 1.5rem;
    }

    .section-header {
        gap: 12px;
    }

    .section-number {
        width: 40px;
        height: 40px;
        font-size: 0.88rem;
    }

    .section-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .tutorial-section {
        padding: 1.25rem;
        border-radius: var(--radius-lg);
        margin-bottom: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .tutorial-hero {
        padding: 2rem 0 !important;
        min-height: auto;
    }

    .tutorial-hero h1 {
        font-size: 1.65rem !important;
    }

    .hero-desc {
        font-size: 0.95rem;
    }

    .download-bar-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .download-bar-info {
        justify-content: center;
    }

    .download-bar-actions {
        justify-content: center;
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .block-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .api-category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .block-type-grid {
        grid-template-columns: 1fr;
    }

    .api-category-grid {
        grid-template-columns: 1fr;
    }

    .key-points-grid {
        grid-template-columns: 1fr;
    }

    .permission-levels {
        grid-template-columns: 1fr;
    }

    .color-palette-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dl-btn {
        padding: 8px 14px;
        font-size: 0.82rem;
    }

    .code-block-wrapper code {
        font-size: 0.74rem !important;
        padding: 14px !important;
    }
}

/* ==================== 文档直接渲染（tutorial/*.md） ==================== */
.tutorial-md {
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.75;
    word-break: break-word;
}

.tutorial-md > *:first-child {
    margin-top: 0;
}

.tutorial-md h1 {
    font-size: 1.7rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.tutorial-md h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #111827;
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #e5e7eb;
    scroll-margin-top: 90px;
}

.tutorial-md h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1f2937;
    margin: 1.5rem 0 0.5rem;
    scroll-margin-top: 90px;
}

.tutorial-md h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 1.25rem 0 0.4rem;
}

.tutorial-md p {
    margin: 0.6rem 0;
}

.tutorial-md a {
    color: #4f62c9;
    text-decoration: none;
    border-bottom: 1px solid rgba(79, 98, 201, 0.35);
}

.tutorial-md a:hover {
    color: #3b4aa8;
    border-bottom-color: #3b4aa8;
}

.tutorial-md ul,
.tutorial-md ol {
    margin: 0.6rem 0;
    padding-left: 1.5rem;
}

.tutorial-md li {
    margin: 0.25rem 0;
}

.tutorial-md li > ul,
.tutorial-md li > ol {
    margin: 0.2rem 0;
}

.tutorial-md blockquote {
    margin: 0.9rem 0;
    padding: 0.6rem 1rem;
    border-left: 4px solid #4f62c9;
    background: #f5f6ff;
    border-radius: 0 8px 8px 0;
    color: #4b5563;
}

.tutorial-md blockquote p {
    margin: 0.25rem 0;
}

.tutorial-md code {
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 0.85em;
    background: #f3f4f6;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    color: #d63384;
}

.tutorial-md pre {
    position: relative;
    margin: 1rem 0;
    background: #1e1e1e;
    border-radius: 8px;
    overflow: auto;
    max-height: 32rem;
}

.tutorial-md pre code {
    display: block;
    padding: 1rem 3rem 1rem 1rem;
    background: transparent;
    color: #d4d4d4;
    font-size: 0.85rem;
    line-height: 1.6;
}

.tutorial-md pre:hover .md-copy-btn {
    opacity: 1;
}

.md-copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #e5e7eb;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.md-copy-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.md-copy-btn.copied {
    color: #4ade80;
}

.md-copy-btn.failed {
    color: #f87171;
}

.tutorial-md table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.tutorial-md th,
.tutorial-md td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.tutorial-md th {
    background: #f9fafb;
    font-weight: 600;
    color: #111827;
}

.tutorial-md tr:nth-child(even) {
    background: #fafafa;
}

.tutorial-md hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 1.5rem 0;
}

.tutorial-md img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.tutorial-md strong {
    font-weight: 600;
    color: #111827;
}

.tutorial-md .md-loading,
.tutorial-md .md-error {
    padding: 3rem 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.95rem;
}

.tutorial-md .md-error i {
    margin-right: 0.5rem;
    color: #f59e0b;
}