/* ===== 全局样式 ===== */
:root {
    --primary: #4A7C59;
    --primary-light: #6BA37D;
    --primary-dark: #3A6347;
    --secondary: #6B7280;
    --accent: #2563EB;
    --bg: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-hover: #F1F5F9;
    --bg-secondary: #F1F5F9;
    --text: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== 图标符号库（SVG Symbol 引用，单色线条风格） ===== */
.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ===== 初始加载遮罩（解决"前端一直在加载"看不清状态） ===== */
.init-loading-mask {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #EFF6FF 0%, #F0FDF4 50%, #FEFCE8 100%);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .35s ease, visibility .35s ease;
}
.init-loading-mask.done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.init-loading-inner {
    max-width: 460px;
    padding: 40px 36px 28px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px -15px rgb(74 124 89 / 0.25);
    text-align: center;
}
.init-spinner {
    width: 52px;
    height: 52px;
    margin: 0 auto 22px;
    border-radius: 50%;
    border: 4px solid #E2E8F0;
    border-top-color: var(--primary);
    animation: init-spin 0.9s linear infinite;
}
.init-loading-mask.error .init-spinner {
    border-top-color: var(--danger);
}
.init-loading-mask.error .init-loading-title {
    color: var(--danger);
}
.init-loading-mask.error .init-loading-desc {
    color: var(--text-secondary);
}
.init-loading-mask.error .init-loading-tip {
    display: block;
    margin-top: 12px;
    padding: 8px 12px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--danger);
    text-align: left;
    word-break: break-all;
}
.init-loading-mask.done .init-spinner {
    animation: none;
    border-color: var(--success);
    border-top-color: var(--success);
    position: relative;
}
.init-loading-mask.done .init-spinner::after {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    width: 24px; height: 12px;
    border-left: 4px solid var(--success);
    border-bottom: 4px solid var(--success);
    transform: translate(-55%, -70%) rotate(-45deg);
}
@keyframes init-spin { to { transform: rotate(360deg); } }
.init-loading-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.init-loading-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.init-loading-tip {
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
    text-align: left;
    line-height: 1.7;
}
.init-loading-tip code {
    background: #fff;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid #FECACA;
    font-family: Consolas, Monaco, monospace;
}
.init-loading-footer {
    margin-top: 22px;
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}
.btn-primary {
    display: inline-block;
    padding: 9px 20px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: background .15s ease, transform .05s ease;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { transform: translateY(1px); }

/* ===== 顶部导航栏 ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-weight: 600;
    font-size: 1.1rem;
}

.logo svg {
    width: 32px;
    height: auto;
}

.main-nav {
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(74, 124, 89, 0.1);
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    width: 280px;
}

.search-icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    margin-right: 8px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    font-size: 0.9rem;
    color: var(--text);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.search-clear-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}

/* Search Results Dropdown */
.search-box {
    position: relative;
}

.search-results-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 360px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    z-index: 500;
    padding: 6px;
}

.search-result-empty {
    padding: 20px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.search-result-item:hover {
    background: var(--bg-hover);
}

.search-result-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-result-icon svg {
    width: 16px;
    height: 16px;
}

.search-result-icon.textbook {
    background: rgba(74, 124, 89, 0.1);
    color: var(--primary);
}

.search-result-icon.chapter {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent);
}

.search-result-icon.quiz {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-type {
    flex-shrink: 0;
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 2px 8px;
    background: var(--bg-hover);
    border-radius: 10px;
}

.icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border: 1px solid var(--border);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-profile:hover {
    background: var(--bg-hover);
}

.avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.avatar svg {
    width: 20px;
    height: 20px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.user-status {
    font-size: 0.75rem;
    color: var(--success);
}

/* ===== 主内容区（左侧边栏右侧的可滚动区域） ===== */
.main-container {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 28px 24px 40px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ===== 欢迎区域 ===== */
.welcome-section {
    margin-bottom: 32px;
}

.welcome-text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.welcome-text p {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* ===== 上传区域 ===== */
.upload-section {
    margin-bottom: 40px;
}

.upload-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 8px;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(74, 124, 89, 0.04);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: rgba(74, 124, 89, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.upload-icon svg {
    width: 32px;
    height: 32px;
}

.upload-area h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.upload-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ===== 按钮样式 ===== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary svg {
    width: 18px;
    height: 18px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.btn-secondary svg {
    width: 18px;
    height: 18px;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    margin-top: auto;
}

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

/* ===== 功能卡片区域 ===== */
.features-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.section-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.view-all {
    font-size: 0.9rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.view-all:hover {
    text-decoration: underline;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.feature-icon svg {
    width: 28px;
    height: 28px;
}

.knowledge-icon {
    background: rgba(74, 124, 89, 0.1);
    color: var(--primary);
}

.quiz-icon {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent);
}

.ppt-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.feature-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stat-item svg {
    width: 14px;
    height: 14px;
    color: var(--success);
}

/* ===== 最近任务 ===== */
.recent-section {
    margin-bottom: 40px;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    transition: all 0.2s ease;
    cursor: pointer;
    flex-wrap: wrap;
}

.task-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.task-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.task-icon.knowledge {
    background: rgba(74, 124, 89, 0.1);
    color: var(--primary);
}

.task-icon.quiz {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent);
}

.task-icon.ppt {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.task-icon svg {
    width: 22px;
    height: 22px;
}

.task-info {
    flex: 1;
    min-width: 200px;
}

.task-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.task-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
    line-height: 1.5;
    word-break: break-word;
    padding-right: 12px;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: normal;
    flex-wrap: wrap;
    padding-right: 12px;
}

.task-meta .dot {
    width: 3px;
    height: 3px;
    background: var(--text-muted);
    border-radius: 50%;
}

.task-meta-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.task-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    width: 100px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 3px;
    transition: width 0.8s ease-out;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 36px;
}

.task-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-in-progress {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent);
}

.status-pending {
    background: var(--bg-hover);
    color: var(--text-muted);
}

.task-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 6px 12px;
    height: 36px;
    min-width: 36px;
}

.task-action-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
    border-color: var(--primary-light);
}

.task-action-btn svg {
    width: 16px;
    height: 16px;
}

/* ===== 模态框 ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.quiz-modal {
    width: 100%;
    max-width: 800px;
}

.progress-modal {
    width: 100%;
    max-width: 500px;
    text-align: center;
    padding: 36px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.close-btn svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* ===== 测试题样式 ===== */
.quiz-section {
    margin-bottom: 32px;
}

.quiz-type-header {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.quiz-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.quiz-question {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.6;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.quiz-question .q-number {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: var(--accent);
    color: white;
    border-radius: 6px;
    font-size: 0.8rem;
    text-align: center;
    line-height: 24px;
    margin-right: 8px;
}

.quiz-options {
    list-style: none;
    padding: 0;
}

.quiz-options li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-options li:hover {
    border-color: var(--primary-light);
}

.quiz-options li.correct {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: var(--text);
}

.quiz-options li.wrong {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--text);
}

.option-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--bg-hover);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.quiz-options li.correct .option-label {
    background: var(--success);
    color: white;
}

.quiz-answer {
    margin-top: 16px;
    padding: 14px 16px;
    background: rgba(74, 124, 89, 0.08);
    border-left: 3px solid var(--primary);
    border-radius: 0 8px 8px 0;
}

.quiz-explanation,
.quiz-source {
    margin-top: 10px;
    padding: 10px 12px;
    font-size: 0.85rem;
    line-height: 1.7;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.quiz-explanation {
    background: rgba(37, 99, 235, 0.05);
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
}

.quiz-source {
    background: rgba(37, 99, 235, 0.04);
    border-left: 3px solid var(--border);
    border-radius: 0 8px 8px 0;
    color: var(--text-muted);
    font-style: italic;
}

.quiz-answer-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 6px;
}

.quiz-answer-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.quiz-answer-explanation {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.explanation-label {
    font-weight: 600;
    color: var(--text);
}

/* 判断题样式 */
.tf-options {
    display: flex;
    gap: 12px;
}

.tf-option {
    flex: 1;
    padding: 14px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tf-option:hover {
    border-color: var(--primary-light);
}

.tf-option.correct {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: var(--success);
}

/* 简答题样式 */
.short-answer {
    width: 100%;
    min-height: 100px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text);
    resize: vertical;
    font-family: inherit;
}

.short-answer:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== 进度模态框 ===== */
.progress-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: rgba(74, 124, 89, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    animation: spin 2s linear infinite;
}

.progress-icon svg {
    width: 32px;
    height: 32px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   工作台（豆包式布局）
   作用域：仅 #page-workbench / body.wb-active，不影响资源库、我的收藏、帮助等其它栏
   ============================================================ */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 工作台页面：占满视口高度，滚动只发生在内部区域 */
body.wb-active {
    overflow: hidden;
}

body.wb-active .main-container {
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* 应用外壳：左侧边栏 + 右侧内容区，整体占满视口（顶部横条已移除） */
.wb-shell {
    --wb-side-w: 260px;
    position: relative;
    display: flex;
    height: 100vh;
    background: #ffffff;
    color: #1f1f1f;
    overflow: hidden;
}

/* 工作台页面撑满内容区高度，滚动只发生在内部区域 */
body.wb-active #page-workbench.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* ---------- 左侧边栏：上（Logo/搜索） 中（可滚动） 下（用户信息，固定） ---------- */
.wb-sidebar {
    display: flex;
    flex-direction: column;
    flex: 0 0 var(--wb-side-w);
    width: var(--wb-side-w);
    min-width: 0;
    background: #f9f9f9;
    border-right: 1px solid #ececec;
    overflow: hidden;
    transition: width .22s ease, flex-basis .22s ease;
}

.wb-shell.collapsed .wb-sidebar {
    width: 0;
    flex-basis: 0;
    border-right-width: 0;
}

.wb-side-top,
.wb-side-scroll,
.wb-side-bottom {
    width: var(--wb-side-w);
    flex-shrink: 0;
    box-sizing: border-box;
}

.wb-side-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 12px 10px;
}

.wb-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.wb-brand-logo {
    width: 26px;
    height: auto;
    color: var(--primary);
    flex-shrink: 0;
}

.wb-brand-name {
    font-size: 15px;
    font-weight: 600;
    color: #1f1f1f;
    letter-spacing: .01em;
}

.wb-icon-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #666;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

.wb-icon-btn:hover {
    background: #ececec;
    color: #1f1f1f;
}

.wb-icon-btn:focus-visible,
.wb-menu-item:focus-visible,
.wb-user:focus-visible,
.wb-mini-btn:focus-visible,
.wb-pop-item:focus-visible,
.wb-action-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.wb-icon-btn svg {
    width: 18px;
    height: 18px;
}

.wb-side-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 8px;
}

.wb-side-scroll::-webkit-scrollbar {
    width: 8px;
}

.wb-side-scroll::-webkit-scrollbar-thumb {
    background: #dcdcdc;
    border-radius: 999px;
    border: 2px solid #f9f9f9;
}

/* 主菜单 */
.wb-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 8px 10px;
}

.wb-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    color: #3f3f3f;
    text-align: left;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

.wb-menu-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #7a7a7a;
}

.wb-menu-item:hover {
    background: #ececec;
}

.wb-menu-item.active {
    background: #e4e4e4;
    color: #111111;
    font-weight: 600;
}

.wb-menu-item.active svg {
    color: #111111;
}

/* 按下反馈：点击时立刻可见，避免「点了没反应」的错觉 */
.wb-menu-item:active {
    background: #dedede;
}

/* 「新工作任务」点击反馈：上传区高亮脉冲，表示按钮已响应
   （触发见 frontend/src/app/main-logic.js 的 flashUploadZone / resetNewTask） */
.upload-area.wb-flash {
    animation: wbUploadFlash .9s ease-out;
}

@keyframes wbUploadFlash {
    0% {
        border-color: var(--primary, #4A7C59);
        box-shadow: 0 0 0 0 rgba(74, 124, 89, .45);
    }
    70% {
        border-color: var(--primary, #4A7C59);
        box-shadow: 0 0 0 10px rgba(74, 124, 89, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 124, 89, 0);
    }
}

/* 最近任务（分组标题 + 纯文本列表） */
.wb-side-group {
    padding: 0 8px 8px;
}

.wb-side-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 6px 6px;
}

.wb-side-group-title {
    font-size: 12px;
    color: #9a9a9a;
}

.wb-side-group-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity .18s ease;
}

.wb-side-group:hover .wb-side-group-actions,
.wb-side-group:focus-within .wb-side-group-actions {
    opacity: 1;
}

.wb-mini-btn {
    padding: 3px 6px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-family: inherit;
    font-size: 12px;
    color: #8a8a8a;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

.wb-mini-btn:hover {
    background: #ececec;
    color: #3f3f3f;
}

.wb-task-list {
    gap: 2px;
}

.wb-task-list .task-card {
    position: relative;
    display: block;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    flex-wrap: nowrap;
    cursor: pointer;
    transition: background .18s ease;
}

.wb-task-list .task-card:hover {
    background: #ececec;
    border-color: transparent;
    box-shadow: none;
}

.wb-task-list .task-card.active {
    background: #e4e4e4;
}

.wb-task-list .task-info {
    min-width: 0;
    padding-right: 32px;
}

.wb-task-list .task-title {
    font-size: 13px;
    font-weight: 500;
    color: #3f3f3f;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wb-task-list .task-card.active .task-title {
    color: #111111;
    font-weight: 600;
}

.wb-task-list .task-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 11px;
    color: #a5a5a5;
    white-space: nowrap;
    overflow: hidden;
}

.wb-task-list .task-meta .dot {
    width: 3px;
    height: 3px;
}

/* 紧凑列表：隐去较长的时间戳，保留状态与进度 */
.wb-task-list .task-meta .dot:has(+ .task-meta-date),
.wb-task-list .task-meta-date {
    display: none;
}

.wb-task-list .task-card-progress {
    margin-top: 6px;
    padding-top: 0;
    border-top: none;
}

.wb-task-list .task-progress-bar {
    height: 3px;
}

.wb-task-list .task-progress-info {
    font-size: 10.5px;
    margin-top: 3px;
}

/* 操作按钮：hover/focus 时才出现，只显示图标，保持紧凑。
   操作区使用与悬停行同色的实底（悬停 #ececec / 选中 #e4e4e4），
   左侧再用同色渐隐收边：标题会被干净地遮住，不会从图标缝隙里透出来。 */
.wb-task-list .task-actions {
    position: absolute;
    right: 4px;
    top: 6px;
    display: flex;
    align-items: center;
    gap: 1px;
    padding-left: 14px;
    background: #ececec;
    opacity: 0;
    visibility: hidden;
    transition: opacity .16s ease, visibility .16s ease;
}

.wb-task-list .task-actions::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 100%;
    width: 34px;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(236, 236, 236, 0), #ececec);
}

