/* ==========================================================================
   招标文件智能辅助生成平台 · 全局设计系统
   风格：政务专业蓝（business-international） / 交付形态：纯静态，可离线打开
   ========================================================================== */

/* ---------- 1. 设计令牌 (Design Tokens) ---------- */
:root {
  /* 主色（政务蓝） */
  --c-primary: #1677ff;
  --c-primary-hover: #4096ff;
  --c-primary-active: #0958d9;
  --c-primary-bg: #e8f3ff;
  --c-primary-bg-hover: #d4e8ff;
  --c-primary-border: #91caff;

  /* 中性色 */
  --c-bg: #f5f7fa;
  --c-surface: #ffffff;
  --c-surface-2: #fafbfc;
  --c-border: #e5e6eb;
  --c-border-strong: #c9cdd4;
  --c-text: #1f2933;
  --c-text-sub: #4e5969;
  --c-text-ter: #86909c;
  --c-text-inverse: #ffffff;

  /* 语义色 */
  --c-success: #00b42a;
  --c-success-bg: #e8ffea;
  --c-success-border: #7be188;
  --c-warning: #ff7d00;
  --c-warning-bg: #fff3e8;
  --c-warning-border: #ffcf8b;
  --c-danger: #f53f3f;
  --c-danger-bg: #ffece8;
  --c-danger-border: #f98981;
  --c-info: #1677ff;

  /* 圆角 / 阴影 */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .14);

  /* 字体 */
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-doc: "Songti SC", "SimSun", "宋体", "Noto Serif CJK SC", serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  /* 字号阶梯 */
  --fs-12: 12px; --fs-13: 13px; --fs-14: 14px;
  --fs-16: 16px; --fs-18: 18px; --fs-20: 20px;
  --fs-24: 24px; --fs-32: 32px;

  /* 布局 */
  --sidebar-w: 232px;
  --topbar-h: 56px;
  --content-pad: 24px;
  --radius: var(--r-md);

  /* 动效 */
  --ease: cubic-bezier(.2, 0, 0, 1);
  --dur-fast: 150ms;
  --dur: 220ms;
}

/* ---------- 2. 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-14);
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-hover); }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
svg { flex-shrink: 0; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d3d7de; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #b9bec8; }
::-webkit-scrollbar-track { background: transparent; }

/* 聚焦环 */
:focus-visible { outline: 2px solid var(--c-primary-border); outline-offset: 1px; }

/* ---------- 3. 工具类 ---------- */
.muted { color: var(--c-text-ter); }
.text-sub { color: var(--c-text-sub); }
.text-danger { color: var(--c-danger); }
.text-success { color: var(--c-success); }
.text-warning { color: var(--c-warning); }
.text-primary { color: var(--c-primary); }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.grow { flex: 1; }
.mono { font-family: var(--font-mono); }

/* 页面载入编排：错峰浮现 */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.reveal { animation: fadeUp .45s var(--ease) both; }
.reveal-1 { animation-delay: .02s; } .reveal-2 { animation-delay: .06s; }
.reveal-3 { animation-delay: .10s; } .reveal-4 { animation-delay: .14s; }
.reveal-5 { animation-delay: .18s; } .reveal-6 { animation-delay: .22s; }
.reveal-7 { animation-delay: .26s; } .reveal-8 { animation-delay: .30s; }

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .8s linear infinite; }

/* ---------- 4. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; height: 34px; padding: 0 14px;
  font-size: var(--fs-14); font-weight: 500; line-height: 1;
  color: var(--c-text); background: var(--c-surface);
  border: 1px solid var(--c-border-strong); border-radius: var(--r-md);
  transition: all var(--dur-fast) var(--ease); white-space: nowrap; user-select: none;
}
.btn:hover { color: var(--c-primary); border-color: var(--c-primary-border); background: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }

.btn-primary { color: #fff; background: var(--c-primary); border-color: var(--c-primary); }
.btn-primary:hover { color: #fff; background: var(--c-primary-hover); border-color: var(--c-primary-hover); }
.btn-primary:active { background: var(--c-primary-active); border-color: var(--c-primary-active); }

.btn-danger { color: var(--c-danger); background: #fff; border-color: var(--c-danger-border); }
.btn-danger:hover { color: #fff; background: var(--c-danger); border-color: var(--c-danger); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--c-text-sub); }
.btn-ghost:hover { color: var(--c-primary); background: var(--c-primary-bg); border-color: transparent; }

.btn-text { background: transparent; border-color: transparent; color: var(--c-primary); padding: 0 6px; height: 28px; }
.btn-text:hover { background: var(--c-primary-bg); }

.btn-lg { height: 42px; padding: 0 22px; font-size: var(--fs-16); }
.btn-sm { height: 28px; padding: 0 10px; font-size: var(--fs-13); }
.btn-block { width: 100%; }

/* 图标按钮 */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--r-md);
  color: var(--c-text-sub); background: transparent; border: none;
  transition: all var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: var(--c-bg); color: var(--c-text); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- 5. 表单控件 ---------- */
.form-item { margin-bottom: 18px; }
.form-label { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; font-size: var(--fs-13); color: var(--c-text-sub); font-weight: 500; }
.form-label .req { color: var(--c-danger); }
.form-hint { margin-top: 4px; font-size: var(--fs-12); color: var(--c-text-ter); }

