:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --accent-color: #3b82f6;
    --text-color: #1e293b;
    --text-light: #64748b;
    --bg-color: #f8fafc;
    --section-bg-color: #ffffff;
    --shadow: 0 4px 20px rgba(0,0,0,0.05);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 深色模式变量 */
body.dark-theme {
    --primary-color: #60a5fa;
    --secondary-color: #94a3b8;
    --accent-color: #3b82f6;
    --text-color: #e2e8f0;
    --text-light: #94a3b8;
    --bg-color: #0f172a;
    --section-bg-color: #1e293b;
    --shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* 深色模式下的导航栏 */
body.dark-theme header {
    background-color: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
}

/* 深色模式下的卡片和项目 */
body.dark-theme .knowledge-card,
body.dark-theme .accordion-item {
    background-color: #1e293b;
}

/* 深色模式下的折叠菜单 */
body.dark-theme .collapsible {
    background-color: #1e293b;
}

body.dark-theme .collapsible:hover {
    background-color: #263548;
}

body.dark-theme .collapsible.active {
    background-color: #2d4055;
}

/* 深色模式下的内容区域 */
body.dark-theme .content {
    background-color: #1e293b;
}

/* 深色模式下的Markdown容器 */
body.dark-theme .markdown-container {
    background-color: var(--section-bg-color);
    border-color: #334155;
}

/* 深色模式下的搜索框 */
body.dark-theme input[type="search"] {
    background-color: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

body.dark-theme input[type="search"]::placeholder {
    color: #94a3b8;
}

/* 深色模式下的社交链接 */
body.dark-theme .social-links a {
    background-color: #334155;
    color: #e2e8f0;
}

/* 深色模式下的搜索结果 */
body.dark-theme .search-result-section ul li {
    background-color: #1e293b;
}

body.dark-theme .search-result-section ul li:hover {
    background-color: #2d4055;
}

body.dark-theme .no-results {
    background-color: #1e293b;
}

/* 深色模式下的项目卡片 - GitHub 深色风格 */
body.dark-theme .project-card {
    background: #0d1117;
    border: 1px solid #30363d;
    box-shadow: none;
}

body.dark-theme .project-card:hover {
    border-color: #58a6ff;
    box-shadow: 0 3px 12px rgba(88, 166, 255, 0.15);
}

body.dark-theme .project-icon {
    background: #161b22;
}

body.dark-theme .project-card:hover .project-icon {
    background: #1c2128;
}

body.dark-theme .project-icon i {
    color: #8b949e;
}

body.dark-theme .project-card:hover .project-icon i {
    color: #58a6ff;
}

body.dark-theme .project-card h4 a {
    color: #58a6ff;
}

body.dark-theme .project-card h4 a:hover {
    text-decoration: underline;
}

body.dark-theme .project-desc {
    color: #8b949e;
}

body.dark-theme .project-category h3 {
    color: #f0f6fc;
    background: none;
    border: none;
    border-bottom: 1px solid #30363d;
    padding: 0;
    padding-bottom: 0.5rem;
}

body.dark-theme .project-subtitle {
    color: #8b949e;
    border: none;
    background: none;
    padding: 0;
}

body.dark-theme #projects {
    background: #0d1117;
}

body.dark-theme #projects h2 {
    color: #f0f6fc;
}

/* 深色模式下的按钮 */
body.dark-theme .btn {
    background-color: #3b82f6;
}

body.dark-theme .btn:hover {
    background-color: #60a5fa;
}

body.dark-theme .back-button {
    background-color: #3b82f6;
}

body.dark-theme .back-button:hover {
    background-color: #60a5fa;
}

/* 深色模式下的代码块 */
body.dark-theme .markdown-content pre {
    background-color: #1a2234;
}

body.dark-theme .markdown-content code {
    color: #e2e8f0;
}

/* 深色模式下的页脚 */
body.dark-theme footer {
    background-color: #1e293b;
    border-top-color: #334155;
}

/* 深色模式下的时间线 */
body.dark-theme .timeline-year {
    background-color: #334155;
    color: #e2e8f0;
}

body.dark-theme .timeline-content {
    border-left-color: #334155;
}

/* 深色模式下的more-footer */
body.dark-theme .more-footer {
    background-color: rgba(37, 59, 94, 0.7);
}

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

body {
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
}

header {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.logo img {
    height: 40px;
    border-radius: 50%;
    transition: var(--transition);
}

.logo img:hover {
    transform: scale(1.05);
}

nav ul {
    display: flex;
    list-style-type: none;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin-left: 2rem;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
}

nav ul li a:hover {
    color: var(--accent-color);
    background-color: rgba(59, 130, 246, 0.1);
    text-decoration: none;
}

nav ul li a.active {
    color: var(--accent-color);
    background-color: rgba(59, 130, 246, 0.15);
}

.nav-right {
    display: flex;
    align-items: center;
}

.robot-lab-fab {
    position: fixed;
    right: calc(max(2rem, env(safe-area-inset-right)) + 72px);
    bottom: max(2rem, env(safe-area-inset-bottom));
    z-index: 1100;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--text-color);
    font-size: 1.5rem;
    line-height: 1;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.robot-lab-fab:hover {
    color: var(--accent-color);
    text-decoration: none;
    transform: translateY(-2px) scale(1.08);
}

.robot-lab-fab:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.45);
    outline-offset: 4px;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    margin-right: 1rem;
    color: var(--text-color);
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--accent-color);
}

.village-icon {
    position: fixed;
    bottom: max(2rem, env(safe-area-inset-bottom));
    right: max(2rem, env(safe-area-inset-right));
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.village-icon:hover {
    color: var(--accent-color);
}

input[type="search"] {
    padding: 0.6rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 30px;
    font-size: 0.9rem;
    width: 180px;
    transition: var(--transition);
    outline: none;
}

input[type="search"]:focus {
    width: 220px;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(93, 156, 236, 0.2);
}

#search-button {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: -30px;
    color: var(--text-light);
    transition: var(--transition);
}

#search-button:hover {
    color: var(--accent-color);
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 5%;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3rem 0;
    gap: 3rem;
}

.hero-content {
    flex: 1;
    position: relative;
    isolation: isolate;
}

.hero-content > :not(.hero-robot-frame) {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-light);
}

.social-links {
    margin-bottom: 2.5rem;
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f0f2f5;
    color: var(--text-color);
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-3px);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    color: white;
}

.btn.resume-btn {
    margin-left: 1rem;
    background: linear-gradient(135deg, #ff7a45 0%, #ff4d4f 100%);
    box-shadow: 0 10px 20px rgba(255, 77, 79, 0.25);
    font-weight: 600;
}

.btn.resume-btn:hover {
    background: linear-gradient(135deg, #ff814c 0%, #ff6a6c 100%);
    box-shadow: 0 14px 24px rgba(255, 106, 108, 0.3);
}

.resume-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 1100;
}

.resume-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.resume-modal__dialog {
    position: relative;
    width: min(420px, 100%);
    background: var(--section-bg-color);
    border-radius: 18px;
    padding: 2.25rem 2rem 2.5rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.resume-modal__close {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.resume-modal__close:hover {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary-color);
}

.resume-modal__header {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.resume-modal__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.resume-modal__title {
    margin: 0;
    color: var(--text-color);
    font-size: 1.4rem;
    font-weight: 600;
}

.resume-modal__subtitle {
    margin: 0.35rem 0 0;
    color: var(--text-light);
    font-size: 0.95rem;
}

.resume-modal__form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.resume-modal__form label {
    font-weight: 500;
    color: var(--text-color);
}

.resume-modal__form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    font-size: 1rem;
    transition: var(--transition);
    background-color: rgba(255, 255, 255, 0.9);
}

.resume-modal__form input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    outline: none;
}

.resume-modal__error {
    min-height: 1.1rem;
    margin: 0;
    color: #ef4444;
    font-size: 0.9rem;
}

.resume-modal__actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.resume-modal__submit {
    flex: 1;
}

.resume-modal__cancel {
    flex: 1;
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    background-color: rgba(148, 163, 184, 0.15);
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
}

.resume-modal__cancel:hover {
    background-color: rgba(148, 163, 184, 0.28);
}

.resume-modal__hint {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
}

body.dark-theme .resume-modal {
    background: rgba(15, 23, 42, 0.65);
}

body.dark-theme .resume-modal__dialog {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.45);
}

body.dark-theme .resume-modal__form input {
    background-color: rgba(30, 41, 59, 0.65);
    border-color: rgba(148, 163, 184, 0.35);
    color: #e2e8f0;
}

body.dark-theme .resume-modal__form input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2);
}

body.dark-theme .resume-modal__cancel {
    background-color: rgba(148, 163, 184, 0.15);
    color: #e2e8f0;
}

body.dark-theme .resume-modal__cancel:hover {
    background-color: rgba(148, 163, 184, 0.25);
}

@media (max-width: 480px) {
    .resume-modal__dialog {
        padding: 2rem 1.5rem;
    }

    .resume-modal__actions {
        flex-direction: column;
    }
}

/* 简历不可用提示模态框特定样式 */
.resume-unavailable__dialog {
    text-align: center;
}

.resume-unavailable__icon {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #ef4444 !important;
}

.resume-unavailable__content {
    padding: 1rem 0;
    line-height: 1.8;
}

.resume-unavailable__content p {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1rem;
}

body.dark-theme .resume-unavailable__icon {
    background: rgba(248, 113, 113, 0.15) !important;
    color: #f87171 !important;
}

.hero-image {
    flex: 1;
    max-width: 50%;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.hero-image video {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: var(--border-radius);
    display: block;
}

.hero-robot-frame {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    display: block;
    width: clamp(220px, 24vw, 340px);
    height: 100%;
    border: 0;
    background: transparent;
    pointer-events: none;
    opacity: 0;
    transform: translateX(var(--hero-robot-offset-x, -8%));
    transition: opacity 0.45s ease;
}

.hero-robot-frame.is-ready {
    opacity: 1;
}

.hero-robot-frame.is-unavailable {
    display: none;
}

section {
    background-color: var(--section-bg-color);
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

section:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-5px);
}

h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

h2:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    border-radius: 3px;
}

h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin: 1.5rem 0 1rem;
}

ul, ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

li {
    margin-bottom: 0.7rem;
}

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

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

footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--section-bg-color);
    margin-top: 3rem;
    border-top: 1px solid #eaeaea;
    color: var(--text-light);
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* 移动端菜单样式 */
.nav-menu {
    transition: all 0.3s ease;
}

@media (max-width: 992px) {
    .hero {
        flex-direction: column;
        text-align: center;
    }

    .hero-content, .hero-image {
        max-width: 100%;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

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

    .hero-content .btn {
        margin-bottom: 1rem;
    }

    .btn.resume-btn {
        margin-left: 0;
    }
}

/* 博客文章分类标题 */
#article-list li.list-category {
    list-style: none;
    margin: 1.8rem 0 0.5rem;
    padding-bottom: 0.4rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary-color);
    border-bottom: 1px solid #eaeaea;
}

#article-list li.list-category:first-child {
    margin-top: 0.2rem;
}

body.dark-theme #article-list li.list-category {
    color: #e2e8f0;
    border-bottom-color: #334155;
}

/* ============ 博客专辑（合集折叠目录） ============ */
#article-list li.album-item,
#article-list li.album-toolbar-item {
    list-style: none;
}

#article-list li.album-item {
    margin: 0.7rem 0;
}

#article-list li.album-item details.album {
    background: var(--section-bg-color);
    border: 1px solid #eaeaea;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#article-list li.album-item details.album:hover {
    border-color: #cbd5e1;
}

#article-list li.album-item details.album[open] {
    border-color: var(--accent-color);
}

/* 专辑头（点击可折叠/展开） */
#article-list .album-summary {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1.1rem;
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: background-color 0.2s ease;
}

#article-list .album-summary::-webkit-details-marker,
#article-list .album-summary::marker {
    display: none;
    content: "";
}

#article-list .album-summary:hover {
    background-color: var(--bg-color);
}

/* 展开箭头 */
#article-list .album-arrow {
    flex: none;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-light);
    border-bottom: 2px solid var(--text-light);
    transform: rotate(-45deg);
    transition: transform 0.25s ease;
    margin-right: 0.15rem;
}

#article-list details.album[open] .album-arrow {
    transform: rotate(45deg);
}

#article-list .album-icon {
    flex: none;
    font-size: 1.15rem;
    line-height: 1;
}

#article-list .album-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-color);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#article-list .album-count {
    flex: none;
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--text-light);
    background: var(--bg-color);
    border: 1px solid #eaeaea;
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
    white-space: nowrap;
}

/* 专辑内文章目录 */
#article-list ul.album-posts {
    margin: 0;
    padding: 0.15rem 1.1rem 0.9rem;
    border-top: 1px dashed #eaeaea;
}

#article-list ul.album-posts li {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #f1f5f9;
    font-size: 0.97rem;
}

#article-list ul.album-posts li:last-child {
    border-bottom: none;
    padding-bottom: 0.15rem;
}

/* 专辑内的分部小标题（如哲学史的“第一部”等） */
#article-list ul.album-posts li.list-subcategory {
    margin: 1rem 0 0.2rem;
    padding-bottom: 0.3rem;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--primary-color);
    border-bottom: 1px solid #eaeaea;
}

body.dark-theme #article-list ul.album-posts li.list-subcategory {
    color: #93c5fd;
    border-bottom-color: #334155;
}

/* 系列名前缀弱化（专辑头已展示系列名，搜索文本不受影响） */
#article-list .series-prefix {
    color: var(--text-light);
    opacity: 0.75;
}

/* 专辑工具条（随文章列表一起显示/隐藏） */
#article-list .album-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0.2rem 0 1rem;
}

#article-list .album-hint {
    font-size: 0.9rem;
    color: var(--text-light);
}

#article-list .album-toolbar-actions {
    display: flex;
    gap: 0.5rem;
}

#article-list .album-tool-btn {
    font-size: 0.85rem;
    color: var(--text-color);
    background: var(--section-bg-color);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.35rem 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

#article-list .album-tool-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 深色模式适配 */
body.dark-theme #article-list li.album-item details.album {
    background-color: #1e293b;
    border-color: #334155;
}

body.dark-theme #article-list li.album-item details.album:hover {
    border-color: #475569;
}

body.dark-theme #article-list li.album-item details.album[open] {
    border-color: #3b82f6;
}

body.dark-theme #article-list .album-summary:hover {
    background-color: #263548;
}

body.dark-theme #article-list .album-name {
    color: #e2e8f0;
}

body.dark-theme #article-list .album-count {
    background: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}

body.dark-theme #article-list ul.album-posts {
    border-top-color: #334155;
}

body.dark-theme #article-list ul.album-posts li {
    border-bottom-color: #26334a;
}

body.dark-theme #article-list .album-tool-btn {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-theme #article-list .album-tool-btn:hover {
    color: #60a5fa;
    border-color: #60a5fa;
}

@media (max-width: 768px) {
    #article-list .album-summary {
        padding: 0.7rem 0.85rem;
        gap: 0.5rem;
    }

    #article-list .album-name {
        font-size: 0.98rem;
    }

    #article-list ul.album-posts {
        padding: 0.1rem 0.85rem 0.7rem;
    }

    #article-list .album-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}


@media (max-width: 768px) {
    .hero-robot-frame {
        width: min(220px, calc(100vw - 48px));
    }

    .robot-lab-fab,
    .village-icon {
        bottom: max(1rem, env(safe-area-inset-bottom));
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
        border: 1px solid rgba(148, 163, 184, 0.28);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.82);
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .robot-lab-fab { right: calc(max(1rem, env(safe-area-inset-right)) + 76px); }
    .village-icon { right: max(1rem, env(safe-area-inset-right)); }

    .robot-lab-fab:active,
    .village-icon:active { transform: scale(0.94); }

    body.dark-theme .robot-lab-fab,
    body.dark-theme .village-icon {
        background: rgba(30, 41, 59, 0.86);
        border-color: rgba(148, 163, 184, 0.32);
    }

    /* 导航栏调整 */
    nav {
        flex-wrap: wrap;
        padding: 1rem 1rem;
    }

    .logo img {
        height: 35px;
    }

    /* 显示汉堡菜单按钮 */
    .mobile-menu-toggle {
        display: flex;
    }

    /* 隐藏导航菜单 */
    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        background-color: var(--section-bg-color);
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 1rem 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        border-radius: 0 0 12px 12px;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        margin: 0;
        text-align: center;
    }

    .nav-menu li a {
        display: block;
        padding: 1rem;
        border-radius: 0;
        margin: 0;
    }

    /* 深色模式下的移动菜单 */
    body.dark-theme .nav-menu {
        background-color: rgba(15, 23, 42, 0.98);
    }

    /* 导航右侧元素调整 */
    .nav-right {
        margin-left: auto;
    }

    .search-container {
        display: none;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    section {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    #projects {
        padding: 2rem 1rem;
    }

    #projects h2 {
        font-size: 1.5rem;
    }

    .project-category h3 {
        font-size: 1.1rem;
        margin-top: 2rem;
    }

    .project-subtitle {
        font-size: 0.95rem;
        margin: 1.5rem 0 1rem 0;
    }

    .project-icon {
        width: 48px;
        height: 48px;
        margin: 1rem 1rem 0.75rem 1rem;
    }

    .project-icon i {
        font-size: 1.25rem;
    }

    .project-card h4 {
        font-size: 0.95rem;
        margin: 0 1rem 0.5rem 1rem;
    }

    .project-desc {
        font-size: 0.85rem;
        margin: 0 1rem 1rem 1rem;
    }

    .video-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .social-links {
        gap: 0.8rem;
    }

    .social-links a {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .btn {
        padding: 0.65rem 1.2rem;
        font-size: 0.95rem;
    }

    /* 时间线调整 */
    .timeline-item {
        padding-left: 2rem;
        margin-bottom: 2rem;
    }

    .timeline-year {
        font-size: 1.3rem;
    }

    /* 文章列表调整 */
    #article-list li {
        font-size: 0.95rem;
    }

    /* 教程库标签调整 */
    .tabs-nav {
        flex-wrap: nowrap;
    }

    .tabs-nav .tab-btn {
        font-size: 0.9rem;
        padding: 0.5rem 0.8rem;
    }
}