.wb-task-list .task-card.active .task-actions {
    background: #e4e4e4;
}

.wb-task-list .task-card.active .task-actions::before {
    background: linear-gradient(90deg, rgba(228, 228, 228, 0), #e4e4e4);
}

.wb-task-list .task-card:hover .task-actions,
.wb-task-list .task-card:focus-within .task-actions,
.wb-task-list .task-card.active:hover .task-actions {
    opacity: 1;
    visibility: visible;
}

.wb-task-list .task-action-btn,
.wb-task-list .task-action-btn.delete-btn {
    width: 25px;
    height: 25px;
    min-width: 25px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #8a8a8a;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wb-task-list .task-action-btn:hover,
.wb-task-list .task-action-btn.delete-btn:hover {
    background: #dedede;
    color: #2f2f2f;
}

.wb-task-list .task-action-btn.delete-btn:hover {
    background: rgba(239, 68, 68, .12);
    color: #dc2626;
}

.wb-task-list .task-action-btn svg {
    width: 15px;
    height: 15px;
}

.wb-task-list .task-action-label {
    display: none;
}

.wb-task-list .task-card.batch-mode {
    padding-left: 30px;
}

.wb-task-list .task-select {
    position: absolute;
    left: 9px;
    top: 11px;
}

/* 侧边栏内的下拉菜单改为浮层，避免被滚动容器裁切 */
.wb-task-list .export-dropdown-content,
.wb-task-list .export-dropdown-content.quiz-type-dropdown,
.wb-task-list .export-dropdown-content.ppt-style-dropdown {
    position: fixed;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    z-index: 10070;
    min-width: 160px;
    border-radius: 10px;
}

.wb-task-list .empty-state {
    padding: 22px 8px;
    font-size: 12px;
}

.wb-task-list .empty-state-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
}

.wb-task-list .empty-state h3 {
    font-size: 13px;
    margin-bottom: 4px;
}

.wb-task-list .empty-state p {
    font-size: 12px;
}

/* 侧边栏内的批量管理条：纵向紧凑排布 */
.wb-side-group .task-batch-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: 8px;
    font-size: 12px;
}

.wb-side-group .task-batch-actions {
    width: 100%;
}

.wb-side-group .task-batch-actions .btn-danger {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
}

/* 底部：数据统计 + 用户信息区（固定，不随中部滚动） */
.wb-side-bottom {
    padding: 8px 10px 10px;
    border-top: 1px solid #efefef;
    background: #f9f9f9;
}

.wb-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 8px 8px;
    font-size: 11.5px;
    color: #9a9a9a;
}

.wb-stat b {
    color: #5f5f5f;
    font-weight: 600;
}

.wb-stat-divider {
    width: 1px;
    height: 10px;
    background: #e2e2e2;
}

.wb-user {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 60px;
    padding: 0 8px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .18s ease;
}

.wb-user:hover {
    background: #ececec;
}

.wb-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 50%;
    border: 1px solid #e8e8e8;
    /* 不设底色：底色由 JS（renderUserIdentity -> applyAvatarColor）按 avatar_color 全不透明写入。
       旧值 background:#e6e6e6 会从 avatar_color 的层后面透出来，使左下角头像比个人中心的同一个
       avatar_color 明显偏灰；置为 transparent 后两处色相一致。未登录（无 avatar_color）时
       整个头像由内容层的灰色人形图标呈现，视觉不变。 */
    background: transparent;
    color: #7a7a7a;
    font-size: 13px;
    font-weight: 600;
}

/* 未登录时 JS 会清空头像文本，此时恢复灰底 + 灰色人形图标（::before 常量内容，无 DOM 写入） */
.wb-avatar:empty {
    background: #e6e6e6;
}

.wb-avatar:empty::before {
    content: "";
    width: 17px;
    height: 17px;
    background-color: currentColor;
    -webkit-mask: var(--wb-user-icon) center / contain no-repeat;
    mask: var(--wb-user-icon) center / contain no-repeat;
}

.wb-avatar {
    /* 与 .wb-avatar svg 同款的人形图标（供上面的 mask 使用） */
    --wb-user-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
}

.wb-avatar svg {
    width: 17px;
    height: 17px;
}

.wb-avatar.has-status::after {
    content: "";
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--success);
    border: 2px solid #f9f9f9;
}

.wb-user-text {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.25;
}

.wb-user-name {
    font-size: 14px;
    font-weight: 500;
    color: #2f2f2f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wb-user-status {
    font-size: 12px;
    font-weight: 400;
    color: #9a9a9a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wb-user-more {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: #b0b0b0;
}

/* ---------- 右侧主内容区 ---------- */
.wb-main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    background: #ffffff;
}

.wb-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #f2f2f2;
    background: #ffffff;
}

.wb-toolbar-left,
.wb-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.wb-toolbar-title {
    font-size: 13px;
    color: #8a8a8a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wb-pop-wrap {
    position: relative;
}

.wb-pop {
    position: absolute;
    z-index: 10060;
    min-width: 176px;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #ececec;
    border-radius: 12px;
    box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .3);
}

.wb-pop[hidden] {
    display: none;
}

.wb-pop-right {
    top: calc(100% + 6px);
    right: 0;
}

.wb-pop-left {
    bottom: calc(100% + 8px);
    left: 0;
}

.wb-pop-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    color: #3f3f3f;
    text-align: left;
    cursor: pointer;
    transition: background .16s ease;
}

.wb-pop-item:hover:not(:disabled) {
    background: #f4f4f4;
}

.wb-pop-item:disabled {
    color: #bdbdbd;
    cursor: not-allowed;
}

.wb-pop-sep {
    height: 1px;
    margin: 4px 6px;
    background: #f0f0f0;
}

/* 中部动态区 */
.wb-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.wb-view {
    display: none;
    flex: 1 1 auto;
    min-height: 0;
}

.wb-view.active {
    display: flex;
}

/* ① 初始态：大标题 + 大尺寸 PDF 上传区（不出现对话框） */
.wb-view-idle.active {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
}

.wb-idle-title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    color: #1f1f1f;
    letter-spacing: -.01em;
    text-align: center;
}

.wb-idle-sub {
    max-width: 560px;
    margin: 0 0 28px;
    font-size: 14px;
    color: #8a8a8a;
    text-align: center;
}

#page-workbench .wb-upload-zone {
    width: 100%;
    max-width: 620px;
    padding: 44px 32px;
    border: 1.5px dashed #dcdcdc;
    border-radius: 16px;
    background: #fbfbfb;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

#page-workbench .wb-upload-zone:hover,
#page-workbench .wb-upload-zone.dragover {
    border-color: var(--primary);
    background: #f5faf6;
}

#page-workbench .wb-upload-zone:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.wb-upload-zone .upload-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 16px;
    background: rgba(74, 124, 89, .08);
    color: var(--primary);
}

.wb-upload-zone .upload-icon svg {
    width: 26px;
    height: 26px;
}

.wb-upload-zone h3 {
    margin-bottom: 6px;
    font-size: 16px;
    font-weight: 600;
    color: #2f2f2f;
}

.wb-upload-zone .upload-sub {
    margin-bottom: 18px;
    font-size: 12.5px;
    color: #9a9a9a;
}

.wb-upload-zone .upload-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}

.wb-upload-zone .upload-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.wb-upload-zone .upload-option label {
    font-size: 12.5px;
    color: #9a9a9a;
    cursor: pointer;
}

/* ② 处理中 */
.wb-view-processing.active {
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.wb-processing-card {
    width: 100%;
    max-width: 460px;
    text-align: center;
}

.wb-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 18px;
    border: 3px solid #ececec;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: wb-spin .85s linear infinite;
}

@keyframes wb-spin {
    to { transform: rotate(360deg); }
}

.wb-processing-title {
    margin-bottom: 6px;
    font-size: 18px;
    font-weight: 600;
    color: #2f2f2f;
}

.wb-processing-desc {
    margin-bottom: 20px;
    font-size: 13px;
    color: #9a9a9a;
}

.wb-progress {
    height: 6px;
    border-radius: 999px;
    background: #efefef;
    overflow: hidden;
}

.wb-progress-fill {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--primary);
    transition: width .6s ease;
}

.wb-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: #9a9a9a;
}

.wb-processing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 18px;
}

/* ③ 完成态：上半部分结果（内部滚动），下半部分对话框（吸底） */
.wb-view-result.active {
    flex-direction: column;
}

.wb-result-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 24px 28px 8px;
    scroll-behavior: smooth;
}

.wb-result-body,
.wb-chat-log {
    max-width: 900px;
    margin: 0 auto;
}

.wb-result-head {
    margin-bottom: 20px;
}

.wb-result-title-row {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
}

.wb-result-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    color: #1f1f1f;
}

.wb-status-chip {
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(16, 185, 129, .12);
    color: #0f9d76;
    font-size: 12px;
    white-space: nowrap;
}

.wb-status-chip.pending {
    background: #f1f5f9;
    color: #64748b;
}

