/* ============================================
   style.css —— 全站统一样式
   设计风格：百科词条风格
   特点：左侧信息卡 + 右侧正文，干净、正式
   ============================================ */

/* ========== 颜色变量 ========== */
:root {
    --primary: #2c3e50;
    --primary-light: #34495e;
    --accent: #3498db;
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --border: #e0e0e0;
    --toc-bg: #f8f9fa;
    --footer-bg: #2c3e50;
}

/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ========== 导航栏 ========== */
.navbar {
    background-color: var(--primary);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.4s ease;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    flex-wrap: wrap;
}

.nav-logo {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.nav-links a {
    color: #ccc;
    padding: 8px 18px;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.nav-links a:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-links a.active {
    color: #fff;
    background-color: var(--accent);
    font-weight: 600;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: #fff;
    margin: 5px 0;
    transition: all 0.3s;
}

/* ========== 词条标题区域 ========== */
.entry-header {
    background-color: rgba(20, 30, 50, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px 20px;
    transition: background-color 0.4s ease;
}

.entry-header-container {
    max-width: 1100px;
    margin: 0 auto;
}

.entry-title {
    font-size: 2rem;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.entry-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    margin-top: 5px;
}

/* ========== 主内容布局 ========== */
.entry-main {
    flex: 1;
    padding: 30px 20px;
    transition: background-color 0.4s ease;
}

.entry-layout {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    /* 只有两列！ */
    gap: 30px;
    align-items: start;
}

.entry-sidebar {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 25px;
    /* 不要 position: sticky */
}

/* 目录卡片（信息卡下方） */
.entry-toc .toc {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 20px 22px;
    margin-bottom: 0;
}

.info-avatar {
    text-align: center;
    margin-bottom: 20px;
}

.info-avatar-img {
    width: 150px;
    height: 200px;
    border-radius: 8px;
    object-fit: cover;
    border: 3px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.info-table th,
.info-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.info-table th {
    color: var(--text-light);
    font-weight: 600;
    white-space: nowrap;
    width: 35%;
}

.info-card-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-block {
    width: 100%;
    text-align: center;
}

/* ========== 按钮样式 ========== */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-outline {
    background-color: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}

.btn-outline:hover {
    background-color: var(--accent);
    color: #fff;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* ========== 右侧正文区域 ========== */
.entry-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 30px;
    min-width: 0;
}

/* ========== 目录 ========== */
.toc {
    background-color: var(--toc-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 20px 25px;
    margin-bottom: 30px;
}

.toc-title {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 700;
}

.toc ul {
    list-style: none;
}

.toc li {
    padding: 5px 0;
}

.toc-link {
    color: var(--accent);
    font-size: 0.95rem;
    transition: color 0.2s;
}

.toc-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* ========== 正文章节 ========== */
.content-section {
    margin-bottom: 35px;
}

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

.section-heading {
    font-size: 1.4rem;
    color: var(--primary);
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
    font-weight: 700;
}

.content-section p {
    margin-bottom: 12px;
    font-size: 1rem;
    color: var(--text);
}

/* ========== 项目行 ========== */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.project-row {
    display: flex;
    gap: 15px;
    padding: 15px;
    background-color: #fafafa;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
    align-items: flex-start;
}

.project-row-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.project-row-info h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 5px;
}

.project-row-info p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.tag {
    display: inline-block;
    background-color: #eef4fb;
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.78rem;
    margin-right: 5px;
}

/* ========== 兴趣列表 ========== */
.interest-list {
    list-style: none;
    margin: 15px 0;
}

.interest-list li {
    padding: 8px 0;
    border-bottom: 1px dashed #f0f0f0;
}

.interest-list li:last-child {
    border-bottom: none;
}

/* ========== 页内联系方式 ========== */
.contact-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 15px 0;
    font-size: 0.95rem;
}

/* ========== 通用页面主体 ========== */
.page-main {
    flex: 1;
    padding: 30px 20px;
    transition: background-color 0.4s ease;
}

.page-container {
    max-width: 1100px;
    margin: 0 auto;
}

.category-heading {
    font-size: 1.3rem;
    color: #ffffff;
    margin: 30px 0 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ========== 项目卡片网格 ========== */
.project-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.project-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 25px;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-color: #ccc;
}

.project-card-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.project-card h3 {
    font-size: 1.15rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.project-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 12px;
    flex: 1;
}

.project-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
}

.project-card-tags span {
    background-color: #eef4fb;
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.78rem;
}

/* ========== 联系卡片 ========== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.contact-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 25px;
    text-align: center;
    transition: all 0.25s;
}

.contact-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.contact-card-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.contact-card h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.contact-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 12px;
    word-break: break-all;
}

/* ========== 表单卡片 ========== */
.form-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 30px;
}

.form-card h2 {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.form-note {
    background-color: #fffde7;
    border-left: 4px solid #f9a825;
    padding: 12px 16px;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 20px;
    border-radius: 0 4px 4px 0;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
}

.form-group input,
.form-group textarea {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

/* ========== 添加提示 ========== */
.add-note {
    background-color: #fffde7;
    border-left: 4px solid #f9a825;
    padding: 20px;
    border-radius: 0 6px 6px 0;
    margin-top: 30px;
}

.add-note h3 {
    color: #f57f17;
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.add-note p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ========== 回到顶部按钮 ========== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 90;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    filter: brightness(0.9);
}

/* ========== 页脚 ========== */
.footer {
    background-color: var(--footer-bg);
    color: #ccc;
    text-align: center;
    padding: 20px;
    margin-top: auto;
    transition: background-color 0.4s ease;
}

.footer p {
    font-size: 0.9rem;
    margin: 3px 0;
}

/* ========== 表单提示消息 ========== */
.form-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.form-message.success {
    background-color: #e8f8f0;
    color: #27ae60;
    border: 1px solid #b2dfdb;
}

.form-message.error {
    background-color: #fdecea;
    color: #e74c3c;
    border: 1px solid #f5c6cb;
}

/* ========== 笔记列表 ========== */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.note-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 20px;
    transition: all 0.2s;
    display: block;
}

.note-item:hover {
    border-color: #ccc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.note-title {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 5px;
}

.note-meta {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 10px;
}

.note-excerpt {
    color: #666;
    font-size: 0.95rem;
}

.note-content {
    line-height: 1.8;
}

/* ========== 分类卡片 ========== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.category-card {
    padding: 30px 20px;
    border-radius: 8px;
    text-align: center;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.category-name {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ========== 证书弹窗 ========== */
.cert-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.cert-modal.open {
    display: flex;
}

.cert-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
}

.cert-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    z-index: 10;
}

