﻿/* ==================== 鏁欑▼椤甸潰鏍峰紡 ==================== */
/* Minimalist Modern Design - Electric Blue gradients, clean aesthetics, micro-interactions */

.tutorial-wrapper {
    padding: 48px 0;
    background: var(--bg-primary);
    position: relative;
}

/* Subtle radial glow effect */
.tutorial-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 82, 255, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

.tutorial-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 48px;
}

/* ==================== 宸︿晶鐩綍 ==================== */
.tutorial-sidebar {
    position: sticky;
    top: 88px;
    height: fit-content;
    background: #f0f0f0;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
}

.sidebar-header {
    padding: 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #4D7CFF 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

/* Shimmer effect */
.sidebar-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.sidebar-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.sidebar-nav {
    padding: 20px 16px;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}

/* Custom scrollbar */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

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

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

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section:last-child {
    margin-bottom: 0;
}

.nav-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: linear-gradient(90deg, var(--bg-primary) 0%, transparent 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-section-title::before {
    content: '';
    width: 3px;
    height: 12px;
    background: linear-gradient(180deg, var(--primary-color), #4D7CFF);
    border-radius: 2px;
}

.nav-link {
    display: block;
    padding: 10px 12px 10px 24px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s ease-out;
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary-color);
    border-radius: 2px;
    transition: height 0.2s ease-out;
}

.nav-link:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    padding-left: 28px;
}

.nav-link:hover::before {
    height: 16px;
}

.nav-link.active {
    background: linear-gradient(90deg, var(--primary-light) 0%, transparent 100%);
    color: var(--primary-color);
    font-weight: 600;
    padding-left: 28px;
}

.nav-link.active::before {
    height: 20px;
    background: linear-gradient(180deg, var(--primary-color), #4D7CFF);
}

/* ==================== 鍙充晶鍐呭 ==================== */
.tutorial-content {
    min-width: 0;
}

.content-header {
    margin-bottom: 40px;
    animation: fadeInUp 0.5s ease-out;
}

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

.content-header h1 {
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-secondary);
    transition: all 0.2s ease-out;
}

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

/* ==================== 鍐呭鍖哄煙 ==================== */
.content-body {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 48px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.content-section {
    margin-bottom: 56px;
    padding-bottom: 56px;
    border-bottom: 1px solid var(--border-color);
}

.content-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.content-section h2 {
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
    position: relative;
    padding-left: 16px;
}

.content-section h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-color), #4D7CFF);
    border-radius: 2px;
}

.content-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 36px 0 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.content-section h3::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.6;
}