.wb-status-chip.failed {
    background: rgba(239, 68, 68, .12);
    color: #dc2626;
}

.wb-result-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    font-size: 12.5px;
    color: #9a9a9a;
}

.wb-result-meta .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #d6d6d6;
}

.wb-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.wb-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    background: #ffffff;
    font-family: inherit;
    font-size: 13px;
    color: #3f3f3f;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.wb-action-btn:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #dcdcdc;
}

.wb-action-btn.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.wb-action-btn.primary:hover:not(:disabled) {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.wb-action-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.wb-section {
    margin-bottom: 14px;
    padding: 16px 18px;
    border: 1px solid #f0f0f0;
    border-radius: 14px;
    background: #ffffff;
}

.wb-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.wb-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #2f2f2f;
}

.wb-section-title svg {
    width: 16px;
    height: 16px;
    color: #8a8a8a;
}

.wb-section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wb-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.wb-chip {
    padding: 2px 9px;
    border-radius: 999px;
    background: #f5f5f5;
    font-size: 11.5px;
    color: #6f6f6f;
}

.wb-chapter {
    margin-bottom: 10px;
}

.wb-chapter-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #3f3f3f;
}

.wb-chapter-count {
    font-size: 11.5px;
    font-weight: 400;
    color: #a5a5a5;
}

.wb-kp-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.wb-kp {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 13px;
    color: #4a4a4a;
}

.wb-kp:hover {
    background: #f7f7f7;
}

.wb-kp-index {
    min-width: 18px;
    font-size: 12px;
    color: #b5b5b5;
}

.wb-kp-text {
    flex: 1 1 auto;
    min-width: 0;
}

.wb-kp-imp {
    width: 6px;
    height: 6px;
    margin-top: 7px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: #dcdcdc;
}

.wb-kp-imp.high {
    background: #e8934a;
}

.wb-empty-text {
    font-size: 13px;
    color: #9a9a9a;
}

.wb-more-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #b0b0b0;
}

/* 章节选择一次性锁定的轻量提示 */
.wb-lock-hint {
    margin: 0 0 10px;
    padding: 6px 10px;
    font-size: 12px;
    color: #8a6d3b;
    background: #fdf6e3;
    border-left: 3px solid #e0c07a;
    border-radius: 4px;
}

/* 对话记录 */
.wb-chat-log {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 4px 0 16px;
}

.wb-chat-log:empty {
    display: none;
}

.wb-msg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.wb-msg.user {
    justify-content: flex-end;
}

.wb-msg-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    background: rgba(74, 124, 89, .12);
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 600;
}

.wb-msg-bubble {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.wb-msg.assistant .wb-msg-bubble {
    background: #f6f6f6;
    color: #2f2f2f;
    border-top-left-radius: 6px;
}

.wb-msg.user .wb-msg-bubble {
    background: rgba(74, 124, 89, .12);
    color: #254532;
    border-top-right-radius: 6px;
}

.wb-msg.error .wb-msg-bubble {
    background: #fef2f2;
    color: #b91c1c;
}

.wb-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.wb-typing i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #bdbdbd;
    animation: wb-blink 1.2s infinite ease-in-out;
}

.wb-typing i:nth-child(2) { animation-delay: .18s; }
.wb-typing i:nth-child(3) { animation-delay: .36s; }

@keyframes wb-blink {
    0%, 60%, 100% { opacity: .3; }
    30% { opacity: 1; }
}

/* 底部 AI 对话区（吸底） */
.wb-composer {
    position: relative;
    flex-shrink: 0;
    padding: 10px 24px 14px;
    background: #ffffff;
    border-top: 1px solid #f5f5f5;
}

.wb-composer[hidden] {
    display: none;
}

.wb-composer.wb-in {
    animation: wb-slide-up .28s ease-out;
}

@keyframes wb-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.wb-composer-box {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 900px;
    margin: 0 auto;
    padding: 8px 10px;
    border: 1px solid #e6e6e6;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 2px 10px -4px rgba(0, 0, 0, .08);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.wb-composer-box:focus-within {
    border-color: #cfd8d2;
    box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .16);
}

.wb-chat-input {
    flex: 1 1 auto;
    max-height: 140px;
    padding: 6px 4px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: #2f2f2f;
    resize: none;
    outline: none;
    overflow-y: auto;
}

.wb-chat-input::placeholder {
    color: #b0b0b0;
}

.wb-send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
    transition: background .18s ease;
}

.wb-send-btn:hover:not(:disabled) {
    background: var(--primary-dark);
}

.wb-send-btn:disabled {
    background: #e2e2e2;
    cursor: not-allowed;
}

.wb-send-btn svg {
    width: 16px;
    height: 16px;
}

.wb-backdrop {
    position: absolute;
    inset: 0;
    z-index: 30;
    background: rgba(15, 23, 42, .28);
}

.wb-backdrop[hidden] {
    display: none;
}

/* ---------- 响应式（仅工作台） ---------- */
@media (max-width: 1180px) {
    .wb-shell {
        --wb-side-w: 232px;
    }
    .wb-result-scroll {
        padding: 20px 20px 8px;
    }
}

@media (max-width: 860px) {
    .wb-shell {
        --wb-side-w: 268px;
    }
    .wb-shell .wb-sidebar {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 40;
        transition: transform .22s ease, width .22s ease;
    }
    .wb-shell.collapsed .wb-sidebar {
        width: var(--wb-side-w);
        transform: translateX(-100%);
    }
    .wb-shell:not(.collapsed) .wb-backdrop:not([hidden]) {
        display: block;
    }
    .wb-idle-title {
        font-size: 23px;
    }
    .wb-view-idle.active,
    .wb-view-processing.active {
        padding: 18px 16px;
    }
    #page-workbench .wb-upload-zone {
        padding: 32px 20px;
    }
    .wb-composer {
        padding: 8px 12px 12px;
    }
    .wb-result-scroll {
        padding: 16px 14px 8px;
    }
}

/* ===== 最近任务：批量管理 ===== */
.section-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--danger);
    color: #fff;
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-danger:hover:not(:disabled) {
    background: #DC2626;
    border-color: #DC2626;
}
.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.task-batch-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    margin-bottom: 12px;
    background: rgba(74, 124, 89, 0.06);
    border: 1px dashed var(--primary-light);
    border-radius: var(--radius);
}
.task-batch-select-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text);
    cursor: pointer;
}
.task-batch-select-all input,
.task-select-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}
.task-batch-count {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.task-batch-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.task-batch-actions .btn-secondary,
.task-batch-actions .btn-danger {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.task-select {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-right: 4px;
    flex-shrink: 0;
}
/* 选中态：需压过 .wb-task-list .task-card:hover（0,3,0）与 border:none，故用更高特异性 + inset 阴影 */
.wb-task-list .task-card.selected,
.wb-task-list .task-card.selected:hover {
    background: rgba(74, 124, 89, 0.14);
    box-shadow: inset 3px 0 0 var(--primary);
}
.task-card.selected {
    border-color: var(--primary);
    background: rgba(74, 124, 89, 0.04);
}
.task-card.batch-mode .task-actions {
    display: none;
}

/* ===== 批量删除二次确认 ===== */
.batch-delete-warning {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
}
.batch-delete-warning svg {
    width: 22px;
    height: 22px;
    color: var(--danger);
    flex-shrink: 0;
    margin-top: 2px;
}
.batch-delete-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}
.batch-delete-title strong {
    color: var(--danger);
}
.batch-delete-desc {
    margin-top: 4px;
    font-size: 0.83rem;
    line-height: 1.6;
    color: var(--text-secondary);
}
.batch-delete-list {
    list-style: none;
    margin: 14px 0 0;
    padding: 10px 14px;
    max-height: 160px;
    overflow-y: auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.batch-delete-list li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 3px 0;
    line-height: 1.5;
}
.batch-delete-list li::before {
    content: "•";
    color: var(--danger);
    flex-shrink: 0;
}
.batch-delete-field {
    margin-top: 18px;
}
.batch-delete-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}
.batch-delete-field label code {
    padding: 1px 6px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 4px;
    color: var(--danger);
    font-family: inherit;
    font-weight: 600;
}
.batch-delete-field input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg);
    outline: none;
    transition: all 0.2s;
}
.batch-delete-field input:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.batch-delete-error {
    min-height: 18px;
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--danger);
}
.batch-delete-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 6px;
}

/* ===== PPT 在线预览 ===== */
.ppt-preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 48px 20px;
    text-align: center;
    color: var(--text-secondary);
}
.ppt-preview-loading-tip {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.ppt-preview-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.ppt-preview-toolbar .ppt-preview-style {
    font-weight: 600;
    color: var(--primary);
}
.ppt-preview-toolbar .ppt-preview-notice {
    flex: 1 1 100%;
    color: var(--warning);
    font-size: 0.8rem;
}
.ppt-preview-toolbar .resource-download-link {
    margin-left: auto;
}
.ppt-preview-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #0F172A;
    border-radius: 10px;
    padding: 12px;
}
.ppt-preview-stage img {
    width: 100%;
    max-height: 52vh;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
}
.ppt-nav-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
}
.ppt-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}
.ppt-preview-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px 2px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.ppt-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 6px 2px 10px;
}
.ppt-thumb {
    position: relative;
    flex: 0 0 auto;
    width: 132px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    background: var(--bg);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.ppt-thumb:hover {
    transform: translateY(-2px);
}
.ppt-thumb.active {
    border-color: var(--primary);
}
.ppt-thumb img {
    display: block;
    width: 100%;
    height: auto;
}
.ppt-thumb span {
    position: absolute;
    right: 4px;
    bottom: 4px;
    padding: 0 6px;
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    border-radius: 4px;
    font-size: 0.7rem;
}
.ppt-text-slides {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.ppt-text-slide {
    padding: 16px 18px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.ppt-text-slide-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.ppt-text-slide-num {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    flex-shrink: 0;
}
.ppt-text-slide-title {
    font-weight: 600;
    color: var(--text);
}
.ppt-text-slide ul {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.8;
}

/* ===== 教材知识点提取（结构化 JSON + 教材截图） ===== */
.modal-content.knowledge-modal {
    width: 96vw;
    max-width: 1480px;
    max-height: 90vh;
}

.kp-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 400px;
    gap: 18px;
    align-items: start;
}

/* 左栏：知识大纲 */
.kp-outline {
    position: sticky;
    top: 0;
    max-height: calc(90vh - 220px);
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    padding: 12px;
}
.kp-outline-head h3 { font-size: 0.95rem; font-weight: 600; }
.kp-outline-head span { font-size: 0.78rem; color: var(--text-muted); }
.kp-outline-list { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.kp-outline-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 7px 9px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.84rem;
    color: var(--text-secondary);
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}
.kp-outline-item:hover { background: var(--bg-card); color: var(--text); border-left-color: var(--primary); }
.kp-outline-title {
    flex: 1;
    min-width: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    line-height: 1.45;
}
.kp-outline-index {
    flex: none;
    min-width: 16px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    line-height: 1.7;
}
.kp-outline-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.kp-outline-chapter {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 2px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted);
}
.kp-outline-chapter-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-outline-items { display: flex; flex-direction: column; gap: 2px; }
.kp-outline-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: var(--bg-hover);
    border-radius: 10px;
    padding: 1px 7px;
}

