 /* ============================================
                   ★★★ #dgbiao 主容器 ★★★
                   ============================================ */
 #dgbiao {
     display: none;
     /* display: flex; */
     flex-direction: column;
     /* ★ 关键：flex 列布局 */
     position: fixed;
     top: 50%;
     left: 50%;
     transform: translate(-50%, -50%);
     width: 95%;
     height: 90%;
     background: #fff;
     border: 2px solid #333;
     box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
     z-index: 10001;
     padding: 0;
     /* 由内部元素控制间距 */
     overflow: hidden;
     /* 防止内容溢出 */
     border-radius: 8px;
 }

 /* ============================================
                   ★★★ 顶部栏 #dingbuqu ★★★
                   ============================================ */
 #dgbiao .header-bar#dingbuqu {
     flex-shrink: 0;
     /* 不压缩 */
     display: flex;
     flex-wrap: nowrap;
     gap: 6px;
     align-items: center;
     background: #f8f9fa;
     border-bottom: 2px solid #007bff;
     padding: 6px 12px;
     overflow-x: auto;
     min-height: 52px;
     z-index: 10;
     position: relative;
 }

 #dgbiao .header-bar select,
 #dgbiao .header-bar button {
     border: 2px solid #333;
     border-radius: 4px;
     background: #ffffff;
     color: #000000;
     padding: 4px 8px;
     font-size: 13px;
     cursor: pointer;
     flex-shrink: 0;
     white-space: nowrap;
     box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
 }

 #dgbiao .header-bar button:hover {
     background: #e9ecef;
     border-color: #007bff;
 }

 #dgbiao .header-bar select {
     min-width: 90px;
     appearance: auto;
 }

 #dgbiao .header-bar #nodgb {
     border-color: #dc3545;
 }

 #dgbiao .header-bar #nodgb:hover {
     background: #f8d7da;
 }

 #dgbiao .header-bar .hint {
     border: none;
     background: none;
     font-size: 12px;
     color: #666;
     flex-shrink: 0;
 }

 /* 作品设置按钮高亮 */
 #dgbiao .zuopin-btn {
     margin-left: auto;
     border: 2px solid #007bff !important;
     background: #e7f1ff !important;
     color: #0056b3 !important;
 }

 #dgbiao .zuopin-btn:hover {
     background: #cce0ff !important;
     border-color: #0056b3 !important;
 }

 #dgbiao #dgb-zhujue-avatar {
     width: 28px;
     height: 28px;
     border-radius: 50%;
     object-fit: cover;
     vertical-align: middle;
     flex-shrink: 0;
 }

 /* ============================================
                   ★★★ flex 行容器：表格区 + 侧边栏 ★★★
                   ============================================ */
 #dgbiao .flex-row {
     display: flex;
     flex: 1;
     /* 占据剩余高度 */
     overflow: hidden;
     min-height: 0;
     position: relative;
 }

 /* ============================================
                   ★★★ 表格区 #biaogequ ★★★
                   ============================================ */
 #dgbiao .main-panel#biaogequ {
     flex: 1;
     /* 占据剩余宽度 */
     overflow: auto;
     padding: 12px 16px;
     background: #ffffff;
     min-width: 0;
     /* 防止flex溢出 */
 }

 /* 表格容器（原 scrollable-content） */
 #dgbiao #scrollable-content {
     width: 100%;
     height: 100%;
     overflow: visible;
 }

 /* ---- 表格样式 ---- */
 #dgbiao table {
     table-layout: fixed;
     border-collapse: collapse;
     border: 1px solid #999;
     font-size: 13px;
     width: 3380px;
     /* 保持原有宽度 */
     ;
 }

 #dgbiao th,
 #dgbiao td {
     border: 1px solid #999;
     padding: 0;
     vertical-align: middle;
     word-break: break-all;
     color: #444444;
 }

 #dgbiao .w40 {
     width: 40px;
 }

 #dgbiao .w60 {
     width: 60px;
 }

 #dgbiao .w100 {
     width: 140px;
 }

 #dgbiao .w200 {
     width: 200px;
 }

 #dgbiao .w250 {
     width: 680px;
 }

 #dgbiao .w220 {
     width: 150px;
 }

 #dgbiao .w120 {
     width: 120px;
 }

 #dgbiao .w40 {
     position: sticky;
     left: 0;
     z-index: 2;
     background: #ffffff;
     border-right: 2px solid #999;
 }

 #dgbiao thead .w40 {
     z-index: 3;
 }

 #dgbiao .header-row {
     height: 25px;
 }

 #dgbiao .data-row {
     height: 100px;
 }

 #dgbiao .field-cell {
     position: relative;
     padding: 0;
 }

 #dgbiao .field-cell textarea,
 #dgbiao .field-cell input,
 #dgbiao .field-cell select {
     position: absolute;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     margin: 0;
     padding: 2px 4px;
     box-sizing: border-box;
     border: none;
     background: transparent;
     font-size: inherit;
     font-family: inherit;
     resize: none;
     display: block;
 }

 /* ---- 人物选择列 ---- */
 #dgbiao .dgb-select-container {
     display: flex;
     align-items: center;
     gap: 4px;
     width: 100%;
     height: 100%;
     padding: 2px;
     box-sizing: border-box;
     flex-wrap: nowrap;
     overflow: hidden;
     position: relative;
 }

 #dgbiao .dgb-avatar {
     width: 28px;
     height: 28px;
     border-radius: 50%;
     object-fit: cover;
     background: #f0f0f0;
     flex-shrink: 0;
     position: relative;
     z-index: 1;
 }

 #dgbiao .dgb-select-container select {
     flex: 1;
     min-width: 30px;
     border: none;
     background: #ffffff;
     font-size: inherit;
     height: 100%;
     padding: 2px 4px;
     position: relative;
     z-index: 2;
     cursor: pointer;
     outline: none;
 }

 #dgbiao .dgb-select-container select:hover,
 #dgbiao .dgb-select-container select:focus {
     background: #ffffff;
 }

 /* ---- 标签 ---- */
 #dgbiao .zj-tag-container {
     width: 100%;
     height: 100%;
     padding: 2px;
     overflow-y: auto;
 }

 #dgbiao .tag-item {
     display: inline-block;
     padding: 2px 8px;
     margin: 2px 3px;
     border-radius: 4px;
     cursor: pointer;
     font-size: 13px;
     border: 1px solid #ccc;
     background: #f5f5f5;
     transition: all 0.2s;
     user-select: none;
 }

 #dgbiao .tag-item:hover {
     background: #e0e0e0;
     border-color: #888;
 }

 #dgbiao .tag-jin {
     background: #fff3cd;
     border-color: #ffc107;
 }

 #dgbiao .tag-quan {
     background: #d1ecf1;
     border-color: #17a2b8;
 }

 #dgbiao .tag-wu {
     background: #f8d7da;
     border-color: #dc3545;
 }

 #dgbiao .tag-bao {
     background: #d4edda;
     border-color: #28a745;
 }

 /* ============================================
                   ★★★ 作品设置侧边栏 #zuopinshezhi ★★★
                   ============================================ */
 #dgbiao #zuopinshezhi {
     /* 侧边栏容器：宽度由 .zuopinshezhi-open 控制 */
     width: 0;
     flex-shrink: 0;
     overflow: hidden;
     transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
     background: #f8f9fa;
     border-left: 2px solid #007bff;
     box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08);
     display: flex;
     flex-direction: column;
     height: 100%;
     /* 与父容器等高 */
     position: relative;
     z-index: 5;
 }

 /* 展开状态：宽度 340px */
 #dgbiao #zuopinshezhi.zuopinshezhi-open {
     width: 340px;
 }

 /* ---- 侧边栏内部包装器（用于滑动动画） ---- */
 #dgbiao #zuopinshezhi .zuopinshezhi-inner {
     width: 340px;
     height: 100%;
     display: flex;
     flex-direction: column;
     transform: translateX(100%);
     transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
     background: #f8f9fa;
     overflow: hidden;
 }

 /* 展开时内层滑入 */
 #dgbiao #zuopinshezhi.zuopinshezhi-open .zuopinshezhi-inner {
     transform: translateX(0);
 }

 /* ---- 侧边栏头部 ---- */
 #dgbiao #zuopinshezhi .zuopinshezhi-header {
     display: flex;
     align-items: center;
     justify-content: space-between;
     padding: 14px 18px;
     background: #ffffff;
     border-bottom: 1px solid #dee2e6;
     flex-shrink: 0;
 }

 #dgbiao #zuopinshezhi .zuopinshezhi-header-title {
     display: flex;
     flex-direction: column;
     gap: 2px;
 }

 #dgbiao #zuopinshezhi .zuopinshezhi-header-title span:first-child {
     font-size: 16px;
     font-weight: 600;
     color: #333;
 }

 #dgbiao #zuopinshezhi .zuopinshezhi-header-title span:last-child {
     font-size: 11px;
     color: #888;
 }

 #dgbiao #zuopinshezhi .zuopinshezhi-close-btn {
     width: 30px;
     height: 30px;
     border: 1px solid #ccc;
     border-radius: 4px;
     background: #fff;
     color: #666;
     font-size: 16px;
     cursor: pointer;
     display: flex;
     align-items: center;
     justify-content: center;
     transition: all 0.2s;
     padding: 0;
     flex-shrink: 0;
 }

 #dgbiao #zuopinshezhi .zuopinshezhi-close-btn:hover {
     background: #f0f0f0;
     border-color: #999;
     color: #333;
 }

 /* ---- 侧边栏内容体 ---- */
 #dgbiao #zuopinshezhi .zuopinshezhi-body {
     flex: 1;
     overflow-y: auto;
     padding: 18px 18px 24px;
     display: flex;
     flex-direction: column;
     gap: 14px;
 }

 /* ---- 表单组 ---- */
 #dgbiao #zuopinshezhi .zuopinshezhi-form-group {
     display: flex;
     flex-direction: column;
     gap: 5px;
 }

 #dgbiao #zuopinshezhi .zuopinshezhi-form-group label {
     font-size: 13px;
     font-weight: 500;
     color: #444;
 }

 #dgbiao #zuopinshezhi .zuopinshezhi-form-group input[type="text"],
 #dgbiao #zuopinshezhi .zuopinshezhi-form-group select {
     width: 100%;
     padding: 8px 10px;
     border: 1px solid #ccc;
     border-radius: 4px;
     font-size: 13px;
     background: #fff;
     color: #333;
     transition: border-color 0.2s;
     box-sizing: border-box;
 }

 #dgbiao #zuopinshezhi .zuopinshezhi-form-group input[type="text"]:focus,
 #dgbiao #zuopinshezhi .zuopinshezhi-form-group select:focus {
     outline: none;
     border-color: #007bff;
     box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
 }

 /* ---- textarea 占高度 ---- */
 #dgbiao #zuopinshezhi .zuopinshezhi-textarea-group {
     display: flex;
     flex-direction: column;
     gap: 5px;
     flex: 1;
     min-height: 0;
 }

 #dgbiao #zuopinshezhi #typeList {
     flex: 1;
     width: 100%;
     min-height: 120px;
     padding: 10px;
     border: 1px solid #ccc;
     border-radius: 4px;
     font-size: 13px;
     background: #fff;
     color: #333;
     resize: none;
     font-family: inherit;
     line-height: 1.5;
     transition: border-color 0.2s;
     box-sizing: border-box;
 }

 #dgbiao #zuopinshezhi #typeList:focus {
     outline: none;
     border-color: #007bff;
     box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
 }

 #dgbiao #zuopinshezhi #leixingjieshi {
     font-size: 11px;
     color: #888;
     padding: 2px 0;
 }

 /* ============================================
                   ★★★ 弹窗 / 其他 ★★★
                   ============================================ */
 .popup-overlay {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background: rgba(0, 0, 0, 0.5);
     display: flex;
     align-items: center;
     justify-content: center;
     z-index: 10001;
 }

 .popup-box {
     background: #fff;
     padding: 20px 30px;
     border-radius: 12px;
     max-width: 90vw;
     max-height: 90vh;
     overflow: auto;
     box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
 }

 /* ============================================
                   ★★★ 响应式微调 ★★★
                   ============================================ */
 @media (max-width: 768px) {
     #dgbiao {
         width: 98%;
         height: 96%;
         border-radius: 4px;
     }

     #dgbiao #zuopinshezhi.zuopinshezhi-open {
         width: 280px;
     }

     #dgbiao #zuopinshezhi .zuopinshezhi-inner {
         width: 280px;
     }

     #dgbiao .header-bar#dingbuqu {
         padding: 4px 8px;
         gap: 4px;
         min-height: 44px;
     }

     #dgbiao .header-bar select,
     #dgbiao .header-bar button {
         font-size: 11px;
         padding: 2px 6px;
     }
 }















 /* ===== TOC 悬浮目录样式（仅作用于大纲容器内） ===== */
 #dagangtxt .toc-floating-container {
     position: fixed;
     right: 40px;
     /* 原来 24px → 增大，向左移动，远离滚动条 */
     top: 80px;
     /* 原来 top: 50%; transform: translateY(-50%) → 固定上方位 */
     transform: none;
     /* 取消垂直居中偏移 */
     z-index: 999;
     display: flex;
     flex-direction: column;
     align-items: center;
     gap: 4px;
     background: rgba(255, 255, 255, 0.88);
     backdrop-filter: blur(12px);
     -webkit-backdrop-filter: blur(12px);
     padding: 10px 6px;
     border-radius: 16px;
     box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
     border: 1px solid rgba(255, 255, 255, 0.5);
     max-height: 80vh;
     overflow-y: auto;
     transition: opacity 0.3s, transform 0.3s;
     scrollbar-width: thin;
     scrollbar-color: #d0d0d0 transparent;
 }

 #dagangtxt .toc-floating-container::-webkit-scrollbar {
     width: 3px;
 }

 #dagangtxt .toc-floating-container::-webkit-scrollbar-thumb {
     background: #d0d0d0;
     border-radius: 4px;
 }

 #dagangtxt .toc-floating-container::-webkit-scrollbar-track {
     background: transparent;
 }

 #dagangtxt .toc-item {
     cursor: pointer;
     padding: 5px 6px;
     border-radius: 10px;
     transition: all 0.2s ease;
     display: flex;
     align-items: center;
     justify-content: center;
     width: 38px;
     height: 38px;
     position: relative;
     color: #6b7280;
     background: transparent;
     border: none;
     flex-shrink: 0;
 }

 #dagangtxt .toc-item i {
     font-size: 18px;
     transition: transform 0.2s ease;
 }

 #dagangtxt .toc-item:hover {
     background: rgba(99, 102, 241, 0.12);
     color: #4f46e5;
     transform: scale(1.05);
 }

 #dagangtxt .toc-item:hover i {
     transform: scale(1.1);
 }

 #dagangtxt .toc-item.active {
     background: rgba(99, 102, 241, 0.18);
     color: #4f46e5;
     box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
 }

 #dagangtxt .toc-item.active i {
     transform: scale(1.05);
 }

 /* 子项缩进 + 小圆点装饰 */
 #dagangtxt .toc-item.is-child {
     width: 32px;
     height: 32px;
     margin-left: 6px;
     padding: 3px 4px;
 }

 #dagangtxt .toc-item.is-child i {
     font-size: 14px;
 }

 #dagangtxt .toc-item.is-child::before {
     content: '';
     position: absolute;
     left: -4px;
     top: 50%;
     transform: translateY(-50%);
     width: 3px;
     height: 3px;
     border-radius: 50%;
     background: #d1d5db;
     opacity: 0.6;
 }

 #dagangtxt .toc-item.is-child:hover::before,
 #dagangtxt .toc-item.is-child.active::before {
     background: #4f46e5;
     opacity: 1;
 }

 /* 分隔线 */
 #dagangtxt .toc-divider {
     width: 24px;
     height: 1px;
     background: linear-gradient(to right, transparent, #e5e7eb, transparent);
     margin: 2px 0;
     flex-shrink: 0;
 }

 /* Tooltip 自定义（更美观） */
 #dagangtxt .toc-item .toc-tooltip {
     position: absolute;
     right: calc(100% + 14px);
     top: 50%;
     transform: translateY(-50%) scale(0.92);
     background: rgba(31, 41, 55, 0.92);
     backdrop-filter: blur(6px);
     color: #f9fafb;
     padding: 4px 12px;
     border-radius: 8px;
     font-size: 13px;
     font-weight: 500;
     white-space: nowrap;
     pointer-events: none;
     opacity: 0;
     transition: opacity 0.2s ease, transform 0.2s ease;
     box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
     letter-spacing: 0.3px;
     font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
 }

 #dagangtxt .toc-item .toc-tooltip::after {
     content: '';
     position: absolute;
     right: -6px;
     top: 50%;
     transform: translateY(-50%);
     border-left: 6px solid rgba(31, 41, 55, 0.92);
     border-top: 6px solid transparent;
     border-bottom: 6px solid transparent;
 }

 #dagangtxt .toc-item:hover .toc-tooltip {
     opacity: 1;
     transform: translateY(-50%) scale(1);
 }

 /* 折叠/展开按钮（针对有子项的父级） */
 #dagangtxt .toc-item.has-children {
     cursor: pointer;
 }

 #dagangtxt .toc-item.has-children .toc-toggle {
     position: absolute;
     bottom: -2px;
     right: -2px;
     font-size: 8px;
     color: #9ca3af;
     background: rgba(255, 255, 255, 0.8);
     border-radius: 50%;
     width: 14px;
     height: 14px;
     display: flex;
     align-items: center;
     justify-content: center;
     transition: transform 0.2s ease;
     border: 1px solid #e5e7eb;
 }

 #dagangtxt .toc-item.has-children .toc-toggle.expanded {
     transform: rotate(180deg);
 }

 /* 子项容器（折叠/展开） */
 #dagangtxt .toc-children {
     display: flex;
     flex-direction: column;
     align-items: center;
     gap: 2px;
     overflow: hidden;
     max-height: 0;
     opacity: 0;
     transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.3s ease;
     margin-top: 0;
 }

 #dagangtxt .toc-children.open {
     max-height: 400px;
     opacity: 1;
     margin-top: 2px;
 }

 /* 模式指示器小圆点 */
 #dagangtxt .toc-mode-indicator {
     width: 6px;
     height: 6px;
     border-radius: 50%;
     background: #10b981;
     margin: 4px 0 2px 0;
     flex-shrink: 0;
     transition: background 0.3s;
     box-shadow: 0 0 6px rgba(16, 185, 129, 0.3);
 }

 #dagangtxt .toc-mode-indicator.is-edit {
     background: #f59e0b;
     box-shadow: 0 0 6px rgba(245, 158, 11, 0.3);
 }

 /* 响应式：小屏幕收起为更紧凑 */
 @media (max-width: 768px) {
     #dagangtxt .toc-floating-container {
         right: 20px;
         /* 原来 12px → 增大大一些 */
         top: 70px;
         /* 小屏也固定上方位 */
         transform: none;
         padding: 8px 4px;
         gap: 2px;
         border-radius: 12px;
     }

     #dagangtxt .toc-item {
         width: 32px;
         height: 32px;
         padding: 4px;
     }

     #dagangtxt .toc-item i {
         font-size: 15px;
     }

     #dagangtxt .toc-item.is-child {
         width: 28px;
         height: 28px;
         margin-left: 4px;
     }

     #dagangtxt .toc-item.is-child i {
         font-size: 12px;
     }

     #dagangtxt .toc-item .toc-tooltip {
         font-size: 11px;
         padding: 3px 10px;
         right: calc(100% + 10px);
     }
 }

 /* 暗色适配（跟随系统） */
 @media (prefers-color-scheme: dark) {
     #dagangtxt .toc-floating-container {
         background: rgba(31, 41, 55, 0.88);
         backdrop-filter: blur(12px);
         border-color: rgba(255, 255, 255, 0.08);
         box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
     }

     #dagangtxt .toc-item {
         color: #9ca3af;
     }

     #dagangtxt .toc-item:hover {
         background: rgba(99, 102, 241, 0.2);
         color: #818cf8;
     }

     #dagangtxt .toc-item.active {
         background: rgba(99, 102, 241, 0.25);
         color: #818cf8;
     }

     #dagangtxt .toc-item .toc-tooltip {
         background: rgba(17, 24, 39, 0.95);
         color: #f3f4f6;
     }

     #dagangtxt .toc-item .toc-tooltip::after {
         border-left-color: rgba(17, 24, 39, 0.95);
     }

     #dagangtxt .toc-divider {
         background: linear-gradient(to right, transparent, #374151, transparent);
     }

     #dagangtxt .toc-item.is-child::before {
         background: #4b5563;
     }

     #dagangtxt .toc-item.is-child:hover::before,
     #dagangtxt .toc-item.is-child.active::before {
         background: #818cf8;
     }

     #dagangtxt .toc-mode-indicator {
         background: #34d399;
     }

     #dagangtxt .toc-mode-indicator.is-edit {
         background: #fbbf24;
     }
 }

 .fenjuan-img {
     width: 100px;
     /* 或您期望的尺寸 */
     height: 100px;
     border-radius: 50%;
     /* 圆形 */
     object-fit: cover;
     /* 图片裁切填充，保持比例 */
     cursor: pointer;
 }

 /* 新增全屏模式样式 */
 #dgbiao.fullscreen-mode {
     transform: none !important;
     top: 0 !important;
     left: 0 !important;
     width: 100% !important;
     height: 100% !important;
     border: none !important;
     border-radius: 0 !important;
 }

 /* 调整内部滚动容器高度 */
 #dgbiao.fullscreen-mode .main-panel {
     max-height: calc(100vh - 80px) !important;
     /* 80px 约为头部栏高度 + 内边距，根据实际情况调整 */
 }


 /* 控制按钮样式 */
 #dagangtxt .toc-controls {
     display: flex;
     gap: 6px;
     margin-bottom: 6px;
     justify-content: center;
     width: 100%;
 }

 #dagangtxt .toc-control-btn {
     cursor: pointer;
     font-size: 14px;
     color: #9ca3af;
     padding: 2px 6px;
     border-radius: 6px;
     transition: all 0.2s;
     user-select: none;
     line-height: 1.4;
     font-weight: 600;
     background: rgba(0, 0, 0, 0.03);
 }

 #dagangtxt .toc-control-btn:hover {
     background: rgba(99, 102, 241, 0.15);
     color: #4f46e5;
 }

 #dagangtxt .toc-control-btn.toc-expand-all.active {
     color: #4f46e5;
     background: rgba(99, 102, 241, 0.1);
 }

 /* 最小化状态 */
 #dagangtxt .toc-floating-container.toc-minimized {
     width: 48px;
     height: 48px;
     padding: 6px;
     border-radius: 50%;
     overflow: hidden;
     justify-content: center;
     align-items: center;
     background: rgba(255, 255, 255, 0.95);
     box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
 }

 #dagangtxt .toc-floating-container.toc-minimized .toc-controls {
     margin: 0;
     width: 100%;
     height: 100%;
     display: flex;
     justify-content: center;
     align-items: center;
 }

 #dagangtxt .toc-floating-container.toc-minimized .toc-control-btn {
     font-size: 24px;
     color: #4f46e5;
     background: transparent;
     padding: 0;
 }

 #dagangtxt .toc-floating-container.toc-minimized .toc-control-btn:hover {
     background: transparent;
     transform: scale(1.1);
 }


 @media (max-width: 768px) {
     #dagangtxt .toc-floating-container.toc-minimized {
         width: 40px;
         height: 40px;
         right: 16px;
         top: 70px;
     }
 }










 td.w220.drag-over {
     background-color: #d4edda !important;
     border: 2px dashed #28a745;
     box-shadow: inset 0 0 10px rgba(40, 167, 69, 0.3);


 }

 .setting-tag {
     display: inline-block;
     padding: 4px 8px;
     border-radius: 4px;
     font-size: 13px;
     cursor: pointer;
     min-width: 30px;
     min-height: 24px;
     background: transparent;
     /* 默认无背景 */
     transition: background 0.2s;
 }

 /* 有内容时背景色由 tag-* 类提供 */
 .setting-tag.tag-jin {
     background: #fff3cd;
 }

 .setting-tag.tag-quan {
     background: #d1ecf1;
 }

 .setting-tag.tag-wu {
     background: #d4edda;
 }

 .setting-tag.tag-bao {
     background: #f8d7da;
 }



 #backViewTable thead {
     position: sticky;
     top: 0;
     z-index: 5;
 }









 /* 左侧边栏 */

 /* ============================================
   ★★★ 左侧边栏 - 全新样式 ★★★
   ============================================ */

