* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    height: 100%;
    overflow: hidden; /* 禁止顶层滚动，防止编辑器页面溢出 */
}

/* ── 总智能体 SVG 动画 ── */
@keyframes master-float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-15px); }
}
@keyframes look-face {
    0%, 50%, 100% { transform: translateX(0px); }
    20%           { transform: translateX(-10px); }
    70%           { transform: translateX(10px); }
}
@keyframes look-glasses {
    0%, 50%, 100% { transform: translateX(0px) scale(1.02); }
    21%           { transform: translateX(-15px) scale(1.02); }
    71%           { transform: translateX(15px) scale(1.02); }
}
@keyframes core-pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50%      { opacity: 0.8; transform: scale(1.1); }
}
.master-float   { animation: master-float 6s ease-in-out infinite; }
.master-face    { animation: look-face    8s cubic-bezier(0.4,0,0.2,1) infinite; }
.master-glasses { animation: look-glasses 8s cubic-bezier(0.42,0,0.3,1) infinite; }
.drop-shadow-agent { filter: drop-shadow(0 25px 50px rgba(109, 40, 217, 0.4)); }
.glasses-shadow { filter: drop-shadow(0 6px 5px rgba(0, 0, 0, 0.3)); }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #f0f2f5; /* 略微加深的背景色，使主体内容更突出 */
}
#app {
    height: 100%;
    overflow: hidden;
}

/* 权限检查遮罩层 */
.permission-check-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    backdrop-filter: blur(10px);
}

/* 页面切换平滑过渡 */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.5s ease;
}
.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

/* 上传页面重构样式 */
.upload-page {
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    height: 100%;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    position: relative;
    overflow: hidden;
}

/* DPI 适配：原始稿在 125% DPI 下完成排版，100% DPI 设备会"显小"。
   <body class="is-low-dpi"> 由 app.js 根据 devicePixelRatio 动态打上，
   仅对首页 .upload-page 做 zoom 等比放大，避免影响审核页/对比页等已布局完成的视图。 */
body.is-low-dpi .upload-page {
    zoom: 1.25;
    /* zoom 1.25 让所有 px 渲染放大 25%，但 vh 单位不会被 zoom 反向缩放。
       用 80vh 给 upload-page 限高，1.25 倍渲染后正好等于 100vh，避免内容溢出。 */
    height: 80vh;
}
/* 上传栏底部对齐右侧 document-stack 的公式，需要把 100vh 替换成 zoom 视角下的逻辑视口高度
   80vh = 100vh / 1.25，常量 596 = 28(上 padding) + 28(下 padding) + 540(stack max-height) 不变。 */
body.is-low-dpi .hero-content {
    padding-bottom: max(0px, calc((80vh - 596px) / 2));
}

.upload-page::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; right: -50%; bottom: -50%;
    background: radial-gradient(circle at center, rgba(102, 126, 234, 0.08) 0%, transparent 60%);
    pointer-events: none;
    animation: rotate-glow 20s linear infinite;
}

@keyframes rotate-glow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hero-section {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    gap: 24px;
    z-index: 1;
    background: rgba(255, 255, 255, 0.7);
    padding: 28px 44px;
    border-radius: 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5);
    backdrop-filter: blur(20px);
}

/* 主题辐射覆盖层：点击切换时从鼠标位置扩圆展现目标主题色
   采用 mask 反向裁剪：覆盖层覆盖全屏 → 圆孔由小到大 → 目标主题从圆心向外显现 */
@property --reveal-r {
    syntax: '<length>';
    initial-value: 0px;
    inherits: false;
}

.theme-reveal {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    --rx: 50%;
    --ry: 50%;
    --reveal-r: 0px;
    -webkit-mask-image: radial-gradient(
        circle at var(--rx) var(--ry),
        transparent var(--reveal-r),
        #000 calc(var(--reveal-r) + 1px)
    );
    mask-image: radial-gradient(
        circle at var(--rx) var(--ry),
        transparent var(--reveal-r),
        #000 calc(var(--reveal-r) + 1px)
    );
}
.theme-reveal.is-active {
    opacity: 1;
}
.theme-reveal.is-animating {
    transition: --reveal-r 900ms cubic-bezier(0.65, 0, 0.35, 1);
}

/* 覆盖层使用不透明色，避免半透明叠加产生灰调 */
.theme-reveal.is-core {
    background: linear-gradient(135deg, #fdfbfb 0%, #f1f3f5 60%, #e7eaee 100%);
}
.theme-reveal.is-graph {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 60%, #312e81 100%);
}

/* 让左右两块内容位于覆盖层之上 */
.hero-section > .hero-content,
.hero-section > .hero-visual {
    position: relative;
    z-index: 1;
}

.hero-content {
    flex: 0 0 520px;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* 向右内缩，避免功能区过度贴左 */
    margin-left: clamp(40px, 8vw, 120px);
    /* 底部按钮与右侧 .document-stack（max-height 540px，居中于 hero-visual）底部对齐：
       空白 = (视口高 - hero-section 上下 padding 56 - 540) / 2 */
    padding-bottom: max(0px, calc((100vh - 596px) / 2));
}

.hero-content h1 {
    font-size: 44px;
    margin-bottom: 8px;
    letter-spacing: -1.5px;
    font-weight: 800;
}

.gradient-text {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.subtitle {
    font-size: 15px;
    color: #4b5563;
    line-height: 1.5;
    font-weight: 400;
    margin: 0;
    text-indent: 2em;
}

/* 副标题占位槽：固定 2 行高度，避免切换瞬间的 DOM 替换导致高度塌陷 */
.subtitle-slot {
    position: relative;
    /* 2 行 × line-height 1.5 × 15px = 45px；用 lh 单位更稳健 */
    min-height: calc(15px * 1.5 * 2);
    min-height: 2lh;
    margin-bottom: 12px;
}

/* Vue <transition name="subtitle-swap" mode="out-in"> 过渡 */
.subtitle-swap-enter-active,
.subtitle-swap-leave-active {
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.subtitle-swap-enter-from {
    opacity: 0;
    transform: translateY(8px);
}
.subtitle-swap-leave-to {
    opacity: 0;
    transform: translateY(-8px);
}

.notice-box {
    background: rgba(254, 243, 199, 0.4);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #92400e;
    line-height: 1.6;
}

.notice-box strong {
    color: #b45309;
    margin-bottom: 4px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notice-box ul {
    margin-top: 12px;
    padding-left: 20px;
}

.notice-box li {
    margin-bottom: 8px;
}

.upload-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: #374151;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.05);
}

.upload-btn {
    padding: 0;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: stretch;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
    overflow: hidden;
    height: 56px;
    animation: btn-float 3s ease-in-out infinite;
}


.upload-btn:hover {
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.4);
    animation-play-state: paused;
    transform: translateY(-4px);
}

.upload-btn:active {
    transform: translateY(0);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.upload-btn:disabled {
    background: #9ca3af;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    animation: none;
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 24px;
    flex: 1;
}

.btn-divider {
    width: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 12px 0;
}

.btn-switch-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    background: rgba(0, 0, 0, 0.1);
    transition: background 0.3s;
}

.btn-switch-container:hover {
    background: rgba(0, 0, 0, 0.2);
}

.switch-label {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0.95;
}

/* 视觉插图区域 - 文档 + 精灵锚定列 */
.hero-visual {
    flex: 1;
    align-self: stretch;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 2000px;
}

.document-stack {
    position: relative;
    width: 500px;
    height: 100%;
    max-height: 540px;
    min-height: 320px;
    margin-left: 0;
    flex-shrink: 0;
    align-self: center;
}

.document-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 12px;
    padding: 35px;
    box-sizing: border-box;
    overflow: hidden;
    transition: transform 0.65s cubic-bezier(0.34, 1.2, 0.64, 1),
                opacity 0.5s ease,
                box-shadow 0.5s ease;
}

.doc-bottom {
    transform: translateX(18px) translateY(14px);
    opacity: 0.85;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    z-index: 1;
    box-shadow: 4px 8px 24px rgba(0,0,0,0.06);
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.6, 1),
                opacity 0.38s ease,
                box-shadow 0.38s ease;
}

.doc-top {
    transform: translateX(0) translateY(0);
    border: 1px solid rgba(99, 102, 241, 0.2);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    z-index: 2;
    box-shadow: -10px 20px 40px rgba(0,0,0,0.1);
    min-height: 300px;
    overflow: visible;
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.6, 1),
                opacity 0.38s ease,
                box-shadow 0.38s ease;
}

/* ── 阶段 1：展开（两张文档向外扩散，180ms CSS） ── */
.document-stack.is-spreading .doc-bottom {
    transform: translateX(72px) translateY(14px);
    transition: transform 0.18s cubic-bezier(0.4, 0, 1, 1);
}
.document-stack.is-spreading .doc-top {
    transform: translateX(-52px) translateY(0);
    transition: transform 0.18s cubic-bezier(0.4, 0, 1, 1);
}

/* ── 阶段 2+：已交换（永久状态），收拢动画 260ms ── */
/* doc-bottom 成为前景文档 */
.document-stack.is-swapped .doc-bottom {
    transform: translateX(0) translateY(0);
    opacity: 1;
    z-index: 3;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: -10px 20px 40px rgba(0,0,0,0.1);
    overflow: visible;
    backdrop-filter: blur(12px);
    transition: transform 0.26s cubic-bezier(0.34, 1.2, 0.64, 1),
                opacity 0.2s ease,
                box-shadow 0.26s ease;
}
/* doc-top 退到背景 */
.document-stack.is-swapped .doc-top {
    transform: translateX(18px) translateY(14px);
    opacity: 0.85;
    z-index: 1;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: 4px 8px 24px rgba(0,0,0,0.06);
    overflow: hidden;
    backdrop-filter: none;
    transition: transform 0.26s cubic-bezier(0.34, 1.2, 0.64, 1),
                opacity 0.2s ease,
                box-shadow 0.4s ease;
}

/* ===========================================================
 * 新版 deck-mode：堆叠卡片无限轮播
 * 栈顶 (i=0) 处于前景；i 越大越靠后 + 越透明 + 越小。
 * 离场用 .is-leaving 翻：左滑 + 旋转 + 淡出 ~520ms。
 * =========================================================== */
.document-stack.deck-mode {
    overflow: visible;
}

.document-stack.deck-mode .deck-card {
    position: absolute;
    inset: 0;
    background: white;
    border-radius: 12px;
    padding: 35px;
    box-sizing: border-box;
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, 0.12);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    /* 用 flex 列让内部 doc-text 可以 flex:1 撑满（关联地图 mini 等场景需要） */
    display: flex;
    flex-direction: column;
    /* 默认（位置 0：栈顶） */
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
    z-index: 10;
    /* 过渡曲线：transform / opacity 都用 0.85s + 同条曲线，让"前滑"与
       "离场" 时长严格对齐，整体动画收尾在同一帧；
       视觉上是"一组卡同时 reflow"而不是错峰。 */
    transition: transform 0.85s cubic-bezier(0.22, 0.61, 0.36, 1),
                opacity 0.85s cubic-bezier(0.22, 0.61, 0.36, 1),
                box-shadow 0.6s ease;
    will-change: transform, opacity;
}

/* 堆叠位置：i=0 最前，i=1/2/3/4 依次向右下偏移 + 缩小 + 淡出 + 后压 */
.document-stack.deck-mode .deck-card.deck-pos-0 {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
    z-index: 14;
    box-shadow: -10px 20px 40px rgba(15, 23, 42, 0.12);
}
.document-stack.deck-mode .deck-card.deck-pos-1 {
    transform: translate3d(18px, 14px, 0) scale(0.97);
    opacity: 0.78;
    z-index: 13;
}
.document-stack.deck-mode .deck-card.deck-pos-2 {
    transform: translate3d(36px, 28px, 0) scale(0.94);
    opacity: 0.55;
    z-index: 12;
}
.document-stack.deck-mode .deck-card.deck-pos-3 {
    transform: translate3d(52px, 40px, 0) scale(0.91);
    opacity: 0.32;
    z-index: 11;
}
.document-stack.deck-mode .deck-card.deck-pos-4 {
    transform: translate3d(64px, 50px, 0) scale(0.89);
    opacity: 0.18;
    z-index: 10;
}

/* ============================================================
 * 离场动画 —— "向下移走 + 同步渐隐"，全程平滑无停顿。
 *
 * 用 @keyframes 同时驱动 transform 和 opacity（不依赖 transition）。
 * 原因：Vue 同 tick 里 shift+push 会让 v-for 把 DOM 节点 insertBefore
 * 到新位置，class 又从 deck-pos-0 跳到 deck-pos-{N-1} is-leaving；浏览器
 * 对"被 reorder 的节点"的 transition 起点判定不稳定，常常直接锁定到新值
 * 导致瞬移。keyframes 起止帧显式声明，绕开这个坑。
 *
 * 时序：只声明 0% 和 100% 两帧，中间由动画曲线 cubic-bezier 平滑插值，
 * transform 与 opacity 共享同一条曲线，全程同步衰减，不会有"先停顿再渐隐"的违和感。
 * ============================================================ */
@keyframes deck-leave {
    0%   { transform: translate3d(0, 0, 0);     opacity: 1; }
    100% { transform: translate3d(0, 280px, 0); opacity: 0; }
}