/* 中栏：工具栏 + 知识点卡片 */
.kp-main { min-width: 0; }
.kp-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.kp-toolbar-info { display: flex; flex-wrap: wrap; gap: 6px; }
.kp-chip {
    font-size: 0.76rem;
    color: var(--text-secondary);
    background: var(--bg-hover);
    border-radius: 20px;
    padding: 3px 10px;
}
.kp-chip-high { background: rgba(239, 68, 68, 0.12); color: #B91C1C; }
.kp-chip-shot { background: rgba(37, 99, 235, 0.12); color: #1D4ED8; }
.kp-chip-quality { background: rgba(74, 124, 89, 0.12); color: var(--primary-dark); }
.kp-chip-subject { background: rgba(124, 58, 237, 0.12); color: #6D28D9; }
.kp-chip-degraded { background: rgba(245, 158, 11, 0.16); color: #B45309; font-weight: 600; }
.kp-toolbar-actions .btn-sm.kp-on { background: var(--primary); color: #fff; border-color: var(--primary); }

.kp-warning .icon { width: 16px; height: 16px; vertical-align: -2px; margin-right: 4px; }
.kp-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #92400E;
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 0.84rem;
    margin-bottom: 12px;
}
/* 降级模式：不要用和普通提示一样的弱化样式，避免用户误以为是 LLM 结果 */
.kp-warning-strong {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.4);
    color: #991B1B;
    font-weight: 500;
}

/* 学科选择（提取前） */
.kp-subject-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}
.kp-subject-row label { font-size: 0.86rem; color: var(--text-secondary); }
.kp-subject-row select {
    min-width: 260px;
    max-width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 8px);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.86rem;
}
.kp-subject-hint {
    font-size: 0.78rem !important;
    color: var(--text-muted);
    max-width: 560px;
}

/* 降级模式：结构化原文 */
.kp-passages { margin-top: 18px; }
.kp-passages-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.kp-passages-head h3 { font-size: 1rem; margin: 0; }
.kp-passages-head span { font-size: 0.78rem; color: var(--text-muted); }
.kp-passage-list { display: flex; flex-direction: column; gap: 8px; }
.kp-passage {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    padding: 8px 12px;
}
.kp-passage summary {
    display: flex;
    align-items: baseline;
    gap: 10px;
    cursor: pointer;
    font-size: 0.88rem;
}
.kp-passage-title { font-weight: 600; color: var(--text-primary); }
.kp-passage-page { font-size: 0.76rem; color: var(--text-muted); margin-left: auto; }
.kp-passage-text {
    margin: 8px 0 2px;
    font-size: 0.84rem;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.kp-cards { display: flex; flex-direction: column; gap: 12px; }
.knowledge-modal .kp-card {
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--radius);
    background: var(--bg-card);
    padding: 14px 16px;
    cursor: pointer;
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}
.knowledge-modal .kp-card:hover { box-shadow: var(--shadow-md); }
.knowledge-modal .kp-card.active { box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.knowledge-modal .kp-imp-high { border-left-color: #EF4444; }
.knowledge-modal .kp-imp-medium { border-left-color: #2563EB; }
.knowledge-modal .kp-imp-low { border-left-color: #94A3B8; }
.kp-flash { animation: kpFlash 1.6s ease; }
@keyframes kpFlash {
    0%, 100% { background: var(--bg-card); }
    25% { background: rgba(74, 124, 89, 0.14); }
}

.kp-card-head { display: flex; align-items: center; gap: 10px; }
.kp-index {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.knowledge-modal .kp-title { flex: 1; font-size: 1rem; font-weight: 600; color: var(--text); }
.kp-badge {
    flex-shrink: 0;
    font-size: 0.72rem;
    border-radius: 4px;
    padding: 2px 8px;
    background: var(--bg-hover);
    color: var(--text-secondary);
}
.kp-imp-high .kp-badge { background: rgba(239, 68, 68, 0.12); color: #B91C1C; }
.kp-imp-medium .kp-badge { background: rgba(37, 99, 235, 0.12); color: #1D4ED8; }
.kp-imp-low .kp-badge { background: rgba(148, 163, 184, 0.18); color: #475569; }

.kp-summary { margin-top: 8px; font-size: 0.9rem; color: var(--text); font-weight: 500; }
.knowledge-modal .kp-detail { margin-top: 6px; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7; }

.kp-formulas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kp-formula {
    display: inline-block;
    background: var(--bg-hover);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.9rem;
    color: var(--text);
    vertical-align: middle;
}
.kp-formula .katex { font-size: 0.95em; }
.kp-formula .katex-display { margin: 0; }
.kp-summary .katex { font-size: 0.95em; }
.kp-detail .katex { font-size: 0.95em; }
.kp-passage-text .katex { font-size: 0.95em; }
.kp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kp-tag {
    font-size: 0.72rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1px 9px;
}
.knowledge-modal .kp-related { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.kp-related-label { font-size: 0.75rem; color: var(--text-muted); }
.kp-related-link {
    font-size: 0.78rem;
    color: var(--primary-dark);
    text-decoration: none;
    background: rgba(74, 124, 89, 0.08);
    border-radius: 20px;
    padding: 2px 10px;
}
.kp-related-link:hover { background: rgba(74, 124, 89, 0.18); }
.kp-related-link i { font-style: normal; font-size: 0.68rem; color: var(--text-muted); margin-left: 5px; }

.kp-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    font-size: 0.78rem;
    color: var(--text-muted);
}
.kp-source { color: var(--text-secondary); }
.kp-source .icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
.kp-shot-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.76rem;
    color: var(--primary-dark);
    cursor: pointer;
    transition: all 0.15s ease;
}
.kp-shot-btn:hover { background: rgba(74, 124, 89, 0.1); border-color: var(--primary-light); }
.kp-no-shot { color: var(--text-muted); }
.kp-flag { color: #B45309; background: rgba(245, 158, 11, 0.12); border-radius: 20px; padding: 2px 9px; }
.kp-flag .icon { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.kp-conf { color: var(--text-muted); }
.kp-conf-rule { color: #B45309; background: rgba(245, 158, 11, 0.12); border-radius: 20px; padding: 2px 9px; }

/* 右栏：教材截图 */
.kp-side { min-width: 0; }
.kp-side-sticky { position: sticky; top: 0; }
/* 注：原「当前知识点引用卡」的 .kp-shot-head/.kp-shot-page/.kp-shot-note/
   .kp-shot-quote* 样式已随引用卡一起移除（知识点提取产物不再展示在 AI 对话区）；
   .kp-shot-btn（卡片「查看截图」按钮）仍在使用，保留。 */

/* 右栏：AI 聊天侧边框（外框尺寸由 .kp-layout 第三列决定，缩放只作用于内部字号） */
.kp-chat-panel {
    --kp-chat-zoom: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    padding: 0;
    max-height: calc(90vh - 220px);
    min-height: 320px;
    overflow: hidden;
}
.kp-chat-head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}
.kp-chat-title { font-size: 0.9rem; font-weight: 600; color: var(--text); white-space: nowrap; }
.kp-chat-ctx {
    flex: 1;
    min-width: 0;
    font-size: 0.72rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kp-chat-zoom { flex-shrink: 0; display: flex; align-items: center; gap: 4px; }
.kp-chat-zoom-btn {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    transition: all .15s ease;
}
.kp-chat-zoom-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
    border-color: var(--primary-light);
}
.kp-chat-zoom-val { min-width: 34px; text-align: center; font-size: 0.7rem; color: var(--text-muted); }
.kp-chat-zoom-reset { width: auto; padding: 0 6px; font-size: 0.7rem; }
.kp-chat-log {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    gap: 12px;
    padding: 12px;
    /* 面板里是列向 flex，横向即交叉轴：若横向出现 auto 外边距，
       align-self:stretch 会失效、消息区退化成收缩宽度并居中。
       这里显式归零，保证消息区始终撑满面板宽度。 */
    margin: 0;
    max-width: none;
    font-size: calc(13.5px * var(--kp-chat-zoom));
    /* 消息气泡（.wb-msg）本身是 flex 项，容器需为列向 flex 才能让 gap 生效。
       注意：不要用 justify-content:flex-end —— 可滚动 flex 容器用 flex-end 时，
       溢出会向容器上方裁剪，导致早期消息永久看不到。底部对齐由 kpChatRender
       里的 scrollTop=scrollHeight 完成。 */
    display: flex;
    flex-direction: column;
}
.kp-chat-log .wb-msg { gap: 8px; }
.kp-chat-log .wb-msg-avatar { width: 24px; height: 24px; flex: 0 0 24px; font-size: 10px; }
.kp-chat-log .wb-msg-bubble {
    max-width: 88%;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 1em;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.kp-chat-composer {
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 8px 10px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    /* 输入区字号固定，不跟随 --kp-chat-zoom：缩放控件只对上方对话内容
       （.kp-chat-log）生效，用户输入框与发送按钮保持原大小 */
    font-size: 13px;
}
.kp-chat-composer textarea {
    flex: 1;
    min-width: 0;
    max-height: 120px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text);
    font-family: inherit;
    font-size: 1em;
    line-height: 1.5;
    resize: none;
    outline: none;
}
.kp-chat-composer textarea:focus { border-color: var(--primary-light); }
.kp-chat-send {
    flex-shrink: 0;
    padding: 7px 14px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 0.95em;
    cursor: pointer;
}
.kp-chat-send:hover { background: var(--primary-dark); }

/* 进度 / 空态 */
.kp-progress { text-align: center; padding: 48px 24px; }
.kp-progress .spinner { margin: 0 auto 16px; }
.kp-progress-msg { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 18px; }
.kp-progress .progress-bar { max-width: 420px; margin: 0 auto; }
.kp-progress .progress-text-big { display: inline-block; margin-top: 10px; }
.kp-progress-hint { margin-top: 18px; font-size: 0.78rem; color: var(--text-muted); }
.kp-empty { text-align: center; padding: 56px 24px; }
.kp-empty-icon { margin-bottom: 10px; }
.kp-empty-icon .icon { width: 48px; height: 48px; color: var(--primary); }
.kp-empty h3 { font-size: 1.1rem; margin-bottom: 8px; }
.kp-empty p { font-size: 0.88rem; color: var(--text-muted); max-width: 520px; margin: 0 auto 20px; line-height: 1.7; }

/* 模态框底部工具条 */
.kp-footer { align-items: center; }
.kp-footer-label { margin-right: auto; font-size: 0.82rem; color: var(--text-muted); }
.kp-footer-close { margin-left: 8px; }

/* 截图灯箱：在当前页面内放大查看，不新开浏览器窗口 */
.kp-lightbox { z-index: 1200; }
.kp-lightbox .modal-overlay { background: rgba(15, 23, 42, 0.82); }
.kp-lightbox-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 94vw;
    max-height: 94vh;
    animation: modalIn 0.2s ease;
}
.kp-lightbox-img {
    max-width: 94vw;
    max-height: 82vh;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    box-shadow: var(--shadow-xl);
    cursor: zoom-out;
}
.kp-lightbox-caption { color: #E2E8F0; font-size: 0.82rem; text-align: center; }
.kp-lightbox-hint { color: rgba(226, 232, 240, 0.6); font-size: 0.72rem; }
.kp-lightbox-close .icon { width: 18px; height: 18px; }
.kp-lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #0F172A;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.kp-lightbox-close:hover { background: #F1F5F9; }
@media (max-width: 780px) {
.kp-lightbox-close { top: 6px; right: 6px; }
}

/* ===== 桌面：AI 聊天面板「独立固定」，撑满内容区高度，整体不再随滚动移动 =====
   机制：原 .modal-body 是滚动容器、.kp-side-sticky 的 containing block 只是
   矮的 .kp-side（align-items:start 下高度=内容），所以 sticky 没有可吸附区间，
   表现成「跟着文档一起滚走」。改法是把滚动下沉到各列内部——
   .modal-body 不再滚动（overflow:hidden），.kp-layout 用 flex:1 撑满内容区高度，
   align-items:stretch 让三列等高，中列/左列/聊天消息区各自内部滚动。
   聊天面板 height:100% = 内容区完整高度（即用户要求对齐的红框范围）。
   只在 ≥1041px 生效；≤1040 维持原有「整页滚动 + 聊天面板 max-height:60vh」降级。 */
@media (min-width: 1041px) {
    #knowledgeBody {
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }
    #knowledgeBody > .kp-layout {
        flex: 1;
        min-height: 0;
        align-items: stretch;          /* 三列等高 = 内容区高度 */
        grid-template-rows: minmax(0, 1fr);
    }
    .kp-main { overflow-y: auto; min-height: 0; }   /* 中栏：内部滚动 */
    .kp-outline { position: static; max-height: none; }  /* 左栏撑满 + 内部滚动（本身已有 overflow-y:auto） */
    .kp-side-sticky { position: static; height: 100%; }
    .kp-chat-panel { height: 100%; max-height: none; min-height: 0; }  /* 撑满内容区高度，不随滚动移动 */
    .kp-passages { flex: 1; min-height: 0; overflow-y: auto; margin-top: 18px; }
}

@media (max-width: 1280px) {
    .kp-layout { grid-template-columns: 190px minmax(0, 1fr) 330px; }
    .kp-chat-head { padding: 7px 8px; gap: 4px; }
    .kp-chat-log { padding: 10px; gap: 10px; }
    .kp-chat-composer { padding: 7px 8px; }
    .kp-chat-zoom-btn { width: 22px; height: 22px; }
    .kp-chat-zoom-val { min-width: 30px; }
}
@media (max-width: 1040px) {
    /* 中等宽度：保留「大纲 + 正文」两栏，右栏（AI 聊天）整行移到正文下方 */
    .kp-layout { grid-template-columns: 200px minmax(0, 1fr); gap: 14px; }
    .kp-side { grid-column: 1 / -1; }
    .kp-side-sticky { position: static; }
    .kp-chat-panel { max-height: 60vh; }
}
@media (max-width: 780px) {
    .kp-layout { grid-template-columns: 1fr; }
    .kp-outline { position: static; max-height: none; }
    .kp-chat-panel { max-height: 55vh; min-height: 260px; }
    .kp-chat-log { padding: 8px; }
    .kp-chat-composer { padding: 6px 8px; }
}

.progress-modal h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.progress-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.step-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--border);
    position: relative;
    transition: all 0.3s ease;
}

.step.active .step-indicator {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(74, 124, 89, 0.2);
}

.step.completed .step-indicator {
    background: var(--success);
    border-color: var(--success);
}

.step.failed .step-indicator {
    background: var(--danger, #e74c3c);
    border-color: var(--danger, #e74c3c);
}

.step.completed .step-indicator::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: 700;
}

.step span {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.step.active span {
    color: var(--primary);
    font-weight: 500;
}

.step-line {
    width: 40px;
    height: 2px;
    background: var(--border);
    margin: 0 8px;
    margin-bottom: 28px;
}

/* ===== Toast提示 ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    width: 24px;
    height: 24px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
}

.toast-icon svg {
    width: 16px;
    height: 16px;
}

.toast.error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

#toastMsg {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--bg-hover);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon svg {
    width: 28px;
    height: 28px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
    }

    .header-left {
        gap: 16px;
    }

    .main-nav {
        display: none;
    }

    .search-box {
        width: 180px;
    }

    .user-info {
        display: none;
    }

    .main-container {
        padding: 80px 16px 24px;
    }

    .welcome-text h1 {
        font-size: 1.35rem;
    }

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

    .upload-area {
        padding: 32px 20px;
    }

    .quiz-modal {
        max-width: 100%;
        margin: 10px;
    }

    .task-progress {
        display: none;
    }
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

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

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

/* ===== 选择样式 ===== */
::selection {
    background: rgba(74, 124, 89, 0.2);
    color: var(--text);
}

/* ================ APP ENHANCEMENTS ================ */

/* Header flex layout (for alignment in single row) */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    cursor: pointer;
}

/* Welcome stats cards */
.welcome-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.welcome-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 20px;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* User dropdown */
.user-profile {
    position: relative;
}
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow-xl);
    z-index: 120;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: all .18s ease;
}
.user-dropdown.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    color: var(--text);
    cursor: pointer;
    transition: background .15s ease;
}
.user-dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--primary);
}
.user-dropdown-item svg {
    width: 18px; height: 18px; flex-shrink: 0;
    color: var(--text-secondary);
}
.user-dropdown-item:hover svg { color: var(--primary); }
.user-dropdown-item.danger { color: var(--danger); }
.user-dropdown-item.danger:hover { background: rgba(239,68,68,0.08); color: var(--danger); }
.user-dropdown-item.danger svg { color: var(--danger); }
.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 4px;
}

/* Notification / Favorite panel (dropdown) */
.panel-dropdown {
    position: fixed;
    width: 340px;
    max-height: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-xl);
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    pointer-events: none;
    transition: all .2s ease;
}
.panel-dropdown.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.panel-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
}
.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* Notif item */
.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s ease;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item.read { opacity: .6; }
.notif-dot {
    width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0;
    background: var(--primary);
}
.notif-dot.info { background: var(--accent); }
.notif-dot.success { background: var(--success); }
.notif-dot.warning { background: var(--warning); }
.notif-dot.error { background: var(--danger); }
.notif-item:not(.read) .notif-dot {
    box-shadow: 0 0 0 4px rgba(16,185,129,0.12);
}
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 0.88rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.notif-body { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }
.notif-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 6px; }

