/* ==========================================
   网课知识点系统 - 现代美学主题
   ========================================== */

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-start: #e8eaf0;
    --bg-mid:  #dfe0e7;
    --bg-end:  #ede4f2;
    --glass-bg: rgba(255, 255, 255, 0.68);
    --glass-bg-hover: rgba(255, 255, 255, 0.86);
    --glass-bg-light: rgba(255, 255, 255, 0.50);
    --glass-border: rgba(255, 255, 255, 0.70);
    --glass-border-subtle: rgba(0, 0, 0, 0.05);
    --glass-shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    --glass-shadow: 0 4px 24px rgba(0,0,0,0.05), 0 1px 4px rgba(0,0,0,0.04);
    --glass-shadow-lg: 0 12px 40px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    --glass-shadow-xl: 0 20px 60px rgba(0,0,0,0.10), 0 4px 16px rgba(0,0,0,0.05);
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-soft: rgba(59, 130, 246, 0.08);
    --accent-soft-hover: rgba(59, 130, 246, 0.14);
    --accent-glow: rgba(59, 130, 246, 0.25);
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #9ca3af;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-soft: rgba(239, 68, 68, 0.08);
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.08);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.08);
    --radius-lg: 20px;
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "PingFang SC", "Noto Sans CJK SC", sans-serif;
    --font-mono: "SF Mono", "Fira Code", "Consolas", "Menlo", "Courier New", monospace;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: linear-gradient(165deg, var(--bg-start) 0%, var(--bg-mid) 45%, var(--bg-end) 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.65;
    letter-spacing: -0.01em;
}

/* ---- 背景装饰 ---- */
.bg-layer {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.bg-layer::before {
    content: '';
    position: absolute;
    top: -8%;
    right: -5%;
    width: 55vw;
    height: 55vw;
    background: radial-gradient(circle at 40% 40%, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    animation: bgFloat1 20s ease-in-out infinite;
}
.bg-layer::after {
    content: '';
    position: absolute;
    bottom: -8%;
    left: -5%;
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle at 60% 60%, rgba(168, 85, 247, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    animation: bgFloat2 25s ease-in-out infinite;
}
@keyframes bgFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(3%, -2%) scale(1.03); }
    66% { transform: translate(-1%, 1%) scale(0.98); }
}
@keyframes bgFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-2%, -3%) scale(1.04); }
}

/* ---- Glass 基础 ---- */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
}
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    transition: all var(--transition);
}
.glass-card:hover {
    background: var(--glass-bg-hover);
    box-shadow: var(--glass-shadow-lg);
    transform: translateY(-2px);
}

/* ---- Navbar ---- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    isolation: isolate;
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
}
.nav-inner {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 32px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.01em;
    cursor: pointer;
    user-select: none;
}
.nav-brand svg { color: var(--accent); }
.nav-user {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-username {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    user-select: none;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
}
.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
    border-radius: 10px;
}
.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #3b82f6);
    color: #fff;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.35);
}
.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.45);
    transform: translateY(-1px);
    filter: brightness(1.05);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 6px rgba(59, 130, 246, 0.3);
}
.btn-outline {
    background: rgba(255,255,255,0.5);
    color: var(--text-primary);
    border: 1px solid rgba(0,0,0,0.08);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.85);
    border-color: var(--accent);
    color: var(--accent);
}
.btn-outline.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 2px 10px rgba(59,130,246,0.3);
}
.btn-full {
    width: 100%;
    padding: 13px;
    font-size: 15px;
    border-radius: 12px;
}
.btn-delete-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.btn-delete-icon:hover {
    background: var(--danger-soft);
    color: var(--danger);
}
.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-icon:hover {
    background: var(--accent-soft);
    color: var(--accent);
}
.btn-icon-danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

/* ---- Forms ---- */
.input-group { margin-bottom: 16px; }
.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}
.input-group input, .input-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    border: 1.5px solid rgba(0,0,0,0.10);
    border-radius: 12px;
    background: rgba(255,255,255,0.65);
    outline: none;
    transition: all var(--transition-fast);
    color: var(--text-primary);
}
.input-group input:focus, .input-group textarea:focus {
    border-color: var(--accent);
    background: rgba(255,255,255,0.95);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
}
.input-group input::placeholder, .input-group textarea::placeholder {
    color: var(--text-tertiary);
}
.input-main {
    flex: 2;
    padding: 11px 16px;
    font-size: 14px;
    font-family: inherit;
    border: 1.5px solid rgba(0,0,0,0.10);
    border-radius: 12px;
    background: rgba(255,255,255,0.55);
    outline: none;
    transition: all var(--transition-fast);
    color: var(--text-primary);
}
.input-sub {
    flex: 1.5;
    padding: 11px 16px;
    font-size: 14px;
    font-family: inherit;
    border: 1.5px solid rgba(0,0,0,0.10);
    border-radius: 12px;
    background: rgba(255,255,255,0.55);
    outline: none;
    transition: all var(--transition-fast);
    color: var(--text-primary);
}
.input-main:focus, .input-sub:focus, textarea:focus {
    border-color: var(--accent);
    background: rgba(255,255,255,0.92);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
}
.input-main::placeholder, .input-sub::placeholder, textarea::placeholder {
    color: var(--text-tertiary);
}
textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    border: 1.5px solid rgba(0,0,0,0.10);
    border-radius: 12px;
    background: rgba(255,255,255,0.55);
    outline: none;
    transition: all var(--transition-fast);
    color: var(--text-primary);
    resize: vertical;
    min-height: 60px;
}
.inline-form {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.inline-form textarea { flex: 1; }

/* ---- Flash Messages ---- */
.flash-container {
    position: fixed;
    top: 72px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
}
.flash-msg {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    animation: slideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--glass-shadow-lg);
}
.flash-success {
    color: #065f46;
    border-left: 3px solid var(--success);
    background: rgba(16, 185, 129, 0.08);
}
.flash-error {
    color: #991b1b;
    border-left: 3px solid var(--danger);
    background: rgba(239, 68, 68, 0.08);
}
.flash-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    line-height: 1;
    transition: opacity var(--transition-fast);
}
.flash-close:hover { opacity: 1; }
@keyframes slideIn {
    from { opacity: 0; transform: translateX(40px) scale(0.96); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ---- Main Content ---- */
.main-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 36px 32px 100px;
}

/* ---- Auth Pages ---- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 24px;
    gap: 0;
    position: relative;
    z-index: 1;
}
.auth-intro { display: none; position: relative; z-index: 1; }

/* 认证页光晕 */
.auth-glow { position: absolute; pointer-events: none; z-index: 0; border-radius: 50%; filter: blur(80px); opacity: 0.5; }
.auth-glow-left {
    top: 15%; right: 52%;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
    animation: authGlowFloat 8s ease-in-out infinite alternate;
}
.auth-glow-right {
    bottom: 12%; left: 52%;
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(59,130,246,0.12) 0%, transparent 70%);
    animation: authGlowFloat 10s ease-in-out infinite alternate-reverse;
}
@keyframes authGlowFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 20px) scale(1.12); }
}