.cert-modal-close:hover {
    color: #e74c3c;
}

.cert-modal-title {
    text-align: center;
    margin-bottom: 15px;
    color: #2c3e50;
}

.cert-image-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.cert-image-wrapper img {
    max-width: 80vw;
    max-height: 70vh;
    display: block;
    border-radius: 4px;
}

.cert-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 2rem;
    color: rgba(0, 0, 0, 0.15);
    pointer-events: none;
    white-space: nowrap;
    letter-spacing: 8px;
    user-select: none;
}

.cert-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 5;
}

/* ========== 星空背景层 ========== */
.starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(180deg, #0b0e1a 0%, #1a1f35 50%, #2c3e50 100%);
    overflow: hidden;
    pointer-events: none;
    transition: background 0.5s ease;
}

.starfield::before,
.starfield::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: repeat;
    opacity: 0.8;
}

.starfield::before {
    background-image:
        radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 70% 60%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 40% 80%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1px 1px at 90% 20%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 15% 70%, rgba(255, 255, 255, 0.2), transparent);
    background-size: 200px 200px;
    animation: twinkle 6s ease-in-out infinite alternate;
}

.starfield::after {
    background-image:
        radial-gradient(2px 2px at 50% 40%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(2px 2px at 80% 75%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(2px 2px at 30% 55%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(2px 2px at 65% 15%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(2px 2px at 10% 90%, rgba(255, 255, 255, 0.4), transparent);
    background-size: 350px 350px;
    animation: twinkle 8s ease-in-out infinite alternate-reverse;
}

@keyframes twinkle {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

.meteor {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), transparent);
    border-radius: 50%;
    opacity: 0;
    transform: rotate(-45deg);
    animation-name: meteorShower;
    animation-timing-function: ease-out;
    animation-iteration-count: 1;
    pointer-events: none;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

@keyframes meteorShower {
    0% {
        opacity: 0;
        transform: translate(0, 0) rotate(-45deg);
    }

    10% {
        opacity: 1;
    }

    40% {
        opacity: 0.8;
    }

    60% {
        opacity: 0;
        transform: translate(-400px, 400px) rotate(-45deg);
    }

    100% {
        opacity: 0;
        transform: translate(-400px, 400px) rotate(-45deg);
    }
}

/* ========== 主题背景（仅背景渐变，四区颜色由 JS 内联控制） ========== */

/* 季节主题下隐藏星星 */
body[data-theme="spring"] .starfield,
body[data-theme="summer"] .starfield,
body[data-theme="autumn"] .starfield,
body[data-theme="winter"] .starfield,
body[data-theme="minimal"] .starfield,
body[data-theme="dark"] .starfield {
    background: none;
}

body[data-theme="spring"] .starfield::before,
body[data-theme="spring"] .starfield::after,
body[data-theme="summer"] .starfield::before,
body[data-theme="summer"] .starfield::after,
body[data-theme="autumn"] .starfield::before,
body[data-theme="autumn"] .starfield::after,
body[data-theme="winter"] .starfield::before,
body[data-theme="winter"] .starfield::after,
body[data-theme="minimal"] .starfield::before,
body[data-theme="minimal"] .starfield::after,
body[data-theme="dark"] .starfield::before,
body[data-theme="dark"] .starfield::after {
    display: none;
}

body[data-theme="spring"] .starfield {
    background: linear-gradient(180deg, #fce4ec 0%, #f8bbd0 40%, #e1bee7 100%);
}

body[data-theme="summer"] .starfield {
    background: linear-gradient(180deg, #003d33 0%, #00695c 50%, #00838f 100%);
}

body[data-theme="autumn"] .starfield {
    background: linear-gradient(180deg, #4e342e 0%, #6d4c41 50%, #a1887f 100%);
}

body[data-theme="winter"] .starfield {
    background: linear-gradient(180deg, #90a4ae 0%, #b0bec5 50%, #cfd8dc 100%);
}

body[data-theme="minimal"] .starfield {
    background: #ffffff;
}

body[data-theme="dark"] .starfield {
    background: #1a1a1a;
}

/* ========== 极简白主题文字颜色（JS 无法覆盖部分） ========== */
body[data-theme="minimal"] .navbar {
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

body[data-theme="minimal"] .entry-header {
    border-bottom: 1px solid #e0e0e0;
}

body[data-theme="minimal"] .footer {
    border-top: 1px solid #e0e0e0;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .entry-layout {
        grid-template-columns: 1fr;
    }

    .entry-sidebar {
        position: static;
    }

    .entry-toc {
        order: -1;
        /* 手机上目录排在信息卡上面 */
    }
}

/* ========== 锚点滚动偏移（避免标题被导航栏遮住） ========== */
.content-section {
    scroll-margin-top: 80px;
}

/* ========== 头像防下载 ========== */
.avatar-wrapper {
    position: relative;
    display: inline-block;
    width: 150px;
    height: 200px;
    margin: 0 auto 20px;
    overflow: hidden;
    border-radius: 8px;
}

.avatar-wrapper .info-avatar-img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 0;
    border: none;
    box-shadow: none;
    pointer-events: none;   /* 图片本身不接受鼠标事件 */
}

/* 透明遮罩：盖在图片上方，让右键/拖拽操作的是遮罩层而不是图片 */
.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: transparent;
}

/* 水印：斜着放在头像中央 */
.avatar-watermark {
    position: absolute;
    bottom: 6px;
    right: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    letter-spacing: 2px;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    z-index: 3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ========== Jupyter 笔记渲染样式 ========== */
.jupyter-md {
    margin-bottom: 20px;
}

.jupyter-md h1, .jupyter-md h2, .jupyter-md h3 {
    color: #2c3e50;
    margin: 20px 0 10px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 6px;
}

.jupyter-md p {
    margin-bottom: 12px;
    line-height: 1.8;
}

.jupyter-md code {
    background-color: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    color: #e74c3c;
}

.jupyter-md pre {
    background-color: #f6f8fa;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 15px 0;
}

.jupyter-md pre code {
    background: none;
    color: #333;
    padding: 0;
}

.jupyter-code {
    margin: 20px 0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.jupyter-code-header {
    background-color: #f0f0f0;
    padding: 6px 14px;
    font-size: 0.8rem;
    color: #666;
    font-family: 'Consolas', 'Monaco', monospace;
    border-bottom: 1px solid #e0e0e0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.jupyter-code pre {
    margin: 0;
    padding: 15px;
    background-color: #fafafa;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.jupyter-output {
    border-top: 1px dashed #e0e0e0;
    background-color: #f9f9f9;
}

.jupyter-output-label {
    padding: 6px 14px;
    font-size: 0.75rem;
    color: #999;
    font-family: 'Consolas', 'Monaco', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.jupyter-output-content {
    padding: 12px 15px;
    font-size: 0.9rem;
    color: #444;
    line-height: 1.6;
}

.jupyter-output-content p {
    margin-bottom: 8px;
}

.jupyter-output-content img {
    max-width: 100%;
    border-radius: 4px;
    margin: 8px 0;
    border: 1px solid #e0e0e0;
}

.jupyter-output-content pre {
    margin: 8px 0;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
}

/* Jupyter 编辑器样式 */
.jupyter-cell-editor textarea {
    font-family: 'Consolas', 'Monaco', monospace;
    outline: none;
    resize: vertical;
}

.jupyter-cell-editor textarea:focus {
    border-color: #3498db;
}


/* ========== 自定义表格按钮图标 ========== */
.ql-snow .ql-toolbar button.ql-table,
.ql-snow.ql-toolbar button.ql-table {
    width: 24px;
}

.ql-snow .ql-toolbar button.ql-table::before,
.ql-snow.ql-toolbar button.ql-table::before {
    content: '⊞';
    font-size: 16px;
    display: block;
    line-height: 24px;
    text-align: center;
    color: #444;
}

.ql-snow .ql-toolbar button.ql-table:hover::before {
    color: #06c;
}

/* ========== 编辑器内表格样式 ========== */
.ql-editor table,
.jupyter-cell-editor .ql-editor table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
}

.ql-editor table td,
.ql-editor table th,
.jupyter-cell-editor .ql-editor table td,
.jupyter-cell-editor .ql-editor table th {
    border: 1px solid #ccc;
    padding: 6px 10px;
    min-width: 60px;
}

.ql-editor table th {
    background: #f0f0f0;
    font-weight: 600;
}

.ql-editor table td:focus,
.ql-editor table th:focus {
    outline: 2px solid #3498db;
    outline-offset: -2px;
}


/* Quill 缩进支持（展示页也生效） */
.ql-editor p[class*="ql-indent-1"],
.note-content p[class*="ql-indent-1"] { margin-left: 2em; }
.ql-editor p[class*="ql-indent-2"],
.note-content p[class*="ql-indent-2"] { margin-left: 4em; }
.ql-editor p[class*="ql-indent-3"],
.note-content p[class*="ql-indent-3"] { margin-left: 6em; }
.ql-editor p[class*="ql-indent-4"],
.note-content p[class*="ql-indent-4"] { margin-left: 8em; }


/* ========== 笔记内容响应式（移动端适配） ========== */
.note-content img,
.jupyter-md img,
.jupyter-output-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
    border-radius: 4px;
}

/* 笔记内容里的表格也不溢出 */
.note-content table,
.jupyter-md table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

/* 代码块换行（防止横向滚动条撑破容器） */
.note-content pre,
.jupyter-md pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre;
    word-wrap: normal;
}

/* 长链接/长单词强制换行 */
.note-content,
.jupyter-md {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* 移动端进一步收紧 */
@media (max-width: 768px) {
    .note-content,
    .jupyter-md {
        padding: 15px;
    }

    .note-content img,
    .jupyter-md img {
        max-width: 100%;
        margin: 8px 0;
    }

    .form-card {
        padding: 15px;
    }
}

/* 符号面板 */
.symbol-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    padding: 8px 10px;
    background: #fafbfc;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}
.symbol-panel-label {
    color: #888;
    font-size: 0.8rem;
    margin-right: 4px;
}
.sym-btn {
    padding: 3px 8px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.2;
    min-width: 32px;
    transition: all 0.15s;
    font-family: "Times New Roman", "Cambria Math", serif;
}
.sym-btn:hover {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

/* KaTeX 公式（编辑器内） */
.math-tex {
    display: inline-block;
    padding: 0 4px;
    background: #f5f7fa;
    border-radius: 3px;
    color: #666;
    font-family: "Times New Roman", serif;
    font-size: 0.95em;
}

/* ★ 编辑器粘性工具栏 */
.editor-sticky-tools {
    position: sticky;
    top: 62px;                /* 导航栏高度，可按需调整 */
    z-index: 40;
    background: #fff;
    padding: 8px 0 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Quill 工具栏粘在 sticky 区域下方，用 JS 动态调整 top */
.editor-sticky-tools + .ql-toolbar {
    position: sticky;
    z-index: 39;
    background: #fafafa;
    border-bottom: 1px solid #ccc;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* 防止 Quill 容器的 overflow 破坏 sticky */
.ql-container.ql-snow {
    overflow: visible;
}