.document-stack.deck-mode .deck-card.is-leaving {
    /* z-index 18：高于所有 deck-pos（最高 14），让离场卡始终位于视图最上层，
       这样它"向下移走"的过程清晰可见，新前景在它下面缓缓露出来。
       z-index 是离散属性、没有 transition，必须高于 deck-pos 的最大值
       否则第一帧就被新前景盖住，视觉上是"震荡一下、下一张突然出现"。 */
    z-index: 18;
    isolation: isolate;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.22),
                0 6px 14px rgba(15, 23, 42, 0.16);
    animation: deck-leave 0.85s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
    /* 关掉 transition，避免与 keyframes 争 transform/opacity */
    transition: box-shadow 0.85s ease;
    pointer-events: none;
}

/* 阶段 2：瞬移到右侧栈底起点；transition:none 让这一跳无可见过渡 */
.document-stack.deck-mode .deck-card.is-emerging {
    transform: translate3d(120px, 50px, 0) scale(0.89);
    opacity: 0;
    z-index: 5;
    isolation: isolate;
    transition: none !important;
    pointer-events: none;
}

/* 栈顶卡稍微提升，便于阅读 */
.document-stack.deck-mode .deck-card.is-top {
    box-shadow: -12px 24px 44px rgba(15, 23, 42, 0.14);
}


/* 文档内容 */
.doc-header {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 24px;
    text-align: center;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 16px;
    position: relative;
}

/* 功能文档标题：flex 布局让精灵和文字同行居中 */
.doc-header.doc-header-feature {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* 标题行精灵容器（复用 doc-agent-jump-in 动画） */
.doc-header-sprite {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* 纸张绝对定位的锚点 */
}

.doc-header-sprite .sprite-arch {
    width: 26px;
    height: 32px;
    border-radius: 13px 13px 4px 4px;
    padding-top: 7px;
    gap: 4px;
}

.doc-header-sprite .sprite-eye {
    width: 6px !important;
    height: 6px !important;
    box-shadow: 0 0 0 1.5px rgba(0,0,0,0.45) !important;
}

.doc-header-sprite .sprite-pupil {
    width: 2.5px !important;
    height: 2.5px !important;
    left: 22% !important;
    transform: translate(-50%, -50%) !important;
}

/* ── 阅读态：瞳孔静态偏向纸张方向（左上） ──────── */
.doc-header-sprite.is-reading .sprite-pupil {
    left: 18% !important;
    top: 32% !important;
    transform: translate(-50%, -50%) !important;
    animation: none !important;
}

/* ── 纸张元素：停在精灵头部左侧，轻微漂浮 ────── */
.header-paper {
    position: absolute;
    left: -20px;
    top: -2px;
    z-index: 6;
    pointer-events: none;
    animation: paper-float 2.8s ease-in-out infinite;
}

.paper-icon {
    width: 14px;
    height: 17px;
    background: #fff;
    border: 1.5px solid #94a3b8;
    border-radius: 2px 5px 2px 2px;
    position: relative;
    box-shadow: 1px 2px 4px rgba(0,0,0,0.12);
}

/* 折角 */
.paper-icon::before {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    width: 5px;
    height: 5px;
    background: #e2e8f0;
    border-left: 1.5px solid #94a3b8;
    border-bottom: 1.5px solid #94a3b8;
    border-radius: 0 0 0 2px;
}

/* 文字线条 */
.paper-icon::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 2px;
    right: 2px;
    height: 1.5px;
    background: #cbd5e1;
    border-radius: 1px;
    box-shadow: 0 3px 0 #cbd5e1;
}

@keyframes paper-float {
    0%, 100% { transform: translateY(0)    rotate(-4deg); }
    50%       { transform: translateY(-3px) rotate(-2deg); }
}

.doc-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #6366f1, transparent);
}

.doc-text {
    font-size: 16px; /* 增大基础字号 */
    line-height: 1.7; /* 调整行高 */
    color: #4b5563;
}

.audit-dimension {
    margin-bottom: 12px; /* 增加维度之间的间距 */
}

.audit-category {
    color: #4f46e5; /* 蓝色字体 */
    font-weight: 600;
    margin-bottom: 4px;
}

.audit-example {
    text-indent: 2em; /* 缩进2个字符 */
}


/* 呼吸标红的错误文字 */
.error-text {
    position: relative;
    display: inline; /* 修改为inline以解决空白问题 */
    color: #111827;
    font-weight: 500;
}

.error-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -2px;
    right: -2px;
    height: 2px;
    background: #ef4444;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
    animation: underline-breathe 5s infinite;
}

.error-text::before {
    content: '';
    position: absolute;
    top: -2px; left: -4px; right: -4px; bottom: -2px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 4px;
    opacity: 0;
    animation: bg-breathe 5s infinite;
}

@keyframes underline-breathe {
    0%, 95% { transform: scaleX(0); transform-origin: left; }
    5%, 90% { transform: scaleX(1); transform-origin: left; }
}