/* ---- 左侧边栏容器 ---- */
#dgbiao .left-sidebar {
    width: 0;
    flex-shrink: 0;
    overflow: hidden;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8fafc;
    border-right: 2px solid #eef2f7;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    z-index: 4;
}

/* 展开状态：宽度 280px */
#dgbiao .left-sidebar.open {
    width: 280px;
}

/* ---- 左侧边栏内部包装器 ---- */
#dgbiao .left-sidebar .left-sidebar-inner {
    width: 280px;
    height: 100%;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8fafc;
    overflow: hidden;
}

/* 展开时内层滑入 */
#dgbiao .left-sidebar.open .left-sidebar-inner {
    transform: translateX(0);
}

/* ---- 左侧边栏头部 ---- */
#dgbiao .left-sidebar .left-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #ffffff;
    border-bottom: 1px solid #eef2f7;
    flex-shrink: 0;
    min-height: 52px;
}

#dgbiao .left-sidebar .left-sidebar-header .sidebar-icon {
    font-size: 18px;
    margin-right: 6px;
}

#dgbiao .left-sidebar .left-sidebar-header .sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    flex: 1;
}

#dgbiao .left-sidebar .sidebar-collapse-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #ffffff;
    color: #64748b;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

#dgbiao .left-sidebar .sidebar-collapse-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