/* 移动气泡背景 */
.auth-bubbles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.bubble {
    position: absolute;
    bottom: -140px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.06));
    animation: bubbleRise linear infinite;
}
.b1  { width: 70px; height: 70px; left: 5%;  animation-duration: 14s; animation-delay: 0s; }
.b2  { width: 45px; height: 45px; left: 15%; animation-duration: 18s; animation-delay: 2s; }
.b3  { width: 90px; height: 90px; left: 25%; animation-duration: 16s; animation-delay: 5s; }
.b4  { width: 38px; height: 38px; left: 38%; animation-duration: 20s; animation-delay: 1s; }
.b5  { width: 60px; height: 60px; left: 50%; animation-duration: 12s; animation-delay: 3s; }
.b6  { width: 50px; height: 50px; left: 62%; animation-duration: 22s; animation-delay: 7s; }
.b7  { width: 80px; height: 80px; left: 72%; animation-duration: 15s; animation-delay: 4s; }
.b8  { width: 34px; height: 34px; left: 82%; animation-duration: 19s; animation-delay: 6s; }
.b9  { width: 55px; height: 55px; left: 90%; animation-duration: 13s; animation-delay: 8s; }
.b10 { width: 72px; height: 72px; left: 45%; animation-duration: 17s; animation-delay: 9s; }
@keyframes bubbleRise {
    0%   { transform: translateY(0) scale(1); opacity: 0; }
    8%   { opacity: 0.85; }
    85%  { opacity: 0.45; }
    100% { transform: translateY(calc(-100vh - 240px)) scale(0.5) rotate(25deg); opacity: 0; }
}
@keyframes bubbleRiseWide {
    0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
    8%   { opacity: 0.75; }
    50%  { transform: translateY(-50vh) translateX(35px) scale(0.85); opacity: 0.45; }
    100% { transform: translateY(calc(-100vh - 240px)) translateX(-25px) scale(0.4) rotate(-18deg); opacity: 0; }
}
.b1, .b4, .b7, .b10 { animation-name: bubbleRiseWide; }

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 52px 40px 40px;
    text-align: center;
}
.auth-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(99,102,241,0.10), rgba(168,85,247,0.08));
    color: var(--accent);
    margin-bottom: 24px;
}
.auth-title {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}
.auth-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 36px;
}
.auth-form { text-align: left; }
.auth-footer {
    margin-top: 28px;
    font-size: 14px;
    color: var(--text-secondary);
}
.auth-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: opacity var(--transition-fast);
}
.auth-footer a:hover { opacity: 0.8; }

/* 系统介绍——桌面端双栏布局 */
@media (min-width: 900px) {
    .auth-page { gap: 72px; padding: 40px; }
    .auth-intro {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        max-width: 420px;
        text-align: left;
    }
    .auth-intro .auth-icon {
        width: 68px; height: 68px;
        border-radius: 20px;
        margin-bottom: 28px;
    }
}
.auth-intro-title {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #4f46e5, #3b82f6, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.auth-intro-desc {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.55;
}
.auth-features {
    display: flex;
    flex-direction: column;
    gap: 22px;
    width: 100%;
}
.auth-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    color: var(--text-primary);
}
.auth-feature-item svg { flex-shrink: 0; margin-top: 2px; color: var(--accent); }
.auth-feature-item strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
}
.auth-feature-item p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.45;
}

/* ---- Dashboard ---- */
.page-header { margin-bottom: 32px; }
.page-header h1 {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}
.page-desc { font-size: 15px; color: var(--text-secondary); }

/* ---- Create Card ---- */
.create-card { padding: 24px 28px; margin-bottom: 24px; }
.create-card.compact { padding: 18px 24px; }
.create-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.create-card-header .card-label { margin: 0; }
.editor-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    flex-shrink: 0;
}

/* 编辑器模式大文本区 */
.editor-mode-area { animation: fadeIn 0.25s ease; }

/* 分屏布局 */
.editor-split-pane {
    display: flex;
    gap: 16px;
    height: 380px;
    min-height: 200px;
    max-height: 800px;
    resize: vertical;
    overflow: hidden;
    position: relative;
}
.editor-split-pane::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    border-radius: 2px;
    background: rgba(0,0,0,0.10);
    pointer-events: none;
}
.editor-pane { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100%; }
.editor-pane-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
}
.editor-pane-input textarea {
    width: 100%;
    flex: 1;
    padding: 16px 18px;
    font-size: 14px;
    font-family: var(--font-mono);
    line-height: 1.8;
    border: 1.5px solid rgba(0,0,0,0.12);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.82);
    outline: none;
    resize: none;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.editor-pane-input textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(59,130,246,0.08);
}
.editor-pane-preview {
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.65);
    overflow-y: auto;
    height: 100%;
}
.editor-preview-content {
    flex: 1;
    padding: 16px 20px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
}
.editor-mode-area textarea {
    width: 100%;
    padding: 16px 18px;
    font-size: 14px;
    font-family: var(--font-mono);
    line-height: 1.8;
    border: 1.5px solid rgba(0,0,0,0.12);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.82);
    outline: none;
    resize: vertical;
    min-height: 320px;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.editor-mode-area textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(59,130,246,0.08);
}
.editor-mode-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