@media (max-width: 480px) {
    /* 更小的屏幕优化 */
    main {
        padding: 1rem 3%;
    }

    .hero {
        padding: 2rem 0;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

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

    section {
        padding: 1rem 0.8rem;
        border-radius: 8px;
    }

    h2 {
        font-size: 1.4rem;
    }

    h2:after {
        width: 40px;
        height: 2px;
    }

    h3 {
        font-size: 1.1rem;
    }

    .project-card, .knowledge-card, .video-card {
        padding: 1.2rem;
    }

    .project-card h4, .knowledge-card h4 {
        font-size: 1rem;
    }

    .project-desc {
        font-size: 0.9rem;
    }

    .social-links a {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.8rem;
    }

    .btn.resume-btn {
        margin-left: 0;
    }

    /* Logo 大小 */
    .logo img {
        height: 30px;
    }

    /* 主题切换按钮 */
    .theme-toggle {
        font-size: 1rem;
        margin-right: 0.5rem;
    }

    .robot-lab-fab,
    .village-icon {
        font-size: 1.25rem;
    }

    /* 时间线进一步优化 */
    .timeline-item {
        padding-left: 1.5rem;
    }

    .timeline-content {
        padding: 1rem;
    }

    /* 折叠菜单调整 */
    .collapsible {
        padding: 0.8rem 1rem 0.8rem 2.5rem;
        font-size: 1rem;
    }

    /* Quote 调整 */
    .quote {
        font-size: 1rem;
    }

    /* Footer 调整 */
    footer {
        padding: 1.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* 横屏手机优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 1.5rem 0;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    section {
        padding: 1rem 1.5rem;
    }
}

/* Page transitions */
.page {
    display: none;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Collapsible elements */
.accordion {
    width: 100%;
    margin-bottom: 1.5rem;
}

.accordion-item {
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    background: #fff;
}

.accordion-item .accordion-item {
    margin: 0.5rem 0;
    box-shadow: none;
    border-left: 2px solid var(--accent-color);
    border-radius: 0;
    background: rgba(240, 245, 255, 0.5);
}

.collapsible {
    cursor: pointer;
    position: relative;
    padding: 1rem 1.5rem 1rem 3rem;
    transition: var(--transition);
    font-weight: 600;
    font-size: 1.1rem;
    background: #f8f9fa;
    color: var(--text-color);
    display: flex;
    align-items: center;
    border-radius: 8px;
}

.accordion-item .accordion-item .collapsible {
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    font-size: 1rem;
    background: transparent;
}

.collapsible::before {
    content: '⏵';
    position: absolute;
    left: 1.2rem;
    transition: transform 0.3s;
    color: var(--accent-color);
}

.accordion-item .accordion-item .collapsible::before {
    left: 0.8rem;
}

.collapsible.active {
    color: var(--primary-color);
    background-color: rgba(240, 245, 255, 0.8);
}

.collapsible.active::before {
    transform: rotate(90deg);
}

.collapsible:hover {
    background-color: rgba(240, 245, 255, 0.8);
}

.content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    padding: 0 1.5rem;
    background-color: #ffffff;
}

.accordion-item .accordion-item .content {
    padding: 0 1rem 0 2.5rem;
    background-color: transparent;
}

.content.show {
    display: block;
}

.content ul {
    padding: 1rem 0;
    margin: 0;
}

.content ul li {
    margin-bottom: 0.8rem;
    list-style-type: none;
    position: relative;
    padding-left: 1.5rem;
}

.content ul li:before {
    content: "•";
    color: var(--accent-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.content ul li:last-child {
    margin-bottom: 0;
}

.content ul li a {
    display: inline-block;
    padding: 0.5rem 0;
    transition: all 0.2s;
    border-radius: 4px;
    width: 100%;
}

.content ul li a:hover {
    transform: translateX(5px);
    color: var(--primary-color);
}

/* Animation for accordion */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Markdown container */
.markdown-container {
    padding: 1.5rem;
    background: var(--section-bg-color);
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    border: 1px solid #eaeaea;
    display: none; /* 默认隐藏 */
}

body.dark-theme .markdown-container {
    background-color: var(--section-bg-color);
    border-color: #334155;
}

/* 确保GitHub Markdown样式不覆盖我们的主题 */
.markdown-body {
    color: var(--text-color) !important;
    background-color: transparent !important;
}

/* 确保markdown内部代码块颜色也跟随主题 */
.markdown-body pre, .markdown-body code {
    background-color: var(--bg-color) !important;
}

body.dark-theme .markdown-body pre, 
body.dark-theme .markdown-body code {
    background-color: #1a2234 !important;
    color: #e2e8f0 !important;
}

/* 确保markdown链接颜色跟随主题 */
.markdown-body a {
    color: var(--primary-color) !important;
}

/* 确保markdown标题颜色跟随主题 */
.markdown-body h1, 
.markdown-body h2, 
.markdown-body h3, 
.markdown-body h4, 
.markdown-body h5, 
.markdown-body h6 {
    color: var(--text-color) !important;
}

#more .markdown-container {
    margin-top: 0;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    background-color: var(--section-bg-color);
}

/* 修复AI Agent页面的背景问题 */
#more .markdown-container pre {
    background-color: var(--bg-color) !important;
}

body.dark-theme #more .markdown-container pre {
    background-color: #1a2234 !important;
}

.error {
    color: #e53e3e;
    text-align: center;
    font-weight: 500;
    margin-bottom: 1rem;
}

.error-details {
    font-size: 0.9rem;
    color: #718096;
    text-align: center;
    margin-bottom: 0.5rem;
}

/* Icons */
.fas, .fab {
    margin-right: 8px;
    color: var(--accent-color);
}

/* About section */
#about .about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

#about h3 {
    margin-top: 1.5rem;
    color: var(--primary-color);
    font-size: 1.3rem;
}

#about ul, #about ol {
    padding-left: 1.5rem;
}

#about li {
    margin-bottom: 0.7rem;
}

/* Back button */
.back-button {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: var(--transition);
    font-weight: 500;
}

.back-button:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Markdown content */
.markdown-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem auto;
    border-radius: var(--border-radius);
}

.markdown-content pre {
    background-color: #f6f8fa;
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 1.5rem 0;
}

.markdown-content code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
}

/* 搜索结果样式 */
.search-results-list {
    margin-top: 2rem;
}

.search-result-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eaeaea;
}

.search-result-section:last-child {
    border-bottom: none;
}

.search-result-section h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(59, 130, 246, 0.2);
}

.search-result-section ul {
    list-style-type: none;
    padding-left: 0.5rem;
}

.search-result-section ul li {
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
    background-color: #f9fafb;
    border-radius: 8px;
    transition: var(--transition);
}

.search-result-section ul li:hover {
    background-color: #f0f5ff;
    transform: translateX(5px);
}

.search-result-section ul li a {
    display: block;
    color: var(--text-color);
    font-weight: 500;
    text-decoration: none;
}

.search-result-section ul li a:hover {
    color: var(--primary-color);
}

.search-loading,
.search-result-excerpt {
    color: var(--text-light);
}

.search-loading {
    margin-top: 1rem;
}

.search-result-excerpt {
    margin: 0.5rem 0 0;
    font-size: 0.92rem;
    line-height: 1.6;
}

.no-results {
    margin-top: 2rem;
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-light);
    padding: 2rem;
    background-color: #f9fafb;
    border-radius: var(--border-radius);
}

#search-results .markdown-container {
    margin-top: 2rem;
}

/* 增强搜索框的视觉反馈 */
.search-container {
    position: relative;
    transition: var(--transition);
}

.search-container:focus-within {
    transform: scale(1.02);
}

#search-input {
    padding-right: 2.5rem;
}

#search-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

#search-button:hover {
    color: var(--primary-color);
}

/* Section intro text */
.section-intro {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-secondary-color);
    line-height: 1.6;
    max-width: 800px;
}

/* More page specific styles */
.more-footer {
    margin-top: 3rem;
    padding: 1.5rem;
    background-color: rgba(240, 245, 255, 0.7);
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 1.1rem;
}

.more-footer a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
    transition: var(--transition);
}

.more-footer a:hover {
    color: var(--accent-color);
}

/* Project cards */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.project-card {
    background: #ffffff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 0;
    box-shadow: none;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    border-color: #0969da;
    box-shadow: 0 3px 12px rgba(140, 149, 159, 0.15);
    transform: translateY(-2px);
}

.project-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6f8fa;
    border-radius: 6px;
    margin: 1rem 1rem 0.75rem 1rem;
    position: relative;
    transition: all 0.2s ease;
}

.project-card:hover .project-icon {
    background: #ddf4ff;
}

.project-icon i {
    font-size: 1.5rem;
    color: #656d76;
    margin-right: 0;
    transition: all 0.2s ease;
}

.project-card:hover .project-icon i {
    color: #0969da;
}

.project-card h4 {
    font-size: 1rem;
    margin: 0 1rem 0.5rem 1rem;
    line-height: 1.5;
    font-weight: 600;
    letter-spacing: normal;
}

.project-card h4 a {
    color: #0969da;
    text-decoration: none;
    transition: all 0.1s ease;
    display: inline-block;
    position: relative;
}

.project-card h4 a:hover {
    text-decoration: underline;
}

.project-desc {
    color: #656d76;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0 1rem 1rem 1rem;
    margin-top: auto;
}

.project-category {
    margin-bottom: 2rem;
    position: relative;
}

.project-category h3 {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2328;
    padding: 0;
    background: none;
    border: none;
    border-bottom: 1px solid #d0d7de;
    padding-bottom: 0.5rem;
    letter-spacing: normal;
}

.project-category h3::before {
    content: none;
}

.project-category h3:after {
    content: none;
}

.project-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: #656d76;
    margin: 1.5rem 0 1rem 0;
    padding: 0;
    border: none;
    background: none;
    letter-spacing: normal;
}

/* Page specific styles for projects and more pages */
#projects .project-card, #more .project-card {
    min-height: 140px;
}

#projects {
    background: #ffffff;
    position: relative;
    padding: 3rem 2rem;
}

#projects::before {
    content: none;
}

#projects::after {
    content: none;
}

#projects h2 {
    color: #1f2328;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: left;
    letter-spacing: normal;
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
    background-clip: initial;
    position: relative;
    z-index: 1;
    text-shadow: none;
    filter: none;
}

#projects > h2::after {
    content: none;
}

/* GitHub 风格不需要复杂动画 */

/* 教程库：竖排标签 + 视频站风格 */
.tutorial-tabs {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.tabs-nav {
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.5rem;
}

.tabs-nav .tab-btn {
    background: #fff;
    border: 1px solid #e6eefc;
    color: var(--text-color);
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(13, 71, 161, 0.03);
}

.tabs-nav .tab-btn:hover {
    transform: translateX(4px);
    background: linear-gradient(90deg, rgba(59,130,246,0.06), rgba(59,130,246,0.02));
}

.tabs-nav .tab-btn.active {
    background: linear-gradient(90deg, rgba(59,130,246,0.12), rgba(59,130,246,0.06));
    border-color: rgba(59,130,246,0.22);
    color: var(--primary-color);
    box-shadow: 0 6px 18px rgba(59,130,246,0.08);
}

.tab-panels {
    min-height: 240px;
}

.tab-panel {
    display: none;
}

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

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
}

.video-card {
    background: var(--section-bg-color);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 6px 20px rgba(16,24,40,0.04);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 180px;
}

.video-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(16,24,40,0.08);
}

.video-thumb {
    width: 100%;
    height: 140px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(59,130,246,0.06), rgba(59,130,246,0.02));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    margin-bottom: 0.9rem;
    position: relative;
}

.video-thumb::after {
    content: '▶';
    position: absolute;
    right: 12px;
    bottom: 8px;
    background: rgba(0,0,0,0.5);
    color: white;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
}

.video-card h4 {
    margin: 0 0 0.4rem 0;
    font-size: 1.05rem;
}

.card-actions {
    margin-top: auto;
}

.preview-container {
    margin-top: 0.8rem;
    display: none;
    max-height: 180px;
    overflow: auto;
    border-radius: 8px;
    border: 1px solid #eef6ff;
    padding: 0.6rem;
    background: #fff;
}

/* Responsive: 在窄屏上改为竖向堆叠 */
@media (max-width: 900px) {
    .tutorial-tabs {
        grid-template-columns: 1fr;
    }
    .tabs-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 0.5rem;
        padding-bottom: 0.5rem;
    }
    .tabs-nav .tab-btn {
        white-space: nowrap;
        flex: 0 0 auto;
    }
    .video-thumb {
        height: 180px;
    }
    .preview-container {
        max-height: 260px;
    }
}

/* 教程库：电子书式阅读布局 */
.tutorial-book {
    display: grid;
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
    margin-top: 2rem;
}

.tutorial-book__toc {
    position: sticky;
    top: 105px;
    align-self: start;
}

.tutorial-book__toc-card,
.tutorial-book__reader {
    border-radius: 28px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 22px 45px rgba(15, 23, 42, 0.08);
}

.tutorial-book__toc-card {
    padding: 1.6rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.98));
}

.tutorial-book__eyebrow,
.tutorial-book__cover-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tutorial-book__toc-card h3 {
    margin-top: 1rem;
    margin-bottom: 0.6rem;
    font-size: 1.8rem;
}

.tutorial-book__toc-intro {
    color: var(--text-light);
    font-size: 0.96rem;
    margin-bottom: 1.4rem;
}

.tutorial-book__nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tutorial-book__nav-group {
    padding: 0.9rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.tutorial-book__nav-chapter,
.tutorial-book__nav-item,
.tutorial-open-btn,
.tutorial-resource-link {
    appearance: none;
    border: none;
    background: transparent;
    font: inherit;
}

.tutorial-book__nav-chapter,
.tutorial-book__nav-item {
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.tutorial-book__nav-chapter {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.55rem 0.7rem;
    border-radius: 14px;
    transition: var(--transition);
}

.tutorial-book__nav-index {
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-light);
}

.tutorial-book__nav-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-color);
}

.tutorial-book__nav-items {
    margin-top: 0.75rem;
    padding-left: 0.75rem;
    border-left: 1px dashed rgba(148, 163, 184, 0.45);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tutorial-book__nav-item {
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    color: var(--text-light);
    transition: var(--transition);
}

.tutorial-book__nav-chapter:hover,
.tutorial-book__nav-item:hover,
.tutorial-book__nav-chapter.is-active,
.tutorial-book__nav-item.is-active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.03));
    color: var(--primary-color);
}

.tutorial-book__nav-chapter.is-active .tutorial-book__nav-title,
.tutorial-book__nav-item.is-active {
    color: var(--primary-color);
}

.tutorial-book__reader {
    position: relative;
    overflow: hidden;
    padding: 2rem;
    background: linear-gradient(180deg, #fffdf8 0%, #ffffff 100%);
}

.tutorial-book__reader::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 30px;
    width: 1px;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0));
    pointer-events: none;
}

.tutorial-book__cover {
    position: relative;
    margin-bottom: 2rem;
    padding: 2rem;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(255, 255, 255, 0.9));
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.tutorial-book__cover h3 {
    font-size: 2rem;
    margin: 1rem 0 0.8rem;
}

.tutorial-book__cover p {
    color: var(--text-light);
    max-width: 760px;
}

.tutorial-book__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.2rem;
}

.tutorial-book__stats span,
.tutorial-section__tags span,
.tutorial-section__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-light);
    font-size: 0.85rem;
}

