/* ===== 设计令牌(与 blog 对齐:slate 灰阶 + blue-600 主色,class 式深色) ===== */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-muted: #f8fafc;
  --elevated: #f1f5f9;
  --ink: #334155;
  --ink-strong: #0f172a;
  --muted: #64748b;
  --dim: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-ink: #ffffff;
  --badge-bg: #eff6ff;
  --badge-ink: #1d4ed8;
  --danger: #dc2626;
  --ring: rgba(37, 99, 235, 0.25);
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* touch-action 禁捏合与双击放大(pan 保留,滚动不受影响) */
html, body { margin: 0; padding: 0; height: 100%; touch-action: pan-x pan-y; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--ink);
  height: 100dvh;
  overflow: hidden;
  display: flex; flex-direction: column;
}

.view { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.hidden { display: none !important; }

/* ===== 全局细滚动条(Firefox: thin / WebKit: 6px) ===== */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--dim); }

/* ===== 统一线性图标(Lucide 风格,颜色跟随文字) ===== */
.ic {
  width: 17px; height: 17px; flex-shrink: 0; display: block;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ===== 顶栏(与 blog header 同构:白底、发丝底线、方块圆角按钮) ===== */
.topbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  color: var(--ink-strong);
}
.topbar h1 { font-size: 15px; font-weight: 650; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em; }
/* 临时:logo 候选对比 */
.logopick { display: flex; flex-shrink: 0; }
.logopick svg { display: block; }