/* ---- 左侧边栏内容 ---- */
#dgbiao .left-sidebar .left-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---- 模块 ---- */
#dgbiao .left-sidebar .sidebar-module {
    background: #ffffff;
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid #eef2f7;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

#dgbiao .left-sidebar .module-title {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
}

/* ---- 章节导航 ---- */
#dgbiao .left-sidebar .chapter-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 200px;
    overflow-y: auto;
}

#dgbiao .left-sidebar .chapter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #475569;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

#dgbiao .left-sidebar .chapter-item:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #0f172a;
}

#dgbiao .left-sidebar .chapter-item .chapter-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

#dgbiao .left-sidebar .chapter-item .chapter-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#dgbiao .left-sidebar .chapter-item .chapter-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

#dgbiao .left-sidebar .chapter-item .chapter-status.done {
    background: #22c55e;
}

#dgbiao .left-sidebar .chapter-item .chapter-status.partial {
    background: #eab308;
}

#dgbiao .left-sidebar .chapter-item .chapter-status.empty {
    background: #e2e8f0;
}

/* ---- 工具网格 ---- */
#dgbiao .left-sidebar .tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

#dgbiao .left-sidebar .tool-btn {
    padding: 6px 8px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

#dgbiao .left-sidebar .tool-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
    transform: translateY(-1px);
}