.tutorial-chapter {
    position: relative;
    margin-top: 2rem;
    scroll-margin-top: 110px;
}

.tutorial-chapter__header {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1.25rem;
}

.tutorial-chapter__index {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 72px;
    padding: 0.75rem;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.14), rgba(37, 99, 235, 0.05));
    color: var(--primary-color);
    font-weight: 700;
}

.tutorial-chapter__header h3 {
    margin-bottom: 0.45rem;
    font-size: 1.7rem;
}

.tutorial-chapter__header p {
    color: var(--text-light);
}

.tutorial-section {
    margin-top: 1rem;
    padding: 1.25rem;
    border-radius: 22px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
    scroll-margin-top: 110px;
    transition: var(--transition);
}

.tutorial-section:hover,
.tutorial-section.is-open {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.tutorial-section__summary {
    display: grid;
    grid-template-columns: 68px 1fr;
    gap: 1rem;
}

.tutorial-section__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.06));
    color: var(--primary-color);
    font-size: 1.05rem;
    font-weight: 700;
}

.tutorial-section__meta {
    min-width: 0;
}

.tutorial-section__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.55rem;
}

.tutorial-section__heading h4 {
    font-size: 1.2rem;
    margin: 0;
}

.tutorial-section__meta > p {
    color: var(--text-light);
}

.tutorial-section__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    margin-top: 1rem;
}

.tutorial-section__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.tutorial-open-btn,
.tutorial-resource-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.7rem 1.1rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

.tutorial-open-btn:hover,
.tutorial-resource-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.22);
}

.tutorial-section__content {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px dashed rgba(148, 163, 184, 0.45);
}

.tutorial-section__content[hidden] {
    display: none !important;
}

.tutorial-content-stack {
    display: grid;
    gap: 1rem;
}

.tutorial-media {
    padding: 1rem;
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(248, 250, 252, 0.85);
}

.tutorial-media__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.9rem;
}

.tutorial-media__header h5 {
    margin: 0;
    font-size: 1rem;
}

.tutorial-media__frame {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
}

.tutorial-media__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.tutorial-rendered {
    padding: 1.2rem;
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(255, 255, 255, 0.92);
}

.tutorial-gallery {
    display: grid;
    gap: 1rem;
}

.tutorial-gallery__page {
    padding: 1rem;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.9));
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.tutorial-gallery__page img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
}

.tutorial-gallery__page figcaption {
    text-align: center;
    color: var(--text-light);
    font-size: 0.88rem;
    margin-top: 0.75rem;
}

.tutorial-loading,
.tutorial-error {
    padding: 1rem 1.1rem;
    border-radius: 16px;
}

.tutorial-loading {
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary-color);
}

.tutorial-error {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

body.dark-theme .tutorial-book__toc-card,
body.dark-theme .tutorial-book__reader,
body.dark-theme .tutorial-book__nav-group,
body.dark-theme .tutorial-section,
body.dark-theme .tutorial-media,
body.dark-theme .tutorial-rendered,
body.dark-theme .tutorial-gallery__page {
    border-color: rgba(71, 85, 105, 0.9);
}

body.dark-theme .tutorial-book__toc-card {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.98));
}

body.dark-theme .tutorial-book__nav-group,
body.dark-theme .tutorial-section,
body.dark-theme .tutorial-rendered,
body.dark-theme .tutorial-gallery__page,
body.dark-theme .tutorial-media {
    background: rgba(15, 23, 42, 0.88);
}

body.dark-theme .tutorial-book__reader {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.98));
}

body.dark-theme .tutorial-book__cover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(15, 23, 42, 0.85));
    border-color: rgba(96, 165, 250, 0.18);
}

body.dark-theme .tutorial-book__stats span,
body.dark-theme .tutorial-section__tags span,
body.dark-theme .tutorial-section__badge {
    background: rgba(148, 163, 184, 0.16);
    color: #cbd5e1;
}

body.dark-theme .tutorial-book__nav-item,
body.dark-theme .tutorial-book__nav-index,
body.dark-theme .tutorial-section__meta > p,
body.dark-theme .tutorial-chapter__header p,
body.dark-theme .tutorial-gallery__page figcaption {
    color: #94a3b8;
}

body.dark-theme .tutorial-book__nav-chapter:hover,
body.dark-theme .tutorial-book__nav-item:hover,
body.dark-theme .tutorial-book__nav-chapter.is-active,
body.dark-theme .tutorial-book__nav-item.is-active {
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.2), rgba(96, 165, 250, 0.06));
}

@media (max-width: 1100px) {
    .tutorial-book {
        grid-template-columns: 1fr;
    }

    .tutorial-book__toc {
        position: static;
    }
}

@media (max-width: 768px) {
    .tutorial-book__toc-card,
    .tutorial-book__reader {
        border-radius: 22px;
    }

    .tutorial-book__reader {
        padding: 1.2rem;
    }

    .tutorial-book__reader::before {
        display: none;
    }

    .tutorial-book__cover {
        padding: 1.4rem;
    }

    .tutorial-book__cover h3 {
        font-size: 1.6rem;
    }

    .tutorial-chapter__header,
    .tutorial-section__summary {
        grid-template-columns: 1fr;
    }

    .tutorial-chapter__index,
    .tutorial-section__number {
        width: fit-content;
        min-height: auto;
    }

    .tutorial-section {
        padding: 1rem;
    }

    .tutorial-section__footer,
    .tutorial-media__header {
        align-items: flex-start;
    }
}

/* 教程库：电子阅读器风格覆盖 */
#tutorial-library,
#more {
    --reader-shell: #f3f4f8;
    --reader-panel: #ffffff;
    --reader-panel-soft: #f8fafc;
    --reader-border: rgba(15, 23, 42, 0.09);
    --reader-border-strong: rgba(15, 23, 42, 0.14);
    --reader-muted: #6b7280;
}

body.dark-theme #tutorial-library,
body.dark-theme #more {
    --reader-shell: #111827;
    --reader-panel: #0f172a;
    --reader-panel-soft: #111b31;
    --reader-border: rgba(148, 163, 184, 0.16);
    --reader-border-strong: rgba(148, 163, 184, 0.22);
    --reader-muted: #94a3b8;
}

.tutorial-book {
    gap: 1.5rem;
}

.tutorial-book__toc-card,
.tutorial-book__reader {
    border-radius: 24px;
    border-color: var(--reader-border);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.tutorial-book__toc-card {
    padding: 1.35rem;
    background: var(--reader-shell);
}

.tutorial-book__eyebrow {
    padding: 0;
    background: transparent;
    border-radius: 0;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--reader-muted);
}

.tutorial-book__toc-card h3 {
    margin-top: 0.45rem;
    margin-bottom: 0.35rem;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.tutorial-book__toc-intro {
    color: var(--reader-muted);
    font-size: 0.92rem;
    margin-bottom: 1.1rem;
}

.tutorial-book__nav {
    gap: 0.9rem;
}

.tutorial-book__nav-group {
    padding: 0.9rem 0 0;
    border-radius: 0;
    background: transparent;
    border: none;
    border-top: 1px solid var(--reader-border);
}

.tutorial-book__nav-group:first-child {
    padding-top: 0;
    border-top: none;
}

.tutorial-book__nav-chapter {
    padding: 0.35rem 0.2rem 0.4rem;
    border-radius: 10px;
}

.tutorial-book__nav-index {
    font-size: 0.7rem;
    color: var(--reader-muted);
}

.tutorial-book__nav-title {
    font-size: 0.98rem;
}

.tutorial-book__nav-items {
    margin-top: 0;
    padding-left: 0;
    border-left: 1px solid transparent;
    gap: 0.2rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.24s ease, margin-top 0.24s ease, padding-left 0.24s ease, border-color 0.24s ease;
}

.tutorial-book__nav-item {
    padding: 0.45rem 0.7rem;
    font-size: 0.94rem;
    color: var(--reader-muted);
}

.tutorial-book__nav-group.is-expanded .tutorial-book__nav-items {
    margin-top: 0.45rem;
    padding-left: 0.8rem;
    border-left-color: var(--reader-border);
    max-height: 520px;
}

.tutorial-book__nav-chapter:hover,
.tutorial-book__nav-item:hover,
.tutorial-book__nav-chapter.is-active,
.tutorial-book__nav-item.is-active {
    background: rgba(37, 99, 235, 0.08);
    box-shadow: inset 2px 0 0 var(--primary-color);
}

.tutorial-book__reader {
    padding: 0 2.25rem 2.4rem;
    background: var(--reader-panel);
}

.tutorial-book__reader::before {
    display: none;
}

.tutorial-reader-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 -2.25rem;
    padding: 0.85rem 2.25rem;
    border-bottom: 1px solid var(--reader-border);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.tutorial-reader-toolbar__window {
    display: flex;
    gap: 0.45rem;
    flex: 0 0 auto;
}

.tutorial-reader-toolbar__window span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d1d5db;
}

.tutorial-reader-toolbar__window span:nth-child(1) {
    background: #f87171;
}

.tutorial-reader-toolbar__window span:nth-child(2) {
    background: #fbbf24;
}

.tutorial-reader-toolbar__window span:nth-child(3) {
    background: #4ade80;
}

.tutorial-reader-toolbar__meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1;
}

.tutorial-reader-toolbar__label {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--reader-muted);
}

.tutorial-reader-toolbar__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: -0.01em;
}

.tutorial-reader-toolbar__actions {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.tutorial-reader-toolbar__actions span {
    display: inline-flex;
    align-items: center;
    padding: 0.32rem 0.68rem;
    border-radius: 999px;
    border: 1px solid var(--reader-border);
    color: var(--reader-muted);
    font-size: 0.82rem;
    background: var(--reader-panel);
}

.tutorial-book__cover,
.tutorial-chapter {
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
}

.tutorial-book__cover {
    margin-top: 1.1rem;
    margin-bottom: 1.6rem;
    padding: 1.35rem 0 1.15rem;
    border: none;
    border-bottom: 1px solid var(--reader-border);
    border-radius: 0;
    background: transparent;
}

.tutorial-book__cover-label {
    padding: 0;
    border-radius: 0;
    background: transparent;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--reader-muted);
}

.tutorial-book__cover h3 {
    margin: 0.5rem 0 0.65rem;
    font-size: 2rem;
    letter-spacing: -0.03em;
}

.tutorial-book__cover p {
    max-width: 70ch;
    color: var(--reader-muted);
    line-height: 1.85;
}

.tutorial-book__stats {
    gap: 0.6rem;
    margin-top: 1rem;
}

.tutorial-book__stats span {
    background: transparent;
    color: var(--reader-muted);
    border: 1px solid var(--reader-border);
}

.tutorial-chapter {
    margin-top: 2.2rem;
}

.tutorial-chapter__header {
    grid-template-columns: 86px 1fr;
    gap: 1rem;
    padding-bottom: 0.85rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid var(--reader-border);
}

.tutorial-chapter__index {
    min-height: auto;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--reader-border);
    background: var(--reader-shell);
    color: var(--reader-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.tutorial-chapter__header h3 {
    margin-bottom: 0.35rem;
    font-size: 1.55rem;
    letter-spacing: -0.02em;
}

.tutorial-chapter__header p {
    color: var(--reader-muted);
    line-height: 1.8;
}

.tutorial-section {
    margin-top: 0;
    padding: 1.35rem 0;
    border: none;
    border-bottom: 1px solid var(--reader-border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.tutorial-section:hover,
.tutorial-section.is-open {
    transform: none;
    box-shadow: none;
}

.tutorial-section.is-open {
    border-bottom-color: var(--reader-border-strong);
}

.tutorial-section__summary {
    grid-template-columns: 62px 1fr;
    gap: 1rem;
}

.tutorial-section__number {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--reader-shell);
    border: 1px solid var(--reader-border);
    color: var(--reader-muted);
    font-size: 0.92rem;
}

.tutorial-section__heading {
    gap: 0.55rem;
    margin-bottom: 0.45rem;
}

.tutorial-section__heading h4 {
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.tutorial-section__badge,
.tutorial-section__tags span {
    background: transparent;
    border: 1px solid var(--reader-border);
    color: var(--reader-muted);
}

.tutorial-section__meta > p {
    color: var(--reader-muted);
    line-height: 1.8;
}

.tutorial-section__footer {
    gap: 0.8rem;
}

.tutorial-section__content {
    margin-top: 1rem;
    margin-left: 62px;
    padding-top: 0.4rem;
    border-top: none;
}

.tutorial-content-stack {
    gap: 1.15rem;
}

.tutorial-open-btn {
    border: 1px solid #111827;
    background: #111827;
    color: #fff;
    box-shadow: none;
}

.tutorial-open-btn:hover {
    background: #1f2937;
    box-shadow: none;
}

.tutorial-resource-link {
    border: 1px solid var(--reader-border);
    background: transparent;
    color: var(--text-color);
    box-shadow: none;
}

.tutorial-resource-link:hover {
    background: var(--reader-shell);
    box-shadow: none;
}

.tutorial-media,
.tutorial-rendered {
    padding: 1rem 1.1rem;
    border-radius: 18px;
    border-color: var(--reader-border);
    background: var(--reader-panel);
}

.tutorial-media__header {
    margin-bottom: 0.8rem;
}

.tutorial-media__header h5 {
    font-size: 0.98rem;
    letter-spacing: -0.01em;
}

.tutorial-media__frame {
    border-radius: 14px;
}

.tutorial-rendered .markdown-body {
    max-width: 72ch;
    margin: 0 auto;
    line-height: 1.9;
    font-size: 1rem;
}

.tutorial-rendered .markdown-body h1,
.tutorial-rendered .markdown-body h2,
.tutorial-rendered .markdown-body h3,
.tutorial-rendered .markdown-body h4 {
    letter-spacing: -0.02em;
}

.tutorial-rendered .markdown-body p,
.tutorial-rendered .markdown-body li {
    color: var(--text-color);
}

.tutorial-gallery {
    gap: 1.15rem;
}

.tutorial-gallery__page {
    padding: 0.85rem;
    border-radius: 18px;
    background: var(--reader-panel-soft);
    border-color: var(--reader-border);
    box-shadow: none;
}

.tutorial-gallery__page img {
    border-radius: 12px;
    border: 1px solid var(--reader-border);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.tutorial-gallery__page figcaption {
    color: var(--reader-muted);
    margin-top: 0.65rem;
}

.tutorial-loading,
.tutorial-error {
    border: 1px solid var(--reader-border);
}

.tutorial-loading {
    background: var(--reader-shell);
}

.tutorial-error {
    background: rgba(239, 68, 68, 0.06);
}

body.dark-theme .tutorial-book__toc-card,
body.dark-theme .tutorial-book__reader,
body.dark-theme .tutorial-book__stats span,
body.dark-theme .tutorial-section__badge,
body.dark-theme .tutorial-section__tags span,
body.dark-theme .tutorial-gallery__page,
body.dark-theme .tutorial-media,
body.dark-theme .tutorial-rendered,
body.dark-theme .tutorial-reader-toolbar__actions span,
body.dark-theme .tutorial-chapter__index,
body.dark-theme .tutorial-section__number,
body.dark-theme .tutorial-resource-link,
body.dark-theme .tutorial-loading {
    border-color: var(--reader-border);
}

body.dark-theme .tutorial-book__toc-card,
body.dark-theme .tutorial-book__nav-group,
body.dark-theme .tutorial-section__number,
body.dark-theme .tutorial-chapter__index,
body.dark-theme .tutorial-loading {
    background: var(--reader-panel-soft);
}

body.dark-theme .tutorial-book__reader,
body.dark-theme .tutorial-media,
body.dark-theme .tutorial-rendered,
body.dark-theme .tutorial-reader-toolbar__actions span {
    background: var(--reader-panel);
}

body.dark-theme .tutorial-book__nav-chapter:hover,
body.dark-theme .tutorial-book__nav-item:hover,
body.dark-theme .tutorial-book__nav-chapter.is-active,
body.dark-theme .tutorial-book__nav-item.is-active {
    background: rgba(96, 165, 250, 0.12);
}

body.dark-theme .tutorial-reader-toolbar {
    background: rgba(15, 23, 42, 0.88);
}

body.dark-theme .tutorial-open-btn {
    border-color: #cbd5e1;
    background: #e2e8f0;
    color: #0f172a;
}

body.dark-theme .tutorial-open-btn:hover {
    background: #ffffff;
}

body.dark-theme .tutorial-resource-link:hover {
    background: var(--reader-panel-soft);
}

@media (max-width: 768px) {
    .tutorial-book__reader {
        padding: 0 1.1rem 1.6rem;
    }

    .tutorial-reader-toolbar {
        margin: 0 -1.1rem;
        padding: 0.75rem 1.1rem;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .tutorial-reader-toolbar__actions {
        width: 100%;
    }

    .tutorial-book__cover {
        margin-top: 0.8rem;
    }

    .tutorial-chapter__header,
    .tutorial-section__summary {
        grid-template-columns: 1fr;
    }

    .tutorial-section__content {
        margin-left: 0;
    }
}

/* 教程库：微信读书风微调 */
#tutorial-library,
#more {
    --primary-color: #1aad19;
    --accent-color: #34c759;
    --reader-shell: #f5f6f7;
    --reader-panel: #ffffff;
    --reader-panel-soft: #f7faf7;
    --reader-border: rgba(31, 35, 41, 0.08);
    --reader-border-strong: rgba(26, 173, 25, 0.22);
    --reader-muted: #7a8088;
    --reader-accent-soft: rgba(26, 173, 25, 0.1);
    --reader-accent-strong: rgba(26, 173, 25, 0.16);
}

body.dark-theme #tutorial-library,
body.dark-theme #more {
    --primary-color: #4dd267;
    --accent-color: #6adf82;
    --reader-shell: #11181b;
    --reader-panel: #151d21;
    --reader-panel-soft: #1a2327;
    --reader-border: rgba(180, 192, 197, 0.14);
    --reader-border-strong: rgba(77, 210, 103, 0.26);
    --reader-muted: #9ca8ae;
    --reader-accent-soft: rgba(77, 210, 103, 0.12);
    --reader-accent-strong: rgba(77, 210, 103, 0.18);
}

.tutorial-book {
    gap: 1.25rem;
}

.tutorial-book__toc-card,
.tutorial-book__reader {
    border-radius: 22px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.tutorial-book__toc-card {
    padding: 1.25rem;
}

.tutorial-book__eyebrow,
.tutorial-book__cover-label,
.tutorial-reader-toolbar__label {
    color: var(--primary-color);
}

.tutorial-book__nav-group {
    padding-top: 0.8rem;
}

.tutorial-book__nav-chapter {
    position: relative;
    padding: 0.48rem 2rem 0.5rem 0.7rem;
}

.tutorial-book__nav-chapter::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 3px;
    border-radius: 999px;
    background: transparent;
    transition: var(--transition);
}

.tutorial-book__nav-item {
    position: relative;
    padding-left: 0.85rem;
}

.tutorial-book__nav-item::before {
    content: '';
    position: absolute;
    left: 0.15rem;
    top: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(122, 128, 136, 0.45);
    transform: translateY(-50%);
}

.tutorial-book__nav-chapter::after {
    content: '⌄';
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    color: var(--reader-muted);
    font-size: 0.9rem;
    transition: transform 0.24s ease, color 0.24s ease;
}

.tutorial-book__nav-group.is-expanded .tutorial-book__nav-chapter::after {
    transform: translateY(-50%) rotate(0deg);
    color: var(--primary-color);
}

.tutorial-book__nav-chapter:hover,
.tutorial-book__nav-item:hover,
.tutorial-book__nav-chapter.is-active,
.tutorial-book__nav-item.is-active {
    background: var(--reader-accent-soft);
    box-shadow: none;
}

.tutorial-book__nav-chapter.is-active::before {
    background: var(--primary-color);
}

.tutorial-book__nav-item.is-active::before {
    background: var(--primary-color);
}

.tutorial-book__nav-chapter.is-active .tutorial-book__nav-index,
.tutorial-book__nav-chapter.is-active .tutorial-book__nav-title,
.tutorial-book__nav-item.is-active {
    color: var(--primary-color);
}

.tutorial-book__reader {
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.05);
}

.tutorial-reader-toolbar {
    gap: 0.9rem;
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
    border-bottom-color: var(--reader-border);
    background: rgba(255, 255, 255, 0.94);
}

.tutorial-reader-toolbar__window span {
    width: 8px;
    height: 8px;
    background: #d9dee3;
}

.tutorial-reader-toolbar__window span:nth-child(1),
.tutorial-reader-toolbar__window span:nth-child(2) {
    background: #d9dee3;
}

.tutorial-reader-toolbar__window span:nth-child(3) {
    background: var(--primary-color);
}

.tutorial-reader-toolbar__title {
    font-size: 1rem;
    font-weight: 700;
}

.tutorial-reader-toolbar__actions span {
    padding: 0.34rem 0.72rem;
    border-radius: 999px;
    border-color: transparent;
    background: var(--reader-shell);
}

.tutorial-book__cover {
    margin-top: 0.9rem;
    margin-bottom: 1.8rem;
    padding: 1.4rem 1.5rem;
    border: 1px solid var(--reader-border);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(26, 173, 25, 0.045), rgba(255, 255, 255, 0.96));
}

.tutorial-book__cover::before {
    content: '';
    position: absolute;
    left: 1.15rem;
    top: 1.35rem;
    bottom: 1.35rem;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--primary-color), rgba(26, 173, 25, 0.12));
}