.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 12px;
  font-family: inherit; font-size: var(--fs-14); color: var(--c-text);
  background: var(--c-surface); border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md); transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--c-text-ter); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--c-primary-border); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--c-primary); box-shadow: 0 0 0 2px rgba(22, 119, 255, .15); outline: none; }
.input.is-error, .select.is-error, .textarea.is-error { border-color: var(--c-danger); }
.input.is-error:focus, .select.is-error:focus, .textarea.is-error:focus { box-shadow: 0 0 0 2px rgba(245, 63, 63, .15); }
.input:disabled, .select:disabled { background: var(--c-surface-2); color: var(--c-text-ter); cursor: not-allowed; }
.textarea { height: auto; min-height: 88px; padding: 8px 12px; resize: vertical; line-height: 1.7; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2386909c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }

.field-error { display: none; margin-top: 4px; font-size: var(--fs-12); color: var(--c-danger); }
.form-item.has-error .field-error { display: flex; align-items: center; gap: 4px; }

/* 单选卡片组 */
.radio-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-card {
  flex: 1; min-width: 130px; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--c-border); border-radius: var(--r-lg);
  background: var(--c-surface); transition: all var(--dur-fast) var(--ease);
}
.radio-card:hover { border-color: var(--c-primary-border); }
.radio-card.is-checked { border-color: var(--c-primary); background: var(--c-primary-bg); }
.radio-card .rc-title { font-weight: 600; color: var(--c-text); }
.radio-card .rc-desc { margin-top: 2px; font-size: var(--fs-12); color: var(--c-text-ter); }
.radio-card input { display: none; }

/* 勾选 */
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--c-primary); cursor: pointer; }

/* ---------- 6. 卡片 ---------- */
.card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-hd { padding: 16px 20px; border-bottom: 1px solid var(--c-border); }
.card-title { font-size: var(--fs-16); font-weight: 600; color: var(--c-text); }
.card-sub { font-size: var(--fs-12); color: var(--c-text-ter); }

/* ---------- 7. 标签 / 徽标 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; font-size: var(--fs-12); font-weight: 500;
  border-radius: var(--r-sm); border: 1px solid transparent; white-space: nowrap;
}
.tag svg { width: 12px; height: 12px; }
.tag-blue { color: var(--c-primary); background: var(--c-primary-bg); border-color: var(--c-primary-border); }
.tag-green { color: var(--c-success); background: var(--c-success-bg); border-color: var(--c-success-border); }
.tag-orange { color: var(--c-warning); background: var(--c-warning-bg); border-color: var(--c-warning-border); }
.tag-red { color: var(--c-danger); background: var(--c-danger-bg); border-color: var(--c-danger-border); }
.tag-gray { color: var(--c-text-sub); background: var(--c-surface-2); border-color: var(--c-border); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--c-success); } .dot-orange { background: var(--c-warning); }
.dot-red { background: var(--c-danger); } .dot-blue { background: var(--c-primary); } .dot-gray { background: var(--c-text-ter); }

/* ---------- 8. 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-13); }
.table th {
  text-align: left; padding: 11px 14px; font-weight: 500; color: var(--c-text-sub);
  background: var(--c-surface-2); border-bottom: 1px solid var(--c-border); white-space: nowrap;
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.table tbody tr { transition: background var(--dur-fast) var(--ease); }
.table tbody tr:hover { background: var(--c-surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table .t-title { font-weight: 500; color: var(--c-text); }

/* ---------- 9. 弹窗 / 抽屉 / 轻提示 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center;
  animation: fadeIn var(--dur) var(--ease);
}
.modal {
  width: 480px; max-width: calc(100vw - 32px); max-height: calc(100vh - 64px);
  background: var(--c-surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
  animation: fadeUp .3s var(--ease);
}
.modal-hd { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--c-border); }
.modal-title { font-size: var(--fs-16); font-weight: 600; }
.modal-bd { padding: 22px; overflow-y: auto; }
.modal-ft { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--c-border); }
.modal-sm { width: 400px; }

.drawer-mask { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.45); animation: fadeIn var(--dur) var(--ease); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 92vw; z-index: 1001;
  background: var(--c-surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: slideIn .28s var(--ease);
}
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-md); font-size: var(--fs-13); animation: fadeUp .3s var(--ease);
}
.toast svg { width: 16px; height: 16px; }
.toast-success svg { color: var(--c-success); }
.toast-error svg { color: var(--c-danger); }
.toast-info svg { color: var(--c-primary); }
.toast-warning svg { color: var(--c-warning); }

/* ---------- 10. 骨架屏 / 空态 ---------- */
.skeleton { position: relative; overflow: hidden; background: #eef0f3; border-radius: var(--r-md); }
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 20px; color: var(--c-text-ter); }
.empty-state svg { width: 56px; height: 56px; color: #c9cdd4; margin-bottom: 14px; }
.empty-state .es-title { font-size: var(--fs-14); color: var(--c-text-sub); margin-bottom: 4px; }

/* 加载遮罩 */
.loading-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.72); z-index: 5; border-radius: inherit; }