#dgbiao .left-sidebar .tool-btn:active {
    transform: translateY(0);
}

/* ---- 统计信息 ---- */
#dgbiao .left-sidebar .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

#dgbiao .left-sidebar .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

#dgbiao .left-sidebar .stat-label {
    font-size: 11px;
    color: #94a3b8;
}

#dgbiao .left-sidebar .stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 2px;
}

/* ---- 快捷操作 ---- */
#dgbiao .left-sidebar .quick-action-btn {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 6px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

#dgbiao .left-sidebar .quick-action-btn:last-child {
    margin-bottom: 0;
}

#dgbiao .left-sidebar .quick-action-btn:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4f46e5;
}

/* ---- 左侧边栏滚动条 ---- */
#dgbiao .left-sidebar .left-sidebar-body::-webkit-scrollbar {
    width: 4px;
}

#dgbiao .left-sidebar .left-sidebar-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#dgbiao .left-sidebar .left-sidebar-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

#dgbiao .left-sidebar .left-sidebar-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ---- 左侧边栏折叠按钮（浮动） ---- */
#dgbiao .left-sidebar-toggle {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    width: 24px;
    height: 60px;
    border: 1px solid #e2e8f0;
    border-left: none;
    border-radius: 0 8px 8px 0;
    background: #ffffff;
    color: #94a3b8;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
}