.tutorial-book__cover > * {
    position: relative;
    z-index: 1;
}

.tutorial-book__cover-label {
    margin-left: 0.55rem;
}

.tutorial-book__cover h3,
.tutorial-book__cover p,
.tutorial-book__stats {
    margin-left: 0.55rem;
}

.tutorial-book__cover h3 {
    font-size: 2.1rem;
}

.tutorial-book__stats span {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.82);
}

.tutorial-chapter__header {
    padding-bottom: 1rem;
    margin-bottom: 0.15rem;
}

.tutorial-chapter__index {
    border-color: transparent;
    background: var(--reader-panel-soft);
    color: var(--primary-color);
}

.tutorial-section {
    padding: 1.4rem 0;
}

.tutorial-section__number {
    background: var(--reader-panel-soft);
    border-color: transparent;
    color: var(--primary-color);
}

.tutorial-section__badge,
.tutorial-section__tags span {
    border-color: transparent;
    background: var(--reader-panel-soft);
}

.tutorial-section.is-open .tutorial-section__number,
.tutorial-section.is-open .tutorial-section__badge {
    background: var(--reader-accent-soft);
}

.tutorial-open-btn {
    border-color: transparent;
    background: linear-gradient(180deg, #21c161, #18ad51);
}

.tutorial-open-btn:hover {
    background: linear-gradient(180deg, #27c96a, #1eb85a);
}

.tutorial-resource-link {
    border-color: transparent;
    background: var(--reader-panel-soft);
    color: var(--primary-color);
}

.tutorial-resource-link:hover {
    background: var(--reader-accent-soft);
}

.tutorial-media,
.tutorial-rendered {
    border-radius: 20px;
    background: #fff;
}

.tutorial-rendered .markdown-body {
    font-size: 1.03rem;
    line-height: 1.95;
}

.tutorial-rendered .markdown-body p {
    text-align: justify;
}

.tutorial-rendered .markdown-body blockquote {
    border-left: 4px solid var(--primary-color) !important;
    background: var(--reader-panel-soft);
    border-radius: 0 12px 12px 0;
    padding: 0.8rem 1rem;
}

.tutorial-gallery__page {
    background: #fbfcfb;
}

.tutorial-gallery__page img {
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.tutorial-loading {
    color: var(--primary-color);
}

body.dark-theme .tutorial-reader-toolbar {
    background: rgba(21, 29, 33, 0.94);
}

body.dark-theme .tutorial-reader-toolbar__window span:nth-child(1),
body.dark-theme .tutorial-reader-toolbar__window span:nth-child(2) {
    background: rgba(156, 168, 174, 0.38);
}

body.dark-theme .tutorial-book__cover {
    background: linear-gradient(180deg, rgba(77, 210, 103, 0.06), rgba(21, 29, 33, 0.96));
}

body.dark-theme .tutorial-book__stats span,
body.dark-theme .tutorial-section__badge,
body.dark-theme .tutorial-section__tags span,
body.dark-theme .tutorial-resource-link,
body.dark-theme .tutorial-chapter__index,
body.dark-theme .tutorial-section__number,
body.dark-theme .tutorial-reader-toolbar__actions span,
body.dark-theme .tutorial-loading {
    background: var(--reader-panel-soft);
}

body.dark-theme .tutorial-resource-link:hover,
body.dark-theme .tutorial-book__nav-chapter:hover,
body.dark-theme .tutorial-book__nav-item:hover,
body.dark-theme .tutorial-book__nav-chapter.is-active,
body.dark-theme .tutorial-book__nav-item.is-active,
body.dark-theme .tutorial-section.is-open .tutorial-section__number,
body.dark-theme .tutorial-section.is-open .tutorial-section__badge {
    background: var(--reader-accent-soft);
}

body.dark-theme .tutorial-open-btn {
    background: linear-gradient(180deg, #3dd06a, #28b955);
    color: #08120a;
}

body.dark-theme .tutorial-open-btn:hover {
    background: linear-gradient(180deg, #53d87b, #34c25f);
}

@media (max-width: 768px) {
    .tutorial-book__toc-card,
    .tutorial-book__reader {
        border-radius: 18px;
    }

    .tutorial-book__cover {
        padding: 1.1rem 1rem 1.1rem 1.2rem;
    }

    .tutorial-book__cover::before {
        left: 0.75rem;
    }

    .tutorial-book__cover-label,
    .tutorial-book__cover h3,
    .tutorial-book__cover p,
    .tutorial-book__stats {
        margin-left: 0.25rem;
    }
}

/* 教程库：目录抽屉（默认折叠） */
.tutorial-book {
    display: block;
    position: relative;
}

.tutorial-book__toc {
    position: fixed;
    top: 0;
    left: 0;
    width: min(340px, calc(100vw - 24px));
    height: 100vh;
    padding: 16px 0 16px 16px;
    z-index: 60;
    opacity: 0;
    visibility: hidden;
    transform: translateX(calc(-100% - 12px));
    pointer-events: none;
    transition: opacity 0.26s ease, transform 0.26s ease, visibility 0.26s ease;
}

.tutorial-book.is-toc-open .tutorial-book__toc {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

.tutorial-book__toc-card {
    height: 100%;
    overflow: auto;
    border-radius: 0 22px 22px 0;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.tutorial-book__toc-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.tutorial-book__toc-close {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 999px;
    background: var(--reader-panel-soft);
    color: var(--reader-muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
}

.tutorial-book__toc-close:hover {
    background: var(--reader-accent-soft);
    color: var(--primary-color);
}

.tutorial-book__scrim {
    position: fixed;
    inset: 0;
    z-index: 50;
    border: none;
    background: rgba(15, 23, 42, 0.22);
    opacity: 0;
    transition: opacity 0.24s ease;
}

.tutorial-book__scrim.is-visible {
    opacity: 1;
}

.tutorial-book__reader {
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
}

.tutorial-reader-toolbar__actions {
    align-items: center;
}

.tutorial-reader-toolbar__actions span,
.tutorial-reader-toolbar__toggle {
    display: inline-flex;
    align-items: center;
    padding: 0.34rem 0.72rem;
    border-radius: 999px;
    background: var(--reader-shell);
    color: var(--reader-muted);
    font-size: 0.82rem;
}

.tutorial-reader-toolbar__toggle {
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.tutorial-reader-toolbar__toggle:hover,
.tutorial-reader-toolbar__toggle.is-active {
    background: var(--reader-accent-soft);
    color: var(--primary-color);
}

body.dark-theme .tutorial-book__scrim {
    background: rgba(2, 6, 23, 0.54);
}

body.dark-theme .tutorial-book__toc-close {
    background: var(--reader-panel-soft);
    color: var(--reader-muted);
}

body.dark-theme .tutorial-book__toc-close:hover {
    background: var(--reader-accent-soft);
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .tutorial-book__toc {
        width: min(320px, calc(100vw - 18px));
        padding: 10px 0 10px 10px;
    }

    .tutorial-book__toc-card {
        border-radius: 0 18px 18px 0;
    }
}

/* 收藏夹：研究笔记 / 实验记录本风格 */
#more {
    --primary-color: #325d8c;
    --accent-color: #4f79a7;
    --reader-shell: #f5f1e8;
    --reader-panel: #fbf8f1;
    --reader-panel-soft: #edf3fa;
    --reader-border: rgba(50, 93, 140, 0.13);
    --reader-border-strong: rgba(197, 92, 86, 0.26);
    --reader-muted: #6c7683;
    --reader-accent-soft: rgba(50, 93, 140, 0.1);
    --reader-accent-strong: rgba(197, 92, 86, 0.12);
    --reader-rule-line: rgba(79, 121, 167, 0.11);
    --reader-margin-line: rgba(197, 92, 86, 0.18);
}

body.dark-theme #more {
    --primary-color: #8fb5de;
    --accent-color: #b8d3f0;
    --reader-shell: #171b22;
    --reader-panel: #1c2129;
    --reader-panel-soft: #232a35;
    --reader-border: rgba(143, 181, 222, 0.16);
    --reader-border-strong: rgba(232, 132, 125, 0.28);
    --reader-muted: #a9b4c2;
    --reader-accent-soft: rgba(143, 181, 222, 0.11);
    --reader-accent-strong: rgba(232, 132, 125, 0.16);
    --reader-rule-line: rgba(143, 181, 222, 0.11);
    --reader-margin-line: rgba(232, 132, 125, 0.16);
}

/* 机器人实验室：仿真嵌入 */
.lab-embed {
    margin-top: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #0b1220;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.lab-embed iframe {
    display: block;
    width: 100%;
    height: min(72vh, 760px);
    border: 0;
    background: #0b1220;
}

.lab-embed__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.85rem 1.1rem;
    background: rgba(15, 23, 42, 0.96);
}

.lab-embed__open {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.05rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    color: #fff;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: var(--transition);
}

.lab-embed__open:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.35);
}

.lab-embed__note {
    color: #94a3b8;
    font-size: 0.82rem;
    font-family: "SFMono-Regular", Consolas, Menlo, monospace;
}

body.dark-theme .lab-embed {
    border-color: rgba(148, 163, 184, 0.25);
}

@media (max-width: 768px) {
    .lab-embed iframe {
        height: 76vh;
        height: 76svh;
        max-height: 680px;
    }

    .lab-embed__note {
        display: none;
    }
}

#more .tutorial-book__eyebrow,
#more .tutorial-book__cover-label,
#more .tutorial-reader-toolbar__label,
#more .tutorial-chapter__index,
#more .more-notebook-strip span {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

#more .tutorial-book__cover h3,
#more .tutorial-chapter__header h3,
#more .tutorial-section__heading h4 {
    font-family: "Kaiti SC", "STKaiti", "KaiTi", "Segoe Print", "Bradley Hand", cursive;
    font-weight: 600;
    letter-spacing: 0.02em;
}

#more .tutorial-book__cover p,
#more .tutorial-chapter__header p,
#more .tutorial-section__meta > p {
    position: relative;
}

#more .tutorial-book__toc-card {
    background:
        linear-gradient(90deg, transparent 0, transparent 42px, var(--reader-margin-line) 42px, var(--reader-margin-line) 44px, transparent 44px),
        repeating-linear-gradient(180deg, transparent 0, transparent 27px, var(--reader-rule-line) 27px, var(--reader-rule-line) 28px),
        linear-gradient(180deg, rgba(252, 249, 243, 0.98), rgba(246, 241, 233, 0.98));
    position: relative;
}

#more .tutorial-book__reader {
    background:
        linear-gradient(90deg, transparent 0, transparent 74px, var(--reader-margin-line) 74px, var(--reader-margin-line) 76px, transparent 76px),
        repeating-linear-gradient(180deg, transparent 0, transparent 33px, var(--reader-rule-line) 33px, var(--reader-rule-line) 34px),
        linear-gradient(180deg, rgba(253, 250, 244, 0.99), rgba(247, 243, 235, 0.99));
    position: relative;
}

#more .tutorial-reader-toolbar {
    background: rgba(251, 248, 241, 0.94);
    border-bottom-style: dashed;
    border-bottom-color: var(--reader-border-strong);
}

#more .tutorial-reader-toolbar__label,
#more .tutorial-book__cover-label {
    letter-spacing: 0.16em;
}

#more .tutorial-book__eyebrow {
    color: #c55c56;
    transform: rotate(-2.5deg);
    display: inline-block;
    margin-left: 0.15rem;
}

#more .tutorial-reader-toolbar__title {
    letter-spacing: 0.03em;
    font-family: "Kaiti SC", "STKaiti", "KaiTi", "Segoe Print", cursive;
    font-size: 1.05rem;
}

#more .tutorial-reader-toolbar__actions span,
#more .tutorial-reader-toolbar__toggle {
    background: rgba(255, 255, 255, 0.58);
    border: 1px dashed var(--reader-border-strong);
}

#more .tutorial-reader-toolbar__window span:nth-child(1) {
    background: #c55c56;
}

#more .tutorial-reader-toolbar__window span:nth-child(2) {
    background: #7f9fc3;
}

#more .tutorial-reader-toolbar__window span:nth-child(3) {
    background: #325d8c;
}

#more .tutorial-book__nav-group {
    border-top-style: dashed;
}