/* Fav item */
.fav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s ease;
}
.fav-item:hover { background: var(--bg-hover); }
.fav-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.fav-icon svg { width: 18px; height: 18px; }
.fav-icon.knowledge { background: rgba(74,124,89,0.1); color: var(--primary); }
.fav-icon.quiz { background: rgba(37,99,235,0.1); color: var(--accent); }
.fav-icon.ppt { background: rgba(245,158,11,0.1); color: var(--warning); }
.fav-content { flex: 1; min-width: 0; }
.fav-type { font-size: 0.72rem; color: var(--text-muted); }
.fav-title { font-size: 0.85rem; font-weight: 500; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-remove-btn {
    flex-shrink: 0;
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; border-radius: 6px;
    color: var(--text-muted); cursor: pointer; font-size: 0.75rem;
    transition: all .15s ease; opacity: 0;
}
.fav-remove-btn .icon { width: 14px; height: 14px; }
.fav-item:hover .fav-remove-btn { opacity: 1; }
.fav-remove-btn:hover { background: rgba(239,68,68,0.1); color: #ef4444; }

/* Icon small button */
.icon-btn-sm {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid var(--border); border-radius: 8px;
    color: var(--text-secondary); cursor: pointer; transition: all .15s ease;
}
.icon-btn-sm:hover {
    background: var(--bg-hover);
    color: var(--primary);
    border-color: var(--primary-light);
}
.icon-btn-sm svg { width: 16px; height: 16px; }

.modal-header-actions {
    display: flex; align-items: center; gap: 6px;
}

/* Quiz meta bar */
.quiz-meta-bar {
    display: flex;
    gap: 18px;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(37,99,235,0.08) 0%, rgba(245,158,11,0.06) 100%);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.quiz-meta-item {
    font-size: 0.88rem;
    color: var(--text-secondary);
}
.quiz-meta-label {
    font-weight: 600;
    color: var(--text);
    margin-right: 2px;
}
.quiz-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.quiz-meta-row .q-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 8px;
    flex-shrink: 0;
}
.q-type {
    padding: 2px 10px;
    background: rgba(37,99,235,0.1);
    color: var(--accent);
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}
.q-difficulty {
    padding: 2px 10px;
    background: rgba(245,158,11,0.1);
    color: var(--warning);
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}
.q-chapter {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Selection feedback on options */
.quiz-options li.selected {
    background: rgba(37,99,235,0.06);
    border-color: var(--accent);
}
.quiz-options li .opt-label {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 24px; height: 24px; margin-right: 10px;
    background: var(--bg-hover);
    border-radius: 6px; font-weight: 700; font-size: 0.8rem;
}
.quiz-options li.correct {
    background: rgba(16,185,129,0.1) !important;
    border-color: var(--success) !important;
}
.quiz-options li.correct .opt-label {
    background: var(--success);
    color: #fff;
}
.tf-option.selected {
    background: rgba(37,99,235,0.06);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}
.tf-option.correct {
    background: rgba(16,185,129,0.1) !important;
    border-color: var(--success) !important;
    color: var(--success) !important;
}
.quiz-body.answers-hidden .quiz-answer,
.quiz-body.answers-hidden .quiz-explanation,
.quiz-body.answers-hidden .quiz-source {
    display: none !important;
}
#quizBody.answers-hidden .quiz-answer,
#quizBody.answers-hidden .quiz-explanation,
#quizBody.answers-hidden .quiz-source {
    display: none !important;
}
#quizBody.answers-hidden .quiz-options li.correct {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
    color: var(--text-secondary) !important;
}
#quizBody.answers-hidden .quiz-options li.correct .opt-label {
    background: var(--bg-hover) !important;
    color: var(--text-secondary) !important;
}
#quizBody.answers-hidden .tf-option.correct {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
    color: var(--text-secondary) !important;
}

/* Footer group */
.footer-actions-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Enhanced progress modal */
.progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}
.progress-bar.big {
    flex: 1;
    height: 10px;
    background: var(--bg-hover);
    border-radius: 8px;
    overflow: hidden;
}
.progress-bar.big .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 8px;
    transition: width .4s ease;
}
.progress-text-big {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 52px;
    text-align: right;
}
.progress-steps {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 20px;
}
.progress-steps .step {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 8px 4px;
    position: relative;
}
.step-info {
    flex: 1; display: flex;
    flex-direction: column;
    align-items: flex-start !important;
    gap: 2px;
}
.step-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.step-msg {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.step-pct {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 42px;
    text-align: right;
}
.progress-steps .step.active .step-name {
    color: var(--primary);
    font-weight: 600;
}
.progress-steps .step.completed .step-name {
    color: var(--success);
}
.progress-steps .step-line {
    display: none;
}
.step-indicator {
    width: 26px; height: 26px;
}
.step.running .step-indicator {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(74,124,89,0.2);
    animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(74,124,89,0.18); }
    50%      { box-shadow: 0 0 0 8px rgba(74,124,89,0.04); }
}

/* Spinner */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: var(--text-muted);
}
.loading-state p {
    margin-top: 14px;
    font-size: 0.88rem;
}
.spinner {
    width: 38px;
    height: 38px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.empty-state.small {
    padding: 20px 10px;
}
.empty-state.small p {
    font-size: 0.85rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .welcome-section { flex-direction: column; align-items: stretch; }
    .welcome-stats { width: 100%; }
    .stat-card { flex: 1; }
    .panel-dropdown {
        width: calc(100vw - 20px);
        right: 10px !important;
        left: 10px !important;
    }
    .search-box { display: none; }
}

/* Export Dropdown */
.export-dropdown {
    position: relative;
    display: inline-block;
}

.export-dropdown-content {
    display: none;
    position: fixed;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    border-radius: 8px;
    z-index: 10001;
    overflow: hidden;
    border: 1px solid var(--border);
}

.export-dropdown-content.show {
    display: block;
}

/* 测试题弹窗底部空间有限，固定让导出菜单向上展开，避免被页脚或视口裁剪 */
#quizExportMenu {
    position: absolute;
    top: auto;
    left: auto;
    right: 0;
    bottom: calc(100% + 8px);
    max-height: min(320px, calc(100vh - 220px));
    overflow-y: auto;
}

.export-dropdown-content a {
    color: var(--text);
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.export-dropdown-content a:hover {
    background-color: var(--bg-hover);
}

.export-dropdown-content a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.export-dropdown .btn-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
}

.export-dropdown .btn-secondary svg:last-child {
    width: 12px;
    height: 12px;
    transition: transform 0.2s;
}

.export-dropdown.open .btn-secondary svg:last-child {
    transform: rotate(180deg);
}

.btn-sm {
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
}

