/* ================================================================
   讨论区样式 (discussion.css)
   与主样式表共用 :root 变量（--primary / --accent / --text / --text-light 等）
   ================================================================ */

/* ---------- 通用面板 ---------- */
.disc-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.disc-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}
.disc-panel-title {
    font-weight: 600;
    color: var(--primary);
    font-size: 15px;
}
.disc-panel-sub {
    font-size: 12px;
    color: var(--text-light);
}
.disc-hint {
    background: #fff8ec;
    border: 1px solid var(--accent-light);
    color: #8a6d2f;
    font-size: 12.5px;
    line-height: 1.6;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 12px;
}

/* ---------- 发帖/发布主题 composer ---------- */
.disc-composer {
    margin-bottom: 14px;
}
.disc-new-btn {
    width: 100%;
    padding: 10px;
    background: #f1f4f9;
    border: 1px dashed #c7d0dc;
    border-radius: 12px;
    color: var(--primary);
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}
.disc-new-btn:hover {
    background: #e8edf5;
}
.disc-composer-form {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #edf2f7;
}
.disc-composer-form.open {
    display: flex;
}
.disc-composer-form input[type="text"],
.disc-composer-form textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #dfe6ee;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13.5px;
    resize: vertical;
}
.disc-composer-form input[type="text"]:focus,
.disc-composer-form textarea:focus {
    outline: none;
    border-color: var(--accent-light);
}
.disc-submit-btn {
    align-self: flex-end;
    padding: 8px 22px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.disc-submit-btn:hover {
    background: var(--primary-light);
}

/* ---------- 帖子卡片 ---------- */
.disc-post-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.disc-post {
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 14px;
    padding: 14px 16px;
}
.disc-post.teacher {
    border-color: var(--accent-light);
    background: linear-gradient(180deg, #fffdf7 0%, #ffffff 60%);
}
.disc-post.pinned {
    border-color: #e2b23c;
    box-shadow: 0 2px 10px rgba(201, 168, 76, 0.12);
}
.disc-post.closed {
    opacity: 0.72;
}
.disc-post-head {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.disc-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-light);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}
.disc-avatar.teacher {
    background: var(--secondary);
}
.disc-avatar.small {
    width: 24px;
    height: 24px;
    font-size: 11px;
}
.disc-post-headinfo {
    flex: 1;
    min-width: 0;
}
.disc-post-author {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.disc-post-time {
    font-size: 11.5px;
    color: var(--text-light);
    margin-top: 2px;
}
.disc-role-badge {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 500;
    background: rgba(45, 90, 74, 0.12);
    color: var(--secondary);
    padding: 1px 8px;
    border-radius: 10px;
}
.disc-pin-badge {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 500;
    background: rgba(201, 168, 76, 0.2);
    color: #a3781f;
    padding: 1px 8px;
    border-radius: 10px;
}
.disc-tag-badge {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 500;
    background: #eef1f6;
    color: var(--text-light);
    padding: 1px 8px;
    border-radius: 10px;
}
.disc-tag-badge.star {
    background: rgba(201, 168, 76, 0.22);
    color: #a3781f;
}
.disc-post-title {
    font-weight: 600;
    font-size: 14.5px;
    color: var(--text);
    margin: 8px 0 4px;
}
.disc-post-content {
    font-size: 13.5px;
    color: var(--text);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}
.disc-post-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.disc-like-btn,
.disc-reply-btn,
.disc-likelist-btn {
    background: #f1f4f9;
    border: none;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    color: var(--text-light);
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}
.disc-like-btn:hover,
.disc-reply-btn:hover {
    background: #e8edf5;
    color: var(--text);
}
.disc-like-btn.liked {
    background: rgba(230, 126, 34, 0.14);
    color: #c0392b;
}
.disc-like-btn.small,
.disc-likelist-btn.small,
.disc-reply-btn.small {
    padding: 3px 9px;
    font-size: 11px;
}

/* ---------- 楼中楼：回复某一条具体回复 ---------- */
.disc-reply-to-tag {
    display: inline-block;
    color: var(--secondary);
    font-weight: 600;
    margin-right: 4px;
}
.disc-reply-target-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--secondary);
    background: rgba(45, 90, 74, 0.08);
    border-radius: 8px;
    padding: 6px 10px;
    margin-top: 10px;
}
.disc-reply-target-cancel {
    color: var(--text-light);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 400;
}
.disc-reply-target-cancel:hover {
    color: var(--text);
}
.disc-likelist-btn {
    background: transparent;
    text-decoration: underline;
    padding: 5px 4px;
}
.disc-reply-btn.danger {
    color: #c0392b;
}
.disc-reply-btn.danger:hover {
    background: rgba(231, 76, 60, 0.1);
}
.disc-closed-tag {
    font-size: 12px;
    color: var(--text-light);
}
.disc-likelist {
    font-size: 12px;
    color: var(--text-light);
    background: #f8fafc;
    border-radius: 8px;
    padding: 6px 10px;
    margin-top: 6px;
}