#more .tutorial-book__nav-chapter,
#more .tutorial-book__nav-item {
    border-radius: 10px;
}

#more .tutorial-book__nav-chapter {
    transform: rotate(-0.25deg);
}

#more .tutorial-book__nav-item::before {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    border: 1px solid currentColor;
    background: transparent;
    transform: translateY(-50%);
}

#more .tutorial-book__nav-item.is-active::before {
    background: currentColor;
}

#more .tutorial-book__nav-chapter:hover,
#more .tutorial-book__nav-item:hover,
#more .tutorial-book__nav-chapter.is-active,
#more .tutorial-book__nav-item.is-active {
    background: rgba(50, 93, 140, 0.08);
}

#more .tutorial-book__cover {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(50, 93, 140, 0.12);
    background:
        linear-gradient(90deg, transparent 0, transparent 52px, rgba(197, 92, 86, 0.12) 52px, rgba(197, 92, 86, 0.12) 54px, transparent 54px),
        repeating-linear-gradient(180deg, transparent 0, transparent 29px, rgba(79, 121, 167, 0.09) 29px, rgba(79, 121, 167, 0.09) 30px),
        linear-gradient(180deg, rgba(252, 248, 242, 0.99), rgba(247, 242, 233, 0.99));
    box-shadow: 0 18px 38px rgba(50, 93, 140, 0.08);
}

#more .tutorial-book__cover .tutorial-book__cover-label {
    display: inline-block;
    transform: rotate(-1.4deg);
}

#more .tutorial-book__cover::before {
    left: 1.35rem;
    right: auto;
    top: -1px;
    bottom: auto;
    width: 96px;
    height: 34px;
    border-radius: 0 0 14px 14px;
    background: linear-gradient(180deg, #6f8fb8, #4f79a7);
}

#more .tutorial-book__cover::after {
    content: 'OBS LOG';
    position: absolute;
    right: 1.35rem;
    top: 1.15rem;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    color: rgba(50, 93, 140, 0.52);
}

#more .tutorial-book__cover h3 {
    transform: rotate(-1deg);
    transform-origin: left center;
}

#more .tutorial-book__cover h3 {
    max-width: 15ch;
}

#more .tutorial-book__cover p {
    max-width: 70ch;
}

#more .tutorial-book__cover p::after {
    content: '注：按主题持续补记';
    display: block;
    margin-top: 0.65rem;
    color: rgba(197, 92, 86, 0.9);
    font-family: "Kaiti SC", "STKaiti", "KaiTi", "Segoe Print", cursive;
    font-size: 0.96rem;
    transform: rotate(-2deg);
}

#more .tutorial-book__stats span {
    background: rgba(255, 255, 255, 0.72);
    border-style: dashed;
    border-color: rgba(50, 93, 140, 0.18);
}

#more .more-notebook-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.95rem;
}

#more .more-notebook-strip span {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.72rem;
    border-radius: 999px;
    border: 1px dashed var(--reader-border-strong);
    background: rgba(255, 255, 255, 0.62);
    color: var(--reader-muted);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

#more #more-chapter-robotics {
    --bookmark-chapter-color: #2d6f8e;
    --bookmark-chapter-soft: rgba(45, 111, 142, 0.11);
}

#more #more-chapter-ai {
    --bookmark-chapter-color: #915fbe;
    --bookmark-chapter-soft: rgba(145, 95, 190, 0.11);
}

#more .tutorial-chapter__index,
#more .tutorial-section__number,
#more .tutorial-section__badge,
#more .tutorial-section__tags span {
    color: var(--bookmark-chapter-color, var(--primary-color));
    background: var(--bookmark-chapter-soft, var(--reader-panel-soft));
}

#more .tutorial-chapter__index {
    letter-spacing: 0.12em;
    border-style: dashed;
    transform: rotate(-2deg);
}

#more .tutorial-section {
    border-bottom-style: dashed;
    transition: background 0.24s ease, border-color 0.24s ease;
    position: relative;
}

#more .tutorial-section:hover {
    background: linear-gradient(
        90deg,
        var(--bookmark-chapter-soft, rgba(50, 93, 140, 0.08)),
        transparent 52%
    );
}

#more .tutorial-section__heading {
    align-items: center;
}

#more .tutorial-section__heading h4 {
    transform: rotate(-0.6deg);
    transform-origin: left center;
}

#more .tutorial-section__badge {
    border-radius: 999px;
    border-style: dashed;
}

#more .tutorial-open-btn {
    background: linear-gradient(180deg, #4874a2, #325d8c);
    box-shadow: 0 10px 18px rgba(50, 93, 140, 0.16);
}

#more .tutorial-open-btn:hover {
    background: linear-gradient(180deg, #5b87b5, #3d6997);
}

#more .tutorial-open-btn,
#more .tutorial-resource-link {
    transform: rotate(-1deg);
}

#more .tutorial-section:nth-of-type(odd)::after {
    content: '✓';
    position: absolute;
    right: 0.35rem;
    top: 1.05rem;
    color: rgba(197, 92, 86, 0.62);
    font-family: "Kaiti SC", "STKaiti", "KaiTi", "Segoe Print", cursive;
    font-size: 1rem;
    transform: rotate(8deg);
    pointer-events: none;
}

#more .tutorial-section__meta > p::after {
    content: '';
    position: absolute;
    left: 0;
    right: 28%;
    bottom: -0.15rem;
    border-bottom: 2px solid rgba(197, 92, 86, 0.12);
    transform: rotate(-0.8deg);
    pointer-events: none;
}

body.dark-theme #more .tutorial-book__toc-card {
    background:
        linear-gradient(90deg, transparent 0, transparent 42px, var(--reader-margin-line) 42px, var(--reader-margin-line) 44px, transparent 44px),
        repeating-linear-gradient(180deg, transparent 0, transparent 27px, var(--reader-rule-line) 27px, var(--reader-rule-line) 28px),
        linear-gradient(180deg, rgba(29, 34, 42, 0.98), rgba(23, 27, 34, 0.98));
}

body.dark-theme #more .tutorial-book__reader {
    background:
        linear-gradient(90deg, transparent 0, transparent 74px, var(--reader-margin-line) 74px, var(--reader-margin-line) 76px, transparent 76px),
        repeating-linear-gradient(180deg, transparent 0, transparent 33px, var(--reader-rule-line) 33px, var(--reader-rule-line) 34px),
        linear-gradient(180deg, rgba(29, 34, 42, 0.99), rgba(22, 27, 34, 0.99));
}

body.dark-theme #more .tutorial-reader-toolbar {
    background: rgba(28, 33, 41, 0.94);
}

body.dark-theme #more .tutorial-reader-toolbar__actions span,
body.dark-theme #more .tutorial-reader-toolbar__toggle,
body.dark-theme #more .tutorial-book__stats span,
body.dark-theme #more .more-notebook-strip span {
    background: rgba(35, 42, 53, 0.88);
    border-color: rgba(232, 132, 125, 0.22);
}

body.dark-theme #more .tutorial-book__cover {
    border-color: rgba(143, 181, 222, 0.18);
    background:
        linear-gradient(90deg, transparent 0, transparent 52px, rgba(232, 132, 125, 0.1) 52px, rgba(232, 132, 125, 0.1) 54px, transparent 54px),
        repeating-linear-gradient(180deg, transparent 0, transparent 29px, rgba(143, 181, 222, 0.08) 29px, rgba(143, 181, 222, 0.08) 30px),
        linear-gradient(180deg, rgba(34, 41, 51, 0.98), rgba(25, 31, 39, 0.98));
}

body.dark-theme #more .tutorial-book__cover::before {
    background: linear-gradient(180deg, #a5c5e8, #7ca5d2);
}

body.dark-theme #more .tutorial-book__cover::after {
    color: rgba(184, 211, 240, 0.42);
}

body.dark-theme #more .tutorial-book__eyebrow,
body.dark-theme #more .tutorial-book__cover p::after,
body.dark-theme #more .tutorial-section:nth-of-type(odd)::after {
    color: rgba(232, 132, 125, 0.86);
}

body.dark-theme #more .tutorial-book__nav-chapter:hover,
body.dark-theme #more .tutorial-book__nav-item:hover,
body.dark-theme #more .tutorial-book__nav-chapter.is-active,
body.dark-theme #more .tutorial-book__nav-item.is-active,
body.dark-theme #more .tutorial-section:hover {
    background: rgba(143, 181, 222, 0.12);
}

body.dark-theme #more .tutorial-open-btn {
    background: linear-gradient(180deg, #8ab0d9, #678fbc);
    color: #10161d;
}

body.dark-theme #more .tutorial-open-btn:hover {
    background: linear-gradient(180deg, #a0c2e6, #779dca);
}

body.dark-theme #more .tutorial-section__meta > p::after {
    border-bottom-color: rgba(232, 132, 125, 0.16);
}

@media (max-width: 768px) {
    #more .tutorial-book__reader {
        background:
            linear-gradient(90deg, transparent 0, transparent 28px, var(--reader-margin-line) 28px, var(--reader-margin-line) 30px, transparent 30px),
            repeating-linear-gradient(180deg, transparent 0, transparent 30px, var(--reader-rule-line) 30px, var(--reader-rule-line) 31px),
            linear-gradient(180deg, rgba(253, 250, 244, 0.99), rgba(247, 243, 235, 0.99));
    }

    body.dark-theme #more .tutorial-book__reader {
        background:
            linear-gradient(90deg, transparent 0, transparent 28px, var(--reader-margin-line) 28px, var(--reader-margin-line) 30px, transparent 30px),
            repeating-linear-gradient(180deg, transparent 0, transparent 30px, var(--reader-rule-line) 30px, var(--reader-rule-line) 31px),
            linear-gradient(180deg, rgba(29, 34, 42, 0.99), rgba(22, 27, 34, 0.99));
    }

    #more .tutorial-book__cover::before {
        left: 0.95rem;
        width: 76px;
        height: 28px;
    }

    #more .tutorial-book__cover::after {
        right: 0.95rem;
        top: 0.95rem;
        font-size: 0.66rem;
        letter-spacing: 0.16em;
    }

    #more .tutorial-section:nth-of-type(odd)::after {
        right: 0.1rem;
    }
}

/* 教程库：工程图纸 / 散落纸张手稿风格 */
#tutorial-library {
    --primary-color: #2f6f99;
    --accent-color: #78a99a;
    --blueprint-ink: #3d4148;
    --blueprint-muted: #7c8792;
    --blueprint-line: rgba(70, 114, 145, 0.18);
    --blueprint-line-soft: rgba(70, 114, 145, 0.08);
    --blueprint-green: rgba(155, 205, 177, 0.28);
    --blueprint-blue: rgba(139, 194, 224, 0.25);
    --blueprint-orange: rgba(246, 181, 123, 0.24);
    --reader-shell: #ffffff;
    --reader-panel: #ffffff;
    --reader-panel-soft: #f8fbfd;
    --reader-border: rgba(69, 91, 112, 0.14);
    --reader-border-strong: rgba(47, 111, 153, 0.32);
    --reader-muted: var(--blueprint-muted);
    --reader-accent-soft: rgba(139, 194, 224, 0.14);
    --reader-accent-strong: rgba(47, 111, 153, 0.14);
    position: relative;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 18px 55px rgba(27, 39, 55, 0.06);
}

#tutorial-library:hover {
    transform: none;
    box-shadow: 0 18px 55px rgba(27, 39, 55, 0.06);
}

body.dark-theme #tutorial-library {
    --primary-color: #2f6f99;
    --accent-color: #78a99a;
    --blueprint-ink: #3d4148;
    --blueprint-muted: #7c8792;
    --blueprint-line: rgba(70, 114, 145, 0.18);
    --blueprint-line-soft: rgba(70, 114, 145, 0.08);
    --blueprint-green: rgba(155, 205, 177, 0.28);
    --blueprint-blue: rgba(139, 194, 224, 0.25);
    --blueprint-orange: rgba(246, 181, 123, 0.24);
    --reader-shell: #ffffff;
    --reader-panel: #ffffff;
    --reader-panel-soft: #f8fbfd;
    --reader-border: rgba(69, 91, 112, 0.14);
    --reader-border-strong: rgba(47, 111, 153, 0.32);
    --reader-muted: var(--blueprint-muted);
    --reader-accent-soft: rgba(139, 194, 224, 0.14);
    --reader-accent-strong: rgba(47, 111, 153, 0.14);
}

#tutorial-library::before,
#tutorial-library::after {
    content: '';
    position: absolute;
    z-index: 0;
    pointer-events: none;
    filter: blur(1px);
}

#tutorial-library::before {
    width: 300px;
    height: 190px;
    right: 6%;
    top: 84px;
    border-radius: 56% 44% 62% 38%;
    background:
        radial-gradient(circle at 28% 35%, var(--blueprint-blue), transparent 58%),
        radial-gradient(circle at 70% 68%, var(--blueprint-green), transparent 62%);
    opacity: 0.72;
}

#tutorial-library::after {
    width: 250px;
    height: 170px;
    left: 5%;
    bottom: 8%;
    border-radius: 46% 54% 40% 60%;
    background:
        radial-gradient(circle at 44% 46%, var(--blueprint-orange), transparent 60%),
        radial-gradient(circle at 66% 30%, var(--blueprint-blue), transparent 58%);
    opacity: 0.62;
}

#tutorial-library > h2,
#tutorial-library > .section-intro,
#tutorial-library > .tutorial-book {
    position: relative;
    z-index: 1;
}

#tutorial-library > h2 {
    margin-bottom: 1rem;
    color: var(--blueprint-ink);
    font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", "Kaiti SC", cursive;
    font-size: clamp(2.35rem, 4vw, 4.2rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    transform: rotate(-1.2deg);
}

#tutorial-library > h2::after {
    bottom: -10px;
    width: 150px;
    height: 1px;
    background:
        linear-gradient(90deg, transparent 0 12px, var(--blueprint-line) 12px 22px, transparent 22px 28px),
        linear-gradient(90deg, var(--blueprint-ink), rgba(61, 65, 72, 0.08));
}

#tutorial-library > .section-intro {
    max-width: 760px;
    margin-bottom: 2.7rem;
    color: var(--blueprint-muted);
    line-height: 1.95;
}

#tutorial-library .tutorial-book__reader {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.4rem;
    max-width: 1180px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#tutorial-library .tutorial-reader-toolbar,
#tutorial-library .tutorial-book__cover,
#tutorial-library .tutorial-blueprint-pager {
    grid-column: 1 / -1;
}

#tutorial-library .tutorial-reader-toolbar {
    position: sticky;
    top: 0;
    z-index: 25;
    margin: 0 0 2rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--reader-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 16px 38px rgba(31, 45, 61, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

#tutorial-library .tutorial-reader-toolbar__window span {
    width: 9px;
    height: 9px;
    border: 1px solid rgba(61, 65, 72, 0.18);
    background: #fff;
}

#tutorial-library .tutorial-reader-toolbar__window span:nth-child(1) {
    background: rgba(139, 194, 224, 0.55);
}

#tutorial-library .tutorial-reader-toolbar__window span:nth-child(2) {
    background: rgba(155, 205, 177, 0.55);
}

#tutorial-library .tutorial-reader-toolbar__window span:nth-child(3) {
    background: rgba(246, 181, 123, 0.55);
}

#tutorial-library .tutorial-reader-toolbar__label,
#tutorial-library .tutorial-book__eyebrow,
#tutorial-library .tutorial-book__cover-label {
    color: var(--blueprint-muted);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    letter-spacing: 0.18em;
}

#tutorial-library .tutorial-reader-toolbar__title {
    color: var(--blueprint-ink);
    font-weight: 700;
}

#tutorial-library .tutorial-reader-toolbar__actions span,
#tutorial-library .tutorial-reader-toolbar__toggle {
    border: 1px solid var(--reader-border);
    background: rgba(255, 255, 255, 0.76);
    color: var(--blueprint-muted);
}

#tutorial-library .tutorial-reader-toolbar__toggle:hover,
#tutorial-library .tutorial-reader-toolbar__toggle.is-active {
    background: rgba(139, 194, 224, 0.16);
    color: var(--primary-color);
}

#tutorial-library .tutorial-book__cover {
    position: relative;
    max-width: none;
    min-height: 260px;
    margin: 0 0 1rem;
    padding: clamp(2.2rem, 5vw, 4.6rem);
    border: 1px solid var(--reader-border);
    border-radius: 2px;
    background:
        linear-gradient(90deg, transparent 0 calc(100% - 30px), rgba(47, 111, 153, 0.08) calc(100% - 30px) calc(100% - 29px), transparent calc(100% - 29px)),
        linear-gradient(180deg, transparent 0 calc(100% - 30px), rgba(47, 111, 153, 0.08) calc(100% - 30px) calc(100% - 29px), transparent calc(100% - 29px)),
        repeating-linear-gradient(0deg, transparent 0 23px, var(--blueprint-line-soft) 24px),
        repeating-linear-gradient(90deg, transparent 0 23px, var(--blueprint-line-soft) 24px),
        #ffffff;
    box-shadow: 0 20px 55px rgba(38, 52, 70, 0.07);
    transform: rotate(-0.45deg);
}

