/* ============ 主题变量 ============ */
:root {
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --accent: #7C3AED;
  --success: #10B981;
  --danger: #EF4444;
  --text: #374151;
  --text-light: #6B7280;
  --bg: #F9FAFB;
  --card-bg: #FFFFFF;
  --border: #E5E7EB;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: system-ui, "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--text-light); }
.small { font-size: .85em; }
.mt { margin-top: 16px; }
.hidden { display: none !important; }
.text-danger { color: var(--danger); font-weight: 600; }
.text-success { color: var(--success); font-weight: 600; }
.center { text-align: center; }
a { color: var(--primary); text-decoration: none; }

/* ============ 导航 ============ */
.nav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
/* 官网首页（bid_base）顶部导航加高 1/2：64 → 96 */
.nav-home .nav-inner { height: 96px; }
.logo { font-size: 20px; font-weight: 700; color: var(--primary); }
.logo-badge {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 12px; padding: 1px 6px; border-radius: 6px; margin-left: 2px;
}
/* 官网品牌：logo 图片 + 名称（字号参考 xiaoxiaoai.cn 顶部） */
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-logo { height: 51px; width: 51px; object-fit: cover; border-radius: 10px; display: block; }
.brand-name { font-size: 18px; font-weight: 700; color: #1f2937; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 17px; }
.nav-links > a { color: #303133; font-weight: 400; text-decoration: none; transition: color .2s; }
.nav-links > a:hover { color: #3b82f6; }
.nav-links > .nav-login { font-size: 14px; font-weight: 500; color: #286AFF; }
.nav-user { color: var(--text-light); }
/* 登录用户：昵称悬停滑出退出（与巡标网首页一致） */
.nav .user-menu { position: relative; font-size: 14px; display: flex; align-items: center; }
.nav .user-menu::after {
  content: ''; position: absolute; top: 100%; left: 0; right: 0; height: 10px;
}
.nav .user-name {
  color: #3b82f6; font-weight: 500; cursor: default; white-space: nowrap;
  padding: 2px 8px; line-height: 1.6; font-size: 15px;
}
.nav-links .badge-quota { font-size: 14px; }
.nav .user-dropdown {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
  padding: 6px; min-width: 116px; z-index: 100;
  opacity: 0; visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.nav .user-menu:hover .user-dropdown,
.nav .user-menu.hover .user-dropdown,
.nav .user-menu:focus-within .user-dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav .user-dropdown form { margin: 0; }
.nav .user-settings-link {
  display: block; width: 100%; box-sizing: border-box;
  padding: 8px 12px; border-radius: 6px;
  font-size: 14px; color: #475569; text-align: center;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav .user-settings-link:hover { background: #f1f5f9; color: #1e293b; }
/* 桥接触发元素与下拉菜单之间的间隙，鼠标下移过程菜单不消失 */
.nav .user-dropdown::before {
  content: ""; position: absolute; top: -6px; left: 0; right: 0; height: 6px;
}
.nav .user-logout-btn {
  width: 100%; border: 0; background: transparent; cursor: pointer;
  padding: 8px 12px; border-radius: 6px;
  font-size: 14px; color: #475569; text-align: center;
  transition: background .15s, color .15s;
}
.nav .user-logout-btn:hover { background: #fef2f2; color: #dc2626; }
.nav-burger { display: none; cursor: pointer; font-size: 22px; }
.nav-toggle { display: none; }
.inline-form { display: inline; }
.row-actions { display: flex; gap: 8px; align-items: center; }
.btn-danger-text { color: #B91C1C; }
.btn-danger-text:hover { color: #991B1B; background: #FEF2F2; }

/* ============ 居中确认弹窗（删除项目等）============ */
.confirm-mask {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(17, 24, 39, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.confirm-mask.hidden { display: none; }
.confirm-box {
  width: 100%; max-width: 520px;
  background: #fff; border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  padding: 30px 34px 22px;
}
.confirm-body { font-size: 15px; color: #1F2937; line-height: 1.9; }
.confirm-line1 { margin: 0 0 6px; font-size: 17px; font-weight: 600; color: #111827; }
.confirm-line2 { margin: 0; color: #4B5563; }
.confirm-foot { display: flex; justify-content: flex-end; margin-top: 22px; }
.confirm-foot form { display: flex; gap: 14px; margin: 0; }
.confirm-btn {
  min-width: 108px; padding: 10px 28px;
  border-radius: 999px; font-size: 15px; font-weight: 600;
  cursor: pointer; border: 2px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.confirm-btn-ok {
  background: #3B4FB8; color: #fff; border-color: #3B4FB8;
}
.confirm-btn-ok:hover { background: #33469F; border-color: #33469F; }
.confirm-btn-cancel {
  background: #DCE7FB; color: #2B3A8C; border-color: #DCE7FB;
}
.confirm-btn-cancel:hover { background: #CBD9F8; border-color: #CBD9F8; }

/* ============ 按钮 ============ */
.btn {
  display: inline-block; padding: 9px 20px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer; font-size: 15px;
  font-weight: 500; text-align: center; transition: all .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .35; pointer-events: none; cursor: not-allowed; }
.btn-light { background: #fff; color: var(--primary); }
.btn-ghost { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-ghost:hover { background: rgba(79, 70, 229, .08); }
.btn-lg { padding: 13px 34px; font-size: 17px; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-xs { padding: 2px 8px; font-size: 12px; border-radius: 4px; }
.btn-block { display: block; width: 100%; }
.btn-row { display: flex; gap: 12px; margin-top: 14px; }

/* ============ 徽标 ============ */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: #EEF2FF; color: var(--primary); font-size: 13px;
}
.badge-quota { background: #ECFDF5; color: var(--success); }
.badge-status { background: #FEF3C7; color: #B45309; }

/* ============ 提示 ============ */
.messages { margin-top: 14px; }
/* 错误/警告消息全部走弹窗后，横幅容器可能为空，避免占位 */
.messages:empty, .app-messages:empty { display: none; }
.alert { padding: 10px 16px; border-radius: 8px; margin-bottom: 8px; font-size: 14px; }
.alert-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-error, .alert-warning { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }

/* ============ Hero（与巡标网首页 banner 一致） ============ */
.hero {
  background: linear-gradient(90deg, #4da6ff 0%, #1a73e8 50%, #0d47a1 100%);
  padding: 40px 0;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-inner {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}
/* 标题前空一行（一个行高） */
.hero-gap { height: 1.6em; }
.hero h1 { font-size: 23px; font-weight: 500; line-height: 1.6; margin: 0; }
.hero-sub { font-size: 17px; font-weight: 400; line-height: 1.7; margin: 8px 0 0; opacity: .9; }

/* ============ 卡片 ============ */
.card {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px; margin-bottom: 20px;
}
.card-title { font-size: 19px; margin-bottom: 14px; color: #111827; }
.sub-title { font-size: 16px; margin: 18px 0 10px; }

/* ============ 页面布局 ============ */
.page { padding: 34px 20px; }
.page.narrow { max-width: 620px; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.page-head h1 { font-size: 26px; }
.page-head.center { display: block; text-align: center; }
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; }
.section-alt { background: #fff; }

/* ============ 特性/步骤/评价 ============ */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature-card h3 { margin-bottom: 8px; color: #111827; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.step h4 { margin: 8px 0 4px; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 700;
}
.steps-compact { margin-bottom: 22px; }
.steps-compact .step { display: flex; align-items: center; gap: 8px; opacity: .55; }
.steps-compact .step.active { opacity: 1; font-weight: 600; color: var(--primary); }
.steps-compact .step-num { width: 26px; height: 26px; font-size: 14px; }

/* ============ 套餐 ============ */
.tabs { display: flex; gap: 10px; justify-content: center; margin-bottom: 24px; }
.tab {
  padding: 8px 24px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; font-size: 15px; color: var(--text-light);
}
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
/* ===== 套餐卡片（4 张一行，等宽自适应） ===== */
.pricing-grid { display: flex; gap: 16px; }
.price-card {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column;
  text-align: center; position: relative;
  padding: 30px 14px 18px; margin-bottom: 0;
  border: 2px solid transparent;
}
.price-card.featured { border-color: var(--primary); }
.price-card .price { margin-bottom: 14px; }
.price-card .btn-block { margin-top: auto; }
@media (max-width: 640px) {
  .pricing-grid { flex-wrap: wrap; gap: 12px; }
  .price-card { flex: 0 0 calc(50% - 6px); }
}
.ribbon {
  position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%);
  background: var(--danger); color: #fff; font-size: 12px;
  padding: 2px 14px; border-radius: 999px;
}
.tagline { color: var(--text-light); font-size: 14px; min-height: 40px; }
.word-count {
  margin: 14px 0 10px; display: flex; align-items: baseline;
  justify-content: center; gap: 2px; color: var(--primary);
}
.word-count .wc-num { font-size: 30px; font-weight: 800; line-height: 1; }
.word-count .wc-unit { font-size: 15px; font-weight: 600; }
.word-count.wc-unlimited {
  font-size: 18px; font-weight: 700; color: var(--primary);
  line-height: 30px;
}
.price-line { display: flex; align-items: center; justify-content: center; min-height: 38px; }
.price-now { font-size: 26px; font-weight: 700; color: var(--primary); }
.price-now.price-custom { font-size: 21px; }
.price-old { color: var(--text-light); text-decoration: line-through; margin-left: 6px; font-size: 14px; }
.discount-badge {
  display: block; width: fit-content; margin: 8px auto 0; padding: 1px 7px;
  background: #fff1f0; color: var(--danger);
  border: 1px solid #ffccc7; border-radius: 4px;
  font-size: 12px; font-weight: 600; line-height: 1.4;
}
.discount-placeholder {
  display: block; width: 1px; height: 21px; margin: 8px auto 0;
  border: 1px solid transparent;
}

/* ============ 表格 ============ */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table thead th { color: var(--text-light); font-weight: 600; background: var(--bg); }
.card-table { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-table thead th { background: var(--bg); }

/* ============ 表单 ============ */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
.help { color: var(--text-light); font-size: 13px; margin-top: 4px; }
.error { color: var(--danger); font-size: 13px; margin-top: 4px; }
.auth-wrap { display: flex; justify-content: center; padding: 60px 20px; }
.auth-card { width: 100%; max-width: 420px; }
.wechat-card { text-align: center; }
.wechat-card .field { text-align: left; }
.auth-title { text-align: center; margin-bottom: 6px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 14px; }

/* 重名昵称：候选手机号选择 */
.phone-pick { display: flex; flex-direction: column; gap: 8px; }
.phone-option {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border, #dcdfe6);
  border-radius: 8px; cursor: pointer; font-size: 15px;
  transition: border-color .15s, background .15s;
}
.phone-option:hover { border-color: var(--primary, #286aff); background: #f5f8ff; }
.phone-option input[type="radio"] { margin: 0; cursor: pointer; }
.phone-option:has(input:checked) {
  border-color: var(--primary, #286aff); background: #eef4ff;
  font-weight: 600;
}

.empty-state { text-align: center; padding: 50px; }

/* ============ 单选项（项目类型）============ */
.radio-inline { display: flex; gap: 14px; flex-wrap: wrap; }
.radio-item {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border: 1.5px solid var(--border); border-radius: 999px;
  background: #fff; cursor: pointer; font-size: 15px; font-weight: 500;
  color: var(--text); transition: all .15s; user-select: none;
}
.radio-item:hover { border-color: var(--primary); color: var(--primary); }
.radio-item input[type="radio"] {
  margin: 0; width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer;
}
.radio-item:has(input:checked) {
  border-color: var(--primary); background: #EEF2FF; color: var(--primary); font-weight: 600;
}

/* ============ 微信登录 ============ */
.btn-wechat { background: #07C160; color: #fff; }
.btn-wechat:hover { background: #06AD56; }
.login-divider { display: flex; align-items: center; margin: 16px 0; color: var(--text-light); font-size: 13px; }
.login-divider::before, .login-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.login-divider span { padding: 0 12px; }
.qrcode-box {
  position: relative; width: 200px; height: 200px; margin: 18px auto 10px;
  border: 1px solid var(--border); border-radius: 12px; padding: 10px;
}
.qrcode-svg { width: 100%; height: 100%; display: block; }
.qrcode-logo {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: #fff; border-radius: 8px; padding: 3px;
  box-shadow: 0 0 0 2px #fff;
}
.qrcode-tip { font-size: 15px; margin-bottom: 14px; }
.mock-tip {
  background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E;
  font-size: 13px; border-radius: 8px; padding: 8px 12px; margin-bottom: 16px; text-align: left;
}

/* ============ 正文预览 ============ */
.chapter { margin-bottom: 14px; }
/* 注意：summary 必须保持 display:list-item，否则 details 的折叠/展开会失效；
   内部圆点/徽标/文本均为 inline 元素，无需 flex */
.chapter-title {
  font-size: 17px; font-weight: 700; cursor: pointer; color: #111827;
  list-style: none; padding: 4px 6px; border-radius: 6px;
}
.chapter-title::-webkit-details-marker { display: none; }
.chapter-title > .otree-pick { margin-right: 4px; }
.chapter-title .muted, .chapter-title .otree-badge-attach { margin-left: 4px; }
.chapter-title:has(.otree-pick.sel),
.section-block h4:has(.otree-pick.sel) { background: #EEF2FF; }
.node-level-0 > .chapter-title { font-size: 18px; color: var(--primary-dark); }
.node-children { margin-left: 2em; border-left: 2px solid var(--border); padding-left: 1em; }
.ctree-body { min-width: 0; }
/* 叶子节点（无子章节）也可折叠：summary 与 .chapter-title 同理，
   必须保持 list-item 默认显示，不能设 flex，否则 details 折叠失效 */
.section-summary { cursor: pointer; list-style: none; }
.section-summary::-webkit-details-marker { display: none; }
.section-block h4 {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 4px 6px; border-radius: 6px;
}
.section-block-title { flex-shrink: 0; }

/* ============ 章节树编辑工具条：类型/字数/移动/拖拽 ============ */
.node-tools {
  display: inline-flex; align-items: center; gap: 2px;
  margin-left: 6px; flex-shrink: 0;
  opacity: .35; transition: opacity .12s;
}
.chapter-title:hover .node-tools,
.section-block h4:hover .node-tools,
.node-tools:focus-within { opacity: 1; }
.node-move-btn {
  border: none; background: transparent; cursor: pointer;
  font-size: 18px; line-height: 1; color: var(--text-light);
  padding: 3px 4px; border-radius: 4px;
}
.node-move-btn:hover { background: #E0E7FF; color: var(--primary); }
.node-move-btn:disabled { opacity: .5; cursor: default; }
.node-type-select {
  /* 技术文本/格式复制 切换下拉框：按要求不显示（新节点默认技术文本，
     后端切换接口保留，需要时去掉 display:none 即可恢复） */
  display: none;
  font-size: 14px; padding: 2px 4px; border: 1px solid var(--border);
  border-radius: 4px; background: var(--card-bg); color: var(--text);
  cursor: pointer; max-width: 96px;
}
.node-word-target {
  font-size: 16px; width: 64px; padding: 2px 4px;
  border: 1px solid var(--border); border-radius: 4px;
}
.node-word-target:focus { border-color: var(--primary); outline: none; }
/* 拖拽：拖动中半透明，按放置分区显示指示（上/下插入线、作为子节点虚线框） */
summary[draggable="true"] { cursor: grab; }
summary.dragging { opacity: .45; }
.drop-before { box-shadow: inset 0 2px 0 var(--primary); }
.drop-after { box-shadow: inset 0 -2px 0 var(--primary); }
.drop-child { outline: 2px dashed var(--primary); outline-offset: -2px; border-radius: 6px; }
.part-tag {
  display: inline-block; background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 4px;
  margin-right: 6px; vertical-align: 2px;
}
/* ============ 提纲树状结构 ============ */
.otree-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.otree-tools { display: flex; gap: 8px; }
ul.otree, ul.otree-children { list-style: none; margin: 0; padding: 0; }
ul.otree-children {
  margin-left: 10px; padding-left: 18px;
  border-left: 1.5px dashed var(--border);
}
.otree-node { position: relative; margin: 3px 0; }
.otree-label {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 8px; cursor: default;
  flex-wrap: wrap;
}
.otree-branch { cursor: pointer; }
.otree-branch:hover { background: #F3F5FF; }
.otree-leaf:hover { background: var(--bg); }
.otree-actions { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; margin-right: 4px; }
.otree-caret {
  width: 0; height: 0; flex-shrink: 0;
  border-left: 5px solid var(--text-light); border-top: 4px solid transparent;
  border-bottom: 4px solid transparent; transition: transform .15s;
}
details[open] > .otree-branch .otree-caret { transform: rotate(90deg); }
.otree-leaf-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: #C7D2FE; margin-left: 2px;
}
.otree-badge {
  flex-shrink: 0; font-size: 11px; font-weight: 600; line-height: 1;
  padding: 3px 7px; border-radius: 4px; letter-spacing: 1px;
}
.otree-badge-part { background: var(--primary); color: #fff; }
.otree-badge-chapter { background: #EEF2FF; color: var(--primary); }
.otree-badge-section { background: #F3F4F6; color: var(--text-light); letter-spacing: 0; }
.otree-badge-appendix { background: #DBEAFE; color: #1E40AF; letter-spacing: 0; }
.otree-title { font-weight: 600; font-size: 14.5px; color: #111827; }
.otree-leaf .otree-title { font-weight: 500; }
.otree-level-0 > details > .otree-branch .otree-title { font-size: 16px; }
.otree-count { margin-left: auto; }
.otree-words {
  margin-left: auto; flex-shrink: 0; font-size: 12px; color: var(--primary);
  background: #EEF2FF; padding: 2px 8px; border-radius: 999px;
}
.otree-req { font-weight: 400; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.otree-tag-no-content {
  margin-left: auto; flex-shrink: 0; font-size: 11px; color: #92400E;
  background: #FEF3C7; padding: 2px 8px; border-radius: 4px; font-weight: 600;
}
.otree-tag-appendix {
  margin-left: auto; flex-shrink: 0; font-size: 11px; color: #B91C1C;
  background: #FEE2E2; padding: 2px 8px; border-radius: 4px; font-weight: 600;
  cursor: help;
}
.otree-tag-generated {
  display: inline-block; margin-left: 6px;
  font-size: 11px; line-height: 1.6;
  padding: 1px 8px; border-radius: 10px;
  background: #ECFDF5; color: #059669;
  border: 1px solid #A7F3D0; font-weight: 600;
}
.otree-tag-pending {
  display: inline-block; margin-left: 6px;
  font-size: 11px; line-height: 1.6;
  padding: 1px 8px; border-radius: 10px;
  background: #FEF2F2; color: #DC2626;
  border: 1px solid #FECACA; font-weight: 600;
}

/* ============ 提纲树：左侧竖排操作栏 + 节点选择柄 ============ */
.otree-layout { display: flex; gap: 14px; align-items: flex-start; }
.otree-rail {
  flex-shrink: 0; width: 106px; position: sticky; top: 70px;
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 10px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff;
}
.otree-rail-title { font-size: 12px; color: var(--text-light); font-weight: 600; text-align: center; }
.otree-rail-form { margin: 0; }
.otree-rail-btn { width: 100%; }
.otree-rail-btn:disabled { opacity: .45; cursor: not-allowed; }
.otree-rail-btn-danger:not(:disabled) { color: var(--danger); border-color: var(--danger); }
.otree-rail-btn-danger:not(:disabled):hover { background: rgba(239, 68, 68, .08); }
.otree-rail-hint { font-size: 11px; color: var(--text-light); text-align: center; margin-top: 2px; line-height: 1.45; word-break: break-all; }
/* 选中节点移动箭头：左右一行、上下一行，操作栏统一控制 */
.otree-move-group { display: flex; flex-direction: column; gap: 6px; }
.otree-move-row { display: flex; gap: 6px; }
.otree-move-btn { flex: 1; min-width: 0; padding-left: 0; padding-right: 0; }
.otree-move-btn:disabled { opacity: .45; cursor: not-allowed; }
/* 章节行尾原有的 ↑↓←→ 箭头改由左侧操作栏统一操作，不再逐行显示 */
.node-tools .node-move-btn { display: none; }
.otree-rail-divider {
  width: 100%; margin: 4px 0; border: none; border-top: 2px solid #9CA3AF;
}
.otree-layout .otree { flex: 1; min-width: 0; }

/* 每行最左侧圆点选择柄 */
.otree-pick {
  display: inline-block; width: 16px; height: 16px; flex-shrink: 0;
  border: 1.5px solid #C7C9D1; border-radius: 50%; background: #fff;
  cursor: pointer; margin-right: 6px; transition: all .12s; vertical-align: middle;
  position: relative;
}
/* 扩大圆点命中区域：用 ::before 撑出一圈透明可点击区域，视觉大小不变 */
.otree-pick::before {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 28px; height: 28px; transform: translate(-50%, -50%);
}
.otree-pick:hover { border-color: var(--primary); background: #EEF2FF; }
.otree-pick.sel {
  border-color: var(--primary); background: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .18);
}
.otree-pick.sel::after {
  content: ""; display: block; width: 6px; height: 6px; margin: 3px auto;
  background: #fff; border-radius: 50%;
}
/* 双击章节标题行内改名输入框（标题本身沿用 summary 的 grab 抓手光标） */
.otree-rename-input {
  font: inherit; padding: 1px 6px; min-width: 12em; max-width: 100%;
  border: 1px solid var(--primary); border-radius: 4px; outline: none;
  cursor: text;
}
/* 选中节点行高亮（渐进增强，不支持 :has 的浏览器仅圆点变色） */
.otree-label:has(.otree-pick.sel) { background: #EEF2FF; border-radius: 6px; }

/* ============ 弹窗（预览/选择共用）============ */
.modal-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(17, 24, 39, .55); display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-mask.hidden { display: none; }
/* 全局提示弹窗（提示/确认/错误）须压过页面级弹窗（新建分类等），
   否则同为 z-index:1000 时按 DOM 顺序被后渲染的页面弹窗盖住 */
#alert-mask, #confirm-mask, #global-error-mask { z-index: 1200; }
.modal-box {
  width: 100%; max-width: 720px; max-height: 86vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.2); overflow: hidden;
}
/* 新建分类弹窗（证书/知识库/资料表格三页共用 #kb-new-mask）：宽度缩小 1/5 */
#kb-new-mask .modal-box { max-width: 576px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-title { font-weight: 600; font-size: 16px; color: #111827; }
.modal-close { border: none; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; color: var(--text-light); padding: 0 6px; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 16px 18px; overflow-y: auto; overflow-x: hidden; flex: 1; min-height: 0; }
/* 任一弹窗打开时锁定背景页面，避免"弹窗内 + 背景页"两条滚动条并存 */
body.modal-open { overflow: hidden; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); }
/* 预览弹窗右下角拖拽手柄：拖动调整窗口大小（仅 #node-modal） */
#node-modal .modal-box { position: relative; }
#node-modal .modal-resize {
  position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px;
  cursor: nwse-resize; z-index: 6; border-bottom-right-radius: 10px;
  background:
    linear-gradient(135deg, transparent 0 46%, #C4CBD6 46% 54%, transparent 54% 66%, #C4CBD6 66% 74%, transparent 74%);
  opacity: .75; transition: opacity .15s;
}
#node-modal .modal-resize:hover { opacity: 1; }
body.resizing-modal { user-select: none; -webkit-user-select: none; }
body.resizing-modal iframe { pointer-events: none; }
.modal-content { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 14px; line-height: 1.85; color: var(--text); margin: 0; }
/* 全局错误/异常弹窗 */
.global-error-box { max-width: 520px; }
.global-error-item + .global-error-item { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
/* AJAX 错误/异常提示弹窗：标题红色警示，正文与确认弹窗同宽居中 */
.alert-box { max-width: 440px; }
.alert-box .modal-title { color: var(--danger); }
.alert-box .modal-body { padding: 20px 22px; }
.modal-edit {
  width: 100%; min-height: 320px; font-family: inherit; font-size: 14px; line-height: 1.8;
  border: 1px solid var(--border); border-radius: 8px; padding: 12px; resize: vertical; background: #fff;
}
.modal-edit:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
/* 确认类小弹窗（重新解析确认等）：居中窄框 */
.confirm-box { max-width: 440px; }
.confirm-box .modal-body { padding: 20px 22px; }

@media (max-width: 720px) {
  .otree-layout { flex-direction: column; }
  .otree-rail { position: static; flex-direction: row; flex-wrap: wrap; width: 100%; }
  .otree-rail-title, .otree-rail-hint { display: none; }
}
.outline-editor { border-top: 1px solid var(--border); }
.outline-editor-title {
  cursor: pointer; padding: 12px 2px; font-weight: 600; color: var(--primary);
  font-size: 14.5px; user-select: none;
}

.section-block { margin: 12px 0; }
.section-block h4 { margin-bottom: 6px; }
.content-preview {
  white-space: pre-wrap; background: var(--bg); border-radius: 8px;
  padding: 14px; font-family: inherit; font-size: 14px; line-height: 1.8;
}
.appendix-warning {
  color: #DC2626; font-weight: 700; font-size: 14px; line-height: 1.7;
  background: #FEF2F2; border: 1px solid #FECACA; border-radius: 8px;
  padding: 12px 16px; margin-top: 8px;
}

/* ============ 邀请树 ============ */
.tree-level { margin-bottom: 14px; }
.tree-depth { font-weight: 700; color: var(--primary); font-size: 14px; margin-bottom: 6px; }
.tree-list { list-style: none; }
.tree-item {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px;
}
.tree-name { font-weight: 600; }

/* ============ 页脚 ============ */
.footer { text-align: center; padding: 30px 20px; color: var(--text-light); font-size: 14px; margin-top: 40px; }

/* ============ 登录后台布局：左侧菜单 ============ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 230px; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: #F6F7FC; border-right: 1px solid #E8EAF3;
  padding: 14px 10px 10px;
  display: flex; flex-direction: column;
  transition: margin-left .2s, width .2s, opacity .2s;
}
/* 桌面端收起状态 */
.sidebar.collapsed {
  margin-left: -230px;
}
/* 收起/展开按钮：固定在侧边栏右边竖线中部 */
.sidebar-collapse-btn {
  position: absolute; right: -12px; top: 50%; transform: translateY(-50%);
  z-index: 210; width: 24px; height: 56px;
  background: #fff; border: 1px solid #E8EAF3; border-radius: 6px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  padding: 0;
}
.sidebar-collapse-btn:hover { background: #ECEEFB; }
/* 展开/收起箭头 */
.sidebar-collapse-btn::before { content: "<<<"; }
.sidebar.collapsed .sidebar-collapse-btn::before { content: ">>>"; }
/* 收起后按钮仍可见 */
.sidebar.collapsed .sidebar-collapse-btn {
  position: fixed; left: 0; right: auto;
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 4px 6px 20px; text-decoration: none; }
.logo-mark { display: flex; }
.logo-text { display: flex; flex-direction: column; }
.logo-name { font-size: 21px; font-weight: 800; color: var(--primary); line-height: 1.2; }
.logo-slogan { font-size: 12px; color: var(--text-light); }

.sidebar-nav { display: flex; flex-direction: column; gap: 8px; }
.menu-group { list-style: none; }
.menu-group > summary { list-style: none; }
.menu-group > summary::-webkit-details-marker { display: none; }

.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 13px;
  color: var(--primary); font-size: 17px; font-weight: 600;
  text-decoration: none; cursor: pointer; user-select: none;
  transition: background .15s;
}
.menu-item:hover { background: #ECEEFB; }
.menu-item.active { background: #E4E7FA; }
.menu-item.active::before {
  content: ""; position: absolute; left: 0; width: 4px; height: 22px;
  background: var(--primary); border-radius: 0 4px 4px 0;
}
.menu-item { position: relative; }
.menu-label { flex: 1; }
/* 个别菜单项文字缩小一号（17px → 16px），仅作用于文字本身，不影响角标 */
.menu-label-sm { font-size: 16px; }
.menu-caret { transition: transform .2s; color: var(--primary); }
.menu-group[open] > .menu-item .menu-caret { transform: rotate(180deg); }

/* "我"字方块 */
.menu-char {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
}
/* 普通线性图标 */
.menu-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
}
/* 写标书：深蓝块 + 白图标（主 CTA 样式） */
.menu-cta { background: #E4E7FA; }
.menu-cta .menu-icon { background: var(--primary); color: #fff; }
.menu-cta:hover { background: #DDE1FA; }

/* 子菜单 */
.submenu { display: flex; flex-direction: column; gap: 2px; padding: 4px 0 2px 54px; }
.submenu-item {
  padding: 7px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: #6366F1; text-decoration: none;
}
.submenu-item:hover { background: #ECEEFB; }

/* 赚钱角标 */
.menu-badge {
  flex-shrink: 0; transform: rotate(-8deg);
  background: linear-gradient(135deg, #F59E0B, #F97316);
  color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 8px;
}

/* 金色胶囊（客服 / 额度） */
.side-capsule {
  display: flex; align-items: center; gap: 8px;
  border: 2px solid #D9A93E; background: #FFFDF5;
  border-radius: 999px; padding: 8px 12px; margin-top: 10px;
}
.capsule-service { margin-top: auto; cursor: default; }
.capsule-service-inline { margin-top: 10px; }
.capsule-avatar { display: flex; flex-shrink: 0; }
.capsule-text { font-size: 13px; color: #7C5A12; white-space: nowrap; }
.capsule-text strong { color: #5F4308; font-size: 15px; }
.quota-gem { display: flex; flex-shrink: 0; }
.quota-words { flex: 1; font-weight: 700; color: #7C5A12; font-size: 15px; white-space: nowrap; }
.quota-btn {
  background: #fff; border: 1.5px solid #D9A93E; color: #A16207;
  border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 700;
  text-decoration: none; white-space: nowrap;
}
.quota-btn:hover { background: #FEF3C7; }

/* 底部用户块 */
.user-box { margin-top: 10px; }
.user-box > summary { list-style: none; }
.user-box > summary::-webkit-details-marker { display: none; }
.user-summary {
  display: flex; align-items: center; gap: 10px;
  background: #E4E7FA; border-radius: 12px; padding: 8px 10px; cursor: pointer;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  background: #60A5FA; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px;
  overflow: hidden;  /* 防头像 img 溢出 */
}
.user-avatar.sm { width: 28px; height: 28px; font-size: 13px; border-radius: 6px; }
.user-name { flex: 1; color: var(--primary); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu {
  margin-top: 6px; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow); padding: 6px;
}
.user-menu a, .user-logout {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 6px; font-size: 14px;
  background: none; border: 0; cursor: pointer; color: var(--text);
  text-decoration: none;
}
.user-menu a:hover, .user-logout:hover { background: var(--bg); }
.user-menu-divider { height: 1px; background: var(--border); margin: 4px 2px; }
.user-logout { color: var(--danger); }

/* 右上角用户胶囊（云端模式，hover 弹出菜单） */
.topbar-user {
  position: relative; display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 4px 8px; border-radius: 8px;
  outline: none;
}
.topbar-user:hover, .topbar-user:focus-within { background: var(--bg); }
.topbar-user-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; }
.topbar-user-menu {
  display: none; position: absolute; top: 100%; right: 0; margin-top: 4px;
  min-width: 140px; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 60;
}
/* 透明桥接：填平胶囊与菜单之间的 4px 间隙，避免鼠标下移时 hover 断开 */
.topbar-user-menu::before {
  content: ""; position: absolute; top: -4px; left: 0; right: 0; height: 4px;
}
.topbar-user:hover .topbar-user-menu,
.topbar-user:focus-within .topbar-user-menu { display: block; }
.topbar-user-menu a, .topbar-user-menu .user-logout {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 6px; font-size: 14px;
  background: none; border: 0; cursor: pointer; color: var(--text);
  text-decoration: none;
}
.topbar-user-menu a:hover, .topbar-user-menu .user-logout:hover { background: var(--bg); }

/* 右侧主区 */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.app-topbar {
  position: sticky; top: 0; z-index: 50;
  height: 56px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 22px;
}
.topbar-title { font-weight: 700; font-size: 16px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
/* 客户端模式侧边栏无额度胶囊后，用户块贴底 */
.user-box-bottom { margin-top: auto; }
/* 移动端汉堡按钮 */
.sidebar-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  color: var(--text); align-items: center; padding: 4px 6px; border-radius: 6px;
}
.sidebar-toggle:hover { background: #ECEEFB; }
.app-messages { padding: 14px 24px 0; }
.app-content { padding: 24px; }
.form-narrow { max-width: 660px; }

/* 邀请推广卡片 */
.promo-code-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.promo-code {
  display: flex; flex-direction: column; gap: 2px;
  border: 1.5px dashed var(--primary); background: #EEF2FF;
  border-radius: 10px; padding: 8px 20px;
}
.promo-code strong { font-size: 22px; letter-spacing: 2px; color: var(--primary); }

/* 功能占位页 */
.coming-wrap { display: flex; justify-content: center; padding: 60px 20px; }
.coming-card { max-width: 480px; text-align: center; }
.coming-icon { font-size: 46px; margin-bottom: 10px; }

/* 移动端遮罩 */
.sidebar-mask {
  display: none; position: fixed; inset: 0; z-index: 150;
  background: rgba(17, 24, 39, .4);
}

/* ============ 招标文件解析面板（八 Tab） ============ */
.parse-panel { padding: 0; overflow: hidden; }
.parse-header {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 22px 0; flex-wrap: wrap;
}
.parse-header .card-title { margin-bottom: 0; }
.parse-wait-tip {
  display: inline-flex; align-items: center; gap: 6px;
  color: #6B7280; font-size: 14px;
}
.parse-header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
/* 头部“编辑”按钮与“重新解析”之间留更大间距 */
.parse-header-edit { display: flex; align-items: center; margin-right: 28px; }
.parse-header-edit:empty { display: none; margin: 0; }

.parse-spinner {
  display: inline-block; width: 14px; height: 14px; margin-right: 7px;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  border-radius: 50%; vertical-align: -2px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-outline.btn-reparse {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 10px 20px; font-size: 15px;
}
.btn-outline.btn-reparse .btn-label {
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-outline.btn-reparse .reparse-icon { display: inline-flex; flex-shrink: 0; }
.btn-reparse[disabled] { opacity: .75; cursor: wait; }
.btn-reparse .parse-spinner {
  border-color: rgba(79, 70, 229, .25); border-top-color: var(--primary);
}

.btn-outline {
  background: #fff; border: 1.5px solid var(--primary); color: var(--primary);
  border-radius: 999px; padding: 9px 20px; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
}
.btn-outline:hover { background: #EEF2FF; }

/* Tab 栏 */
.parse-tabs {
  display: flex; overflow-x: auto; border-bottom: 1px solid var(--border);
  padding: 0 12px; scrollbar-width: thin;
}
.parse-tab {
  position: relative; flex-shrink: 0;
  background: none; border: 0; cursor: pointer;
  padding: 14px 16px; font-size: 15px; font-weight: 600;
  color: #9CA3AF; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
}
.parse-tab.is-done { color: var(--primary); }
.parse-tab.is-pending { color: #9CA3AF; }
.parse-tab.active { color: var(--primary); }
.parse-tab.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 3px; border-radius: 3px 3px 0 0; background: var(--primary);
}
/* 正在编辑的板块 Tab：变红并加 * 号，醒目提示 */
.parse-tab.is-editing { color: #DC2626; }
.parse-tab.is-editing .tab-check { color: #DC2626; }
.parse-tab.active.is-editing::after { background: #DC2626; }
.pe-tab-edit-mark { color: #DC2626; font-weight: 700; margin-left: 2px; }
.tab-check { color: var(--primary); }

.parse-panels { padding: 20px 22px; }
.parse-panel-body .table { margin-bottom: 0; }
/* 评分要求表格：评分项 + 分值列宽（仅 score 表，排除 kv-table） */
.parse-panel-body[data-panel="scoring"] .table:not(.kv-table) th:nth-child(1),
.parse-panel-body[data-panel="scoring"] .table:not(.kv-table) td:nth-child(1) { width: 10%; }
.parse-panel-body[data-panel="scoring"] .table:not(.kv-table) th:nth-child(2),
.parse-panel-body[data-panel="scoring"] .table:not(.kv-table) td:nth-child(2) { width: 8%; }
.kv-table th {
  width: 190px; background: #F8FAFC; color: var(--text);
  font-weight: 600; white-space: nowrap; vertical-align: top;
}
.kv-table td { vertical-align: top; line-height: 1.7; }
.score-cell { color: var(--primary); font-weight: 700; }
/* 布尔字段展示（暗标/授权评标委员会等） */
.bool-yes { color: #047857; font-weight: 600; }
.bool-no { color: #6B7280; }
.score-warn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; margin-bottom: 12px;
  background: #FEF2F2; border: 1px solid #FECACA; border-radius: 8px;
  color: #B91C1C; font-size: 13px;
}
.score-warn strong { color: #991B1B; font-size: 15px; }
.score-info {
  padding: 6px 12px; margin-bottom: 10px;
  background: #EFF6FF; border: 1px solid #BFDBFE; border-radius: 6px;
  color: #1D4ED8; font-size: 12.5px;
}
.table tfoot th, .table tfoot td { border-top: 2px solid var(--border); }

.invalid-list { margin: 0; padding-left: 22px; }
.invalid-list li { padding: 7px 0; line-height: 1.7; border-bottom: 1px dashed var(--border); }
.invalid-list li:last-child { border-bottom: 0; }
/* 资格条件逐条清单（样式同废标项列表，条目通常较长，留白略宽） */
.qual-list { margin: 0; padding-left: 22px; }
.qual-list li { padding: 8px 0; line-height: 1.8; border-bottom: 1px dashed var(--border); }
.qual-list li:last-child { border-bottom: 0; }

.parse-empty { text-align: center; padding: 40px 20px; }
.parse-empty p { margin: 4px 0; }

/* 收起态 */
.parse-panel.is-collapsed .parse-tabs,
.parse-panel.is-collapsed .parse-panels { display: none; }
.parse-panel.is-collapsed .parse-header { padding-bottom: 20px; }

/* 点击标题展开/折叠：标题可点 + 尾部箭头 */
.card-toggle-title {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
}
.card-toggle-title:hover { color: var(--primary); }
.card-toggle-arrow { transition: transform .2s; flex: none; color: #9CA3AF; }
.card-toggle-title:hover .card-toggle-arrow { color: var(--primary); }
/* 折叠态：箭头向下（∨）提示可展开；展开态旋转 180° 向上（^）提示可收起 */
.parse-panel:not(.is-collapsed) .card-toggle-arrow,
.collapsible-card:not(.is-collapsed) .card-toggle-arrow { transform: rotate(180deg); }

/* 通用卡片折叠（第二步提纲 / 第三步正文） */
.collapsible-card.is-collapsed .card-collapse-body { display: none; }

/* ============ 解析内容就地编辑 ============ */
.pe-toolbar {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 8px; margin: 0 0 10px;
}
.pe-toolbar.is-empty { display: none; }
.pe-manual-tag { font-size: 12px; color: #B45309; }
.pe-link-btn {
  border: 0; background: none; padding: 0; cursor: pointer;
  font-size: 12px; color: var(--primary); text-decoration: underline;
}
.pe-link-btn:hover { opacity: .8; }
/* 展示态=只读输入框：隐藏保存/取消与行增删按钮；编辑态（is-editing）显示 */
.pe-actions { display: none; }
.pe-row-del, .pe-row-add { display: none; }
.pe-group.is-editing .pe-actions,
.pe-groups-merged.is-editing .pe-actions { display: flex; }
.pe-group.is-editing .pe-row-del,
.pe-groups-merged.is-editing .pe-row-del { display: inline-block; }
.pe-group.is-editing .pe-row-add,
.pe-groups-merged.is-editing .pe-row-add { display: inline-block; }
/* 只读态输入框：灰底、去掉聚焦高亮，表示不可编辑 */
.pe-wrap input[type="text"]:disabled,
.pe-wrap textarea:disabled {
  background: #F3F4F6; color: #374151; cursor: default;
}
.pe-wrap input[type="checkbox"]:disabled { cursor: default; }
/* 未解析板块：非编辑态隐藏表单，仅显示"待解析"提示 */
.pe-group.is-unparsed:not(.is-editing) .pe-wrap { display: none; }
.pe-group.is-editing .parse-empty { display: none; }
/* kv 表单中的栏目分组标题（占满整行）；可点击展开/折叠 */
.pe-cat-title {
  grid-column: 1 / -1; font-size: 14px; font-weight: 600; color: #4B5563;
  margin: 4px 0 0; padding-left: 6px;
  border-left: 3px solid var(--primary);
}
/* group 容器：data_key 级分组，含工具条+正文 */
.pe-group { padding: 4px 0 16px; border-bottom: 1px dashed var(--border); }
.pe-group:last-child { border-bottom: 0; padding-bottom: 0; }
/* 合并栏目：多个 data_key 组视觉上合为一个栏目——无分隔线、无组名 */
.pe-groups-merged .pe-toolbar { margin-bottom: 8px; }
.pe-group-label { font-weight: 600; color: var(--text); font-size: 14px; }
/* 非合并板块组标题（如无效标与废标项）：可点击折叠；占满左侧使手改标记靠右，
   箭头仍紧跟名称（margin-right:auto 在容器上，不在文字上） */
.pe-group-toggle { margin-right: auto; }
/* 合并板块：各子类（评标办法/技术评分表/商务评分表等）一律竖向堆叠；
   子类内部的 kv 解析项仍由 .pe-form 两列网格横向排列 */
.pe-merged-form { display: flex; flex-direction: column; gap: 18px; }
.pe-merged-sub { margin-bottom: 0; }
.pe-merged-sub-title { font-size: 14px; font-weight: 600; color: #4B5563; margin-bottom: 8px; }
/* 子类标题点击展开/折叠 */
.pe-sub-toggle {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; user-select: none;
}
.pe-sub-toggle:hover { color: var(--primary); }
/* 箭头紧跟名称之后（容器 gap 控制间距），不推到行末 */
.pe-sub-arrow { margin-left: 0; flex: none; color: #9CA3AF; transition: transform .2s; }
.pe-sub-toggle:hover .pe-sub-arrow { color: var(--primary); }
/* 折叠态箭头向下（∨），展开态向上（^） */
.pe-sub-arrow { transform: rotate(180deg); }
.pe-merged-sub.is-collapsed .pe-sub-arrow,
.pe-cat-title.is-collapsed .pe-sub-arrow,
.pe-group.is-collapsed .pe-sub-arrow { transform: rotate(0deg); }
/* 子类折叠后隐藏正文，标题不留底距 */
.pe-merged-sub.is-collapsed > :not(.pe-merged-sub-title) { display: none; }
.pe-merged-sub.is-collapsed .pe-merged-sub-title { margin-bottom: 0; }
/* 非合并板块组（无效标与废标项）折叠：隐藏条目正文与"待解析"提示 */
.pe-group.is-collapsed > .pe-wrap,
.pe-group.is-collapsed > .parse-empty { display: none; }
.pe-form > .cat-collapsed-hidden { display: none; }
.pe-cat-title.is-collapsed { margin-bottom: 2px; }
/* 头部"编辑"按钮：卡片折叠时置灰不可点 */
#parse-head-edit:disabled { opacity: .5; cursor: not-allowed; }
/* 编辑态：子类项前的单选按钮（选中目标子类以接收新增解析项） */
.pe-add-radio { flex: none; margin: 0 6px 0 0; cursor: pointer; accent-color: var(--primary); }
/* "+ 添加新的解析项"按钮与新增行；上方留一空行高度与原有内容隔开 */
.pe-add-item-row {
  display: grid; grid-template-columns: 180px 1fr auto;
  gap: 10px; margin: 20px 0 8px; align-items: start;
}
.pe-add-item-row .pe-add-label {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit;
}
.pe-add-item-row .pe-add-content {
  width: 100%; box-sizing: border-box; resize: vertical; overflow: hidden;
  min-height: calc(1.6em * 2 + 16px); padding: 7px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; line-height: 1.6;
}
.pe-add-item-remove {
  border: 0; background: none; cursor: pointer; color: #9CA3AF;
  font-size: 20px; line-height: 1; padding: 6px 4px;
}
.pe-add-item-remove:hover { color: #DC2626; }
.pe-group-body { margin-top: 6px; }
/* kv 栏目分组：栏目标题 + 子表 */
.pe-category { margin-bottom: 14px; }
.pe-category:last-child { margin-bottom: 0; }
.pe-category-title {
  font-size: 13px; font-weight: 600; color: #4B5563;
  margin: 0 0 6px; padding-left: 6px;
  border-left: 3px solid var(--primary);
}
.pe-bool-row { padding: 6px 0; font-size: 13px; }
/* 未解析字段：右侧留空（占位空行与单行文字等高，不写占位文案） */
.pe-empty-cell { display: inline-block; min-height: 1.7em; width: 100%; }
/* 无效标与废标项表格：左列项目名多条合并，顶部对齐 */
.invalid-table th[rowspan] { vertical-align: top; }
.invalid-table td { line-height: 1.8; }
.pe-form {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
}
/* kv 字段统一：label 顶部对齐，每行最多 6 个汉字；文本框宽度固定填满所在栅格列 */
.pe-field { display: flex; align-items: flex-start; gap: 10px; }
.pe-field label {
  width: 6em; flex: none; font-size: 13px;
  color: #4B5563; text-align: right; padding-top: 7px;
  word-break: break-all;  /* 超过 6 个汉字折到第 2 行 */
}
.pe-field textarea {
  flex: 1; min-width: 0; width: auto;
  box-sizing: border-box; resize: vertical; overflow: hidden;
  min-height: calc(1.6em * 2 + 16px);  /* 拖拽缩小下限：2 行 */
  padding: 7px 10px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; font-family: inherit;
  line-height: 1.6; background: #fff;
}
/* 内容仅 1 行的框：不显示拖拽手柄，高度固定 1 行（rows=1 决定）。
   提高特异性以压过 .pe-table textarea / .pe-item-row textarea 的 2 行 min-height */
.pe-field textarea.pe-ta-1,
.pe-table textarea.pe-ta-1,
.pe-item-row textarea.pe-ta-1 {
  resize: none; min-height: 0;
}
.pe-field textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, .12);
}
.pe-field-bool { grid-column: 1 / -1; }
.pe-field-bool label {
  width: auto; text-align: left; font-weight: 400; padding-top: 0;
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  margin-left: calc(6em + 10px);  /* 与上方输入框左缘对齐（label 宽 6em + 间距） */
}
.pe-table { margin-bottom: 10px; }
/* 表头字号与子类标题原大小一致（13px） */
.pe-table th { font-size: 13px; font-weight: 600; color: #4B5563; background: #F9FAFB; }
.pe-table input[type="text"],
.pe-table textarea {
  width: 100%; box-sizing: border-box;
  padding: 6px 9px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 13px; font-family: inherit;
  line-height: 1.5; background: #fff;
}
.pe-table textarea { resize: vertical; overflow: hidden; min-height: calc(1.5em * 2 + 14px); }
.pe-table input[type="text"]:focus,
.pe-table textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, .12);
}
.pe-col-score { width: 110px; }
.pe-col-op { width: 46px; }
/* 所有评分表（含空的技术评分表）采用固定列宽，
   "评分标准/说明"列宽与商务评分表一致，避免空表时该列被压缩 */
.pe-table { table-layout: fixed; }
.pe-table th:nth-child(1),
.pe-table td:nth-child(1) { width: 160px; }
.pe-table .pe-col-score { width: 100px; }
.pe-table th:nth-child(3),
.pe-table td:nth-child(3) { width: 360px; }
.pe-table .pe-col-op { width: 46px; }
/* 商务评分表：窗口过窄时表格保底 666px，外层横向滚动而不压缩列 */
.pe-table-biz { min-width: 666px; }
.pe-wrap:has(.pe-table-biz) { overflow-x: auto; }
/* 空的评分子表（如无内容的技术评分表）：与有内容的评分表同样渲染，仅行内为空白 */
.pe-row-del {
  width: 24px; height: 24px; padding: 0;
  border: 1px solid var(--border); background: #fff; border-radius: 6px;
  color: #EF4444; cursor: pointer; font-size: 14px; line-height: 1;
}
.pe-row-del:hover { border-color: #EF4444; background: #FEF2F2; }
.pe-list { list-style: none; margin: 0 0 10px; padding: 0; }
.pe-item-row {
  display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px;
}
.pe-item-row textarea {
  flex: 1; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; font-family: inherit;
  line-height: 1.6; background: #fff;
  box-sizing: border-box; resize: vertical; overflow: hidden;
  min-height: calc(1.6em * 2 + 16px);
}
.pe-item-row textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, .12);
}
.pe-item-row .pe-row-del { flex: none; margin-top: 4px; }
.pe-actions {
  align-items: center; gap: 10px; margin-top: 12px;
}
.pe-msg { font-size: 12px; color: #DC2626; }

.next-step-bar { display: flex; justify-content: center; margin: 18px 0 6px; }

/* ============ 生成中转圈遮罩 ============ */
.gen-loading-box {
  background: #fff; border-radius: 14px; padding: 30px 46px;
  text-align: center; box-shadow: 0 10px 30px rgba(17, 24, 39, .25);
}
.gen-spinner {
  display: inline-block; width: 36px; height: 36px;
  border: 3.5px solid #E5E7EB; border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite;
}
.gen-loading-text { margin-top: 12px; color: var(--text); font-size: 14px; line-height: 1.7; }

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 200;
    transform: translateX(-100%); transition: transform .2s;
    box-shadow: 4px 0 16px rgba(0, 0, 0, .12);
  }
  #sidebar.open { transform: translateX(0); }
  #sidebar.open ~ .sidebar-mask { display: block; }
  .sidebar-toggle { display: inline-flex; }
  .app-content { padding: 16px; }
  .app-messages { padding: 12px 16px 0; }
}
@media (max-width: 768px) {
  .nav-burger { display: block; }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: #fff; flex-direction: column; padding: 16px;
    border-bottom: 1px solid var(--border); align-items: flex-start;
    gap: 16px;
  }
  .nav-home .nav-links { top: 96px; }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
}

/* ============ 行业模板 ============ */
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tpl-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.tpl-card { margin-bottom: 0; display: flex; flex-direction: column; gap: 8px; }
.tpl-card.is-ready { border-top: 3px solid var(--success); }
.tpl-card.is-pending { border-top: 3px solid #D1D5DB; }
.tpl-card-head { display: flex; align-items: center; justify-content: space-between; }
.tpl-code {
  display: inline-block; background: #EEF2FF; color: var(--primary);
  font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 6px;
  letter-spacing: .5px;
}
.tpl-code-lg { font-size: 14px; vertical-align: middle; }
.tpl-name { font-size: 17px; color: #111827; }
.tpl-card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }

/* 模板详情：章/节提纲 */
.tpl-outline { padding: 8px 22px; }
.tpl-chapter { padding: 14px 0; border-bottom: 1px solid var(--border); }
.tpl-chapter:last-child { border-bottom: 0; }
.tpl-chapter-title {
  font-size: 16px; font-weight: 700; color: #111827;
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.tpl-chapter-num {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.tpl-section-list { list-style: none; margin-left: 36px; display: flex; flex-direction: column; gap: 10px; }
.tpl-section-list li {
  background: var(--bg); border-radius: 8px; padding: 10px 12px;
}
.tpl-section-title { font-weight: 600; font-size: 14px; }
.tpl-req { margin: 4px 0 6px; }
.tpl-words { background: #EEF2FF; color: var(--primary); }

/* ============ 资质证书 ============ */
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title-row .card-title { margin-bottom: 0; }
.card-title-actions { display: flex; align-items: center; gap: 10px; }

/* 调整模式：默认隐藏的控件，点击本行"编辑证书"后显示（cert-adjusting 加在 tr 上） */
.cert-adjust-only { display: none !important; }
tr.cert-adjusting .cert-adjust-only { display: flex !important; }
tr.cert-adjusting .cert-name-text { display: none; }
.cert-name-edit { display: flex; align-items: center; gap: 4px; }
.cert-name-edit input[type="text"] {
  flex: 1; min-width: 120px; padding: 4px 8px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px;
}
.cert-name-edit input[type="text"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79,70,229,.12); }
.cert-name-edit button {
  width: 24px; height: 26px; padding: 0; border: none; border-radius: 5px;
  background: var(--primary); color: #fff; font-size: 13px; line-height: 1; cursor: pointer;
}
.cert-name-edit button:hover { background: var(--primary-dark); }
/* 调整模式下序号输入框可编辑（JS 会移除 readonly 属性） */
.cert-edit-form input[name="seq_no"][readonly] { background: transparent; border-color: transparent; }
/* 操作列：编辑证书 / 追加图片 / 删除证书 竖排 */
.cert-op-cell { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cert-row-edit { margin-bottom: 2px; }
.cert-row-edit.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.cert-add-form .cert-add-row { display: flex; gap: 16px; flex-wrap: wrap; }
.cert-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; flex: 1; min-width: 220px; }
.cert-field > span { font-weight: 600; font-size: 14px; }
.cert-field input[type="text"] {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; background: #fff;
}
.cert-field input[type="text"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }

/* 上传证书行：证书名称 + 输入框同一行，输入框宽度扩大 1/3 */
.cert-upload-row { align-items: center; flex-wrap: nowrap; }
.cert-upload-row .cert-field-name {
  flex: 0 0 auto; width: 22%; min-width: 280px; margin-bottom: 0;
  flex-direction: row; align-items: center; gap: 10px;
}
.cert-upload-row .cert-field-name > span { flex-shrink: 0; white-space: nowrap; }
.cert-upload-row .cert-field-name input[type="text"] { flex: 1; width: auto; min-width: 140px; }

/* 分类名带规则/错误提示时（证书页新建弹窗；知识库、资料表格页后续照此结构复制）：
   标签 + 窄输入框 + 右侧提示栏（规则提示与错误提示在输入框右侧纵向叠放，不溢出弹窗） */
.cert-add-form .cert-field-name.cert-field-hints {
  flex: 1 1 auto; width: 100%; flex-wrap: nowrap; align-items: center;
}
.cert-add-form .cert-field-name.cert-field-hints input[type="text"] {
  flex: 0 0 170px; width: 170px; min-width: 0;
}
.cert-add-form .cert-field-hints > .cert-hints-side {
  flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column;
  gap: 4px; align-items: flex-start; white-space: normal; line-height: 1.5;
}
.cert-add-form .cert-hints-side > .cert-name-rule,
.cert-add-form .cert-hints-side > .cert-name-error {
  font-weight: 400; font-size: 13px; white-space: normal;
}
/* 分类名输入区与"选择文件"按钮之间的空行（三个页面的新建弹窗共用） */
.cert-form-blank { height: 1em; }
.cert-pick { display: flex; align-items: center; gap: 12px; padding-bottom: 1px; }
.cert-pick-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 20px;
  border: 1px solid var(--primary); border-radius: 8px;
  background: transparent; color: var(--primary);
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.cert-pick-btn:hover { background: rgba(79,70,229,.08); }
.cert-pick-btn input[type="file"] { display: none; }
.cert-pick-tip { white-space: nowrap; }

/* 知识库新建分类弹窗：已选文件名回显（选择按钮复用 cert-pick-btn） */
.kb-new-picked-names {
  display: none; margin: 6px 0 0; font-size: 13px;
  color: var(--text-light); word-break: break-all;
}
.kb-new-picked-names.has-files { display: block; }

/* 上传证书弹窗：按钮组与选择文件按钮拉开距离 */
.cert-add-form .btn-row { margin-top: 28px; }

/* 已选文件本地缩略图（提交前预览，按选择顺序） */
.cert-pick-previews { display: none; flex-wrap: wrap; gap: 10px; margin: 2px 0 14px; }
.cert-pick-previews.has-files { display: flex; }
.pp-thumb {
  position: relative; width: 84px; height: 84px;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg);
}
.pp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-idx {
  position: absolute; left: 4px; bottom: 4px; min-width: 18px; height: 18px; padding: 0 5px;
  background: rgba(17,24,39,.72); color: #fff; font-size: 11px; line-height: 18px;
  text-align: center; border-radius: 9px;
}
.pp-del {
  position: absolute; top: -6px; right: -6px; z-index: 2;
  width: 20px; height: 20px; padding: 0; border: none; border-radius: 50%;
  background: var(--danger); color: #fff; font-size: 14px; line-height: 1;
  cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.pp-del:hover { background: #DC2626; }

.cert-table td { vertical-align: top; }
.cert-name { font-weight: 500; }

/* 序号编辑（输入框，保存按钮在名称列） */
.cert-edit-form { margin: 0; }
.cert-edit-form input[name="seq_no"] {
  width: 46px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; text-align: center; font-weight: 600;
}
.cert-edit-form input[name="seq_no"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79,70,229,.12); }

.cert-thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.cert-thumb { position: relative; width: 96px; }
.cert-thumb a { display: block; width: 96px; height: 96px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg); }
.cert-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .12s; }
.cert-thumb a:hover img { transform: scale(1.06); }
.cert-thumb-idx {
  position: absolute; left: 4px; bottom: 4px; min-width: 18px; height: 18px; padding: 0 5px;
  background: rgba(17,24,39,.72); color: #fff; font-size: 11px; line-height: 18px;
  text-align: center; border-radius: 9px;
}
/* 缩略图工具条：上移 / 下移 / 删除 */
.cert-thumb-tools {
  position: absolute; top: -6px; right: -6px; display: flex; gap: 3px; z-index: 2;
}
.cert-thumb-move, .cert-thumb-del { margin: 0; }
.cert-thumb-move button, .cert-thumb-del button {
  width: 20px; height: 20px; padding: 0; border: none; border-radius: 50%;
  font-size: 11px; line-height: 1; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.cert-thumb-move button { background: #fff; color: var(--primary); border: 1px solid var(--border); }
.cert-thumb-move button:hover:not(:disabled) { background: #EEF2FF; }
.cert-thumb-move button:disabled { opacity: .35; cursor: not-allowed; }
.cert-thumb-del button { background: var(--danger); color: #fff; font-size: 14px; }
.cert-thumb-del button:hover { background: #DC2626; }

.cert-append-form, .cert-del-form { margin: 0; }

/* ============ 知识库 ============ */
.kb-list { font-size: 15px; }
.kb-folder { margin-bottom: 6px; }
.kb-folder-row {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px; background: #F3F4F6; border-radius: 6px;
}
.kb-folder-row:hover { background: #E5E7EB; }
.kb-caret {
  display: inline-block; width: 14px; cursor: pointer; user-select: none;
  font-size: 12px; color: var(--text-light); transition: transform .15s;
}
.kb-folder.open .kb-caret { transform: rotate(90deg); }
.kb-folder-name {
  font-weight: 600; font-size: 16px; flex: 1;
  cursor: pointer; user-select: none;
}
.kb-folder-count { flex-shrink: 0; }
.kb-folder-actions {
  display: flex; gap: 6px; align-items: center; flex-shrink: 0;
}
.kb-folder-actions button,
.kb-folder-actions .kb-upload-label {
  padding: 3px 10px; font-size: 14px; border-radius: 4px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  cursor: pointer; white-space: nowrap;
}
.kb-folder-actions button:hover:not(:disabled),
.kb-folder-actions .kb-upload-label:hover { background: var(--bg); }
.kb-folder-actions button:disabled { opacity: .35; cursor: not-allowed; }
.kb-folder-actions .kb-upload-label.disabled { opacity: .35; pointer-events: none; cursor: not-allowed; }
.kb-folder-actions .kb-del-form button { color: var(--danger); border-color: var(--danger); }
.kb-folder-actions .kb-del-form button:hover { background: rgba(239,68,68,.08); }
.kb-folder-actions .kb-upload-label { color: var(--primary); border-color: var(--primary); }
.kb-folder-actions .kb-upload-label input[type="file"] { display: none; }
.kb-folder-actions .kb-move-form { display: inline; }
.kb-folder-actions .kb-del-form { display: inline; }

.kb-files { display: none; margin: 4px 0 6px 28px; overflow-x: auto; }
.kb-file-head, .kb-file-row, .kb-dir-row { min-width: 720px; }
.kb-folder.open .kb-files { display: block; }
.kb-file-head, .kb-file-row, .kb-dir-row {
  display: grid;
  grid-template-columns: 50px minmax(150px, 1fr) minmax(200px, 1.3fr)
                         90px 140px 100px;
  align-items: center; gap: 10px;
  padding: 2px 12px; line-height: 1.3;
}
/* 文件夹引用行：淡蓝底与普通文件行区分；行内不显示表头边框 */
.kb-dir-row {
  background: #F5F8FF;
  border-bottom: 1px solid #E8EEFB;
  transition: background .1s;
}
.kb-dir-row:hover { background: #EDF3FE; }
.kb-dir-row .kb-col-idx { text-align: center; font-size: 15px; }
.kb-dir-row .kb-col-name .kb-kbdir-open {
  border: 0; background: transparent; padding: 0; cursor: pointer;
  font: inherit; color: var(--primary); text-align: left;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kb-dir-row .kb-col-name .kb-kbdir-open:hover { text-decoration: underline; }
.kb-dir-row .kb-col-size { color: var(--text-light); font-size: 13px; }
/* 类型列：文件类型小徽章 + 文件夹 emoji */
.kb-type-badge {
  display: inline-block; min-width: 34px; padding: 1px 6px;
  border-radius: 4px; font-size: 12px; line-height: 1.5;
  text-align: center; color: #4a5f85; background: #EEF2F8;
  border: 1px solid #DDE5F0;
}
.kb-file-head {
  background: var(--bg); color: var(--text-light);
  font-weight: 600; font-size: 14px;
  border-bottom: 1px solid var(--border); border-radius: 4px 4px 0 0;
}
.kb-file-row { border-bottom: 1px solid #F3F4F6; transition: background .1s; }
.kb-file-row:hover { background: #F9FAFB; }
.kb-file-row:last-child { border-bottom: none; }
.kb-file-link, .kb-file-open {
  text-decoration: none; color: var(--primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kb-file-link:hover, .kb-file-open:hover { text-decoration: underline; }
.kb-file-open {
  background: none; border: none; padding: 0; font: inherit;
  text-align: left; cursor: pointer;
}
/* 名称列：文件名与损坏标记同格排列，文件名超长省略 */
.kb-col-name-cell {
  display: flex; align-items: center; gap: 6px; min-width: 0;
}
.kb-col-name-cell .kb-file-open {
  flex: 0 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kb-col-name-cell .kb-broken-tag { flex-shrink: 0; margin-left: 0; }
/* 目录列：只读，显示本地路径，点击在资源管理器中打开 */
.kb-col-dir {
  background: none; border: none; padding: 0; font: inherit;
  text-align: left; cursor: pointer; min-width: 0; width: 100%;
  color: var(--text-light); font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kb-col-dir:hover { color: var(--primary); text-decoration: underline; }
/* 目录列表头可拖拽调宽 */
.kb-file-head .kb-col-dir {
  position: relative; cursor: default; color: inherit;
}
.kb-file-head .kb-col-dir:hover {
  color: inherit; text-decoration: none;
}
.kb-col-resizer {
  position: absolute; top: 0; right: -5px; width: 10px; height: 100%;
  cursor: col-resize; z-index: 2;
}
.kb-col-resizer::before {
  content: ""; position: absolute; left: 4px; top: 20%;
  width: 2px; height: 60%; background: transparent; border-radius: 1px;
}
/* 平台知识库页（.pkb-card）：文件表增加缓存统计列（文档/已缓存/待提取/损坏） */
.pkb-card .kb-file-head, .pkb-card .kb-file-row, .pkb-card .kb-dir-row {
  grid-template-columns: 50px minmax(150px, 1fr) minmax(200px, 1.3fr)
                         52px 60px 60px 52px 90px 140px 100px;
  min-width: 1020px;
}
.pkb-card .pkb-c {
  text-align: center; font-size: 13px; color: var(--text-light);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pkb-card .pkb-c.pkb-dead { color: #c0392b; }
.pkb-card .pkb-c.pkb-pending { color: #c0392b; }
.kb-col-resizer:hover::before,
body.kb-col-resizing .kb-col-resizer::before { background: var(--primary); }
body.kb-col-resizing { cursor: col-resize; user-select: none; }
.kb-col-size, .kb-col-time { color: var(--text-light); font-size: 14px; }
.kb-col-op { display: flex; gap: 20px; }
.kb-col-op .kb-move-form,
.kb-col-op .kb-del-form { display: inline; }
.kb-col-op button {
  width: 20px; height: 20px; padding: 0; font-size: 11px;
  border: 1px solid var(--border); border-radius: 50%; background: #fff;
  cursor: pointer; line-height: 1;
}
.kb-col-op button:hover:not(:disabled) { background: var(--bg); }
.kb-col-op button:disabled { opacity: .35; cursor: not-allowed; }
.kb-col-op .kb-del-form button { color: var(--danger); border-color: var(--danger); }
.kb-empty { padding: 6px 12px; }

/* ============ 提纲树附件计数徽标 ============ */
.otree-badge-attach {
  background: #FEF3C7; color: #B45309; font-size: 14px; padding: 1px 6px;
  border-radius: 999px; margin-left: 4px; vertical-align: middle;
}

/* ============ 资质证书 / 知识库 资料选择弹窗 ============ */
.picker-box { max-width: 880px; height: 86vh; }
.picker-body { padding: 0; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.picker-tabs { display: flex; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.picker-tab {
  padding: 7px 18px; border: 1px solid var(--border); border-radius: 999px;
  background: #fff; cursor: pointer; font-size: 14px; color: var(--text-light);
}
.picker-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.picker-panel { flex: 1; overflow-y: auto; padding: 14px; }
.picker-cert { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px dashed var(--border); }
.picker-cert:last-child, .picker-folder:last-child { border-bottom: none; }
.picker-cert-name, .picker-folder-name {
  font-weight: 600; font-size: 14px; color: #111827; margin-bottom: 8px;
}
.picker-folder-toggle { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 4px; }
.picker-folder-toggle:hover { color: var(--primary); }
.picker-folder-arrow { flex-shrink: 0; transition: transform .15s; transform: rotate(-90deg); color: var(--text-light); }
.picker-folder-toggle.open .picker-folder-arrow { transform: rotate(0); }
.picker-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.picker-thumb {
  position: relative; cursor: pointer; border: 2px solid var(--border);
  border-radius: 8px; overflow: hidden; aspect-ratio: 3/4; background: #fff;
  transition: border-color .12s, transform .12s;
}
.picker-thumb:hover { border-color: var(--primary); }
.picker-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.picker-thumb-check {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; opacity: 0; transition: opacity .12s;
}
.picker-thumb.selected, .picker-file.selected {
  border-color: var(--primary); background: #EEF2FF;
}
.picker-thumb.selected .picker-thumb-check { opacity: 1; }
.picker-files { display: flex; flex-direction: column; gap: 4px; }
.picker-file {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
  background: #fff; transition: border-color .12s, background .12s;
}
.picker-file:hover { border-color: var(--primary); }
.picker-file-name {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.picker-file .picker-thumb-check {
  position: static; width: 18px; height: 18px; opacity: 0; font-size: 11px;
}
.picker-file.selected .picker-thumb-check { opacity: 1; }
/* 「选图」按钮：查看/勾选文档内嵌图片 */
.picker-img-btn {
  flex-shrink: 0; padding: 2px 8px; font-size: 12px; line-height: 1.6;
  border: 1px solid var(--border); border-radius: 4px; background: #fff;
  color: #4b5563; cursor: pointer; transition: border-color .12s, color .12s;
}
.picker-img-btn:hover { border-color: var(--primary); color: var(--primary); }
.picker-img-badge {
  display: inline-block; min-width: 16px; margin-left: 3px; padding: 0 3px;
  font-size: 11px; line-height: 16px; text-align: center; border-radius: 8px;
  background: var(--primary); color: #fff;
}
.picker-img-badge.hidden { display: none; }
/* 选图面板 */
.picker-images-box { max-width: 760px; width: 90vw; max-height: 80vh; display: flex; flex-direction: column; }
.picker-images-body { overflow: auto; min-height: 120px; }
.picker-images-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.picker-image-cell {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 6px; border: 2px solid var(--border); border-radius: 6px;
  cursor: pointer; background: #fff;
}
.picker-image-cell.selected { border-color: var(--primary); background: #EEF2FF; }
.picker-image-cell input[type=checkbox] {
  position: absolute; top: 8px; left: 8px; z-index: 1;
  width: 16px; height: 16px; accent-color: var(--primary);
}
.picker-image-cell img {
  width: 100%; height: 110px; object-fit: contain; background: #f8fafc;
  border-radius: 4px;
}
.picker-image-cap {
  font-size: 11px; color: #6b7280; line-height: 1.4;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.picker-foot { display: flex; align-items: center; gap: 10px; }
.picker-count { font-size: 13px; color: var(--text); }
.picker-count-list { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ 预览弹窗中的章节附件区 ============ */
.modal-attachments { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.ma-title { font-weight: 600; font-size: 13px; color: #6b7280; margin-bottom: 10px; }
.ma-files { display: flex; flex-direction: column; gap: 6px; }
.ma-file {
  display: block; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 13px; background: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ma-file:hover { border-color: var(--primary); background: #EEF2FF; }

/* 证书图片内联正文（预览与 Word 导出版式一致：居中等比缩放 + 灰色图注） */
.body-cert-figure { margin: 18px 0 6px; text-align: center; text-indent: 0; }
.body-cert-figure a { display: inline-block; line-height: 0; }
.body-cert-figure img {
  max-width: 100%; max-height: 420px; width: auto; height: auto;
  border: 1px solid #e5e7eb; border-radius: 4px; background: #fff;
}
.body-cert-figure figcaption {
  margin-top: 6px; font-size: 12px; color: #6b7280; text-indent: 0; line-height: 1.5;
}

/* 禁用态按钮（如：无正文时的一键下载 span，仅降透明度，保留 title 提示） */
.btn-disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 格式复制类章节预览弹窗：段落 + 表格 HTML 渲染 ---------- */
/* 不在此容器上设 max-height/overflow：滚动统一交给外层 .modal-body，避免双滚动条 */
.modal-content-html { padding: 4px 0; }
.modal-content-html p {
  margin: 8px 0; line-height: 1.8; text-indent: 2em;
  font-size: 14px; color: #1f2937;
}
.modal-content-html p:first-child { margin-top: 0; }
.format-table {
  border-collapse: collapse; width: 100%; margin: 12px 0;
  font-size: 13px; background: #fff;
}
.format-table th, .format-table td {
  border: 1px solid #d1d5db; padding: 6px 10px; text-align: left;
  vertical-align: top; word-break: break-all;
}
.format-table thead th { background: #f3f4f6; font-weight: 600; }
.format-table tbody tr:nth-child(even) { background: #fafafa; }
.format-image-wrap { text-align: center; margin: 12px 0; }
.format-image { max-width: 100%; max-height: 400px; border: 1px solid #e5e7eb; border-radius: 4px; }

/* ============ AI 正文 Markdown 渲染（预览弹窗） ============ */
.modal-content-md { padding: 4px 0; font-size: 14px; line-height: 1.85; color: #1f2937; }
.modal-content-md .md-p { margin: 8px 0; text-indent: 2em; }
.modal-content-md .md-p:first-child { margin-top: 0; }
.modal-content-md .md-h2 {
  margin: 16px 0 8px; font-size: 16px; font-weight: 700; text-indent: 0;
  border-left: 3px solid #3b82f6; padding-left: 8px;
}
.modal-content-md .md-h3 {
  margin: 12px 0 6px; font-size: 15px; font-weight: 600; text-indent: 0;
}
.modal-content-md .md-ul, .modal-content-md .md-ol {
  margin: 8px 0 8px 2em; padding-left: 1em; text-indent: 0;
}
.modal-content-md .md-ul { list-style: disc; }
.modal-content-md .md-ol { list-style: decimal; }
.modal-content-md .md-ul li, .modal-content-md .md-ol li {
  margin: 4px 0; line-height: 1.7;
}
.modal-content-md .md-table {
  border-collapse: collapse; width: 100%; margin: 12px 0;
  font-size: 13px; background: #fff; text-indent: 0;
}
.modal-content-md .md-table th, .modal-content-md .md-table td {
  border: 1px solid #d1d5db; padding: 6px 10px; text-align: left;
  vertical-align: top; word-break: break-all;
}
.modal-content-md .md-table thead th { background: #f3f4f6; font-weight: 600; }
.modal-content-md .md-table tbody tr:nth-child(even) { background: #fafafa; }
.modal-content-md .md-image {
  max-width: 100%; max-height: 500px; margin: 10px auto; display: block;
  border: 1px solid #e5e7eb; border-radius: 4px;
}
.modal-content-md strong { font-weight: 700; }
.modal-content-md em { font-style: italic; }
/* Mermaid 图表：居中、带边框、自动滚动（流程图可能超宽） */
.modal-content-md .mermaid {
  display: flex; justify-content: center; align-items: center;
  margin: 16px 0; padding: 12px; text-indent: 0;
  background: #fafbfc; border: 1px solid #e5e7eb; border-radius: 4px;
  overflow: auto; min-height: 40px;
}
.modal-content-md .mermaid:not([data-processed]) {
  font-family: Consolas, Monaco, monospace; font-size: 12px;
  color: #6b7280; white-space: pre-wrap; text-align: left;
  display: block;
}
/* Mermaid 语法错误降级：回显源码（替代炸弹错误图） */
.modal-content-md .mermaid-src-fallback {
  display: block; text-align: left; padding: 12px;
  background: #fff8f0; border: 1px solid #f0d9b5;
}
.mermaid-fallback-hint {
  font-size: 12px; color: #b45309; margin-bottom: 6px;
}
.mermaid-fallback-src {
  margin: 0; font-family: Consolas, Monaco, monospace; font-size: 12px;
  color: #374151; white-space: pre-wrap; word-break: break-all;
  background: transparent; border: none;
}
/* 预览弹窗正文手动编辑区 */
.modal-edit-area {
  width: 100%; min-height: 60vh; display: block;
  padding: 12px 14px; font-size: 14px; line-height: 1.85;
  color: #1f2937; font-family: inherit;
  border: 1px solid #d1d5db; border-radius: 8px;
  background: #fff; resize: vertical; outline: none;
  box-sizing: border-box;
}
.modal-edit-area:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, .15);
}
.modal-edit-tip {
  margin: 0 0 8px; font-size: 12px; color: #6b7280;
}

/* ============ 预览弹窗：对话式重新生成（竖向分栏） ============ */
.modal-body.modal-split { display: flex; padding: 0; overflow: hidden; }
.modal-chat-left {
  flex: 1; min-width: 0; overflow-y: auto;
  padding: 16px 18px;
}
.modal-chat-pane {
  width: 320px; flex-shrink: 0;
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-chat-log {
  flex: 1; overflow-y: auto;
  padding: 10px 12px; font-size: 13px; line-height: 1.6;
}
.modal-chat-msg {
  margin: 6px 0; padding: 8px 10px;
  border-radius: 6px; word-break: break-word;
  max-width: 85%;
}
.modal-chat-msg.user {
  background: #e0f2fe;
  margin-left: auto;        /* 靠右显示 */
  text-align: right;
}
.modal-chat-msg.assistant {
  background: #f0fdf4;
  margin-right: auto;       /* 靠左显示 */
  text-align: left;
}
.modal-chat-role {
  font-size: 11px; font-weight: 700; color: var(--text-light);
  margin-bottom: 4px;
}
.modal-chat-text { color: var(--text); }
.modal-chat-msg.user .modal-chat-text { text-align: left; }  /* 正文内容左对齐阅读 */
.modal-chat-gen-btn {
  display: block; width: 100%; margin-top: 8px;
  padding: 8px 12px; border: 1px solid var(--primary, #4f46e5);
  background: var(--primary, #4f46e5); color: #fff;
  border-radius: 6px; font-size: 13px; cursor: pointer;
}
.modal-chat-gen-btn:hover { opacity: 0.9; }
.modal-chat-gen-btn:disabled { opacity: 0.5; cursor: not-allowed; }
/* 左侧预览正文高亮：本次新生成的内容临时高亮 */
.modal-content-html.chat-highlight {
  background: #fffbeb;
  box-shadow: inset 0 0 0 1px #fbbf24;
  border-radius: 4px;
  transition: background 0.3s;
}
/* 对话式生成正文：AI 标记的修改处高亮 */
mark.chat-modified {
  background: #fef9c3;
  border-radius: 3px;
  padding: 1px 2px;
  box-shadow: 0 0 0 1px #facc15;
  animation: chat-modified-pulse 2s ease-in-out;
}
@keyframes chat-modified-pulse {
  0%, 100% { background: #fef9c3; }
  50% { background: #fde68a; }
}
/* 对话式生成正文：AI 标记的删除处——红色删除线（应用后才真正删除） */
del.chat-deleted {
  color: #e11d48;
  text-decoration: line-through;
  text-decoration-color: #e11d48;
  text-decoration-thickness: 1.5px;
}
/* 被删除的图片：删除线对图片无效，用红框+半透明灰度标明 */
del.chat-deleted img {
  opacity: 0.45;
  filter: grayscale(0.6);
  outline: 2px solid #e11d48;
  outline-offset: 2px;
}

/* ============ 对话区：「生成正文」按钮（保存/取消统一在弹窗底栏）============ */
.modal-chat-btnrow {
  display: flex; gap: 6px; margin-top: 8px;
}
.modal-chat-btnrow .modal-chat-gen-btn {
  width: auto; flex: 1; margin-top: 0;
}

.modal-chat-input {
  width: 100%; min-height: 94px; max-height: 200px;
  font-family: inherit; font-size: 13px; line-height: 1.6;
  border: none; border-top: 1px solid var(--border);
  border-radius: 0; padding: 10px 12px; resize: vertical;
  background: #fff; outline: none;
}
.modal-chat-input:focus { border-top-color: var(--primary, #4f46e5); }
.modal-chat-input:disabled { background: #f3f4f6; color: var(--text-light); }

/* ============ 导航内：免费领取 5 万字按钮（样式与官网 AI 写标书按钮完全一致） ============ */
/* 用 .nav-links 前缀提高优先级，避免被 .nav-links > a 的灰字/细字重覆盖 */
.nav-links .gift-nav-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 24px;
  margin-right: 0;
  font-family: inherit; font-size: 17px; font-weight: 700; letter-spacing: 0;
  line-height: 1.6; color: #fff; text-decoration: none; white-space: nowrap;
  border: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, #FF512F 0%, #DD2476 45%, #8B5CF6 100%);
  background-size: 200% 200%;
  box-shadow: 0 6px 22px rgba(221, 36, 118, .45);
  overflow: hidden;
  animation: gift-bg-flow 3s ease infinite, gift-glow 1.8s ease-out infinite;
  transition: transform .25s, box-shadow .25s;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.nav-links .gift-nav-btn:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 12px 30px rgba(221, 36, 118, .6);
  color: #fff;
}
.gift-nav-icon { font-size: 16px; animation: gift-spin 2.5s linear infinite; }
.gift-free-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0;
  background: #fff; color: #DD2476;
  padding: 2px 8px; border-radius: 999px; margin-left: 2px;
  text-shadow: none;
}
/* 光泽扫过（与 AI 写标书一致，覆于文字之上） */
.gift-nav-btn::before {
  content: ""; position: absolute; top: 0; left: -90%; width: 55%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg); pointer-events: none;
  animation: gift-shine 2.8s ease-in-out infinite;
}
@keyframes gift-bg-flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes gift-glow {
  0% { box-shadow: 0 6px 22px rgba(221, 36, 118, .45), 0 0 0 0 rgba(221, 36, 118, .5); }
  70% { box-shadow: 0 6px 22px rgba(221, 36, 118, .45), 0 0 0 14px rgba(221, 36, 118, 0); }
  100% { box-shadow: 0 6px 22px rgba(221, 36, 118, .45), 0 0 0 0 rgba(221, 36, 118, 0); }
}
@keyframes gift-shine {
  0% { left: -90%; }
  55%, 100% { left: 140%; }
}
@keyframes gift-spin {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.25); }
}
@media (prefers-reduced-motion: reduce) {
  .gift-nav-btn, .gift-nav-btn::before, .gift-nav-icon { animation: none; }
}
@media (max-width: 780px) {
  .gift-nav-btn { margin-right: 0; }
}
@media (max-width: 600px) {
  .gift-nav-btn { padding: 10px 18px; font-size: 15px; letter-spacing: 0; }
}

/* ============ 领取额度弹窗 ============ */
.gift-box { max-width: 420px; }
.gift-tip { font-size: 14px; line-height: 1.7; color: var(--text); margin: 0 0 12px; }
.gift-tip b { color: #F11D7A; font-size: 16px; }
.gift-label { display: block; font-size: 13px; color: var(--text-light); margin: 12px 0 6px; }
.gift-input {
  width: 100%; padding: 10px 12px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.gift-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
.gift-input:disabled {
  background: #F3F4F6; color: var(--text-light);
  cursor: not-allowed; box-shadow: none;
}
.gift-code-row { display: flex; gap: 10px; }
.gift-code-row .gift-input { flex: 1; min-width: 0; }
.gift-code-row .btn { white-space: nowrap; }
.gift-dev-hint {
  margin: 10px 0 0; padding: 8px 12px; font-size: 13px; line-height: 1.6;
  color: #92400E; background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 8px;
}
.gift-submit {
  background: linear-gradient(135deg, #FF512F, #F11D7A);
  color: #fff; font-weight: 700; font-size: 15px; padding: 11px 16px;
  border: none; border-radius: 8px;
}
.gift-submit:hover { background: linear-gradient(135deg, #ED4423, #D91468); }
.gift-submit:disabled { opacity: .6; cursor: not-allowed; }
.gift-box .error { margin-bottom: 0; }