/* ---------- 11. 应用壳 (App Shell) ---------- */
.app-nav {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); z-index: 100;
  background: #0e2a52; color: rgba(255,255,255,.72);
  display: flex; flex-direction: column;
}
.app-brand { display: flex; align-items: center; gap: 10px; height: var(--topbar-h); padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.app-brand .brand-logo { width: 30px; height: 30px; border-radius: var(--r-md); background: linear-gradient(135deg, #2f88ff, #1677ff); display: flex; align-items: center; justify-content: center; color: #fff; }
.app-brand .brand-logo svg { width: 18px; height: 18px; }
.app-brand .brand-name { font-size: var(--fs-14); font-weight: 700; color: #fff; letter-spacing: .5px; line-height: 1.25; }
.app-brand .brand-sub { font-size: 10px; color: rgba(255,255,255,.45); }

.nav-section { padding: 14px 12px 6px; font-size: 11px; letter-spacing: 1px; color: rgba(255,255,255,.4); }
.nav-list { padding: 4px 12px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 2px;
  border-radius: var(--r-md); color: rgba(255,255,255,.72); font-size: var(--fs-14);
  transition: all var(--dur-fast) var(--ease); cursor: pointer;
}
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--c-primary); color: #fff; }
.nav-item .nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--c-primary); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.nav-item.active .nav-badge { background: rgba(255,255,255,.25); }

.nav-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.nav-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-md); cursor: pointer; transition: background var(--dur-fast) var(--ease); }
.nav-user:hover { background: rgba(255,255,255,.08); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #2f88ff, #6c4dff); color: #fff; display: flex; align-items: center; justify-content: center; font-size: var(--fs-14); font-weight: 600; flex-shrink: 0; }
.nav-user .nu-name { font-size: var(--fs-13); color: #fff; font-weight: 500; line-height: 1.3; }
.nav-user .nu-role { font-size: 11px; color: rgba(255,255,255,.5); }

.app-topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0; height: var(--topbar-h); z-index: 90;
  background: var(--c-surface); border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
}
.app-topbar .tb-title { font-size: var(--fs-16); font-weight: 600; }
.app-topbar .tb-right { display: flex; align-items: center; gap: 6px; }
.tb-tenant { display: flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: var(--r-pill); background: var(--c-bg); font-size: var(--fs-12); color: var(--c-text-sub); margin-right: 6px; }

.app-main { margin-left: var(--sidebar-w); padding-top: var(--topbar-h); min-height: 100vh; }
.page-body { padding: var(--content-pad); max-width: 1440px; margin: 0 auto; }

/* 下拉菜单 */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 180px; z-index: 500;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-md); padding: 6px; display: none; animation: fadeUp .18s var(--ease);
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-md); font-size: var(--fs-13); color: var(--c-text); cursor: pointer; }
.dropdown-item:hover { background: var(--c-bg); }
.dropdown-item svg { width: 16px; height: 16px; color: var(--c-text-ter); }
.dropdown-divider { height: 1px; background: var(--c-border); margin: 6px 0; }

/* ---------- 12. 登录页 ---------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(22,119,255,.18), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(22,119,255,.12), transparent 55%),
    linear-gradient(180deg, #eef4fd 0%, #f5f7fa 100%);
  padding: 24px;
}
.login-shell { width: 100%; max-width: 420px; }
.login-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 28px; }
.login-logo .ll-icon { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, #2f88ff, #1677ff); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(22,119,255,.35); margin-bottom: 16px; }
.login-logo .ll-icon svg { width: 30px; height: 30px; }
.login-logo h1 { font-size: var(--fs-20); font-weight: 700; color: var(--c-text); }
.login-logo p { font-size: var(--fs-13); color: var(--c-text-ter); margin-top: 4px; }
.login-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: 32px; }
.login-role { display: flex; gap: 8px; margin-bottom: 20px; background: var(--c-surface-2); padding: 4px; border-radius: var(--r-lg); }
.login-role button { flex: 1; height: 34px; border: none; background: transparent; border-radius: var(--r-md); font-size: var(--fs-13); color: var(--c-text-sub); transition: all var(--dur-fast) var(--ease); }
.login-role button.active { background: var(--c-surface); color: var(--c-primary); font-weight: 600; box-shadow: var(--shadow-sm); }
.login-foot { margin-top: 20px; text-align: center; font-size: var(--fs-12); color: var(--c-text-ter); }

/* ---------- 13. 项目列表 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { padding: 18px 20px; }
.stat-card .sc-label { font-size: var(--fs-13); color: var(--c-text-sub); }
.stat-card .sc-value { font-size: var(--fs-32); font-weight: 700; margin: 6px 0 2px; line-height: 1.1; }
.stat-card .sc-trend { font-size: var(--fs-12); color: var(--c-text-ter); display: flex; align-items: center; gap: 4px; }
.stat-card .sc-icon { width: 44px; height: 44px; border-radius: var(--r-lg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-card .sc-icon svg { width: 22px; height: 22px; }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .search-box { position: relative; width: 300px; }
.toolbar .search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--c-text-ter); }
.toolbar .search-box .input { padding-left: 34px; }

/* ---------- 14. 立项向导 ---------- */
.stepper { display: flex; align-items: center; max-width: 720px; margin: 0 auto 28px; }
.step { display: flex; align-items: center; gap: 8px; flex: 1; }
.step:last-child { flex: 0; }
.step-dot { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: var(--fs-13); font-weight: 600; background: var(--c-bg); color: var(--c-text-ter); border: 2px solid var(--c-border); transition: all var(--dur) var(--ease); flex-shrink: 0; }
.step.active .step-dot { background: var(--c-primary); color: #fff; border-color: var(--c-primary); box-shadow: 0 4px 12px rgba(22,119,255,.3); }
.step.done .step-dot { background: var(--c-success); color: #fff; border-color: var(--c-success); }
.step-label { font-size: var(--fs-13); color: var(--c-text-ter); white-space: nowrap; }
.step.active .step-label { color: var(--c-text); font-weight: 600; }
.step.done .step-label { color: var(--c-text-sub); }
.step-line { flex: 1; height: 2px; background: var(--c-border); margin: 0 12px; }
.step-line.done { background: var(--c-success); }

.wizard-card { max-width: 880px; margin: 0 auto; }

/* 上传区 */
.upload-zone {
  border: 2px dashed var(--c-border-strong); border-radius: var(--r-xl);
  padding: 36px 24px; text-align: center; cursor: pointer; transition: all var(--dur) var(--ease);
  background: var(--c-surface-2);
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--c-primary); background: var(--c-primary-bg); }
.upload-zone .uz-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--c-primary-bg); color: var(--c-primary); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.upload-zone .uz-icon svg { width: 26px; height: 26px; }
.upload-zone .uz-title { font-size: var(--fs-14); font-weight: 500; color: var(--c-text); }
.upload-zone .uz-sub { font-size: var(--fs-12); color: var(--c-text-ter); margin-top: 4px; }