#tutorial-library .tutorial-book__cover::before {
    content: '';
    position: absolute;
    left: 2.2rem;
    top: 2rem;
    width: 118px;
    height: 48px;
    border-top: 1px solid var(--reader-border-strong);
    border-left: 1px solid var(--reader-border-strong);
    border-radius: 0;
    background: transparent;
}

#tutorial-library .tutorial-book__cover::after {
    content: '';
    position: absolute;
    right: 10%;
    top: 24%;
    width: 190px;
    height: 150px;
    border-radius: 58% 42% 54% 46%;
    background:
        radial-gradient(circle at 42% 44%, var(--blueprint-blue), transparent 58%),
        radial-gradient(circle at 66% 62%, var(--blueprint-green), transparent 62%);
    opacity: 0.8;
    transform: rotate(12deg);
}

#tutorial-library .tutorial-book__cover > * {
    position: relative;
    z-index: 2;
    margin-left: 0;
}

#tutorial-library .tutorial-book__cover h3 {
    max-width: 680px;
    color: var(--blueprint-ink);
    font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", "Kaiti SC", cursive;
    font-size: clamp(2.15rem, 4vw, 4.8rem);
    font-weight: 700;
    letter-spacing: -0.04em;
}

#tutorial-library .tutorial-book__cover p {
    max-width: 720px;
    color: var(--blueprint-muted);
    line-height: 1.95;
}

#tutorial-library .tutorial-book__stats {
    margin-top: 1.7rem;
}

#tutorial-library .tutorial-book__stats span {
    border: 1px solid var(--reader-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--blueprint-muted);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

#tutorial-library .tutorial-blueprint-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.9rem, 3vw, 2rem);
    margin: 1.8rem auto 0.35rem;
    padding: 0.72rem 0.95rem;
    border: 1px solid var(--reader-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 16px 36px rgba(38, 52, 70, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#tutorial-library .tutorial-blueprint-pager__btn,
#tutorial-library .tutorial-blueprint-pager__dot {
    border: 1px solid var(--reader-border);
    background: rgba(255, 255, 255, 0.82);
    color: var(--blueprint-muted);
    cursor: pointer;
    transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

#tutorial-library .tutorial-blueprint-pager__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.46rem 0.88rem;
    border-radius: 999px;
    font-size: 0.9rem;
}

#tutorial-library .tutorial-blueprint-pager__dots {
    display: inline-flex;
    align-items: center;
    gap: 0.58rem;
}

#tutorial-library .tutorial-blueprint-pager__dot {
    position: relative;
    width: 13px;
    height: 13px;
    padding: 0;
    border-radius: 50%;
}

#tutorial-library .tutorial-blueprint-pager__dot::after {
    content: '';
    position: absolute;
    inset: -7px;
    border: 1px solid transparent;
    border-radius: 50%;
}

#tutorial-library .tutorial-blueprint-pager__btn:hover,
#tutorial-library .tutorial-blueprint-pager__dot:hover,
#tutorial-library .tutorial-blueprint-pager__dot.is-active {
    border-color: var(--reader-border-strong);
    background: rgba(139, 194, 224, 0.16);
    color: var(--primary-color);
}

#tutorial-library .tutorial-blueprint-pager__dot.is-active {
    transform: scale(1.18);
}

#tutorial-library .tutorial-blueprint-pager__dot.is-active::after {
    border-color: var(--reader-border-strong);
}

#tutorial-library .tutorial-blueprint-pager__btn:active {
    transform: translateY(1px);
}

#tutorial-library .tutorial-chapter {
    position: relative;
    z-index: 0;
    grid-column: 1 / -1;
    max-width: none;
    min-height: 440px;
    margin: 0;
    padding: clamp(1.5rem, 3vw, 2.2rem);
    border: 1px solid rgba(69, 91, 112, 0.16);
    border-radius: 2px;
    background:
        linear-gradient(135deg, transparent 0 28px, rgba(47, 111, 153, 0.08) 28px 29px, transparent 29px),
        repeating-linear-gradient(0deg, transparent 0 27px, var(--blueprint-line-soft) 28px),
        repeating-linear-gradient(90deg, transparent 0 27px, var(--blueprint-line-soft) 28px),
        #ffffff;
    box-shadow:
        0 24px 52px rgba(38, 52, 70, 0.08),
        0 1px 0 rgba(255, 255, 255, 0.9) inset;
    transform-origin: center;
    transition: opacity 0.28s ease, transform 0.26s ease, box-shadow 0.26s ease, border-color 0.26s ease;
}

#tutorial-library .tutorial-blueprint-stack .tutorial-chapter:not(.is-active-sheet) {
    display: none;
}

#tutorial-library .tutorial-blueprint-stack .tutorial-chapter.is-active-sheet {
    display: block;
    animation: blueprintSheetIn 0.34s ease both;
}

@keyframes blueprintSheetIn {
    from {
        opacity: 0;
        transform: translateY(18px) rotate(-0.6deg) scale(0.985);
    }
    to {
        opacity: 1;
    }
}

#tutorial-library .tutorial-chapter::before,
#tutorial-library .tutorial-chapter::after {
    content: '';
    position: absolute;
    z-index: -1;
    border: 1px solid rgba(69, 91, 112, 0.1);
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(38, 52, 70, 0.05);
}

#tutorial-library .tutorial-chapter::before {
    top: 10px;
    right: -12px;
    bottom: -14px;
    left: 12px;
    transform: rotate(-2.2deg) translate(-7px, 9px);
}

#tutorial-library .tutorial-chapter::after {
    top: 16px;
    right: -18px;
    bottom: -20px;
    left: 20px;
    transform: rotate(1.8deg) translate(9px, 12px);
}

#tutorial-library #chapter-biped {
    transform: rotate(-0.55deg);
}

#tutorial-library #chapter-quadruped {
    transform: rotate(0.55deg);
}

#tutorial-library #chapter-arm {
    transform: rotate(0.35deg);
}

#tutorial-library #chapter-embodied {
    transform: rotate(-0.45deg);
}

#tutorial-library .tutorial-chapter:hover {
    border-color: var(--reader-border-strong);
    box-shadow: 0 28px 68px rgba(38, 52, 70, 0.12);
}

#tutorial-library .tutorial-chapter__header {
    display: grid;
    grid-template-columns: 118px 1fr;
    gap: 1.2rem;
    margin: 0 0 1.45rem;
    padding: 0 0 1.15rem;
    border-bottom: 1px solid var(--blueprint-line);
}

#tutorial-library .tutorial-chapter__index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.48rem;
    min-height: 52px;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--reader-border);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.74);
    color: var(--primary-color);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
}

#tutorial-library .tutorial-chapter__index i {
    font-size: 0.95rem;
}

#tutorial-library .tutorial-chapter__header h3 {
    margin: 0 0 0.45rem;
    color: var(--blueprint-ink);
    font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", "Kaiti SC", cursive;
    font-size: clamp(1.55rem, 2.5vw, 2.35rem);
    letter-spacing: -0.02em;
}

#tutorial-library .tutorial-chapter__header p {
    color: var(--blueprint-muted);
    line-height: 1.85;
}

#tutorial-library .tutorial-section {
    position: relative;
    margin: 0;
    padding: 1.05rem 0;
    border: none;
    border-bottom: 1px solid var(--blueprint-line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#tutorial-library .tutorial-section:last-child {
    border-bottom: none;
}

#tutorial-library .tutorial-section:hover,
#tutorial-library .tutorial-section.is-open {
    transform: none;
    background: linear-gradient(90deg, rgba(139, 194, 224, 0.08), transparent 58%);
    box-shadow: none;
}

#tutorial-library .tutorial-section__summary {
    grid-template-columns: 76px 1fr;
    gap: 1rem;
    align-items: start;
}

#tutorial-library .tutorial-section__number {
    position: relative;
    flex-direction: column;
    width: 62px;
    height: 62px;
    border: 1px solid var(--reader-border-strong);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.78);
    color: var(--blueprint-ink);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9rem;
    line-height: 1;
}

#tutorial-library .tutorial-section__number::before {
    content: 'STEP';
    margin-bottom: 0.26rem;
    color: var(--primary-color);
    font-size: 0.52rem;
    letter-spacing: 0.16em;
}

#tutorial-library .tutorial-section__number::after {
    content: '';
    position: absolute;
    right: -35px;
    top: 50%;
    width: 34px;
    border-top: 1px solid var(--reader-border-strong);
}

#tutorial-library .tutorial-section__heading {
    align-items: center;
    gap: 0.65rem;
}

#tutorial-library .tutorial-section__heading::before {
    content: '';
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: 1px solid var(--reader-border-strong);
    border-radius: 8px;
    background:
        linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(47, 111, 153, 0.42) calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
        linear-gradient(0deg, transparent calc(50% - 0.5px), rgba(47, 111, 153, 0.42) calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
        rgba(255, 255, 255, 0.78);
}

#tutorial-library .tutorial-section__heading h4 {
    color: var(--blueprint-ink);
    font-size: 1.16rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

#tutorial-library .tutorial-section__badge,
#tutorial-library .tutorial-section__tags span {
    border: 1px solid var(--reader-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--blueprint-muted);
}

#tutorial-library .tutorial-section__meta > p {
    color: var(--blueprint-muted);
    line-height: 1.82;
}

#tutorial-library .tutorial-section__footer {
    margin-top: 0.95rem;
}

#tutorial-library .tutorial-open-btn {
    border: 1px solid var(--blueprint-ink);
    border-radius: 999px;
    background: #ffffff;
    color: var(--blueprint-ink);
    box-shadow: none;
}

#tutorial-library .tutorial-open-btn::after {
    content: ' ↗';
    color: var(--primary-color);
}

#tutorial-library .tutorial-open-btn:hover {
    border-color: var(--primary-color);
    background: rgba(139, 194, 224, 0.14);
    color: var(--primary-color);
    box-shadow: none;
}

#tutorial-library .tutorial-book__toc-card {
    border: 1px solid var(--reader-border);
    background:
        radial-gradient(circle at 18% 14%, var(--blueprint-blue), transparent 30%),
        repeating-linear-gradient(0deg, transparent 0 25px, var(--blueprint-line-soft) 26px),
        repeating-linear-gradient(90deg, transparent 0 25px, var(--blueprint-line-soft) 26px),
        #ffffff;
}

#tutorial-library .tutorial-book__toc-card h3 {
    color: var(--blueprint-ink);
    font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", "Kaiti SC", cursive;
}

#tutorial-library .tutorial-book__nav-group {
    border-top: 1px solid var(--blueprint-line);
}

#tutorial-library .tutorial-book__nav-chapter,
#tutorial-library .tutorial-book__nav-item {
    color: var(--blueprint-muted);
}

#tutorial-library .tutorial-book__nav-title {
    color: var(--blueprint-ink);
}

#tutorial-library .tutorial-book__nav-chapter:hover,
#tutorial-library .tutorial-book__nav-item:hover,
#tutorial-library .tutorial-book__nav-chapter.is-active,
#tutorial-library .tutorial-book__nav-item.is-active {
    background: rgba(139, 194, 224, 0.14);
    color: var(--primary-color);
}

#tutorial-library .tutorial-book__nav-chapter.is-active .tutorial-book__nav-title,
#tutorial-library .tutorial-book__nav-chapter.is-active .tutorial-book__nav-index {
    color: var(--primary-color);
}

body.dark-theme #tutorial-library,
body.dark-theme #tutorial-library .tutorial-book__reader,
body.dark-theme #tutorial-library .tutorial-book__toc-card,
body.dark-theme #tutorial-library .tutorial-book__cover,
body.dark-theme #tutorial-library .tutorial-chapter,
body.dark-theme #tutorial-library .tutorial-chapter::before,
body.dark-theme #tutorial-library .tutorial-chapter::after,
body.dark-theme #tutorial-library .tutorial-media,
body.dark-theme #tutorial-library .tutorial-rendered,
body.dark-theme #tutorial-library .tutorial-gallery__page {
    background-color: #ffffff;
    color: var(--blueprint-ink);
}

body.dark-theme #tutorial-library .tutorial-reader-toolbar {
    background: rgba(255, 255, 255, 0.86);
}

body.dark-theme #tutorial-library .tutorial-reader-toolbar__title,
body.dark-theme #tutorial-library .tutorial-book__cover h3,
body.dark-theme #tutorial-library .tutorial-chapter__header h3,
body.dark-theme #tutorial-library .tutorial-section__heading h4 {
    color: var(--blueprint-ink);
}

body.dark-theme #tutorial-library .tutorial-book__cover p,
body.dark-theme #tutorial-library .tutorial-chapter__header p,
body.dark-theme #tutorial-library .tutorial-section__meta > p,
body.dark-theme #tutorial-library .tutorial-book__stats span,
body.dark-theme #tutorial-library .tutorial-section__badge,
body.dark-theme #tutorial-library .tutorial-section__tags span,
body.dark-theme #tutorial-library .tutorial-reader-toolbar__actions span,
body.dark-theme #tutorial-library .tutorial-reader-toolbar__toggle {
    color: var(--blueprint-muted);
}

body.dark-theme #tutorial-library .tutorial-open-btn {
    background: #ffffff;
    color: var(--blueprint-ink);
}

body.dark-theme #tutorial-library .tutorial-open-btn:hover {
    background: rgba(139, 194, 224, 0.14);
    color: var(--primary-color);
}

@media (max-width: 980px) {
    #tutorial-library .tutorial-book__reader {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    #tutorial-library #chapter-biped,
    #tutorial-library #chapter-quadruped,
    #tutorial-library #chapter-arm,
    #tutorial-library #chapter-embodied {
        transform: rotate(0deg);
    }
}

@media (max-width: 768px) {
    #tutorial-library {
        padding: 1.4rem;
    }

    #tutorial-library .tutorial-reader-toolbar {
        border-radius: 22px;
        align-items: flex-start;
    }

    #tutorial-library .tutorial-book__cover {
        padding: 1.6rem 1.25rem;
        transform: none;
    }

    #tutorial-library .tutorial-book__cover::after {
        right: 4%;
        top: 10%;
        width: 130px;
        height: 100px;
    }

    #tutorial-library .tutorial-blueprint-pager {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
        border-radius: 22px;
    }

    #tutorial-library .tutorial-blueprint-pager__btn {
        padding: 0.42rem 0.65rem;
        font-size: 0.82rem;
    }

    #tutorial-library .tutorial-blueprint-pager__dots {
        gap: 0.42rem;
    }

    #tutorial-library .tutorial-chapter {
        min-height: auto;
        padding: 1.25rem;
    }

    #tutorial-library .tutorial-chapter::before,
    #tutorial-library .tutorial-chapter::after {
        display: none;
    }

    #tutorial-library .tutorial-chapter__header,
    #tutorial-library .tutorial-section__summary {
        grid-template-columns: 1fr;
    }

    #tutorial-library .tutorial-section__number::after {
        display: none;
    }

    #tutorial-library .tutorial-section__content {
        margin-left: 0;
    }
}

/* 教程库：纸张质感增强 */
#tutorial-library .tutorial-chapter {
    width: min(100%, 980px);
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
    padding: clamp(1.75rem, 3.5vw, 3rem);
    border-color: rgba(64, 92, 116, 0.2);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 253, 0.92) 58%, rgba(255, 255, 255, 0.98)),
        radial-gradient(circle at 11% 14%, rgba(139, 194, 224, 0.13), transparent 22%),
        radial-gradient(circle at 84% 78%, rgba(246, 181, 123, 0.11), transparent 25%),
        repeating-linear-gradient(0deg, transparent 0 27px, rgba(70, 114, 145, 0.07) 28px),
        repeating-linear-gradient(90deg, transparent 0 27px, rgba(70, 114, 145, 0.065) 28px),
        #ffffff;
    box-shadow:
        0 42px 80px rgba(31, 45, 61, 0.12),
        0 18px 34px rgba(31, 45, 61, 0.08),
        0 1px 0 rgba(255, 255, 255, 0.92) inset,
        0 0 0 9px rgba(255, 255, 255, 0.54) inset;
}

#tutorial-library .tutorial-chapter > * {
    position: relative;
    z-index: 1;
}

#tutorial-library .tutorial-chapter::before {
    top: 18px;
    right: -20px;
    bottom: -24px;
    left: 24px;
    z-index: -2;
    border-color: rgba(64, 92, 116, 0.13);
    background:
        repeating-linear-gradient(0deg, transparent 0 27px, rgba(70, 114, 145, 0.045) 28px),
        repeating-linear-gradient(90deg, transparent 0 27px, rgba(70, 114, 145, 0.04) 28px),
        #fbfdfe;
    box-shadow: 0 22px 46px rgba(31, 45, 61, 0.08);
}

