/* style.css - 统一样式（柔和幼教风） */
:root {
  --primary: #6c8ee2;
  --primary-dark: #4a6bbf;
  --accent: #ffb84d;
  --bg: #f7f9fd;
  --card-bg: #ffffff;
  --text: #2b3a55;
  --text-muted: #7a8499;
  --border: #e1e7f3;
  --danger: #e26060;
  --ok: #38a169;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  /* 全局按 80% 显示（用户反馈 100% 偏大，浏览器 80% 缩放正合适） */
  zoom: 0.8;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 16px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
}
button:hover { opacity: .9; }
button:active { transform: translateY(1px); }
button.ghost { background: #fff; color: var(--primary-dark); }
button.danger { background: var(--danger); border-color: var(--danger); }
button.link { background: none; color: var(--primary-dark); border: none; padding: 4px 8px; }
button.link.danger { color: var(--danger); }
button:disabled { opacity: .5; cursor: not-allowed; }

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,142,226,.15);
}

/* 登录页：左侧登录框 + 右侧宣传语与流程 */
.login-page { min-height: 100vh; }
.login-bg {
  position: fixed; inset: 0; z-index: 0;
  background: url('/img/login-bg.jpg') right center / cover no-repeat #f4f8fd;
}
.login-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(255,255,255,.82) 0%, rgba(255,255,255,.7) 40%, rgba(255,255,255,.52) 100%);
}
.login-shell {
  position: relative; z-index: 1; box-sizing: border-box;
  width: 100%; max-width: 1200px; margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  grid-template-areas: "head head" "card flow";
  align-content: center; align-items: center;
  column-gap: 56px; row-gap: 24px;
  padding: 28px 40px;
}
.login-left { grid-area: card; width: 380px; display: flex; }
.login-card {
  width: 100%;
  background: rgba(255,255,255,.97);
  border: 1px solid #fff;
  border-radius: 18px;
  padding: 28px 30px 20px;
  box-shadow: 0 22px 55px rgba(40,60,100,.15);
}
.login-card .login-logo { display: block; width: 48px; height: 48px; margin: 0 auto 8px; }
.login-card h1 { margin: 0 0 2px; font-size: 22px; text-align: center; color: var(--primary-dark); letter-spacing: 2px; }
.login-card .login-sub { text-align: center; color: var(--text-muted); font-size: 12px; margin: 0 0 18px; }
.login-contact { text-align: center; margin-top: 6px; }