/* Knowledge point cards */
.kp-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    transition: box-shadow 0.2s;
}
.kp-card:hover {
    box-shadow: var(--shadow-sm);
}
.kp-title {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}
.kp-detail {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 8px;
}
.kp-related {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.kp-related strong {
    color: var(--text-secondary);
}

/* ===== 通用文本溢出处理 ===== */
.modal-body p,
.modal-body li,
.modal-body .quiz-answer,
.modal-body .quiz-explanation,
.modal-body .quiz-source,
.task-title,
.task-meta,
.quiz-question,
.quiz-answer-text,
.quiz-answer-explanation,
.quiz-explanation,
.quiz-source,
.quiz-meta-item,
.quiz-meta-row,
.notif-title,
.notif-body,
.fav-title,
.fav-type {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* 确保文本容器不会溢出 */
.task-title,
.quiz-question {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 多行文本容器 */
.quiz-answer-text,
.quiz-answer-explanation {
    line-height: 1.7;
}

/* 确保模态框内容不会溢出 */
.modal-content {
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-body {
    overflow-x: hidden;
    word-wrap: break-word;
}

/* 删除按钮样式 */
.task-action-btn.delete-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease;
    height: 36px;
}

.task-action-btn.delete-btn:hover {
    background: #dc2626;
}

/* ===== 任务卡片进度条样式 ===== */
.task-card-progress {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.task-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.task-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 3px;
    transition: width 0.8s ease-out;
}

.task-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.task-progress-text {
    color: var(--text-secondary);
    font-weight: 500;
}

.task-progress-status {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.task-progress-status.in-progress {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent);
}

.task-progress-status.completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.task-progress-status.pending {
    background: var(--bg-hover);
    color: var(--text-muted);
}

/* ===== 导航页面切换样式 ===== */
.page-content {
    display: none;
}

.page-content.active {
    display: block;
}

.nav-link.active {
    color: var(--primary);
    background: rgba(74, 124, 89, 0.1);
}

/* ===== 响应式任务卡片 ===== */
@media (max-width: 768px) {
    .task-card-progress {
        margin-top: 8px;
        padding-top: 8px;
    }
    
    .task-progress-bar {
        height: 4px;
    }
    
    .task-progress-info {
        font-size: 0.75rem;
    }
}

/* ===== 我的教材页面 ===== */
.mybooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 16px;
}

.mybook-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    transition: all 0.2s ease;
}

.mybook-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.mybook-icon {
    width: 48px;
    height: 48px;
    background: rgba(74, 124, 89, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.mybook-icon svg {
    width: 24px;
    height: 24px;
}

.mybook-info {
    flex: 1;
    min-width: 0;
}

.mybook-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.mybook-status {
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-hover);
    font-size: 0.75rem;
}

.mybook-status.completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.mybook-size {
    font-size: 0.75rem;
}

.mybook-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ===== 资源库页面 ===== */
.resources-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.resource-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s ease;
}

.resource-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.resource-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.resource-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.resource-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.resource-card-body {
    padding: 16px 20px;
}

.resource-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: background 0.15s ease;
}

.resource-item.available {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.resource-item.unavailable {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    opacity: 0.7;
}
.fav-remove-btn .icon { width: 14px; height: 14px; }

.resource-item svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.resource-item.available svg {
    color: var(--primary);
}

.resource-item span {
    flex: 1;
    color: var(--text);
}

.resource-item .text-muted {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Resource PPT style dropdown */
.resource-item .export-dropdown {
    position: relative;
}

.resource-item .ppt-style-dropdown-menu {
    position: absolute;
    right: 0;
    bottom: 100%;
    z-index: 10000;
    min-width: 150px;
}

.resource-item .export-dropdown-content a {
    white-space: nowrap;
}

.resource-gen-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.resource-ppt-style {
    font-size: 0.78rem;
    color: var(--primary);
    background: rgba(74, 124, 89, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.resource-ppt-chapters {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.04);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
    display: inline-block;
}

.resource-download-link {
    flex-shrink: 0;
    padding: 5px 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.82rem;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.15s;
}
.resource-download-link:hover {
    opacity: 0.85;
    color: white;
}

/* ===== 收藏页面 ===== */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.fav-page-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.fav-page-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.fav-page-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fav-page-icon svg {
    width: 22px;
    height: 22px;
}

.fav-page-icon.knowledge {
    background: rgba(74, 124, 89, 0.1);
    color: var(--primary);
}

.fav-page-icon.quiz {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent);
}

.fav-page-icon.ppt {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.fav-page-content {
    flex: 1;
    min-width: 0;
}

.fav-page-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.fav-page-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fav-page-remove-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all .15s ease;
    opacity: 0;
}
.fav-remove-btn .icon { width: 14px; height: 14px; }
.fav-page-item:hover .fav-page-remove-btn { opacity: 1; }
.fav-page-remove-btn:hover {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
    border-color: #ef4444;
}

/* ===== 统一收藏按钮样式 ===== */
.icon-btn-sm.fav-active {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
}

.icon-btn-sm.fav-active svg {
    fill: var(--warning);
}

/* ===== PPT Chapter + Style Selector ===== */
.ppt-chapter-selector {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.ppt-style-selector-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px;
    background: var(--bg);
    border-radius: 10px;
    border: 1px solid var(--border);
}
.ppt-style-selector-inline label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}
.ppt-chapter-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}

.ppt-style-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ppt-style-chip {
    padding: 6px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ppt-style-chip:hover {
    border-color: var(--primary-light);
    color: var(--text);
}

.ppt-style-chip.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 500;
}

/* ===== 帮助页面 - 文档风格 ===== */
.help-layout {
    display: flex;
    gap: 0;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 68px);
}
.help-sidebar {
    width: 240px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    height: calc(100vh - 68px);
    overflow-y: auto;
}
.help-sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    padding: 0 20px 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}
.help-nav-group {
    margin-bottom: 8px;
}
.help-nav-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 20px 4px;
}
.help-nav-item {
    display: block;
    padding: 6px 20px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.help-nav-item:hover {
    color: var(--primary);
    background: rgba(74, 124, 89, 0.05);
}
.help-nav-item.active {
    color: var(--primary);
    background: rgba(74, 124, 89, 0.08);
    border-left-color: var(--primary);
    font-weight: 600;
}
.help-main {
    flex: 1;
    padding: 24px 40px;
    max-width: 800px;
}
.help-section-content {
    display: none;
}
.help-section-content.active {
    display: block;
}
.help-section-content h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.help-section-content h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin: 28px 0 12px;
}
.help-section-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
}
.help-lead {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}
.help-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 40px;
    margin: 20px 0 28px;
}
.help-feature-item {
    padding: 14px 0;
    border-bottom: 1px solid #eaeaea;
}
.help-feature-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}
.help-feature-title .icon {
    color: #555;
}
.help-table-icon { width: 16px; height: 16px; vertical-align: -3px; color: var(--primary); }
.help-feature-item p {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.6;
    margin: 6px 0 0;
}
.help-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 20px;
    font-size: 0.9rem;
}
.help-table th, .help-table td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}
.help-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text);
}
.help-table td {
    color: var(--text-secondary);
}
.help-table code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85rem;
    color: var(--primary);
}
.help-steps {
    margin: 16px 0;
}
.help-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.help-step:last-child {
    border-bottom: none;
}
.help-step-num {
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}
.help-ordered-list, .help-list {
    margin: 12px 0;
    padding-left: 24px;
}
.help-ordered-list li, .help-list li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.8;
}
.help-tip .icon { width: 16px; height: 16px; vertical-align: -2px; margin-right: 4px; color: var(--primary); }
.help-tip-icon { flex-shrink: 0; width: 16px; height: 16px; margin-top: 3px; color: var(--primary); }
.help-tip {
    background: rgba(74, 124, 89, 0.08);
    border-left: 3px solid var(--primary);
    padding: 12px 16px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 16px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
/* help-tip / help-table 内联图标：基类 .icon 固定 16px，这里覆盖尺寸与对齐，
   否则 <svg class="icon help-tip-icon"> 会以 16px 与文字基线错位显示。 */
.help-tip-icon {
    width: 15px;
    height: 15px;
    vertical-align: -2px;
    margin-right: 2px;
    color: var(--primary);
}
.help-table-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    color: var(--primary);
}
.help-faq-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.help-faq-item:last-child {
    border-bottom: none;
}
.help-faq-item h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.help-faq-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}
@media (max-width: 768px) {
    .help-layout { flex-direction: column; }
    .help-sidebar { width: 100%; position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
    .help-main { padding: 20px; }
    .help-feature-grid { grid-template-columns: 1fr; }
}

/* ===== 响应式设计补充 ===== */
@media (max-width: 768px) {
    .mybooks-grid {
        grid-template-columns: 1fr;
    }
    
    .favorites-grid {
        grid-template-columns: 1fr;
    }
    
    .help-content {
        grid-template-columns: 1fr;
    }
    .mybook-actions {
        flex-direction: column;
    }
}

/* ===== 资源库标签页 ===== */
.resource-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.resource-tab {
    padding: 8px 20px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.resource-tab:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.resource-tab.active {
    background: var(--primary);
    color: white;
    font-weight: 500;
}

.resource-tab-content {
    min-height: 200px;
}

.resource-tab-pane {
    display: none;
}

.resource-tab-pane.active {
    display: block;
}

/* 资源库名称搜索框：贴在 tab 行最右侧 */
.resource-search-box {
    display: flex;
    align-items: center;
    margin-left: auto;
    align-self: center;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    width: 240px;
    max-width: 40%;
}

.resource-search-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    margin-right: 6px;
    flex-shrink: 0;
}

.resource-search-box input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    color: var(--text);
}

.resource-search-box input::placeholder {
    color: var(--text-muted);
}

.resource-search-clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.resource-search-clear-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.resources-list .resource-card {
    margin-bottom: 16px;
}

/* ===== 任务卡片PPT风格下拉框 ===== */
.task-actions .export-dropdown {
    position: relative;
    display: inline-block;
}

.task-actions .ppt-style-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    background: white;
    min-width: 120px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    z-index: 1000;
    margin-bottom: 4px;
    border: 1px solid var(--border);
}

.task-actions .ppt-style-dropdown.show {
    display: block;
}

.task-actions .ppt-style-dropdown a {
    display: block;
    padding: 8px 12px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.task-actions .ppt-style-dropdown a:hover {
    background: var(--bg-hover);
}

/* ===== Quiz Type Dropdown ===== */
.quiz-type-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    background: white;
    min-width: 140px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    z-index: 1000;
    margin-bottom: 4px;
    border: 1px solid var(--border);
}
.quiz-type-dropdown.show {
    display: block;
}
.quiz-type-dropdown a {
    display: block;
    padding: 10px 14px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.2s;
}
.quiz-type-dropdown a:first-child {
    border-radius: 8px 8px 0 0;
}
.quiz-type-dropdown a:last-child {
    border-radius: 0 0 8px 8px;
}
.quiz-type-dropdown a:hover {
    background: var(--bg-hover);
}

/* ===== Resource Preview Button ===== */
.resource-preview-btn {
    flex-shrink: 0;
    padding: 5px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--primary);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
}
.resource-preview-btn:hover {
    background: rgba(74, 124, 89, 0.08);
    border-color: var(--primary-light);
}