.file-chip { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--c-border); border-radius: var(--r-lg); background: var(--c-surface); }
.file-chip .fc-icon { width: 36px; height: 36px; border-radius: var(--r-md); background: var(--c-success-bg); color: var(--c-success); display: flex; align-items: center; justify-content: center; }
.file-chip .fc-icon svg { width: 18px; height: 18px; }
.file-chip .fc-name { font-size: var(--fs-13); font-weight: 500; }
.file-chip .fc-meta { font-size: var(--fs-12); color: var(--c-text-ter); }

.parse-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-lg); background: var(--c-success-bg); border: 1px solid var(--c-success-border); color: #0d6e2f; font-size: var(--fs-13); }
.parse-banner svg { width: 16px; height: 16px; }

.wizard-ft { display: flex; align-items: center; justify-content: space-between; padding-top: 20px; margin-top: 24px; border-top: 1px solid var(--c-border); }

/* 模板卡片 */
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tpl-card { position: relative; padding: 16px; border: 1px solid var(--c-border); border-radius: var(--r-lg); cursor: pointer; transition: all var(--dur-fast) var(--ease); background: var(--c-surface); }
.tpl-card:hover { border-color: var(--c-primary-border); box-shadow: var(--shadow-md); }
.tpl-card.is-checked { border-color: var(--c-primary); background: var(--c-primary-bg); box-shadow: 0 0 0 1px var(--c-primary); }
.tpl-card .tc-badge { position: absolute; top: 12px; right: 12px; }
.tpl-card .tc-check { position: absolute; top: 12px; left: 12px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--c-border-strong); display: flex; align-items: center; justify-content: center; color: transparent; background: #fff; }
.tpl-card.is-checked .tc-check { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.tpl-card .tc-check svg { width: 13px; height: 13px; }
.tpl-card .tc-name { font-size: var(--fs-14); font-weight: 600; margin-bottom: 6px; padding-left: 26px; line-height: 1.4; }
.tpl-card .tc-meta { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 26px; }

/* ---------- 15. 资产库 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--c-border); margin-bottom: 20px; }
.tab { display: flex; align-items: center; gap: 6px; padding: 10px 16px; font-size: var(--fs-14); color: var(--c-text-sub); border: none; background: transparent; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all var(--dur-fast) var(--ease); }
.tab:hover { color: var(--c-primary); }
.tab.active { color: var(--c-primary); font-weight: 600; border-bottom-color: var(--c-primary); }
.tab svg { width: 16px; height: 16px; }

/* ---------- 16. 工作台（左：项目档案 + 章节目录 / 右：多标签文档区） ---------- */
.workbench { display: flex; height: 100vh; overflow: hidden; }

/* 左栏 */
.wb-left { width: 300px; flex-shrink: 0; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.wb-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-xl); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; min-height: 0; }
.wb-card-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--c-border); flex-shrink: 0; }
.wb-card-hd .hd-title { display: flex; align-items: center; gap: 6px; font-size: var(--fs-14); font-weight: 600; }

