:root {
    --bg-primary: #1e1e1e;
    --bg-secondary: #252525;
    --bg-tertiary: #2d2d2d;
    --bg-sidebar: #1a1a1a;
    --bg-card: #252525;
    --bg-card-hover: #2a2a2a;
    --bg-code: #1a1a1a;
    --bg-input: #2d2d2d;
    --text-primary: #e8e8e8;
    --text-secondary: #a8a8a8;
    --text-muted: #6e6e6e;
    --text-code: #d4d4d4;
    --primary: #1e88e5;
    --primary-hover: #1976d2;
    --primary-light: rgba(30, 136, 229, 0.1);
    --success: #4caf50;
    --success-light: rgba(76, 175, 80, 0.1);
    --warning: #ffc107;
    --warning-light: rgba(255, 193, 7, 0.1);
    --danger: #f44336;
    --danger-light: rgba(244, 67, 54, 0.1);
    --easy: #4caf50;
    --medium: #ffc107;
    --hard: #f44336;
    --border: #3a3a3a;
    --border-light: #4a4a4a;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.6);
    --sidebar-width: 240px;
    --header-height: 60px;
    --radius: 4px;
    --radius-lg: 8px;
    --font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
}

body.light-theme {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #fafafa;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f9f9f9;
    --bg-code: #f5f5f5;
    --bg-input: #ffffff;
    --text-primary: #212121;
    --text-secondary: #616161;
    --text-muted: #9e9e9e;
    --text-code: #333333;
    --border: #e0e0e0;
    --border-light: #d0d0d0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
}

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

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    overflow: hidden;
    transition: background-color 0.3s, color 0.3s;
}

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

a:hover {
    text-decoration: underline;
}

.app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}


.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #1565c0);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.brand-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-section {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border);
}

.sidebar-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
    padding: 0 8px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    display: none;
}

.nav-badge {
    margin-left: auto;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.nav-item.active .nav-badge {
    background: var(--primary);
    color: white;
}

.sidebar-bottom {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.theme-indicator {
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 0;
    text-align: center;
    border-radius: var(--radius);
    transition: color 0.2s;
}

.theme-indicator:hover {
    color: var(--primary);
}

.version-text {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}


.main-content {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-primary);
}

.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.main-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}


.page {
    display: none;
    padding: 32px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.page.active-page {
    display: block;
    animation: fadeIn 0.3s ease;
}

.page-full {
    max-width: 100% !important;
    padding: 32px 60px !important;
}

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


.page-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}


.intro-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.2s;
}

.intro-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.intro-card h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.intro-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}


.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.feature-tag {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.feature-tag:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.tag-green {
    border-left-color: var(--easy);
}

.tag-blue {
    border-left-color: var(--primary);
}

.tag-accent {
    border-left-color: var(--warning);
}


.tutorial-list-item {
    display: flex;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    align-items: flex-start;
    border-left: 4px solid transparent;
}

.tutorial-list-item:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.tutorial-number {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 16px;
    color: var(--text-muted);
    min-width: 32px;
    text-align: center;
}

.tutorial-list-item h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.tutorial-excerpt {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.detail-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.detail-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tutorial-list-item.difficulty-easy {
    border-left-color: var(--easy);
}
.tutorial-list-item.difficulty-medium {
    border-left-color: var(--medium);
}
.tutorial-list-item.difficulty-hard {
    border-left-color: var(--hard);
}

.detail-meta .difficulty-text {
    font-weight: 600;
}
.difficulty-text.difficulty-easy {
    color: var(--easy);
}
.difficulty-text.difficulty-medium {
    color: var(--medium);
}
.difficulty-text.difficulty-hard {
    color: var(--hard);
}


.tutorial-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.tag:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}


.tutorial-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 40px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.tutorial-detail-card h2 {
    font-size: 26px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.detail-content {
    color: var(--text-primary);
    line-height: 1.8;
}

.detail-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 28px;
    margin-bottom: 12px;
    color: var(--text-primary);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.detail-content h3 {
    font-size: 17px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.detail-content p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.detail-content ul,
.detail-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
    color: var(--text-secondary);
}

.detail-content li {
    margin-bottom: 8px;
}

.detail-content code {
    background: var(--bg-code);
    color: var(--text-code);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 13px;
    border: 1px solid var(--border);
}

.detail-content pre {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    overflow-x: auto;
    margin: 16px 0;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
}

.detail-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--text-code);
}

.detail-content blockquote {
    border-left: 4px solid var(--primary);
    background: var(--primary-light);
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.detail-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.detail-content table th,
.detail-content table td {
    border: 1px solid var(--border);
    padding: 12px;
    text-align: left;
}

.detail-content table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.detail-content table td {
    color: var(--text-secondary);
}

.detail-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}


.back-to-list-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.back-to-list-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}


.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
}

.empty-state span {
    display: block;
    font-size: 16px;
    margin-bottom: 12px;
}

.action-link {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

.action-link:hover {
    text-decoration: underline;
}


.coming-soon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
}

.coming-soon-container h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.coming-soon-container p {
    color: var(--text-muted);
    font-size: 14px;
}

.coming-soon-icon {
    display: none;
}


.settings-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.settings-group h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.settings-row:last-child {
    border-bottom: none;
}


.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 26px;
    transition: all 0.3s;
    cursor: pointer;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s;
}

input:checked + .toggle-slider {
    background: var(--primary);
    border-color: var(--primary);
}

input:checked + .toggle-slider::before {
    transform: translateX(22px);
    background: white;
}

input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.coming-soon-badge {
    background: var(--warning-light);
    color: var(--warning);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}


.about-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    display: flex;
    gap: 24px;
}

.about-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #1565c0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 28px;
    color: white;
    flex-shrink: 0;
}

.about-info h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.about-info .role {
    color: var(--primary);
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: block;
}

.about-info p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
}

.stat-container {
    display: flex;
    gap: 12px;
    margin: 20px 0;
}

.stat-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    text-align: center;
    flex: 1;
    transition: all 0.2s;
}

.stat-box:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-top: 4px;
}

.stat-sub {
    font-size: 11px;
    color: var(--text-secondary);
}

.about-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.about-link {
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.about-link:hover {
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-color: var(--primary);
}

.current-status {
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}


@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .brand-name,
    .sidebar-section-title,
    .nav-item span:not(.nav-badge),
    .version-text,
    .theme-indicator {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: 12px;
    }

    .nav-item.active::before {
        display: none;
    }

    .nav-badge {
        display: none;
    }

    .page {
        padding: 20px;
    }

    .page-full {
        padding: 20px !important;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .tutorial-detail-card {
        padding: 20px;
    }

    .about-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .stat-container {
        flex-direction: column;
    }

    .about-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 22px;
    }

    .tutorial-list-item {
        flex-direction: column;
    }

    .tutorial-number {
        align-self: flex-start;
    }
}


.recent-tutorials-section {
    margin-top: 32px;
}