#dgbiao .left-sidebar-toggle:hover {
    background: #f1f5f9;
    color: #0f172a;
    width: 28px;
}

/* 左侧边栏展开时，toggle 按钮移到边栏右侧 */
#dgbiao .left-sidebar.open ~ .left-sidebar-toggle {
    left: 280px;
}


/* ============================================
   ★★★ 左侧边栏 - 下拉框样式 ★★★
   ============================================ */

/* ---- 侧边栏模块内的下拉框容器 ---- */
#dgbiao .left-sidebar .sidebar-module select {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin-top: 4px;
    margin-bottom: 8px;
    font-size: 13px;
    font-family: inherit;
    color: #1e293b;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    transition: all 0.25s ease;
    appearance: auto;
    box-sizing: border-box;
}

/* 最后一个下拉框不需要底部边距 */
#dgbiao .left-sidebar .sidebar-module select:last-of-type {
    margin-bottom: 0;
}

/* 悬浮效果 */
#dgbiao .left-sidebar .sidebar-module select:hover {
    border-color: #94a3b8;
    background: #fafbfc;
}

/* 聚焦效果 */
#dgbiao .left-sidebar .sidebar-module select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
    background: #ffffff;
}

/* 下拉框选项样式（部分浏览器支持） */
#dgbiao .left-sidebar .sidebar-module select option {
    padding: 6px 10px;
    font-size: 13px;
}