/* 项目档案卡 */
.profile-card { flex-shrink: 0; padding: 16px; }
.profile-eyebrow { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.profile-eyebrow .pe-text { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 1.2px; color: var(--c-text-ter); }
.profile-name { margin-bottom: 14px; font-size: 19px; font-weight: 700; line-height: 1.35; color: var(--c-text); }
.profile-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-bottom: 16px; }
.pm-label { margin-bottom: 2px; font-size: 11px; color: var(--c-text-ter); }
.pm-value { font-size: var(--fs-13); font-weight: 500; color: var(--c-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-actions { display: flex; gap: 8px; }
.profile-actions .btn { flex: 1; min-width: 0; }

/* 章节目录 */
.toc-card { flex: 1; min-height: 0; }
.toc-bd { flex: 1; overflow-y: auto; padding: 8px; }
.toc-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-lg); cursor: pointer; transition: background var(--dur-fast) var(--ease); }
.toc-item:hover { background: var(--c-surface-2); }
.toc-item.active { background: var(--c-primary-bg); }
.toc-idx { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: var(--r-md); background: var(--c-bg); color: var(--c-text-ter); font-size: var(--fs-12); font-weight: 600; transition: all var(--dur-fast) var(--ease); }
.toc-item.active .toc-idx { background: var(--c-primary); color: #fff; }
.toc-title { flex: 1; min-width: 0; font-size: var(--fs-13); color: var(--c-text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toc-item.active .toc-title { color: var(--c-primary); font-weight: 600; }

/* 右栏 */
.wb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--c-bg); padding: 16px; }
.wb-tabbar { display: flex; align-items: center; gap: 2px; height: 56px; padding: 0 20px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-xl) var(--r-xl) 0 0; flex-shrink: 0; }
.wb-tab { display: inline-flex; align-items: center; gap: 6px; height: 56px; padding: 0 12px; font-size: var(--fs-14); color: var(--c-text-sub); background: transparent; border: none; border-bottom: 2px solid transparent; transition: all var(--dur-fast) var(--ease); white-space: nowrap; }
.wb-tab svg { width: 16px; height: 16px; }
.wb-tab:hover { color: var(--c-primary); }
.wb-tab.active { color: var(--c-primary); font-weight: 600; border-bottom-color: var(--c-primary); }
.tabbar-spacer { flex: 1; }

.wb-stage { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 20px 24px 28px; background: var(--c-surface); border: 1px solid var(--c-border); border-top: none; border-radius: 0 0 var(--r-xl) var(--r-xl); }

/* 文档头（面包屑 + 章标题 + 操作） */
.wb-dochead { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.wb-dochead .dh-left { flex: 1; min-width: 0; }
.dh-crumb { margin-bottom: 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 1.2px; color: var(--c-text-ter); }
.dh-title { font-size: var(--fs-24); font-weight: 700; line-height: 1.3; color: var(--c-text); }
.wb-dochead .dh-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* 文档预览纸张 */
.doc-preview { position: relative; min-height: 480px; padding: 44px 52px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-xl); box-shadow: var(--shadow-sm); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.doc-preview.is-editing { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(22, 119, 255, .12); }
.doc-preview .dp-title { margin-bottom: 26px; padding-bottom: 16px; border-bottom: 2px solid #1f2933; font-family: var(--font-doc); font-size: 26px; font-weight: 700; color: #111; }

.doc-editbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 9px 14px; background: var(--c-primary-bg); border: 1px solid var(--c-primary-border); border-radius: var(--r-lg); font-size: var(--fs-13); color: var(--c-text-sub); }

/* 文档正文（编辑态与预览态共用） */
.doc-content { font-family: var(--font-doc); font-size: 15px; line-height: 2; color: #262626; }
.doc-content:focus { outline: none; }
.doc-content p { margin-bottom: 8px; }
.doc-content .doc-h { font-family: var(--font-ui); font-weight: 600; color: #000; font-size: var(--fs-18); margin: 20px 0 10px; }
.doc-content ol { list-style: decimal; padding-left: 24px; }
.doc-content ul { list-style: disc; padding-left: 24px; }
.doc-content table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.doc-content table th, .doc-content table td { border: 1px solid #000; padding: 6px 10px; text-align: left; }
.doc-content table th { background: #f0f3f7; font-family: var(--font-ui); }

/* 面板通用区块 */
.wb-block { margin-bottom: 16px; padding: 18px 20px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-xl); box-shadow: var(--shadow-sm); }
.wb-block-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.wb-block-title { display: flex; align-items: center; gap: 8px; font-size: var(--fs-15); font-weight: 600; }
.wb-block-title svg { width: 17px; height: 17px; color: var(--c-primary); }

/* 项目档案信息栅格 */
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.info-item { padding: 12px 14px; background: var(--c-surface-2); border-radius: var(--r-lg); }
.ii-label { margin-bottom: 4px; font-size: 11px; color: var(--c-text-ter); }
.ii-value { font-size: var(--fs-14); font-weight: 500; color: var(--c-text); }

/* 生成日志时间轴 */
.log-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--c-border); }
.log-item:last-child { border-bottom: none; padding-bottom: 0; }
.log-ico { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: var(--r-md); }
.log-ico svg { width: 15px; height: 15px; }
.log-ico.t-ai { background: var(--c-primary-bg); color: var(--c-primary); }
.log-ico.t-edit { background: var(--c-warning-bg); color: var(--c-warning); }
.log-ico.t-audit { background: var(--c-danger-bg); color: var(--c-danger); }
.log-ico.t-system { background: var(--c-surface-2); color: var(--c-text-sub); }
.log-ico.t-export { background: var(--c-success-bg); color: var(--c-success); }
.log-main { flex: 1; min-width: 0; }
.log-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; flex-wrap: wrap; }
.log-action { font-size: var(--fs-13); font-weight: 600; }
.log-target { font-size: var(--fs-13); color: var(--c-text-sub); }
.log-note { font-size: var(--fs-12); color: var(--c-text-ter); line-height: 1.7; }
.log-time { flex-shrink: 0; font-family: var(--font-mono); font-size: 11px; color: var(--c-text-ter); white-space: nowrap; }

/* 知识参考卡片 */
.ref-card { margin-bottom: 10px; padding: 14px 16px; border: 1px solid var(--c-border); border-radius: var(--r-lg); transition: all var(--dur-fast) var(--ease); }
.ref-card:hover { border-color: var(--c-primary-border); box-shadow: var(--shadow-sm); }
.ref-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ref-title { font-size: var(--fs-13); font-weight: 600; line-height: 1.5; }
.ref-snippet { margin-top: 8px; padding: 8px 12px; border-left: 3px solid var(--c-border-strong); border-radius: 0 var(--r-md) var(--r-md) 0; background: var(--c-surface-2); font-family: var(--font-doc); font-size: var(--fs-13); line-height: 1.9; color: var(--c-text-sub); }
.relevance { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--c-text-ter); white-space: nowrap; }
.relevance .rv-bar { width: 44px; height: 4px; border-radius: 2px; background: var(--c-border); overflow: hidden; }
.relevance .rv-bar span { display: block; height: 100%; background: var(--c-primary); }