/* ===== Preview Modal Styles ===== */
.preview-content {
    font-size: 0.9rem;
    line-height: 1.7;
}
.preview-book-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.preview-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.preview-quiz-item {
    padding: 14px;
    margin-bottom: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.preview-quiz-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.preview-q-num {
    width: 24px;
    height: 24px;
    background: var(--accent);
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.78rem;
    flex-shrink: 0;
}
.preview-q-type {
    padding: 2px 8px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent);
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 500;
}
.preview-q-diff {
    padding: 2px 8px;
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 500;
}
.preview-q-question {
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.6;
}
.preview-q-options {
    margin-bottom: 8px;
}
.preview-q-option {
    padding: 4px 10px;
    margin-bottom: 2px;
    font-size: 0.86rem;
    color: var(--text-secondary);
}
.preview-q-answer {
    padding: 6px 10px;
    background: rgba(74, 124, 89, 0.06);
    border-left: 3px solid var(--primary);
    border-radius: 0 6px 6px 0;
    font-size: 0.85rem;
    color: var(--primary-dark);
    margin-bottom: 6px;
    line-height: 1.7;
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.preview-q-explanation {
    padding: 10px 12px;
    margin-top: 8px;
    background: rgba(37, 99, 235, 0.05);
    border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0;
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.6;
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.preview-q-source .icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
.preview-q-source {
    padding: 6px 10px;
    margin-top: 4px;
    background: rgba(37, 99, 235, 0.04);
    border-left: 3px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.7;
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.preview-ppt-info {
    text-align: center;
    padding: 20px;
}
.preview-ppt-icon {
    margin-bottom: 16px;
}
.preview-ppt-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}
.preview-ppt-style {
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 8px;
}
.preview-ppt-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* ===== Chapter Selector ===== */
.chapter-selector-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chapter-selector-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.chapter-selector-item:hover {
    border-color: var(--primary);
    background: rgba(74, 124, 89, 0.04);
    box-shadow: var(--shadow-sm);
}
.chapter-selector-num {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.chapter-selector-title {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chapter-selector-pages {
    font-size: 0.78rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.chapter-select-actions .btn-sm {
    padding: 4px 12px;
    font-size: 0.82rem;
    border-radius: 6px;
}

.chapter-detect-loading .init-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Profile Modal ===== */
.avatar-large {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin: 0 auto 12px;
}

.profile-form .form-group {
    margin-bottom: 16px;
}

.profile-form .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.profile-form .form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg);
    transition: all 0.2s;
    outline: none;
}

.profile-form .form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.12);
}


/* ============================================================
   Chapter Selection Modal Styles
   ============================================================ */

.chapter-checkbox-item {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    background: var(--bg-primary);
}

.chapter-checkbox-item:hover {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.chapter-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    width: 100%;
}

.chapter-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.chapter-checkbox-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.chapter-checkbox-title {
    font-weight: 500;
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.4;
}

.chapter-checkbox-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chapter-type-chapter {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 4px;
    background: var(--primary-light, #e8f5e9);
    color: var(--primary, #4A7C59);
    font-size: 0.75rem;
    font-weight: 500;
}

.chapter-type-appendix {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 4px;
    background: #fff3e0;
    color: #e65100;
    font-size: 0.75rem;
    font-weight: 500;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== PPT 风格画廊（豆包式风格选择） ===== */
.ppt-gallery-modal {
    padding: 16px;
}

.ppt-gallery-modal-content {
    width: 96vw;
    max-width: 1180px;
    max-height: 90vh;
    padding: 0;
    overflow: hidden;
}

.ppt-gallery-body {
    padding: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    min-height: 0;
    overflow: hidden;
}

.ppt-gallery-multi {
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 5px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.ppt-gallery-multi:hover { border-color: var(--primary); color: var(--primary); }
.ppt-gallery-multi.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.ppt-gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px 10px;
}

.ppt-gallery-search {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.ppt-gallery-search svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.ppt-gallery-search input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.85rem;
    background: var(--bg-card);
    color: var(--text);
    outline: none;
}

.ppt-gallery-search input:focus { border-color: var(--primary); }

.ppt-gallery-total {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.ppt-gallery-cats {
    display: flex;
    gap: 8px;
    padding: 0 20px 10px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.ppt-gallery-cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.82rem;
    padding: 5px 12px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.16s ease;
}

.ppt-gallery-cat span { font-size: 0.72rem; color: var(--text-muted); }
.ppt-gallery-cat:hover { border-color: var(--primary); color: var(--primary); }
.ppt-gallery-cat.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.ppt-gallery-cat.active span { color: rgba(255, 255, 255, 0.8); }

.ppt-gallery-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    min-height: 0;
    border-top: 1px solid var(--border-light);
}

.ppt-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    /* auto 行高会在「高度确定的滚动网格」里被压缩到不足 30px，必须锁成内容高度 */
    grid-auto-rows: max-content;
    gap: 14px;
    align-content: start;
    padding: 16px 20px 20px;
    overflow-y: auto;
    min-height: 0;
}

.ppt-gallery-empty {
    grid-column: 1 / -1;
    font-size: 0.84rem;
    color: var(--text-muted);
    padding: 12px 0;
}

.ppt-style-card {
    border: 1px solid #ececef;
    border-radius: 12px;
    background: var(--bg-card);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.ppt-style-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-light);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.10);
}

.ppt-style-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(74, 124, 89, 0.25);
}

.ppt-style-card-thumb {
    position: relative;
    height: 104px;
    background: #f1f5f9;
    overflow: hidden;
}

.ppt-style-card-content {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
    display: block;
}

.ppt-style-card-cover {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 55%;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.22);
    background: #fff;
}

.ppt-style-card.selected .ppt-style-card-thumb::after {
    content: "\2713";
    position: absolute;
    left: 6px;
    top: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
}

.ppt-style-card-badge {
    position: absolute;
    left: 6px;
    bottom: 6px;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 0.66rem;
    padding: 1px 7px;
    border-radius: 999px;
}

.ppt-style-card-info { padding: 8px 10px 10px; }

.ppt-style-card-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text);
}

.ppt-style-card-swatches { display: inline-flex; gap: 3px; flex: 0 0 auto; }

.ppt-style-card-swatches i,
.ppt-gallery-preview-meta i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(15, 23, 42, 0.12);
}

.ppt-style-card-desc {
    margin-top: 4px;
    font-size: 0.74rem;
    line-height: 1.45;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ppt-gallery-preview {
    border-left: 1px solid var(--border);
    padding: 16px;
    overflow-y: auto;
    min-height: 0;
    background: var(--bg);
}

.ppt-gallery-preview-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.ppt-gallery-preview-name { font-size: 0.95rem; font-weight: 600; }
.ppt-gallery-preview .ppt-style-card-badge { position: static; }

.ppt-gallery-preview-pages figure { margin: 0 0 10px; }

.ppt-gallery-preview-pages img {
    width: 100%;
    display: block;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}

.ppt-gallery-preview-pages figcaption {
    margin-top: 4px;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.ppt-gallery-preview-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.ppt-gallery-preview-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.ppt-gallery-preview-meta i { width: 12px; height: 12px; }
.ppt-gallery-preview-cat { font-size: 0.72rem; color: var(--text-muted); }

.ppt-gallery-preview-prompt {
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--text-muted);
    border-top: 1px dashed var(--border);
    padding-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ppt-gallery-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.ppt-gallery-selinfo {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ppt-gallery-actions { display: flex; gap: 10px; flex: 0 0 auto; }
.ppt-gallery-actions .btn-primary {
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 0.85rem;
    cursor: pointer;
}

/* 章节选择器里的「当前风格」卡片 */
.ppt-style-picked-card {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
    background: var(--bg-hover);
}

.ppt-style-picked-thumb {
    flex: 0 0 132px;
    width: 132px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #fff;
}

.ppt-style-picked-thumb img { width: 100%; display: block; }
.ppt-style-picked-label { font-size: 0.72rem; color: var(--text-muted); }

.ppt-style-picked-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
}

.ppt-style-picked-extra {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--primary);
    background: rgba(74, 124, 89, 0.12);
    border-radius: 999px;
    padding: 1px 8px;
}

.ppt-style-picked-desc { font-size: 0.78rem; color: var(--text-secondary); }
.ppt-style-picked-actions { margin-left: auto; }

.ppt-style-picked-extra-list {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.ppt-chapter-tip { font-size: 0.76rem; color: var(--text-muted); margin-top: 10px; }

/* 候选风格方案对比 */
.ppt-candidates-head {
    font-size: 0.84rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.ppt-candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

.ppt-candidate {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    background: var(--bg-card);
}

.ppt-candidate.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(74, 124, 89, 0.18);
}

.ppt-candidate-thumb {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
}

.ppt-candidate-thumb img { width: 100%; display: block; }

.ppt-candidate-badge {
    position: absolute;
    left: 8px;
    top: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
}

.ppt-candidate-name { font-size: 0.9rem; font-weight: 600; }
.ppt-candidate-meta { font-size: 0.76rem; color: var(--text-secondary); }
.ppt-candidate-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }

.resource-ppt-compare { margin-top: 8px; }

/* ============================================================
   布局重构：全局左侧边栏（仿豆包）
   · 顶部 Logo + 搜索图标，点击搜索图标展开搜索框
   · 左下角用户信息区，点击向上弹出菜单（资源库/我的收藏/帮助/通知 ...）
   ============================================================ */

/* 侧边栏品牌：点击返回工作台 */
.wb-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 4px 6px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}

.wb-brand:hover .wb-brand-name {
    color: var(--primary);
}

/* 侧边栏搜索（点击搜索图标后展开） */
.wb-search-row {
    width: var(--wb-side-w);
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 0 12px 10px;
}

.wb-search-row[hidden] {
    display: none;
}

.wb-search-row .search-box {
    width: 100%;
    padding: 7px 10px;
    background: #ffffff;
    border-color: #e4e4e4;
}

/* 搜索结果下拉：比侧边栏略宽，避免标题与类型标签被裁切 */
.wb-sidebar .search-results-dropdown {
    left: 0;
    right: auto;
    width: 320px;
    min-width: 0;
    max-width: 320px;
}

.wb-menu-item:disabled {
    color: #b9b9b9;
    cursor: not-allowed;
}

.wb-menu-item:disabled:hover {
    background: transparent;
}

.wb-menu-item:disabled svg {
    color: #cfcfcf;
}

/* ---------- 左下角用户详情展开栏（仿豆包气泡菜单） ---------- */
.wb-user-wrap {
    position: relative;
}

.user-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 10070;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #ececec;
    border-radius: 12px;
    box-shadow: 0 16px 36px -18px rgba(0, 0, 0, .38);
    opacity: 0;
    transform: translateY(6px) scale(.98);
    transform-origin: bottom left;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.user-popover.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.user-popover-group {
    display: flex;
    flex-direction: column;
}

.user-popover .user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-family: inherit;
    font-size: 13.5px;
    color: #3f3f3f;
    text-align: left;
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}

.user-popover .user-dropdown-item:hover {
    background: #f2f2f2;
    color: #111111;
}

.user-popover .user-dropdown-item.danger {
    color: var(--danger);
}

.user-popover .user-dropdown-item.danger:hover {
    background: rgba(239, 68, 68, .08);
    color: var(--danger);
}

/* 通知条目内的角标：改为行内右对齐，不再依赖绝对定位 */
.user-popover .user-dropdown-item .badge {
    position: static;
    margin-left: auto;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--danger);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
}

/* 通知 / 收藏面板：锚定在侧边栏右侧（left 由 JS 跟随侧边栏宽度计算） */
.panel-dropdown {
    top: auto;
    bottom: 24px;
    left: 272px;
}

/* ============================================================
   对话历史（仿 DeepSeek）
   · 常态收起为一条窄轨，鼠标悬浮 / 键盘聚焦时平滑展开
   · 悬浮于内容之上，不挤压右侧主对话区
   ============================================================ */
.wb-hist {
    --wb-hist-rail-w: 44px;
    --wb-hist-panel-w: 240px;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 25;
    display: flex;
    width: var(--wb-hist-rail-w);
    overflow: hidden;
    border-radius: 0 12px 12px 0;
    transition: width .26s ease, box-shadow .26s ease;
}

.wb-hist[hidden] {
    display: none;
}

.wb-hist:hover,
.wb-hist:focus-within,
.wb-hist.pinned {
    width: calc(var(--wb-hist-rail-w) + var(--wb-hist-panel-w));
    box-shadow: 0 0 0 1px #ececec, 16px 0 40px -28px rgba(15, 23, 42, .45);
}

.wb-hist-rail {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: var(--wb-hist-rail-w);
    flex: 0 0 var(--wb-hist-rail-w);
    padding: 12px 0;
    border: none;
    background: transparent;
    font-family: inherit;
    color: #7a7a7a;
    cursor: pointer;
}

.wb-hist-rail:hover {
    color: #3A6347;
}