/* ---------- 回复 ---------- */
.disc-reply-list {
    margin-top: 10px;
    padding-left: 14px;
    border-left: 2px solid #edf2f7;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.disc-reply {
    display: flex;
    gap: 8px;
}
.disc-reply-body {
    flex: 1;
    min-width: 0;
}
.disc-reply-author {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.disc-reply-time {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 400;
}
.disc-reply-content {
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
    margin-top: 2px;
    white-space: pre-wrap;
    word-break: break-word;
}
.disc-reply-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}
.disc-reply-box {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.disc-reply-box input,
.disc-reply-box textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid #dfe6ee;
    border-radius: 20px;
    font-size: 13px;
    font-family: inherit;
}
.disc-reply-box input:focus,
.disc-reply-box textarea:focus {
    outline: none;
    border-color: var(--accent-light);
}
/* 【2026-09 新增】回复框改为可自适应增高的 <textarea>（原来是单行
   <input>，内容一长会被横向裁掉看不见）——配合 JS 的 autoGrowReplyBox
   按内容高度调整 style.height，这里只负责静态外观：单行时和原来的
   input 视觉高度一致（line-height+上下padding≈一行输入框的高度），
   圆角在单行时是"胶囊"形状、增高后由 border-radius 保持顶部/底部的
   圆角不突兀；resize:none 是因为高度已经由 JS 自动接管，不需要用户
   再拖拽把手，两者同时存在反而容易冲突；max-height 和 JS 里的
   REPLY_TEXTAREA_MAX_HEIGHT 保持一致（160px），超出后交给内部滚动条。 */
.disc-reply-box textarea {
    resize: none;
    line-height: 1.5;
    min-height: 34px;
    max-height: 160px;
    border-radius: 16px;
    overflow-y: auto;
}
.disc-reply-box button {
    padding: 8px 18px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    align-self: flex-end;
}

/* ---------- 教师端：任务列表侧栏 mini badge ---------- */
.disc-mini-badge {
    background: var(--accent-light);
    color: #8a6d2f;
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
}
.disc-mini-badge.off {
    background: #eee;
    color: #999;
}

/* ---------- 教师端：题目统计 ---------- */
.disc-qstat-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.disc-qstat {
    font-size: 12px;
    color: var(--text-light);
    border: 1px solid #edf2f7;
    border-radius: 8px;
    padding: 3px 10px;
}
.disc-qstat-bar {
    height: 6px;
    background: #edf2f7;
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}
.disc-qstat-bar-fill {
    height: 100%;
    border-radius: 4px;
}
.disc-qstat-link {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    border: 1px solid #dfe6ee;
    background: #fff;
    border-radius: 8px;
    padding: 3px 10px;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}
.disc-qstat-link:hover {
    background: #eef2f9;
    border-color: var(--accent-light);
}

