/* ============================================================
   兰青优学 · 课研平台 设计系统 v2
   色值全部取自「整体规划/品牌快速参考.md」，不自定义色值
   ============================================================ */

:root {
    /* 主色系 · 兰青蓝 */
    --brand-dark: #00695C;
    --brand: #1A9B9B;
    --brand-mid: #4DBDBA;
    --brand-light: #B2DFDB;
    --brand-pale: #E0F5F5;

    /* 辅助色 */
    --green: #4CAF50;
    --green-light: #A5D6A7;
    --green-pale: #E8F5E9;
    --orange: #F5A623;
    --orange-light: #FFCC80;
    --orange-pale: #FFF3E0;
    --yellow-pale: #FFF9C4;

    /* 语义色 */
    --success: #4CAF50;
    --warning: #FF9800;
    --error: #F44336;
    --info: #1A9B9B;

    /* 文字 & 中性色 */
    --text-1: #1A1A1A;
    --text-2: #3D3D3D;
    --text-3: #6B6B6B;
    --text-4: #9E9E9E;
    --border: #E4E7E7;
    --divider: #EEF1F1;
    --bg-page: #F4F6F6;
    --bg-card: #FAFBFB;
    --white: #FFFFFF;

    /* 布局 */
    --sidebar-w: 232px;
    --topbar-h: 60px;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(16, 60, 58, 0.04);
    --shadow: 0 2px 10px rgba(16, 60, 58, 0.05);
    --shadow-hover: 0 6px 20px rgba(16, 60, 58, 0.09);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
        "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-page);
    color: var(--text-2);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* ==================== 整体布局 ==================== */

.app { display: flex; min-height: 100vh; }

/* ==================== 侧边栏 ==================== */

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    padding: 16px 20px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--divider);
}

.sidebar-brand img { height: 36px; width: auto; display: block; }

.sidebar-nav { flex: 1; padding: 14px 12px; overflow-y: auto; }

.nav-group-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--text-4);
    padding: 4px 10px 8px;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    margin-bottom: 3px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
}

.nav-link:hover { background: var(--brand-pale); color: var(--brand-dark); }

.nav-link.active {
    background: var(--brand-pale);
    color: var(--brand-dark);
    font-weight: 600;
}

.nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 2px;
    background: var(--brand);
}

.nav-link svg { flex-shrink: 0; opacity: 0.9; }

.sidebar-footer {
    padding: 13px 20px;
    border-top: 1px solid var(--divider);
    font-size: 12px;
    color: var(--text-4);
}

/* ==================== 主区域 ==================== */

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar h1 { font-size: 17px; font-weight: 600; color: var(--text-1); letter-spacing: 0.01em; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.env-tag {
    font-size: 12px;
    color: var(--text-3);
    background: var(--bg-page);
    border: 1px solid var(--border);
    padding: 3px 11px;
    border-radius: 999px;
}

.content { padding: 22px 28px 44px; max-width: 1180px; width: 100%; }

/* ==================== 卡片 ==================== */

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==================== 按钮 ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: var(--white); box-shadow: 0 2px 6px rgba(26,155,155,.25); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-success { background: var(--green); color: var(--white); box-shadow: 0 2px 6px rgba(76,175,80,.25); }
.btn-success:hover:not(:disabled) { background: #429846; }
.btn-outline { background: var(--white); border-color: var(--brand); color: var(--brand); }
.btn-outline:hover:not(:disabled) { background: var(--brand-pale); }
.btn-ghost { background: var(--white); color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { border-color: var(--brand-mid); color: var(--brand); background: var(--brand-pale); }
.btn-sm { padding: 6px 11px; font-size: 13px; }

/* ==================== 表单 ==================== */

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-1);
    margin-bottom: 7px;
}

.form-input, .form-select {
    width: 100%;
    height: 40px;
    padding: 8px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-1);
    background: var(--white);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 34px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B6B6B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(26, 155, 155, 0.14);
}

.form-hint { font-size: 12px; color: var(--text-4); margin-top: 6px; }

/* ---------- 自定义下拉框（隐藏原生 select，保留其为数据源） ---------- */

.select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0;
    pointer-events: none;
}

.cselect { position: relative; width: 100%; }