.wb-hist-rail svg {
    width: 20px;
    height: 20px;
    padding: 5px;
    box-sizing: content-box;
    border: 1px solid #ececec;
    border-radius: 9px;
    background: #ffffff;
    transition: background .18s ease, border-color .18s ease;
}

.wb-hist:hover .wb-hist-rail svg,
.wb-hist-rail:focus-visible svg {
    background: #eef4ef;
    border-color: #dbe7de;
}

.wb-hist-count {
    font-size: 11px;
    line-height: 1;
    color: #9a9a9a;
}

.wb-hist-count[hidden] {
    display: none;
}

.wb-hist-panel {
    display: flex;
    flex-direction: column;
    width: var(--wb-hist-panel-w);
    flex: 0 0 var(--wb-hist-panel-w);
    min-height: 0;
    padding: 12px 0 10px;
    background: #ffffff;
    border-right: 1px solid #ececec;
    opacity: 0;
    transition: opacity .18s ease;
}

.wb-hist:hover .wb-hist-panel,
.wb-hist:focus-within .wb-hist-panel,
.wb-hist.pinned .wb-hist-panel {
    opacity: 1;
    transition-delay: .06s;
}

.wb-hist-head {
    display: flex;
    align-items: center;
    padding: 0 14px 10px;
}

.wb-hist-title {
    font-size: 12px;
    color: #9a9a9a;
}


.wb-hist-scroll {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 8px 4px;
    overflow-y: auto;
    overflow-x: hidden;
}

.wb-hist-scroll::-webkit-scrollbar {
    width: 6px;
}

.wb-hist-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.wb-hist-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, .10);
    border-radius: 999px;
}

.wb-hist-scroll:hover::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, .22);
}

.wb-hist-group {
    padding: 10px 8px 4px;
    font-size: 11.5px;
    color: #a5a5a5;
}

.wb-hist-item {
    display: flex;
    align-items: center;
    border-radius: 8px;
    transition: background .16s ease;
}

.wb-hist-item:hover {
    background: rgba(74, 124, 89, .10);
}

.wb-hist-item-main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 13.5px;
    color: #3f3f3f;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.wb-hist-item-more {
    flex: 0 0 auto;
    padding: 6px 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-family: inherit;
    color: #8a8a8a;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity .16s ease, color .16s ease;
}

.wb-hist-item:hover .wb-hist-item-more,
.wb-hist-item-more:focus-visible {
    opacity: 1;
}

.wb-hist-item-more:hover {
    color: #3A6347;
}

.wb-hist-empty {
    padding: 14px 12px;
    font-size: 13px;
    color: #a5a5a5;
}

/* 从对话历史定位到某条消息时的闪烁提示 */
.wb-msg.wb-msg-flash .wb-msg-bubble {
    animation: wb-msg-flash 1.5s ease;
}

@keyframes wb-msg-flash {
    0%, 35% { outline: 3px solid rgba(74, 124, 89, .35); outline-offset: 2px; }
    100% { outline: 3px solid rgba(74, 124, 89, 0); outline-offset: 2px; }
}

@media (max-width: 860px) {
    .wb-hist {
        --wb-hist-panel-w: 220px;
    }
}


/* ===== 右侧操作栏（操作按钮区域） ===== */
.wb-result-layout {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.wb-result-layout .wb-result-scroll {
    flex: 1 1 auto;
    min-width: 0;
}

.wb-action-sidebar {
    flex: 0 0 220px;
    width: 220px;
    min-width: 0;
    background: #fafafa;
    border-left: 1px solid #ececec;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: width .22s ease, flex-basis .22s ease;
}

.wb-action-sidebar[hidden] {
    display: none;
}

.wb-action-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 16px 12px 8px 16px;
    border-bottom: 1px solid #f0f0f0;
}

/* 收起 / 展开操作栏的按钮（需求 2） */
.wb-action-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #8a8a8a;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

.wb-action-sidebar-toggle:hover {
    background: #f0f0f0;
    color: #3f3f3f;
}

.wb-action-sidebar-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform .22s ease;
}

.wb-action-sidebar.collapsed .wb-action-sidebar-toggle svg {
    transform: rotate(180deg);
}

.wb-action-sidebar-title {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wb-action-sidebar-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wb-sidebar-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    background: #ffffff;
    font-family: inherit;
    font-size: 13px;
    color: #3f3f3f;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
    text-align: left;
}

.wb-sidebar-action-btn:hover:not(:disabled) {
    background: #f0f0f0;
    border-color: #dcdcdc;
}

.wb-sidebar-action-btn.primary {
    font-weight: 600;
    color: #2f2f2f;
}

.wb-sidebar-action-btn.primary:hover:not(:disabled) {
    background: rgba(74, 124, 89, 0.08);
    border-color: var(--primary-light);
    color: var(--primary-dark);
}

.wb-sidebar-action-sep {
    height: 1px;
    margin: 4px 2px;
    background: #ececec;
}

.wb-sidebar-action-btn.secondary {
    padding: 8px 12px;
    border-color: transparent;
    background: transparent;
    font-size: 12.5px;
    color: #7a7a7a;
}

.wb-sidebar-action-btn.secondary:hover:not(:disabled) {
    background: #f0f0f0;
    border-color: #e6e6e6;
    color: #3f3f3f;
}

.wb-sidebar-action-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.wb-sidebar-action-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.wb-sidebar-action-btn .action-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 右侧操作栏「查看PPT」列表：一个任务可能生成过多个 PPT，逐条列出可分别预览 */
.wb-ppt-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 2px;
}

/* 作者样式 display:flex 会覆盖 UA 的 [hidden]，需显式补回，空列表时才能隐藏 */
.wb-ppt-list[hidden] {
    display: none;
}

.wb-ppt-list-title {
    padding: 0 2px;
    font-size: 12px;
    font-weight: 600;
    color: #7a7a7a;
}

.wb-ppt-list-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wb-ppt-loading {
    padding: 6px 2px;
    font-size: 12px;
    color: #a0a0a0;
}

.wb-ppt-item {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ececec;
    border-radius: 8px;
    background: #fafafa;
    font-family: inherit;
    font-size: 12.5px;
    color: #3f3f3f;
    text-align: left;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.wb-ppt-item:hover {
    background: rgba(74, 124, 89, 0.08);
    border-color: var(--primary-light);
    color: var(--primary-dark);
}

.wb-ppt-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.wb-ppt-item.current {
    border-color: var(--primary-light);
    background: rgba(74, 124, 89, 0.06);
}

.wb-ppt-item-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.wb-ppt-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wb-ppt-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: #9a9a9a;
}

.wb-ppt-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #cfcfcf;
}

.wb-ppt-badge {
    flex-shrink: 0;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--primary);
    color: #ffffff;
    font-size: 11px;
    line-height: 16px;
}

/* 收起态：只留图标，主内容区自动变宽（需求 2） */
.wb-action-sidebar.collapsed {
    flex: 0 0 56px;
    width: 56px;
}

.wb-action-sidebar.collapsed .wb-action-sidebar-head {
    justify-content: center;
    padding: 16px 8px 8px;
}

.wb-action-sidebar.collapsed .wb-action-sidebar-title {
    display: none;
}

.wb-action-sidebar.collapsed .wb-action-sidebar-body {
    padding: 12px 8px;
}

.wb-action-sidebar.collapsed .wb-sidebar-action-btn {
    justify-content: center;
    padding: 10px 0;
}

.wb-action-sidebar.collapsed .wb-sidebar-action-btn .action-label {
    display: none;
}

.wb-action-sidebar.collapsed .wb-ppt-list {
    display: none;
}

/* ===== 内嵌章节选择面板（替代模态框，在主对话区直接展示） ===== */
.wb-chapter-select-panel {
    max-width: 700px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .04);
    overflow: hidden;
}

.wb-chapter-panel-head {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.wb-chapter-panel-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
    color: #1f1f1f;
}

.wb-chapter-panel-info {
    font-size: 13px;
    color: #888;
    line-height: 1.5;
}

.wb-chapter-panel-info strong {
    color: #333;
}

.wb-chapter-panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.wb-chapter-panel-actions .btn-sm {
    padding: 4px 12px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #555;
    cursor: pointer;
    transition: background .15s;
}

.wb-chapter-panel-actions .btn-sm:hover {
    background: #f0f0f0;
}

.wb-chapter-panel-count {
    margin-left: auto;
    font-size: 12px;
    color: #999;
}

.wb-chapter-panel-list {
    padding: 8px 16px;
    max-height: 400px;
    overflow-y: auto;
}

.wb-chapter-panel-loading {
    text-align: center;
    padding: 40px 0;
}

.wb-chapter-panel-loading .init-spinner {
    margin: 0 auto 16px;
}

.wb-chapter-panel-loading-text {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.wb-chapter-panel-error {
    text-align: center;
    padding: 30px 24px;
    color: var(--error);
}

.wb-chapter-panel-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ===== 资源库抽屉（按会话隔离，右侧滑出） ===== */
.resource-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .3);
    z-index: 9990;
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}

.resource-drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.resource-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    bottom: 0;
    width: 400px;
    max-width: 90vw;
    background: #ffffff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, .12);
    z-index: 9991;
    display: flex;
    flex-direction: column;
    transition: right .3s cubic-bezier(.4, 0, .2, 1);
}

.resource-drawer.active {
    right: 0;
}

.resource-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.resource-drawer-title {
    flex: 1;
    min-width: 0;
    margin-right: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #1f1f1f;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #999;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s;
}

.resource-drawer-close:hover {
    background: #f0f0f0;
    color: #333;
}

.resource-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.resource-drawer-tabs {
    display: flex;
    gap: 4px;
    padding: 0 20px 12px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.resource-drawer-tab {
    padding: 6px 14px;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: all .15s;
}

.resource-drawer-tab:hover {
    background: #f5f5f5;
}

.resource-drawer-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.resource-drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: background .15s;
}

.resource-drawer-footer {
    padding-top: 4px;
    text-align: center;
}

.resource-drawer-footer .resource-drawer-item-btn {
    padding: 7px 16px;
    font-size: 12px;
}

.resource-drawer-item:hover {
    background: #fafafa;
}

.resource-drawer-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.resource-drawer-item-icon.knowledge {
    background: rgba(16, 185, 129, .1);
    color: #10b981;
}

.resource-drawer-item-icon.quiz {
    background: rgba(99, 102, 241, .1);
    color: #6366f1;
}

.resource-drawer-item-icon.ppt {
    background: rgba(245, 158, 11, .1);
    color: #f59e0b;
}

.resource-drawer-item-icon svg {
    width: 18px;
    height: 18px;
}

.resource-drawer-item-info {
    flex: 1;
    min-width: 0;
}

.resource-drawer-item-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-drawer-item-meta {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.resource-drawer-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.resource-drawer-item-btn {
    padding: 4px 10px;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    background: #fff;
    font-family: inherit;
    font-size: 11px;
    color: #555;
    cursor: pointer;
    transition: background .15s;
}

.resource-drawer-item-btn:hover {
    background: #f0f0f0;
}

.resource-drawer-empty {
    text-align: center;
    padding: 40px 20px;
    color: #bbb;
}

.resource-drawer-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: .4;
}

.resource-drawer-empty p {
    font-size: 13px;
}

/* ===== 任务卡片资源按钮 ===== */
.task-resource-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #b0b0b0;
    cursor: pointer;
    transition: all .15s;
    flex-shrink: 0;
}

.task-resource-btn:hover {
    background: rgba(74, 124, 89, .08);
    color: var(--primary);
}

.task-resource-btn svg {
    width: 15px;
    height: 15px;
}

/* ===== 响应式：右侧操作栏在窄屏下隐藏 ===== */
@media (max-width: 1180px) {
    .wb-action-sidebar {
        flex: 0 0 180px;
        width: 180px;
    }
}

@media (max-width: 860px) {
    .wb-action-sidebar {
        display: none !important;
    }
    .resource-drawer {
        width: 100%;
        max-width: 100vw;
    }
}