/* ---------- 教师端：逐条评分标准的班级得分情况 ---------- */
.disc-criteria-block {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #edf2f7;
}
.disc-criteria-block-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 8px;
}
.disc-criteria-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(70px, 1fr) 72px;
    align-items: center;
    gap: 10px;
    margin-bottom: 7px;
}
.disc-criteria-row:last-child {
    margin-bottom: 0;
}
.disc-criteria-text {
    font-size: 12.5px;
    color: var(--text);
    line-height: 1.5;
}
.disc-criteria-bar {
    height: 6px;
    background: #edf2f7;
    border-radius: 4px;
    overflow: hidden;
}
.disc-criteria-bar-fill {
    height: 100%;
    border-radius: 4px;
}
.disc-criteria-score {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

/* ---------- 教师端：工具条 / 筛选条 ---------- */
.disc-teacher-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 12px;
}
.disc-teacher-filterbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #edf2f7;
}
.disc-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1.5px solid #dfe6ee;
    border-radius: 20px;
    padding: 8px 14px;
    margin-bottom: 10px;
    transition: var(--transition);
}
.disc-search-bar:focus-within {
    border-color: var(--accent-light);
    background: #fff;
}
.disc-search-icon {
    font-size: 13px;
    opacity: 0.6;
    flex-shrink: 0;
}
.disc-search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    outline: none;
}
.disc-search-bar input::placeholder {
    color: var(--text-light);
}
.disc-search-clear {
    background: #e2e8f0;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    padding: 0;
    font-size: 12px;
    color: var(--text-light);
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}
.disc-search-clear:hover {
    background: #cbd5e0;
    color: var(--text);
}

/* ---------- 教师端：讨论区设置面板 ---------- */
.disc-settings-panel {
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.disc-settings-row {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    align-items: center;
}
.disc-settings-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.disc-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
}
.disc-radio {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: var(--text);
    cursor: pointer;
}