.logo, .glogo {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--ink-strong); color: var(--bg);
  font-family: 'GaoJian Logo', 'Kaiti SC', KaiTi, STKaiti, serif;
  position: relative;
}
.logo { font-size: 22px; padding-bottom: 2px; }
.glogo { width: 56px; height: 56px; font-size: 36px; border-radius: 15px; margin: 0 auto 2px; }
/* 右下角蓝色「见」字小印章,点出「稿见」 */
.logo i, .glogo i {
  position: absolute; right: -4px; bottom: -4px; font-style: normal;
  background: var(--primary); color: #fff;
  width: 14px; height: 14px; border-radius: 3px;
  font-family: 'GaoJian Logo', 'Kaiti SC', KaiTi, STKaiti, serif;
  font-size: 10px; line-height: 14px; text-align: center;
}
.glogo i { width: 22px; height: 22px; right: -2px; bottom: -2px; font-size: 15px; line-height: 22px; border-radius: 5px; }
.glogo { width: 56px; height: 56px; font-size: 26px; border-radius: 15px; margin: 0 auto 2px; }
.pvtitle { font-size: 14.5px !important; }
.iconbtn {
  background: var(--bg); color: var(--ink); border: 1px solid var(--line);
  width: 34px; height: 34px; border-radius: 9px; font-size: 15px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.iconbtn:active { background: var(--elevated); }
.sub { margin: 0; padding: 12px 16px 6px; font-size: 12.5px; color: var(--muted); }

/* ===== 文章卡片(blog 列表卡片同款) ===== */
.cards { flex: 1; overflow-y: auto; padding: 10px 16px 20px; }
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.card:active { transform: scale(0.99); border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.card .thumb {
  width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0;
  background: var(--badge-bg); color: var(--badge-ink);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.card .info { flex: 1; min-width: 0; }
.card .t { font-size: 15px; font-weight: 600; margin: 0 0 4px; color: var(--ink-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .m { font-size: 11px; color: var(--muted); margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.card .arrow { color: var(--dim); }
.carddel {
  border: none; background: transparent; color: var(--dim);
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}
.carddel .ic { width: 15px; height: 15px; }
.carddel:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }

/* 底部提示 */
.hint { padding: 8px 16px calc(14px + env(safe-area-inset-bottom)); font-size: 12px; color: var(--muted); line-height: 1.7; }
.mono { font-family: ui-monospace, monospace; background: var(--elevated); padding: 0 5px; border-radius: 5px; }

/* ===== 编辑器面板与底栏(flat 白底 + 主色按钮) ===== */
.actionbar {
  display: flex; align-items: center; gap: 8px;
  height: calc(60px + env(safe-area-inset-bottom));
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--line);
  box-sizing: border-box;
}
.primary {
  flex: 1; border: none; border-radius: 8px; height: 40px; padding: 0 12px;
  background: var(--primary); color: var(--primary-ink);
  font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.primary .ic { width: 16px; height: 16px; }
.pushbtn {
  flex: 1; border: 1px solid var(--primary); border-radius: 8px; height: 40px; padding: 0 12px;
  background: var(--bg); color: var(--primary); font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.pushbtn:active { transform: scale(0.98); background: var(--badge-bg); }
.pushbtn:disabled { opacity: 0.55; }
.pushbtn .ic { width: 15px; height: 15px; }

/* 公众号列表与添加表单 */
.wxlist { display: flex; flex-direction: column; gap: 8px; }
.wxrow {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; cursor: pointer;
}
.wxrow.mgr { cursor: default; }
.wxrow:has(input:checked) { border-color: var(--primary); background: var(--badge-bg); }
.wxrow .wname { font-size: 14px; font-weight: 600; color: var(--ink-strong); flex-shrink: 0; }
.wxrow .wappid { font-size: 12px; color: var(--muted); font-family: ui-monospace, monospace; flex: 1; }
.wxrow input[type='radio'] { accent-color: var(--primary); }
.wxadd { display: grid; grid-template-columns: 1fr 1.2fr 1.2fr auto; gap: 8px; }
.wxadd input {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
  font-size: 13.5px; font-family: inherit; background: var(--bg); color: var(--ink-strong);
  outline: none; min-width: 0;
}
.wxadd input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
@media (max-width: 640px) { .wxadd { grid-template-columns: 1fr 1fr; } }
.primary:active { transform: scale(0.98); filter: brightness(0.92); }
.primary:disabled { opacity: 0.55; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%);
  background: var(--ink-strong); color: var(--bg);
  font-size: 13.5px; padding: 10px 18px; border-radius: 10px;
  max-width: 82vw; text-align: center; line-height: 1.55;
  box-shadow: var(--shadow-md);
  z-index: 60; white-space: pre-line;
}

/* ===== 首页新建卡片(虚线) ===== */
.addcard {
  display: flex; align-items: center; gap: 12px; width: calc(100% - 32px);
  margin: 0 16px 12px; padding: 14px;
  background: var(--bg-muted); color: var(--ink);
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  text-align: left;
}
.addcard > .ic { color: var(--primary); }
.addcard .addtxt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.addcard b { font-size: 14.5px; color: var(--ink-strong); }
.addcard small { font-size: 12px; color: var(--muted); }
.addcard .arrow { color: var(--dim); }
.addcard:active { transform: scale(0.99); border-color: var(--primary); background: var(--badge-bg); }

/* ===== 新建文章弹窗 ===== */
.modal {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modalbox {
  width: min(560px, 100%); max-height: 90dvh;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-md); padding: 16px;
}
.modalhead { display: flex; align-items: center; justify-content: space-between; }
.modalhead h2 { margin: 0; font-size: 16px; font-weight: 650; color: var(--ink-strong); }
.newtext {
  flex: 1; min-height: 220px; resize: vertical;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 12px; font-size: 15px; line-height: 1.6;
  font-family: inherit; color: var(--ink-strong); background: var(--bg);
  outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.newtext:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.newtext::placeholder { color: var(--dim); }
.filerow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filebtn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink);
  font-size: 13.5px; padding: 8px 12px; cursor: pointer;
  transition: background 0.15s ease;
}
.filebtn:active { background: var(--elevated); }
.filebtn input[type='file'] { display: none; }
.filemeta { font-size: 12px; color: var(--muted); font-family: ui-monospace, monospace; }
.filehint { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.modalact { display: flex; gap: 10px; }
.modalact .ghost {
  flex: 0 0 auto; height: 38px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); font-size: 14.5px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.modalact .ghost .ic { width: 15px; height: 15px; }
.modalact .ghost:active { background: var(--elevated); }
.modalact .primary { flex: 1; }
.modalact .danger {
  flex: 1; height: 40px; border: none; border-radius: 8px; padding: 0 12px;
  background: var(--danger); color: #fff; font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}

/* ===== 通用确认弹窗(uiConfirm;骨架与新建/推送弹窗同款) ===== */
.uibox { width: min(360px, 100%); }
.uimsg { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--ink); white-space: pre-line; }
.uiinput {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 12px; font-size: 16px; /* ≥16px 防 iOS 聚焦缩放 */
  font-family: inherit; color: var(--ink-strong); background: var(--bg); outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.uiinput:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.uiinput::placeholder { color: var(--dim); }
.filebtn { height: 38px; padding: 0 12px; }
.filebtn .ic { width: 15px; height: 15px; }

/* ===== 访问码门 ===== */
.gate {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg-muted);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.gatebox {
  width: min(330px, 88vw); text-align: center;
  display: flex; flex-direction: column; gap: 12px;
  padding: 30px 24px 24px; border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.gatebox h1 { margin: 0; font-size: 18px; font-weight: 700; color: var(--ink-strong); letter-spacing: -0.01em; }
.gatebox .gsub { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.gatebox input {
  font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px;
  text-align: center; background: var(--bg); color: var(--ink-strong); outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.gatebox input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.gatebox #btnGate { height: 48px; min-height: 48px; flex: 0 0 auto; font-size: 16px; border-radius: 8px; }
.gateerr { color: var(--danger); font-size: 13px; margin: 0; }

/* ===== 对话工作台:顶栏/输入条悬浮,聊天流从底下穿过 ===== */
#chatPane { position: relative; height: 100%; min-height: 0; }
#chatPane > .topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 10; border-top: none; border-left: none; border-right: none; }
#chatLog {
  position: absolute; inset: 0; overflow-y: auto;
  padding: calc(58px + env(safe-area-inset-top)) 14px calc(84px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
  background: var(--bg-muted);
}
.composer {
  position: absolute; left: 0; right: 0;
  bottom: 0;
  z-index: 10;
  display: flex; align-items: center; gap: 7px;
  height: calc(60px + env(safe-area-inset-bottom));
  box-sizing: border-box;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.composer textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 8px;
  height: 40px; min-height: 40px;
  padding: 9px 11px; font-size: 16px; /* ≥16px 防 iOS 聚焦缩放 */
  font-family: inherit; line-height: 1.4; max-height: 120px; outline: none;
  background: var(--bg); color: var(--ink-strong);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.composer textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.composer textarea::placeholder { color: var(--dim); }
.chip, .pvbtn {
  flex-shrink: 0; width: 40px; height: 40px; font-size: 16px;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.chip:active, .pvbtn:active { transform: scale(0.93); background: var(--elevated); }
.sendbtn {
  flex-shrink: 0; width: 40px; height: 40px; font-size: 15px;
  border-radius: 8px; border: none;
  background: var(--primary); color: var(--primary-ink);
  display: flex; align-items: center; justify-content: center;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.sendbtn:active { transform: scale(0.93); filter: brightness(0.92); }

/* ===== 模型选择(自定义下拉,与按钮等高) ===== */
.modeldd { position: relative; flex-shrink: 0; }
.modelbtn {
  display: flex; align-items: center; gap: 5px; height: 34px; padding: 0 9px;
  background: var(--bg); color: var(--ink-strong); border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; max-width: 175px;
  transition: background 0.15s ease;
}
.modelbtn:hover { background: var(--bg-muted); }
.modelbtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modelbtn .ic { width: 13px; height: 13px; transform: rotate(90deg); color: var(--muted); }
.modelmenu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 25;
  min-width: 210px; padding: 4px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-md);
}
.modelitem {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px; border-radius: 6px; font-size: 13.5px; color: var(--ink); cursor: pointer;
}
.modelitem:hover { background: var(--elevated); }
.modelitem.on { color: var(--primary); font-weight: 600; }
.modelitem .ic { width: 15px; height: 15px; visibility: hidden; }
.modelitem.on .ic { visibility: visible; }

/* 对话流 */
.msg { display: flex; margin: 10px 0; }
.msg.user { justify-content: flex-end; }
.bubble {
  max-width: 86%; padding: 10px 13px; border-radius: 12px;
  font-size: 15px; line-height: 1.65; white-space: pre-wrap; word-break: break-word;
}
.msg.user .bubble { background: var(--primary); color: var(--primary-ink); border-bottom-right-radius: 4px; }
.msg.assistant .bubble {
  background: var(--bg); border: 1px solid var(--line);
  border-bottom-left-radius: 4px; box-shadow: var(--shadow-sm);
}
.bubble .prose { margin: 0 0 4px; }
.bubble .prose.streaming { margin: 0; }
.cursor { color: var(--muted); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.15; } }
.emptytip { text-align: center; color: var(--muted); font-size: 13px; line-height: 2.1; padding: 44px 12px; }
.errmsg { color: var(--danger); font-size: 13px; margin: 6px 0 0; }

/* 编辑块折叠卡片 */
.editcard { margin: 8px 0 0; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-muted); }
.editcard summary { cursor: pointer; padding: 7px 10px; color: var(--muted); font-weight: 600; list-style-position: inside; }
.editcard.bad { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: color-mix(in srgb, var(--danger) 6%, transparent); }
.editcard.bad summary { color: var(--danger); }
.editcard pre {
  margin: 0; padding: 8px 10px; border-top: 1px dashed var(--line);
  max-height: 200px; overflow: auto; font-size: 12px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-all; color: var(--muted);
}

/* 自动刷新为默认行为,无开关 */

/* ===== 预览面板:窄屏=全屏弹层 ===== */
.pvpanel { display: none; flex-direction: column; position: relative; background: #fff; }
.pvpanel.open { display: flex; position: fixed; inset: 0; z-index: 30; overscroll-behavior: contain; }
.pvpanel .subbar { border-top: none; border-left: none; border-right: none; }   /* 在文档流里:不再浮盖文章顶部 */

/* ===== TinyMCE 编辑器宿主(编辑模式替换 iframe 显示) ===== */
.savestate { font-size: 11px; color: var(--muted); flex-shrink: 0; }
#btnEditPv.on { border-color: var(--primary); color: var(--primary); background: var(--badge-bg); }
.pveditor { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; background: #fff; }
.pveditor .tox-tinymce { flex: 1; border: none; }
.pvloading { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; background: #fff; color: var(--muted); font-size: 13px; }
.pvempty { flex: 1; display: flex; align-items: center; justify-content: center; background: #fff; color: var(--muted); font-size: 13px; text-align: center; line-height: 1.9; }
/* AI 改稿期间盖在编辑区上的遮罩(编辑器同时置只读,双保险) */
.aimask {
  position: absolute; inset: 0; z-index: 10;
  display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.72); color: var(--ink); font-size: 13px;
}
.aimspin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--primary); animation: aimspin 0.8s linear infinite; }
@keyframes aimspin { to { transform: rotate(360deg); } }
/* AI 轮次中底栏按钮的 loading 态:禁用 + 转圈替换原图标 */
.actionbar button.busy { opacity: 0.65; }
.actionbar button.busy .ic { display: none; }
.busyspin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--primary); animation: aimspin 0.8s linear infinite; flex-shrink: 0; }

/* ===== 素材库抽屉(素材片段 + 模板) ===== */
.libmask { position: absolute; inset: 0; z-index: 14; background: rgba(15, 23, 42, 0.25); }
.libdrawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 100%); z-index: 15;
  background: var(--bg); border-left: 1px solid var(--line); box-shadow: var(--shadow-md);
  display: flex; flex-direction: column;
}
.libhead { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.libhead h2 { margin: 0; font-size: 14.5px; font-weight: 650; color: var(--ink-strong); }
.libtabs { display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.libtab { flex: 1; height: 32px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--ink); font-size: 13px; }
.libtab.on { background: var(--badge-bg); color: var(--badge-ink); border-color: var(--primary); }
.libpane { flex: 1; min-height: 0; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.libsave { justify-content: center; }
.libempty { margin: 20px 0; text-align: center; font-size: 12.5px; color: var(--muted); line-height: 1.9; }
/* 素材卡片:双列,真实 HTML 缩放预览 */
.assetgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.assetcard { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; cursor: pointer; }
.assetcard:active { border-color: var(--line-strong); }
.assetview { height: 88px; overflow: hidden; pointer-events: none; background: #fff; }
.libscale { width: 200%; transform: scale(0.5); transform-origin: top left; }
.assetname {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  padding: 5px 4px 5px 7px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--ink); white-space: nowrap; overflow: hidden;
}
.assetname span { overflow: hidden; text-overflow: ellipsis; }
.assetdel { border: none; background: none; color: var(--dim); padding: 2px; display: flex; flex-shrink: 0; }
.assetdel .ic { width: 12px; height: 12px; }
.assetdel:active { color: var(--danger); }
/* 模板卡片:单列,iframe 缩放预览 + 双按钮 */
.tpllist { display: flex; flex-direction: column; gap: 10px; }
.tplcard { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.tplview { height: 150px; overflow: hidden; pointer-events: none; background: #fff; position: relative; }
.tplview iframe { width: 578px; height: 700px; border: none; transform: scale(0.5); transform-origin: top left; }
.tplmeta { padding: 8px 10px; display: flex; flex-direction: column; gap: 7px; border-top: 1px solid var(--line); }
.tplname { font-size: 13px; font-weight: 600; color: var(--ink-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tplact { display: flex; gap: 6px; align-items: center; }
.tplbtn { flex: 1; height: 30px; border-radius: 7px; font-size: 12.5px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.tplai { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }
.tplai:active { filter: brightness(0.92); }
.tpldirect:active { background: var(--elevated); }
.tplact .assetdel { height: 30px; width: 26px; justify-content: center; border: 1px solid var(--line); border-radius: 7px; }
#btnPv { display: flex; }

/* ===== 主题切换按钮(与 blog 右上角月亮/太阳同款) ===== */

/* ===== 宽屏:预览常驻右栏 ===== */
@media (min-width: 700px) and (min-height: 461px) {
  #chatView { display: grid; grid-template-columns: minmax(380px, 470px) minmax(0, 1fr); }
  #chatPane { grid-column: 1; }
  .pvpanel { display: flex; grid-column: 2; border-left: 1px solid var(--line); }
  #btnPv, #btnClosePv { display: none; }
}

/* 桌面上列表内容限宽居中 */
@media (min-width: 900px) {
  #listView .cards, #listView .sub, #listView .hint { max-width: 780px; margin-left: auto; margin-right: auto; width: 100%; }
}