#tutorial-library .tutorial-chapter::after {
    top: 30px;
    right: -34px;
    bottom: -38px;
    left: 42px;
    z-index: -3;
    border-color: rgba(64, 92, 116, 0.1);
    background: #ffffff;
    box-shadow: 0 26px 52px rgba(31, 45, 61, 0.06);
}

#tutorial-library .tutorial-chapter__header {
    position: relative;
    padding: 1.15rem 1.25rem 1.35rem;
    border: 1px solid rgba(47, 111, 153, 0.18);
    background: rgba(255, 255, 255, 0.58);
}

#tutorial-library .tutorial-chapter__header::before,
#tutorial-library .tutorial-chapter__header::after {
    content: '';
    position: absolute;
    pointer-events: none;
}

#tutorial-library .tutorial-chapter__header::before {
    left: 50%;
    top: -18px;
    width: 116px;
    height: 30px;
    border: 1px solid rgba(155, 205, 177, 0.26);
    border-radius: 4px;
    background: rgba(215, 237, 226, 0.38);
    box-shadow: 0 6px 14px rgba(31, 45, 61, 0.04);
    transform: translateX(-50%) rotate(-1.6deg);
}

#tutorial-library .tutorial-chapter__header::after {
    right: 0.8rem;
    bottom: 0.65rem;
    width: 124px;
    height: 34px;
    border-top: 1px solid rgba(47, 111, 153, 0.24);
    border-left: 1px solid rgba(47, 111, 153, 0.24);
    background:
        linear-gradient(90deg, transparent 0 40%, rgba(47, 111, 153, 0.18) 40% calc(40% + 1px), transparent calc(40% + 1px)),
        linear-gradient(0deg, transparent 0 50%, rgba(47, 111, 153, 0.18) 50% calc(50% + 1px), transparent calc(50% + 1px));
    opacity: 0.75;
}

#tutorial-library .tutorial-section {
    padding: 1.18rem 0;
}

#tutorial-library .tutorial-section::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 82px;
    bottom: -1px;
    border-left: 1px dashed rgba(47, 111, 153, 0.2);
    pointer-events: none;
}

#tutorial-library .tutorial-section:last-child::before {
    display: none;
}

#tutorial-library .tutorial-section__number {
    box-shadow:
        0 0 0 5px rgba(255, 255, 255, 0.78),
        0 8px 18px rgba(47, 111, 153, 0.08);
}

#tutorial-library .tutorial-section__heading::before {
    box-shadow: 0 8px 16px rgba(47, 111, 153, 0.06);
}

#tutorial-library .tutorial-section__meta {
    position: relative;
}

#tutorial-library .tutorial-section__meta::after {
    content: '';
    position: absolute;
    right: 0.1rem;
    top: 0.1rem;
    width: 74px;
    height: 74px;
    border-top: 1px solid rgba(47, 111, 153, 0.16);
    border-right: 1px solid rgba(47, 111, 153, 0.16);
    opacity: 0.7;
    pointer-events: none;
}

#tutorial-library .tutorial-blueprint-pager {
    margin-top: 2.4rem;
}

@media (max-width: 768px) {
    #tutorial-library .tutorial-chapter {
        width: 100%;
        padding: 1.25rem;
        box-shadow:
            0 24px 52px rgba(31, 45, 61, 0.11),
            0 0 0 6px rgba(255, 255, 255, 0.58) inset;
    }

    #tutorial-library .tutorial-chapter__header {
        padding: 1rem;
    }

    #tutorial-library .tutorial-chapter__header::after,
    #tutorial-library .tutorial-section::before,
    #tutorial-library .tutorial-section__meta::after {
        display: none;
    }
}

/* 教程库：去 AI 化，改成更克制的真实纸稿质感 */
#tutorial-library {
    --blueprint-ink: #34373b;
    --blueprint-muted: #6f757b;
    --blueprint-line: rgba(52, 55, 59, 0.12);
    --blueprint-line-soft: rgba(52, 55, 59, 0.045);
    --reader-border: rgba(52, 55, 59, 0.14);
    --reader-border-strong: rgba(52, 55, 59, 0.22);
    background: #fbfbfa;
}

#tutorial-library::before,
#tutorial-library::after {
    display: none;
}

#tutorial-library > h2 {
    font-family: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", serif;
    font-size: clamp(2rem, 3.2vw, 3.1rem);
    font-weight: 600;
    letter-spacing: 0.03em;
    transform: none;
}

#tutorial-library > h2::after {
    width: 96px;
    background: rgba(52, 55, 59, 0.32);
}

#tutorial-library > .section-intro {
    margin-bottom: 2.2rem;
}

#tutorial-library .tutorial-reader-toolbar {
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 24px rgba(31, 45, 61, 0.04);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

#tutorial-library .tutorial-reader-toolbar__window span:nth-child(1),
#tutorial-library .tutorial-reader-toolbar__window span:nth-child(2),
#tutorial-library .tutorial-reader-toolbar__window span:nth-child(3) {
    background: #e6e3dc;
}

#tutorial-library .tutorial-chapter {
    border-radius: 3px;
    border-color: rgba(52, 55, 59, 0.16);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(250, 249, 246, 0.9)),
        repeating-linear-gradient(0deg, transparent 0 31px, rgba(52, 55, 59, 0.04) 32px),
        #fffdf8;
    box-shadow:
        0 18px 42px rgba(31, 45, 61, 0.08),
        0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

#tutorial-library .tutorial-chapter::before {
    top: 10px;
    right: -9px;
    bottom: -10px;
    left: 9px;
    z-index: -2;
    border-color: rgba(52, 55, 59, 0.08);
    background: #f7f5ef;
    box-shadow: 0 12px 28px rgba(31, 45, 61, 0.05);
    transform: none;
}

#tutorial-library .tutorial-chapter::after {
    display: none;
}

#tutorial-library .tutorial-chapter:hover {
    border-color: rgba(52, 55, 59, 0.16);
    box-shadow:
        0 18px 42px rgba(31, 45, 61, 0.08),
        0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

#tutorial-library .tutorial-chapter__header {
    padding: 0 0 1.1rem;
    border: none;
    border-bottom: 1px solid rgba(52, 55, 59, 0.12);
    background: transparent;
}

#tutorial-library .tutorial-chapter__header::before,
#tutorial-library .tutorial-chapter__header::after {
    display: none;
}

#tutorial-library .tutorial-chapter__header h3 {
    font-family: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", serif;
    font-weight: 600;
    text-shadow: none;
}

#tutorial-library .tutorial-chapter__index {
    border-radius: 2px;
    background: transparent;
    color: #4f565c;
}

#tutorial-library .tutorial-section:hover,
#tutorial-library .tutorial-section.is-open {
    background: rgba(52, 55, 59, 0.025);
}

#tutorial-library .tutorial-section::before,
#tutorial-library .tutorial-section__meta::after,
#tutorial-library .tutorial-section__heading::before {
    display: none;
}

#tutorial-library .tutorial-section__summary {
    grid-template-columns: 58px 1fr;
}

#tutorial-library .tutorial-section__number {
    width: 42px;
    height: 42px;
    border-radius: 2px;
    border-color: rgba(52, 55, 59, 0.18);
    background: transparent;
    box-shadow: none;
    font-size: 0.82rem;
}

#tutorial-library .tutorial-section__number::before {
    content: '';
    display: none;
}

#tutorial-library .tutorial-section__number::after {
    right: -24px;
    width: 24px;
    border-top-color: rgba(52, 55, 59, 0.18);
}

#tutorial-library .tutorial-section__badge,
#tutorial-library .tutorial-section__tags span {
    border-color: rgba(52, 55, 59, 0.12);
    background: rgba(255, 255, 255, 0.56);
}

#tutorial-library .tutorial-blueprint-pager {
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 22px rgba(31, 45, 61, 0.04);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* 教程库：改为博客文章列表风格 */
#tutorial-library {
    --primary-color: #3498db;
    --accent-color: #2ecc71;
    --reader-muted: var(--text-light);
    background-color: var(--section-bg-color);
    overflow: visible;
}

#tutorial-library > h2 {
    color: var(--primary-color);
    font-family: inherit;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: normal;
}

#tutorial-library > h2::after {
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
}

#tutorial-library .tutorial-book {
    display: block;
}

#tutorial-library .tutorial-book__toc,
#tutorial-library .tutorial-book__scrim,
#tutorial-library .tutorial-reader-toolbar,
#tutorial-library .tutorial-blueprint-pager {
    display: none !important;
}

#tutorial-library .tutorial-book__reader {
    display: block;
    max-width: none;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

#tutorial-library .tutorial-chapter,
#tutorial-library #chapter-biped,
#tutorial-library #chapter-quadruped,
#tutorial-library #chapter-arm,
#tutorial-library #chapter-embodied {
    display: block;
    width: 100%;
    max-width: none;
    min-height: 0;
    margin: 0 0 2.2rem;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    transform: none;
    animation: none;
}

#tutorial-library .tutorial-chapter::before,
#tutorial-library .tutorial-chapter::after {
    display: none;
}

#tutorial-library .tutorial-chapter__header {
    display: block;
    margin: 0 0 0.4rem;
    padding: 0;
    border: none;
    background: transparent;
}

#tutorial-library .tutorial-chapter__index {
    display: none;
}

#tutorial-library .tutorial-chapter__header h3 {
    margin: 1.4rem 0 0.3rem;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1.35rem;
    font-weight: 700;
}

#tutorial-library .tutorial-chapter__header p {
    margin-bottom: 0.6rem;
    color: var(--text-light);
    line-height: 1.7;
}

#tutorial-library .tutorial-section {
    margin: 0;
    padding: 0.85rem 0;
    border: none;
    border-bottom: 1px solid #eaeaea;
    background: transparent;
    box-shadow: none;
}

#tutorial-library .tutorial-section:hover,
#tutorial-library .tutorial-section.is-open {
    background: transparent;
    transform: none;
    box-shadow: none;
}

#tutorial-library .tutorial-section__summary {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 0.9rem;
    align-items: start;
}

#tutorial-library .tutorial-section__number {
    width: auto;
    height: auto;
    margin-top: 0.12rem;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--text-light);
    box-shadow: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
}

#tutorial-library .tutorial-section__number::before,
#tutorial-library .tutorial-section__number::after,
#tutorial-library .tutorial-section__heading::before,
#tutorial-library .tutorial-section::before,
#tutorial-library .tutorial-section__meta::after {
    display: none;
}

#tutorial-library .tutorial-section__heading {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    margin-bottom: 0.25rem;
}

#tutorial-library .tutorial-section__heading h4 {
    color: var(--primary-color);
    font-size: 1.05rem;
    font-weight: 600;
}

#tutorial-library .tutorial-section__meta > p {
    margin: 0.25rem 0 0.55rem;
    color: var(--text-color);
    line-height: 1.7;
}

#tutorial-library .tutorial-section__badge {
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 0.85rem;
}

#tutorial-library .tutorial-section__footer {
    align-items: center;
    margin-top: 0.4rem;
}

#tutorial-library .tutorial-section__tags {
    gap: 0.4rem;
}

#tutorial-library .tutorial-section__tags span {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 0.86rem;
}

#tutorial-library .tutorial-section__tags span:not(:last-child)::after {
    content: ' ·';
}

#tutorial-library .tutorial-open-btn {
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--primary-color);
    border-radius: 999px;
    background: transparent;
    color: var(--primary-color);
    box-shadow: none;
}

#tutorial-library .tutorial-open-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

#tutorial-library .tutorial-open-btn::after {
    content: '';
}

body.dark-theme #tutorial-library,
body.dark-theme #tutorial-library .tutorial-book__reader,
body.dark-theme #tutorial-library .tutorial-chapter,
body.dark-theme #tutorial-library .tutorial-section {
    background: transparent;
    color: var(--text-color);
}

body.dark-theme #tutorial-library .tutorial-section {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

@media (max-width: 768px) {
    #tutorial-library .tutorial-section__summary {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    #tutorial-library .tutorial-section__number {
        color: var(--text-light);
    }

    #tutorial-library .tutorial-section__footer {
        align-items: flex-start;
    }
}

/* 收藏夹：采用教程库同款博客列表风格 */
#more {
    --primary-color: #3498db;
    --accent-color: #2ecc71;
    --reader-muted: var(--text-light);
    background-color: var(--section-bg-color);
    overflow: visible;
}

#more:hover {
    transform: none;
}

#more > h2 {
    color: var(--primary-color);
    font-family: inherit;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: normal;
}

#more > h2::after {
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
}

#more .tutorial-book {
    display: block;
}

#more .tutorial-book__toc,
#more .tutorial-book__scrim,
#more .tutorial-reader-toolbar,
#more .tutorial-book__cover {
    display: none !important;
}

#more .tutorial-book__reader {
    display: block;
    max-width: none;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#more .tutorial-book__reader::before,
#more .tutorial-book__reader::after,
#more .tutorial-chapter::before,
#more .tutorial-chapter::after {
    display: none;
}

#more .tutorial-chapter {
    display: block;
    width: 100%;
    max-width: none;
    min-height: 0;
    margin: 0 0 2.2rem;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    transform: none;
}

#more .tutorial-chapter__header {
    display: block;
    margin: 0 0 0.4rem;
    padding: 0;
    border: none;
    background: transparent;
}

#more .tutorial-chapter__index {
    display: none;
}

#more .tutorial-chapter__header h3 {
    margin: 1.4rem 0 0.3rem;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1.35rem;
    font-weight: 700;
}

#more .tutorial-chapter__header p {
    margin-bottom: 0.6rem;
    color: var(--text-light);
    line-height: 1.7;
}

#more .tutorial-section {
    margin: 0;
    padding: 0.85rem 0;
    border: none;
    border-bottom: 1px solid #eaeaea;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#more .tutorial-section:hover,
#more .tutorial-section.is-open {
    background: transparent;
    transform: none;
    box-shadow: none;
}

#more .tutorial-section__summary {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 0.9rem;
    align-items: start;
}

#more .tutorial-section__number {
    width: auto;
    height: auto;
    min-height: 0;
    margin-top: 0.12rem;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--text-light);
    box-shadow: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
}

#more .tutorial-section__number::before,
#more .tutorial-section__number::after,
#more .tutorial-section__heading::before,
#more .tutorial-section::before,
#more .tutorial-section__meta::before,
#more .tutorial-section__meta::after,
#more .tutorial-section__meta > p::after,
#more .tutorial-section:nth-of-type(odd)::after {
    display: none;
}

#more .tutorial-section__heading {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    margin-bottom: 0.25rem;
}

#more .tutorial-section__heading h4 {
    color: var(--primary-color);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
}

#more .tutorial-section__meta > p {
    margin: 0.25rem 0 0.55rem;
    color: var(--text-color);
    line-height: 1.7;
}

#more .tutorial-section__badge {
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 0.85rem;
}

#more .tutorial-section__footer {
    align-items: center;
    margin-top: 0.4rem;
}

#more .tutorial-section__tags {
    gap: 0.4rem;
}

#more .tutorial-section__tags span {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 0.86rem;
}

#more .tutorial-section__tags span:not(:last-child)::after {
    content: ' ·';
}

#more .tutorial-open-btn {
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--primary-color);
    border-radius: 999px;
    background: transparent;
    color: var(--primary-color);
    box-shadow: none;
}

#more .tutorial-open-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

body.dark-theme #more,
body.dark-theme #more .tutorial-book__reader,
body.dark-theme #more .tutorial-chapter,
body.dark-theme #more .tutorial-section {
    background: transparent;
    color: var(--text-color);
}

body.dark-theme #more .tutorial-section {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

@media (max-width: 768px) {
    #more .tutorial-section__summary {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    #more .tutorial-section__footer {
        align-items: flex-start;
    }
}

/* ============================================================
   博客文章阅读页（微信读书风格）
   ============================================================ */
.blog-reader {
    --reader-font-size: 18px;
    --reader-bg: #f7f8fa;
    --reader-paper: #ffffff;
    --reader-text: #2b2f36;
    --reader-text-light: #8a8f99;
    --reader-border: #ececf0;
    --reader-btn-bg: #ffffff;
    --reader-btn-hover: #f2f3f5;

    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--reader-bg);
}

body.dark-theme .blog-reader {
    --reader-bg: #0f1420;
    --reader-paper: #1e293b;
    --reader-text: #d6dde8;
    --reader-text-light: #8b95a6;
    --reader-border: #2c3a52;
    --reader-btn-bg: #1e293b;
    --reader-btn-hover: #2a3a55;
}

body.blog-reader-open {
    overflow: hidden;
}