/* 顶部居中：宣传语 */
.login-hero { grid-area: head; text-align: center; }
.hero-slogan {
  margin: 0 0 12px; font-size: 38px; line-height: 1.32;
  letter-spacing: 1px; font-weight: 800; color: #1F3350;
  text-shadow: 0 2px 14px rgba(255,255,255,.9);
}
.hero-slogan em { font-style: normal; color: #159877; }
.hero-sub { margin: 0; font-size: 14px; color: #5C7191; letter-spacing: .3px; }

/* 中间：新用户体验流程 */
.login-flow {
  grid-area: flow; justify-self: center;
  width: 100%; max-width: 684px; min-width: 0;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 20px;
  padding: 24px 26px 18px;
  box-shadow: 0 18px 44px rgba(40,60,100,.07);
  backdrop-filter: blur(3px);
}
.flow {
  width: 100%; margin: 0;
  display: grid; grid-template-columns: 1fr 20px 1fr 20px 1fr 20px 1fr;
  align-items: start; gap: 4px;
}
.flow-step { min-width: 0; }
.flow-ic {
  width: 46px; height: 46px; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; background: #fff; border: 1px solid #E1EAF8;
  border-radius: 14px; box-shadow: 0 8px 18px rgba(44,91,216,.12);
}
.flow-arrow { height: 46px; display: flex; align-items: center; justify-content: center; color: #A9BEDD; font-size: 15px; }
.flow-no { font-size: 10px; color: #93A7C3; letter-spacing: 1.4px; }
.flow-title { margin: 2px 0 4px; font-size: 14px; font-weight: 700; color: #25405F; }
.flow-desc { padding: 0 2px; font-size: 11.5px; line-height: 1.6; color: #6B7C94; }

.hero-feats { width: 100%; margin-top: 18px; display: flex; gap: 10px; }
.feat {
  flex: 1; min-width: 0; text-align: left;
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px; border-radius: 12px;
  background: rgba(255,255,255,.8); border: 1px solid #E6EEFA;
}
.feat-ic { font-size: 17px; line-height: 1.25; }
.feat-t { font-size: 12.5px; font-weight: 700; color: #2C4664; }
.feat-d { margin-top: 2px; font-size: 11px; line-height: 1.5; color: #6E7F96; }
.hero-note { margin: 18px 0 0; font-size: 12px; color: #7A8AA1; }

@media (max-width: 1180px) {
  .login-shell { padding: 24px 28px; column-gap: 24px; grid-template-columns: 340px minmax(0, 1fr); }
  .login-left { width: 340px; }
  .hero-slogan { font-size: 30px; }
  .flow-desc { font-size: 11px; }
}
@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr; grid-template-areas: "head" "card";
    justify-items: center; padding: 22px 16px; row-gap: 18px;
  }
  .login-flow { display: none; }
  .login-left { width: 100%; max-width: 400px; }
  .hero-slogan { font-size: 24px; letter-spacing: .5px; }
  .hero-sub { padding: 0 6px; font-size: 12px; }
}
.login-card .field { margin-bottom: 16px; }
.login-card label { display:block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.login-card input { width: 100%; }
.login-card .btn-full { width: 100%; padding: 10px; margin-top: 8px; }
.login-tip { margin-top: 16px; padding: 10px; background: #fff8e6; border: 1px dashed var(--accent); border-radius: 6px; font-size: 12px; color: #946b14; }
.error { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 18px; }

/* 顶部导航（比例参照企业控制台：文字更大、栏高更紧凑） */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 11px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.topbar .brand { font-size: 21px; font-weight: 600; color: var(--primary-dark); display: flex; align-items: center; gap: 9px; letter-spacing: .5px; }
.topbar .brand-logo { display: block; width: 26px; height: 26px; border-radius: 6px; }
.topbar .tag { font-size: 13px; padding: 3px 10px; }
.topbar .spacer { flex: 1; }
.topbar .user-info { color: var(--text-muted); font-size: 15px; }
.topbar button.link { font-size: 16px; padding: 6px 8px; }

/* 返回按钮：全站统一 —— 二级页面顶栏最左侧一个「← 返回」边框按钮 */
.topbar .topbar-back, .editor-topbar .topbar-back {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid #cdd6e4; background: #fff; color: var(--text);
  border-radius: 7px; padding: 6px 14px; font-size: 15px; line-height: 1.2;
  cursor: pointer; font-family: inherit; white-space: nowrap; text-decoration: none;
}
.topbar .topbar-back:hover, .editor-topbar .topbar-back:hover {
  background: #f0f4fb; border-color: var(--primary); color: var(--primary);
}

/* 主区容器（字号与比例全站统一：加宽画布、放大字号层级） */
.container { max-width: 1760px; margin: 0 auto; padding: 28px 40px; }
.page-title { display: flex; align-items: flex-start; margin-bottom: 18px; }
.page-title h2 { margin: 0; flex: 1; font-size: 24px; font-weight: 600; letter-spacing: .5px; line-height: 1.35; }
.page-title .pt-main { flex: 1; min-width: 0; }
.page-slogan { margin: 4px 0 0; font-size: 14px; color: var(--text-muted); }
.page-title .actions { display: flex; gap: 10px; }
.page-title .actions button { padding: 9px 18px; font-size: 14px; }

/* 表格 */
table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(40,60,100,.06);
}
table.data-table th, table.data-table td {
  padding: 18px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.data-table th { background: #f7f9fc; font-weight: 600; color: var(--text-muted); font-size: 13px; padding: 15px 20px; }
table.data-table td { font-size: 15px; line-height: 1.7; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: #fafcff; }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 12px;
  background: #eaf0ff; color: var(--primary-dark); font-size: 12px;
}

/* 空状态 */
.empty { text-align: center; padding: 48px; color: var(--text-muted); }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20,30,60,.35);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  background: #fff; border-radius: 10px; width: 480px; max-height: 80vh;
  display: flex; flex-direction: column;
}
.modal .modal-head { padding: 14px 20px; border-bottom: 1px solid var(--border); font-weight: 600; display:flex; }
.modal .modal-head h3 { margin: 0; flex: 1; }
.modal .modal-body { padding: 20px; overflow: auto; }
.modal .modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.modal.modal-wide { width: 720px; }
.preview-content {
  background: #f7f9fd; padding: 16px; border-radius: 6px;
  max-height: 60vh; overflow: auto; line-height: 1.8; font-size: 13px;
}
.preview-content table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.preview-content td, .preview-content th { border: 1px solid #ccc; padding: 6px 10px; }

/* 历史文档列表 */
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  padding: 12px; border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; background: #fafcff; transition: all .15s;
}
.history-item:hover { border-color: var(--primary); background: #f0f5ff; }
.history-item .hi-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.history-item .hi-meta { font-size: 11px; color: var(--text-muted); }
.template-option { display:flex; padding: 10px 12px; border:1px solid var(--border); border-radius:6px; margin-bottom: 8px; cursor: pointer; }
.template-option:hover { border-color: var(--primary); background: #fafcff; }
.template-option .name { font-weight: 600; flex: 1; }
.template-option .cat { color: var(--text-muted); font-size: 12px; }

/* 模板选择器标签 */
.picker-tabs { display: flex; gap: 0; margin: 10px 0; border-bottom: 2px solid var(--border); }
.picker-tab {
  padding: 8px 18px; border: none; background: none; cursor: pointer;
  font-size: 13px; color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all .15s;
}
.picker-tab:hover { color: var(--primary); }
.picker-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* 选模板弹窗：上传自己已写好的文档 */
.picker-upload { text-align: center; padding: 22px 16px 26px; border-radius: 10px; border: 2px dashed #bbb; background: #fafafa; transition: all 0.2s; outline: none; cursor: pointer; }
.picker-upload:hover { border-color: var(--primary, #1a73e8); background: #f0f6ff; }
.picker-upload.drag-over { border-color: var(--primary, #1a73e8); background: #eaf2ff; transform: scale(1.02); }
.picker-upload .pu-icon { font-size: 34px; line-height: 1; }
.picker-upload .pu-title { font-size: 15px; font-weight: 600; margin-top: 8px; }
.picker-upload .pu-tip { font-size: 12px; color: var(--text-muted); line-height: 1.8; margin: 8px 0 14px; }
.picker-upload .pu-status { font-size: 12px; color: var(--primary); margin-top: 10px; min-height: 18px; }

/* 按主题生成一套文档弹窗 */
.themeset-hint { font-size: 12px; color: var(--text-muted); line-height: 1.7; background: #fff8e6; border-radius: 4px; padding: 8px; margin: 4px 0 12px; }
.themeset-tabs { display: flex; gap: 0; margin: 4px 0 10px; border-bottom: 2px solid var(--border); }
.themeset-tab {
  padding: 8px 18px; border: none; background: none; cursor: pointer;
  font-size: 13px; color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all .15s;
}
.themeset-tab:hover { color: var(--primary); }
.themeset-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.themeset-list { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
.themeset-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.themeset-item:last-child { border-bottom: none; }
.themeset-item:hover { background: #fafcff; }
.themeset-item.selected { background: #eef5ff; }
.themeset-item input { flex: 0 0 auto; cursor: pointer; }
.themeset-item .themeset-name { flex: 1; font-size: 13px; }
.themeset-item .themeset-cat { color: var(--text-muted); font-size: 12px; }
/* 数量步进器：同一模板可生成多篇 */
.themeset-qty { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.themeset-qty .qty-btn { width: 24px; height: 24px; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; font-size: 15px; line-height: 1; padding: 0; color: var(--text); font-family: inherit; }
.themeset-qty .qty-btn:hover { border-color: #4f7cf0; color: #4f7cf0; }
.themeset-qty .qty-n { min-width: 20px; text-align: center; font-size: 13px; }
.themeset-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.themeset-count { flex: 1; font-size: 12px; color: var(--text-muted); }

/* 我的模板操作区 */
.my-tpl-actions { display: flex; gap: 10px; margin-bottom: 12px; }

/* 编辑器页 */
.editor-layout { display: flex; flex-direction: column; height: 100vh; }
.editor-topbar {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-bottom: 1px solid var(--border); padding: 10px 16px;
}
.editor-topbar input.title-input { flex: 1; max-width: 480px; font-size: 15px; font-weight: 600; }
.editor-topbar .meta { color: var(--text-muted); font-size: 12px; margin-right: 8px; }

/* 导出 Word 下拉菜单 */
.export-dd { position: relative; }
.export-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  min-width: 190px; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(40,60,100,.16);
  padding: 6px; display: flex; flex-direction: column;
}
.export-menu .export-item {
  display: block; width: 100%; text-align: left; background: none;
  border: none; color: var(--text); font-size: 13px; padding: 9px 12px;
  border-radius: 6px; cursor: pointer;
}
.export-menu .export-item:hover { background: #f0f5ff; color: var(--primary-dark); opacity: 1; }

/* 按主题生成一套文档：生成进度遮罩 */
.theme-gen-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(247,249,253,.97);
  display: flex; align-items: center; justify-content: center;
}
.theme-gen-card {
  width: 420px; max-width: 86vw; background: #fff; border-radius: 12px;
  padding: 28px 30px; box-shadow: 0 16px 44px rgba(40,60,100,.18);
  text-align: center;
}
.theme-gen-title { font-size: 17px; font-weight: 600; color: var(--primary-dark); margin-bottom: 8px; }
.theme-gen-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; min-height: 20px; }
.theme-gen-bar { height: 10px; background: #eef2fb; border-radius: 6px; overflow: hidden; }
.theme-gen-fill {
  height: 100%; width: 0; border-radius: 6px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .35s ease;
}
.theme-gen-pct { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--text-muted); }

/* 幼儿测评分析页 */
.assess-sub { color: var(--text-muted); font-size: 14px; margin: -6px 0 16px; }
.assess-layout { display: flex; gap: 20px; align-items: flex-start; }
.assess-side {
  flex: none; width: 280px; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 10px; padding: 16px;
}
.assess-side-title { font-weight: 600; margin-bottom: 10px; font-size: 16px; }
.assess-side .history-item.active { border-color: var(--primary); background: #eef4ff; }
.assess-main { flex: 1; min-width: 0; }
.assess-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.assess-head h3 { margin: 0; font-size: 18px; flex: none; max-width: 100%; }
.assess-head .meta { color: var(--text-muted); font-size: 13px; flex: 1; }
.assess-card {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 12px;
}
.ac-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ac-label { font-weight: 600; font-size: 15px; flex: 1; }
.ac-data { margin-bottom: 10px; }
.ac-data summary { cursor: pointer; font-size: 13px; color: var(--text-muted); user-select: none; }
.ac-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.ac-table th, .ac-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: center; }
.ac-table th { background: #f1f4fb; font-weight: 600; }
.ac-text { width: 100%; min-height: 96px; line-height: 1.7; resize: vertical; box-sizing: border-box; }

/* 测评分析：文档视图 */
.assess-doc {
  width: 794px; max-width: 100%; margin: 0 auto; background: #fff;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 44px 52px; box-shadow: 0 2px 12px rgba(40,60,100,.08);
  line-height: 1.8; overflow-wrap: break-word;
}
.assess-doc table { max-width: 100%; }
.assess-doc img { max-width: 100% !important; height: auto; }
.assess-fill { cursor: text; }
.assess-fill:focus { outline: 2px solid var(--primary); background: #fff !important; }
.assess-focusbar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: #2b3a55; color: #fff; border-radius: 10px; padding: 10px 14px;
  display: flex; align-items: center; gap: 10px; z-index: 80;
  box-shadow: 0 8px 24px rgba(20,30,60,.35); max-width: 94vw;
}
.assess-focusbar .fb-label { font-size: 13px; max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.assess-focusbar .fb-count { font-size: 12px; color: #ffd27a; white-space: nowrap; }
.assess-focusbar button { padding: 5px 10px; font-size: 12px; }
.assess-focusbar button.ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.45); }
.assess-focusbar button.ghost:hover { opacity: .85; }
.assess-focusbar .fb-close { background: none; border: none; color: #fff; padding: 5px 6px; }

/* 编辑器主体：左侧面板 + 主编辑区 */
.editor-body { flex: 1; display: flex; overflow: hidden; }
.editor-sidebar {
  width: 420px; min-width: 420px;
  background: #fff; border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.sidebar-tabs { display: flex; border-bottom: 1px solid var(--border); }
.tab-btn {
  flex: 1; padding: 10px 4px; border: none; background: #f7f9fd;
  color: var(--text-muted); cursor: pointer; font-size: 12px;
  border-right: 1px solid var(--border);
}
.tab-btn:last-child { border-right: none; }
.tab-btn.active { background: #fff; color: var(--primary-dark); font-weight: 600; }
.sidebar-content { flex: 1; overflow: auto; padding: 12px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* 新建模板：格式设置面板 */
.fmt-panel { padding: 10px 12px; background: #f7f9fd; border-bottom: 1px solid var(--border); }
.fmt-head { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.fmt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fmt-grid label { display: block; font-size: 12px; color: var(--text-muted); }
.fmt-grid select { width: 100%; margin-top: 2px; padding: 4px 6px; font-size: 12px; }
.fmt-hint { margin-top: 8px; font-size: 11px; color: var(--text-muted); }

.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.snippet-cat { width: 100%; margin-bottom: 10px; }
.snippet-list { display: flex; flex-direction: column; gap: 8px; }
.snippet-item {
  padding: 10px; border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; background: #fafcff; transition: all .15s;
}
.snippet-item:hover { border-color: var(--primary); background: #f0f5ff; }
.snippet-item .si-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.snippet-item .si-content { font-size: 12px; color: var(--text-muted); line-height: 1.5; max-height: 48px; overflow: hidden; }
.snippet-item .si-actions { margin-top: 6px; display: flex; gap: 6px; }
.snippet-item .si-actions button { padding: 2px 8px; font-size: 12px; }

/* 知识库 */
.kb-cat { margin-bottom: 4px; }
.kb-cat-title {
  padding: 8px 10px; font-weight: 600; font-size: 13px; cursor: pointer;
  background: #f5f7fa; border-radius: 4px; color: var(--primary);
  user-select: none;
}
.kb-cat-title:hover { background: #eef2f7; }
.kb-items { padding: 4px 0 4px 8px; display: flex; flex-direction: column; gap: 6px; }
.kb-item {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: #fafcff; transition: all .15s;
}
.kb-item:hover { border-color: var(--primary); background: #f0f5ff; }
.kb-item-title { font-size: 12.5px; font-weight: 500; margin-bottom: 4px; color: #333; }
.kb-item-actions { display: flex; gap: 8px; }
.kb-item-actions button { padding: 2px 8px; font-size: 11px; }

.ai-section { display: flex; flex-direction: column; gap: 10px; }

/* 主题推荐（方案一） */
.theme-recommend { background: #f0f7ff; border: 1px solid #c5dcf5; border-radius: 8px; padding: 10px; }
.theme-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.theme-title { font-size: 14px; font-weight: 700; color: #1a5fb4; }
.theme-season { font-size: 12px; color: #fff; background: #4a9eff; padding: 2px 10px; border-radius: 12px; }
.theme-filters { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.theme-age { flex: 1; padding: 5px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; background: #fff; }
.theme-list { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; }
.theme-card {
  background: #fff; border: 1px solid #dde8f5; border-radius: 6px; padding: 8px 10px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.theme-card:hover { border-color: var(--primary); box-shadow: 0 2px 6px rgba(74,158,255,.15); }
.theme-card-name { font-size: 13px; font-weight: 600; color: #1a3a5c; margin-bottom: 3px; }
.theme-card-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 4px; }
.theme-tag { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: #e8f0fe; color: #4a6fa5; }
.theme-tag.domain { background: #fff3e0; color: #b8860b; }
.theme-card-goals { font-size: 11px; color: #666; line-height: 1.5; }
.theme-card-goals span { display: block; }
.theme-card-goals b { color: #444; }

/* 热门主题标签云 */
.theme-popular { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #b0c8e8; }
.theme-popular-head { font-size: 12px; font-weight: 600; color: #c0392b; margin-bottom: 6px; }
.theme-tag-cloud { display: flex; flex-wrap: wrap; gap: 5px; }
.theme-tag-pop {
  position: relative; display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 9px; border-radius: 12px; font-size: 11.5px; cursor: pointer;
  background: #fff; border: 1px solid #d5e3f5; color: #1a5fb4;
  transition: all .15s; max-width: 100%; white-space: nowrap;
}
.theme-tag-pop:hover { background: #4a9eff; color: #fff; border-color: #4a9eff; z-index: 10; }
.theme-tag-pop.ai { background: #fff8ec; border-color: #f0d9a8; color: #8a5a00; }
.theme-tag-pop.ai:hover { background: #e89500; color: #fff; border-color: #e89500; }
.theme-tag-pop .use-count { font-size: 10px; opacity: .7; }
/* hover 提示气泡 */
.theme-tag-pop .tag-tooltip {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 0;
  min-width: 220px; max-width: 320px; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; box-shadow: 0 4px 14px rgba(0,0,0,.18);
  font-size: 11.5px; color: #333; line-height: 1.6; white-space: normal;
  z-index: 100;
}
.theme-tag-pop:hover .tag-tooltip { display: block; }
.tag-tooltip .tt-name { font-weight: 700; font-size: 13px; color: #1a3a5c; margin-bottom: 3px; }
.tag-tooltip .tt-meta { font-size: 10px; color: #999; margin-bottom: 4px; }
.tag-tooltip .tt-goal { margin: 1px 0; }
.tag-tooltip .tt-goal b { color: #555; }

/* AI 主题生成器（方案二） */
.theme-gen { background: #fdf6ec; border: 1px solid #f0d9a8; border-radius: 8px; padding: 10px; }
.theme-gen-row { display: flex; gap: 6px; margin-top: 4px; }
.theme-keywords {
  flex: 1; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; background: #fff;
}
.theme-keywords:focus { outline: none; border-color: var(--primary); }
.theme-gen-btn {
  padding: 7px 14px; background: #e89500; color: #fff; border: none; border-radius: 6px;
  cursor: pointer; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.theme-gen-btn:hover { background: #d4850a; }
.theme-gen-btn:disabled { background: #c8b48a; cursor: not-allowed; }
.theme-gen-result { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.theme-gen-item {
  background: #fff; border: 1px solid #e8d8a8; border-radius: 6px; padding: 8px 10px;
  cursor: pointer; transition: border-color .15s;
}
.theme-gen-item:hover { border-color: #e89500; }
.theme-gen-item-name { font-size: 13px; font-weight: 600; color: #8a5a00; margin-bottom: 3px; }
.theme-gen-item-goals { font-size: 11px; color: #666; line-height: 1.5; }
.theme-gen-item-goals span { display: block; }
.theme-gen-item-goals b { color: #444; }
.theme-gen-loading { padding: 10px; text-align: center; color: #999; font-size: 12px; }

.ai-divider { height: 1px; background: var(--border); margin: 2px 0; }
.ai-tip { font-size: 12px; color: var(--text-muted); line-height: 1.6; margin: 0; padding: 8px; background: #fff8e6; border-radius: 4px; }
.ai-label { font-size: 12px; color: var(--text-muted); margin-bottom: -4px; }
.ai-input-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 6px; }
.ai-input-head .ai-label { margin-bottom: 0; }
.ai-voice-btn {
  padding: 3px 10px; font-size: 12px; line-height: 1.6; cursor: pointer;
  border: 1px solid var(--border); border-radius: 14px; background: #fff;
  color: var(--text-muted); white-space: nowrap;
}
.ai-voice-btn:hover { border-color: var(--primary); color: var(--primary); }
.ai-voice-btn.recording {
  border-color: var(--danger); background: var(--danger); color: #fff;
  animation: voicePulse 1.2s ease-in-out infinite;
}
@keyframes voicePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.ai-select { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: #fff; }
.ai-type { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: #fff; cursor: pointer; }
.ai-type:focus { outline: none; border-color: var(--primary); }
.ai-image-upload { display: flex; flex-direction: column; gap: 8px; }
.ai-image-btn { padding: 8px 12px; font-size: 13px; cursor: pointer; }
.ai-image-preview { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #f5f5f5; }
.ai-image-preview img { width: 100%; display: block; max-height: 180px; object-fit: contain; }
.ai-input {
  width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-family: inherit; resize: vertical; line-height: 1.6;
}
.ai-input:focus { outline: none; border-color: var(--primary); }
.ai-generate {
  width: 100%; padding: 10px; background: var(--primary); color: #fff;
  border: none; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.ai-generate:hover { background: var(--primary-dark); }
.ai-generate:disabled { background: #aab; cursor: not-allowed; }

/* === 豆包式统一输入区 === */
.ai-unified {
  position: relative; border: 1px solid var(--border); border-radius: 12px;
  background: #fff; padding: 12px 14px; transition: border-color 0.15s, box-shadow 0.15s;
  display: flex; flex-direction: column; gap: 10px;
}
.ai-unified:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,115,232,0.1); }
.ai-unified.drag-over { border-color: var(--primary); background: #f0f6ff; }

.ai-unified-previews { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-unified-previews .au-pv {
  position: relative; width: 52px; height: 52px; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border); background: #f5f5f5; flex-shrink: 0;
}
.ai-unified-previews .au-pv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ai-unified-previews .au-pv .au-file {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 10px; color: var(--primary); text-align: center; gap: 2px;
}
.ai-unified-previews .au-pv .au-file .au-ext { font-weight: 700; font-size: 12px; }
.ai-unified-previews .au-pv .au-rm {
  position: absolute; top: -4px; right: -4px; width: 18px; height: 18px; border-radius: 50%;
  background: #333; color: #fff; border: none; cursor: pointer; font-size: 11px; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.ai-unified-previews .au-pv .au-parse {
  position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%);
  background: var(--primary, #1a73e8); color: #fff; font-size: 9px; padding: 1px 4px;
  border-radius: 8px; white-space: nowrap; animation: au-pulse 1.2s infinite;
}
@keyframes au-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* 输入框 wrap（语音按钮定位用） */
.ai-unified .ai-input-wrap { position: relative; width: 100%; }

/* 输入框直接放在大框里，占满宽度 */
.ai-unified .ai-input {
  border: none; padding: 8px 0 32px 0; /* 底部留空间给语音按钮 */
  resize: none; box-shadow: none; font-size: 14px;
  line-height: 1.6; min-height: 48px; max-height: 160px;
  background: transparent; width: 100%;
}
.ai-unified .ai-input:focus { border: none; box-shadow: none; outline: none; }

/* 小语音按钮：输入框右下角 */
.ai-voice-mini {
  position: absolute; right: 2px; bottom: 2px;
  width: 28px; height: 28px; border-radius: 50%;
  border: none; background: transparent; cursor: pointer;
  font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; color: #999;
}
.ai-voice-mini:hover { background: #f0f6ff; color: var(--primary); }
.ai-voice-mini.recording { background: #ffe8e8; color: #e74c3c; animation: voice-pulse 1s infinite; }
@keyframes voice-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }

/* 大蓝色生成按钮，宽度=输入框宽度 */
.ai-generate-btn {
  width: 100%; height: 40px; border-radius: 20px; border: none;
  background: linear-gradient(135deg, #4a9eff, #2d7ddf);
  color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.18s; letter-spacing: 0.5px;
}
.ai-generate-btn:hover { background: linear-gradient(135deg, #5aa8ff, #3d8def); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(45,125,223,0.3); }
.ai-generate-btn:active { transform: translateY(0); }
.ai-generate-btn:disabled { background: #c0c4cc; cursor: not-allowed; transform: none; box-shadow: none; }
.ai-tool-btn {
  width: 30px; height: 30px; border-radius: 6px; border: none; background: transparent;
  color: #666; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.12s;
}
.ai-tool-btn:hover { background: #f5f5f5; color: var(--primary); }
.ai-generate-small {
  height: 32px; padding: 0 14px; border-radius: 16px; border: none;
  background: var(--primary); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; transition: all 0.15s;
}
.ai-generate-small:hover { background: var(--primary-dark); }
.ai-generate-small:disabled { background: #c0c4cc; cursor: not-allowed; }

/* 圆形图标按钮（豆包风格） */
.ai-tool-btn.round {
  width: 34px; height: 34px; border-radius: 50%;
  background: #f0f2f5; color: #666; border: none;
  font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.ai-tool-btn.round:hover { background: #e3e6eb; color: var(--primary); transform: scale(1.05); }

/* 圆形发送按钮 */
.ai-generate-small.round {
  width: 34px; height: 34px; border-radius: 50%;
  padding: 0; font-size: 15px;
}

/* 参考资料区的语音按钮（蓝色底图标+文字） */
.ref-btn.voice-btn {
  background: linear-gradient(135deg, #4a9eff, #2d7ddf);
  color: #fff; border: none;
}
.ref-btn.voice-btn:hover { background: linear-gradient(135deg, #5aa8ff, #3d8def); color: #fff; }
.ref-btn.voice-btn.recording {
  background: linear-gradient(135deg, #ff6b6b, #e53d3d); animation: pulse-red 1s infinite;
}
@keyframes pulse-red {
  0%,100% { box-shadow: 0 0 0 0 rgba(229,61,61,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(229,61,61,0); }
}

.ai-drop-hint {
  position: absolute; inset: 0; background: rgba(26,115,232,0.08);
  border: 2px dashed var(--primary); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 14px; pointer-events: none; z-index: 2;
}

.ai-unified-info {
  margin-top: 6px; padding: 6px 8px; font-size: 12px; color: var(--text-muted);
  background: #f9f9fa; border-radius: 6px; line-height: 1.5;
}

.ai-unified-hint {
  margin-top: 6px; font-size: 11.5px; color: #8a8f99;
  line-height: 1.5; padding: 0 2px;
}
/* 「本次只重写某一格」提示：光标/点选落在表格某格时出现 */
.ai-target-hint {
  font-size: 12px; color: #946b14; background: #fff8e6;
  border: 1px dashed var(--accent); border-radius: 6px;
  padding: 6px 8px; margin: 6px 0; line-height: 1.5;
}
.ai-target-hint b { color: #7a5410; }
/* 模板填写说明：用户教给 AI 的规矩，可删除 */
.ai-notes-bar {
  margin: 6px 0; padding: 7px 9px; border-radius: 8px;
  background: #eef5ef; border: 1px solid #cfe3d2;
}
.ai-notes-title { font-size: 12px; color: #3a6a44; margin-bottom: 5px; }
.ai-note-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: #2f4f36; background: #fff;
  border: 1px solid #cfe3d2; border-radius: 20px;
  padding: 2px 9px; margin: 2px 6px 2px 0; line-height: 1.6;
}
.ai-note-chip a { cursor: pointer; color: #b0623a; font-weight: 700; margin-left: 2px; }
.ai-note-chip a:hover { color: #8f3f1d; }
/* AI 生成等待面板：计时 + 小贴士轮播 */
.ai-waiting {
  margin: 8px 0; border-radius: 8px; overflow: hidden;
  border: 1px solid #e6e2d8; background: #fbfaf7;
}
.ai-waiting-timer {
  font-size: 12px; color: #666; padding: 8px 10px;
  background: #f4f1ea; border-bottom: 1px solid #ece7dc;
}
.ai-waiting-timer b { color: var(--accent); font-weight: 600; }
.ai-waiting-card {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px; font-size: 12px; line-height: 1.6; color: #555;
}
.ai-waiting-tag { flex: none; font-weight: 600; color: #7a5410; white-space: nowrap; }
/* 编辑器顶部的首次使用小技巧条 */
.editor-onboard {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; line-height: 1.6; color: #7a5410;
  background: #fff8e6; border-bottom: 1px solid #f0e0b0;
  padding: 8px 12px;
}
.editor-onboard .onboard-text { flex: 1; }
.editor-onboard b { color: #6b4a0d; }
/* 表格单元格旁的「只重写此格」浮动按钮 */
.cell-rewrite-btn {
  position: fixed; z-index: 300; display: none;
  padding: 3px 10px; font-size: 12px; line-height: 1.5;
  color: #fff; background: var(--primary); border: none; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2); cursor: pointer; white-space: nowrap;
}
.cell-rewrite-btn:hover { background: var(--primary-dark); }
.ai-result-box {
  border: 1px solid var(--border); border-radius: 6px; background: #fafcff;
  display: none;
}
.ai-result-box.show { display: block; }
.ai-result-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}
.ai-result {
  padding: 12px 14px; font-size: 13px; line-height: 1.8;
  min-height: 160px; max-height: 400px; overflow: auto;
  white-space: pre-wrap; word-break: break-word;
}

.hint-box {
  padding: 10px 12px; background: #f7f9fd; border-radius: 6px;
  margin-bottom: 10px; font-size: 12px; line-height: 1.7; color: var(--text);
}
.hint-box p { margin: 2px 0; }

.editor-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.toolbar-container { border-bottom: 1px solid var(--border); background: #fafcff; }
#editor-container {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#editor-container .w-e-toolbar { background: #fafcff; }
#editor-container .w-e-text-container { background: #fff; }

/* 编辑区：让文本容器撑满可用宽度 */
#editor-container .w-e-text-container {
  background: #f0f3f9;
  width: 100%;
  flex: 1;
}
/* 白色纸张区域：只针对 .w-e-scroll 滚动容器，避免误伤单元格编辑器等浮层 */
#editor-container .w-e-text-container > .w-e-scroll {
  max-width: min(1100px, 94vw);
  margin: 16px auto;
  background: #fff;
  padding: 32px 48px;
  min-height: calc(100vh - 150px);
  box-shadow: 0 2px 10px rgba(40,60,100,.08);
  border-radius: 4px;
}
/* 编辑区内的段落/表格等元素，去掉默认内边距，让内容填满纸张 */
#editor-container .w-e-text-container [data-w-e-type] { padding: 0; }
/* 单元格编辑器浮层：恢复默认，不套纸张样式 */
#editor-container .w-e-text-container .w-e-cell-editor,
#editor-container .w-e-text-container > div:not(.w-e-scroll) {
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  min-height: 0;
}

/* 编辑器内表格默认样式：确保导入的表格大字号、加粗、紧凑列宽 */
#editor-container table {
  width: 100% !important;
  border-collapse: collapse;
}
#editor-container table th {
  border: 1px solid #999;
  font-size: 14px;
  line-height: 1.5;
  padding: 8px;
  font-weight: bold !important;
  vertical-align: middle;
}
/* 表格内图片限宽：手机原图宽 1600px 会把整张表格横向撑爆，
   表现成「内容格里只有照片、看不到 AI 写的文字」，这里统一压到格子宽度内 */
#editor-container table img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 4px auto;
}
/* td 默认正常字重；标签格加 .label-cell 类后才加粗 */
#editor-container table td {
  border: 1px solid #999;
  font-size: 14px;
  line-height: 1.5;
  padding: 8px;
  font-weight: normal !important;
  vertical-align: middle;
}
#editor-container table td * {
  font-weight: normal !important;
}
#editor-container table td.label-cell,
#editor-container table td.label-cell * {
  font-weight: bold !important;
}

.statusbar {
  background: #fff; border-top: 1px solid var(--border);
  padding: 6px 16px; font-size: 12px; color: var(--text-muted);
  text-align: right;
}

.toast {
  position: fixed; top: 70px; left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: var(--text); color: #fff; padding: 13px 26px;
  border-radius: 8px; box-shadow: 0 10px 32px rgba(0,0,0,.3);
  font-size: 15px; line-height: 1.6; max-width: 72%;
  z-index: 3000; opacity: 0; transition: opacity .25s, transform .25s;
  pointer-events: none; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* 姓名联想浮层 */
.name-suggest {
  position: fixed; z-index: 200;
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
  max-height: 200px; overflow: auto; min-width: 120px;
}
.name-suggest .ns-item {
  padding: 8px 12px; cursor: pointer; font-size: 13px;
}
.name-suggest .ns-item:hover { background: #f0f5ff; }

/* 续写分页线（编辑器内提示"另起一页"） */
#editor-container hr {
  border: 0;
  border-top: 2px dashed #cfcfcf;
  margin: 22px 0;
}

/* 续写模板选择弹窗 */
.append-tpl-tip { font-size: 13px; color: var(--text-muted); margin: 0 0 12px; }
.append-tpl-list {
  max-height: 46vh; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 8px;
}
.append-tpl-item { padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.append-tpl-item:last-child { border-bottom: 0; }
.append-tpl-item:hover { background: #f0f5ff; }
.append-tpl-name { font-size: 14px; color: var(--text); }
.append-tpl-cat { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* 弹窗表单字段 */
.modal .field { margin-bottom: 14px; }
.modal .field label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.modal .field input, .modal .field select, .modal .field textarea { width: 100%; }
.modal .field textarea { resize: vertical; font-family: inherit; }

/* ============ 站点页脚（政策链接 + 备案信息） ============ */
.site-footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  padding: 18px 16px 24px;
  font-size: 12px;
  color: var(--text-muted);
}
.site-footer span, .site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--primary-dark); text-decoration: underline; }

/* ============ 政策 / 协议页 ============ */
.legal-body {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 28px 32px; line-height: 1.9; font-size: 14px; color: #333;
}
.legal-body h2 { font-size: 19px; margin: 0 0 6px; color: var(--primary-dark); }
.legal-body h3 { font-size: 15px; margin: 22px 0 8px; color: var(--primary-dark); }
.legal-body p { margin: 8px 0; }
.legal-body ul { margin: 8px 0; padding-left: 22px; }
.legal-body li { margin: 4px 0; }
.legal-body .legal-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 18px; }
.legal-body table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.legal-body td, .legal-body th { border: 1px solid #ddd; padding: 7px 10px; text-align: left; vertical-align: top; }
.legal-body .legal-anchor-gap { height: 34px; }


/* ============ 全局确认弹窗（confirmUi，替代浏览器原生 confirm） ============ */
.confirm-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; z-index: 3000;
}
.confirm-dialog {
  background: #fff; border-radius: 10px; padding: 22px 24px;
  max-width: 420px; width: calc(100% - 48px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .25);
}
.confirm-msg {
  font-size: 14px; line-height: 1.7; color: var(--text);
  white-space: pre-wrap; margin-bottom: 18px;
}
.confirm-btns { display: flex; justify-content: flex-end; gap: 10px; }

@media (max-width: 720px) {
  .container { padding: 16px; }
  .topbar { padding: 10px 14px; flex-wrap: wrap; }
  #editor-container .w-e-text-container > .w-e-scroll { padding: 16px; margin: 0; border-radius: 0; max-width: 100%; }
  .editor-topbar input.title-input { max-width: none; }
}

/* ===== AI 参考资料区（引用已有文档 / 上传外部文档） ===== */
.ref-box {
  background: #f2f7ff; border: 1px solid #c5dcf5; border-radius: 8px;
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
}
.ref-head { display: flex; align-items: center; justify-content: space-between; }
.ref-head .ref-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.ref-head .ref-count { font-size: 11px; color: var(--text-muted); }
.ref-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ref-btn {
  padding: 8px 6px; font-size: 12px; border: 1px dashed #b9cdea; border-radius: 6px;
  background: #fff; color: var(--primary-dark); cursor: pointer; transition: all .15s;
}
.ref-btn:hover { border-color: var(--primary); background: #f7faff; }
.ref-btn:disabled { opacity: .6; cursor: wait; }
.ref-list { display: flex; flex-direction: column; gap: 6px; }
.ref-chip {
  display: flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid var(--border); border-radius: 6px; padding: 7px 9px;
}
.ref-chip .ref-ico { font-size: 14px; flex: none; }
.ref-chip .ref-info { flex: 1; min-width: 0; }
.ref-chip .ref-name { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ref-chip .ref-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.ref-chip .ref-del { flex: none; border: none; background: none; color: var(--text-muted); font-size: 13px; cursor: pointer; padding: 2px 4px; border-radius: 4px; }
.ref-chip .ref-del:hover { background: #ffecec; color: var(--danger); }
.ref-empty { font-size: 11.5px; color: var(--text-muted); line-height: 1.6; padding: 2px; }
.ref-note { font-size: 11px; color: #8a94a6; line-height: 1.55; }
.ref-sum { font-size: 11px; color: var(--primary-dark); }
.ref-picker-list { display: flex; flex-direction: column; gap: 6px; }
.ref-picker-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 6px; background: #fafcff; cursor: pointer;
}
.ref-picker-item:hover { border-color: var(--primary); background: #f0f5ff; }
.ref-picker-item.checked { border-color: var(--primary); background: #eef4ff; }
.ref-picker-item input { accent-color: var(--primary); }
.ref-picker-item .rk-name { font-size: 13px; font-weight: 600; flex: 1; }
.ref-picker-item .rk-meta { font-size: 11.5px; color: var(--text-muted); }
.ref-picker-tip { font-size: 11.5px; color: var(--text-muted); margin-top: 12px; line-height: 1.6; }