/* 版本管理 */
.ver-item { display: flex; gap: 12px; margin-bottom: 10px; padding: 14px; border: 1px solid var(--c-border); border-radius: var(--r-lg); transition: all var(--dur-fast) var(--ease); }
.ver-item.current { border-color: var(--c-primary); background: var(--c-primary-bg); }
.ver-version { font-family: var(--font-mono); font-size: var(--fs-14); font-weight: 700; }
.ver-item .ver-main { flex: 1; min-width: 0; }

/* 占位符清单 */
.ph-group-title { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; font-size: var(--fs-13); font-weight: 600; color: var(--c-text-sub); }
.ph-item { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; padding: 11px 14px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); }
.ph-item.todo { border-color: var(--c-warning-border); background: #fffbf5; }
.ph-item .ph-main { flex: 1; min-width: 0; }
.ph-item .ph-label { font-size: var(--fs-13); font-weight: 500; }
.ph-key { font-family: var(--font-mono); font-size: 11px; color: var(--c-text-ter); }
.ph-item .input { max-width: 260px; }

/* 变量标签：已填充（蓝） */
.var-tag {
  display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--c-primary-bg);
  color: var(--c-primary); font-family: var(--font-ui); font-size: 13px; font-weight: 500;
  border-bottom: 1px dashed var(--c-primary-border); cursor: pointer; line-height: 1.7; margin: 0 2px;
}
.var-tag:hover { background: var(--c-primary-bg-hover); }