/* ===== 全屏编辑器 ===== */
.full-editor-area { animation: fadeIn 0.25s ease; margin-top: 24px; }
.full-editor-split-pane {
    display: flex;
    gap: 0;
    height: calc(100vh - 280px);
    min-height: 400px;
    max-height: 1000px;
    overflow: hidden;
    position: relative;
}
.full-editor-split-pane .editor-pane-input { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.full-editor-split-pane .editor-pane-preview { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.full-editor-divider {
    width: 12px;
    cursor: col-resize;
    flex-shrink: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.2s;
    z-index: 2;
}
.full-editor-divider::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    left: 5px;
    width: 2px;
    background: rgba(0,0,0,0.07);
    border-radius: 1px;
    transition: background 0.2s, width 0.2s;
}
.full-editor-divider:hover::before,
.full-editor-divider.active::before {
    background: var(--accent);
    width: 3px;
}
.divider-grip {
    width: 4px;
    height: 40px;
    border-radius: 2px;
    background: rgba(0,0,0,0.10);
    flex-shrink: 0;
    transition: background 0.2s;
}
.full-editor-divider:hover .divider-grip,
.full-editor-divider.active .divider-grip { background: var(--accent); }
#full-editor-codemirror {
    flex: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.12);
}
#full-editor-codemirror .CodeMirror {
    height: 100%;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.7;
}
#full-editor-codemirror .CodeMirror-gutters {
    border-right: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.2);
}
#full-editor-codemirror .CodeMirror-linenumber {
    color: rgba(255,255,255,0.3);
    padding: 0 10px 0 5px;
}
.full-editor-area.light-theme #full-editor-codemirror { border-color: rgba(0,0,0,0.14); }
.full-editor-area.light-theme #full-editor-codemirror .CodeMirror { background: #fafbfc; color: #333; }
.full-editor-area.light-theme #full-editor-codemirror .CodeMirror-gutters { background: #f0f0f5; border-right: 1px solid #e0e0e8; }
.full-editor-area.light-theme #full-editor-codemirror .CodeMirror-linenumber { color: #999; }
.full-editor-area.light-theme #full-editor-codemirror .CodeMirror-activeline-background { background: rgba(59,130,246,0.06); }
.full-editor-area.light-theme #full-editor-codemirror .CodeMirror-selected { background: rgba(59,130,246,0.18); }
.full-editor-area.light-theme #full-editor-codemirror .CodeMirror-cursor { border-left-color: #333; }
.full-editor-point-block {
    padding: 22px 0;
    border-bottom: 2px dashed rgba(0,0,0,0.08);
}
.full-editor-point-block:last-child { border-bottom: none; }
.full-editor-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.full-editor-status { font-size: 13px; color: var(--text-secondary); margin-left: auto; }

/* 沉浸式全屏模式 */
.full-editor-area.immersive {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    margin: 0;
    padding: 28px 36px;
    background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 100%);
    display: flex;
    flex-direction: column;
    animation: immersiveIn 0.3s ease;
}
@keyframes immersiveIn {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
}
.full-editor-area.immersive .full-editor-split-pane { flex: 1; height: auto; min-height: 0; max-height: none; }
.full-editor-area.immersive .editor-pane-label { color: rgba(255,255,255,0.55); }
.full-editor-area.immersive .full-editor-actions { margin-top: 16px; padding-bottom: 0; }
.full-editor-area.immersive .editor-preview-content { background: #fff; color: var(--text-primary); border-radius: var(--radius-sm); }
#full-editor-fullscreen-btn { font-size: 13px; }
.full-editor-area.immersive #full-editor-fullscreen-btn { opacity: 0.7; }

/* ---- Search Bar ---- */
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    margin-bottom: 18px;
    border-radius: 16px;
    position: relative;
}
.search-icon { color: var(--text-tertiary); flex-shrink: 0; }
.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    padding: 4px 0;
}
.search-input::placeholder { color: var(--text-tertiary); }
.search-count {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
    min-width: 70px;
    text-align: right;
}
.search-nav-btn { flex-shrink: 0; }
.search-nav-btn:disabled { opacity: 0.25; cursor: default; pointer-events: none; }

/* 搜索高亮 */
.search-highlight {
    background: rgba(250, 204, 21, 0.45);
    padding: 1px 3px;
    border-radius: 3px;
    color: inherit;
}
.search-current {
    background: rgba(249, 115, 22, 0.55);
    padding: 1px 3px;
    border-radius: 3px;
    color: inherit;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

/* 搜索结果下拉面板 */
.search-results-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0; right: 0;
    max-height: 400px;
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 50;
    box-shadow: 0 16px 48px rgba(0,0,0,0.12);
    border-radius: var(--radius);
}
.search-result-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}
.search-result-item:hover { background: var(--accent-soft); }
.search-result-item[data-type="point"] { cursor: pointer; }
.sr-type {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sr-text { font-size: 14px; line-height: 1.55; }
.sr-breadcrumb { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }
.search-no-result { padding: 24px; text-align: center; font-size: 14px; color: var(--text-tertiary); }
.card-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: -0.01em;
    margin-bottom: 14px;
}
.md-hint {
    display: inline-block;
    font-size: 11px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-tertiary);
    background: rgba(0,0,0,0.03);
    padding: 3px 10px;
    border-radius: 10px;
    margin-left: 10px;
    vertical-align: middle;
}

/* ---- Course Grid ---- */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 18px;
}
.course-card {
    display: flex;
    align-items: center;
    padding: 24px 28px;
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
}
.course-card-body { flex: 1; min-width: 0; }
.course-card-body h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}
.course-card-body p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.course-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-tertiary);
}
.course-delete-form { position: absolute; top: 14px; right: 14px; }

/* ---- Breadcrumb ---- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}
.breadcrumb a:hover { opacity: 0.8; }
.breadcrumb .current { color: var(--text-primary); font-weight: 600; }

/* ---- Chapter List ---- */
.chapter-list { display: flex; flex-direction: column; gap: 16px; }
.chapter-block { padding: 22px 28px; }
.chapter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 12px;
}
.chapter-collapse-btn {
    flex-shrink: 0;
    width: 30px; height: 30px;
    border: 1.5px solid rgba(0,0,0,0.08);
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}
.chapter-collapse-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.chapter-collapse-btn svg { transition: transform 0.25s ease; }
.chapter-block.collapsed .chapter-collapse-btn svg { transform: rotate(-90deg); }
.chapter-block.collapsed .chapter-body { display: none; }
.chapter-block.collapsed .chapter-header { margin-bottom: 0; }
.chapter-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.chapter-title-area { display: flex; align-items: baseline; gap: 12px; }
.chapter-name { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.chapter-count { font-size: 13px; color: var(--text-tertiary); font-weight: 500; }

/* ---- Section List ---- */
.section-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; padding-left: 8px; }
.section-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.section-item:hover { background: rgba(59,130,246,0.04); }
.section-link {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 15px;
}
.section-link svg { color: var(--text-tertiary); flex-shrink: 0; }
.section-point-count {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-left: auto;
    padding: 3px 12px;
    background: rgba(59,130,246,0.06);
    border-radius: 10px;
    font-weight: 500;
}
.add-section-form { display: flex; gap: 10px; padding-left: 22px; }
.add-section-form input {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    border: 2px dashed rgba(0,0,0,0.12);
    border-radius: var(--radius-sm);
    background: transparent;
    outline: none;
    transition: all var(--transition-fast);
    color: var(--text-primary);
}
.add-section-form input:focus {
    border-color: var(--accent);
    border-style: solid;
    background: rgba(255,255,255,0.7);
    box-shadow: 0 0 0 4px rgba(59,130,246,0.06);
}