/* 为不同下拉框添加微小的视觉区分（可选） */
#dgbiao .left-sidebar .sidebar-module select#xzfg {
    border-left: 3px solid #4f46e5;
}

#dgbiao .left-sidebar .sidebar-module select#fuwushang {
    border-left: 3px solid #22c55e;
}

#dgbiao .left-sidebar .sidebar-module select#AImoxing {
    border-left: 3px solid #eab308;
}

#dgbiao .left-sidebar .sidebar-module select#temperature-select {
    border-left: 3px solid #f97316;
}

#dgbiao .left-sidebar .sidebar-module select#max_tokens_num {
    border-left: 3px solid #8b5cf6;
}

/* ---- 下拉框前添加小标签（如果需要） ---- */
#dgbiao .left-sidebar .sidebar-module .select-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 2px;
    margin-top: 6px;
}

#dgbiao .left-sidebar .sidebar-module .select-label:first-of-type {
    margin-top: 0;
}

/* ---- 紧凑模式（两个下拉框并排） ---- */
#dgbiao .left-sidebar .sidebar-module .select-row {
    display: flex;
    gap: 8px;
}

#dgbiao .left-sidebar .sidebar-module .select-row select {
    flex: 1;
    width: auto;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    #dgbiao .left-sidebar .sidebar-module select {
        font-size: 12px;
        padding: 6px 10px;
    }
}