.cselect-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 40px;
    padding: 8px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-1);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.cselect-trigger:hover { border-color: var(--brand-mid); }

.cselect.open .cselect-trigger,
.cselect-trigger:focus-visible {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(26, 155, 155, 0.14);
}

.cselect-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.cselect-trigger > svg {
    flex-shrink: 0;
    color: var(--text-3);
    transition: transform 0.15s;
}

.cselect.open .cselect-trigger > svg { transform: rotate(180deg); }

.cselect-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 50;
    max-height: 264px;
    overflow-y: auto;
    padding: 5px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(10, 30, 28, 0.14);
}

.cselect.open .cselect-menu { display: block; }

.cselect-option {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 9px;
    border-radius: 7px;
    font-size: 14px;
    color: var(--text-2);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

.cselect-option:hover { background: var(--brand-pale); color: var(--brand-dark); }

.cselect-option.selected { color: var(--brand-dark); font-weight: 500; }

.cselect-option.cselect-empty { color: var(--text-4); cursor: default; }
.cselect-option.cselect-empty:hover { background: transparent; }

.cselect-check {
    width: 18px;
    flex-shrink: 0;
    display: inline-flex;
    color: var(--brand);
}

.cselect-option-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-row { margin-bottom: 15px; }
.form-row:last-child { margin-bottom: 0; }

/* ==================== 标签 / 徽标 ==================== */

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 5px;
    font-size: 12px;
    line-height: 1.75;
    white-space: nowrap;
}

.tag-info { background: var(--brand-pale); color: var(--brand-dark); }
.tag-success { background: var(--green-pale); color: #2E7D32; }
.tag-warning { background: var(--orange-pale); color: #9A6800; }
.tag-neutral { background: var(--bg-page); color: var(--text-3); border:1px solid var(--border); }
.tag-error { background: #FDECEA; color: var(--error); }
.tag-mono { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 11px; letter-spacing:.02em; }

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--brand-pale);
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 600;
}

/* ==================== 步骤条 ==================== */

.steps { display: flex; align-items: flex-start; margin: 2px 0 28px; }

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

.step-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--border);
    color: var(--text-4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    z-index: 1;
    transition: all .2s;
}

.step-label { font-size: 12.5px; color: var(--text-4); white-space: nowrap; }
.step.active .step-circle { border-color: var(--brand); color: var(--white); background: var(--brand); box-shadow:0 2px 8px rgba(26,155,155,.35); }
.step.active .step-label { color: var(--brand-dark); font-weight: 600; }
.step.done .step-circle { border-color: var(--green); background: var(--green); color: var(--white); }
.step.done .step-label { color: var(--text-2); }

.step-connector { flex: 1; height: 2px; background: var(--border); margin: 16px 10px 0; min-width: 24px; border-radius: 1px; }
.step-connector.done { background: var(--green); }

/* ==================== 弹窗 ==================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 40, 38, 0.42);
    backdrop-filter: blur(2px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    z-index: 100;
    overflow-y: auto;
}

.modal-overlay.show { display: flex; }

/* 轻量确认弹窗 */
.cfm-overlay { align-items: center; }
.cfm {
    background: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
    padding: 26px 24px 20px;
    box-shadow: 0 16px 48px rgba(10, 30, 28, 0.24);
    text-align: center;
}
.cfm-icon { color: var(--orange); display: flex; justify-content: center; }
.cfm-title { font-size: 16px; font-weight: 600; color: var(--text-1); margin-top: 12px; }
.cfm-message { font-size: 13.5px; color: var(--text-3); line-height: 1.7; margin-top: 8px; }
.cfm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}
.btn-danger {
    background: var(--error);
    color: #fff;
    border: 1px solid var(--error);
}
.btn-danger:hover { background: #d04035; border-color: #d04035; }

.modal {
    background: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 860px;
    box-shadow: 0 16px 48px rgba(10, 30, 28, 0.24);
    display: flex;
    flex-direction: column;
}

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

.modal-header h2 { font-size: 16px; font-weight: 600; color: var(--text-1); }

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
    display: flex;
    align-items: center;
}
.modal-close:hover { background: var(--bg-page); color: var(--text-1); }

.modal-body { padding: 26px 26px 18px; }