/* ---------- 教师端：AI 归纳面板 ---------- */
.disc-ai-summary {
    background: linear-gradient(180deg, #fbf9f3 0%, #ffffff 100%);
    border: 1px solid var(--accent-light);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
.disc-ai-summary-head {
    font-weight: 700;
    color: var(--primary);
    font-size: 14.5px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.disc-ai-analyze-btn {
    padding: 7px 18px;
    border: none;
    border-radius: 20px;
    background: var(--primary);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}
.disc-ai-analyze-btn:hover:not(:disabled) {
    background: var(--primary-light);
}
.disc-ai-analyze-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.disc-ai-analyzed-at {
    font-size: 11.5px;
    color: var(--text-light);
    font-weight: 400;
}
.disc-ai-analyzing {
    text-align: center;
    padding: 32px 10px;
}
.disc-ai-analyzing-spinner {
    font-size: 32px;
    animation: discAiPulse 1.2s ease-in-out infinite;
}
@keyframes discAiPulse {
    0%, 100% { opacity: 0.4; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
}
.disc-ai-analyzing-text {
    margin-top: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--primary);
}
.disc-ai-analyzing-hint {
    margin-top: 4px;
    font-size: 11.5px;
    color: var(--text-light);
}
.disc-ai-error-banner {
    background: #fdedec;
    border: 1px solid #f1a9a0;
    color: #c0392b;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12.5px;
    margin-bottom: 12px;
}
.disc-ai-stats-row {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}
.disc-ai-stat {
    flex: 1;
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    text-align: center;
    padding: 10px 6px;
}
.disc-ai-stat .n {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}
.disc-ai-stat .l {
    font-size: 11.5px;
    color: var(--text-light);
    margin-top: 2px;
}
.disc-ai-block {
    margin-bottom: 14px;
}
.disc-ai-block:last-child {
    margin-bottom: 0;
}
.disc-ai-block-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}
.disc-keyword-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.disc-keyword {
    background: rgba(201, 168, 76, 0.16);
    color: #8a6d2f;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}
.disc-ai-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text);
    line-height: 1.6;
}
.disc-ai-list li {
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    transition: var(--transition);
}
.disc-ai-list li:hover {
    border-color: var(--accent-light);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}
.disc-low-reason {
    color: #c0392b;
    font-size: 11.5px;
}
.disc-quality-bar {
    display: flex;
    height: 10px;
    border-radius: 6px;
    overflow: hidden;
    background: #edf2f7;
}
.disc-quality-bar .seg.high { background: #2ecc71; }
.disc-quality-bar .seg.mid { background: #f1c40f; }
.disc-quality-bar .seg.low { background: #e74c3c; }
.disc-quality-legend {
    display: flex;
    gap: 14px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-light);
}
.disc-quality-legend .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}
.disc-quality-legend .dot.high { background: #2ecc71; }
.disc-quality-legend .dot.mid { background: #f1c40f; }
.disc-quality-legend .dot.low { background: #e74c3c; }

/* ---------- 教师端：AI深度分析 —— 风险预警区 ---------- */
.disc-risk-block {
    background: #fff9f5;
    border: 1px solid #f5c6a5;
    border-radius: 12px;
    padding: 12px 14px;
}
.disc-risk-block.has-crisis {
    border-color: #e74c3c;
    background: #fef2f0;
}
.disc-crisis-alert {
    background: #e74c3c;
    color: #fff;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.6;
}
.disc-risk-list li {
    border-left: 4px solid #e0a458;
    position: relative;
}
.disc-risk-item.risk-crisis { border-left-color: #e74c3c; background: #fef5f4; }
.disc-risk-item.risk-attack { border-left-color: #e74c3c; }
.disc-risk-item.risk-bias { border-left-color: #d35400; }
.disc-risk-item.risk-rude { border-left-color: #e0a458; }
.disc-risk-item.risk-spam { border-left-color: #95a5a6; }
.disc-risk-item.risk-other { border-left-color: #95a5a6; }
.disc-risk-type-tag {
    display: inline-block;
    background: rgba(231, 76, 60, 0.12);
    color: #c0392b;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 10px;
    margin-right: 6px;
}
.disc-risk-reason {
    color: #c0392b;
    font-size: 11.5px;
    margin-top: 3px;
}

/* ---------- 教师端：AI深度分析 —— 核心素养关联条形图 ---------- */
.disc-ability-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.disc-ability-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 3px 4px;
    border-radius: 6px;
    transition: var(--transition);
}
.disc-ability-bar-row:hover {
    background: #f5f8fc;
}
.disc-ability-label {
    flex: 0 0 108px;
    font-size: 12px;
    color: var(--text);
}
.disc-ability-bar-track {
    flex: 1;
    height: 8px;
    border-radius: 5px;
    background: #edf2f7;
    overflow: hidden;
}
.disc-ability-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: var(--transition);
}
.disc-ability-bar-fill.ability-L { background: #2c4a7a; }
.disc-ability-bar-fill.ability-T { background: #c9a84c; }
.disc-ability-bar-fill.ability-A { background: #8e44ad; }
.disc-ability-bar-fill.ability-C { background: #16a085; }
.disc-ability-count {
    flex: 0 0 20px;
    text-align: right;
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
}

/* ---------- 教师端：AI深度分析 —— 认知层级配色（复用 .disc-quality-bar/.seg 结构）---------- */
.disc-quality-bar .seg.level-L0 { background: #95a5a6; }
.disc-quality-bar .seg.level-L1 { background: #a6c8e8; }
.disc-quality-bar .seg.level-L2 { background: #4a90c4; }
.disc-quality-bar .seg.level-L3 { background: #2c4a7a; }
.disc-quality-legend .dot.level-L0 { background: #95a5a6; }
.disc-quality-legend .dot.level-L1 { background: #a6c8e8; }
.disc-quality-legend .dot.level-L2 { background: #4a90c4; }
.disc-quality-legend .dot.level-L3 { background: #2c4a7a; }

/* ---------- 教师端：学生标签选择器 ---------- */
.disc-tag-picker-wrap {
    position: relative;
    display: inline-block;
}
.disc-tag-picker {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 20;
    background: #fff;
    border: 1px solid #dfe6ee;
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 10px;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
    margin-top: 4px;
}
.disc-tag-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
}
.disc-tag-add {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    border-top: 1px solid #edf2f7;
    padding-top: 6px;
}
.disc-tag-add input {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #dfe6ee;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
}
.disc-tag-add button {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 24px;
    cursor: pointer;
    font-family: inherit;
}

/* ---------- 回复列表折叠/展开 ---------- */
.disc-replies-toggle {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    padding: 5px 8px;
    border-radius: 20px;
    transition: var(--transition);
}
.disc-replies-toggle:hover {
    background: #eef2f9;
}

/* ---------- 学生端："回复后可见"锁定提示 ---------- */
.disc-locked-hint {
    margin-top: 10px;
    background: #f8fafc;
    border: 1px dashed #dfe6ee;
    color: var(--text-light);
    font-size: 12px;
    line-height: 1.6;
    padding: 8px 12px;
    border-radius: 10px;
}

/* ---------- 教师端：讨论互动整体布局（可收起的任务目录 + 可调宽度的原文/功能区）----------
   讨论区内容一多（设置面板 + AI归纳 + 筛选栏 + 一长串帖子）确实容易显得局促，
   但整块交给页面自然撑高滚动，又会出现"原文卡片矮、讨论区卡片超长"一长一短、
   翻到下面找不到原文对照的问题。这里改回"一屏卡片 + 内部滚动"的常规模式，
   只是不再沿用 calc(100vh - 160px) 这个偏矮的固定值——讨论互动页顶部没有
   其它数据页面那条"查看范围"选择条，可用空间更多，卡片整体调高一截，
   让设置面板/AI归纳/帖子列表在卡片内部滚动时更舒展、不至于太局促。 */
.disc-teacher-layout {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.disc-teacher-sidebar {
    flex: 0 0 250px;
    width: 250px;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: calc(100vh - 40px);
    opacity: 1;
    position: sticky;
    top: 20px;
    transition: flex-basis 0.22s ease, width 0.22s ease, padding 0.22s ease, opacity 0.18s ease;
}
.disc-teacher-layout.sidebar-collapsed .disc-teacher-sidebar {
    flex-basis: 0;
    width: 0;
    padding-left: 0;
    padding-right: 0;
    opacity: 0;
    pointer-events: none;
    box-shadow: none;
}
.disc-sidebar-toggle {
    flex-shrink: 0;
    align-self: flex-start;
    position: sticky;
    top: 20px;
    width: 22px;
    height: 46px;
    border-radius: 8px;
    background: var(--card);
    box-shadow: var(--shadow);
    border: 1px solid #edf2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-light);
    font-size: 15px;
    font-family: inherit;
    padding: 0;
    transition: var(--transition);
}
.disc-sidebar-toggle:hover {
    background: #f1f4f9;
    color: var(--primary);
    border-color: #dfe6ee;
}
.disc-teacher-layout .process-main {
    flex: 1;
    min-width: 0;
    overflow: visible;
}
/* .reading-layout / .left-panel / .right-panel 在 styles.css 里默认是"钉死一屏、
   内部各自滚动"设计（左侧原文、右侧功能区各自 overflow-y:auto），这里沿用同一套
   机制，只是把整卡的高度从默认的 calc(100vh - 160px) 调高，给右侧"题目 / AI对话 /
   讨论区"三个tab（尤其讨论区：设置面板 + AI归纳 + 筛选栏 + 帖子列表）更充裕的
   内部可视高度，减少还没展开就要滚动大半屏的局促感；左右两栏仍然等高对齐，
   哪一栏内容更长，就在自己内部滚动，不会把另一栏也拖变形。 */
.disc-teacher-layout .reading-layout {
    height: calc(100vh - 120px);
    min-height: 680px;
}

/* ---------- 教师端：AI 归纳 · 讨论热点话题（按主题聚类，取代原来的字符切片"关键词"）---------- */
.disc-topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
.disc-topic-card {
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: var(--transition);
}
.disc-topic-card:hover {
    border-color: var(--accent-light);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}
.disc-topic-card.top {
    border-color: rgba(201, 168, 76, 0.5);
    background: linear-gradient(180deg, #fffdf5 0%, #ffffff 70%);
}
.disc-topic-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.disc-topic-count {
    font-size: 11.5px;
    font-weight: 700;
    color: #a3781f;
    background: rgba(201, 168, 76, 0.16);
    padding: 1px 8px;
    border-radius: 10px;
}
.disc-topic-example {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.5;
}
.disc-topic-example strong {
    color: var(--text);
    font-weight: 600;
}
.disc-topic-open-hint {
    margin-top: 6px;
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
    opacity: 0;
    transition: var(--transition);
}
.disc-topic-card:hover .disc-topic-open-hint {
    opacity: 1;
}

/* ---------- 教师端：讨论热点话题 · 详情弹窗 ---------- */
.disc-topic-modal-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.disc-topic-modal-title span {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-light);
}
.disc-topic-modal-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.disc-topic-modal-item {
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: var(--transition);
}
.disc-topic-modal-item:hover {
    border-color: var(--accent-light);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}
.disc-topic-modal-item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.disc-topic-modal-item-author {
    display: flex;
    align-items: center;
    gap: 6px;
}
.disc-topic-modal-item-type {
    font-size: 11.5px;
    font-weight: 400;
    color: var(--text-light);
}
.disc-topic-modal-item-text {
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.disc-topic-modal-item-jump {
    margin-top: 6px;
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
    opacity: 0;
    transition: var(--transition);
}
.disc-topic-modal-item:hover .disc-topic-modal-item-jump {
    opacity: 1;
}

/* ---------- 跳转定位高亮：从"热点话题/低质量发帖"点击某条发言、或从"批改答案"
   跳到具体学生任务时，短暂给目标卡片一圈提示光晕，帮老师一眼找到滚动到的位置 ---------- */
@keyframes discJumpPulse {
    0% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.55); }
    100% { box-shadow: 0 0 0 10px rgba(201, 168, 76, 0); }
}
.disc-jump-highlight {
    animation: discJumpPulse 0.9s ease-out 2;
    border-color: var(--accent) !important;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .disc-ai-stats-row {
        flex-wrap: wrap;
    }
    .disc-ai-stat {
        min-width: 30%;
    }
    .disc-topic-grid {
        grid-template-columns: 1fr;
    }
    .disc-teacher-sidebar {
        flex-basis: 200px;
        width: 200px;
        position: static;
        max-height: none;
    }
    .disc-sidebar-toggle {
        position: static;
    }
}

/* ---------- 教师端：AI深度分析 —— 可折叠区块标题 ---------- */
.disc-ai-collapsible-head {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}
.disc-ai-collapsible-head:hover {
    color: var(--primary);
}
.disc-ai-collapse-arrow {
    color: var(--text-light);
    font-size: 12px;
    flex-shrink: 0;
    margin-left: 8px;
}

/* ---------- 教师端：AI深度分析 —— 认知层级分布可点击 ---------- */
.disc-quality-bar .seg {
    cursor: pointer;
    transition: var(--transition);
}
.disc-quality-bar .seg:hover {
    filter: brightness(1.15);
}
.disc-level-legend-item {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 10px;
    transition: var(--transition);
}
.disc-level-legend-item:hover {
    background: #f5f8fc;
    color: var(--primary);
}