.content-section p {
    margin-bottom: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.content-section ul,
.content-section ol {
    margin: 20px 0;
    padding-left: 24px;
}

.content-section li {
    margin-bottom: 12px;
    line-height: 1.75;
    color: var(--text-secondary);
    position: relative;
}

.content-section ul li::marker {
    color: var(--primary-color);
}

/* ==================== 淇℃伅妗?==================== */
.info-box {
    background: linear-gradient(90deg, #EEF2FF 0%, #F8FAFF 100%);
    border-left: 4px solid var(--primary-color);
    padding: 24px 28px;
    border-radius: 0 12px 12px 0;
    margin: 24px 0;
    position: relative;
    overflow: hidden;
}

.info-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at left center, rgba(0, 82, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.info-box strong {
    display: block;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 1rem;
}

.info-box ul {
    margin: 0;
    padding-left: 20px;
}

.info-box.warning {
    background: linear-gradient(90deg, #FEF3C7 0%, #FFFBEB 100%);
    border-left-color: #F59E0B;
}

.info-box.warning::before {
    background: radial-gradient(circle at left center, rgba(245, 158, 11, 0.08) 0%, transparent 50%);
}

.explain-box {
    background: linear-gradient(90deg, #F0FDF4 0%, #F0FFF4 100%);
    border-left: 4px solid #10B981;
    padding: 24px 28px;
    border-radius: 0 12px 12px 0;
    margin: 24px 0;
    position: relative;
}

.explain-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at left center, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.explain-box strong {
    display: block;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 1rem;
}

/* ==================== 浠ｇ爜鍧?==================== */
.code-block {
    margin: 24px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
}

.code-header {
    background: linear-gradient(90deg, #1E293B 0%, #334155 100%);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-header span {
    color: #94A3B8;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94A3B8;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease-out;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.code-block pre {
    background: #0F172A;
    padding: 24px;
    margin: 0;
    overflow-x: auto;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.75;
    color: #E2E8F0;
}

/* ==================== 琛ㄦ牸 ==================== */
.data-table,
.content-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.9rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
}

.data-table th,
.data-table td,
.content-table th,
.content-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th,
.content-table th {
    background: linear-gradient(90deg, var(--bg-primary) 0%, #F8FAFC 100%);
    font-weight: 600;
    color: var(--text-primary);
}

.data-table td,
.content-table td {
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

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

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

.data-table code,
.content-table code {
    background: var(--primary-light);
    padding: 3px 10px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 500;
}

.table-header {
    background: linear-gradient(90deg, var(--bg-primary) 0%, #F8FAFC 100%);
    font-weight: 600;
    color: var(--text-primary);
}

.table-cell {
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

/* ==================== 鍒楄〃 ==================== */
.content-list {
    margin: 20px 0;
    padding-left: 24px;
    list-style-type: disc;
}

.content-list li {
    margin-bottom: 12px;
    line-height: 1.75;
    color: var(--text-secondary);
    position: relative;
}

.content-list li::marker {
    color: var(--primary-color);
    font-size: 1.2em;
}

.ordered-list {
    list-style-type: decimal;
}

.ordered-list li::marker {
    color: var(--primary-color);
    font-weight: 600;
}

.list-item {
    margin-bottom: 12px;
    line-height: 1.75;
    color: var(--text-secondary);
    position: relative;
}

.list-item::marker {
    color: var(--primary-color);
    font-size: 1.2em;
}

/* ==================== 灏濊瘯鎸夐挳 ==================== */
.try-it-box {
    margin: 24px 0;
}

.try-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #4D7CFF 100%);
    color: white;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease-out;
    box-shadow: 0 4px 14px rgba(0, 82, 255, 0.25);
}

.try-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 82, 255, 0.35);
}

/* ==================== 搴曢儴瀵艰埅 ==================== */
.content-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 48px;
    padding-top: 48px;
    border-top: 1px solid var(--border-color);
}

.nav-prev,
.nav-next {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 28px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.3s ease-out;
}

.nav-prev:hover,
.nav-next:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 82, 255, 0.15);
}

.nav-next {
    margin-left: auto;
}

/* ==================== 鍝嶅簲寮?==================== */
@media (max-width: 1024px) {
    .tutorial-layout {
        grid-template-columns: 1fr;
    }

    .tutorial-sidebar {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .content-body {
        padding: 28px;
    }

    .content-header h1 {
        font-size: 2rem;
    }

    .content-section h2 {
        font-size: 1.5rem;
    }

    .content-nav {
        flex-direction: column;
        gap: 16px;
    }

    .nav-prev,
    .nav-next {
        width: 100%;
        justify-content: center;
    }

    .nav-next {
        margin-left: 0;
    }
}

/* ==================== 绔犺妭鍒楄〃 ==================== */
.chapter-list {
    margin: 24px 0;
}

.chapter-item {
    display: flex;
    align-items: center;
    padding: 18px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.3s ease-out;
}

.chapter-item:hover {
    border-color: var(--primary-color);
    background: var(--bg-primary);
    transform: translateX(4px);
    box-shadow: 0 4px 14px rgba(0, 82, 255, 0.1);
}

.chapter-num {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #4D7CFF 100%);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    margin-right: 18px;
    box-shadow: 0 2px 8px rgba(0, 82, 255, 0.25);
}

.chapter-title {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.chapter-item i {
    color: var(--text-muted);
    transition: all 0.3s ease-out;
}

.chapter-item:hover i {
    color: var(--primary-color);
    transform: translateX(6px);
}

/* ==================== 代码高亮样式 ==================== */
.hl-main {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.75;
}

.hl-brackets {
    color: #FF6B6B;
}

.hl-code {
    color: #E2E8F0;
}

.hl-var {
    color: #4EC9B0;
}

.hl-reserved {
    color: #569CD6;
}

.hl-string {
    color: #CE9178;
}

.hl-quotes {
    color: #CE9178;
}

.hl-number {
    color: #B5CEA8;
}

.hl-comment {
    color: #6A9955;
    font-style: italic;
}

.hl-function {
    color: #DCDCAA;
}

.hl-keyword {
    color: #569CD6;
}

/* ==================== Markdown代码样式 ==================== */
.markdown-code {
    background: #f3f9ff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow-x: auto;
}

.markdown-code code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
}

/* ==================== 示例代码样式 ==================== */
.example_code.notranslate {
    background: #f3f9ff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow-x: auto;
}

.example_code.notranslate code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
}

/* ==================== 代码div样式 ==================== */
div.code,
div.code.notranslate {
    background: #f3f9ff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow-x: auto;
}

div.code code,
div.code.notranslate code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
}