@keyframes bg-breathe {
    0%, 95% { opacity: 0; }
    5%, 90% { opacity: 1; color: #b91c1c; }
}

/* 扫描光束效果 */
.scanner-beam {
    position: absolute;
    top: 0; left: -20px; right: -20px;
    height: 4px;
    background: linear-gradient(90deg, transparent, #6366f1, transparent);
    box-shadow: 0 0 20px 4px rgba(99, 102, 241, 0.3);
    opacity: 0;
    animation: scan-visual 5s infinite cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

@keyframes scan-visual {
    0% { top: 5%; opacity: 0; transform: scaleX(0.8); }
    10% { opacity: 1; transform: scaleX(1); }
    85% { top: 95%; opacity: 1; transform: scaleX(1); } /* 扫描到更底部 */
    95% { top: 95%; opacity: 0; transform: scaleX(0.8); } /* 在底部开始渐隐 */
    100% { top: 95%; opacity: 0; }
}

/* ================================================================
   精灵锚定列 — 相对于 doc-scene 定位，紧贴文档左侧
   ================================================================ */

/* ================================================================
   内联精灵行：精灵 + 气泡嵌在文档错误行末尾
   ================================================================ */

/* 错误行容器：文字 + 精灵 + 气泡横排 */
.audit-example-row {
    display: flex;
    align-items: center;
    gap: 5px;
    text-indent: 0; /* 覆盖父级 audit-example 的缩进 */
}

.audit-example-text {
    flex: 1;
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
    min-width: 0;
}

/* 内联精灵：小尺寸，不抢文档视线 */
.inline-agent {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: sprite-float 2.8s ease-in-out infinite;
}

.inline-agent .sprite-arch {
    width: 26px;
    height: 32px;
    border-radius: 13px 13px 3px 3px;
    padding-top: 7px;
    gap: 4px;
    /* 颜色沿用已有 .sprite-color-N .sprite-arch */
}

.inline-agent .sprite-eye {
    width: 6px !important;
    height: 6px !important;
    box-shadow: 0 0 0 1.5px rgba(0,0,0,0.5) !important;
}

/* 眼睛朝左看向错误文字（精灵在文字右侧，瞳孔向左偏移） */
.inline-agent .sprite-pupil {
    width: 3px !important;
    height: 3px !important;
    left: 22% !important;
    transform: translate(-50%, -50%) !important;
}

/* 内联气泡：精灵右侧，左箭头指向精灵 */
.inline-bubble {
    position: relative;
    background: white;
    border: 1px solid #e5e7eb;
    border-left-width: 2.5px; /* 颜色由 style="" 内联覆盖 */
    border-radius: 6px;
    padding: 4px 9px;
    font-size: 11px;
    white-space: nowrap;
    color: #374151;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    flex-shrink: 0;
    flex-basis: 96px; /* 以最长 7 字标签为基准统一气泡宽度，保证精灵左对齐 */
    text-align: center;
    animation: bubble-breathe 4s ease-in-out infinite;
}

/* 气泡左侧小箭头（指向精灵） */
.inline-bubble::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-right-color: #e5e7eb;
}
.inline-bubble::after {
    content: '';
    position: absolute;
    left: -3px;
    top: 50%;
    transform: translateY(-50%);
    border: 3px solid transparent;
    border-right-color: white;
}

/* 各行气泡错开动画 */
.audit-dimension:nth-child(1) .inline-bubble { animation-delay: 0s; }
.audit-dimension:nth-child(2) .inline-bubble { animation-delay: 1.0s; }
.audit-dimension:nth-child(3) .inline-bubble { animation-delay: 2.0s; }
.audit-dimension:nth-child(4) .inline-bubble { animation-delay: 3.0s; }

.audit-dimension:nth-child(1) .inline-agent { animation-delay: 0s; }
.audit-dimension:nth-child(2) .inline-agent { animation-delay: -0.7s; }
.audit-dimension:nth-child(3) .inline-agent { animation-delay: -1.4s; }
.audit-dimension:nth-child(4) .inline-agent { animation-delay: -2.1s; }

@keyframes bubble-breathe {
    0%, 100% { box-shadow: 0 1px 6px rgba(0,0,0,0.06); }
    50%       { box-shadow: 0 2px 10px rgba(99,102,241,0.14); }
}


/* ═══════════════════════════════════════════════════════════
   doc-bottom 内部：精灵行 + 跳入动画
   ═══════════════════════════════════════════════════════════ */

/* 上传提示行 */
.doc-agent-row {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

/* 跳入动画（标题行精灵使用） */
.doc-agent-jump-in {
    animation: doc-sprite-jump-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
               sprite-float 2.8s ease-in-out 0.3s infinite;
}

@keyframes doc-sprite-jump-in {
    0%   { transform: translateY(-30px) scale(0.4); opacity: 0; }
    60%  { transform: translateY(4px) scale(1.12); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   迷茫态：眼睛变 ？形 + 问号气泡
   ═══════════════════════════════════════════════════════════ */

.sprite-arch.is-confused {
    animation: confused-wiggle 1.4s ease-in-out infinite;
}

@keyframes confused-wiggle {
    0%, 100% { transform: rotate(0deg); }
    20%      { transform: rotate(-5deg); }
    40%      { transform: rotate(5deg); }
    60%      { transform: rotate(-3deg); }
    80%      { transform: rotate(3deg); }
}

/* 迷茫眼：眼白变灰、瞳孔斗鸡眼（各自往中间靠） */
.eye-confused {
    border-radius: 50% !important;
    background: #e5e7eb !important;
}
/* 左眼瞳孔偏右（往内靠） */
.sprite-arch.is-confused .sprite-eye:first-child .sprite-pupil {
    left: 68% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
}
/* 右眼瞳孔偏左（往内靠） */
.sprite-arch.is-confused .sprite-eye:last-child .sprite-pupil {
    left: 32% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
}

/* ═══════════════════════════════════════════════════════════
   上传提示区（替代原气泡样式）
   ═══════════════════════════════════════════════════════════ */

.doc-upload-prompt {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
    border: 1px dashed #a5b4fc;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
    margin-top: -10px;
    transition: background 0.3s, border-color 0.3s;
}

/* 已上传态：整体绿色调 */
.doc-upload-prompt.is-uploaded {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
    border-style: solid;
}

.dup-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #e0e7ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366f1;
    transition: background 0.3s, color 0.3s;
}

/* 已上传：图标绿色 */
.dup-icon.dup-icon-ok {
    background: #bbf7d0;
    color: #16a34a;
}

/* 上传失败：图标红色 */
.dup-icon.dup-icon-err {
    background: #fee2e2;
    color: #dc2626;
}

/* 上传中旋转 */
@keyframes dup-spin {
    to { transform: rotate(360deg); }
}
.dup-spin {
    animation: dup-spin 0.9s linear infinite;
    transform-origin: center;
}

.dup-text {
    flex: 1;
    font-size: 12px;
    color: #4338ca;
    line-height: 1.4;
    min-width: 0;
}

/* 已上传：文件名绿色，超长截断 */
.dup-text.dup-text-ok {
    color: #15803d;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dup-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 7px;
    padding: 5px 11px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s, transform 0.12s;
}

.dup-btn:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

/* 重新上传按钮：绿色调 */
.dup-btn.dup-btn-reupload {
    background: #16a34a;
}

.dup-btn.dup-btn-reupload:hover {
    background: #15803d;
}

.dup-btn svg {
    flex-shrink: 0;
}

/* doc-bottom 内审查行的淡入动画 */
.is-swapped .doc-bottom .audit-dimension {
    opacity: 0;
    animation: row-fadein 0.4s ease forwards;
}

@keyframes row-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 上传等待图标脉冲 - 见后面 @keyframes icon-upload-pulse */
.f-icon.f-icon-upload {
    background: #fef3c7;
    animation: icon-upload-pulse 1.8s ease-in-out infinite;
}

/* 响应式：小屏隐藏精灵列 */
@media (max-width: 992px) {
    .hero-section {
        flex-direction: column;
        text-align: center;
        gap: 40px;
        padding: 40px 20px;
    }

    .hero-content {
        flex: none;
        max-width: 100%;
    }

    .doc-agents-rail {
        display: none;
    }

    .upload-controls {
        justify-content: center;
        flex-direction: column;
        gap: 20px;
    }

    .hero-visual {
        height: 360px;
        align-self: auto;
    }

    .document-stack {
        margin-left: 0;
    }
}


/* 编辑器页面 - 动态布局 */
.editor-page {
    display: flex;
    flex-direction: column; /* Changed to column */
    height: 100%;
    background: #f8f9fa;
    transition: background-color 0.8s ease;
    width: 100%;
}

.editor-page.is-auditing {
    background: linear-gradient(135deg, #e8f4f8 0%, #f5e8f0 100%);
}

.main-header {
    flex-shrink: 0;
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.editor-page.is-auditing .main-header {
    background: white;
    border-bottom-color: #e9ecef;
}

.editor-page.is-auditing .document-title {
    color: #2d3436;
}

.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 中间文档区 */
.document-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    margin: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.editor-page.is-auditing .document-area {
    flex: 0 0 35%; /* Fixed width during audit */
    opacity: 0.7;
    pointer-events: none;
    border-right: 1px solid #e9ecef;
    transform: scale(0.98);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.1);
    background: white;
}

.review-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    backdrop-filter: blur(5px);
}

.review-status-box {
    background: white;
    padding: 30px 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    color: #2d3436;
    font-size: 16px;
    font-weight: 500;
}

.cyber-grid {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        linear-gradient(rgba(102, 126, 234, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(102, 126, 234, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 5;
    display: none;
}

.editor-page.is-auditing .cyber-grid { display: block; }

.scanner-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent, rgba(102, 126, 234, 0.05) 50%, rgba(102, 126, 234, 0.15) 100%);
    border-bottom: 2px solid #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
    z-index: 10;
    animation: scan 7s linear infinite; /* Slower animation */
    pointer-events: none;
    display: none;
}

.editor-page.is-auditing .scanner-line { display: block; }

@keyframes scan {
    0% { top: 0%; }
    100% { top: 100%; }
}

.pulse-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    box-shadow: inset 0 0 50px rgba(102, 126, 234, 0.05);
    animation: pulse-border 2s infinite alternate;
    pointer-events: none;
    z-index: 11;
    display: none;
}

.editor-page.is-auditing .pulse-overlay { display: block; }

@keyframes pulse-border {
    0% { box-shadow: inset 0 0 20px rgba(102, 126, 234, 0.02); }
    100% { box-shadow: inset 0 0 40px rgba(102, 126, 234, 0.1); }
}

.analysis-section { padding: 20px; }
.analysis-section h4 { margin-bottom: 12px; color: #1f2937; font-size: 16px; }
.analysis-section p { font-size: 14px; line-height: 1.7; color: #4b5563; }

.tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 15px; }
.tech-item { background: #f8f9fa; padding: 15px; border-radius: 8px; font-size: 14px; border: 1px solid #e9ecef; }
.tech-item strong { color: #4f46e5; display: block; margin-bottom: 6px; font-size: 15px; }

.document-title { font-size: 18px; font-weight: 600; color: #2d3436; transition: color 0.8s ease; }

.switch { position: relative; display: inline-block; width: 34px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.3); transition: .4s; border-radius: 20px; border: 1px solid rgba(255,255,255,0.5); }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 1px; bottom: 1px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .slider { background-color: #4f46e5; border-color: #4f46e5; }
input:checked + .slider:before { transform: translateX(14px); }

.new-upload-btn { padding: 8px 20px; background: #4f46e5; color: white; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; }
.editor-page.is-auditing .new-upload-btn { display: none; }

.document-content-wrapper {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    z-index: 12;
}

.line-numbers {
    padding: 40px 10px 40px 20px;
    text-align: right;
    color: #ccc;
    font-size: 16px;
    line-height: 1.8;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    overflow: hidden;
}

.line-number {
    display: block;
}

.document-content {
    flex: 1;
    padding: 40px 60px 40px 20px;
    overflow-y: auto;
    line-height: 1.8;
    font-size: 16px;
    color: #2d3436;
    position: relative;
    transition: all 0.8s ease;
    scroll-behavior: smooth;
}

.editor-page.is-auditing .document-content { color: #636e72; }
.editor-page.is-auditing .document-content p,
.editor-page.is-auditing .document-content li,
.editor-page.is-auditing .document-content h1,
.editor-page.is-auditing .document-content h2,
.editor-page.is-auditing .document-content h3 { transition: color 0.3s, background-color 0.3s; }
.editor-page.is-auditing .document-content *:hover { color: #2d3436 !important; background-color: rgba(102, 126, 234, 0.05); }

.document-content p { margin-bottom: 1em; }
.document-content h1, .document-content h2, .document-content h3,
.document-content h4, .document-content h5, .document-content h6 { margin-top: 1.5em; margin-bottom: 0.5em; color: #1a1a1a; }
.editor-page.is-auditing .document-content h1,
.editor-page.is-auditing .document-content h2,
.editor-page.is-auditing .document-content h3 { color: #667eea; border-bottom-color: #f1f3f5; }
.document-content h1 { font-size: 2em; border-bottom: 1px solid #eee; padding-bottom: 0.3em; }
.document-content h2 { font-size: 1.5em; border-bottom: 1px solid #eee; padding-bottom: 0.3em; }
.document-content h3 { font-size: 1.25em; }
.document-content ul, .document-content ol { margin-bottom: 1em; padding-left: 2em; }
.document-content li { margin-bottom: 0.5em; }
.document-content pre { background-color: #f8f9fa; border-radius: 6px; padding: 16px; overflow-x: auto; margin-bottom: 1em; border: 1px solid #e9ecef; }
.editor-page.is-auditing .document-content pre { background-color: rgba(102, 126, 234, 0.05); border-color: rgba(102, 126, 234, 0.1); }
.document-content code { font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; background-color: #f1f3f5; padding: 2px 4px; border-radius: 3px; font-size: 0.9em; color: #d63384; }
.editor-page.is-auditing .document-content code { background-color: transparent; color: #667eea; }
.document-content pre code { background-color: transparent; padding: 0; color: #24292e; }

.document-content a { transition: all 0.3s; }
.document-content a.link-checking { opacity: 0.7; cursor: wait; position: relative; color: #f39c12 !important; text-shadow: 0 0 8px rgba(243, 156, 18, 0.4); }
.document-content a.link-checking::after { content: " [探测中...]"; display: inline-block; margin-left: 4px; font-size: 10px; animation: pulse-text 1s linear infinite; color: #f39c12; }
@keyframes pulse-text { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* 链接检查结果标签动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-10px); }
}

.link-check-result {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.link-check-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.link-check-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.link-check-checking {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}
.document-content a.link-valid { text-decoration-color: #27ae60; text-underline-offset: 3px; }
.editor-page.is-auditing .document-content a.link-valid { color: #00b894 !important; }
.document-content a.link-broken { color: #d63031; text-decoration: underline wavy #d63031; text-underline-offset: 4px; background-color: rgba(214, 48, 49, 0.1); border-radius: 2px; padding: 0 2px; }
.editor-page.is-auditing .document-content a.link-broken { background-color: rgba(214, 48, 49, 0.15); color: #d63031 !important; }

.highlight { background: linear-gradient(120deg, #ffeaa7 0%, #fdcb6e 100%); padding: 2px 4px; border-radius: 3px; cursor: pointer; position: relative; border-bottom: 2px solid #fdcb6e; color: #2d3436; }
.editor-page.is-auditing .highlight { background: rgba(255, 107, 107, 0.2); border-bottom: 2px solid #ff6b6b; color: #2d3436 !important; animation: highlightPulse 0.6s ease-out; }

/* 审计阶段的高亮脉冲动画 */
@keyframes highlightPulse {
    0% { background: rgba(255, 107, 107, 0.4); transform: scale(1.02); }
    100% { background: rgba(255, 107, 107, 0.2); transform: scale(1); }
}

.comments-area {
    width: 550px;
    min-width: 250px;
    max-width: 800px;
    background: white;
    margin: 20px 20px 20px 0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden; /* Prevent inner content from overflowing the rounded corners */
}

.editor-page.is-auditing .comments-area {
    flex: 1;
    max-width: none;
    width: auto;
    background: transparent;
    box-shadow: none;
    margin-left: 0;
}

.resize-handle { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; cursor: ew-resize; background: transparent; z-index: 10; }
.editor-page.is-auditing .resize-handle { display: none; }

/* 审计控制栏（切换器 + 终止按钮） */
.audit-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.stop-audit-btn {
    flex-shrink: 0;
    margin-right: 10px;
    padding: 6px 14px;
    background: #fff0f0;
    color: #dc2626;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.stop-audit-btn:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}
.stop-audit-btn:active {
    background: #b91c1c;
    border-color: #b91c1c;
}

/* 审计期间的视图切换器 */
.audit-view-switcher {
    flex: 1;
    padding: 10px;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.audit-view-switcher button {
    padding: 6px 16px;
    border: 1px solid #d1d5db;
    background-color: white;
    color: #4b5563;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}
.audit-view-switcher button:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}
.audit-view-switcher button.active {
    background-color: #eef2ff;
    color: #4f46e5;
    border-color: #a5b4fc;
    font-weight: 600;
}
.error-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid white;
}


/* Unified Audit Panel */
.audit-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Unified Status Display */
.unified-dashboard {
    padding: 20px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.unified-status-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #eef2f5 100%);
    border: 1px solid #e9ecef;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.ai-avatar-container {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-avatar {
    width: 80px;
    height: 80px;
    z-index: 2;
}

.ai-avatar.is-working .master-float {
    animation: master-float 4s ease-in-out infinite;
}

.spinner-ring {
    position: absolute;
    top: -6px; left: -6px; right: -6px; bottom: -6px;
    border: 3px solid rgba(102, 126, 234, 0.1);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    z-index: 1;
}

.status-info {
    flex: 1;
}

.status-info h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #2d3436;
    font-weight: 600;
}

.status-info .status-text {
    font-size: 14px;
    color: #667eea;
    font-weight: 500;
    line-height: 1.4;
}

/* Thinking Process Preview Box - Refined for writers */
.thinking-preview-box {
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

/* Audit Progress Bar - Between thinking and dashboard */
.audit-progress-container {
    padding: 6px 20px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.audit-progress-bar {
    flex: 1;
    height: 4px;
    background: #f1f3f5;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.audit-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.8s linear;
    position: relative;
}

.audit-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.audit-progress-text {
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
    min-width: 38px;
    text-align: right;
}

.thinking-preview-box strong {
    display: block;
    margin-bottom: 8px;
    color: #636e72;
    font-size: 13px;
    font-weight: normal;
}
.thinking-content-display {
    max-height: 4.8em; /* Approx 3 lines */
    overflow-y: auto;
    font-size: 14px; /* 更亲和文字工作者 */
    line-height: 1.6;
    color: #2d3436;
    white-space: pre-wrap;
    background: transparent;
    padding: 0;
    border: none;
    font-style: italic;
    opacity: 0.8;
}

/* AI Chat Message Flow */
.audit-log-box.chat-style {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 90%;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-avatar {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.chat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.chat-bubble-wrapper {
    display: flex;
    align-items: center;
}

.chat-bubble {
    background: white;
    padding: 12px 16px;
    border-radius: 0 16px 16px 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #2d3436;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.link-status-indicator {
    margin-left: 10px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-success {
    width: 12px;
    height: 6px;
    border-bottom: 2px solid #00b894;
    border-left: 2px solid #00b894;
    transform: rotate(-45deg);
}

.icon-error {
    width: 12px;
    height: 12px;
    position: relative;
}
.icon-error::before,
.icon-error::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 0;
    width: 12px;
    height: 2px;
    background-color: #ff7675;
}
.icon-error::before {
    transform: rotate(45deg);
}
.icon-error::after {
    transform: rotate(-45deg);
}

.msg-info .chat-bubble {
    border-left: 3px solid #667eea;
}

.msg-warn .chat-bubble {
    border-left: 3px solid #fdcb6e;
    background: #fffdf5;
}

.msg-error .chat-bubble {
    border-left: 3px solid #ff7675;
    background: #fff5f5;
}

.msg-success .chat-bubble {
    border-left: 3px solid #00b894;
    background: #f5fbf9;
}

.chat-time {
    font-size: 11px;
    color: #b2bec3;
    margin-left: 4px;
}


.cursor-blink { display: inline-block; width: 2px; height: 14px; background-color: #667eea; vertical-align: middle; margin-left: 2px; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.errors-list { flex: 1; padding: 20px; position: relative; }
.editor-page.is-auditing .errors-list { display: block; } /* Keep it in the layout */
.empty-status { text-align: center; color: #a4b0be; padding: 40px 0; font-size: 14px; }

.comment-card {
    background: #fff;
    border-left: 4px solid #fdcb6e;
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    position: relative;
    transition: all 0.3s;
    cursor: pointer;
    animation: fadeIn 0.4s ease-out;
    border: 1px solid #f1f3f5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.comment-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateX(-4px); }
.comment-card.link-error-card { border-left-color: #ff7675; }
.comment-header { font-weight: 600; color: #2d3436; margin-bottom: 8px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.political-tag { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; line-height: 1.4; }
.political-tag.tag-category { background: #eef2ff; color: #4f46e5; }
.political-tag.tag-risk { background: #fef3c7; color: #92400e; }
.political-tag.tag-score { background: #ecfdf5; color: #047857; }
.severity-badge { padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.severity-high { background: #ff7675; color: white; }
.severity-medium { background: #fdcb6e; color: #2d3436; }
.severity-low { background: #74b9ff; color: white; }
.comment-original { background: #f8f9fa; padding: 8px; border-radius: 4px; margin: 8px 0; font-size: 13px; color: #636e72; word-break: break-all; }
.comment-suggestion { background: #d4edda; padding: 8px; border-radius: 4px; margin: 8px 0; font-size: 13px; color: #155724; }
.comment-reason { font-size: 12px; color: #636e72; margin-top: 8px; line-height: 1.5; white-space: pre-wrap; }
.apply-btn { width: 100%; padding: 8px; background: #00b894; color: white; border: none; border-radius: 6px; cursor: pointer; margin-top: 10px; font-size: 13px; }
.apply-btn:hover { background: #00a383; }
.apply-btn:disabled { background: #b2bec3; cursor: not-allowed; }
.ignore-btn { width: 100%; padding: 8px; background: #636e72; color: white; border: none; border-radius: 6px; cursor: pointer; margin-top: 8px; font-size: 13px; }
.ignore-btn:hover { background: #2d3436; }

/* 拦截徽章和卡片样式 */
.intercepted-card {
    opacity: 0.8;
    border-left-color: #a4b0be;
    background-color: #fcfcfc;
}
.intercepted-badge {
    margin-top: 10px;
    padding: 8px;
    background: #f1f2f6;
    color: #57606f;
    border-radius: 6px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #dfe4ea;
}
.intercepted-badge::before {
    content: '🛡️';
}
.strikethrough-text {
    text-decoration: line-through;
    color: #a4b0be;
}


.loading-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.loading-box { background: white; padding: 40px; border-radius: 12px; text-align: center; }
.complete-modal { background: white; padding: 40px; border-radius: 16px; max-width: 500px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.3); }
.complete-modal h2 { color: #00b894; margin-bottom: 20px; font-size: 24px; }
.complete-modal p { color: #2d3436; line-height: 1.8; font-size: 15px; margin-bottom: 30px; }
.complete-modal button { padding: 12px 40px; background: #00b894; color: white; border: none; border-radius: 8px; cursor: pointer; font-size: 16px; font-weight: 600; }
.complete-modal button:hover { background: #00a383; }

.spinner { width: 50px; height: 50px; border: 4px solid #f3f3f3; border-top: 4px solid #667eea; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 10px; }
.spinner-small { width: 20px; height: 20px; border: 3px solid rgba(102,126,234,0.3); border-top: 3px solid #667eea; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.editor-page.is-auditing ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); }
.audit-log-box::-webkit-scrollbar-thumb { background: #ccc; }
.thinking-content-display::-webkit-scrollbar-thumb { background: #b2bec3; }
.editor-page.is-auditing .thinking-content-display::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); }

/* 页脚版权信息 */
.page-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 4px 20px;
    text-align: center;
    font-size: 11px;
    color: #636e72;
    border-top: 1px solid #e9ecef;
    z-index: 1000;
}

.page-footer p {
    margin: 0;
}

/* Styles for corrected items */
.corrected-apply {
    background: #d4edda !important; /* Light green */
    color: #155724 !important;
    border-bottom: 2px solid #00b894;
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
}

.corrected-del {
    background: #f8d7da !important; /* Light red */
    color: #721c24 !important;
    text-decoration: line-through;
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
}

/* ==========================================================
   全新引擎功能配置选项卡矩阵样式
   ========================================================== */
.engine-features {
    margin-bottom: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 0;
}

/* ─────────── 左侧功能设置卡：把模式切换 + 功能区框起来 ─────────── */
.feature-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 14px 14px 12px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    backdrop-filter: blur(8px);
    transition: background 0.3s ease, border-color 0.3s ease;
}

/* ─────────── 顶部模式切换器 ─────────── */
.mode-switcher {
    position: relative;
    display: inline-flex;
    align-self: flex-start;
    background: rgba(226, 232, 240, 0.7);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: background 0.4s ease;
    isolation: isolate; /* 建立层叠上下文，防止滑块被外部叠盖 */
}

/* 滑动指示条：绝对定位到激活选项上，靠 translateX 平滑切换 */
.mode-switcher-pill {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    background: #ffffff;
    border-radius: 9px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1),
                background 0.4s ease,
                box-shadow 0.4s ease;
    z-index: 0;
    pointer-events: none;
}

.mode-switcher.mode-graph .mode-switcher-pill {
    transform: translateX(100%);
}

.mode-switcher-option {
    position: relative;
    z-index: 1;
    appearance: none;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 18px;
    border-radius: 9px;
    cursor: pointer;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.mode-switcher-option:hover:not(.is-active) {
    color: #1f2937;
}

.mode-switcher-option.is-active {
    color: #4f46e5;
}

/* ─────────── 模式面板：承载当前模式下的所有 feature-group ─────────── */
.mode-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Vue <transition name="mode-slide"> 的过渡类 —— 与切换器滑块同步 */
.mode-slide-enter-active,
.mode-slide-leave-active {
    transition: opacity 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.mode-slide-enter-from {
    opacity: 0;
    transform: translateX(24px);
}
.mode-slide-leave-to {
    opacity: 0;
    transform: translateX(-24px);
}

/* 入场时，内部卡片错峰滑入（在父 transition 淡入之上叠加一层轻微错位） */
.mode-slide-enter-active .feature-group {
    animation: feature-group-rise 0.5s both cubic-bezier(0.34, 1.2, 0.64, 1);
}
.mode-slide-enter-active .feature-group:nth-child(1) { animation-delay: 0.05s; }
.mode-slide-enter-active .feature-group:nth-child(2) { animation-delay: 0.14s; }

@keyframes feature-group-rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 分组标题 */
.feature-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.feature-group-label {
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding-left: 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

/* 两列网格（只用于融入建议的“新”融+思政）——左右各内缩 4px，避免卡片紧贴容器边 */
.features-grid:not(.features-grid-full) {
    padding: 0 4px;
}

/* 单列变体：每张卡横向撑满，与核心卡宽度一致；卡间距加大 */
.features-grid.features-grid-full {
    grid-template-columns: 1fr;
    gap: 14px;
}

.feature-card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.75);
    border: 1.5px solid rgba(203, 213, 225, 0.7);
    padding: 10px 14px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(10px);
    user-select: none;
    gap: 4px;
}

/* 卡片第一行：图标 + 标题 + 单选框 */
.f-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.92);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.08);
    border-color: rgba(165, 180, 252, 0.5);
}

.feature-card.is-active {
    background: #ffffff;
    border-color: #818cf8;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.18);
    /* 左侧彩条作为激活指示器 */
    border-left: 3.5px solid #4f46e5;
}

/* 核心审核卡：默认启用、不可切换 */
.feature-card-core {
    cursor: default;
    background: linear-gradient(135deg, rgba(124,58,237,0.08) 0%, rgba(99,102,241,0.05) 100%);
    border-left: 3.5px solid #7c3aed;
}

.feature-card-core:hover {
    /* 关掉通用 hover 的上移 */
    transform: none;
    background: linear-gradient(135deg, rgba(124,58,237,0.1) 0%, rgba(99,102,241,0.07) 100%);
    border-color: rgba(124,58,237,0.4);
    box-shadow: 0 4px 18px rgba(124,58,237,0.18);
}

.feature-card-core .f-check {
    cursor: default;
}

/* 锁定态：其他卡片置灰，禁止交互 */
.feature-card.is-card-locked {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(40%);
}

/* 上传提示区警告态：红边 + 抖动 */
.doc-upload-prompt.is-warning {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
    animation: upload-warn-shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards;
}

@keyframes upload-warn-shake {
    0%             { transform: translateX(0); }
    12%, 52%, 88%  { transform: translateX(-6px); }
    28%, 68%       { transform: translateX(6px); }
    100%           { transform: translateX(0); }
}

/* 精灵头上警告气泡 */
.sprite-warn-bubble {
    position: absolute;
    top: -36px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1.5px solid #ef4444;
    color: #dc2626;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    padding: 4px 9px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.18);
    animation: bubble-pop-in 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    pointer-events: none;
    z-index: 20;
}

/* 气泡下方小三角 */
.sprite-warn-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #ef4444;
    border-bottom: none;
}

@keyframes bubble-pop-in {
    from { transform: translateX(-50%) scale(0.6); opacity: 0; }
    to   { transform: translateX(-50%) scale(1);   opacity: 1; }
}

/* 右侧圆形勾选指示器 */
.f-check {
    flex-shrink: 0;
    margin-left: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: transparent;
    transition: background 0.22s ease, border-color 0.22s ease,
                transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

/* 未激活时 hover：圈变深一点，暗示可点击 */
.feature-card:hover .f-check {
    border-color: #a5b4fc;
}

/* 激活态：实心紫圈 + 白色对勾 */
.feature-card.is-active .f-check {
    background: #4f46e5;
    border-color: #4f46e5;
    transform: scale(1.1);
}

.feature-card.is-active .f-check::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: 2px solid white;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

/* .f-icon 改为相对定位容器，以便 spawn sprite 绝对定位 */
.f-icon-wrap {
    position: relative;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.f-icon {
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    transition: background 0.3s, transform 0.15s;
    flex-shrink: 0;
}

.feature-card.is-active .f-icon {
    background: #e0e7ff;
    box-shadow: 0 0 0 2px #a5b4fc;
}

/* 上传等待态：图标变 📎，添加轻微脉冲 */
.f-icon.f-icon-upload {
    background: #fef3c7;
    animation: icon-upload-pulse 1.8s ease-in-out infinite;
}

@keyframes icon-upload-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.3); }
    50%       { box-shadow: 0 0 0 5px rgba(245,158,11,0); }
}

.f-title {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

.f-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
    margin-top: 2px;
}

/* 卡片元信息：耗时 / 产出 —— 同一行，中间间距自适应，不撑开卡片宽度 */
.f-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: #64748b;
    line-height: 1.5;
    min-width: 0;
}

.f-meta-item {
    white-space: nowrap;
    min-width: 0;
}

.f-meta-key {
    display: inline-block;
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 6px;
    font-size: 10px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.feature-card.is-active .f-meta-key {
    background: #e0e7ff;
    color: #4338ca;
}

/* ─── 耗时计算中：三点 loading + 柔化文字 ─── */
.f-meta-computing {
    color: #94a3b8;
    font-style: italic;
    animation: meta-computing-pulse 1.6s ease-in-out infinite;
}

@keyframes meta-computing-pulse {
    0%, 100% { opacity: 0.7; }
    50%       { opacity: 1; }
}

.dot-loader {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    margin-left: 4px;
    height: 10px;
}

.dot-loader i {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.35;
    animation: dot-loader-bounce 1.1s ease-in-out infinite both;
}

.dot-loader i:nth-child(1) { animation-delay: 0s; }
.dot-loader i:nth-child(2) { animation-delay: 0.18s; }
.dot-loader i:nth-child(3) { animation-delay: 0.36s; }

@keyframes dot-loader-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
    40%           { transform: translateY(-3px); opacity: 1; }
}
/* 上传按钮跟随功能容器底部 */
.upload-controls {
    width: 100%;
    margin-top: 16px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}
.upload-btn {
    width: 100%;
}

/* ─────────── 已上传待审核文档预览卡 ─────────── */
.pending-doc-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
    background: #ffffff;
    border: 1.5px solid #a5b4fc;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.12);
    animation: pending-doc-appear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pending-doc-appear {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pending-doc-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.pending-doc-info {
    flex: 1;
    min-width: 0;
}

.pending-doc-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.pending-doc-meta {
    font-size: 12px;
    color: #64748b;
}

.pending-doc-stat-label {
    display: inline-block;
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 4px;
    font-size: 10px;
}

.pending-doc-sep {
    color: #cbd5e1;
    margin: 0 8px;
}

.pending-doc-reselect {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #9ca3af;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pending-doc-reselect:hover:not(:disabled) {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

.pending-doc-reselect:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─────────── 底部汇总条 + 右嵌按钮 ─────────── */
.upload-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 12px 12px 18px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.28);
    color: #ffffff;
    width: 100%;
    box-sizing: border-box;
    transition: opacity 0.2s ease;
}

.upload-bar.is-disabled {
    opacity: 0.75;
}

.upload-bar-info {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}

.upload-bar-line {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.upload-bar-line-sub {
    font-size: 12px;
    opacity: 0.88;
    margin-top: 2px;
}

.upload-bar-key {
    opacity: 0.82;
    font-weight: 500;
}

.upload-bar-value {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    margin: 0 2px;
}

.upload-bar-line-sub .upload-bar-value {
    font-size: 15px;
}

.upload-bar-unit {
    opacity: 0.85;
    font-size: 12px;
    font-weight: 500;
}

.upload-bar-hint {
    opacity: 0.8;
    font-size: 12px;
}

/* 步骤徽章：上传栏在"图谱+教材"两步流程时用来区分当前步骤 */
.upload-step-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    color: #c7d2fe;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-right: 6px;
    line-height: 1.4;
}
.upload-step-badge-ok {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
}
.upload-step-badge-ok svg {
    margin-top: 1px;
}

.upload-bar-btn {
    flex-shrink: 0;
    appearance: none;
    border: none;
    background: #ffffff;
    color: #4f46e5;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    white-space: nowrap;
}

.upload-bar-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    background: #f5f3ff;
}

.upload-bar-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.upload-bar-btn:disabled {
    cursor: not-allowed;
    background: #f1f5f9;
    color: #94a3b8;
    box-shadow: none;
}

/* ═════════════════════════════════════════════
   暗色主题：图谱联查模式（.hero-section.mode-graph）
   ═════════════════════════════════════════════ */
.hero-section.mode-graph {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 60%, #312e81 100%);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
}

/* 文字 */
.hero-section.mode-graph .subtitle {
    color: #cbd5e1;
}

.hero-section.mode-graph .feature-group-label {
    color: #64748b;
}

/* 功能设置卡：深色变体 */
.hero-section.mode-graph .feature-panel {
    background: rgba(15, 23, 42, 0.45);
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

/* 模式切换器：深色变体 */
.hero-section.mode-graph .mode-switcher {
    background: rgba(15, 23, 42, 0.6);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.1);
}
.hero-section.mode-graph .mode-switcher-pill {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}
.hero-section.mode-graph .mode-switcher-option {
    color: #94a3b8;
}
.hero-section.mode-graph .mode-switcher-option:hover:not(.is-active) {
    color: #e2e8f0;
}
.hero-section.mode-graph .mode-switcher-option.is-active {
    color: #ffffff;
}

/* 功能卡：深色变体 */
.hero-section.mode-graph .feature-card {
    background: rgba(30, 41, 59, 0.55);
    border-color: rgba(148, 163, 184, 0.2);
    backdrop-filter: blur(10px);
}
.hero-section.mode-graph .feature-card:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(165, 180, 252, 0.4);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.22);
}
.hero-section.mode-graph .feature-card.is-active {
    background: rgba(67, 56, 202, 0.3);
    border-color: #818cf8;
    box-shadow: 0 4px 18px rgba(129, 140, 248, 0.25);
}

.hero-section.mode-graph .f-title {
    color: #f1f5f9;
}
.hero-section.mode-graph .f-desc {
    color: #94a3b8;
}
.hero-section.mode-graph .f-meta-row,
.hero-section.mode-graph .f-meta-computing {
    color: #94a3b8;
}

.hero-section.mode-graph .f-icon {
    background: rgba(30, 41, 59, 0.9);
    color: #e2e8f0;
}

.hero-section.mode-graph .f-meta-key {
    background: rgba(129, 140, 248, 0.2);
    color: #a5b4fc;
}
.hero-section.mode-graph .feature-card.is-active .f-meta-key {
    background: rgba(129, 140, 248, 0.32);
    color: #c7d2fe;
}

/* 单选圈 */
.hero-section.mode-graph .f-check {
    border-color: #475569;
}
.hero-section.mode-graph .feature-card:hover .f-check {
    border-color: #818cf8;
}

/* 待审文档预览卡：深色变体 */
.hero-section.mode-graph .pending-doc-card {
    background: rgba(30, 41, 59, 0.75);
    border-color: rgba(129, 140, 248, 0.5);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.hero-section.mode-graph .pending-doc-name {
    color: #f1f5f9;
}
.hero-section.mode-graph .pending-doc-meta {
    color: #94a3b8;
}
.hero-section.mode-graph .pending-doc-icon {
    background: linear-gradient(135deg, rgba(99,102,241,0.3) 0%, rgba(124,58,237,0.22) 100%);
}
.hero-section.mode-graph .pending-doc-stat-label {
    background: rgba(99,102,241,0.22);
    color: #a5b4fc;
}
.hero-section.mode-graph .pending-doc-reselect {
    background: rgba(51, 65, 85, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    color: #94a3b8;
}
.hero-section.mode-graph .pending-doc-reselect:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(248, 113, 113, 0.5);
    color: #fca5a5;
}

/* 底部汇总条：略微调整以在暗背景上不过亮 */
.hero-section.mode-graph .upload-bar {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

/* 响应式：在小屏幕上自动变为单列排列 */
@media (max-width: 680px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================
   New Tabbed Results View
   ========================================================== */
.results-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.results-tabs {
    display: flex;
    flex-shrink: 0;
    border-bottom: 1px solid #e9ecef;
    padding: 0 20px;
    background: #f8f9fa;
}

.results-tabs button {
    padding: 12px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #636e72;
    position: relative;
    transition: color 0.3s;
}

.results-tabs button:hover {
    color: #2d3436;
}

.results-tabs button.active {
    color: #4f46e5;
    font-weight: 600;
}

.results-tabs button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 3px;
    background: #4f46e5;
    border-radius: 3px 3px 0 0;
}

.tab-count {
    display: inline-block;
    margin-left: 6px;
    background: #e9ecef;
    color: #636e72;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
}

.results-tabs button.active .tab-count {
    background: #e0e7ff;
    color: #4f46e5;
}

.results-content {
    flex: 1;
    overflow-y: auto;
}

.results-content .errors-list,
.results-content .analysis-section {
    padding: 20px;
}

/* Confirm Modal Styles */
.confirm-modal {
    background: white;
    padding: 40px;
    border-radius: 16px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: modal-pop-in 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes modal-pop-in {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.confirm-modal h2.confirm-title {
    color: #ef4444; /* Red for warning */
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 700;
}

.confirm-modal p.confirm-message {
    color: #2d3436;
    line-height: 1.8;
    font-size: 15px;
    margin-bottom: 30px;
    white-space: pre-wrap; /* To handle newlines from the message */
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.confirm-button {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.1s ease;
}

.confirm-button:hover {
    transform: translateY(-2px);
}

.confirm-button-primary {
    background: #ef4444; /* Red for primary action (confirming the warning) */
    color: white;
}

.confirm-button-primary:hover {
    background: #dc2626;
}

.confirm-button {
    background: #e2e8f0; /* Light gray for secondary action (cancel) */
    color: #4b5563;
}

.confirm-button:hover {
    background: #cbd5e1;
}

/* ==========================================================
   Risk Filter Styles
   ========================================================== */
.risk-filter-bar {
    position: sticky;
    top: 0;
    margin: -20px -20px 15px -20px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 1px solid #f1f3f5;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.risk-tag {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.risk-tag:hover {
    background: #f1f3f5;
    border-color: #dee2e6;
}

.risk-tag.active {
    background: #eef2ff;
    border-color: #a5b4fc;
    color: #4f46e5;
    font-weight: 600;
}

.risk-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.bg-high { background-color: #ff7675; }
.bg-medium { background-color: #fdcb6e; }
.bg-low { background-color: #74b9ff; }

/* ==========================================================
   精灵系统（Agent Sprites）
   ========================================================== */

/* 精灵入场舞台 */
.agent-stage {
    padding: 8px 16px 4px;
    border-bottom: 1px solid #f1f3f5;
}
.agent-sprite-row {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
    min-height: 56px;
}

/* 单个精灵（舞台版） */
.agent-sprite {
    display: flex;
    flex-direction: column;
    position: relative;
    align-items: center;
    gap: 3px;
    animation: sprite-float 2.8s ease-in-out infinite;
    transform-origin: bottom center;
}
.agent-sprite:nth-child(1) { animation-delay: 0s; }
.agent-sprite:nth-child(2) { animation-delay: -0.45s; }
.agent-sprite:nth-child(3) { animation-delay: -0.9s; }
.agent-sprite:nth-child(4) { animation-delay: -1.35s; }
.agent-sprite:nth-child(5) { animation-delay: -1.8s; }
@keyframes sprite-float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-5px); }
}

/* 飞行的公用书本 */
.flying-book {
    position: absolute;
    transform: translateX(-50%);
    z-index: 20;
    pointer-events: none;
    transition: left 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), top 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.flying-book-inner {
    font-size: 18px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    animation: book-hover 1.5s ease-in-out infinite;
}

@keyframes book-hover {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

/* 弹入动画 */
.sprite-pop-enter-active {
    animation: sprite-jelly-in 0.58s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
    animation-delay: 0s !important;
}
.sprite-pop-leave-active {
    animation: sprite-jelly-out 0.25s ease-in forwards;
}
@keyframes sprite-jelly-in {
    0%   { opacity: 0; transform: translateY(30px) scaleY(0.4) scaleX(1.35); }
    40%  { opacity: 1; transform: translateY(-6px) scaleY(1.2) scaleX(0.87); }
    65%  {             transform: translateY(3px)  scaleY(0.9) scaleX(1.07); }
    82%  {             transform: translateY(-2px) scaleY(1.04) scaleX(0.98); }
    100% { opacity: 1; transform: translateY(0)   scaleY(1)   scaleX(1); }
}
@keyframes sprite-jelly-out {
    0%   { opacity: 1; transform: scaleY(1); }
    100% { opacity: 0; transform: scaleY(0.3) translateY(10px); }
}

/* 拱形身体 */
.sprite-arch {
    width: 34px;
    height: 44px;
    border-radius: 17px 17px 5px 5px;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
    padding-top: 10px;
    box-sizing: border-box;
    box-shadow: 0 0 0 2.5px rgba(0,0,0,0.18);
}

/* 五色方案 */
.sprite-color-0 .sprite-arch { background: #818cf8; box-shadow: 0 0 0 2.5px #4338ca; }
.sprite-color-1 .sprite-arch { background: #38bdf8; box-shadow: 0 0 0 2.5px #0369a1; }
.sprite-color-2 .sprite-arch { background: #4ade80; box-shadow: 0 0 0 2.5px #15803d; }
.sprite-color-3 .sprite-arch { background: #f87171; box-shadow: 0 0 0 2.5px #b91c1c; }
.sprite-color-4 .sprite-arch { background: #fbbf24; box-shadow: 0 0 0 2.5px #92400e; }
/* ─── 功能智能体专属颜色（5–10，与审核智能体 0–4 区分） ─── */
.sprite-color-5 .sprite-arch  { background: #fb923c; box-shadow: 0 0 0 2.5px #c2410c; }  /* 橙 */
.sprite-color-6 .sprite-arch  { background: #2dd4bf; box-shadow: 0 0 0 2.5px #0f766e; }  /* 青绿 */
.sprite-color-7 .sprite-arch  { background: #f472b6; box-shadow: 0 0 0 2.5px #be185d; }  /* 粉 */
.sprite-color-8 .sprite-arch  { background: #a3e635; box-shadow: 0 0 0 2.5px #4d7c0f; }  /* 黄绿 */
.sprite-color-9 .sprite-arch  { background: #e879f9; box-shadow: 0 0 0 2.5px #a21caf; }  /* 紫粉 */
.sprite-color-10 .sprite-arch { background: #67e8f9; box-shadow: 0 0 0 2.5px #0891b2; }  /* 浅蓝 */
/* 系统消息（灰色） */
.sprite-color-sys .sprite-arch { background: #d1d5db; box-shadow: 0 0 0 2.5px #9ca3af; }

/* 眼睛 */
.sprite-arch .sprite-eye {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.55);
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    transition: all 0.2s ease;
}

/* 疲惫状态的眼睛变形 */
.agent-sprite.is-tired .sprite-eye {
    border-radius: 0 0 10px 10px !important;
    height: 7px !important;
    margin-top: 2px;
}
.agent-sprite.is-tired .sprite-eye:nth-child(1) {
    transform: rotate(-8deg);
}
.agent-sprite.is-tired .sprite-eye:nth-child(2) {
    transform: rotate(8deg);
}

/* 瞳孔（真实 DOM，JS 控制眼睛跟随） */
.sprite-arch .sprite-pupil {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #111;
    border-radius: 50%;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    will-change: transform;
    pointer-events: none;
}
.sprite-color-sys .sprite-arch .sprite-pupil { background: #6b7280; }

/* 投影 */
.sprite-shadow {
    width: 26px;
    height: 4px;
    background: rgba(0,0,0,0.13);
    border-radius: 50%;
    filter: blur(2px);
    animation: shadow-pulse 2.8s ease-in-out infinite;
}
.agent-sprite:nth-child(1) .sprite-shadow { animation-delay: 0s; }
.agent-sprite:nth-child(2) .sprite-shadow { animation-delay: -0.45s; }
.agent-sprite:nth-child(3) .sprite-shadow { animation-delay: -0.9s; }
.agent-sprite:nth-child(4) .sprite-shadow { animation-delay: -1.35s; }
.agent-sprite:nth-child(5) .sprite-shadow { animation-delay: -1.8s; }
@keyframes shadow-pulse {
    0%, 100% { transform: scaleX(1);   opacity: 0.65; }
    50%       { transform: scaleX(0.6); opacity: 0.3; }
}

/* 标签 */
.sprite-label {
    font-size: 10px;
    color: #9ca3af;
    white-space: nowrap;
    text-align: center;
    letter-spacing: 0.02em;
}

/* ── chat-avatar 精灵版（迷你，静止，无投影） ── */
.chat-avatar {
    width: 24px;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* 关掉 agent-sprite 的浮动动画（如果同时存在时） */
    animation: none !important;
}
.chat-avatar .sprite-arch {
    width: 22px;
    height: 28px;
    border-radius: 11px 11px 3px 3px;
    padding-top: 6px;
    gap: 3px;
    animation: none;
}
.chat-avatar .sprite-eye {
    width: 6px;
    height: 6px;
    box-shadow: 0 0 0 1.5px rgba(0,0,0,0.5);
}
.chat-avatar .sprite-pupil {
    width: 2.5px;
    height: 2.5px;
}
.chat-avatar .sprite-shadow { display: none; }

/* ── 合并结果的多头像堆叠 ── */
.merged-agent-avatars {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.merged-agent-avatars .chat-avatar {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 50%;
}
.merged-agent-avatars .chat-avatar:hover {
    transform: translateY(-2px) scale(1.15);
    z-index: 100 !important;
}

.sprite-sweat {
    position: absolute;
    top: 5px;
    right: -8px;
    font-size: 14px;
    animation: sweat-fly 0.6s infinite ease-out;
    z-index: 10;
}
@keyframes sweat-fly {
    0% { transform: translate(0, 0) scale(0.5); opacity: 0; }
    20% { transform: translate(5px, -5px) scale(1.2); opacity: 1; }
    100% { transform: translate(15px, 10px) scale(0); opacity: 0; }
}

/* ==========================================================
   全网搜索小窗 (Search Browser Panel)
   ========================================================== */
.search-browser-panel {
    position: fixed;
    right: -420px; /* 隐藏在屏幕外 */
    top: 50%;
    transform: translateY(-50%);
    width: 400px;
    height: 600px;
    background: #fff;
    border-radius: 12px;
    box-shadow: -5px 10px 30px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.search-browser-panel.is-open {
    right: 30px; /* 滑出显示 */
}

.browser-header {
    background: #f1f3f5;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
    gap: 15px;
}

.browser-controls {
    display: flex;
    gap: 6px;
}

.browser-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
}
.browser-dot.close { background: #ff5f56; }
.browser-dot.min { background: #ffbd2e; }
.browser-dot.max { background: #27c93f; }

.browser-url-bar {
    flex: 1;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lock-icon { font-size: 10px; opacity: 0.7; }

.browser-content {
    flex: 1;
    position: relative;
    background: #fff;
}

.browser-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.browser-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    flex-direction: column;
    gap: 15px;
}

.scanner-line-horizontal {
    width: 80%;
    height: 2px;
    background: #6366f1;
    box-shadow: 0 0 10px #6366f1;
    animation: scan-horizontal 1.5s ease-in-out infinite alternate;
}

@keyframes scan-horizontal {
    0% { transform: translateY(-30px); opacity: 0.5; }
    100% { transform: translateY(30px); opacity: 1; }
}

.analyzing-text {
    font-size: 14px;
    color: #4f46e5;
    font-weight: 600;
    animation: pulse-text 1.5s infinite;
}

/* ── 总管智能体验证 loading ── */
.master-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 18vh;
    z-index: 2000;
}

.master-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 480px;
    width: 100%;
    padding: 0 24px;
}

.master-loading-avatar {
    filter: drop-shadow(0 12px 32px rgba(109, 40, 217, 0.35));
}

.master-loading-title {
    font-size: 20px;
    font-weight: 700;
    color: #2e1065;
    letter-spacing: -0.3px;
}

.master-loading-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-top: -8px;
}

.master-loading-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    padding: 10px 16px;
    width: 100%;
    min-height: 44px;
}

.master-loading-item-label {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: #7c3aed;
    background: #ede9fe;
    border-radius: 4px;
    padding: 2px 6px;
}

.master-loading-item-text {
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.master-loading-dots {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.master-loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7c3aed;
    animation: master-dot-bounce 1.2s ease-in-out infinite;
}

.master-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.master-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes master-dot-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40%           { transform: scale(1);   opacity: 1; }
}

/* 轮换文字过渡 */
.master-item-fade-enter-active,
.master-item-fade-leave-active {
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.master-item-fade-enter-from {
    opacity: 0;
    transform: translateY(8px);
}
.master-item-fade-leave-to {
    opacity: 0;
    transform: translateY(-8px);
}

/* ───────────────── 下载订正文档面板 ───────────────── */
.download-panel {
    position: relative;
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #bbf7d0;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}
.download-panel.ds-state-generating {
    background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%);
    border-color: #bfdbfe;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.12);
}
.download-panel.ds-state-ready {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #6ee7b7;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.18);
}
.download-panel.ds-state-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fca5a5;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.12);
}
.download-panel .dl-row {
    display: flex;
    align-items: center;
    gap: 14px;
}
.download-panel .dl-icon-wrap {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
    color: #059669;
}
.download-panel.ds-state-generating .dl-icon-wrap { color: #2563eb; }
.download-panel.ds-state-ready .dl-icon-wrap { color: #059669; background: #a7f3d0; }
.download-panel.ds-state-error .dl-icon-wrap { color: #dc2626; }

.download-panel .dl-spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(37, 99, 235, 0.2);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: dl-spin 0.8s linear infinite;
}
@keyframes dl-spin {
    to { transform: rotate(360deg); }
}
.download-panel .dl-text {
    flex: 1;
    min-width: 0;
}
.download-panel .dl-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
}
.download-panel .dl-sub {
    margin-top: 2px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.download-panel .dl-sub-error { color: #dc2626; white-space: normal; }

.download-panel .dl-action {
    flex: 0 0 auto;
    height: 36px;
    padding: 0 16px;
    border: none;
    border-radius: 8px;
    background: #10b981;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.download-panel .dl-action:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.3);
}
.download-panel .dl-action:disabled {
    cursor: not-allowed;
    opacity: 0.75;
    background: #6b7280;
}
.download-panel.ds-state-generating .dl-action { background: #3b82f6; }
.download-panel.ds-state-ready .dl-action { background: #059669; }
.download-panel.ds-state-error .dl-action { background: #dc2626; }
.download-panel.ds-state-error .dl-action:hover:not(:disabled) { background: #b91c1c; }

.download-panel .dl-progress {
    margin-top: 12px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}
.download-panel .dl-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}
.download-panel.ds-state-ready .dl-progress-fill {
    background: linear-gradient(90deg, #10b981, #059669);
}
.download-panel .dl-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    animation: dl-shimmer 1.4s linear infinite;
}
@keyframes dl-shimmer {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}



/* ───────────────────────────────────────────────────────────
   思政建议（v4 · 外部有边界 · 内部无装饰）
   ─────────────────────────────────────────────────────────── */
.political-section {
    padding: 16px 20px 24px;
}

/* 大标题：研判报告 —— 给整个素养融入选项卡一个明确的 H3 入口 */
.political-section-title {
    margin: 0 0 14px;
    padding: 0 0 10px;
    border-bottom: 2px solid #ede9fe;
    color: #4c1d95;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* 二级小标题：素养点对应情况 / "新"融对应情况，作为下方卡片列表的引导 */
.political-section-subtitle {
    margin: 18px 0 10px;
    padding: 0;
    color: #4c1d95;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.political-section-subtitle::before {
    content: '';
    width: 3px;
    height: 14px;
    background: #a78bfa;
    border-radius: 2px;
    display: inline-block;
}
.four-new-section-subtitle {
    color: #9a3412;
}
.four-new-section-subtitle::before {
    background: #fb923c;
}
/* 首页 mini 版二级小标题 */
.political-section-subtitle-mini {
    margin: 10px 0 6px;
    font-size: 12px;
    font-weight: 600;
}
.political-section-subtitle-mini::before {
    width: 2px;
    height: 11px;
}

/* 研判目标 · 独立浅卡，与建议卡形成层级差 */
.political-brief {
    margin: 0 0 16px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #eef0f3;
    border-left: 3px solid #c4b5fd;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.75;
    color: #4b5563;
}
.political-brief-label {
    color: #6d28d9;
    font-weight: 600;
    margin-right: 8px;
}
/* 研判报告正文：保留 LLM 返回的原始换行（如 "1. xxx\n2. yyy" 这种列表）。
   white-space: pre-line 让 \n 渲染为换行但合并普通空白 —— 避免 LLM 顺手加一堆缩进。 */
.political-brief-body {
    white-space: pre-line;
}

/* ============================================================
 * 首页右侧示例卡：素养融入 mini 版
 *   把结果页的 .political-section-title / .political-brief /
 *   .political-card 按 deck-card 的尺寸压缩。所有 mini 类只是覆盖
 *   尺寸/留白/字号，配色与结果页保持一致，让用户在首页就能预览结果页。
 * ============================================================ */
.doc-text-political {
    overflow: auto;
}
.political-section-title-mini {
    margin: 0 0 10px;
    padding: 0 0 7px;
    border-bottom: 2px solid #ede9fe;
    color: #4c1d95;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.political-brief-mini {
    margin: 0 0 10px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #eef0f3;
    border-left: 3px solid #c4b5fd;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.6;
    color: #4b5563;
}
.political-card-mini {
    margin: 0 0 8px;
    padding: 8px 10px;
    border: 1px solid #eef0f3;
    border-left: 3px solid #a78bfa;
    border-radius: 6px;
    font-size: 11px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    /* 让示例卡逐张轻轻浮入，与原 audit-dimension 节奏一致 */
    opacity: 0;
    transform: translateY(6px);
    animation: pol-mini-fade 0.42s ease-out forwards;
}
@keyframes pol-mini-fade {
    to { opacity: 1; transform: translateY(0); }
}
.political-card-mini .comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
    font-size: 11px;
    color: #4c1d95;
    font-weight: 600;
}
.political-mini-idx {
    color: #4c1d95;
}
.political-card-mini .pol-pill {
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 500;
    border-radius: 999px;
    line-height: 1.4;
}
.political-mini-original {
    font-size: 11px;
    line-height: 1.55;
    color: #374151;
}
.political-mini-original strong {
    color: #6d28d9;
    margin-right: 4px;
}

/* ============================================================
 * "新"融选项卡 / 首页"新"融 mini 卡 —— 复用素养版式骨架，仅替换配色。
 *   智能体精灵 colorIndex = 5 是橙色（#fb923c / #c2410c），整套以橙系为主。
 *   选择器：在素养基础类后面叠 .four-new-* 覆盖颜色相关属性即可。
 * ============================================================ */
.four-new-section-title {
    color: #9a3412;
    border-bottom-color: #fed7aa;
}
.four-new-brief {
    border-left-color: #fdba74;
}
.four-new-brief-label {
    color: #c2410c;
}
.four-new-card {
    border-left-color: #fb923c !important;
}
.four-new-card .comment-header { color: #9a3412; }
.four-new-card .political-mini-original strong,
.four-new-section .comment-card .political-suggested-text strong {
    color: #c2410c;
}

/* 引入项编号文字色 */
.four-new-mini-idx { color: #9a3412 !important; }

/* 类别 / 关键词 pill：橙系深浅两档 */
.pol-pill.pol-pill-fournew-cat {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}
.pol-pill.pol-pill-fournew-key {
    background: #fb923c;
    color: #fff;
}

/* 结果页全宽版（非 mini）的 four-new 卡：补上素养版没用到的 reason / suggested 排版 */
.four-new-section .comment-reason { color: #4b5563; font-size: 13px; line-height: 1.7; margin-top: 8px; }
.four-new-section .comment-reason strong { color: #c2410c; margin-right: 4px; }
.four-new-section .political-suggested-text {
    margin-top: 8px;
    padding: 10px 12px;
    background: #fff7ed;
    border-left: 3px solid #fb923c;
    border-radius: 6px;
    font-size: 13px;
    color: #1f2937;
    line-height: 1.7;
}
/* ============================================================
 * 首页 mini：图谱联查两张卡的"结果预览"。
 *   knowledge_gap → gap-summary-mini + gap-tree-mini，复用结果页结构，
 *                   缩小内边距 / 字号到能塞进 deck-card 高度内。
 *   capability_map_design → gap-map-mini：左侧图谱节点 + 右侧教材片段，
 *                            模拟点击节点高亮跳转。
 * ============================================================ */

/* mini 总览：4 列网格压缩 */
.gap-summary-mini {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin: 0 0 10px;
}
.gap-summary-mini .gap-stat {
    padding: 6px 4px;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 6px;
    text-align: center;
}
.gap-summary-mini .gap-stat-value {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}
.gap-summary-mini .gap-stat-label {
    font-size: 10px;
    color: #6b7280;
    margin-top: 2px;
}

/* mini 项目树：紧凑卡 */
.gap-tree-mini { display: flex; flex-direction: column; gap: 8px; }
.gap-tree-mini .gap-project {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 8px;
    overflow: hidden;
}
.gap-tree-mini .gap-project-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #f9fafb;
    border-bottom: 1px solid #eef0f3;
}
.gap-tree-mini .gap-project-name {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
}
.gap-tree-mini .gap-caret { font-size: 10px; color: #9ca3af; }
.gap-tree-mini .gap-tasks { padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 6px; }
.gap-tree-mini .gap-task {
    border: 1px solid #eef0f3;
    border-radius: 6px;
    padding: 6px 8px;
    background: #fff;
}
.gap-tree-mini .gap-task-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.gap-tree-mini .gap-task-name { font-size: 11px; color: #1f2937; font-weight: 500; }
.gap-tree-mini .gap-items { display: flex; flex-direction: column; gap: 4px; padding-left: 8px; }
.gap-tree-mini .gap-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    background: #fafbff;
    border-radius: 4px;
    flex-wrap: wrap;
}
.gap-tree-mini .gap-item-type {
    padding: 1px 5px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 3px;
    flex-shrink: 0;
}
.gap-tree-mini .gap-item-name { font-size: 11px; color: #374151; flex: 1; min-width: 0; }
.gap-tree-mini .gap-item-meta { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.gap-tree-mini .gap-loc { font-size: 10px; color: #6b7280; }
.gap-tree-mini .gap-chip {
    padding: 1px 5px;
    font-size: 10px;
    font-weight: 500;
    border-radius: 999px;
    border: 1px solid transparent;
    line-height: 1.4;
}

/* mini 关联地图：左节点 + 右教材片段 */
.gap-map-mini {
    display: grid;
    grid-template-columns: 5fr 6fr;
    gap: 8px;
    height: 100%;
    min-height: 0;
    position: relative;     /* 让 .gap-map-mini-link 可以绝对定位覆盖在两栏之上 */
}
/* 连接线 SVG 覆盖层：跟随 mini 容器铺满整张图谱+教材区，
   端点由 home.js 算出后写入 path d。pointer-events:none 不挡点击。 */
.gap-map-mini-link {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 3;
}
.gap-map-mini-link-path {
    fill: none;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-dasharray: 6 5;
    /* 与左侧节点 / 右侧 mark 的 2.4s 呼吸节奏同步：流动一圈也是 2.4s */
    animation: gap-mini-link-flow 2.4s linear infinite,
               gap-mini-link-glow 2.4s ease-in-out infinite;
    filter: drop-shadow(0 0 3px rgba(16, 185, 129, 0.45));
}
@keyframes gap-mini-link-flow {
    0%   { stroke-dashoffset: 22; }
    100% { stroke-dashoffset: 0; }
}
@keyframes gap-mini-link-glow {
    0%, 100% { opacity: 0.55; stroke-width: 1.6; }
    50%      { opacity: 1;    stroke-width: 2.2; }
}
.gap-map-mini-tree {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: #fafbff;
    border: 1px solid #eef0f3;
    border-radius: 6px;
    overflow: auto;
}
.gap-map-mini-tree .gap-map-node {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: default;
    background: #fff;
    border: 1px solid #eef0f3;
}
.gap-map-mini-tree .gap-map-node-project {
    background: #f3e8ff;
    border-color: #e9d5ff;
}
.gap-map-mini-tree .gap-map-node-task {
    margin-left: 8px;
}
.gap-map-mini-tree .gap-map-node-item {
    margin-left: 18px;
}
.gap-map-mini-tree .gap-map-node.is-active {
    background: #ecfdf5;
    border-color: #6ee7b7;
    /* 用同一条 gap-mini-pulse keyframe 给 active 节点和右侧 mark 加同步呼吸效果，
       视觉上看像两端被同一个心跳脉冲串起来，明确指示"它们对应同一处"。 */
    animation: gap-mini-pulse 2.4s ease-in-out infinite;
}
.gap-map-mini-tree .gap-map-tag {
    padding: 1px 5px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 3px;
    flex-shrink: 0;
}
.gap-map-mini-tree .gap-map-name {
    font-size: 11px;
    color: #1f2937;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gap-map-mini-textbook {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 6px;
    overflow: auto;
}
.gap-map-mini-tip {
    font-size: 10px;
    color: #6b7280;
    padding-bottom: 4px;
    border-bottom: 1px dashed #e5e7eb;
}
.gap-map-mini-snippet {
    font-size: 11.5px;
    line-height: 1.7;
    color: #374151;
}
/* snippet 里允许 h4 / h5 充当章节小标题 —— mini 尺寸下也要可读、不能比正文还小 */
.gap-map-mini-snippet h4 {
    margin: 0 0 4px;
    padding: 0;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
}
.gap-map-mini-snippet h5 {
    margin: 6px 0 4px;
    padding: 0;
    font-size: 12px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.5;
}
.gap-map-mini-snippet p {
    margin: 4px 0 0;
}
.gap-map-mini-snippet mark.gap-anchor-active {
    background: linear-gradient(120deg, #fde68a 0%, #fcd34d 100%);
    color: #7c2d12;
    padding: 1px 3px;
    border-radius: 3px;
    /* 与左侧 active 节点同节奏的呼吸高亮，串起两端 */
    animation: gap-mini-pulse-mark 2.4s ease-in-out infinite;
}

/* 左侧 active 节点：绿色光晕呼吸（边框/阴影/亮度） */
@keyframes gap-mini-pulse {
    0%, 100% {
        box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15),
                    0 0 0 0   rgba(16, 185, 129, 0);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.35),
                    0 0 12px 2px rgba(16, 185, 129, 0.28);
    }
}

/* 右侧匹配高亮：金黄色光晕呼吸 */
@keyframes gap-mini-pulse-mark {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.0);
        background: linear-gradient(120deg, #fde68a 0%, #fcd34d 100%);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.35),
                    0 0 14px 3px rgba(251, 191, 36, 0.45);
        background: linear-gradient(120deg, #fcd34d 0%, #fbbf24 100%);
    }
}

/* 关联地图 mini：占用整张卡可用高度，至少 320px。
   父级 deck-card 内部是 doc-header（约 64px）+ doc-text-gap-map，让 grid
   两栏都撑到容器高度，左侧节点列表与右侧教材片段都能各自滚动。 */
.gap-map-mini {
    display: grid;
    grid-template-columns: 5fr 6fr;
    gap: 10px;
    height: 100%;
    min-height: 320px;
    max-height: 100%;
}
.gap-map-mini-tree,
.gap-map-mini-textbook {
    height: 100%;
    min-height: 0;        /* 让 grid 子项允许内部滚动而不撑爆父容器 */
}

.doc-text-gap-check {
    overflow: auto;
}
/* doc-text-gap-map 用 flex 撑满 deck-card 减去 header 后的高度 */
.doc-text-gap-map {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.doc-text-gap-map > .gap-map-mini { flex: 1 1 auto; }

/* 建议卡 · 复用 .comment-card，微调左边条为紫色线索，维持思政专属视觉 */
.political-section .comment-card.political-card {
    border-left: 4px solid #a78bfa;
}
.political-section .comment-card.political-card:hover {
    border-left-color: #8b5cf6;
    transform: translateX(-4px);
}
.political-section .comment-card.political-card .comment-header {
    flex-wrap: wrap;
    gap: 6px;
}

/* 思政专用药丸 · 与 .severity-badge / .political-tag 平行 */
.pol-pill {
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.6;
    white-space: nowrap;
    border: 1px solid transparent;
    letter-spacing: 0.2px;
}

/* 融入点类型 · 按主题分色 */
.pol-pill-cat-default      { background: #f3f4f6; color: #4b5563; border-color: #e5e7eb; }
.pol-pill-cat-patriotic    { background: #fef2f2; color: #b91c1c; border-color: #fecaca; } /* 爱国主义 · 红 */
.pol-pill-cat-professional { background: #fff7ed; color: #c2410c; border-color: #fed7aa; } /* 职业素养 · 橙 */
.pol-pill-cat-scientific   { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; } /* 科学精神 · 蓝 */
.pol-pill-cat-collective   { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; } /* 集体主义 · 绿 */
.pol-pill-cat-legal        { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; } /* 法治规范 · 紫 */

/* 风险等级 · 复用严重度配色语义 */
.pol-pill-risk-high   { background: #ff7675; color: #fff;   border-color: #ff7675; }
.pol-pill-risk-medium { background: #fdcb6e; color: #2d3436; border-color: #fdcb6e; }
.pol-pill-risk-low    { background: #74b9ff; color: #fff;   border-color: #74b9ff; }

/* 自然度分 · 中性灰调 */
.pol-pill-score { background: #ecfdf5; color: #047857; border-color: #d1fae5; }

/* ───────────────────────────────────────────────────────────
   图谱与教材内容匹配度检查 · 独立页
   ─────────────────────────────────────────────────────────── */
.gap-check-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #f6f7f9;
}
.gap-check-body {
    flex: 1;
    padding: 24px 32px 40px;
    overflow-y: auto;
    max-width: 920px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}
.gap-check-meta {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    position: relative;
}
.gap-meta-row {
    display: flex;
    gap: 12px;
    font-size: 13px;
    line-height: 1.9;
    color: #374151;
}
.gap-meta-row .gap-meta-label {
    color: #6b7280;
    font-weight: 600;
    min-width: 72px;
}

.gap-check-loading {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 22px;
    background: #fff;
    border: 1px solid #e0e7ff;
    border-left: 3px solid #6366f1;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
    position: relative;
}

/* 智能体宿主：右侧居中，撑出位置不参与 flex 布局 */
.gap-check-sprite-host {
    position: absolute;
    top: 50%;
    right: 22px;
    transform: translateY(-50%);
    width: 40px;
    height: 56px;
    pointer-events: none;
    z-index: 5;
}
/* 加载态宿主额外加宽，给左右两份悬浮文档腾位置 */
.gap-check-sprite-host-loading {
    width: 116px;
    height: 80px;
    right: 32px;
}
.gap-check-sprite-host > .agent-sprite {
    position: absolute;
    inset: 0;
    margin: auto;
}

/* ───── 审查态：智能体两侧的悬浮文档 ───── */
.gap-floating-doc {
    position: absolute;
    top: 50%;
    width: 32px;
    height: 40px;
    border-radius: 4px;
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border: 1px solid #cbd5e1;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 3;          /* 压在 sprite-arch (默认) 之上 */
}
/* 文档"折角"装饰（右上小三角） */
.gap-floating-doc::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 7px;
    height: 7px;
    background: #e2e8f0;
    border-bottom-left-radius: 3px;
    box-shadow: -1px 1px 0 #cbd5e1;
}
.gap-floating-doc-icon {
    font-size: 14px;
    line-height: 1;
    margin-top: 4px;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.08));
}
.gap-floating-doc-label {
    font-size: 9px;
    font-weight: 600;
    color: #475569;
    letter-spacing: 0.5px;
    line-height: 1;
    margin-top: 1px;
}

/* 左侧：教材文档（轻微左倾，错峰漂浮） */
.gap-floating-doc-left {
    left: 12px;
    top: 38%;
    animation: gap-doc-float-left 2.6s ease-in-out infinite;
}
/* 右侧：图谱文件（轻微右倾） */
.gap-floating-doc-right {
    right: 12px;
    top: 38%;
    animation: gap-doc-float-right 2.6s ease-in-out -1.3s infinite;
}
.gap-floating-doc-right .gap-floating-doc-label {
    color: #0f766e;
}

@keyframes gap-doc-float-left {
    0%, 100% { transform: translateY(-50%) rotate(-6deg) translateY(0); }
    50%      { transform: translateY(-50%) rotate(-6deg) translateY(-5px); }
}
@keyframes gap-doc-float-right {
    0%, 100% { transform: translateY(-50%) rotate(6deg)  translateY(0); }
    50%      { transform: translateY(-50%) rotate(6deg)  translateY(-5px); }
}

/* ───── 审查态：瞳孔扫视
   思路：
   - 两只眼睛同步看向同一份文档（共用同一关键帧）
   - 每边停留时间不等（30%/45%），看起来不像机械循环
   - 永不回中：关键帧里没有任何一帧停在前方
   ───── */
.sprite-pupil-scan {
    transform: translate(-95%, -50%);  /* 默认看左 */
    animation: gap-pupil-look 7.3s ease-in-out infinite;
}

@keyframes gap-pupil-look {
    0%   { transform: translate(-95%, -50%); }   /* 看左：教材 */
    38%  { transform: translate(-95%, -50%); }   /* 看左已凝视 38% */
    44%  { transform: translate(-15%, -50%); }   /* 快速扫到右 */
    86%  { transform: translate(-15%, -50%); }   /* 看右：图谱，凝视 42% */
    92%  { transform: translate(-95%, -50%); }   /* 快速扫回左 */
    100% { transform: translate(-95%, -50%); }
}

/* 思考气泡：略微盖住精灵右上角，气泡内三点 loading 表示该精灵正在思考/响应。
   仅在 is-inspecting 时渲染（v-if）。 */
.agent-sprite .sprite-bubble {
    position: absolute;
    top: -8px;
    right: -22px;
    min-width: 26px;
    height: 16px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: #ffffff;
    border: 1px solid rgba(79, 70, 229, 0.35);
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.14),
                0 1px 2px rgba(15, 23, 42, 0.08);
    z-index: 5;
    pointer-events: none;
    transform-origin: 20% 100%;
    animation: sprite-bubble-pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both,
               sprite-bubble-float 2.4s ease-in-out 0.32s infinite;
}

.agent-sprite .sprite-bubble-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #4f46e5;
    opacity: 0.35;
    animation: sprite-bubble-dot 1.1s ease-in-out infinite;
}
.agent-sprite .sprite-bubble-dot:nth-child(2) { animation-delay: 0.18s; }
.agent-sprite .sprite-bubble-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes sprite-bubble-pop {
    0%   { opacity: 0; transform: scale(0.3) translate(-4px, 6px); }
    70%  { opacity: 1; transform: scale(1.1) translate(0, 0); }
    100% { opacity: 1; transform: scale(1)   translate(0, 0); }
}

@keyframes sprite-bubble-float {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(0, -2px); }
}

@keyframes sprite-bubble-dot {
    0%, 80%, 100% { opacity: 0.3;  transform: translateY(0); }
    40%           { opacity: 1;    transform: translateY(-2px); }
}

/* 第一次：从加载条上方跳入（appear） */
.gap-sprite-warp-enter-active {
    animation: gap-sprite-warp-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
/* 离开：原地快速缩小消失（审核结束时） */
.gap-sprite-warp-leave-active {
    animation: gap-sprite-warp-out 0.22s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* 第二次：从 meta 卡片上方跳入 */
.gap-sprite-warp-meta-enter-active {
    /* 0.28s 延迟用来等加载条里的离开动画播完 + 一点空白，营造"穿梭"节奏 */
    animation: gap-sprite-warp-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.28s both;
}
.gap-sprite-warp-meta-leave-active {
    animation: gap-sprite-warp-out 0.22s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes gap-sprite-warp-in {
    0%   { opacity: 0; transform: translateY(-34px) scale(0.5); }
    60%  { opacity: 1; transform: translateY(4px) scale(1.12); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes gap-sprite-warp-out {
    0%   { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(0) scale(0.1); }
}
.gap-check-spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2.5px solid #c7d2fe;
    border-top-color: #6366f1;
    animation: swb-spin 0.9s linear infinite;
    flex-shrink: 0;
}
.gap-check-loading-title {
    font-size: 14px;
    font-weight: 600;
    color: #4338ca;
}
.gap-check-loading-sub {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}
@keyframes swb-spin {
    to { transform: rotate(360deg); }
}

.gap-check-error {
    padding: 16px 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #991b1b;
    font-size: 13px;
    line-height: 1.7;
}
.gap-check-retry {
    margin-left: 12px;
    padding: 4px 12px;
    border: 1px solid #fca5a5;
    background: #fff;
    color: #991b1b;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}
.gap-check-retry:hover { background: #fef2f2; }

.gap-check-result {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 10px;
    padding: 20px 24px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    font-size: 14px;
    line-height: 1.8;
    color: #1f2937;
}
.gap-check-result h1,
.gap-check-result h2,
.gap-check-result h3,
.gap-check-result h4 {
    margin: 18px 0 10px;
    color: #111827;
}
.gap-check-result h1 { font-size: 20px; border-bottom: 1px solid #e5e7eb; padding-bottom: 8px; }
.gap-check-result h2 { font-size: 17px; }
.gap-check-result h3 { font-size: 15px; }
.gap-check-result h4 { font-size: 14px; color: #374151; }
.gap-check-result ul,
.gap-check-result ol { padding-left: 1.6em; margin: 6px 0 12px; }
.gap-check-result li { margin: 4px 0; }
.gap-check-result code {
    background: #f3f4f6;
    color: #be185d;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 90%;
}
.gap-check-result pre {
    background: #f9fafb;
    border: 1px solid #eef0f3;
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
    font-size: 13px;
}
.gap-check-result table {
    border-collapse: collapse;
    margin: 10px 0;
    width: 100%;
}
.gap-check-result th,
.gap-check-result td {
    border: 1px solid #e5e7eb;
    padding: 6px 10px;
    font-size: 13px;
    text-align: left;
}
.gap-check-result th { background: #f9fafb; font-weight: 600; }
.gap-check-result blockquote {
    margin: 10px 0;
    padding: 8px 14px;
    border-left: 3px solid #c7d2fe;
    background: #f5f3ff;
    color: #4338ca;
    border-radius: 0 6px 6px 0;
}

.gap-check-empty {
    padding: 40px 0;
    text-align: center;
    color: #9ca3af;
}

/* ───────── 图谱检查 · 结构化可视化 ───────── */
.gap-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}
.gap-stat {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    text-align: center;
}
.gap-stat-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    color: #111827;
}
.gap-stat-label {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
    letter-spacing: 0.3px;
}
.gap-stat-covered .gap-stat-value { color: #047857; }
.gap-stat-partial .gap-stat-value { color: #b45309; }
.gap-stat-missing .gap-stat-value { color: #b91c1c; }
.gap-stat-rate    .gap-stat-value { color: #4338ca; }

/* 树形列表容器 */
.gap-tree { display: flex; flex-direction: column; gap: 12px; }

/* 项目卡 */
.gap-project {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}
.gap-project-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.gap-project-head:hover { background: #f9fafb; }
.gap-project-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gap-caret {
    display: inline-block;
    font-size: 12px;
    color: #9ca3af;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.gap-caret.is-open { transform: rotate(90deg); color: #4338ca; }
.gap-project-name {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gap-project-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.gap-note {
    padding: 0 16px 10px 36px;
    font-size: 12.5px;
    color: #6b7280;
    line-height: 1.6;
}

/* 任务列表 */
.gap-tasks {
    padding: 4px 16px 14px 36px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid #f3f4f6;
}
.gap-task {
    background: #fafbfc;
    border: 1px solid #eef0f3;
    border-radius: 8px;
    padding: 10px 12px;
}
.gap-task-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.gap-task-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #1f2937;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gap-task-meta { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* 技能/知识条目 */
.gap-items {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.gap-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
        "type name meta"
        "reason reason reason";
    gap: 6px 10px;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #eef0f3;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.gap-item-main { display: contents; }
.gap-item-type {
    grid-area: type;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.gap-item-type-skill     { background: #eef2ff; color: #4f46e5; }
.gap-item-type-knowledge { background: #ecfdf5; color: #047857; }
.gap-item-name {
    grid-area: name;
    font-size: 13px;
    color: #1f2937;
    line-height: 1.6;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gap-item-meta {
    grid-area: meta;
    display: flex;
    gap: 6px;
    align-items: center;
}
.gap-item-reason {
    grid-area: reason;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.6;
    padding-left: 8px;
    border-left: 2px solid #e5e7eb;
}

/* partial 条目 · 橙色静态边框 */
.gap-item.gap-status-partial {
    border-color: #fdba74;
    background: #fff7ed;
}

/* missing 条目 · 红色呼吸灯 */
.gap-item.gap-status-missing {
    border-color: #fca5a5;
    background: #fef2f2;
}
.gap-item-breathing {
    animation: gap-breathing 2.2s ease-in-out infinite;
}
@keyframes gap-breathing {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
        border-color: #fca5a5;
    }
    50% {
        box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
        border-color: #ef4444;
    }
}

/* 状态 chip */
.gap-chip {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 9px;
    border-radius: 999px;
    line-height: 1.6;
    white-space: nowrap;
    border: 1px solid transparent;
}
.gap-chip-matched   { background: #ecfdf5; color: #047857; border-color: #d1fae5; }
.gap-chip-covered   { background: #ecfdf5; color: #047857; border-color: #d1fae5; }
.gap-chip-similar   { background: #fef6ec; color: #b45309; border-color: #fde7c3; }
.gap-chip-partial   { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.gap-chip-missing   { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.gap-loc {
    font-size: 11.5px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    white-space: nowrap;
}

/* 原始报告折叠区 */
.gap-raw-toggle {
    margin-top: 22px;
    padding: 8px 14px;
    color: #6b7280;
    font-size: 12.5px;
    cursor: pointer;
    user-select: none;
    display: inline-block;
}
.gap-raw-toggle:hover { color: #4338ca; }
.gap-raw-body { margin-top: 8px; }

/* 降级展示 */
.gap-parse-error {
    padding: 12px 16px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    color: #92400e;
    font-size: 13px;
    margin-bottom: 14px;
}
.gap-parse-error-sub {
    margin-top: 4px;
    font-size: 12px;
    color: #a16207;
}

@media (max-width: 720px) {
    .gap-summary { grid-template-columns: repeat(2, 1fr); }
    .gap-item {
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "type name"
            "meta meta"
            "reason reason";
    }
}

/* ────────────────────────────────────────────
   图谱联查页 · Tab 切换（匹配度 / 关联地图）
   ──────────────────────────────────────────── */
.gap-page-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: #f3f4f6;
    border-radius: 999px;
    margin-left: 16px;
}
.gap-page-tab {
    padding: 6px 18px;
    font-size: 13px;
    color: #6b7280;
    background: transparent;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
}
.gap-page-tab:hover { color: #4338ca; }
.gap-page-tab.active {
    background: #fff;
    color: #4338ca;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* ────────────────────────────────────────────
   关联地图：左图谱 + 右教材 分屏
   ──────────────────────────────────────────── */
.gap-map-body {
    flex: 1;
    padding: 18px 28px 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    min-height: 0;
}

/* 顶部工具条 */
.gap-map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 10px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.gap-map-toolbar-info {
    font-size: 12.5px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.gap-map-toolbar-key { color: #6b7280; }
.gap-map-toolbar-val { color: #1f2937; font-weight: 500; margin-right: 4px; }
.gap-map-toolbar-sep { color: #d1d5db; }

.gap-map-download-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.18s, transform 0.18s;
    flex-shrink: 0;
}
.gap-map-download-btn:hover:not(:disabled) { transform: translateY(-1px); }
.gap-map-download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.gap-map-download-btn.ds-state-ready {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
}
.gap-map-download-btn.ds-state-error {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}
.gap-map-download-error {
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #b91c1c;
    font-size: 12.5px;
}

/* 主分屏 */
.gap-map-main {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: 14px;
    min-height: 0;
}

/* 左：图谱树 */
.gap-map-tree {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 10px;
    padding: 10px 12px;
    overflow-y: auto;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.gap-map-project { margin-bottom: 12px; }
.gap-map-project:last-child { margin-bottom: 0; }
.gap-map-tasks {
    margin-left: 14px;
    border-left: 1px dashed #e5e7eb;
    padding-left: 10px;
    margin-top: 6px;
}
.gap-map-task { margin-bottom: 8px; }
.gap-map-items {
    margin-left: 14px;
    border-left: 1px dashed #f3f4f6;
    padding-left: 10px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gap-map-node {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    user-select: none;
    border: 1px solid transparent;
    line-height: 1.5;
}
.gap-map-node:hover { background: #f5f6fa; }
.gap-map-node.is-active {
    background: #eef2ff;
    border-color: #c7d2fe;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}
.gap-map-node.is-disabled {
    cursor: not-allowed;
    opacity: 0.55;
}
.gap-map-node.is-disabled:hover { background: transparent; }

.gap-map-node-project { background: #f9fafb; font-weight: 600; }
.gap-map-node-project .gap-map-name { color: #111827; font-size: 13.5px; }
.gap-map-node-task .gap-map-name { color: #1f2937; font-size: 13px; }
.gap-map-node-item .gap-map-name { color: #374151; font-size: 12.5px; }

.gap-map-tag {
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}
.gap-map-tag-project   { background: #f3e8ff; color: #6b21a8; }
.gap-map-tag-task      { background: #e0f2fe; color: #075985; }
.gap-map-tag-skill     { background: #eef2ff; color: #4f46e5; }
.gap-map-tag-knowledge { background: #ecfdf5; color: #047857; }

.gap-map-node .gap-map-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gap-map-node .gap-chip { flex-shrink: 0; }

/* status missing 的条目仍可点击查看说明，但视觉上弱化 */
.gap-map-node-item.gap-status-missing { background: #fef2f2; }
.gap-map-node-item.gap-status-partial { background: #fff7ed; }

/* 右：教材正文 */
.gap-map-textbook {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 10px;
    padding: 18px 24px;
    overflow-y: auto;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    line-height: 1.85;
    color: #1f2937;
}
.gap-map-textbook-inner {
    font-size: 14px;
    word-wrap: break-word;
}
.gap-map-textbook-inner h1,
.gap-map-textbook-inner h2,
.gap-map-textbook-inner h3,
.gap-map-textbook-inner h4 {
    margin: 18px 0 10px;
    color: #111827;
    font-weight: 600;
}
.gap-map-textbook-inner h1 { font-size: 20px; }
.gap-map-textbook-inner h2 { font-size: 17px; }
.gap-map-textbook-inner h3 { font-size: 15px; }
.gap-map-textbook-inner p { margin: 8px 0; }
.gap-map-textbook-inner img { max-width: 100%; }
.gap-map-textbook-inner table {
    border-collapse: collapse;
    margin: 10px 0;
}
.gap-map-textbook-inner th,
.gap-map-textbook-inner td {
    border: 1px solid #e5e7eb;
    padding: 6px 10px;
    font-size: 13px;
}
.gap-map-textbook-inner th { background: #f9fafb; }

/* anchor 高亮 */
.gap-anchor-active {
    background: linear-gradient(120deg, #fde68a 0%, #fcd34d 100%);
    color: #78350f;
    padding: 0 3px;
    border-radius: 3px;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.3);
    animation: gap-anchor-pulse 1.6s ease-in-out;
}
@keyframes gap-anchor-pulse {
    0% {
        background: linear-gradient(120deg, #fef3c7 0%, #fde68a 100%);
        box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.5);
    }
    100% {
        background: linear-gradient(120deg, #fde68a 0%, #fcd34d 100%);
        box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.3);
    }
}

.gap-map-empty {
    color: #9ca3af;
    text-align: center;
    padding: 40px 20px;
    font-size: 13px;
}

@media (max-width: 960px) {
    .gap-map-main {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(200px, 40vh) 1fr;
    }
    .gap-map-tree { max-height: 40vh; }
}

/* anchor 定位失败提示 */
.gap-anchor-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 18px;
    background: rgba(31, 41, 55, 0.92);
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 9999;
    max-width: 80vw;
    text-align: center;
}
.gap-anchor-toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}