/* 变量标签：待填充（琥珀） */
.var-tag-todo {
  display: inline-block; padding: 0 8px; border-radius: 6px; background: var(--c-warning-bg);
  color: #b25e00; font-family: var(--font-ui); font-size: 14px; font-weight: 500;
  border: 1px solid var(--c-warning-border); cursor: pointer; line-height: 1.7; margin: 0 2px;
}
.var-tag-todo:hover { background: #ffe7ba; }

/* 右侧变量面板 */
.var-row { padding: 12px; border: 1px solid var(--c-border); border-radius: var(--r-lg); margin-bottom: 10px; transition: border-color var(--dur-fast) var(--ease); }
.var-row:hover { border-color: var(--c-primary-border); }
.var-row .vr-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.var-row .vr-key { font-family: var(--font-mono); font-size: 11px; color: var(--c-text-ter); }
.var-row .vr-label { font-size: var(--fs-13); font-weight: 500; }
.var-row input { height: 32px; font-size: var(--fs-13); }

/* 审查结果 */
.issue-card { padding: 12px 14px; border: 1px solid var(--c-border); border-radius: var(--r-lg); margin-bottom: 10px; cursor: pointer; transition: all var(--dur-fast) var(--ease); background: var(--c-surface); }
.issue-card:hover { box-shadow: var(--shadow-sm); }
.issue-card.active { border-color: var(--c-primary); box-shadow: 0 0 0 1px var(--c-primary); }
.issue-card.is-fixed { opacity: .55; }
.issue-card .ic-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.issue-card .ic-cat { font-size: var(--fs-12); font-weight: 600; color: var(--c-text); }
.issue-card .ic-snippet { font-family: var(--font-doc); font-size: var(--fs-12); background: var(--c-danger-bg); color: var(--c-danger); padding: 2px 6px; border-radius: 4px; margin: 6px 0; display: inline-block; }
.issue-card .ic-desc { font-size: var(--fs-12); color: var(--c-text-sub); line-height: 1.6; }
.issue-card .ic-ft { display: flex; gap: 8px; margin-top: 10px; }

/* 历史比对 */
.diff-block { border: 1px solid var(--c-border); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 12px; }
.diff-block .db-hd { padding: 8px 12px; font-size: var(--fs-12); font-weight: 600; color: var(--c-text-sub); background: var(--c-surface-2); border-bottom: 1px solid var(--c-border); }
.diff-block .db-bd { padding: 10px 12px; font-size: var(--fs-13); font-family: var(--font-doc); line-height: 1.8; color: var(--c-text); }
.diff-block.del .db-bd { background: var(--c-danger-bg); }
.diff-block.del .db-bd del { color: var(--c-danger); }
.diff-block.ins .db-bd { background: var(--c-success-bg); }
.diff-block.ins .db-bd ins { color: var(--c-success); text-decoration: none; }

/* 高亮问题段落 */
.hl-issue { background: var(--c-warning-bg); border-radius: 3px; padding: 0 2px; box-shadow: 0 0 0 2px var(--c-warning); }
.hl-issue-high { background: var(--c-danger-bg); box-shadow: 0 0 0 2px var(--c-danger); }

/* 工作台顶栏（独立头） */
.wb-header { height: var(--topbar-h); background: var(--c-surface); border-bottom: 1px solid var(--c-border); display: flex; align-items: center; gap: 12px; padding: 0 16px; flex-shrink: 0; }
.wb-header .wh-title { font-size: var(--fs-15); font-weight: 600; }
.wb-header .wh-save { font-size: var(--fs-12); color: var(--c-text-ter); display: flex; align-items: center; gap: 4px; }

/* ---------- 17. 响应式 ---------- */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .tpl-grid { grid-template-columns: repeat(2, 1fr); }
  .wb-left { width: 252px; }
  .profile-meta { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 64px; }
  .app-brand .brand-name, .app-brand .brand-sub, .nav-section, .nav-item span.nav-label, .nav-user .nu-name, .nav-user .nu-role { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-user { justify-content: center; }
  .stat-grid { grid-template-columns: 1fr; }
  .tpl-grid { grid-template-columns: 1fr; }
  .wb-left { display: none; }
  .wb-tabbar { padding: 0 12px; overflow-x: auto; }
  .wb-stage { padding: 14px; }
  .doc-preview { padding: 24px 20px; }
  .wb-dochead { flex-direction: column; align-items: stretch; gap: 10px; }
  .info-grid { grid-template-columns: 1fr; }
  .toolbar .search-box { width: 100%; }
}
@media (max-width: 480px) {
  .page-body { padding: 12px; }
  .login-card { padding: 22px; }
}

/* ---------- 18. 工作台增强：新增章节弹窗 / 占位符汇总 / 章节编辑器 ---------- */

/* --- 18.1 新增章节弹窗 --- */
.cs-modal { width: 620px; }
.cs-hd { align-items: flex-start; padding: 22px 26px 18px; border-bottom: none; }
.cs-eyebrow { margin-bottom: 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 1.4px; color: var(--c-text-ter); }
.cs-title { font-size: var(--fs-24); font-weight: 700; line-height: 1.25; }
.cs-bd { padding: 0 26px 22px; }
.cs-panel { padding: 16px; border: 1px solid var(--c-border); border-radius: var(--r-lg); background: var(--c-surface); }
.cs-row2 { display: grid; grid-template-columns: 200px 1fr; gap: 16px; margin: 18px 0; }
.cs-file { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 38px; margin-top: 10px; }
.cs-file-name { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: var(--fs-12); color: var(--c-success); }
.cs-ft { border-top: none; padding-top: 0; }

/* --- 18.2 占位符汇总面板 --- */
.wb-stage.is-ph { display: flex; flex-direction: column; overflow: hidden; }
.wb-stage.is-ph #stagePanel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wb-stage.is-ph .ph-panel { flex: 1; }
.ph-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-xl); box-shadow: var(--shadow-sm); overflow: hidden; }
.ph-panel-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--c-border); flex-shrink: 0; }
.ph-eyebrow { margin-bottom: 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 1.4px; color: var(--c-text-ter); }
.ph-headline { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; font-size: var(--fs-20); font-weight: 700; }
.ph-stats { font-size: var(--fs-13); font-weight: 400; color: var(--c-text-sub); }
.ph-hd-actions { display: flex; gap: 8px; flex-shrink: 0; }
.ph-list { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 22px; }
.ph-card { margin-bottom: 12px; padding: 14px 16px; border: 1px solid var(--c-border); border-radius: var(--r-lg); background: var(--c-surface); transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.ph-card:last-child { margin-bottom: 0; }
.ph-card:hover { border-color: var(--c-primary-border); box-shadow: var(--shadow-sm); }
.ph-card-top { display: flex; align-items: center; gap: 12px; }
.ph-chip { flex-shrink: 0; padding: 2px 8px; font-family: var(--font-mono); font-size: var(--fs-12); color: var(--c-text-sub); background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--r-sm); }
.ph-occur { flex: 1; min-width: 0; font-size: var(--fs-13); color: var(--c-text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-card-body { margin-top: 12px; }
.ph-value { padding: 9px 12px; font-size: var(--fs-14); color: #0d6e2f; background: var(--c-success-bg); border-radius: var(--r-md); }
.ph-fill { display: flex; gap: 10px; }
.ph-fill .input { flex: 1; }

/* --- 18.3 章节编辑器（三栏） --- */
.wb-tabbar.is-hidden { display: none; }
.wb-stage.is-editing { display: flex; flex-direction: column; padding: 0; overflow: hidden; background: transparent; border: none; border-radius: 0; }
.wb-stage.is-editing #stageEditor { flex: 1; min-height: 0; }
.ed-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-xl); box-shadow: var(--shadow-sm); overflow: hidden; }

.ed-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; row-gap: 8px; padding: 12px 20px; background: var(--c-surface); border-bottom: 1px solid var(--c-border); flex-shrink: 0; }
.ed-idx { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: var(--r-md); background: var(--c-primary-bg); color: var(--c-primary); font-size: var(--fs-12); font-weight: 600; }
.ed-title { min-width: 0; font-size: var(--fs-16); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ed-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; row-gap: 4px; padding: 6px 10px; background: var(--c-surface); border-bottom: 1px solid var(--c-border); flex-shrink: 0; }
.ed-tool { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 30px; min-width: 30px; padding: 0 8px; font-size: var(--fs-13); color: var(--c-text-sub); background: transparent; border: 1px solid transparent; border-radius: var(--r-md); transition: all var(--dur-fast) var(--ease); }
.ed-tool:hover { color: var(--c-text); background: var(--c-bg); }
.ed-tool.is-mono { font-family: var(--font-mono); font-weight: 600; }
.ed-tool.is-italic { font-style: italic; font-weight: 600; }
.ed-tool svg { width: 15px; height: 15px; }
.ed-sep { width: 1px; height: 18px; margin: 0 6px; background: var(--c-border); }