/* ---- Points List ---- */
.points-list { display: flex; flex-direction: column; gap: 12px; }
.point-card { display: flex; gap: 18px; padding: 20px 24px; align-items: flex-start; }
.point-index {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(59,130,246,0.10));
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}
.point-content-area { flex: 1; min-width: 0; }
.point-text { font-size: 15px; line-height: 1.75; color: var(--text-primary); word-break: break-word; }

/* ---- Markdown 渲染样式 ---- */
.md-body h1 { font-size: 1.6em; font-weight: 700; margin: 0.8em 0 0.4em; color: var(--text-primary); }
.md-body h2 { font-size: 1.35em; font-weight: 700; margin: 0.7em 0 0.35em; color: var(--text-primary); }
.md-body h3 { font-size: 1.15em; font-weight: 600; margin: 0.6em 0 0.3em; color: var(--text-primary); }
.md-body h4 { font-size: 1.05em; font-weight: 600; margin: 0.5em 0 0.25em; }
.md-body h5, .md-body h6 { font-size: 1em; font-weight: 600; margin: 0.4em 0 0.2em; color: var(--text-secondary); }

/* 荧光笔标题 */
.md-body .heading-highlight,
.md-body .hl-inline {
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}
.md-body h1 .heading-highlight { background: linear-gradient(180deg, transparent 58%, rgba(255,214,0,0.5) 58%); padding: 0 5px; }
.md-body h2 .heading-highlight { background: linear-gradient(180deg, transparent 60%, rgba(6,182,212,0.35) 60%); padding: 0 4px; }
.md-body h3 .heading-highlight { background: linear-gradient(180deg, transparent 62%, rgba(251,146,60,0.40) 62%); padding: 0 3px; }
.md-body h4 .heading-highlight { background: linear-gradient(180deg, transparent 63%, rgba(168,85,247,0.30) 63%); padding: 0 3px; }
.md-body h5 .heading-highlight { background: linear-gradient(180deg, transparent 64%, rgba(249,115,22,0.30) 64%); padding: 0 3px; }
.md-body h6 .heading-highlight { background: linear-gradient(180deg, transparent 65%, rgba(142,142,147,0.30) 65%); padding: 0 3px; }
.md-body .heading-highlight[style*="--hl"],
.md-body .hl-inline[style*="--hl"] {
    background: linear-gradient(180deg, transparent 60%, var(--hl) 60%) !important;
}
.md-body .hl-inline {
    background: linear-gradient(180deg, transparent 58%, rgba(255,214,0,0.5) 58%);
    padding: 0 3px;
}
.md-body.heading-highlight h1 { background: linear-gradient(180deg, transparent 58%, rgba(255,214,0,0.5) 58%); display: inline; -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 5px; }
.md-body.heading-highlight h2 { background: linear-gradient(180deg, transparent 60%, rgba(6,182,212,0.35) 60%); display: inline; -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 4px; }
.md-body.heading-highlight h3 { background: linear-gradient(180deg, transparent 62%, rgba(251,146,60,0.40) 62%); display: inline; -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 3px; }
.md-body.heading-highlight h4 { background: linear-gradient(180deg, transparent 63%, rgba(168,85,247,0.30) 63%); display: inline; -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 3px; }
.md-body.heading-highlight h5 { background: linear-gradient(180deg, transparent 64%, rgba(249,115,22,0.30) 64%); display: inline; -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 3px; }
.md-body.heading-highlight h6 { background: linear-gradient(180deg, transparent 65%, rgba(142,142,147,0.30) 65%); display: inline; -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 3px; }

.md-body p { margin: 0.5em 0; }
.md-body p:first-child { margin-top: 0; }
.md-body p:last-child { margin-bottom: 0; }
.md-body strong { font-weight: 700; color: #0f172a; }
.md-body em { font-style: italic; }
.md-body del { text-decoration: line-through; opacity: 0.55; }
.md-body mark,
.md-body .highlight {
    background: linear-gradient(180deg, transparent 50%, rgba(250,204,21,0.45) 50%);
    padding: 0 3px;
    border-radius: 3px;
}
.md-body code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: rgba(0,0,0,0.04);
    padding: 2px 7px;
    border-radius: 5px;
    color: #be185d;
}
.md-body pre {
    background: rgba(15,23,42,0.04);
    border: 1.5px solid rgba(0,0,0,0.07);
    border-radius: 12px;
    padding: 16px 18px;
    margin: 12px 0;
    overflow-x: auto;
    line-height: 1.6;
}
.md-body pre code { background: none; padding: 0; font-size: 0.86em; color: var(--text-primary); border-radius: 0; }
.md-body blockquote {
    margin: 12px 0;
    padding: 12px 18px;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 10px 10px 0;
    color: var(--text-secondary);
}
.md-body blockquote p { margin: 0; }
.md-body ul, .md-body ol { margin: 10px 0; padding-left: 26px; }
.md-body li { margin: 4px 0; }
.md-body ul li::marker { color: var(--accent); }
.md-body ol li::marker { color: var(--text-secondary); font-weight: 600; }
.md-body a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(59,130,246,0.25); transition: border-color var(--transition-fast); }
.md-body a:hover { border-bottom-color: var(--accent); }
.md-body hr {
    border: none;
    height: 2px;
    background: repeating-linear-gradient(90deg, var(--accent) 0px, var(--accent) 6px, transparent 6px, transparent 14px);
    margin: 30px 0;
    opacity: 0.25;
    border-radius: 1px;
}
.md-body img { max-width: 100%; border-radius: 12px; margin: 10px 0; }
.md-body table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.95em; border-radius: 10px; overflow: hidden; }
.md-body th, .md-body td { border: 1px solid rgba(0,0,0,0.08); padding: 10px 14px; text-align: left; }
.md-body th { background: rgba(0,0,0,0.03); font-weight: 600; }
.md-body tr:nth-child(even) { background: rgba(0,0,0,0.012); }
.md-body input[type="checkbox"] { margin-right: 6px; accent-color: var(--accent); }
.md-body sup a { font-size: 0.8em; border-bottom: none; }
.md-body abbr { text-decoration: underline dotted; cursor: help; }

/* 自定义容器 */
.md-body .note, .md-body .tip, .md-body .warning, .md-body .danger {
    padding: 14px 18px;
    border-radius: 12px;
    margin: 12px 0;
    font-size: 0.95em;
}
.md-body .note { background: rgba(59,130,246,0.06); border-left: 3px solid var(--accent); }
.md-body .tip { background: rgba(16,185,129,0.06); border-left: 3px solid var(--success); }
.md-body .warning { background: rgba(245,158,11,0.06); border-left: 3px solid var(--warning); }
.md-body .danger { background: rgba(239,68,68,0.06); border-left: 3px solid var(--danger); }

