/* ============================================================
   运营后台样式 · admin.html
   设计 token 对齐 ardot 设计稿：
   主色 #6D5CF6 · 背景 #F6F7F9 · 卡片白 · 描边 #ECEDF0
   ============================================================ */

/* hidden 属性必须真的隐藏。
   下面 .adm / .toast / .side-badge / .modal-mask 都设了 display，
   类选择器优先级高于浏览器默认的 [hidden]{display:none}，
   会导致本应隐藏的节点（空弹窗、toast、角标）直接显示出来。 */
[hidden] { display: none !important; }

:root {
  --brand: #6D5CF6;
  --brand-deep: #5A48E8;
  --brand-soft: #F1EFFE;
  --bg: #F6F7F9;
  --card: #FFFFFF;
  --line: #ECEDF0;
  --line-2: #E2E5EA;
  --ink: #0F1319;
  --ink-2: #2B3240;
  --mut: #8A90A0;
  --faint: #A8AEBC;
  --ok: #0E9F6E;
  --ok-bg: #E7F6F0;
  --warn: #B45309;
  --warn-dot: #F59E0B;
  --warn-bg: #FDF3E7;
  --err: #EF4444;
  --info: #2563EB;
  --info-bg: #EAF0F8;
  --r-s: 8px;
  --r-m: 10px;
  --r-l: 12px;
  --shadow: 0 8px 24px rgba(15, 19, 25, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.adm-body {
  font-family: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

/* ============ 布局 ============ */
.adm { display: flex; min-height: 100vh; }

/* ---- 侧栏 ---- */
.adm-side {
  width: 236px;
  flex: 0 0 236px;
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-scroll { flex: 1; overflow-y: auto; padding: 14px 12px; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; }
.side-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #6D5CF6, #8F7BFB);
  color: #fff;
  display: grid; place-items: center;
}
.side-mark svg { width: 20px; height: 20px; }
.side-brand-text strong { display: block; font-size: 14px; letter-spacing: .2px; }
.side-brand-text em { display: block; font-style: normal; font-size: 11px; color: var(--mut); }

/* 导航项变多后允许滚动，避免矮窗口把底部账号块挤出去 */
.side-nav { flex: 1 1 auto; overflow-y: auto; padding-bottom: 4px; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: #E2E5EA; border-radius: 3px; }

.side-group {
  margin: 14px 8px 6px;
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--faint);
}
.side-item {
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 10px;
  border-radius: var(--r-s);
  color: var(--ink-2);
  font-size: 13px;
  margin-bottom: 2px;
}
.side-item svg { width: 16px; height: 16px; color: var(--mut); flex: 0 0 16px; }
.side-item:hover { background: #F5F6FA; }
.side-item.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.side-item.is-active svg { color: var(--brand); }
.side-badge {
  margin-left: auto;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px;
  background: var(--brand); color: #fff;
  font-size: 10px; font-style: normal; font-weight: 600;
  display: grid; place-items: center;
}

.side-foot {
  border-top: 1px solid var(--line);
  padding: 9px 8px;
  display: flex; align-items: center; gap: 8px;
}
/* 底部身份卡：整卡可点，打开「账号与权限」弹窗 */
.side-user {
  display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0;
  width: 100%; padding: 6px 7px;
  border: 0; background: transparent; border-radius: 10px;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  transition: background .15s ease;
}
.side-user:hover { background: #F4F5F9; }
.side-user:active { background: #EEF0F6; }
.side-user:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.side-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  flex: 0 0 32px;
}
.side-user-text { min-width: 0; flex: 1; }
.side-user-text strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-text em { display: block; font-style: normal; font-size: 11px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-chev {
  width: 22px; height: 22px; border-radius: 7px; flex: none;
  display: grid; place-items: center;
  color: var(--faint); background: #F2F3F7;
  transition: color .15s ease, background .15s ease, transform .15s ease;
}
.side-user-chev svg { width: 13px; height: 13px; }
.side-user:hover .side-user-chev { color: var(--ink-2); background: #E8EAF1; transform: translateX(1px); }
.side-exit {
  width: 30px; height: 30px; border: 0; border-radius: var(--r-s);
  background: transparent; color: var(--mut);
  display: grid; place-items: center;
}
.side-exit:hover { background: #F5F6FA; color: var(--err); }
.side-exit svg { width: 16px; height: 16px; }

/* ---- 主区域 ---- */
.adm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.adm-top {
  height: 64px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 5;
}
.adm-crumb { margin: 0; font-size: 12px; color: var(--mut); display: flex; gap: 8px; align-items: center; }
.adm-crumb i { color: #D3D7DF; font-style: normal; }
.adm-crumb strong { color: var(--ink-2); font-weight: 600; font-size: 12.5px; }
.top-flex { flex: 1; }
.top-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--line-2); border-radius: var(--r-s);
  background: var(--card); color: var(--ink-2);
  display: grid; place-items: center;
}
.top-btn svg { width: 15px; height: 15px; }
.top-btn.spin svg { animation: rot 1s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.top-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
}

.adm-content { flex: 1; padding: 24px; min-width: 0; }
.view { animation: fadein .18s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.view-loading { text-align: center; color: var(--mut); padding: 80px 0; }

/* ---- AI助手：内嵌全屏对话，去掉内容区内边距 ---- */
.adm-content.is-aihelper { padding: 0; }
.aihelper-frame { width: 100%; height: 100%; min-height: calc(100vh - 64px); background: #fff; }
.aihelper-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.spinner {
  display: inline-block; width: 22px; height: 22px;
  border: 2.5px solid var(--line-2); border-top-color: var(--brand);
  border-radius: 50%; animation: rot .8s linear infinite;
  margin-bottom: 10px;
}

/* ============ 通用组件 ============ */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.page-head h1 { margin: 0; font-size: 20px; font-weight: 600; }
.page-head .sub { margin: 4px 0 0; font-size: 12px; color: var(--mut); }
.head-actions { display: flex; gap: 10px; }

.btn {
  height: 32px; padding: 0 13px;
  border-radius: var(--r-s);
  border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink-2);
  font-size: 12px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { border-color: #C9CEDA; }
.btn svg { width: 13px; height: 13px; }
.btn-solid { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-solid:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn-danger { color: var(--err); }
.btn-danger:hover { border-color: var(--err); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-sm { height: 26px; padding: 0 9px; font-size: 11.5px; }

.card {
  background: var(--card);
  border-radius: var(--r-l);
  padding: 16px;
}
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-head strong { font-size: 13px; }
.card-head .sub { font-size: 11px; color: var(--mut); margin-top: 2px; }
.link { color: var(--brand); font-size: 11.5px; font-weight: 500; background: none; border: 0; padding: 0; }

/* 统计卡 · 对齐会员工作台 KPI 卡：右上图标 + 大字数值 + 环比标签 */
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.stat {
  background: var(--card); border-radius: var(--r-l);
  padding: 15px 18px 16px;
  display: flex; flex-direction: column; gap: 9px;
  box-shadow: 0 1px 2px rgba(24, 25, 28, .04);
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.stat-glyph {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center;
}
.stat-glyph svg { width: 15px; height: 15px; display: block; }
.stat-num {
  font-family: Inter, "Noto Sans SC", sans-serif;
  font-size: 27px; font-weight: 700; line-height: 1.12;
  letter-spacing: -.02em; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat-foot { display: flex; align-items: center; gap: 8px; min-height: 21px; }
.stat-foot em { font-style: normal; font-size: 11.5px; color: var(--mut); }
.delta {
  display: inline-flex; align-items: center; gap: 3px; flex: none;
  height: 21px; padding: 0 7px; border-radius: 11px;
  font-size: 11.5px; font-weight: 600; font-style: normal;
}
.delta svg { width: 11px; height: 11px; display: block; }
.delta--up { background: var(--ok-bg); color: var(--ok); }
.delta--down { background: #FDECEC; color: #D14343; }
.delta--warn { background: #FFF4E5; color: var(--warn); }
.delta--flat { background: var(--bg); color: var(--mut); }
.meta.ok { color: var(--ok); }
.meta.warn { color: var(--warn); }
.meta.mut { color: var(--mut); }

/* Tab 筛选 */
.tab-row { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }.tab {
  height: 32px; padding: 0 12px;
  border-radius: var(--r-s);
  border: 0; background: transparent;
  font-size: 12px; color: #6B7280; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { background: #EFF0F4; }
.tab.is-active { background: var(--card); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.tab .n { font-size: 11px; font-family: Inter, sans-serif; color: var(--faint); }
.tab.is-active .n { color: var(--brand); }
.tab .n.warn { color: var(--warn); }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .flex { flex: 1; }
/* 内容管理：分类 chips 与搜索框同一行，搜索框靠右 */
.filter-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-row .tab-row { margin-bottom: 0; }
/* 搜索框清除按钮：有输入时右侧出现 × */
.search-box { position: relative; display: inline-flex; }
.search-box .input { padding-right: 28px; }
.input-clear {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%;
  background: #E8EAF0; color: var(--mut); font-size: 13px; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
}
.input-clear:hover { background: #DCDFE8; color: var(--ink-2); }

/* 一级视图切换（会话 / 转人工策略、对话 / 图片 / 视频模型） */
.seg {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px; margin-bottom: 16px;
  border-radius: 10px; background: #ECEDF2;
}
.seg-item {
  height: 30px; padding: 0 14px;
  border: 0; border-radius: 8px; background: transparent;
  font-family: inherit; font-size: 12.5px; font-weight: 500; color: #6B7280;
  display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer; white-space: nowrap;
}
.seg-item:hover { color: var(--ink-2); }
.seg-item.is-on {
  background: #fff; color: var(--ink);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08), inset 0 0 0 1px rgba(16, 24, 40, .04);
}
.seg-num {
  min-width: 18px; height: 17px; padding: 0 5px;
  border-radius: 9px; background: #E0E2E9; color: #6B7280;
  font-size: 10.5px; font-style: normal; font-family: Inter, sans-serif;
  display: inline-flex; align-items: center; justify-content: center;
}
.seg-item.is-on .seg-num { background: var(--brand-soft); color: var(--brand); }
.seg-dot { width: 6px; height: 6px; border-radius: 50%; background: #C7CAD3; display: inline-block; }
.seg-dot.is-ok { background: var(--ok); }
/* 模型配置：对话 / 图片 / 视频三卡并排，不再用按钮切换 */
.model-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.model-card .int-top { align-items: flex-start; }
.mc-head { min-width: 0; }
.mc-head strong { display: block; font-size: 13px; }
.mc-head .sub { font-size: 11px; color: var(--mut); line-height: 1.45; margin-top: 1px; }
/* 窄卡里模型名普遍很长，允许收缩省略，不撑破卡片 */
.model-card .model-chip { max-width: 100%; }
.model-card .mc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1320px) { .model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 980px) { .model-grid { grid-template-columns: 1fr; } }

.input, .select, .textarea {
  height: 34px;
  border: 1px solid var(--line-2); border-radius: var(--r-s);
  background: var(--card);
  padding: 0 12px; font-size: 12.5px; color: var(--ink);
  font-family: inherit; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109, 92, 246, .12); }
.textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.6; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11px; font-weight: 500; color: var(--mut);
  padding: 12px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px 10px; border-bottom: 1px solid #F1F2F5; font-size: 12.5px; color: var(--ink-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #FAFBFC; }
.t-title strong { display: block; font-weight: 500; color: var(--ink-2); }
.t-title em { font-style: normal; font-size: 11px; color: var(--mut); }
.t-name strong { font-weight: 500; color: var(--ink-2); }
.t-email em { font-style: normal; font-size: 11px; color: var(--mut); }
.t-num { font-family: Inter, sans-serif; font-size: 12px; }
.t-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: nowrap; }
/* 操作按钮不许被压窄换行：中文两字一旦折行就变成竖排 */
.t-actions .btn { flex: 0 0 auto; white-space: nowrap; }
.t-empty { text-align: center; color: var(--mut); padding: 48px 0 !important; font-size: 12.5px; }

/* 商品表：商店标签 / 价格 / 角标 */
.kind-tag {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 8px;
  border-radius: 6px;
  font-size: 11px; font-weight: 500;
  white-space: nowrap;
  background: #F2F3F5; color: #5B6270;
}
.kind-tag.is-app { background: #EEF0FE; color: #5145CD; }
.kind-tag.is-wf { background: #E8F6F4; color: #0E7C6B; }
.kind-tag.is-tut { background: #FFF3E6; color: #B76A12; }
.kind-tag.is-agent { background: #F3EDFD; color: #7A4BC7; }
.kind-tag.is-tpl { background: #EDF3FD; color: #2A62B8; }
.price-now { font-weight: 600; color: var(--ink); font-family: Inter, sans-serif; }
.price-old { margin-left: 5px; color: var(--faint); font-size: 11px; font-family: Inter, sans-serif; }
.flag-mini {
  display: inline-block; margin-left: 5px; vertical-align: 1px;
  padding: 0 5px; height: 17px; line-height: 17px;
  border-radius: 4px; font-size: 10px; font-weight: 500;
  background: var(--brand-soft); color: var(--brand-deep);
  white-space: nowrap;
}
.toolbar-tip { font-size: 11.5px; color: var(--mut); }
.input-color { width: 88px !important; padding: 3px 4px; height: 34px; cursor: pointer; }

.pill {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 8px;
  border-radius: 6px;
  font-size: 11px; font-weight: 500;
  white-space: nowrap;
}
.pill-brand { background: var(--brand-soft); color: var(--brand-deep); }
.pill-info { background: var(--info-bg); color: var(--info); }
.pill-gray { background: #F2F3F5; color: #6B7280; }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-ok { background: var(--ok-bg); color: var(--ok); }

.dot-item { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; }
.dot-item i { width: 6px; height: 6px; border-radius: 50%; }
.dot-ok i { background: var(--ok); } .dot-ok { color: var(--ok); }
.dot-warn i { background: var(--warn-dot); } .dot-warn { color: var(--warn); }
.dot-err i { background: var(--err); } .dot-err { color: var(--err); }
.dot-gray i { background: #C4C9D4; } .dot-gray { color: var(--mut); }

/* 进度条 */
.quota { min-width: 110px; }
.quota .q-text { font-size: 11px; font-family: Inter, sans-serif; color: var(--ink-2); }
.quota .bar { width: 108px; height: 4px; border-radius: 2px; background: #EEF0F3; margin-top: 5px; overflow: hidden; }
.quota .bar i { display: block; height: 100%; border-radius: 2px; background: var(--brand); }

/* 双栏 */
.split { display: flex; gap: 16px; align-items: flex-start; }
.split .main-col { flex: 1; min-width: 0; }
.split .side-col { width: 288px; flex: 0 0 288px; }
.split .side-col.is-wide { width: 440px; flex: 0 0 440px; }

/* 看板 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chart-wrap { width: 100%; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.rank-list { margin: 0; padding: 0; list-style: none; }
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #F5F6F8; font-size: 12.5px; }
.rank-list li:last-child { border-bottom: 0; }
.rank-list .idx { width: 18px; height: 18px; border-radius: 5px; background: #F2F3F5; color: var(--mut); font-size: 10.5px; display: grid; place-items: center; flex: 0 0 18px; }
.rank-list li:nth-child(1) .idx { background: var(--brand-soft); color: var(--brand); }
.rank-list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.rank-list .pv { font-family: Inter, sans-serif; font-size: 12px; color: var(--mut); }

/* 需求 / 会话列表 */
.list-col { width: 400px; flex: 0 0 400px; }
.list-col.slim { width: 320px; flex-basis: 320px; }
.pick-list { margin: 0; padding: 0; list-style: none; max-height: 640px; overflow-y: auto; }
.pick-item {
  padding: 12px 12px;
  border-bottom: 1px solid #F5F6F8;
  cursor: pointer; border-radius: var(--r-s);
}
.pick-item:hover { background: #FAFBFC; }
.pick-item.is-active { background: var(--brand-soft); }
.pick-item .p-top { display: flex; align-items: center; gap: 8px; }
.pick-item .p-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-item.is-active .p-title { color: var(--brand-deep); }
.pick-item .p-sub { font-size: 11.5px; color: var(--mut); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-mini { flex: 0 0 auto; font-size: 10px; padding: 1px 6px; border-radius: 4px; background: #F2F3F5; color: #6B7280; }
.tag-mini.hot { background: var(--warn-bg); color: var(--warn); }

/* 登录失效：整页浮层，压住所有内容，只留一个动作 */
.sess-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 19, 25, .38);
  backdrop-filter: blur(2px);
}
.sess-card {
  width: 100%;
  max-width: 344px;
  padding: 26px 24px 20px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 24px 60px rgba(15, 19, 25, .18);
  text-align: center;
}
.sess-icon {
  width: 44px; height: 44px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
}
.sess-icon svg { width: 22px; height: 22px; }
.sess-card strong { display: block; font-size: 14.5px; color: var(--ink); margin-bottom: 7px; }
.sess-card p { margin: 0 0 18px; font-size: 12.5px; line-height: 1.7; color: var(--mut); }
.sess-actions { display: flex; gap: 8px; }
.sess-actions .btn { flex: 1; justify-content: center; text-decoration: none; }

.detail-empty { text-align: center; color: var(--mut); padding: 90px 20px; }
.detail-empty svg { width: 40px; height: 40px; margin: 0 auto 12px; color: #D8DCE4; }

.field-grid { display: grid; grid-template-columns: 88px 1fr; gap: 10px 14px; font-size: 12.5px; }
.field-grid dt { color: var(--mut); }
.field-grid dd { margin: 0; color: var(--ink-2); word-break: break-all; }

.note-item { padding: 10px 0; border-bottom: 1px solid #F5F6F8; font-size: 12px; }
.note-item:last-child { border-bottom: 0; }
.note-item .n-meta { color: var(--faint); font-size: 11px; margin-bottom: 3px; }

/* 气泡（会话） */
.msg-flow { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }
.msg-row { display: flex; gap: 10px; max-width: 78%; }
.msg-row.is-user { align-self: flex-end; flex-direction: row-reverse; }
.msg-bubble {
  background: #F5F6F8; border-radius: 12px 12px 12px 4px;
  padding: 9px 12px; font-size: 12.5px; color: var(--ink-2);
  white-space: pre-wrap; word-break: break-word; line-height: 1.65;
}
.msg-row.is-user .msg-bubble { background: var(--brand); color: #fff; border-radius: 12px 12px 4px 12px; }
.msg-time { font-size: 10.5px; color: var(--faint); margin-top: 4px; }

/* 智能体卡 */
.agent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.agent-card { background: var(--card); border-radius: var(--r-l); padding: 14px 16px; }
.agent-top { display: flex; align-items: center; gap: 10px; }
.agent-ico { width: 38px; height: 38px; border-radius: 10px; background: #F2F3F5; overflow: hidden; flex: 0 0 38px; display: grid; place-items: center; font-weight: 700; color: var(--mut); }
.agent-ico img { width: 100%; height: 100%; object-fit: cover; }
.agent-top strong { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.agent-card .desc { font-size: 11.5px; color: var(--mut); margin: 9px 0 10px; min-height: 34px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.agent-foot { display: flex; align-items: center; justify-content: space-between; }
.agent-foot .time { font-size: 11px; color: var(--faint); font-family: Inter, sans-serif; }
.tag-mini.draft { background: var(--warn-bg); color: var(--warn); }

/* 勾选与批量操作：全选框 + 卡片勾选框 + 选中后的批量条 */
.ag-sel-all { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--mut); cursor: pointer; user-select: none; margin-right: 2px; }
.ag-sel-all input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.ag-check { display: inline-flex; align-items: center; cursor: pointer; flex: 0 0 auto; }
.ag-check input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.sel-bar { display: flex; align-items: center; gap: 8px; background: var(--brand-soft, #F1EFFE); border: 1px solid #DCD7FB; border-radius: var(--r-m, 10px); padding: 8px 12px; margin-bottom: 12px; }
.sel-bar .sel-count { font-size: 12.5px; color: var(--brand); font-weight: 600; }
.sel-bar .btn { padding: 4px 12px; }
.sel-bar[hidden] { display: none; }

/* 智能体列表分页 */
.pager-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pager-info { font-size: 11.5px; color: var(--mut); }
.pager-btns { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.pager-btns .btn { min-width: 26px; justify-content: center; padding: 0 7px; font-family: Inter, sans-serif; }
.pager-btns .btn.is-cur { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager-gap { font-size: 11.5px; color: var(--faint); padding: 0 2px; }

/* 开关 */
.switch { position: relative; width: 34px; height: 20px; border-radius: 10px; background: #D8DCE4; border: 0; transition: background .15s; flex: 0 0 34px; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.is-on { background: var(--brand); }
.switch.is-on::after { transform: translateX(14px); }

/* 权益表 */
/* 套餐权益表：固定布局，第一列给足宽度，避免「权益项」被压成一字一行 */
.plan-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.plan-table th, .plan-table td { border-bottom: 1px solid #F5F6F8; padding: 10px 7px; font-size: 12.5px; text-align: center; }
.plan-table th { color: var(--mut); font-weight: 500; font-size: 11.5px; }
.plan-table td:first-child, .plan-table th:first-child {
  width: 108px;
  text-align: left;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-table .num-in { width: 100%; height: 30px; padding: 0 6px; text-align: center; font-size: 12.5px; }
/* 独立页（权益设置）里的宽版：第一列更宽，输入框不拉满、居中留白 */
.plan-table.is-page td:first-child, .plan-table.is-page th:first-child { width: 180px; font-size: 13px; }
.plan-table.is-page th, .plan-table.is-page td { padding: 13px 10px; }
.plan-table.is-page th:not(:first-child) { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.plan-table.is-page .num-in { max-width: 180px; margin: 0 auto; display: block; height: 34px; }

/* 主列表：窗口窄时横向滚动，不压缩列宽 */
.table-scroll { overflow-x: auto; }
.table-scroll .table { min-width: 780px; }

/* 轻提示条 */
.notice {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px; padding: 10px 14px;
  border-radius: var(--r-m);
  background: #FFF8EC; border: 1px solid #FBE3BC;
  font-size: 12px; color: #8A5B12;
}
.notice a { color: #8A5B12; text-decoration: underline; }

/* 弹层 */
.modal-mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15, 19, 25, .4);
  display: grid; place-items: center;
  padding: 24px;
}
.modal {
  width: 560px; max-width: 100%;
  max-height: 86vh;
  background: var(--card); border-radius: 14px;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  animation: pop .16s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.modal-head strong { font-size: 15px; }
.modal-close { width: 28px; height: 28px; border: 0; background: #F2F3F5; border-radius: 7px; color: var(--mut); display: grid; place-items: center; }
.modal-close svg { width: 14px; height: 14px; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { padding: 0 20px 18px; display: flex; justify-content: flex-end; gap: 10px; }

/* 账号与权限弹窗（侧栏底部身份卡入口，参考 X / 创作中枢的账号设置弹窗） */
.modal-acc { width: 760px; }
.modal-acc .modal-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.modal-acc .modal-body { padding: 0; overflow: hidden; display: flex; }
.modal-acc .modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); align-items: center; }
/* .btn 自带 display:inline-flex，会盖掉 [hidden]，这里显式兜住 */
.modal-acc .modal-foot .btn[hidden] { display: none; }
.acc-wrap { display: flex; width: 100%; min-height: 392px; max-height: 60vh; }
.acc-nav {
  width: 172px; flex: none; padding: 12px 10px;
  border-right: 1px solid var(--line); background: #FBFBFD;
  display: flex; flex-direction: column; gap: 2px;
}
.acc-nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 0; border-radius: 8px;
  background: transparent; font: inherit; font-size: 12.5px; color: var(--ink-2);
  text-align: left; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.acc-nav-item svg { width: 15px; height: 15px; flex: none; color: var(--mut); }
.acc-nav-item:hover { background: #F1F2F7; }
.acc-nav-item.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.acc-nav-item.is-active svg { color: var(--brand); }
.acc-pane { flex: 1; min-width: 0; overflow-y: auto; padding: 18px 22px 22px; }
/* 只读字段（邮箱账号）与可编辑字段拉开层次 */
.acc-pane .input[disabled] { background: #F7F8FA; color: var(--mut); cursor: not-allowed; }
.acc-sec h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--ink); }
.acc-hint { margin: 0 0 16px; font-size: 11.5px; color: var(--mut); line-height: 1.6; }
.acc-avatar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.acc-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #6D5CF6, #9B8BFA);
  color: #fff; display: grid; place-items: center;
  font-size: 20px; font-weight: 700;
}
.acc-avatar-meta { min-width: 0; }
.acc-avatar-meta strong { display: block; font-size: 13px; color: var(--ink); }
.acc-avatar-meta em { display: block; font-style: normal; font-size: 11px; color: var(--mut); margin-top: 2px; }
.acc-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font: inherit; text-align: left; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.acc-row:hover { border-color: #D8D3FB; box-shadow: 0 2px 10px rgba(109, 92, 246, .09); }
.acc-row .int-logo { width: 30px; height: 30px; border-radius: 8px; font-size: 11px; flex: none; }
.acc-row-meta { flex: 1; min-width: 0; }
.acc-row-meta strong { display: block; font-size: 12.5px; color: var(--ink-2); }
.acc-row-meta em {
  display: block; font-style: normal; font-size: 11px; color: var(--faint);
  font-family: 'SF Mono', Consolas, Monaco, monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.acc-row-arrow { color: var(--faint); font-size: 11px; flex: none; }
.acc-go { margin-right: auto; font-size: 12px; color: var(--brand); text-decoration: none; }
.acc-go:hover { text-decoration: underline; }
.acc-meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--mut); padding-top: 2px; }
.acc-meta strong { font-weight: 500; color: var(--ink-2); }
@media (max-width: 760px) {
  .modal-acc { width: 100%; }
  .acc-wrap { flex-direction: column; min-height: 0; }
  .acc-nav { width: auto; flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; }
}
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.form-item .input, .form-item .select, .form-item .textarea { width: 100%; }
.form-item .hint { font-size: 11px; color: var(--faint); margin-top: 4px; }
/* 新建内容弹窗：同步写入多维表 */
.sync-row { display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 500; }
.sync-row input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--pri); cursor: pointer; }
.sync-list { max-height: 190px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 6px; background: var(--bg, #fff); }
.sync-item { padding: 7px 12px; font-size: 12px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.sync-item:hover { background: rgba(109, 92, 246, 0.08); }
.sync-item.is-active { color: var(--pri); font-weight: 600; }
.sync-item .sync-check { font-size: 11px; }
.sync-more { padding: 7px 12px; font-size: 11px; color: var(--faint); }
/* 字段映射：文章字段 → 表字段 */
.sync-map { margin-top: 10px; }
.sync-map-head { font-size: 11px; color: var(--faint); margin-bottom: 2px; }
.sync-map-row > span { min-width: 56px; width: auto; }
.sync-map-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.sync-map-row > span { font-size: 12px; width: 34px; flex: none; color: var(--mut); }
.sync-map-row select { flex: 1; }
.sync-map-row .sync-miss { font-size: 10px; color: #d97706; font-style: normal; flex: none; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 无权限提示（已登录但非站长） */
.deny {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background: var(--bg);
}
.deny-card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px 30px 26px;
  text-align: center;
}
.deny-glyph {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: 16px;
}
.deny-glyph svg { width: 24px; height: 24px; }
.deny-card h1 { font-size: 17px; font-weight: 700; color: var(--ink); margin: 0 0 10px; letter-spacing: -.01em; }
.deny-desc { font-size: 13px; line-height: 1.75; color: var(--mut); margin: 0 0 4px; }
.deny-desc strong { color: var(--ink-2); font-weight: 600; }
.deny-desc .pill { margin: 0 2px; vertical-align: 1px; }
.deny-tip {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--warn);
  background: var(--warn-bg);
  border-radius: var(--r-m);
  padding: 10px 12px;
  margin: 14px 0 20px;
  text-align: left;
}
.deny-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.deny-actions .btn { height: 36px; padding: 0 16px; font-size: 12.5px; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  font-size: 12.5px; padding: 9px 16px;
  border-radius: 8px; z-index: 60;
  box-shadow: var(--shadow);
  animation: fadein .18s ease;
}
.toast.is-err { background: var(--err); }

/* 集成卡 */
.int-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
/* 其他配置分排：第一排 2 列（Coze / Knocket），第二排 3 列（高德 / 腾讯 / OpenWeatherMap） */
.int-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.int-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1240px) { .int-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .int-grid.cols-2, .int-grid.cols-3 { grid-template-columns: minmax(0, 1fr); } }
/* 邮箱配置页：三列 —— ① 发信通道 + 生效配置 ② 邮件模板源码 ③ 运行结果预览 */
.mail-grid3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.mail-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (max-width: 1000px) { .mail-grid3 { grid-template-columns: minmax(0, 1fr); } }
.tpl-pane { background: var(--card); border-radius: var(--r-l); padding: 14px; display: flex; flex-direction: column; min-width: 0; }
.tpl-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tpl-title { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tpl-meta { font-size: 11px; color: var(--mut); }
.tpl-meta.is-custom { color: var(--brand-deep); font-weight: 600; }
.tpl-auto { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--mut); cursor: pointer; user-select: none; white-space: nowrap; }
.tpl-auto input { accent-color: var(--brand); margin: 0; }
.tpl-code {
  width: 100%; box-sizing: border-box; height: 430px; resize: vertical;
  border: 1px solid var(--line); border-radius: var(--r-m); background: #FCFCFD;
  padding: 10px 12px; font-family: 'SF Mono', Consolas, Monaco, monospace;
  font-size: 12px; line-height: 1.65; color: var(--ink-2); tab-size: 2;
}
.tpl-code:focus { outline: none; border-color: var(--brand); }
.tpl-frame { width: 100%; height: 492px; border: 1px solid var(--line); border-radius: var(--r-m); background: #fff; display: block; }
.tpl-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.tpl-mini { padding: 5px 10px; font-size: 12px; }
.tpl-pane.is-full { position: fixed; inset: 20px; z-index: 70; box-shadow: var(--shadow); }
.tpl-pane.is-full .tpl-frame { flex: 1; height: auto; }
/* 邮箱配置页旧两列布局（保留兜底） */
.mail-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1120px) { .mail-grid { grid-template-columns: minmax(0, 1fr); } }
.int-card { background: var(--card); border-radius: var(--r-l); padding: 16px; }
.int-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.int-logo { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.int-logo.agnes { background: #EAF0F8; color: var(--info); }
.int-logo.image { background: #FFF1E6; color: #C2410C; }
.int-logo.video { background: #EDEBFF; color: var(--brand-deep); }
.int-logo.coze { background: var(--brand-soft); color: var(--brand); }
.int-logo.amap { background: #E7F6EF; color: #0E9F6E; }
.int-logo.tencent { background: #E8F0FF; color: #0052D9; }
.int-logo.owm { background: #FFF1E6; color: #C2410C; }
.int-logo.knocket { background: #E8F1FF; color: #1D4ED8; }
.int-logo.mail { background: #EAF2FE; color: #0369A1; }
.int-logo.notion { background: #F2F2EF; color: #1F1F1F; border: 1px solid #E4E4DF; }
.int-logo.feishu { background: #E8F1FF; color: #0052D9; }
.int-logo.supabase { background: #EAFAF0; color: #0E9F6E; }
.kv { display: flex; justify-content: space-between; font-size: 12px; padding: 6px 0; border-bottom: 1px solid #F5F6F8; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--mut); }
.kv strong { font-weight: 500; color: var(--ink-2); font-family: Inter, sans-serif; }

/* 邮箱配置：服务商折叠卡片（默认收缩，点击在弹窗里配置） */
.prov-list { display: flex; flex-direction: column; gap: 10px; }
.prov-card { background: var(--card); border: 1px solid var(--line, #ECECF1); border-radius: var(--r-l, 14px); overflow: hidden; }
.prov-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; user-select: none; transition: background .15s ease; }
.prov-head:hover { background: #FAFAFB; }
.prov-head .int-logo { width: 32px; height: 32px; border-radius: 8px; font-size: 12px; flex: none; }
.prov-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.prov-meta strong { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.prov-sub { font-size: 11px; color: var(--mut); }

/* 弹窗（参考 X / Twitter 连接弹窗；mp- 前缀避免与既有 .modal 体系冲突） */
.mp-overlay { position: fixed; inset: 0; background: rgba(15,18,35,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; animation: mpFade .15s ease; }
@keyframes mpFade { from { opacity: 0; } to { opacity: 1; } }
.mp-modal { width: 520px; max-width: calc(100vw - 32px); max-height: 86vh; overflow: auto; background: #fff; border-radius: 16px; box-shadow: 0 18px 60px rgba(15,18,35,.28); animation: mpPop .18s ease; }
@keyframes mpPop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.mp-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line, #ECECF1); }
.mp-head .int-logo { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.mp-titles { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.mp-titles strong { font-size: 15px; font-weight: 600; color: var(--ink); }
.mp-sub { font-size: 11px; color: var(--mut); }
.mp-close { width: 30px; height: 30px; border: 0; background: #F2F3F7; color: var(--mut); border-radius: 8px; font-size: 18px; line-height: 1; cursor: pointer; flex: none; }
.mp-close:hover { background: #E7E9F0; color: var(--ink); }
.mp-body { padding: 18px; }
.mp-body .form-item:last-child { margin-bottom: 0; }
.mp-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line, #ECECF1); }

/* 大模型服务：修改模型折叠面板 + 模型目录 */
.int-grid { align-items: start; }

/* 数据库配置：数据表 / 图床 两栏，卡片列表 + 点击展开 */
.db-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.db-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.db-col-head { display: flex; align-items: baseline; gap: 10px; margin: 2px 2px 0; }
.db-col-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.db-col-note { font-size: 12px; color: var(--mut); }
.db-card { background: var(--card); border: 1px solid var(--line, #ECECF1); border-radius: var(--r-l, 14px); overflow: hidden; }
.db-card + .db-card { margin-top: 0; }
.db-card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; user-select: none; transition: background .15s ease; }
.db-card-head:hover { background: #FAFAFB; }
.db-card-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.db-card-meta strong { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.db-card-sub { font-size: 11px; color: var(--mut); }
.db-chevron { margin-left: 4px; color: var(--mut); flex: none; transition: transform .2s ease; }
.db-card.is-open .db-chevron { transform: rotate(180deg); }
.db-card-body { display: none; padding: 0 16px 16px; border-top: 1px solid var(--line, #ECECF1); }
.db-card-body .form-item:first-child { margin-top: 14px; }
.db-card.is-open .db-card-body { display: block; }
.db-card-body .hint { margin-bottom: 0; }
@media (max-width: 980px) { .db-cols { grid-template-columns: minmax(0, 1fr); } }
.int-adv {
  margin: 2px 0 12px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: #FCFCFD;
}
.int-adv > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 0;
  font-size: 12px;
  color: var(--ink-2);
}
.int-adv > summary::-webkit-details-marker { display: none; }
.int-adv > summary::before {
  content: '';
  width: 0; height: 0;
  flex: 0 0 auto;
  border-left: 4.5px solid var(--mut);
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
  transition: transform .15s;
}
.adv-sp { flex: 1; }
.int-adv > summary .link {
  flex: 0 0 auto;
  padding: 2px 4px;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}
.int-adv > summary .link:hover { background: var(--brand-soft); }
.int-adv[open] > summary::before { transform: rotate(90deg); }
.int-adv[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.adv-block { margin-bottom: 10px; }
.adv-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.adv-head span:first-child { font-size: 11.5px; font-weight: 500; color: var(--ink-2); }
.adv-head .sub { font-size: 11px; color: var(--faint); }
.model-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.model-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 4px 0 8px;
  border-radius: 13px;
  background: #F4F5F7;
  border: 1px solid transparent;
  font-size: 11.5px;
  color: var(--ink-2);
  font-family: Inter, sans-serif;
}
.model-chip.is-default { background: var(--brand-soft); border-color: #DAD4FE; color: var(--brand-deep); }
.mc-name { white-space: nowrap; }
.mc-dot {
  width: 9px; height: 9px;
  flex: 0 0 auto;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid #C9CEDA;
  background: #fff;
  cursor: pointer;
}
.model-chip.is-default .mc-dot {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: inset 0 0 0 2px #fff;
}
.mc-del {
  width: 16px; height: 16px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--faint);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.mc-del:hover { background: #E7E9EE; color: var(--ink-2); }
.chip-empty { font-size: 11.5px; color: var(--faint); margin: 0 0 8px; }
.int-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.mc-check { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); }

/* 字段标签 + 行内操作（如「默认模型」旁的「获取模型」） */
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.label-row label { margin-bottom: 0; }
.label-row .link { font-size: 12px; }

/* 选择要添加的模型（一键获取） */
.mc-pick-tip { margin: 0 0 10px; font-size: 12px; line-height: 1.55; color: var(--mut); }
.mc-pick-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.mc-pick-tools .input { flex: 1; height: 32px; }
.mc-pick-list {
  max-height: 306px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 8px; padding: 4px;
  background: #FCFCFD;
}
.mc-pick-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 6px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer;
}
.mc-pick-row:hover { background: #F4F5F8; }
.mc-pick-row input { margin: 0; flex: 0 0 auto; accent-color: var(--brand); }
.mc-pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Coze 选智能体时：名字在左，Bot ID 在右，便于肉眼核对 */
.mc-pick-id {
  flex: 0 0 auto; font-size: 11px; color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mc-pick-tag {
  flex: 0 0 auto; font-size: 10.5px; color: var(--faint);
  background: #F0F1F4; border-radius: 4px; padding: 1px 6px;
}

.t-nowrap { white-space: nowrap; }

/* 用户管理：套餐 pill 可点（切换套餐） */
.plan-btn { border: 0; cursor: pointer; font-family: inherit; }
.plan-btn:hover { filter: brightness(.96); }

/* 为单个用户分配套餐 */
.plan-opts { display: flex; flex-direction: column; gap: 8px; }
.plan-opt {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 12px; text-align: left;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--card); cursor: pointer; font-family: inherit;
  transition: border-color .15s, background .15s;
}
.plan-opt:hover { border-color: var(--line-2); background: #FAFAFC; }
.plan-opt.is-on { border-color: var(--brand); background: var(--brand-soft); }
.plan-opt-name { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.plan-opt-name em {
  font-style: normal; font-size: 10.5px; font-weight: 500;
  color: var(--brand-deep); background: #FFF; border-radius: 4px; padding: 1px 5px;
}
.plan-opt-meta { font-size: 11.5px; color: var(--mut); }

/* 响应式 */
@media (max-width: 1100px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .agent-grid { grid-template-columns: repeat(2, 1fr); }
  .split { flex-direction: column; }
  .list-col, .side-col, .split .side-col.is-wide { width: 100%; flex-basis: auto; }
  .grid-2, .int-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .adm-side { display: none; }
  .adm-content { padding: 16px; }
  .agent-grid { grid-template-columns: 1fr; }
}

/* 文章模板设置弹窗 */
.tpl-tip { font-size: 11.5px; color: var(--mut); margin: 0 0 12px; }
.tpl-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.tpl-field { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--mut); }
.tpl-group { font-size: 12px; font-weight: 600; color: var(--ink, #1c1f26); margin: 4px 0 8px; }
.tpl-checks { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px 12px; }
.tpl-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; user-select: none; }
.tpl-check input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
@media (max-width: 760px) {
  .tpl-row3, .tpl-checks { grid-template-columns: 1fr 1fr; }
}
.tpl-row4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 10px; }
.tpl-color-row { display: inline-flex; align-items: center; gap: 8px; height: 32px; }
.tpl-color-row input[type="color"] { width: 42px; height: 26px; padding: 0; border: 1px solid #E3E6EC; border-radius: 6px; background: #fff; cursor: pointer; }
.tpl-color-row input[type="color"][disabled] { cursor: not-allowed; opacity: .45; }
.tpl-color-row em { font-style: normal; font-size: 11px; color: var(--mut); }
@media (max-width: 760px) { .tpl-row4 { grid-template-columns: 1fr 1fr; } }
.tpl-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tpl-preset { border: 1px solid #E3E6EC; border-radius: 10px; padding: 6px; background: #fff; cursor: pointer; display: flex; flex-direction: column; gap: 6px; text-align: left; transition: border-color .15s, box-shadow .15s; }
.tpl-preset:hover { border-color: var(--brand); }
.tpl-preset.on { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(109, 92, 246, .16); }
.tpl-prev { display: flex; flex-direction: column; gap: 4px; height: 58px; border-radius: 6px; padding: 9px 10px; border: 1px solid rgba(0,0,0,.06); }
.tpl-prev i { display: block; width: 26px; height: 8px; border-radius: 2px; }
.tpl-prev b { display: block; width: 72%; height: 7px; border-radius: 2px; background: rgba(0,0,0,.78); }
.tpl-prev u { display: block; height: 4px; border-radius: 2px; text-decoration: none; }
.tpl-pname { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--ink, #1c1f26); }
.tpl-pname em { font-style: normal; font-size: 10.5px; font-weight: 500; color: var(--brand); }
/* 模板弹窗：左表单 + 右实时预览 */
.modal-wide { width: 980px; }
.tpl-wrap { display: flex; gap: 18px; align-items: flex-start; }
.tpl-form { flex: 1; min-width: 0; }
.tpl-side { width: 300px; flex-shrink: 0; position: sticky; top: 0; }
.tpl-stage { border: 1px solid var(--line, #E3E6EC); border-radius: 10px; overflow: hidden; background: #fff; }
/* 预览缩略元素 */
.tp-page { padding: 12px; min-height: 330px; }
.tp-crumb { font-size: 9px; color: rgba(0,0,0,.38); margin-bottom: 7px; }
.tp-row { display: flex; gap: 10px; }
.tp-main { transition: width .15s; min-width: 0; }
.tp-chip { display: inline-block; font-size: 9px; line-height: 1; padding: 3px 7px; border-radius: 20px; border: 1px solid transparent; margin-bottom: 6px; }
.tp-title { font-weight: 700; color: #17181C; line-height: 1.35; letter-spacing: .2px; }
.tp-meta { display: flex; align-items: center; gap: 6px; font-size: 9px; color: rgba(0,0,0,.45); margin-top: 6px; }
.tp-meta i { width: 2px; height: 2px; border-radius: 50%; background: rgba(0,0,0,.3); }
.tp-lead { color: rgba(0,0,0,.52); border-left: 2px solid rgba(0,0,0,.12); padding-left: 7px; margin-top: 8px; line-height: 1.6; }
.tp-cover { background: linear-gradient(135deg, rgba(109,92,246,.18), rgba(109,92,246,.05)); border: 1px dashed rgba(109,92,246,.3); margin: 9px 0; }
.tp-page p { margin: 7px 0; color: #2B2D33; }
.tp-page a { text-decoration: underline; }
.tp-pn { display: flex; justify-content: space-between; font-size: 9px; color: rgba(0,0,0,.5); border-top: 1px solid rgba(0,0,0,.08); padding-top: 7px; margin-top: 10px; }
.tp-rel { margin-top: 9px; }
.tp-rel b { display: block; font-size: 9px; color: rgba(0,0,0,.55); margin-bottom: 5px; }
.tp-rel div { display: flex; gap: 6px; }
.tp-rel u { flex: 1; height: 16px; border-radius: 5px; background: rgba(0,0,0,.06); text-decoration: none; }
.tp-toc { width: 56px; flex-shrink: 0; border-left: 1px solid rgba(0,0,0,.08); padding-left: 9px; display: flex; flex-direction: column; gap: 7px; padding-top: 3px; }
.tp-toc u { height: 4px; border-radius: 2px; background: rgba(0,0,0,.16); text-decoration: none; }
.tp-toc u:first-child { width: 80%; }
@media (max-width: 900px) {
  .modal-wide { width: 560px; }
  .tpl-wrap { flex-direction: column; }
  .tpl-side { width: 100%; position: static; }
}
.tag-mini.tpl-tag { margin-left: 6px; vertical-align: 1px; background: rgba(109, 92, 246, .1); color: var(--pri); }
.tag-mini.vid-tag { margin-left: 6px; vertical-align: 1px; background: rgba(245, 158, 11, .12); color: #B45309; }
.int-logo.coze { background: linear-gradient(135deg, #4E5BFF, #7C3AED); color: #fff; }

/* 内容管理：文章/视频大按钮 Tab（参照「＋ 新建内容」） */
.kind-tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 20px; border: 1px solid var(--line, #E3E6EC); border-radius: 9px; background: #fff; font-size: 13.5px; font-weight: 600; color: var(--ink, #1c1f26); cursor: pointer; transition: all .15s; }
.kind-tab .kt-ico { font-size: 15px; line-height: 1; }
.kind-tab .kt-n { font-size: 11px; font-weight: 600; background: rgba(0, 0, 0, .07); border-radius: 10px; padding: 2px 8px; color: var(--mut); }
.kind-tab:hover { border-color: var(--brand); color: var(--brand); }
.kind-tab.is-active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(109, 92, 246, .28); }
.kind-tab.is-active .kt-n { background: rgba(255, 255, 255, .24); color: #fff; }

/* ============ UI 界面：组件库 / 画布 / 属性 三栏 ============ */
.ui-shell { display: grid; grid-template-columns: 268px minmax(0, 1fr) 310px; gap: 12px; height: calc(100vh - 208px); min-height: 560px; }
.ui-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); display: flex; flex-direction: column; overflow: hidden; }
.ui-list-head { padding: 11px 14px; font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--mut); }
.ui-list-head span { color: var(--faint); font-weight: 500; }
.ui-list-body { overflow-y: auto; padding: 6px; }
.ui-group { font-size: 10.5px; color: var(--faint); padding: 9px 9px 5px; letter-spacing: .3px; margin: 0; }
.ui-item { display: flex; align-items: center; gap: 6px; width: 100%; padding: 7px 9px; border: 0; background: transparent; border-radius: 7px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; text-align: left; transition: background .12s; }
.ui-item:hover { background: var(--brand-soft); }
.ui-item.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.ui-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-badge { font-style: normal; font-size: 10px; padding: 1px 5px; border-radius: 4px; background: var(--warn-bg); color: var(--warn); }
.ui-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); flex-shrink: 0; }

.ui-stage { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.ui-bar { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #FBFBFD; }
.ui-url { font-size: 11.5px; color: var(--mut); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-frame-wrap { flex: 1; overflow: auto; background: #F2F3F7; padding: 12px; display: flex; justify-content: center; align-items: flex-start; }
.ui-frame-inner { width: 100%; max-width: 100%; min-height: 100%; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 6px 22px rgba(20, 20, 40, .08); transition: max-width .18s; }
.ui-frame-inner iframe { width: 100%; height: 100%; min-height: 560px; border: 0; display: block; background: #fff; }

.ui-props { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px; overflow-y: auto; }
.ui-props-title { font-size: 12.5px; font-weight: 600; margin: 0 0 12px; display: flex; justify-content: space-between; gap: 6px; }
.ui-props-title span { font-size: 10.5px; color: var(--faint); font-weight: 500; font-family: ui-monospace, monospace; }
.ui-seg { display: inline-flex; background: #F2F3F7; border-radius: 7px; padding: 2px; gap: 2px; }
.ui-seg button { border: 0; background: transparent; padding: 5px 10px; font-size: 11.5px; border-radius: 5px; cursor: pointer; color: var(--mut); transition: all .12s; }
.ui-seg button:hover { color: var(--ink-2); }
.ui-seg button.is-active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 3px rgba(15, 19, 25, .1); }
.ui-meta { font-size: 10.5px; color: var(--faint); margin: 12px 0; }
.ui-actions { display: flex; gap: 8px; justify-content: flex-end; }

@media (max-width: 1180px) {
  .ui-shell { grid-template-columns: 236px minmax(0, 1fr); height: auto; }
  .ui-props { grid-column: 1 / -1; }
}

/* UI 界面：属性面板里的导航栏开关 */
.ui-switch-row { display: flex; align-items: center; gap: 9px; height: 32px; }
.ui-switch-txt { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }

/* ============ 侧边导航：收起 / 展开 ============ */
.adm-side { transition: width .18s ease, flex-basis .18s ease; }
/* sticky 自成层叠上下文，需抬高层级，否则侧栏会压住顶栏 */
.adm-side { z-index: 12; }
/* 收起过程内层保持原宽度，避免文字重排抖动 */
.adm-side > .side-scroll,
.adm-side > .side-foot { min-width: 236px; }

/* 显隐按钮放在顶栏左上角（面包屑左侧），始终可见 */
.side-toggle { margin-right: -2px; }
.side-toggle svg { transition: transform .18s ease; }
.side-toggle:hover { color: var(--brand); border-color: var(--brand); }
/* 收起后图标镜像：面板竖线换到右侧，暗示「往左展开回来」 */
.adm.is-side-collapsed .side-toggle { color: var(--brand); border-color: #DAD5FF; background: #F4F2FF; }
.adm.is-side-collapsed .side-toggle svg { transform: scaleX(-1); }

.adm.is-side-collapsed .adm-side {
  width: 0; flex: 0 0 0;
  border-right-width: 0;
  overflow: hidden;
}

/* ============================================================
   UI 界面 · 组件化画布（参考 Coze UI Builder）
   ============================================================ */
/* ---- 左栏：组件库 / 页面 / 结构 ---- */
.ui-left { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.ui-tabs { display: flex; gap: 2px; padding: 7px 8px 0; border-bottom: 1px solid var(--line); }
.ui-tabs button { flex: 1; border: 0; background: transparent; padding: 7px 6px 9px; font-size: 12.5px; color: var(--mut); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.ui-tabs button:hover { color: var(--ink-2); }
.ui-tabs button.is-active { color: var(--brand); font-weight: 600; border-bottom-color: var(--brand); }
.ui-left-body { flex: 1; overflow-y: auto; padding: 8px; }

.cmp-grp { margin-bottom: 6px; }
.cmp-grp-h { width: 100%; display: flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 7px 6px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.cmp-grp-h span { flex: 1; text-align: left; }
.cmp-grp-h i { font-style: normal; font-size: 10px; color: var(--faint); font-weight: 500; }
.cmp-grp-h svg { width: 13px; height: 13px; color: var(--faint); transition: transform .16s; transform: rotate(90deg); }
.cmp-grp.is-closed .cmp-grp-h svg { transform: rotate(0deg); }
.cmp-grp.is-closed .cmp-grid { display: none; }
.cmp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 2px 0 8px; }
.cmp-card { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 9px 4px 7px; border: 1px solid var(--line); border-radius: 9px; background: #FBFBFD; cursor: grab; transition: all .13s; }
.cmp-card:hover { border-color: var(--gc); background: #fff; box-shadow: 0 3px 10px rgba(20, 20, 40, .07); transform: translateY(-1px); }
.cmp-card:active { cursor: grabbing; }
.cmp-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--gc) 12%, #fff); color: var(--gc); }
.cmp-ico svg { width: 16px; height: 16px; }
.cmp-card em { font-style: normal; font-size: 10.5px; color: var(--ink-2); line-height: 1.2; text-align: center; }
.cmp-tip { font-size: 10.5px; color: var(--faint); line-height: 1.6; margin: 4px 4px 8px; }

.ui-dirty { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); flex-shrink: 0; }

.tree-page { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 8px 6px 10px; border-bottom: 1px dashed var(--line); margin-bottom: 6px; }
.tree-page-ico { width: 16px; height: 16px; color: var(--brand); }
.tree-page-ico svg { width: 16px; height: 16px; }
.tree-page em { font-style: normal; font-size: 10px; color: var(--faint); font-weight: 500; margin-left: auto; }
.tree-row { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 12px; border-radius: 6px; cursor: pointer; font-size: 12px; color: var(--ink-2); }
.tree-row:hover { background: var(--brand-soft); }
.tree-row.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.tree-row.is-off { opacity: .5; }
.tree-ico { width: 14px; height: 14px; display: grid; place-items: center; flex-shrink: 0; }
.tree-ico svg { width: 14px; height: 14px; }
.tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-eye, .tree-del { border: 0; background: transparent; color: var(--faint); cursor: pointer; font-size: 11px; padding: 2px 3px; border-radius: 4px; line-height: 1; }
.tree-eye:hover { color: var(--brand); }
.tree-del:hover { color: var(--err); background: #FEF2F2; }
.tree-empty { text-align: center; color: var(--faint); font-size: 11.5px; line-height: 1.8; padding: 40px 12px; }

/* ---- 中栏工具条 ---- */
.ui-ico { width: 28px; height: 28px; border: 1px solid var(--line-2); border-radius: 7px; background: #fff; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.ui-ico:hover { color: var(--brand); border-color: var(--brand); }
.ui-ico:disabled { opacity: .38; cursor: default; color: var(--faint); border-color: var(--line); }
.ui-ico svg { width: 14px; height: 14px; }
.ui-zoom { display: inline-flex; align-items: center; height: 28px; border: 1px solid var(--line-2); border-radius: 7px; background: #fff; overflow: hidden; }
.ui-zoom button { width: 24px; height: 26px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 13px; line-height: 1; }
.ui-zoom button:hover { background: var(--brand-soft); color: var(--brand); }
.ui-zoom span { min-width: 40px; text-align: center; font-size: 11px; color: var(--mut); font-variant-numeric: tabular-nums; }
.btn.is-dirty { box-shadow: 0 0 0 3px rgba(109, 92, 246, .16); }

/* ---- 画布 ---- */
.cv-outer { flex: 1; overflow: auto; background: #F4F5F9; background-image: radial-gradient(#D7DAE4 1px, transparent 1px); background-size: 16px 16px; padding: 34px 20px 24px; display: flex; justify-content: center; align-items: flex-start; }
.cv-space { position: relative; display: flex; justify-content: center; align-items: flex-start; }
.cv-zoom { transform-origin: top center; flex-shrink: 0; }
.cv-board { position: relative; box-shadow: 0 8px 30px rgba(20, 20, 40, .1); border-radius: 2px; }
.cv-page-label { position: absolute; left: 0; top: -19px; display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--faint); }
.cv-page-label span { background: #E7E9F1; color: var(--mut); border-radius: 3px; padding: 1px 5px; }
.cv-page-label i { font-style: normal; font-variant-numeric: tabular-nums; }
.cv-empty { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); color: #B4B9C8; font-size: 12.5px; border: 1px dashed #D6D9E4; border-radius: 10px; padding: 18px 26px; background: rgba(255, 255, 255, .6); pointer-events: none; }

.cv-node { position: absolute; box-sizing: border-box; outline: 1px dashed transparent; outline-offset: 0; }
.cv-node:hover { outline-color: #C3BDFA; }
.cv-node.is-sel { outline: 1.5px solid #2F7BFF; }
.cv-node.is-hidden { opacity: .38; outline-style: dashed; }
.cv-node.is-hidden:hover { outline-color: #9AA2B8; }
.cv-box { width: 100%; height: 100%; box-sizing: border-box; overflow: hidden; }
.cv-tag { position: absolute; left: -1.5px; top: -19px; display: none; background: #2F7BFF; color: #fff; font-size: 10px; line-height: 1.5; padding: 0 5px; border-radius: 3px 3px 3px 0; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.cv-node.is-sel .cv-tag { display: block; }
.cv-h { position: absolute; width: 7px; height: 7px; background: #fff; border: 1.5px solid #2F7BFF; border-radius: 1px; display: none; z-index: 3; }
.cv-node.is-sel .cv-h { display: block; }
.cv-h.tl { left: -4px; top: -4px; cursor: nwse-resize; }
.cv-h.tr { right: -4px; top: -4px; cursor: nesw-resize; }
.cv-h.bl { left: -4px; bottom: -4px; cursor: nesw-resize; }
.cv-h.br { right: -4px; bottom: -4px; cursor: nwse-resize; }

/* 画布内组件的占位与小件 */
.cv-ph { height: 100%; display: flex; align-items: center; justify-content: center; color: #A8AEC0; font-size: 12px; background: repeating-linear-gradient(45deg, #F1F2F7, #F1F2F7 8px, #EAECF3 8px, #EAECF3 16px); }
.cv-ph-dark { background: #14161F; color: #8B93A8; }
.cv-vid { width: 100%; height: 100%; border-radius: 12px; overflow: hidden; background: #000; }
.cv-vid iframe { width: 100%; height: 100%; border: 0; display: block; }
.cv-input { margin-top: 10px; height: 36px; border: 1px solid #E6E8F0; border-radius: 9px; display: flex; align-items: center; padding: 0 11px; color: #A8AEC0; font-size: 12px; }
.cv-btn { margin-top: 11px; height: 36px; border-radius: 9px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600; }
.cv-ai { width: 21px; height: 21px; border-radius: 6px; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; }
.cv-bubble { margin-top: 9px; background: #F4F3FF; border-radius: 10px; padding: 9px 11px; font-size: 12px; color: #4B4F63; line-height: 1.65; }
.cv-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid #F1F2F7; }
.cv-row span { width: 20px; height: 20px; border-radius: 6px; background: #F1EFFF; color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; }
.cv-row i { flex: 1; height: 7px; border-radius: 4px; background: #EEF0F6; }

/* ---- 右栏属性面板 ---- */
.ui-props { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); overflow-y: auto; display: flex; flex-direction: column; }
.pr-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px; border-bottom: 1px solid var(--line); }
.pr-head-page { padding-top: 14px; }
.pr-ico { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: rgba(109, 92, 246, .1); color: var(--brand); flex-shrink: 0; }
.pr-ico svg { width: 14px; height: 14px; }
.pr-head div { min-width: 0; }
.pr-head strong { display: block; font-size: 12.5px; color: var(--ink); line-height: 1.3; }
.pr-head em { display: block; font-style: normal; font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; margin-top: 2px; }
.pr-act { width: 22px; height: 22px; border: 1px solid var(--line-2); border-radius: 5px; background: #fff; color: var(--mut); font-size: 10px; line-height: 1; cursor: pointer; }
.pr-act:hover { color: var(--brand); border-color: var(--brand); }
.pr-tabs { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.pr-tabs button { border: 0; background: transparent; font-size: 11.5px; color: var(--mut); cursor: pointer; padding: 3px 9px; border-radius: 5px; }
.pr-tabs button.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.pr-body { padding: 4px 12px 18px; }
.pr-sec { border-bottom: 1px solid var(--line); }
.pr-sec:last-child { border-bottom: 0; }
.pr-sec-h { width: 100%; display: flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 11px 0 9px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.pr-sec-h span { flex: 1; text-align: left; }
.pr-sec-h svg { width: 13px; height: 13px; color: var(--faint); transition: transform .16s; }
.pr-sec.is-closed .pr-sec-h svg { transform: rotate(-90deg); }
.pr-sec.is-closed .pr-sec-b { display: none; }
.pr-sec-b { padding-bottom: 12px; }
.pr-row { margin-bottom: 9px; }
.pr-row > label { display: block; font-size: 10.5px; color: var(--mut); margin-bottom: 4px; }
.pr-row .input { height: 30px; font-size: 12px; }
.pr-area { height: auto !important; min-height: 58px; padding: 7px 9px; line-height: 1.6; resize: vertical; }
.pr-num { font-variant-numeric: tabular-nums; }
.pr-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pr-color { display: flex; align-items: center; gap: 6px; }
.pr-color input[type="color"] { width: 30px; height: 30px; padding: 0; border: 1px solid var(--line-2); border-radius: 6px; background: #fff; cursor: pointer; flex-shrink: 0; }
.pr-color .input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; }
.pr-seg { width: 100%; }
.pr-seg button { flex: 1; }
.pr-quick, .pr-layers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 2px; }
.pr-quick { margin-bottom: 6px; }
.pr-quick button, .pr-layers button { border: 1px solid var(--line-2); background: #fff; border-radius: 6px; font-size: 10.5px; color: var(--mut); padding: 5px 2px; cursor: pointer; white-space: nowrap; }
.pr-quick button:hover, .pr-layers button:hover { border-color: var(--brand); color: var(--brand); }
.pr-hint { font-size: 10px; color: var(--faint); line-height: 1.6; margin: 4px 0 0; }
.pr-kv { display: flex; align-items: baseline; gap: 10px; font-size: 11px; color: var(--mut); padding: 3px 0; }
.pr-kv span { width: 58px; color: var(--faint); flex-shrink: 0; }
.pr-kv b { font-weight: 500; color: var(--ink-2); word-break: break-all; }
.pr-foot { display: flex; gap: 8px; justify-content: flex-end; padding-top: 14px; }
.pr-clear { margin-top: 8px; }

/* ---- 组件画布：真实页面底图 / 新建页面 ---- */
.cv-base { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border: 0; background: #fff; pointer-events: none; z-index: 0; }
.cv-board > .cv-node { z-index: 1; }
.cv-board > .cv-page-label, .cv-board > .cv-empty { z-index: 2; }
.ui-newpage { border: 1px solid var(--brand); color: var(--brand); background: #fff; border-radius: 6px; font-size: 10.5px; font-weight: 600; padding: 3px 8px; cursor: pointer; white-space: nowrap; }
.ui-newpage:hover { background: var(--brand-soft); }
.ui-pdel { border: 0; background: transparent; color: var(--faint); font-size: 11px; font-weight: 400; cursor: pointer; padding: 2px 4px; border-radius: 4px; line-height: 1; flex-shrink: 0; }
.ui-pdel:hover { color: var(--err); background: #FEF2F2; }
.pr-del-page { width: 100%; margin-top: 14px; color: var(--err); border-color: #F3C9C9; background: #fff; }
.pr-del-page:hover { background: #FEF2F2; }
