* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #1f4e9c; --primary-dark: #163873; --primary-light: #eaf1fb;
  --bg: #f4f6fa; --card: #ffffff; --border: #e2e7f0; --text: #1f2937;
  --muted: #6b7280; --danger: #c0392b; --success: #1e7d5a; --accent: #b8860b;
}
body { font-family: "Microsoft YaHei", "PingFang SC", -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }
button, input, select { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
input, select { border: 1px solid var(--border); border-radius: 6px; padding: 9px 12px; outline: none; background: #fff; width: 100%; }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,78,156,.08); }

/* 登录 */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1f4e9c 0%, #2c6bbb 55%, #163873 100%); }
.auth-card { width: 400px; background: #fff; border-radius: 14px; padding: 38px 40px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.auth-brand { text-align: center; margin-bottom: 26px; }
.brand-mark { width: 56px; height: 56px; background: var(--primary); color: #fff; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; margin: 0 auto 14px; letter-spacing: 1px; }
.brand-mark.sm { width: 32px; height: 32px; font-size: 11px; border-radius: 7px; margin: 0; flex-shrink: 0; }
.auth-brand h1 { font-size: 22px; color: var(--primary-dark); margin-bottom: 6px; }
.auth-brand p { color: var(--muted); font-size: 13px; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.auth-tab { flex: 1; background: none; border: none; padding: 10px; color: var(--muted); border-bottom: 2px solid transparent; }
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.auth-card label { display: block; margin: 14px 0 6px; font-size: 13px; font-weight: 600; }
.auth-hint { font-size: 12px; color: var(--muted); margin-top: 12px; text-align: center; }
.auth-error { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 20px; text-align: center; }
.btn-primary { background: var(--primary); color: #fff; border: none; border-radius: 6px; padding: 9px 18px; font-weight: 600; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary.full { width: 100%; margin-top: 20px; padding: 12px; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); border-radius: 6px; padding: 8px 14px; font-weight: 600; }
.btn-outline:hover { background: var(--primary-light); }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; font-weight: 700; color: var(--primary-dark); border-bottom: 1px solid var(--border); font-size: 15px; }
.nav { padding: 14px 10px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; border: none; background: none; padding: 11px 14px; border-radius: 8px; color: #4b5563; margin-bottom: 4px; text-align: left; }
.nav-item:hover { background: #f5f7fb; }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.ico { font-size: 17px; width: 20px; text-align: center; }
.side-bottom { padding: 10px; border-top: 1px solid var(--border); }
.user-box { display: flex; align-items: center; gap: 10px; padding: 12px 8px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.user-info { flex: 1; font-size: 13px; min-width: 0; }
.user-info small { color: var(--muted); font-size: 11px; }
.logout { border: none; background: none; color: var(--muted); font-size: 18px; padding: 4px; }
.logout:hover { color: var(--danger); }
.main { flex: 1; min-width: 0; }
.page { display: none; padding: 28px 32px; }
.page.active { display: block; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head.compact { align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 0; }
.page-head h2 { font-size: 22px; color: var(--primary-dark); font-weight: 700; }
.sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.save-tip { color: var(--muted); font-size: 12px; }

/* 工作台 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 20px; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-num { font-size: 30px; font-weight: 700; color: var(--primary); margin-top: 6px; }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.quick-card { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 18px; text-align: left; }
.quick-card:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(31,78,156,.08); }
.quick-ico { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; color: #fff; }
.q1 { background: #1f4e9c; } .q2 { background: #2e8b6b; } .q3 { background: #b8860b; }
.quick-card b { display: block; margin-bottom: 2px; }
.quick-card p { color: var(--muted); font-size: 12px; }
.arrow { margin-left: auto; color: var(--primary); font-size: 18px; }
.recent-box, .box-title { background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.recent-box { padding: 18px 20px; }
.box-title { padding: 12px 16px; font-weight: 600; border-bottom: 1px solid var(--border); background: #fff; }
.link { background: none; border: none; color: var(--primary); font-size: 13px; }
.box-title .link { float: right; font-weight: 400; }
.recent-list { padding: 8px 0; }
.recent-row { display: flex; align-items: center; padding: 10px 4px; border-bottom: 1px solid #f0f2f6; font-size: 13px; }
.recent-row:last-child { border: none; }
.recent-row .t { flex: 1; }
.tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 4px; background: var(--primary-light); color: var(--primary); margin-left: 8px; }
.empty { color: var(--muted); text-align: center; padding: 30px; font-size: 13px; }

/* 知识库 / 文档 */
.search-bar { display: flex; gap: 10px; margin-bottom: 16px; }
.search-bar input { flex: 1; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; }
.filter-bar select { width: 180px; } .filter-bar input { flex: 1; }
.search-results { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 16px 20px; margin-bottom: 16px; }
.result-item { padding: 10px 0; border-bottom: 1px solid #f0f2f6; font-size: 13px; }
.result-item:last-child { border: none; }
.result-src { color: var(--primary); font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.doc-list { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-top: 16px; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid #f0f2f6; font-size: 13px; }
.doc-row:last-child { border: none; }
.doc-row .t { flex: 1; font-weight: 500; }
.doc-row .meta { color: var(--muted); font-size: 12px; width: 120px; }
.data-table { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.dt-head, .dt-row { display: flex; padding: 11px 18px; border-bottom: 1px solid #f0f2f6; font-size: 13px; align-items: center; }
.dt-head { background: #f8fafc; color: var(--muted); font-weight: 600; }
.dt-row:last-child { border: none; }
.dt-row:hover { background: #fafbfe; }
.c1 { flex: 2; } .c2 { width: 90px; } .c3 { width: 100px; } .c4 { width: 100px; } .c5 { width: 160px; } .c6 { width: 190px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 4px; }
.open-btn, .index-btn { border: none; background: none; color: var(--primary); font-size: 12px; padding: 2px 4px; }
.open-btn:hover, .index-btn:hover { text-decoration: underline; }
.index-btn.update { color: var(--success); }
.preview-public { background: #fff; padding: 32px 56px; font-family: "FangSong_GB2312", "仿宋", "FangSong", "SimSun", serif;
                  font-size: 16pt; line-height: 28pt; color: #000; min-height: 420px; }
.preview-public p { margin: 0; text-indent: 2em; }
.preview-public p.gw-blank { text-indent: 0; height: 14pt; line-height: 14pt; }
.preview-public p.gw-recv { text-indent: 0; }
.preview-public p.gw-h1 { font-family: "SimHei", "黑体", sans-serif; font-weight: 700; text-indent: 2em; }
.preview-public p.gw-h2 { font-family: "KaiTi_GB2312", "楷体", "KaiTi", serif; text-indent: 2em; }
.preview-public p.gw-h3 { text-indent: 2em; }
.badge.indexed { background: #e3f5ed; color: var(--success); }
.badge.draft { background: #fef3e2; color: #a86a00; }
.badge.published { background: var(--primary-light); color: var(--primary); }
.del-btn { border: none; background: none; color: var(--muted); }
.del-btn:hover { color: var(--danger); }

/* 写作 */
.writing-page, .table-page { padding: 0; display: none; height: 100vh; flex-direction: column; }
.writing-page.active, .table-page.active { display: flex; }
.writing-page > .page-head, .table-page > .page-head { padding: 12px 24px; background: #fff; flex-shrink: 0; }
.writing-layout { flex: 1; display: flex; min-height: 0; }
.editor-area { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #fff; }
.editor-toolbar { display: flex; align-items: center; gap: 12px; padding: 10px 28px; border-bottom: 1px solid var(--border); }
.editor-toolbar select { width: 90px; padding: 6px 8px; }
.title-input { border: none !important; box-shadow: none !important; font-size: 16px; font-weight: 600; text-align: center; flex: 1; }
.format-tag { color: var(--accent); font-size: 11px; white-space: nowrap; }
/* A4 纸张视图：所见即所得，格式与 Word 导出一致 */
.editor-scroll { flex: 1; overflow-y: auto; background: #e9edf2; padding: 28px 20px 40px; min-height: 0; }
.paper { width: 794px; max-width: 100%; min-height: 1123px; margin: 0 auto; background: #fff;
         box-shadow: 0 2px 12px rgba(0,0,0,.12); padding: 140px 99px 132px 106px; box-sizing: border-box; }
.paper-title { font-family: "方正小标宋简体", "FZXiaoBiaoSong-B05S", "SimSun", serif; font-size: 22pt;
               font-weight: 700; text-align: center; line-height: 1.5; margin-bottom: 30pt; outline: none;
               min-height: 33pt; cursor: text; }
.paper-title:empty::before, .editor:empty::before { content: attr(data-placeholder); color: #b9c0cb; }
.editor { font-family: "FangSong_GB2312", "仿宋", "FangSong", "SimSun", serif; font-size: 16pt;
          line-height: 28pt; outline: none; min-height: 400px; color: #000; cursor: text; }
.editor p { margin: 0; text-indent: 2em; line-height: 28pt; }
.editor p.gw-blank { text-indent: 0; height: 14pt; line-height: 14pt; }
.editor p.gw-recv { text-indent: 0; }
.editor p.gw-h1 { font-family: "SimHei", "黑体", sans-serif; font-weight: 700; text-indent: 2em; }
.editor p.gw-h2 { font-family: "KaiTi_GB2312", "楷体", "KaiTi", serif; text-indent: 2em; }
.editor p.gw-h3 { text-indent: 2em; }
.ref-panel { padding: 10px 28px; background: #f8fafc; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); max-height: 120px; overflow-y: auto; }

/* 常驻格式工具栏 */
/* 折叠态：默认只露出标题条，需要时点开，避免工具栏遮挡纸张 */
.fmt-panel { background: #fafbfc; border-bottom: 1px solid #e6ebf0; }
.fmt-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 5px 20px;
                  background: #f2f5f9; border-bottom: 1px solid transparent; cursor: pointer; user-select: none; }
.fmt-panel-head.open { border-bottom-color: #e6ebf0; }
.fmt-panel-title { font-size: 12px; color: #40546e; font-weight: 600; }
.fmt-panel-title small { font-weight: 400; color: #8a97a8; margin-left: 8px; }
.fmt-panel-toggle { border: none; background: none; color: #1a56a0; font-size: 12px; padding: 0; }
.fmt-panel-body { display: none; }
.fmt-panel-body.open { display: block; }
.fmt-bar { display: flex; align-items: center; gap: 8px; padding: 6px 20px; background: #fafbfc;
           border-bottom: 1px solid #e6ebf0; flex-wrap: wrap; }
.fmt-group { display: flex; align-items: center; gap: 3px; }
.fmt-bar select { height: 28px; border: 1px solid #d5dce4; border-radius: 5px; font-size: 12px; padding: 0 4px; background: #fff; }
.fmt-bar select.fmt-font { width: 128px; }
.fmt-bar select.fmt-size { width: 68px; }
.fmt-btn { height: 28px; min-width: 28px; padding: 0 8px; border: 1px solid transparent; background: #fff;
           border-radius: 5px; cursor: pointer; font-size: 13px; color: #263244; }
.fmt-btn:hover { background: #e8f0fb; border-color: #b9d0ee; }
.fmt-btn.active { background: #1a56a0; color: #fff; }
.fmt-btn.fmt-color-btn span { font-weight: 700; }
.fmt-btn.fmt-brush { font-size: 12px; color: #1a56a0; border-color: #b9d0ee; }
.fmt-btn.fmt-brush.on { background: #1a56a0; color: #fff; }
.fmt-vsep { width: 1px; height: 18px; background: #dfe5eb; }
/* 公文层级一键套用条 */
.fmt-style-bar { display: flex; align-items: center; gap: 6px; padding: 5px 20px; background: #eef3fa;
                 border-bottom: 1px solid #d6e0ee; flex-wrap: wrap; }
.fmt-style-label { font-size: 12px; color: #33547f; font-weight: 600; }
.fmt-style-bar button { height: 25px; padding: 0 10px; border: 1px solid #b9cfe8; background: #fff; color: #1a4e8a;
                        border-radius: 12px; font-size: 12px; cursor: pointer; }
.fmt-style-bar button:hover { background: #1a56a0; color: #fff; border-color: #1a56a0; }
.fmt-style-hint { font-size: 11px; color: #8a97a8; margin-left: 6px; }

/* 选中文字右键格式菜单 */
.fmt-menu { position: fixed; z-index: 900; background: #fff; border: 1px solid #d5dce4; border-radius: 8px;
            box-shadow: 0 6px 24px rgba(0,0,0,.16); padding: 6px; min-width: 300px; user-select: none; }
.fmt-menu-title { font-size: 11px; color: #8a94a3; padding: 2px 6px 6px; border-bottom: 1px solid #eef1f4; margin-bottom: 4px; }
.fmt-menu-title span { float: right; color: #1a56a0; }
.fmt-row { display: flex; align-items: center; gap: 4px; padding: 4px 2px; }
.fmt-row button { min-width: 30px; height: 28px; padding: 0 7px; border: 1px solid transparent; background: #f6f8fa;
                  border-radius: 5px; cursor: pointer; font-size: 13px; color: #263244; }
.fmt-row button:hover { background: #e8f0fb; border-color: #b9d0ee; color: #1a56a0; }
.fmt-row button.active { background: #1a56a0; color: #fff; }
.fmt-sep { width: 1px; height: 18px; background: #e2e7ed; margin: 0 3px; }
.fmt-label { font-size: 12px; color: #5b6675; margin: 0 2px; white-space: nowrap; }
.fmt-row select { height: 28px; padding: 0 4px; border: 1px solid #d5dce4; border-radius: 5px; font-size: 12px; }
.fmt-colors { display: flex; gap: 4px; }
.fmt-color { width: 22px !important; min-width: 22px !important; height: 22px !important; padding: 0 !important;
             border-radius: 50% !important; border: 2px solid #fff !important; box-shadow: 0 0 0 1px #c9d1da; }
.ref-panel b { color: var(--primary); }
.ai-resizer { width: 6px; flex-shrink: 0; cursor: col-resize; background: #e9edf2;
              border-left: 1px solid #e2e7f0; border-right: 1px solid #e2e7f0; position: relative; }
.ai-resizer::after { content: ''; position: absolute; left: 50%; top: 50%; width: 2px; height: 38px;
                     background: #b8c2d0; border-radius: 2px; transform: translate(-50%, -50%); }
.ai-resizer:hover, .ai-resizer.dragging { background: #d6e4f7; }
.ai-resizer:hover::after, .ai-resizer.dragging::after { background: var(--primary); }
body.resizing-ai { user-select: none; cursor: col-resize; }
.ai-panel { width: var(--ai-panel-width, 340px); background: #fff; border-left: 1px solid var(--border);
            display: flex; flex-direction: column; flex-shrink: 0; min-width: 280px; }
.ai-head { padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ai-head small { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 11px; }
.ai-dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; }
.ai-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ai-msg { padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.ai-msg.bot { background: #f3f6fb; }
.ai-msg.user { background: var(--primary); color: #fff; align-self: flex-end; }
.ai-msg.loading { color: var(--muted); }
.ai-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px 10px; }
.ai-quick button { border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 7px; font-size: 12px; color: var(--primary); }
.ai-quick button:hover { border-color: var(--primary); background: var(--primary-light); }
.ai-input-row { display: flex; gap: 8px; padding: 0 16px 8px; }
.ai-input-row button { border: none; background: var(--primary); color: #fff; border-radius: 6px; padding: 0 16px; font-weight: 600; white-space: nowrap; }
.ai-input-row.small { display: block; padding-bottom: 14px; }
.ai-input-row textarea { width: 100%; min-height: 72px; max-height: 160px; padding: 9px 10px; border: 1px solid var(--border);
                         border-radius: 6px; outline: none; background: #fff; resize: vertical; font-family: inherit;
                         font-size: 13px; line-height: 1.6; }
.ai-input-row textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,78,156,.08); }

/* 表格助手 */
.table-layout { flex: 1; display: flex; min-height: 0; }
.chat-col { width: 380px; background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.chat-msg { padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.7; max-width: 90%; white-space: pre-wrap; }
.chat-msg.bot { background: #f3f6fb; align-self: flex-start; }
.chat-msg.user { background: var(--primary); color: #fff; align-self: flex-end; }
.chat-input-row { display: flex; gap: 8px; padding: 14px; border-top: 1px solid var(--border); }
.sheet-col { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #fff; }
.sheet-toolbar { padding: 12px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px; }
.sheet-toolbar span:first-child { font-weight: 600; font-size: 15px; }
.sheet-hint { color: var(--muted); font-size: 12px; }
.sheet { flex: 1; overflow: auto; padding: 20px; }
.sheet table { border-collapse: collapse; min-width: 100%; font-size: 13px; }
.sheet th, .sheet td { border: 1px solid #d7dde8; padding: 8px 12px; min-width: 100px; text-align: left; outline: none; }
.sheet th { background: #eef3fb; font-weight: 600; color: var(--primary-dark); }
.sheet td:focus { background: #fffbea; box-shadow: inset 0 0 0 2px var(--primary); }
.sheet .row-num { background: #f8fafc; color: var(--muted); min-width: 36px; text-align: center; user-select: none; }

/* 设置 */
.settings-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.settings-tab { border: none; background: none; padding: 10px 20px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; }
.settings-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.settings-note { background: #eef4fc; border-left: 3px solid var(--primary); padding: 11px 14px; border-radius: 6px; color: #40546e; font-size: 13px; margin-bottom: 18px; line-height: 1.7; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 900px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 13px; font-weight: 600; color: #374151; }
.form-group textarea { border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; resize: vertical; outline: none; font-family: inherit; font-size: 14px; line-height: 1.6; width: 100%; }
.form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,78,156,.08); }
.settings-actions { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.provider-list { display: flex; flex-direction: column; gap: 12px; max-width: 900px; }
.provider-card { background: #fff; border: 1px solid var(--border); border-left: 4px solid #cbd5e1; border-radius: 10px; padding: 16px 18px; display: flex; align-items: center; gap: 16px; }
.provider-card.active { border-left-color: var(--success); background: #fbfefd; }
.provider-main { flex: 1; min-width: 0; }
.provider-name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.provider-meta { color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.7; }
.provider-meta code { background: #f3f4f6; padding: 1px 5px; border-radius: 4px; font-size: 11px; }
.active-badge { font-size: 11px; background: #e3f5ed; color: var(--success); padding: 2px 9px; border-radius: 4px; font-weight: 600; }
.provider-ops { display: flex; gap: 6px; flex-shrink: 0; }
.provider-ops button { border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 6px 11px; font-size: 12px; color: var(--primary); }
.provider-ops button:hover { border-color: var(--primary); }
.provider-ops button.danger { color: var(--danger); }
.provider-ops button.on { background: var(--success); color: #fff; border-color: var(--success); }
.req { color: var(--danger); }
.field-hint { color: var(--muted); font-size: 11px; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-card { width: 520px; max-width: 92vw; background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.3); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; color: var(--primary-dark); }
.modal-x { border: none; background: none; font-size: 16px; color: var(--muted); }
.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 15px; max-height: 65vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: #fafbfc; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
/* 文档预览弹窗 */
.preview-card { width: 900px; max-width: 94vw; }
.preview-body { padding: 0; max-height: 70vh; overflow: auto; background: #f8fafc; }
.preview-text { white-space: pre-wrap; padding: 20px 24px; font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
                font-size: 14px; line-height: 1.8; color: #263244; }
.preview-frame { display: block; width: 100%; height: 70vh; border: 0; background: #fff; }
.preview-note { padding: 10px 24px; background: #eef4fc; color: #40546e; font-size: 12px; border-bottom: 1px solid var(--border); }

/* 提示 */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(100px); background: #1f2937; color: #fff; padding: 11px 24px; border-radius: 8px; font-size: 13px; opacity: 0; transition: .3s; z-index: 999; pointer-events: none; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
@media (max-width: 1100px) { .stat-grid, .quick-grid { grid-template-columns: repeat(2, 1fr); } .ai-panel, .chat-col { width: 280px; } }