.modal-footer {
    padding: 15px 24px;
    border-top: 1px solid var(--divider);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* ==================== 上传拖拽区 ==================== */

.dropzone {
    border: 2px dashed var(--brand-mid);
    border-radius: var(--radius);
    padding: 46px 20px 42px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: var(--brand-pale);
}

.dropzone:hover { border-color: var(--brand); background: #EBF7F7; }
.dropzone.dragover { border-color: var(--brand-dark); background: #DDF2F2; }

.dropzone-icon { color: var(--brand); display: flex; justify-content: center; margin-bottom: 13px; }
.dropzone-text { font-size: 14.5px; color: var(--text-1); font-weight: 500; }
.dropzone-hint { font-size: 12.5px; color: var(--text-3); margin-top: 7px; }

.file-meta {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 15px;
    font-size: 13px;
}

.file-meta .fname {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ==================== 工具栏卡片 ==================== */

.toolbar-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.toolbar-select { flex: 1; min-width: 250px; max-width: 560px; }

.select-with-action { display: flex; gap: 9px; }
.select-with-action .form-select,
.select-with-action .cselect { flex: 1; min-width: 0; }

.icon-btn { width: 40px; height: 40px; padding: 0; flex-shrink: 0; }

.btn-lg { height: 40px; padding: 9px 22px; font-size: 14.5px; }

.info-strip {
    margin-top: 17px;
    padding-top: 15px;
    border-top: 1px solid var(--divider);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.info-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-3);
}

.info-stat b { color: var(--text-1); font-weight: 600; font-size: 13.5px; }

.info-stat-dot {
    width: 3px; height: 3px;
    border-radius: 50%;
    background: var(--text-4);
    margin: 0 5px;
}

/* ==================== 教材管理 ==================== */

/* 统计看板（全部教材视图） */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.stat-num { font-size: 26px; font-weight: 700; color: var(--text-1); line-height: 1.2; }
.stat-num.c-brand { color: var(--brand); }
.stat-num.c-green { color: var(--green); }
.stat-num.c-orange { color: var(--orange); }
.stat-num.c-error { color: var(--error); }
.stat-label { font-size: 12.5px; color: var(--text-3); }

.tb-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 20px;
    margin-bottom: 12px;
}

.tb-row-main { min-width: 0; }

.tb-row-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
}

.tb-row-icon { display: inline-flex; color: var(--brand); }

.tb-row-meta { margin-top: 5px; font-size: 12.5px; }

.tb-row-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* 确认弹窗支持多行文案 */
.cfm-message { white-space: pre-line; }

/* ==================== 章节 / 知识点树 ==================== */

.chapter-card { padding: 0; overflow: hidden; }

.chapter-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 15px 20px;
    border-bottom: 1px solid var(--divider);
    background: var(--bg-card);
}

.chapter-index {
    font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--brand-dark);
    background: var(--brand-pale);
    padding: 3px 9px;
    border-radius: 6px;
    letter-spacing: .03em;
}

.chapter-title { font-size: 15px; font-weight: 600; color: var(--text-1); }

.chapter-head-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.chapter-body { padding: 18px 20px 20px; }

.section-block + .section-block { margin-top: 18px; }

.section-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--brand-dark);
    margin-bottom: 11px;
}

.section-title::before {
    content: "";
    width: 4px; height: 15px;
    background: var(--brand-mid);
    border-radius: 2px;
}

.section-title .sec-meta { font-weight: 400; color: var(--text-4); font-size: 12px; }

.kp-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    transition: border-color .15s, box-shadow .15s;
}

.kp-card + .kp-card { margin-top: 10px; }
.kp-card:hover { border-color: var(--brand-light); box-shadow: var(--shadow-sm); }

.kp-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 7px;
}

.kp-name { font-size: 14px; font-weight: 600; color: var(--text-1); }

.kp-field { display: flex; gap: 9px; font-size: 13px; padding: 1.5px 0; }
.kp-field-label { color: var(--text-4); white-space: nowrap; flex-shrink: 0; }