.ed-body { flex: 1; min-height: 0; display: flex; }
.ed-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ed-pane { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--c-surface); }
.ed-pane-hd { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: var(--fs-12); color: var(--c-text-ter); background: var(--c-surface-2); border-bottom: 1px solid var(--c-border); flex-shrink: 0; }
.ed-editor { flex: 1; min-width: 0; min-height: 0; padding: 22px 26px 32px; overflow-y: auto; outline: none; background: var(--c-surface); font-family: var(--font-doc); font-size: 15px; line-height: 2; color: #262626; }
.ed-editor:empty::before { content: '在此输入章节正文…'; color: var(--c-text-ter); }
.ed-editor p { margin-bottom: 8px; }
.ed-editor h3 { font-family: var(--font-ui); font-weight: 600; color: #000; font-size: var(--fs-18); margin: 20px 0 10px; }
.ed-editor ol { list-style: decimal; padding-left: 24px; }
.ed-editor ul { list-style: disc; padding-left: 24px; }
.ed-editor table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.ed-editor table th, .ed-editor table td { border: 1px solid #000; padding: 6px 10px; text-align: left; }
.ed-editor table th { background: #f0f3f7; font-family: var(--font-ui); }

.ed-right { flex-shrink: 0; width: 272px; display: flex; flex-direction: column; min-height: 0; background: var(--c-surface-2); border-left: 1px solid var(--c-border); }
.ed-right-bd { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ed-card { padding: 12px 14px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); }
.ed-card-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ed-card-title { font-size: var(--fs-13); font-weight: 600; }
.ed-link { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-12); color: var(--c-primary); cursor: pointer; }
.ed-link:hover { color: var(--c-primary-hover); }
.ed-link svg { width: 13px; height: 13px; }
.ed-prop { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: var(--fs-12); }
.ed-prop .k { flex-shrink: 0; color: var(--c-text-ter); }
.ed-prop .v { min-width: 0; font-family: var(--font-mono); font-size: 11px; color: var(--c-text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-foot { display: none; }

.ec-ph { padding: 9px 10px; margin-bottom: 8px; border: 1px solid var(--c-border); border-radius: var(--r-md); }
.ec-ph:last-child { margin-bottom: 0; }
.ec-ph-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.ec-ph-chip { padding: 1px 6px; font-family: var(--font-mono); font-size: 11px; color: var(--c-text-sub); background: var(--c-surface-2); border-radius: var(--r-sm); }
.ec-ph-state { flex-shrink: 0; font-size: 10px; color: var(--c-text-ter); white-space: nowrap; }
.ec-ph-state.ok { color: var(--c-success); }
.ec-ph-val { padding: 5px 8px; font-size: var(--fs-12); color: #0d6e2f; background: var(--c-success-bg); border-radius: var(--r-sm); }
.ec-ph-fill { display: flex; gap: 6px; }
.ec-ph-fill .input { height: 28px; font-size: var(--fs-12); }
.ec-hist { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--c-border); }
.ec-hist:last-child { border-bottom: none; padding-bottom: 0; }
.ec-hist .eh-main { flex: 1; min-width: 0; }
.ec-hist .eh-time { font-family: var(--font-mono); font-size: 11px; color: var(--c-text-ter); }
.ec-hist .eh-note { font-size: 11px; color: var(--c-text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ed-statusbar { display: flex; align-items: center; gap: 10px; padding: 9px 16px; background: var(--c-surface); border-top: 1px solid var(--c-border); font-size: var(--fs-12); color: var(--c-text-sub); flex-shrink: 0; }
.ed-statusbar .dot-on { width: 7px; height: 7px; border-radius: 50%; background: var(--c-success); flex-shrink: 0; }

@media (max-width: 1440px) {
  .ed-right { width: 244px; }
}
@media (max-width: 1200px) {
  .ed-right { width: 232px; }
}
@media (max-width: 900px) {
  .ed-right { display: none; }
  .cs-modal { width: calc(100vw - 32px); }
  .cs-row2 { grid-template-columns: 1fr; }
  .ph-panel-hd { flex-direction: column; }
}