/* ===== 查询浮窗样式 ===== */
.query-window-header {
    user-select: none;
}

.query-window-header button {
    transition: color 0.2s;
}

.query-window-box input[type="text"]:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
    outline: none;
}

.query-window-box .btn-dark {
    transition: all 0.25s ease;
    font-weight: 500;
}

.query-window-box .btn-dark:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#txst-chengyu, #txst-shiju {
    font-family: inherit;
    line-height: 1.8;
    scroll-behavior: smooth;
}

#chengyu-prev-page, #chengyu-next-page,
#prev-page, #next-page {
    transition: all 0.2s;
}

#chengyu-prev-page:hover:not(:disabled),
#chengyu-next-page:hover:not(:disabled),
#prev-page:hover:not(:disabled),
#next-page:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #94a3b8;
}

#chengyu-prev-page:disabled,
#chengyu-next-page:disabled,
#prev-page:disabled,
#next-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#chengyu-page-info, #page-info {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.query-window-box ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.query-window-box ::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 8px;
}
.query-window-box ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
}
.query-window-box ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


/* ===== 查询结果条目样式 ===== */
#txst-chengyu p, #txst-shiju p {
    margin: 2px 0;
    padding: 1px 0;
}

#txst-chengyu hr, #txst-shiju hr {
    margin: 10px 0;
    border: none;
    border-top: 1px solid #f1f5f9;
}

#txst-chengyu strong, #txst-shiju strong {
    color: #475569;
    font-weight: 600;
}

#txst-chengyu mark, #txst-shiju mark {
    background: #fef3c7;
    padding: 0 2px;
    border-radius: 2px;
    color: #b45309;
}

/* 空状态提示 */
.query-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #94a3b8;
    font-size: 14px;
}


/* 数据管理按钮特殊样式（可选） */
#dgbiao .left-sidebar .sidebar-module .tool-btn[onclick*="Backup"] {
    border-color: #4f46e5;
}
#dgbiao .left-sidebar .sidebar-module .tool-btn[onclick*="exportLocal"] {
    border-color: #22c55e;
}
#dgbiao .left-sidebar .sidebar-module .tool-btn[onclick*="importLocal"] {
    border-color: #eab308;
}