/* 阅读页打开时禁用区块悬停位移，避免 transform 使内部 fixed 定位退化 */
body.blog-reader-open section,
body.blog-reader-open section:hover {
    transform: none;
}

/* 阅读页打开时隐藏站点自带的悬浮小部件，避免遮挡翻页按钮 */
body.blog-reader-open .robot-lab-fab,
body.blog-reader-open .village-icon {
    display: none !important;
}

/* ---------- 顶栏 ---------- */
.reader-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1010;
    background: var(--reader-bg);
}

.reader-topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.reader-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--reader-border);
    background: var(--reader-btn-bg);
    color: var(--reader-text);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.reader-back:hover {
    background: var(--reader-btn-hover);
    transform: translateY(-1px);
}

.reader-topbar-divider {
    width: 1px;
    height: 18px;
    background: var(--reader-border);
    flex-shrink: 0;
}

.reader-topbar-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--reader-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 48vw;
}

.reader-topbar-right {
    font-size: 13px;
    color: var(--reader-text-light);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---------- 正文纸卡 ---------- */
.reader-stage {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    padding: 84px 100px 130px;
    scroll-behavior: smooth;
}

.reader-paper {
    max-width: 780px;
    margin: 0 auto;
    background: var(--reader-paper);
    border-radius: 6px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    padding: 56px 72px 72px;
    min-height: calc(100vh - 214px);
}

.reader-paper-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    color: var(--reader-text);
    margin: 0 0 18px;
    line-height: 1.5;
    letter-spacing: 0.5px;
}

.reader-paper-meta {
    text-align: center;
    font-size: 13px;
    color: var(--reader-text-light);
    margin: 0 0 14px;
}

.reader-paper-divider {
    width: 40px;
    height: 3px;
    background: var(--primary-color);
    opacity: 0.55;
    border-radius: 2px;
    margin: 0 auto 44px;
}

/* ---------- 正文排版 ---------- */
.reader-content {
    color: var(--reader-text) !important;
    font-size: var(--reader-font-size) !important;
    line-height: 1.95 !important;
}

.reader-content p {
    margin: 1.05em 0;
    text-align: justify;
}

.reader-content h2,
.reader-content h3,
.reader-content h4 {
    color: var(--reader-text) !important;
    scroll-margin-top: 72px;
}

.reader-content h2 {
    margin-top: 2.2em;
    font-size: 1.45em;
}

.reader-content h3 {
    margin-top: 1.8em;
    font-size: 1.22em;
}

.reader-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1.5em auto;
}

.reader-content blockquote {
    border-left: 3px solid var(--primary-color);
    background: var(--reader-btn-hover);
    border-radius: 0 8px 8px 0;
    padding: 0.6em 1.1em;
    color: var(--reader-text-light);
}

.reader-content blockquote p {
    margin: 0.35em 0;
}

.reader-content hr {
    border: none;
    border-top: 1px solid var(--reader-border);
    margin: 2.4em auto;
    width: 70%;
}

/* ---------- 右侧悬浮工具条 ---------- */
.reader-toolbar {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 1010;
}

.reader-tool-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--reader-btn-bg);
    color: var(--reader-text);
    border: 1px solid var(--reader-border);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}

.reader-tool-btn:hover {
    background: var(--reader-btn-hover);
    transform: translateY(-1px);
}

.reader-tool-font {
    font-weight: 700;
    font-size: 17px;
}

/* ---------- 字号弹窗 ---------- */
.reader-font-pop {
    position: absolute;
    right: 86px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1040;
    background: var(--reader-btn-bg);
    border: 1px solid var(--reader-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 12px 16px;
}

.reader-font-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.reader-font-row button {
    width: 46px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--reader-border);
    background: transparent;
    color: var(--reader-text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.reader-font-row button:hover:not(:disabled) {
    background: var(--reader-btn-hover);
}

.reader-font-row button:disabled {
    opacity: 0.35;
    cursor: default;
}

#reader-font-label {
    font-size: 13px;
    color: var(--reader-text-light);
    min-width: 36px;
    text-align: center;
}

/* ---------- 底部翻页 ---------- */
.reader-pager-btn {
    position: absolute;
    bottom: 30px;
    z-index: 1010;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 999px;
    background: var(--reader-btn-bg);
    border: 1px solid var(--reader-border);
    color: var(--reader-text);
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
    transition: all 0.2s;
}

.reader-pager-prev {
    left: 28px;
}

.reader-pager-next {
    right: 90px;
}

.reader-pager-btn:not(:disabled):hover {
    background: var(--reader-btn-hover);
    transform: translateY(-1px);
}

.reader-pager-btn:disabled {
    opacity: 0.35;
    cursor: default;
    box-shadow: none;
}

/* ---------- 目录抽屉 ---------- */
.reader-scrim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1020;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.blog-reader.toc-open .reader-scrim {
    opacity: 1;
    pointer-events: auto;
}

.reader-toc-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 86vw);
    background: var(--reader-paper);
    z-index: 1030;
    transform: translateX(105%);
    transition: transform 0.28s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.1);
}

.blog-reader.toc-open .reader-toc-panel {
    transform: translateX(0);
}

.reader-toc-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--reader-text);
    border-bottom: 1px solid var(--reader-border);
    flex-shrink: 0;
}

.reader-toc-close {
    border: none;
    background: transparent;
    color: var(--reader-text-light);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
}

.reader-toc-close:hover {
    background: var(--reader-btn-hover);
    color: var(--reader-text);
}

.reader-toc-list {
    /* 显式覆盖站点全局的 nav {} 规则（display:flex + space-between 会把
       目录条目压成一行、每条缩到一个字宽，文字被迫竖排） */
    display: block;
    justify-content: flex-start;
    align-items: stretch;
    max-width: none;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px 28px;
}

.reader-toc-item {
    display: block;
    padding: 9px 14px;
    border-radius: 6px;
    color: var(--reader-text);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.55;
    border-left: 2px solid transparent;
    transition: background 0.15s;
}

.reader-toc-item.is-h3 {
    padding-left: 30px;
    font-size: 13px;
    color: var(--reader-text-light);
}

.reader-toc-item:hover {
    background: var(--reader-btn-hover);
    color: inherit;
}

.reader-toc-item.is-active {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    background: var(--reader-btn-hover);
    font-weight: 600;
}

.reader-toc-empty {
    padding: 28px 18px;
    font-size: 13px;
    color: var(--reader-text-light);
    text-align: center;
}

/* ---------- 手机端 ---------- */
@media (max-width: 768px) {
    .reader-topbar {
        padding: 0 12px;
        height: 56px;
    }

    .reader-back span {
        display: none;
    }

    .reader-back {
        padding: 8px 12px;
    }

    .reader-topbar-divider {
        display: none;
    }

    .reader-topbar-title {
        font-size: 14px;
        max-width: 52vw;
    }

    .reader-topbar-right {
        display: none;
    }

    .reader-stage {
        padding: 68px 12px 96px;
    }

    .reader-paper {
        padding: 32px 22px 48px;
        min-height: calc(100vh - 178px);
    }

    .reader-paper-title {
        font-size: 23px;
    }

    /* 手机端：工具条改为底部横条（微信读书手机版布局） */
    .reader-toolbar {
        right: 0;
        left: 0;
        top: auto;
        bottom: 0;
        transform: none;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 36px;
        height: 54px;
        background: var(--reader-paper);
        border-top: 1px solid var(--reader-border);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    }

    .reader-tool-btn {
        width: 40px;
        height: 40px;
        font-size: 15px;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .reader-tool-btn:hover {
        background: transparent;
        transform: none;
    }

    #reader-top-btn {
        display: none;
    }

    .reader-font-pop {
        top: auto;
        right: 12px;
        bottom: 64px;
        transform: none;
    }

    .reader-pager-btn {
        bottom: 11px;
        padding: 9px 13px;
    }

    .reader-pager-prev {
        left: 10px;
    }

    .reader-pager-next {
        right: 10px;
    }

    .reader-pager-btn span {
        display: none;
    }
}

/* ============================================================
   收藏夹页面改版：微信读书榜单式章节卡片网格
   （参考：白色圆角卡片并排成网格，卡内条目单列紧凑排布 + 分隔线）
   ============================================================ */

/* 取消「左侧目录 + 右侧笔记本」两栏结构，卡片网格占满整行；
   并重定义配色变量，压掉 #more 上「实验记录本」的米黄纸色系 */
#more-book {
    display: block;
    --reader-panel: #ffffff;
    --reader-panel-soft: #f8fafc;
    --reader-border: rgba(15, 23, 42, 0.09);
    --reader-muted: #64748b;
}

body.dark-theme #more-book {
    --reader-panel: #1e293b;
    --reader-panel-soft: rgba(148, 163, 184, 0.09);
    --reader-border: rgba(148, 163, 184, 0.16);
    --reader-muted: #94a3b8;
}

#more-book .tutorial-book__toc,
#more-book .tutorial-book__scrim,
#more-book .tutorial-reader-toolbar,
#more-book .tutorial-book__cover {
    display: none;
}

/* 网格容器：桌面两列并排，窄屏自动收成单列 */
#more-book .tutorial-book__reader {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 1.4rem;
    align-items: start;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    overflow: visible;
}

#more-book .tutorial-book__reader::before {
    display: none;
}

/* 章节卡片 */
#more-book .tutorial-chapter {
    max-width: none;
    margin: 0;
    scroll-margin-top: 90px;
    display: flex;
    flex-direction: column;
    padding: 1.3rem 1.5rem 0.7rem;
    background: var(--reader-panel);
    border: 1px solid var(--reader-border);
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

/* 卡片头部：主题色徽章 + 章节名 + 条目数 */
#more-book .tutorial-chapter__header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding-bottom: 0.9rem;
    margin-bottom: 0.2rem;
    border-bottom: 1px solid var(--reader-border);
    box-shadow: none;
}

#more-book .tutorial-chapter__index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0.42rem 0.8rem;
    border: none;
    border-radius: 10px;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    white-space: nowrap;
    transform: none;
}

/* 榜单主题色：机器人技术=玫红、AI 实用工具=橙（参考图2两个榜单的配色） */
#more-book .tutorial-chapter:nth-of-type(1) .tutorial-chapter__index {
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.14), rgba(225, 29, 72, 0.05));
    color: #e11d48;
}

#more-book .tutorial-chapter:nth-of-type(2) .tutorial-chapter__index {
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.15), rgba(234, 88, 12, 0.05));
    color: #ea580c;
}

#more-book .tutorial-chapter__header h3 {
    margin: 0;
    font-size: 1.28rem;
    letter-spacing: -0.01em;
}

#more-book .tutorial-chapter__header p {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    color: var(--reader-muted);
}

/* 条目行：紧凑单列 + 分隔线（类似图2榜单条目） */
#more-book .tutorial-section {
    margin: 0;
    padding: 0.9rem 0.45rem;
    border: none;
    border-bottom: 1px solid var(--reader-border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#more-book .tutorial-section:last-of-type {
    border-bottom: none;
}

#more-book .tutorial-section:hover,
#more-book .tutorial-section.is-open {
    transform: none;
    box-shadow: none;
    background: var(--reader-panel-soft);
    border-radius: 12px;
}

#more-book .tutorial-section__summary {
    grid-template-columns: 46px 1fr;
    gap: 0.9rem;
    align-items: start;
    cursor: pointer;
}

#more-book .tutorial-section__number {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    font-size: 0.95rem;
}

#more-book .tutorial-section__heading {
    gap: 0.55rem;
    margin-bottom: 0.35rem;
}

#more-book .tutorial-section__heading h4 {
    margin: 0;
    font-size: 1.05rem;
    transform: none;
}

#more-book .tutorial-section__meta > p {
    margin: 0 0 0.5rem;
    font-size: 0.88rem;
    line-height: 1.7;
}

#more-book .tutorial-section__badge {
    padding: 0;
    border: none;
    background: transparent;
    font-size: 0.78rem;
    color: var(--reader-muted);
}

#more-book .tutorial-section__footer {
    margin-top: 0.35rem;
    gap: 0.7rem;
}

#more-book .tutorial-section__tags {
    gap: 0.4rem;
}

#more-book .tutorial-section__tags span {
    padding: 0.14rem 0.55rem;
    font-size: 0.72rem;
    background: var(--reader-panel-soft);
    border: 1px solid var(--reader-border);
}

#more-book .tutorial-open-btn {
    padding: 0.34rem 0.9rem;
    font-size: 0.8rem;
    box-shadow: none;
}

/* 手机端：单列 + 收紧留白 */
@media (max-width: 768px) {
    #more-book .tutorial-book__reader {
        grid-template-columns: 1fr;
        gap: 1.1rem;
    }

    #more-book .tutorial-chapter {
        padding: 1.1rem 1rem 0.5rem;
    }
}

/* 深色模式 */
body.dark-theme #more-book .tutorial-chapter {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

body.dark-theme #more-book .tutorial-section:hover,
body.dark-theme #more-book .tutorial-section.is-open {
    background: var(--reader-panel-soft);
}

/* ============================================================
   博客页改版：微信读书榜单式「专辑侧栏 + 文章列表」
   ============================================================ */
.blog-shelf {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 1.6rem;
    align-items: start;
    margin-top: 1.5rem;
}

/* 左侧专辑栏（显式覆盖站点全局的 nav {} 规则：
   margin auto 会使其变成 fit-content 宽度、padding 5% 额外撑宽） */
.blog-shelf__nav {
    position: sticky;
    top: 105px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0.35rem;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    z-index: auto;
}

.blog-shelf__nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.18s, color 0.18s;
}

.blog-shelf__nav-item:hover {
    background: rgba(37, 99, 235, 0.08);
}

/* 选中态：蓝色高亮，参考图2里「飙升榜」的选中胶囊 */
.blog-shelf__nav-item.is-active {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

.blog-shelf__nav-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.blog-shelf__nav-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.blog-shelf__nav-count {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
    background: rgba(15, 23, 42, 0.05);
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.blog-shelf__nav-item.is-active .blog-shelf__nav-count {
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.2);
}

/* 右侧文章列表面板 */
.blog-shelf__panel {
    background: var(--section-bg-color);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 16px;
    padding: 0.4rem 1.6rem 0.8rem;
    box-shadow: var(--shadow);
}

.blog-shelf__head {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    padding: 1.15rem 0.4rem 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.blog-shelf__head-icon {
    font-size: 1.2rem;
}

.blog-shelf__head-name {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-color);
}

.blog-shelf__head-count {
    font-size: 0.82rem;
    color: var(--text-light);
}

/* 文章行：大号排名数字 + 标题 + 元信息 */
.blog-shelf__row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 0.6rem;
    align-items: start;
    padding: 1.05rem 0.4rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    cursor: pointer;
    transition: background 0.15s;
}

.blog-shelf__row:last-child {
    border-bottom: none;
}

.blog-shelf__row:hover {
    background: rgba(37, 99, 235, 0.06);
    border-radius: 10px;
}

.blog-shelf__row-num {
    font-size: 1.35rem;
    font-weight: 700;
    color: #b9c3d0;
    text-align: center;
    line-height: 1;
    padding-top: 0.25rem;
    font-variant-numeric: tabular-nums;
}

/* 前三名数字用主题蓝，榜单习惯 */
.blog-shelf__row:nth-child(-n+3) .blog-shelf__row-num {
    color: var(--accent-color);
}

.blog-shelf__row-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.55;
    word-break: break-word;
}

.blog-shelf__row-meta {
    margin-top: 0.32rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* 手机端：侧栏变横向滑动的胶囊行 */
@media (max-width: 768px) {
    .blog-shelf {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }

    .blog-shelf__nav {
        position: static;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.35rem;
        -webkit-overflow-scrolling: touch;
    }

    .blog-shelf__nav-item {
        width: auto;
        flex: 0 0 auto;
        padding: 0.45rem 0.8rem;
        font-size: 0.88rem;
    }

    .blog-shelf__panel {
        padding: 0.2rem 1rem 0.4rem;
    }

    .blog-shelf__row {
        grid-template-columns: 40px minmax(0, 1fr);
        padding: 0.85rem 0.2rem;
    }

    .blog-shelf__row-num {
        font-size: 1.1rem;
    }
}

/* 深色模式 */
body.dark-theme .blog-shelf__panel {
    border-color: #2c3a52;
}

body.dark-theme .blog-shelf__head,
body.dark-theme .blog-shelf__row {
    border-color: rgba(148, 163, 184, 0.16);
}

body.dark-theme .blog-shelf__row:hover {
    background: rgba(96, 165, 250, 0.1);
}

body.dark-theme .blog-shelf__row-num {
    color: #475569;
}

body.dark-theme .blog-shelf__nav-item {
    color: var(--text-color);
}

body.dark-theme .blog-shelf__nav-item:hover {
    background: rgba(96, 165, 250, 0.12);
}

body.dark-theme .blog-shelf__nav-count {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
}