/* ==================== 分页 ==================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.pagination-info { font-size: 13px; color: var(--text-3); white-space: nowrap; }

.pager { display: flex; align-items: center; gap: 5px; }

.pager-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-2);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s, color .15s, background .15s;
}

.pager-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pager-btn.active { background: var(--brand); border-color: var(--brand); color: var(--white); }
.pager-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ==================== 空状态 / 占位页 ==================== */

.empty-state { text-align: center; padding: 52px 20px 50px; }

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

.empty-state-text { font-size: 14px; color: var(--text-3); }

.empty-state-actions { margin-top: 18px; display: flex; justify-content: center; gap: 10px; }

.placeholder { text-align: center; padding: 96px 20px; }

.placeholder-icon {
    width: 66px; height: 66px;
    border-radius: 50%;
    background: var(--brand-pale);
    color: var(--brand);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
}

.placeholder-title { font-size: 17px; font-weight: 600; color: var(--text-1); margin-bottom: 8px; }
.placeholder-text { font-size: 13px; color: var(--text-3); }

/* ==================== 加载 / 提示 ==================== */

.spinner {
    display: inline-block;
    width: 22px; height: 22px;
    border: 3px solid var(--brand-light);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

.spinner-lg { width: 42px; height: 42px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-row { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 14px; }

/* 梳理阶段列表（带左侧连接线） */
.stage-list { margin: 22px auto 4px; max-width: 380px; text-align: left; }

.stage-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
    font-size: 13.5px;
    color: var(--text-4);
}

.stage-item::before {
    content: "";
    position: absolute;
    left: 8px; top: -9px;
    width: 2px; height: 14px;
    background: var(--divider);
}

.stage-item:first-child::before { display: none; }

.stage-item .stage-dot {
    width: 18px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.stage-item.active { color: var(--brand-dark); font-weight: 600; }
.stage-item.done { color: var(--text-2); }
.stage-item.done::before { background: var(--green-light); }

/* 进度统计行 */
.progress-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.progress-stat { font-size: 13px; color: var(--text-3); }
.progress-stat b { color: var(--text-1); font-weight: 600; }
.progress-stat-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-4);
}
.progress-cost {
    font-size: 12px !important;
    text-align: center;
    margin-top: 6px;
}

.alert {
    display: flex;
    gap: 10px;
    padding: 11px 15px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.alert-warning { background: var(--orange-pale); color: #9A6800; }
.alert-error { background: #FDECEA; color: #B3261E; }
.alert-info { background: var(--brand-pale); color: var(--brand-dark); }

/* ==================== Toast ==================== */

.toast-wrap {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(10, 30, 28, 0.14);
    padding: 11px 16px;
    font-size: 13px;
    color: var(--text-1);
    min-width: 230px;
    animation: toast-in 0.2s ease;
}

.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--error); }
.toast.warning { border-left-color: var(--orange); }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ==================== 结果/完成 ==================== */

.summary-box {
    background: var(--brand-pale);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    font-size: 13.5px;
    color: var(--text-2);
    margin-bottom: 16px;
}

.summary-box .summary-title { font-weight: 600; color: var(--brand-dark); margin-bottom: 3px; font-size: 14px; }

.result-success { text-align: center; padding: 26px 0 14px; }
.result-success .success-circle {
    width: 66px; height: 66px;
    border-radius: 50%;
    background: var(--green-pale);
    color: var(--green);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
}

details.advanced { margin-top: 4px; }

details.advanced summary {
    cursor: pointer;
    font-size: 13px;
    color: var(--brand-dark);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 7px;
    user-select: none;
    padding: 4px 0;
}

details.advanced summary::-webkit-details-marker { display: none; }
details.advanced[open] summary .chev { transform: rotate(90deg); }
.advanced-body { margin-top: 13px; }

/* ==================== 工具类 ==================== */

.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.flex-center { display: flex; align-items: center; gap: 8px; }
.gap-8 { gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0 !important; }
.text-3 { color: var(--text-3); }
.text-4 { color: var(--text-4); }
.hidden { display: none !important; }

/* ==================== 响应式 ==================== */

@media (max-width: 920px) {
    .sidebar { display: none; }
    .content { padding: 16px; }
    .topbar { padding: 0 18px; }
    .form-grid-2 { grid-template-columns: 1fr; gap: 15px; }
    .chapter-head-right { margin-left: 0; }
}