/* LaTeX */
.md-body .katex, .md-body .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.katex-display { text-align: left !important; margin: 14px 0 !important; }

/* ========== 仿真便利贴 ========== */
.sticky-note {
    position: relative;
    --sticky-bg: #fef9c3;
    --sticky-bg-mid: #fef08a;
    --sticky-bg-end: #fde047;
    --sticky-text: #5c4a1e;
    background: linear-gradient(140deg, var(--sticky-bg) 0%, var(--sticky-bg-mid) 45%, var(--sticky-bg-end) 100%);
    box-shadow: 2px 4px 14px rgba(0,0,0,0.10), 1px 1px 4px rgba(0,0,0,0.06);
    padding: 18px 22px 22px 22px;
    margin: 16px 4px 20px 4px;
    transform: rotate(-0.6deg);
    transition: transform 0.25s, box-shadow 0.25s;
    border-radius: 2px 2px 8px 2px;
}
.sticky-note::before {
    content: ''; position: absolute; top: -7px; left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    width: 44px; height: 14px;
    background: rgba(255,255,255,0.55);
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.sticky-note::after {
    content: ''; position: absolute; bottom: 3px; right: 8px;
    width: 34px; height: 9px;
    background: rgba(0,0,0,0.03);
    border-radius: 2px;
    transform: rotate(-3deg);
}
.sticky-note:hover {
    transform: rotate(0deg) translateY(-3px);
    box-shadow: 4px 8px 22px rgba(0,0,0,0.14), 2px 2px 8px rgba(0,0,0,0.08);
}
.sticky-note-inner { font-size: 14px; line-height: 1.75; color: var(--sticky-text, #5c4a1e); }
.sticky-note-inner p { margin: 5px 0; }
.sticky-note-inner p:first-child { margin-top: 0; }
.sticky-note-inner p:last-child { margin-bottom: 0; }
.sticky-note-inner code { background: rgba(0,0,0,0.06) !important; color: var(--sticky-text, #5c4a1e) !important; }
.sticky-note-inner .katex-display { text-align: left !important; margin-left: 0 !important; }
.sticky-note-inner .katex-display > .katex { text-align: left !important; }
.sticky-note.sticky-small  { max-width: 320px; }
.sticky-note.sticky-medium { max-width: 500px; }
.sticky-note.sticky-large  { max-width: 700px; }
.sticky-note.sticky-full   { max-width: 100%; }
.sticky-note.sticky-yellow  { --sticky-bg:#fef9c3; --sticky-bg-mid:#fef08a; --sticky-bg-end:#fde047; --sticky-text:#5c4a1e; }
.sticky-note.sticky-pink    { --sticky-bg:#fce4ec; --sticky-bg-mid:#f8bbd0; --sticky-bg-end:#f48fb1; --sticky-text:#6d1a3a; }
.sticky-note.sticky-blue    { --sticky-bg:#e3f2fd; --sticky-bg-mid:#90caf9; --sticky-bg-end:#64b5f6; --sticky-text:#1a3a5c; }
.sticky-note.sticky-green   { --sticky-bg:#e8f5e9; --sticky-bg-mid:#a5d6a7; --sticky-bg-end:#81c784; --sticky-text:#1a4d2e; }
.sticky-note.sticky-purple  { --sticky-bg:#f3e5f5; --sticky-bg-mid:#ce93d8; --sticky-bg-end:#ba68c8; --sticky-text:#3d1a5c; }
.sticky-note.sticky-orange  { --sticky-bg:#fff3e0; --sticky-bg-mid:#ffcc80; --sticky-bg-end:#ffa726; --sticky-text:#5c3a1a; }
.sticky-note.sticky-mint    { --sticky-bg:#e0f7f0; --sticky-bg-mid:#80cbc4; --sticky-bg-end:#4db6ac; --sticky-text:#1a3d38; }
.sticky-note.sticky-lavender{ --sticky-bg:#f5f0ff; --sticky-bg-mid:#b39ddb; --sticky-bg-end:#9575cd; --sticky-text:#2d1a4d; }
.sticky-note.sticky-coral   { --sticky-bg:#fde8e4; --sticky-bg-mid:#f4a89a; --sticky-bg-end:#ef8573; --sticky-text:#5c1a10; }
.sticky-note.sticky-sky     { --sticky-bg:#e0f0fd; --sticky-bg-mid:#81d4fa; --sticky-bg-end:#4fc3f7; --sticky-text:#1a3d5c; }
.sticky-note.sticky-lime    { --sticky-bg:#f0f7e0; --sticky-bg-mid:#c5e1a5; --sticky-bg-end:#aed581; --sticky-text:#3d4d1a; }
.sticky-note.sticky-rose    { --sticky-bg:#fde4ed; --sticky-bg-mid:#f8a5c2; --sticky-bg-end:#f06292; --sticky-text:#5c1a30; }
.sticky-note.sticky-custom  { --sticky-bg:var(--sticky-c); --sticky-bg-mid:color-mix(in srgb,var(--sticky-c) 80%,#fff); --sticky-bg-end:color-mix(in srgb,var(--sticky-c) 60%,#fff); --sticky-text:color-mix(in srgb,var(--sticky-c) 30%,#222); }

/* ========== 知识点框 ========== */
.knowledge-box {
    position: relative;
    --kb-color: var(--accent);
    border: 2.5px solid var(--kb-color, var(--accent));
    border-radius: 10px;
    margin: 24px 0 20px 0;
    padding: 20px 24px 18px;
    background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
    transition: box-shadow 0.25s;
}
.knowledge-box:hover { box-shadow: 0 3px 16px rgba(59,130,246,0.12); }
.knowledge-box-title {
    position: absolute;
    top: -13px; left: 20px;
    background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
    padding: 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--kb-color, var(--accent));
    letter-spacing: 0.3px;
    white-space: nowrap;
    line-height: 1.6;
}
.knowledge-box-body { font-size: 14px; line-height: 1.8; color: #1e293b; }
.knowledge-box-body p { margin: 5px 0; }
.knowledge-box-body p:first-child { margin-top: 0; }
.knowledge-box-body p:last-child { margin-bottom: 0; }
.knowledge-box-body code { background: rgba(59,130,246,0.06); color: #2563eb; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.knowledge-box-body .katex-display { text-align: left !important; margin-left: 0 !important; }
.knowledge-box-body .katex-display > .katex { text-align: left !important; }

/* ========== 标注块 callout ========== */
.callout {
    position: relative;
    margin: 20px 0;
    border-radius: 14px;
    padding: 18px 20px 16px 50px;
    border: 1.5px solid rgba(0,0,0,0.04);
}
.callout::before { position: absolute; left: 16px; top: 18px; font-size: 20px; line-height: 1; }
.callout-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; letter-spacing: 0.2px; }
.callout-body { font-size: 14px; line-height: 1.8; color: #334155; }
.callout-body p { margin: 5px 0; }
.callout-body p:first-child { margin-top: 0; }
.callout-body p:last-child { margin-bottom: 0; }
.callout-body code { padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.callout-keypoint { background: linear-gradient(135deg, #fffbeb, #fef3c7); }
.callout-keypoint::before { content: "🔑"; }
.callout-keypoint .callout-title { color: #b45309; }
.callout-keypoint .callout-body code { background: rgba(245,158,11,0.10); color: #b45309; }
.callout-mistake { background: linear-gradient(135deg, #fff5f5, #fee2e2); }
.callout-mistake::before { content: "❌"; }
.callout-mistake .callout-title { color: #b91c1c; }
.callout-mistake .callout-body code { background: rgba(239,68,68,0.10); color: #b91c1c; }
.callout-note { background: linear-gradient(135deg, #f5f9ff, #dbeafe); }
.callout-note::before { content: "📝"; }
.callout-note .callout-title { color: #1d4ed8; }
.callout-note .callout-body code { background: rgba(59,130,246,0.10); color: #1d4ed8; }
.callout-tip { background: linear-gradient(135deg, #f5fdf9, #d1fae5); }
.callout-tip::before { content: "💡"; }
.callout-tip .callout-title { color: #047857; }
.callout-tip .callout-body code { background: rgba(16,185,129,0.10); color: #047857; }
.callout-summary { background: linear-gradient(135deg, #faf8ff, #e9d5ff); }
.callout-summary::before { content: "📋"; }
.callout-summary .callout-title { color: #6d28d9; }
.callout-summary .callout-body code { background: rgba(139,92,246,0.10); color: #6d28d9; }
.callout-think { background: linear-gradient(135deg, #f5fdfc, #ccfbf1); }
.callout-think::before { content: "🤔"; }
.callout-think .callout-title { color: #0f766e; }
.callout-think .callout-body code { background: rgba(20,184,166,0.10); color: #0f766e; }
.callout-warning { background: linear-gradient(135deg, #fffaf5, #ffedd5); }
.callout-warning::before { content: "⚠️"; }
.callout-warning .callout-title { color: #c2410c; }
.callout-warning .callout-body code { background: rgba(249,115,22,0.10); color: #c2410c; }

/* 高亮标记 */
.md-body mark { background: rgba(250,204,21,0.35); padding: 1px 4px; border-radius: 3px; color: inherit; }
.md-body sub { font-size: 0.8em; vertical-align: sub; }
.md-body sup { font-size: 0.8em; vertical-align: super; }
.md-body dl { margin: 10px 0; }
.md-body dt { font-weight: 600; margin-top: 10px; }
.md-body dd { margin-left: 22px; color: var(--text-secondary); }

/* 知识点编辑区 */
.point-edit-area textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.75;
    border: 1.5px solid rgba(0,0,0,0.14);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.78);
    outline: none;
    resize: vertical;
    min-height: 60px;
    color: var(--text-primary);
}
.point-edit-area textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(59,130,246,0.08);
}
.point-edit-split-pane {
    display: flex;
    gap: 14px;
    height: 260px;
    min-height: 140px;
    max-height: 640px;
    resize: vertical;
    overflow: hidden;
    position: relative;
}
.point-edit-split-pane::after {
    content: ''; position: absolute; bottom: 3px; left: 50%;
    transform: translateX(-50%);
    width: 30px; height: 3px;
    border-radius: 2px;
    background: rgba(0,0,0,0.08);
    pointer-events: none;
}
.point-edit-input-pane { flex: 1; min-width: 0; height: 100%; }
.point-edit-input-pane textarea {
    width: 100%; height: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-family: var(--font-mono);
    line-height: 1.75;
    border: 1.5px solid rgba(0,0,0,0.14);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.78);
    outline: none;
    resize: none;
    color: var(--text-primary);
}
.point-edit-input-pane textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(59,130,246,0.08);
}
.point-edit-preview-pane {
    flex: 1; min-width: 0; height: 100%;
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.55);
    overflow-y: auto;
}
.point-edit-preview-content { padding: 12px 18px; font-size: 14px; line-height: 1.8; color: var(--text-primary); }
.point-edit-actions { display: flex; gap: 8px; margin-top: 10px; }
.point-actions {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.point-card:hover .point-actions { opacity: 1; }

/* ---- Empty State ---- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 48px;
    text-align: center;
    color: var(--text-tertiary);
    gap: 12px;
}
.empty-state svg { opacity: 0.3; }
.empty-state p { font-size: 17px; font-weight: 500; color: var(--text-secondary); }
.empty-state span { font-size: 14px; }

/* ---- 3D卡片模式 ---- */
.page-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.mode-toggle-group { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.mode-toggle-btn { display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; font-weight: 500; transition: all 0.25s ease; }
.mode-toggle-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 10px rgba(59,130,246,0.3); }

/* 点读高亮 */
.tts-speaking { position: relative; outline: none; border-radius: 10px; transition: box-shadow 0.3s ease; }
.tts-enabled { cursor: pointer; }

.card3d-view { position: relative; padding: 0 0 40px; animation: fadeIn 0.4s ease; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
.card3d-progress {
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 36px;
    font-variant-numeric: tabular-nums;
}
.card3d-sep { color: var(--text-tertiary); font-weight: 300; margin: 0 6px; }
#card3d-current { color: var(--accent); font-size: 38px; }
.card3d-stage-wrap { position: relative; }
.card3d-stage {
    position: relative;
    width: 100%;
    height: 540px;
    perspective: 1300px;
    perspective-origin: 50% 50%;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.card3d-card {
    position: absolute;
    top: 0; left: 50%;
    width: min(660px, 100%);
    height: 100%;
    padding: 36px 40px;
    overflow-y: auto;
    transform-origin: center center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}
.card3d-card.active {
    transform: translateX(-50%) translateZ(0) rotateY(0deg) scale(1);
    z-index: 10; opacity: 1;
    box-shadow: 0 24px 64px rgba(0,0,0,0.10), 0 4px 14px rgba(0,0,0,0.05);
    background: rgba(255,255,255,0.80);
}
.card3d-card.prev {
    transform: translateX(calc(-50% - 290px)) translateZ(-140px) rotateY(20deg) scale(0.86);
    z-index: 5; opacity: 0.50; filter: blur(1px); pointer-events: none;
}
.card3d-card.next {
    transform: translateX(calc(-50% + 290px)) translateZ(-140px) rotateY(-20deg) scale(0.86);
    z-index: 5; opacity: 0.50; filter: blur(1px); pointer-events: none;
}
.card3d-card.prev2 {
    transform: translateX(calc(-50% - 380px)) translateZ(-260px) rotateY(32deg) scale(0.68);
    z-index: 3; opacity: 0.20; filter: blur(3px); pointer-events: none;
}
.card3d-card.next2 {
    transform: translateX(calc(-50% + 380px)) translateZ(-260px) rotateY(-32deg) scale(0.68);
    z-index: 3; opacity: 0.20; filter: blur(3px); pointer-events: none;
}
.card3d-card.hidden { opacity: 0; pointer-events: none; z-index: 0; transform: translateX(-50%) translateZ(-420px) scale(0.45); }
.card3d-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 18px;
}
.card3d-content { font-size: 15px; line-height: 1.8; color: var(--text-primary); }

/* 3D导航按钮 */
.card3d-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px; height: 50px;
    border-radius: 50%;
    border: 1.5px solid rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    z-index: 20;
    transition: all 0.25s ease;
    box-shadow: 0 4px 18px rgba(0,0,0,0.06);
}
.card3d-nav:hover {
    background: rgba(255,255,255,0.95);
    color: var(--accent);
    box-shadow: 0 6px 24px rgba(0,0,0,0.10);
    transform: translateY(-50%) scale(1.08);
}
.card3d-nav:active { transform: translateY(-50%) scale(0.95); }
.card3d-prev { left: -8px; }
.card3d-next { right: -8px; }

/* 底部圆点 */
.card3d-dots { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 32px; }
.card3d-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.12);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}
.card3d-dot:hover { background: rgba(0,0,0,0.25); }
.card3d-dot.active {
    width: 28px;
    border-radius: 5px;
    background: var(--accent);
}
.card3d-hint { text-align: center; margin-top: 24px; font-size: 12px; color: var(--text-tertiary); opacity: 0.65; }

/* ========== A4 预览模式 ========== */
.preview-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeIn 0.25s ease;
}
.preview-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15,23,42,0.40);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.preview-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 880px;
    margin: 0 auto;
    width: 100%;
    min-height: 0;
}
/* 预览工具栏 */
.preview-toolbar {
    position: relative;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    gap: 12px;
    flex-wrap: wrap;
}
.preview-toolbar-left, .preview-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.preview-tb-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 12px;
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    color: #1d1d1f;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    font-family: inherit;
}
.preview-tb-btn:hover {
    background: rgba(255,255,255,0.95);
    box-shadow: 0 6px 22px rgba(0,0,0,0.10);
    transform: translateY(-1px);
}
.preview-tb-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.preview-tb-btn.close-btn:hover { background: rgba(239,68,68,0.10); color: var(--danger); border-color: rgba(239,68,68,0.20); }

/* 预览浮动按钮 */
.preview-float-left {
    position: absolute;
    z-index: 1100;
    top: 24px; left: 24px;
}
.preview-float-right {
    position: absolute;
    z-index: 1100;
    top: 24px; right: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.preview-float-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border: 1px solid rgba(255,255,255,0.30);
    border-radius: 14px;
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    color: #1d1d1f;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    box-shadow: 0 4px 18px rgba(0,0,0,0.07);
    font-family: inherit;
}
.preview-float-btn:hover {
    background: rgba(255,255,255,0.95);
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}
.preview-float-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.preview-float-close { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 50%; }
.preview-float-close:hover { background: rgba(239,68,68,0.10); color: var(--danger); border-color: rgba(239,68,68,0.25); }

/* 滚动区域 */
.preview-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 36px 0 64px; scroll-behavior: smooth; }
.preview-point, .preview-section, .preview-chapter { scroll-margin-top: 24px; }

/* 挖空模式 */
.hide-underlines u {
    color: transparent !important;
    text-decoration-color: var(--accent) !important;
    cursor: pointer;
    transition: color 0.15s ease;
}
.hide-underlines u:hover { color: inherit !important; }

/* A4 纸张 */
.preview-page {
    width: 210mm;
    min-height: 297mm;
    background: #fff;
    box-shadow: 0 8px 48px rgba(0,0,0,0.14), 0 2px 10px rgba(0,0,0,0.06);
    border-radius: 4px;
    padding: 25mm 20mm;
    color: #1d1d1f;
    line-height: 1.85;
    font-size: 14px;
    margin: 0 auto;
    box-sizing: border-box;
}
.preview-page-header { margin-bottom: 32px; padding-bottom: 18px; border-bottom: 2.5px solid #1d1d1f; }
.preview-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px; }
.preview-subtitle { font-size: 13px; color: #6e6e73; margin: 0; }
.preview-points { display: flex; flex-direction: column; gap: 16px; }
.preview-toc { margin: 22px 0 34px; padding: 18px 24px; background: #f5f5f7; border-radius: 12px; }
.toc-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; color: #1d1d1f; }
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list .toc-list { padding-left: 18px; }
.toc-item { margin-bottom: 6px; font-size: 13px; line-height: 1.65; }
.toc-item a { color: var(--accent); text-decoration: none; transition: opacity var(--transition-fast); }
.toc-item a:hover { opacity: 0.75; }
.toc-section-title { font-weight: 600; color: #333; margin: 8px 0 3px; font-size: 13px; }
.toc-chapter-title { font-weight: 700; color: #1d1d1f; margin: 12px 0 5px; font-size: 14px; }
.preview-point { display: flex; gap: 12px; }
.preview-point-content { flex: 1; }
.preview-point-content.md-body h1 { font-size: 1.45em; }
.preview-point-content.md-body h2 { font-size: 1.2em; }
.preview-point-content.md-body h3 { font-size: 1.05em; }
.preview-point-content.md-body p { margin: 0.4em 0; }
.preview-point-content.md-body pre { background: #f5f5f7; }
.preview-point-content.md-body pre code { background: none; }
.preview-chapter-header { font-size: 20px; font-weight: 700; margin: 36px 0 18px; padding-bottom: 10px; border-bottom: 1px solid #d2d2d7; color: #1d1d1f; }
.preview-section-header { font-size: 16px; font-weight: 600; margin: 22px 0 12px; color: #333; }

/* 打印 */
@media print {
    .preview-backdrop, .preview-float-left, .preview-float-right,
    nav, .breadcrumb, .page-header, footer { display: none !important; }
    .preview-overlay { position: static !important; animation: none !important; }
    .preview-container { max-width: none !important; margin: 0 !important; }
    .preview-scroll { overflow: visible !important; padding: 0 !important; }
    .preview-page { width: 100% !important; min-height: auto !important; box-shadow: none !important; border-radius: 0 !important; padding: 0 !important; }
    body { overflow: visible !important; }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .main-content { padding: 20px 14px 64px; }
    .inline-form { flex-direction: column; }
    .course-grid { grid-template-columns: 1fr; }
    .page-header h1 { font-size: 26px; }
    .page-header-row { flex-direction: column; align-items: flex-start; gap: 14px; }
    .nav-inner { padding: 0 14px; }
    .nav-brand { font-size: 15px; }
    .nav-username { display: none; }
    .breadcrumb { font-size: 12px; flex-wrap: wrap; }
    .search-bar { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
    .search-input { font-size: 14px; }
    .chapter-block { padding: 16px 18px; }
    .chapter-name { font-size: 16px; }
    .section-item { padding: 14px 16px; flex-direction: column; align-items: flex-start; gap: 10px; }
    .point-card { flex-direction: column; padding: 18px; gap: 12px; }
    .point-index { align-self: flex-start; width: 30px; height: 30px; font-size: 13px; }
    .point-content-area { width: 100%; }
    .point-actions { flex-direction: row; gap: 6px; margin-left: 0; }
    .create-card { padding: 18px 20px; }
    .card-label { font-size: 14px; }
    .auth-card { padding: 40px 28px 32px; }
    .auth-title { font-size: 26px; }
    .auth-intro-title { font-size: 26px; }
    .auth-intro-desc { font-size: 14px; margin-bottom: 28px; }
    .auth-features { gap: 16px; }
    .auth-feature-item { gap: 12px; }
    .flash-container { top: 64px; right: 10px; left: 10px; max-width: none; }
    .flash-msg { font-size: 13px; padding: 12px 16px; }
    .chapter-header { flex-wrap: wrap; gap: 10px; }
    .chapter-header-actions { width: 100%; justify-content: flex-end; }
    .chapter-collapse-btn { width: 32px; height: 32px; }
    .btn { font-size: 13px; padding: 9px 18px; }
    .btn-sm { padding: 6px 12px; font-size: 12px; }
    .card3d-stage { height: 400px; }
    .card3d-card { width: calc(100% - 8px); padding: 24px 18px; }
    .card3d-card.prev { transform: translateX(calc(-50% - 130px)) translateZ(-110px) rotateY(16deg) scale(0.80); }
    .card3d-card.next { transform: translateX(calc(-50% + 130px)) translateZ(-110px) rotateY(-16deg) scale(0.80); }
    .card3d-card.prev2, .card3d-card.next2 { opacity: 0; pointer-events: none; }
    .card3d-nav { width: 40px; height: 40px; }
    .card3d-progress { font-size: 22px; margin-bottom: 20px; }
    #card3d-current { font-size: 28px; }
    .mode-toggle-group { flex-direction: column; gap: 6px; width: 100%; }
    .mode-toggle-btn { font-size: 13px; padding: 9px 16px; justify-content: center; }
    .preview-page { width: 100%; min-height: auto; padding: 14mm 10mm; font-size: 13px; border-radius: 0; }
    .preview-title { font-size: 22px; }
    .preview-chapter-header { font-size: 18px; }
    .preview-section-header { font-size: 15px; }
    .preview-float-btn { padding: 8px 14px; font-size: 12px; }
    .preview-float-left { top: 12px; left: 12px; }
    .preview-float-right { top: 12px; right: 12px; gap: 6px; }
    .preview-float-close { width: 34px; height: 34px; }
    .preview-scroll { padding: 16px 8px 44px; }
}

@media (max-width: 480px) {
    .main-content { padding: 14px 10px 52px; }
    .page-header h1 { font-size: 22px; }
    .point-card { padding: 14px; }
    .point-text.md-body { font-size: 14px; }
    .search-bar { padding: 10px 12px; }
    .search-input { font-size: 13px; }
    .card3d-stage { height: 340px; }
    .card3d-card { padding: 18px 16px; }
    .card3d-card.prev { transform: translateX(calc(-50% - 100px)) translateZ(-110px) rotateY(16deg) scale(0.76); }
    .card3d-card.next { transform: translateX(calc(-50% + 100px)) translateZ(-110px) rotateY(-16deg) scale(0.76); }
    .preview-page { padding: 10mm 6mm; font-size: 12px; }
    .preview-float-btn span { display: none; }
    .preview-float-btn { padding: 8px; }
    .mode-toggle-group { flex-direction: column; }
    .mode-toggle-btn { font-size: 12px; padding: 8px 14px; }
}

/* ========== 内联重命名 ========== */
.rename-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border: 1px solid var(--border);
    border-radius: 6px; background: transparent; color: var(--text-tertiary);
    cursor: pointer; transition: all 0.2s; opacity: 0; flex-shrink: 0;
}
.rename-btn:hover { color: var(--primary); border-color: var(--primary); background: rgba(37,99,235,0.05); }
.chapter-block:hover .rename-btn,
.section-item:hover .rename-btn,
.page-header:hover .rename-btn,
.course-card:hover .rename-btn,
.chapter-header:hover .rename-btn { opacity: 1; }
.inline-rename-wrap { display: inline-flex; align-items: center; gap: 6px; }
.inline-rename-input {
    padding: 4px 8px; border: 1px solid var(--primary); border-radius: 6px;
    font-size: inherit; font-weight: inherit; color: var(--text);
    background: var(--card-bg); outline: none; min-width: 120px;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1); font-family: inherit;
}
.inline-rename-input:focus { border-color: var(--primary); }
.inline-rename-actions { display: inline-flex; gap: 4px; }
.inline-rename-actions button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 5px; border: none;
    cursor: pointer; transition: all 0.15s;
}
.inline-rename-save { background: var(--primary); color: #fff; }
.inline-rename-save:hover { background: #1d4ed8; }
.inline-rename-cancel { background: var(--border); color: var(--text-secondary); }
.inline-rename-cancel:hover { background: #d4d4d8; }
.chapter-name .inline-rename-input { font-size: 1.05em; font-weight: 600; }
.page-header h1 .inline-rename-input { font-size: 1.4em; font-weight: 700; }
.section-item .inline-rename-input { font-size: 0.95em; }
.course-card h3 .inline-rename-input { font-size: 1.1em; font-weight: 600; }
