/* ============================================================
   Nexus AI 工作台 · 样式表
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  --accent: #6FA8A0;
  --accent-2: #93C8C0;
  --accent-soft: rgba(111, 168, 160, 0.14);
  --ok: #4FA97C;
  --danger: #D96A57;
  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
}

html[data-theme="dark"] {
  --bg: #0c0e10;
  --bg-elev: #14171a;
  --bg-panel: #0f1214;
  --bg-input: #090b0d;
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-active: rgba(111, 168, 160, 0.14);
  --border: rgba(255, 255, 255, 0.09);
  --border-soft: rgba(255, 255, 255, 0.055);
  --text: #e7e9ea;
  --text-dim: #9ca2a6;
  --text-mute: #6a7075;
  --bubble: rgba(111, 168, 160, 0.10);
  --code-bg: #08090b;
  --user-bubble: rgba(111, 168, 160, 0.12);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  --glow: radial-gradient(circle at 50% 0%, rgba(111, 168, 160, 0.10), transparent 60%);
}

html[data-theme="light"] {
  --accent: #3f7f76;
  --accent-2: #5a9c93;
  --accent-soft: rgba(63, 127, 118, 0.10);
  --bg: #f6f6f4;
  --bg-elev: #ffffff;
  --bg-panel: #fafaf8;
  --bg-input: #ffffff;
  --bg-hover: rgba(20, 23, 26, 0.045);
  --bg-active: rgba(63, 127, 118, 0.10);
  --border: rgba(20, 23, 26, 0.10);
  --border-soft: rgba(20, 23, 26, 0.06);
  --text: #14171a;
  --text-dim: #5a6166;
  --text-mute: #8b9296;
  --bubble: rgba(63, 127, 118, 0.08);
  --code-bg: #14171a;
  --user-bubble: rgba(63, 127, 118, 0.10);
  --shadow: 0 12px 30px rgba(20, 23, 26, 0.10);
  --glow: radial-gradient(circle at 50% 0%, rgba(63, 127, 118, 0.07), transparent 60%);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(111, 168, 160, 0.35); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(140, 155, 175, 0.22); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(140, 155, 175, 0.4); background-clip: content-box; }

/* ============================== 布局 ============================== */
.app {
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr) 330px;
  height: 100vh;
  height: 100dvh;
  transition: grid-template-columns 0.28s cubic-bezier(.4, 0, .2, 1);
}
.app.panel-closed { grid-template-columns: 278px minmax(0, 1fr) 0; }

.sidebar, .panel { min-width: 0; }
.main { display: flex; flex-direction: column; min-width: 0; background: var(--bg); position: relative; }

/* ============================= 侧边栏 ============================= */
.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 18px 14px 14px;
  gap: 14px;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #93c8c0);
  box-shadow: 0 6px 18px rgba(111, 168, 160, .38);
  flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; flex: 1; }
.brand-text strong { font-size: 15px; letter-spacing: .2px; }
.brand-text span { font-size: 11px; color: var(--text-mute); letter-spacing: .8px; }

.new-chat {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 13px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--accent), #48807a);
  color: #fff;
  font-weight: 550;
  font-size: 13.5px;
  box-shadow: 0 8px 22px rgba(79, 70, 229, .28);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.new-chat:hover { filter: brightness(1.06); box-shadow: 0 10px 26px rgba(79, 70, 229, .38); transform: translateY(-1px); }
.new-chat:active { transform: translateY(0); }
.new-chat kbd {
  margin-left: auto;
  font-family: var(--font);
  font-size: 10.5px;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .9);
}

.search-box {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 11px;
  border-radius: 9px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-mute);
  transition: border-color .15s;
}
.search-box:focus-within { border-color: rgba(111, 168, 160, .55); }
.search-box input { flex: 1; min-width: 0; background: none; border: none; outline: none; font-size: 12.5px; }
.search-box input::placeholder { color: var(--text-mute); }

.conv-scroll { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.conv-group-title {
  font-size: 10.5px; letter-spacing: .9px; text-transform: uppercase;
  color: var(--text-mute); padding: 12px 8px 6px; font-weight: 600;
}
.conv-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--text-dim);
  cursor: pointer;
  position: relative;
  transition: background .14s, color .14s;
  margin-bottom: 2px;
}
.conv-item:hover { background: var(--bg-hover); color: var(--text); }
.conv-item.active { background: var(--bg-active); color: var(--text); }
.conv-item.active::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), #93c8c0);
}
.conv-icon { flex: none; opacity: .55; display: grid; place-items: center; }
.conv-name { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-tools { display: flex; gap: 2px; opacity: 0; transition: opacity .14s; }
.conv-item:hover .conv-tools, .conv-item.active .conv-tools { opacity: 1; }
.conv-tools button {
  width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center;
  color: var(--text-mute);
}
.conv-tools button:hover { background: rgba(255, 255, 255, .1); color: var(--text); }
html[data-theme="light"] .conv-tools button:hover { background: rgba(15, 23, 42, .08); }
.conv-empty { padding: 26px 12px; text-align: center; color: var(--text-mute); font-size: 12.5px; line-height: 1.7; }

.sidebar-foot { border-top: 1px solid var(--border-soft); padding-top: 12px; }
.usage-mini {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--bg-hover);
  border: 1px solid var(--border-soft);
  display: block;
}
.usage-mini:hover { border-color: rgba(111, 168, 160, .35); }
.usage-mini-top { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-mute); }
.usage-mini-value { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.usage-mini-bar { height: 4px; border-radius: 3px; background: rgba(140, 155, 175, .18); margin: 8px 0 6px; overflow: hidden; }
.usage-mini-bar i { display: block; height: 100%; width: 0%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), #93c8c0); transition: width .5s; }
.usage-mini-sub { font-size: 10.5px; color: var(--text-mute); }
.foot-actions { display: flex; align-items: center; gap: 4px; margin-top: 10px; padding: 0 2px; }
.version { margin-left: auto; font-size: 10px; color: var(--text-mute); opacity: .7; }

/* ============================== 通用按钮 ============================== */
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  color: var(--text-dim); transition: background .14s, color .14s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.ghost-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12.5px;
  background: var(--bg-elev);
  transition: border-color .15s, color .15s, background .15s;
}
.ghost-btn:hover { border-color: rgba(111, 168, 160, .5); color: var(--text); }
.ghost-btn.danger:hover { border-color: rgba(240, 82, 82, .5); color: var(--danger); }
.primary-btn {
  padding: 9px 18px; border-radius: 9px; font-size: 13px; font-weight: 550;
  background: linear-gradient(135deg, var(--accent), #48807a); color: #fff;
  box-shadow: 0 6px 18px rgba(79, 70, 229, .28);
  transition: filter .15s, transform .15s;
}
.primary-btn:hover { filter: brightness(1.08); }
.primary-btn:active { transform: scale(.98); }
.link-btn { color: var(--accent); font-size: 12px; padding: 2px 4px; border-radius: 5px; }
.link-btn:hover { background: var(--bg-active); }

/* ============================== 顶栏 ============================== */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 26px;
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(12px);
  min-height: 66px;
  flex: none;
}
.title-wrap { flex: 1; min-width: 0; }
.title-wrap h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  outline: none;
  border-radius: 6px;
  padding: 2px 4px; margin-left: -4px;
  width: fit-content; max-width: 100%;
}
.title-wrap h1:focus { background: var(--bg-hover); box-shadow: inset 0 0 0 1px var(--border); }
.meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-mute); margin-top: 2px; }
.meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(34, 197, 94, .14); }
.meta .sep { opacity: .5; }
.top-actions { display: flex; align-items: center; gap: 6px; }

/* ============================== 会话区 ============================== */
.thread { flex: 1; overflow-y: auto; scroll-behavior: smooth; position: relative; }
.thread::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 320px;
  background: var(--glow); pointer-events: none; opacity: .8;
}

/* 空状态 */
.empty {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(40px, 9vh, 96px) 28px 40px;
  text-align: center;
  animation: fadeUp .5s ease both;
}
.orb {
  width: 76px; height: 76px; margin: 0 auto 22px; border-radius: 24px;
  background: conic-gradient(from 140deg, var(--accent), #3f7f76, var(--accent));
  filter: blur(0.4px);
  box-shadow: 0 18px 50px rgba(111, 168, 160, .4), inset 0 0 0 1px rgba(255,255,255,.18);
  position: relative;
  animation: float 6s ease-in-out infinite;
}
.orb::after {
  content: ""; position: absolute; inset: 16px; border-radius: 14px;
  background: var(--bg); opacity: .82;
}
.orb::before {
  content: ""; position: absolute; inset: 27px; border-radius: 8px; z-index: 1;
  background: linear-gradient(135deg, #ffffff, #d9ece9);
  clip-path: polygon(50% 0%, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0% 50%, 38% 38%);
}
.empty-eyebrow { font-size: 10.5px; letter-spacing: 3px; color: var(--text-mute); font-weight: 600; }
.empty h2 { font-size: clamp(22px, 2.6vw, 29px); margin: 12px 0 10px; letter-spacing: -.4px; }
.empty-sub { color: var(--text-dim); font-size: 13.5px; margin: 0 auto 30px; max-width: 480px; line-height: 1.7; }

.suggests { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.suggest {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 15px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  text-align: left;
  transition: border-color .18s, transform .18s, background .18s;
}
.suggest:hover { border-color: rgba(111, 168, 160, .55); transform: translateY(-2px); background: var(--bg-panel); }
.suggest-icon { font-size: 18px; line-height: 1; }
.suggest-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.suggest-body strong { font-size: 13px; font-weight: 550; }
.suggest-body small { font-size: 11.5px; color: var(--text-mute); }
.demo-tip {
  margin-top: 22px; display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--text-mute);
  padding: 7px 13px; border-radius: 999px; border: 1px dashed var(--border);
}
.demo-tip button { color: var(--accent); font-size: 12px; }

/* 消息 */
.messages { max-width: 848px; margin: 0 auto; padding: 26px 28px 10px; display: flex; flex-direction: column; gap: 26px; }
.msg { display: flex; gap: 12px; animation: fadeUp .3s ease both; }
.msg.user { justify-content: flex-end; }
.msg-avatar {
  width: 30px; height: 30px; border-radius: 9px; flex: none; margin-top: 2px;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), #93c8c0);
  box-shadow: 0 4px 12px rgba(111, 168, 160, .3);
}
.msg-main { min-width: 0; max-width: 100%; flex: 1; }
.msg.user .msg-main { flex: 0 1 auto; max-width: 82%; display: flex; flex-direction: column; align-items: flex-end; }
.msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 11.5px; color: var(--text-mute); }
.msg-head .name { color: var(--text-dim); font-weight: 600; font-size: 12px; }
.badge {
  font-size: 10px; padding: 1.5px 6px; border-radius: 5px;
  background: var(--bg-hover); border: 1px solid var(--border-soft); color: var(--text-mute);
  font-family: var(--mono);
}
.msg.user .bubble {
  padding: 11px 15px;
  border-radius: 15px 15px 4px 15px;
  background: var(--user-bubble);
  border: 1px solid rgba(111, 168, 160, .22);
  font-size: 14.5px;
  line-height: 1.7;
  word-break: break-word;
  white-space: pre-wrap;
}
.msg.user .bubble .md-body { white-space: pre-wrap; }
.md-body { font-size: 14.6px; line-height: 1.78; color: var(--text); word-wrap: break-word; }
.md-body > *:first-child { margin-top: 0; }
.md-body > *:last-child { margin-bottom: 0; }

.md-body p { margin: 0 0 12px; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 { margin: 22px 0 10px; line-height: 1.4; font-weight: 600; letter-spacing: -.2px; }
.md-body h1 { font-size: 20px; }
.md-body h2 { font-size: 17.5px; }
.md-body h3 { font-size: 15.5px; }
.md-body h4 { font-size: 14.5px; color: var(--text-dim); }
.md-body h1:first-child, .md-body h2:first-child, .md-body h3:first-child { margin-top: 2px; }
.md-body ul, .md-body ol { margin: 0 0 12px; padding-left: 22px; }
.md-body li { margin: 4px 0; }
.md-body li::marker { color: var(--text-mute); }
.md-body strong { font-weight: 650; color: var(--text); }
.md-body em { color: var(--text-dim); }
.md-body del { color: var(--text-mute); }
.md-body hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.md-body blockquote {
  margin: 0 0 12px; padding: 8px 14px;
  border-left: 3px solid var(--accent);
  background: var(--bg-hover);
  border-radius: 0 8px 8px 0;
  color: var(--text-dim);
}
.md-body blockquote p:last-child { margin-bottom: 0; }
.md-body .inline-code {
  font-family: var(--mono); font-size: 12.6px;
  padding: 2px 5px; border-radius: 5px;
  background: rgba(140, 155, 175, .16);
  border: 1px solid var(--border-soft);
  color: #e0e7ff;
}
html[data-theme="light"] .md-body .inline-code { color: #4338ca; background: rgba(111,168,160,.1); }
.md-body table { width: 100%; border-collapse: collapse; margin: 6px 0 14px; font-size: 13.3px; display: block; overflow-x: auto; }
.md-body th, .md-body td { border: 1px solid var(--border); padding: 8px 11px; text-align: left; }
.md-body th { background: var(--bg-hover); font-weight: 600; white-space: nowrap; }
.md-body tr:nth-child(even) td { background: rgba(140, 155, 175, .04); }

.code-block {
  margin: 0 0 14px;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid rgba(140, 155, 175, .16);
  background: var(--code-bg);
}
.code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 12px;
  background: rgba(255, 255, 255, .04);
  border-bottom: 1px solid rgba(140, 155, 175, .12);
  font-family: var(--mono); font-size: 11px; color: #8b9bb4;
}
.code-copy { font-size: 11px; color: #8b9bb4; padding: 2px 6px; border-radius: 5px; font-family: var(--font); }
.code-copy:hover { background: rgba(255, 255, 255, .08); color: #e2e8f0; }
.code-block pre { margin: 0; padding: 13px 15px; overflow-x: auto; }
.code-block code { font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: #cbd5e1; white-space: pre; }

.reasoning {
  margin-bottom: 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--bg-hover);
  font-size: 12.5px;
  color: var(--text-dim);
  overflow: hidden;
}
.reasoning summary { cursor: pointer; padding: 8px 12px; color: var(--text-mute); font-size: 12px; user-select: none; }
.reasoning-body { padding: 0 12px 10px; white-space: pre-wrap; line-height: 1.7; max-height: 260px; overflow-y: auto; }

.msg-actions { display: flex; gap: 2px; margin-top: 8px; opacity: 0; transition: opacity .16s; }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; }
.msg.user .msg-actions { justify-content: flex-end; }
.msg-actions button {
  width: 27px; height: 27px; border-radius: 7px; display: grid; place-items: center;
  color: var(--text-mute); transition: background .13s, color .13s;
}
.msg-actions button:hover { background: var(--bg-hover); color: var(--text); }
.msg-actions button.danger:hover { color: var(--danger); }
.msg-meta-line { font-size: 11px; color: var(--text-mute); margin-top: 6px; display: flex; gap: 8px; }

.streaming .md-body::after {
  content: ""; display: inline-block; width: 7px; height: 15px; margin-left: 3px;
  background: var(--accent); border-radius: 2px; vertical-align: -2px;
  animation: blink 1.05s steps(2, start) infinite;
}
.error-box {
  border: 1px solid rgba(240, 82, 82, .35);
  background: rgba(240, 82, 82, .08);
  color: #f8b4b4;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 12.8px;
  white-space: pre-wrap;
  line-height: 1.6;
  display: flex; align-items: flex-start; gap: 10px;
}
.error-box button { color: #fca5a5; text-decoration: underline; flex: none; font-size: 12px; }
.typing-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-mute); animation: bounce 1.2s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .16s; }
.typing-dots i:nth-child(3) { animation-delay: .32s; }

/* ============================== 输入区 ============================== */
.composer-area { flex: none; padding: 6px 28px 16px; background: linear-gradient(180deg, transparent, var(--bg) 30%); }
.composer {
  max-width: 848px; margin: 0 auto;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 12px 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .16);
  transition: border-color .18s, box-shadow .18s;
}
.composer:focus-within { border-color: rgba(111, 168, 160, .55); box-shadow: 0 10px 34px rgba(111, 168, 160, .12); }
#input {
  width: 100%; border: none; outline: none; background: none; resize: none;
  font-size: 14.5px; line-height: 1.7; padding: 2px 4px 8px; max-height: 200px;
  min-height: 26px;
}
#input::placeholder { color: var(--text-mute); }
.composer-bar { display: flex; align-items: center; gap: 8px; }
.model-picker { position: relative; display: flex; align-items: center; }
.model-picker select {
  appearance: none; -webkit-appearance: none;
  background: var(--bg-hover);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  font-size: 12px; color: var(--text-dim);
  padding: 6px 26px 6px 10px;
  max-width: 230px; text-overflow: ellipsis; cursor: pointer; outline: none;
}
.model-picker select:hover { border-color: rgba(111, 168, 160, .4); }
.model-picker select:focus { border-color: var(--accent); }
.model-picker select option, .model-picker select optgroup { background: var(--bg-elev); color: var(--text); }
.picker-caret { position: absolute; right: 8px; pointer-events: none; color: var(--text-mute); }
.temp-chip {
  display: flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--text-mute);
  padding: 5px 8px; border-radius: 7px;
  cursor: pointer; font-variant-numeric: tabular-nums;
}
.temp-chip:hover { background: var(--bg-hover); color: var(--text-dim); }
.spacer { flex: 1; }
.kbd-hint { font-size: 11px; color: var(--text-mute); opacity: .8; }
.send-btn {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #48807a); color: #fff;
  box-shadow: 0 5px 16px rgba(79, 70, 229, .34);
  transition: filter .15s, transform .15s;
}
.send-btn:hover { filter: brightness(1.08); }
.send-btn:active { transform: scale(.94); }
.send-btn.stop { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 5px 16px rgba(220, 38, 38, .3); }
.send-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.composer-hint { text-align: center; font-size: 10.5px; color: var(--text-mute); margin-top: 8px; opacity: .85; }

/* ============================== 右侧面板 ============================== */
.panel {
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: opacity .2s, transform .28s;
}
.app.panel-closed .panel { opacity: 0; pointer-events: none; }
.panel-tabs { display: flex; gap: 4px; padding: 14px 14px 0; border-bottom: 1px solid var(--border-soft); flex: none; }
.panel-tabs .tab {
  padding: 8px 12px 11px; font-size: 12.5px; color: var(--text-mute);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.panel-tabs .tab:hover { color: var(--text-dim); }
.panel-tabs .tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 550; }
.panel-body { flex: 1; overflow-y: auto; padding: 18px 16px 28px; }
.tab-pane { display: none; animation: fadeUp .22s ease both; }
.tab-pane.active { display: block; }

.field { margin-bottom: 20px; }
.field-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.field-head label { font-size: 12.5px; color: var(--text-dim); font-weight: 500; }
.field-head output { font-size: 11.5px; color: var(--text); font-variant-numeric: tabular-nums; background: var(--bg-hover); padding: 2px 8px; border-radius: 6px; }
.field-hint { font-size: 11px; color: var(--text-mute); margin: 7px 0 0; line-height: 1.6; }
.field input[type="number"], .field textarea, .field select {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 9px; padding: 9px 11px; font-size: 12.8px; outline: none;
  transition: border-color .15s;
}
.field input[type="number"]:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; line-height: 1.65; font-family: var(--font); min-height: 84px; }
input[type="range"] {
  width: 100%; appearance: none; -webkit-appearance: none; height: 4px; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent) var(--pct, 35%), rgba(140,155,175,.22) var(--pct, 35%));
  outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.35); cursor: pointer;
}
.panel-actions { padding-top: 4px; }
.panel-actions .ghost-btn { width: 100%; justify-content: center; }
.panel-section { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.section-title { font-size: 11px; letter-spacing: .8px; text-transform: uppercase; color: var(--text-mute); font-weight: 600; margin-bottom: 12px; }
.kbd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.kbd-list li { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-dim); }
kbd {
  font-family: var(--font); font-size: 10.5px; padding: 2.5px 7px; border-radius: 5px;
  background: var(--bg-hover); border: 1px solid var(--border); color: var(--text-mute);
}

.pane-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 12px; color: var(--text-dim); }
.prompt-list { display: flex; flex-direction: column; gap: 8px; }
.prompt-card {
  position: relative;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.prompt-card:hover { border-color: rgba(111, 168, 160, .5); transform: translateY(-1px); }
.prompt-card strong { display: block; font-size: 12.5px; font-weight: 550; margin-bottom: 4px; padding-right: 20px; }
.prompt-card p { margin: 0; font-size: 11.5px; color: var(--text-mute); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prompt-del { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 5px; color: var(--text-mute); display: grid; place-items: center; opacity: 0; }
.prompt-card:hover .prompt-del { opacity: 1; }
.prompt-del:hover { background: rgba(240, 82, 82, .12); color: var(--danger); }
.pane-tip { font-size: 11px; color: var(--text-mute); margin-top: 14px; text-align: center; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { padding: 12px; border-radius: 10px; background: var(--bg-hover); border: 1px solid var(--border-soft); }
.stat span { display: block; font-size: 11px; color: var(--text-mute); margin-bottom: 5px; }
.stat strong { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.spark { display: flex; align-items: flex-end; gap: 5px; height: 74px; padding-top: 6px; }
.spark .bar { flex: 1; background: linear-gradient(180deg, var(--accent), rgba(111, 168, 160, .55)); border-radius: 4px 4px 2px 2px; min-height: 3px; opacity: .9; transition: height .4s; }
.spark .bar.zero { background: var(--bg-hover); }
.spark-labels { display: flex; gap: 5px; margin-top: 6px; }
.spark-labels span { flex: 1; text-align: center; font-size: 9.5px; color: var(--text-mute); }
.model-usage { display: flex; flex-direction: column; gap: 11px; }
.model-row { font-size: 11.5px; }
.model-row-top { display: flex; justify-content: space-between; margin-bottom: 5px; color: var(--text-dim); gap: 8px; }
.model-row-top span:first-child { font-family: var(--mono); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-row-top span:last-child { color: var(--text-mute); flex: none; font-variant-numeric: tabular-nums; }
.model-bar { height: 5px; border-radius: 3px; background: rgba(140, 155, 175, .14); overflow: hidden; }
.model-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), #93c8c0); }
.empty-mini { font-size: 12px; color: var(--text-mute); text-align: center; padding: 16px 0; }

/* ============================== 弹层 ============================== */
.scrim {
  position: fixed; inset: 0; background: rgba(3, 6, 12, .62);
  backdrop-filter: blur(2px); opacity: 0; pointer-events: none;
  transition: opacity .22s; z-index: 45;
}
.scrim.show { opacity: 1; pointer-events: auto; }
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(3, 6, 12, .55);
  backdrop-filter: blur(6px);
  animation: fadeIn .18s ease both;
}
.modal[hidden] { display: none; }
.modal-card {
  width: 100%; max-width: 540px; max-height: 86vh;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: popIn .22s cubic-bezier(.2,.9,.3,1.1) both;
}
.modal-card.wide { max-width: 760px; }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 22px 16px; border-bottom: 1px solid var(--border-soft);
}
.modal-head h3 { margin: 0 0 5px; font-size: 15.5px; }
.modal-head p { margin: 0; font-size: 12px; color: var(--text-mute); line-height: 1.6; }
.modal-head code { font-family: var(--mono); font-size: 11px; background: var(--bg-hover); padding: 1px 5px; border-radius: 4px; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-body.form { display: flex; flex-direction: column; gap: 14px; }
.modal-body.form label { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; color: var(--text-dim); }
.modal-body.form input, .modal-body.form textarea {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 11px; font-size: 13px; outline: none; resize: vertical;
}
.modal-body.form input:focus, .modal-body.form textarea:focus { border-color: var(--accent); }
.modal-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-top: 1px solid var(--border-soft); background: var(--bg-panel);
  flex-wrap: wrap;
}
.default-model { font-size: 12px; color: var(--text-mute); display: flex; align-items: center; gap: 8px; }
.default-model select {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 9px; font-size: 12px; outline: none; max-width: 240px;
}

.provider-card {
  border: 1px solid var(--border); border-radius: 14px; padding: 15px; margin-bottom: 12px;
  background: var(--bg-panel);
}
.provider-card.locked { opacity: .92; }
.provider-top { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.provider-top .pname { font-size: 13px; font-weight: 600; flex: 1; }
.provider-tag { font-size: 10px; padding: 2px 7px; border-radius: 999px; background: var(--bg-active); color: #93c8c0; }
.provider-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.provider-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--text-mute); }
.provider-grid label.full { grid-column: 1 / -1; }
.provider-grid input, .provider-grid textarea {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 9px; font-size: 12px; outline: none; width: 100%;
  font-family: var(--mono); resize: vertical;
}
.provider-grid input:focus, .provider-grid textarea:focus { border-color: var(--accent); }
.provider-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.provider-actions .test-result { font-size: 11px; color: var(--text-mute); flex: 1; overflow: hidden; text-overflow: ellipsis; }
.provider-actions .test-result.ok { color: var(--ok); }
.provider-actions .test-result.err { color: var(--danger); }
.add-provider-empty { font-size: 12px; color: var(--text-mute); text-align: center; padding: 20px; border: 1px dashed var(--border); border-radius: 12px; }

/* Toast */
.toasts { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  padding: 9px 16px; border-radius: 10px; font-size: 12.5px;
  background: rgba(20, 26, 36, .96); color: #e6edf6;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  animation: toastIn .22s ease both;
}
.toast.err { border-color: rgba(240, 82, 82, .45); color: #fecaca; }
.toast.ok { border-color: rgba(34, 197, 94, .4); }
.toast.out { animation: toastOut .2s ease forwards; }

/* ============================== 动画 ============================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { opacity: 0; transform: scale(.97) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

.mobile-only { display: none; }

/* ============================== 响应式 ============================== */
@media (max-width: 1180px) {
  .app, .app.panel-closed { grid-template-columns: 278px minmax(0, 1fr); }
  .panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: 336px; z-index: 50;
    transform: translateX(102%); box-shadow: var(--shadow);
  }
  .app.panel-open .panel { transform: none; }
  .app.panel-closed .panel { opacity: 1; pointer-events: auto; }
  .scrim.show { display: block; }
}

@media (max-width: 880px) {
  .app, .app.panel-closed { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 278px; z-index: 50;
    transform: translateX(-102%); box-shadow: var(--shadow);
  }
  .app.sidebar-open .sidebar { transform: none; }
  .mobile-only { display: grid; }
  .topbar { padding: 12px 16px; min-height: 60px; }
  .composer-area { padding: 6px 14px 12px; }
  .messages { padding: 20px 16px 6px; gap: 22px; }
  .empty { padding: 40px 18px 30px; }
  .suggests { grid-template-columns: 1fr; }
  .kbd-hint { display: none; }
  .msg.user .msg-main { max-width: 92%; }
  .msg-actions { opacity: 1; }
  .modal { padding: 12px; }
  .provider-grid { grid-template-columns: 1fr; }
  .modal-card { max-height: 92vh; }
  .top-actions .ghost-btn span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==================================================================
   自媒体创作模式（平台 / 素材 / 稿件 / 配图）
   ================================================================== */
.panel-tabs { padding: 12px 8px 0; gap: 0; }
.panel-tabs .tab { padding: 8px 7px 10px; font-size: 12px; }

.platform-wrap { position: relative; }
.platform-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-hover);
  font-size: 11.5px; color: var(--text-dim);
  transition: border-color .15s, color .15s;
}
.platform-pill:hover { border-color: rgba(111,168,160,.45); color: var(--text); }
.platform-pill .pdot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.platform-pill .pdot.blank {
  background: transparent;
  border: 1px dashed var(--text-mute);
}
.platform-pill .pdot.blank + span { font-style: normal; opacity: .85; }
.platform-menu {
  position: absolute; top: calc(100% + 8px); left: -6px; z-index: 40;
  width: 272px; padding: 6px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow);
  animation: fadeUp .14s ease both;
}
.pm-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 8px; color: var(--text-dim);
}
.pm-item:hover { background: var(--bg-hover); }
.pm-item.active { background: var(--bg-active); color: var(--text); }
.pm-top { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text); font-weight: 550; }
.pm-top small { margin-left: auto; font-size: 10px; color: var(--text-mute); font-weight: 400; }
.pm-desc { font-size: 10.5px; color: var(--text-mute); margin-top: 2px; }

.tool-btn {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  color: var(--text-mute); flex: none;
}
.tool-btn:hover { background: var(--bg-hover); color: var(--text-dim); }

.attachments { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px 8px; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%;
  padding: 4px 7px 4px 9px;
  border-radius: 8px;
  background: rgba(111, 168, 160, .08);
  border: 1px solid rgba(111, 168, 160, .22);
  font-size: 11px; color: var(--text-dim);
}
.attach-chip .ac-title { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip button { color: var(--text-mute); display: grid; place-items: center; padding: 1px; }
.attach-chip button:hover { color: var(--danger); }

/* 稿件包卡片 */
.article-card {
  margin: 12px 0 2px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elev);
  overflow: hidden;
}
.ac-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-panel);
  font-size: 11.5px; color: var(--text-mute);
}
.ac-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 550;
  background: rgba(111, 168, 160, .14); color: #93c8c0;
  border: 1px solid rgba(111, 168, 160, .25);
}
.ac-head .ac-spacer { flex: 1; }
.ac-body { padding: 12px 13px 6px; }
.ac-label { font-size: 10px; letter-spacing: .6px; text-transform: uppercase; color: var(--text-mute); margin-bottom: 7px; }
.ac-title-row {
  display: flex; align-items: flex-start; gap: 7px;
  padding: 5px 0;
  font-size: 12.8px; color: var(--text-dim); line-height: 1.5;
}
.ac-title-row .idx {
  width: 15px; height: 15px; flex: none; margin-top: 1px;
  border-radius: 4px; background: var(--bg-hover);
  font-size: 9px; display: grid; place-items: center; color: var(--text-mute);
}
.ac-title-row span.txt { flex: 1; }
.ac-title-row.active { color: var(--text); }
.ac-title-row.active .idx { background: rgba(111,168,160,.25); color: #a3d4cd; }
.ac-adopt { font-size: 10px; color: #7fb8b0; padding: 1px 6px; border-radius: 5px; flex: none; }
.ac-adopt:hover { background: rgba(111,168,160,.14); }
.ac-title-row.active .ac-adopt { color: var(--ok); }
.ac-summary {
  margin: 10px 0 0; padding: 9px 11px;
  border-left: 2px solid rgba(111,168,160,.5);
  background: var(--bg-hover);
  border-radius: 0 8px 8px 0;
  font-size: 12px; line-height: 1.7; color: var(--text-dim);
}
.ac-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 11px 0 4px; }
.ac-tag {
  font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
  background: rgba(111, 168, 160, .1);
  border: 1px solid rgba(111, 168, 160, .2);
  color: #93c8c0;
}
.ac-plans { margin: 12px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.ac-plan {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 11.5px; color: var(--text-dim);
  padding: 6px 8px; border-radius: 8px; background: var(--bg-hover);
}
.ac-plan .ratio {
  flex: none; font-family: var(--mono); font-size: 9.5px;
  padding: 1px 5px; border-radius: 4px;
  background: rgba(111, 168, 160, .1); color: #67e8f9;
}
.ac-plan b { color: var(--text); font-weight: 550; margin-right: 4px; }
.ac-checks { margin: 12px 0 4px; display: flex; flex-direction: column; gap: 4px; }
.ac-checks div { font-size: 11px; color: var(--text-mute); display: flex; gap: 6px; }
.ac-checks i { color: var(--ok); font-style: normal; }
.ac-full { display: none; padding: 6px 13px 0; border-top: 1px solid var(--border-soft); margin-top: 10px; }
.article-card.expanded .ac-full { display: block; }
.ac-foot {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 9px 12px; border-top: 1px solid var(--border-soft);
  background: var(--bg-panel);
}
.ac-btn {
  font-size: 11px; padding: 4px 9px; border-radius: 7px;
  border: 1px solid var(--border); color: var(--text-dim);
  background: var(--bg-elev);
}
.ac-btn:hover { border-color: rgba(111,168,160,.45); color: var(--text); }
.ac-btn.primary { background: rgba(111,168,160,.16); border-color: rgba(111,168,160,.4); color: #a3d4cd; }

/* 平台档案面板 */
.platform-hero {
  padding: 14px; border-radius: 13px;
  background: var(--bg-hover);
  border: 1px solid var(--border-soft);
}
.ph-top { display: flex; align-items: center; gap: 9px; }
.ph-emoji { font-size: 20px; line-height: 1; }
.ph-name { font-size: 14.5px; font-weight: 600; }
.ph-tag { font-size: 10.5px; color: var(--text-mute); margin-top: 2px; }
.ph-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.ph-stat { padding: 7px 9px; border-radius: 8px; background: var(--bg-panel); border: 1px solid var(--border-soft); }
.ph-stat span { display: block; font-size: 9.5px; color: var(--text-mute); }
.ph-stat strong { font-size: 12px; font-weight: 550; }

.rules { margin-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.rule { display: flex; gap: 8px; font-size: 11.8px; line-height: 1.65; color: var(--text-dim); }
.rule b { flex: none; color: var(--text-mute); font-weight: 500; width: 40px; }
.rule span { flex: 1; }

/* 素材 / 稿件列表 */
.asset-item {
  padding: 10px 11px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-elev); margin-bottom: 8px;
}
.asset-title { font-size: 12px; font-weight: 550; line-height: 1.5; margin-bottom: 3px; }
.asset-meta { font-size: 10px; color: var(--text-mute); display: flex; gap: 6px; flex-wrap: wrap; }
.asset-actions { display: flex; gap: 6px; margin-top: 8px; }
.asset-actions button, .article-item button.mini {
  font-size: 10px; padding: 2px 7px; border-radius: 5px;
  border: 1px solid var(--border); color: var(--text-mute);
}
.asset-actions button:hover { border-color: rgba(111,168,160,.4); color: var(--text-dim); }
.asset-actions button.danger:hover { border-color: rgba(240,82,82,.4); color: var(--danger); }

.article-item {
  padding: 10px 11px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-elev); margin-bottom: 8px; cursor: pointer;
  transition: border-color .15s;
}
.article-item:hover { border-color: rgba(111,168,160,.45); }
.article-item .ai-top { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.article-item .ai-plat { font-size: 9.5px; padding: 1px 6px; border-radius: 999px; background: var(--bg-active); color: #93c8c0; }
.article-item .ai-title { font-size: 12px; font-weight: 550; line-height: 1.5; }
.article-item .ai-meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 10px; color: var(--text-mute); }
.article-item .ai-meta button { margin-left: auto; }

.link-result { font-size: 12px; color: var(--text-mute); line-height: 1.7; min-height: 18px; }
.link-result.ok { color: var(--ok); }
.link-result.err { color: var(--danger); white-space: pre-wrap; }
.link-result .lr-title { color: var(--text); font-weight: 550; margin-bottom: 3px; }

.edit-area {
  width: 100%; min-height: 60px; resize: vertical;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; font-size: 13.5px; line-height: 1.7;
  outline: none;
}
.edit-bar { display: flex; gap: 6px; justify-content: flex-end; margin-top: 7px; }
.edit-bar .ghost-btn, .edit-bar .primary-btn { padding: 4px 10px; font-size: 11.5px; }

/* 顶栏需要独立层叠上下文，避免下拉菜单被消息区盖住 */
.topbar { position: relative; z-index: 20; }

/* ==================================================================
   配图工坊
   ================================================================== */
.modal-card.xwide { width: min(1120px, 94vw); max-height: 88vh; }

.settings-extra { margin-top: 14px; padding-top: 4px; border-top: 1px dashed var(--border-soft); }
.settings-extra .section-title { margin: 12px 0 10px; }
.settings-extra .provider-card { margin-bottom: 10px; }
.check-line {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-dim);
  padding: 8px 0 0;
}
.check-line input { accent-color: var(--accent); }

/* 稿件卡：配图位按钮与图片条 */
.ac-plan { align-items: center; }
.ac-plan-btn {
  margin-left: auto; flex: none;
  font-size: 10px; padding: 2px 8px; border-radius: 6px;
  border: 1px solid rgba(111, 168, 160, .3); color: #67e8f9;
  background: rgba(111, 168, 160, .08);
}
.ac-plan-btn:hover { background: rgba(111, 168, 160, .18); }
.ac-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 13px 2px; }
.ac-img {
  position: relative; width: 108px; border-radius: 9px; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-hover);
}
.ac-img img { display: block; width: 100%; height: 76px; object-fit: cover; }
.ac-img span {
  position: absolute; left: 5px; bottom: 4px;
  font-size: 9px; padding: 1px 5px; border-radius: 4px;
  background: rgba(10, 12, 20, .72); color: #dbe2f0; max-width: 90px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ac-img button {
  position: absolute; right: 3px; top: 3px;
  width: 17px; height: 17px; border-radius: 50%;
  background: rgba(10, 12, 20, .72); color: #cdd6e4;
  font-size: 11px; line-height: 1; display: grid; place-items: center;
}
.ac-img button:hover { background: var(--danger); color: #fff; }

/* 弹层布局 */
.im-body { display: flex; gap: 14px; min-height: 0; padding: 4px 0; }
.im-left { flex: 1.25; min-width: 0; display: flex; flex-direction: column; }
.im-right {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px;
  border-left: 1px solid var(--border-soft); padding-left: 14px;
}

.im-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.im-tab {
  font-size: 11.5px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-mute); background: transparent;
}
.im-tab:hover { color: var(--text-dim); border-color: rgba(111, 168, 160, .4); }
.im-tab.active { background: rgba(111, 168, 160, .16); border-color: rgba(111, 168, 160, .45); color: #a3d4cd; }

.im-panes { flex: 1; min-height: 0; overflow-y: auto; padding-right: 4px; }
.im-pane { display: none; }
.im-pane.active { display: block; }

.im-field { display: block; margin-bottom: 10px; font-size: 11.5px; color: var(--text-mute); }
.im-field input, .im-field textarea, .im-field select {
  display: block; width: 100%; margin-top: 5px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px;
  font-size: 13px; color: var(--text); outline: none;
}
.im-field textarea { resize: vertical; min-height: 52px; line-height: 1.6; }
.im-field input:focus, .im-field textarea:focus, .im-field select:focus { border-color: rgba(111, 168, 160, .55); }
.im-field input[type="color"] { padding: 2px 3px; height: 34px; cursor: pointer; }
.im-row { display: grid; grid-template-columns: 1fr 96px; gap: 10px; }
.im-go { width: 100%; margin-top: 2px; }
.im-go:disabled { opacity: .55; cursor: wait; }

.im-search { display: flex; gap: 8px; margin-bottom: 10px; }
.im-search input {
  flex: 1; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; font-size: 13px; color: var(--text); outline: none;
}
.im-search input:focus { border-color: rgba(111, 168, 160, .55); }

.im-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}
.im-item {
  position: relative; border-radius: 9px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-hover);
  aspect-ratio: 4 / 3;
}
.im-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.im-item:hover { border-color: rgba(111, 168, 160, .55); }
.im-item.sel { border-color: #7fb8b0; box-shadow: 0 0 0 2px rgba(111, 168, 160, .35); }
.im-item .im-tag {
  position: absolute; left: 5px; bottom: 4px;
  font-size: 9px; padding: 1px 5px; border-radius: 4px;
  background: rgba(10, 12, 20, .7); color: #dbe2f0;
}
.im-item .im-tag.cover { background: rgba(111, 168, 160, .78); }
.im-item .im-tag.ai { background: rgba(236, 72, 153, .78); }
.im-item .im-tag.stock { background: rgba(16, 185, 129, .75); }
.im-item .im-del {
  position: absolute; right: 3px; top: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(10, 12, 20, .7); color: #cdd6e4;
  font-size: 11px; line-height: 1; display: none; place-items: center;
}
.im-item:hover .im-del { display: grid; }
.im-item .im-del:hover { background: var(--danger); color: #fff; }
.im-item .im-loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(10, 12, 22, .55); font-size: 11px; color: #dbe2f0;
}

/* 预览区 */
.im-stage {
  flex: 1; min-height: 260px; border-radius: 12px;
  border: 1px solid var(--border); background:
    repeating-conic-gradient(var(--bg-hover) 0% 25%, var(--bg-panel) 0% 50%) 50%/22px 22px;
  display: grid; place-items: center; overflow: hidden;
}
.im-stage img { max-width: 100%; max-height: 340px; object-fit: contain; display: block; }
.im-stage-empty { font-size: 12px; color: var(--text-mute); padding: 20px; text-align: center; }
.im-info { font-size: 11px; color: var(--text-mute); min-height: 15px; }
.im-actions { display: flex; align-items: center; gap: 8px; }

@media (max-width: 880px) {
  .im-body { flex-direction: column; }
  .im-right { border-left: none; padding-left: 0; border-top: 1px solid var(--border-soft); padding-top: 12px; }
  .im-stage img { max-height: 260px; }
}

.settings-extra .check-line { grid-column: 1 / -1; }

/* 移动端配图工坊：允许整体滚动，压缩预览高度 */
@media (max-width: 880px) {
  .modal-card.xwide { overflow-y: auto; }
  .im-body { overflow: visible; }
  .im-stage { min-height: 170px; }
  .im-stage img { max-height: 190px; }
}

/* 复选框在 provider-grid 里保持同行 */
.provider-grid label.check-line { flex-direction: row; align-items: center; gap: 7px; padding: 6px 0 0; }
.provider-grid label.check-line input { width: auto; margin: 0; accent-color: var(--accent); }

/* ==================================================================
   跨平台改写菜单 + 发布体检面板
   ================================================================== */
.ac-foot { position: relative; }
.ac-btn.on { border-color: rgba(52, 211, 153, .45); color: #6ee7b7; }

.ac-menu {
  position: absolute; bottom: calc(100% + 6px); left: 8px; z-index: 30;
  width: 236px; padding: 5px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 11px; box-shadow: var(--shadow);
  animation: fadeUp .14s ease both;
}
.ac-menu-title { font-size: 10px; color: var(--text-mute); padding: 5px 8px 6px; letter-spacing: .5px; }
.ac-mi {
  display: flex; align-items: center; gap: 7px; width: 100%;
  padding: 7px 8px; border-radius: 7px;
  font-size: 12px; color: var(--text-dim); text-align: left;
}
.ac-mi:hover { background: var(--bg-hover); color: var(--text); }
.ac-mi-emoji { font-size: 13px; }
.ac-mi-name { flex: 1; }
.ac-mi-meta { font-size: 9.5px; color: var(--text-mute); }

.ac-check-panel {
  border-top: 1px solid var(--border-soft);
  background: var(--bg-panel);
  padding: 12px 13px 14px;
}
.ck-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ck-score {
  width: 52px; height: 52px; flex: none; border-radius: 50%;
  display: grid; place-items: center; align-content: center;
  border: 2px solid var(--border); line-height: 1;
}
.ck-score b { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ck-score span { display: block; font-size: 9px; margin-top: 2px; opacity: .85; letter-spacing: .5px; }
.ck-score.grade-A { color: #34d399; border-color: rgba(52, 211, 153, .45); background: rgba(52, 211, 153, .09); }
.ck-score.grade-B { color: #60a5fa; border-color: rgba(96, 165, 250, .45); background: rgba(96, 165, 250, .09); }
.ck-score.grade-C { color: #fbbf24; border-color: rgba(251, 191, 36, .45); background: rgba(251, 191, 36, .09); }
.ck-score.grade-D { color: #f87171; border-color: rgba(248, 113, 113, .45); background: rgba(248, 113, 113, .09); }

.ck-verdict { flex: 1; min-width: 130px; }
.ck-verdict strong { display: block; font-size: 13.5px; font-weight: 600; }
.ck-verdict span { display: block; margin-top: 3px; font-size: 10.5px; color: var(--text-mute); }
.ck-counts { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
.ck-counts span {
  font-size: 9.5px; padding: 1px 7px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-mute);
}
.ck-counts .hi { border-color: rgba(248, 113, 113, .4); color: #fca5a5; }
.ck-counts .mid { border-color: rgba(251, 191, 36, .4); color: #fcd34d; }
.ck-counts .fail { border-color: rgba(96, 165, 250, .4); color: #93c5fd; }

.ck-body { margin-top: 4px; }
.ck-sec-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 13px 0 6px; font-size: 10.5px; letter-spacing: .5px; color: var(--text-mute);
  text-transform: uppercase;
}
.ck-sec-title span { font-size: 10px; letter-spacing: 0; text-transform: none; }

.ck-check {
  display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap;
  padding: 3px 0; font-size: 11.5px; color: var(--text-dim);
}
.ck-check i { font-style: normal; width: 11px; flex: none; text-align: center; }
.ck-check.ok i { color: var(--ok); }
.ck-check.fail i { color: var(--danger); }
.ck-check.hint i { color: var(--text-mute); }
.ck-check-value { color: var(--text); font-variant-numeric: tabular-nums; }
.ck-check-hint { flex-basis: 100%; padding-left: 18px; font-size: 10.5px; color: var(--text-mute); line-height: 1.6; }

.ck-issue {
  margin-top: 8px; padding: 8px 10px;
  border-radius: 9px; background: var(--bg-elev);
  border: 1px solid var(--border-soft); border-left-width: 2px;
}
.ck-issue.high { border-left-color: #f87171; }
.ck-issue.mid { border-left-color: #fbbf24; }
.ck-issue.low { border-left-color: #94a3b8; }
.ck-issue-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; }
.ck-lv {
  font-size: 9px; padding: 1px 6px; border-radius: 4px;
  background: var(--bg-hover); color: var(--text-mute);
}
.ck-issue.high .ck-lv { background: rgba(248, 113, 113, .14); color: #fca5a5; }
.ck-issue.mid .ck-lv { background: rgba(251, 191, 36, .14); color: #fcd34d; }
.ck-kind { font-size: 10px; color: var(--text-mute); }
.ck-issue-head b { font-size: 12.5px; color: var(--text); font-weight: 600; }
.ck-issue.high .ck-issue-head b { color: #fca5a5; }
.ck-where { margin-left: auto; font-size: 9.5px; color: var(--text-mute); }
.ck-snip {
  margin-top: 5px; padding: 4px 7px; border-radius: 5px;
  background: var(--bg-hover); font-size: 10.5px; color: var(--text-mute);
  line-height: 1.65; overflow-wrap: anywhere;
}
.ck-advice { margin-top: 5px; font-size: 10.8px; color: var(--text-dim); line-height: 1.65; }
.ck-sugs { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px; font-size: 10px; color: var(--text-mute); }
.ck-sugs button {
  font-size: 10px; padding: 2px 7px; border-radius: 5px;
  border: 1px solid rgba(111, 168, 160, .35); color: #93c8c0;
  background: rgba(111, 168, 160, .08);
}
.ck-sugs button:hover { background: rgba(111, 168, 160, .18); }
.ck-clean { padding: 6px 0 2px; font-size: 11.5px; color: var(--ok); }

/* 稿件库模态内的体检面板 */
.ac-check-panel.art-check {
  border: 1px solid var(--border-soft); border-radius: 10px;
  margin-bottom: 14px;
}

/* ==================================================================
   灵感工坊：批量选题 / 爆款拆解
   ================================================================== */
.idea-tabs { align-items: center; margin-bottom: 12px; }
.idea-plat { margin-left: auto; font-size: 10.5px; color: var(--text-mute); }

.idea-pane { display: none; }
.idea-pane.active { display: block; }

.idea-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px;
  padding: 12px 12px 2px; margin-bottom: 12px;
  border-radius: 12px; background: var(--bg-panel);
  border: 1px solid var(--border-soft);
}
.idea-form .im-field { margin-bottom: 10px; }
.idea-full { grid-column: 1 / -1; }
.idea-go-wrap { display: flex; flex-direction: column; justify-content: flex-end; }
.idea-go-wrap > span { display: none; }

.idea-list { display: flex; flex-direction: column; gap: 8px; }

.tp-item {
  padding: 10px 12px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--bg-elev);
  transition: border-color .15s;
}
.tp-item:hover { border-color: rgba(111, 168, 160, .4); }
.tp-item.used { opacity: .58; }
.tp-head { display: flex; align-items: flex-start; gap: 8px; }
.tp-idx { font-family: var(--mono); font-size: 10px; color: var(--text-mute); padding-top: 2px; flex: none; }
.tp-title { flex: 1; font-size: 13px; font-weight: 550; line-height: 1.5; }
.tp-fmt {
  flex: none; font-size: 9.5px; padding: 1px 7px; border-radius: 999px;
  background: rgba(111, 168, 160, .12); color: #93c8c0;
  border: 1px solid rgba(111, 168, 160, .22);
}
.tp-angle { margin: 6px 0 0 22px; font-size: 11px; color: var(--text-mute); line-height: 1.65; }
.tp-why { margin: 3px 0 0 22px; font-size: 10.5px; color: var(--text-mute); line-height: 1.65; }
.tp-foot { display: flex; align-items: center; gap: 6px; margin-top: 9px; padding-left: 22px; }
.tp-kw {
  font-size: 10px; color: var(--text-mute);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tp-spacer { flex: 1; }
.tp-used { font-size: 9.5px; color: var(--ok); flex: none; }

/* 拆解结果 */
.bd-card {
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg-elev); padding: 12px 14px 10px;
}
.bd-top { display: flex; align-items: center; gap: 8px; }
.bd-badge {
  flex: none; font-size: 10px; padding: 2px 8px; border-radius: 999px;
  background: rgba(236, 72, 153, .14); color: #f9a8d4;
  border: 1px solid rgba(236, 72, 153, .25);
}
.bd-src {
  flex: 1; font-size: 12px; font-weight: 550;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bd-time { flex: none; font-size: 10px; color: var(--text-mute); }
.bd-summary {
  margin-top: 9px; padding: 8px 10px;
  border-left: 2px solid rgba(236, 72, 153, .5);
  background: var(--bg-hover); border-radius: 0 8px 8px 0;
  font-size: 11.5px; line-height: 1.7; color: var(--text-dim);
}
.bd-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin-top: 12px; }
.bd-score { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--text-mute); }
.bd-score span { width: 26px; flex: none; }
.bd-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--bg-hover); overflow: hidden; }
.bd-bar i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--accent), #93c8c0); }
.bd-score b { width: 20px; text-align: right; font-size: 10.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.bd-sec { margin-top: 14px; }
.bd-sec h4 {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 6px; font-size: 11px; letter-spacing: .4px; color: var(--text-mute);
}
.bd-sec blockquote {
  margin: 0 0 6px; padding: 7px 10px;
  border-left: 2px solid rgba(111, 168, 160, .5);
  background: var(--bg-hover); border-radius: 0 7px 7px 0;
  font-size: 11.5px; line-height: 1.7; color: var(--text-dim);
}
.bd-sec p { font-size: 11px; line-height: 1.7; color: var(--text-mute); }
.bd-hook-type {
  font-size: 9.5px; padding: 1px 6px; border-radius: 4px;
  background: rgba(236, 72, 153, .12); color: #f9a8d4;
}
.bd-steps { display: flex; flex-direction: column; gap: 6px; }
.bd-step { display: flex; gap: 8px; padding: 7px 9px; border-radius: 8px; background: var(--bg-hover); }
.bd-step-no { font-family: var(--mono); font-size: 9.5px; color: var(--text-mute); padding-top: 2px; flex: none; }
.bd-step b { font-size: 11.5px; font-weight: 550; }
.bd-step p { font-size: 10.5px; color: var(--text-mute); line-height: 1.65; margin-top: 2px; }
.bd-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.bd-chip {
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  background: var(--bg-hover); border: 1px solid var(--border); color: var(--text-dim);
}
.bd-template {
  margin: 0; padding: 10px 12px; border-radius: 9px;
  background: var(--bg-panel); border: 1px solid var(--border-soft);
  font-family: inherit; font-size: 11.5px; line-height: 1.85;
  color: var(--text-dim); white-space: pre-wrap;
  max-height: 260px; overflow-y: auto;
}
.bd-transfer { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 4px; }
.bd-transfer li { font-size: 11px; line-height: 1.7; color: var(--text-mute); }
.bd-actions {
  display: flex; align-items: center; gap: 6px;
  margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border-soft);
}

.bd-history { margin-top: 14px; }
.bd-hist-title { font-size: 10px; letter-spacing: .5px; color: var(--text-mute); margin-bottom: 6px; }
.bd-hist-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 8px; margin-bottom: 5px;
  border: 1px solid var(--border-soft); background: var(--bg-elev);
  font-size: 11px; cursor: pointer;
}
.bd-hist-item:hover { border-color: rgba(111, 168, 160, .4); }
.bd-hist-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-hist-item time { flex: none; font-size: 9.5px; color: var(--text-mute); }

@media (max-width: 880px) {
  .idea-form { grid-template-columns: 1fr; }
  .bd-scores { grid-template-columns: 1fr; }
  .idea-plat { display: none; }
}

/* ============================ 内容日历 ============================ */
.side-wide-btn {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 9px 11px; margin-bottom: 8px; border-radius: 10px;
  border: 1px solid var(--border-soft); background: var(--bg-elev);
  color: var(--text-dim); font-size: 12px; font-family: inherit;
  cursor: pointer; transition: all .16s ease;
}
.side-wide-btn:hover { color: var(--text); border-color: rgba(111,168,160,.45); background: var(--bg-active); }
.side-wide-btn svg { color: var(--accent); flex: none; }
.side-wide-btn em {
  margin-left: auto; font-style: normal; font-size: 10px; font-weight: 600;
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: #fff; display: grid; place-items: center;
}

.cal-card {
  width: min(1060px, 95vw); max-width: none; height: 86vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.cal-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 18px; border-bottom: 1px solid var(--border-soft); flex: none;
}
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav strong { font-size: 13.5px; margin-left: 6px; letter-spacing: .2px; }
.cal-legend { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-legend span { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--text-mute); }
.cal-legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

.cal-body { display: flex; flex: 1; min-height: 0; }
.cal-main { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 10px 14px 14px; overflow: auto; }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  padding: 0 0 6px; flex: none;
}
.cal-weekdays span { text-align: center; font-size: 10px; color: var(--text-mute); letter-spacing: .5px; }
.cal-weekdays span.wk { color: var(--text-dim); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; flex: 1; min-height: 0; }
.cal-cell {
  min-height: 78px; padding: 5px 5px 4px; border-radius: 9px;
  border: 1px solid var(--border-soft); background: var(--bg-elev);
  display: flex; flex-direction: column; gap: 3px; overflow: hidden;
  cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.cal-cell:hover { border-color: rgba(111,168,160,.35); }
.cal-cell.mute { opacity: .42; }
.cal-cell.sel { border-color: var(--accent); background: var(--bg-active); }
.cal-cell.today .cal-date {
  background: var(--accent); color: #fff; border-radius: 5px; padding: 0 4px;
}
.cal-date { font-size: 10.5px; color: var(--text-dim); align-self: flex-start; line-height: 16px; }
.cal-items { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-item {
  --pc: var(--accent);
  display: block; width: 100%; text-align: left; font-family: inherit;
  font-size: 9.5px; line-height: 1.45; padding: 2px 5px; border-radius: 4px;
  border: 0; border-left: 2px solid var(--pc); cursor: pointer;
  background: color-mix(in srgb, var(--pc) 14%, transparent);
  color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-item:hover { color: var(--text); background: color-mix(in srgb, var(--pc) 24%, transparent); }
.cal-item.done { opacity: .55; text-decoration: line-through; }
.cal-item.late { color: #f87171; }
.cal-more { font-size: 9px; color: var(--text-mute); padding-left: 4px; }

.cal-side {
  width: 292px; flex: none; border-left: 1px solid var(--border-soft);
  display: flex; flex-direction: column; padding: 12px 14px 14px; min-height: 0;
  background: var(--bg-panel);
}
.cal-side-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.cal-side-head strong { font-size: 12.5px; }
.cal-side-head span { font-size: 10px; color: var(--text-mute); }
.cal-day-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 2px; }
.cal-empty { font-size: 11px; color: var(--text-mute); text-align: center; padding: 26px 10px; line-height: 1.8; }
.cal-row {
  display: flex; align-items: flex-start; gap: 8px; padding: 8px 9px;
  border-radius: 9px; border: 1px solid var(--border-soft); background: var(--bg-elev);
  transition: border-color .15s ease;
}
.cal-row:hover { border-color: rgba(111,168,160,.4); }
.cal-row.late { border-color: rgba(240,82,82,.4); }
.cal-check {
  width: 17px; height: 17px; flex: none; margin-top: 1px; border-radius: 50%;
  border: 1.5px solid var(--border); background: transparent; cursor: pointer;
  display: grid; place-items: center; padding: 0; color: transparent;
}
.cal-check:hover { border-color: var(--ok); }
.cal-check.writing { border-color: #f59e0b; color: #f59e0b; }
.cal-check.done { border-color: var(--ok); background: var(--ok); color: #fff; }
.cal-check.skipped { border-style: dashed; color: var(--text-mute); }
.cal-row-main { flex: 1; min-width: 0; }
.cal-row-title { font-size: 11.5px; line-height: 1.5; word-break: break-word; }
.cal-row.done .cal-row-title { color: var(--text-mute); text-decoration: line-through; }
.cal-row-meta { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 9.5px; color: var(--text-mute); }
.cal-row-meta i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.cal-row-act {
  border: 0; background: transparent; color: var(--text-mute); cursor: pointer;
  padding: 2px 3px; border-radius: 5px; font-size: 10px; font-family: inherit; flex: none;
}
.cal-row-act:hover { color: var(--text); background: var(--bg-hover); }
.cal-add { padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--border-soft); }
.cal-add input {
  width: 100%; padding: 8px 10px; border-radius: 8px; font-family: inherit; font-size: 12px;
  border: 1px solid var(--border); background: var(--bg-input); color: var(--text); outline: none;
}
.cal-add input:focus { border-color: rgba(111,168,160,.6); }
.cal-add-row { display: flex; gap: 6px; margin-top: 6px; }
.cal-add-row select {
  flex: 1; min-width: 0; padding: 7px 8px; border-radius: 8px; font-family: inherit; font-size: 11.5px;
  border: 1px solid var(--border); background: var(--bg-input); color: var(--text); outline: none;
}
.cal-add-row .primary-btn { padding: 7px 14px; font-size: 11.5px; }

@media (max-width: 880px) {
  .cal-card { width: 96vw; height: 92vh; }
  .cal-body { flex-direction: column; overflow-y: auto; }
  .cal-main { overflow: visible; flex: none; padding: 8px 10px; }
  .cal-grid { flex: none; }
  .cal-cell { min-height: 58px; padding: 4px; }
  .cal-item { font-size: 9px; padding: 1px 3px; }
  .cal-side { width: 100%; border-left: 0; border-top: 1px solid var(--border-soft); padding: 10px; }
  .cal-day-list { max-height: 200px; flex: none; }
  .cal-legend { display: none; }
}

/* ============================ 侧栏工具 / 附件 ============================ */
.side-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.side-tools .side-wide-btn {
  margin-bottom: 0; justify-content: center; padding: 8px 6px;
  font-size: 11.5px; gap: 5px;
}
.side-tools .side-wide-btn em { margin-left: 1px; font-size: 9px; min-width: 15px; height: 15px; }
.side-tools .side-wide-btn em[data-kind="soft"] { background: var(--bg-active); color: var(--accent); }

.upload-strip { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px 12px 0; }
.up-card {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elev);
  max-width: 236px;
}
.up-thumb { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; flex: none; background: var(--bg-active); }
.up-icon {
  width: 34px; height: 34px; border-radius: 7px; flex: none;
  display: grid; place-items: center; font-size: 9px; font-weight: 650; letter-spacing: .2px;
  background: linear-gradient(135deg, rgba(111,168,160,.9), rgba(111,168,160,.75)); color: #fff;
  text-transform: uppercase;
}
.up-icon.k-image { background: linear-gradient(135deg, #6fa8a0, #48807a); }
.up-icon.k-pdf { background: linear-gradient(135deg, #ef4444, #f97316); }
.up-icon.k-docx { background: linear-gradient(135deg, #2563eb, #38bdf8); }
.up-icon.k-xlsx { background: linear-gradient(135deg, #16a34a, #84cc16); }
.up-icon.k-pptx { background: linear-gradient(135deg, #ea580c, #fbbf24); }
.up-icon.k-audio, .up-icon.k-video { background: linear-gradient(135deg, #3f7f76, #db2777); }
.up-main { min-width: 0; }
.up-name { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-meta { font-size: 9.5px; color: var(--text-mute); margin-top: 2px; white-space: nowrap; }
.up-acts { display: flex; align-items: center; gap: 1px; flex: none; }
.up-act {
  border: 0; background: transparent; color: var(--text-mute); cursor: pointer;
  padding: 3px 4px; border-radius: 5px; font-size: 10px; font-family: inherit;
}
.up-act:hover { color: var(--text); background: var(--bg-hover); }
.up-act.hot { color: var(--accent); }
.up-busy { font-size: 10px; color: var(--text-mute); padding: 0 4px; }

/* ============================ 技能库 ============================ */
.skills-card { width: min(1140px, 95vw); max-width: none; height: 86vh; display: flex; flex-direction: column; overflow: hidden; }
.sk-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 18px; border-bottom: 1px solid var(--border-soft); flex: none;
}
.sk-cats { display: flex; gap: 5px; flex-wrap: wrap; }
.sk-cat {
  font-size: 11px; padding: 4px 10px; border-radius: 999px; font-family: inherit;
  border: 1px solid var(--border); background: transparent; color: var(--text-dim); cursor: pointer;
  transition: all .15s ease;
}
.sk-cat:hover { color: var(--text); border-color: rgba(111,168,160,.4); }
.sk-cat.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.sk-search {
  display: flex; align-items: center; gap: 6px; margin-left: auto;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-input);
}
.sk-search svg { color: var(--text-mute); flex: none; }
.sk-search input { border: 0; background: transparent; color: var(--text); outline: none; font-family: inherit; font-size: 11.5px; width: 160px; }

.sk-body { display: flex; flex: 1; min-height: 0; padding: 0; }
.sk-grid {
  flex: 1; overflow-y: auto; padding: 14px 16px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; align-content: start;
}
.sk-card {
  border: 1px solid var(--border-soft); border-radius: 11px; padding: 11px 12px;
  background: var(--bg-elev); cursor: pointer; transition: all .15s ease;
}
.sk-card:hover { border-color: rgba(111,168,160,.4); }
.sk-card.sel { border-color: var(--accent); background: var(--bg-active); }
.sk-card.on { box-shadow: inset 3px 0 0 var(--ok); }
.sk-card-head { display: flex; align-items: center; gap: 7px; }
.sk-card-title { font-size: 12.5px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-tag { font-size: 9px; padding: 1px 6px; border-radius: 4px; background: var(--bg-hover); color: var(--text-mute); flex: none; }
.sk-card-desc {
  font-size: 11px; color: var(--text-mute); line-height: 1.65; margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sk-card-foot { display: flex; align-items: center; gap: 6px; margin-top: 9px; font-size: 9.5px; color: var(--text-mute); }
.sk-switch { position: relative; width: 30px; height: 17px; margin-left: auto; flex: none; cursor: pointer; }
.sk-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.sk-switch i {
  position: absolute; inset: 0; border-radius: 999px; background: var(--border);
  transition: background .18s ease;
}
.sk-switch i::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px;
  border-radius: 50%; background: #fff; transition: transform .18s ease;
}
.sk-switch input:checked + i { background: var(--ok); }
.sk-switch input:checked + i::after { transform: translateX(13px); }

.sk-detail {
  width: 340px; flex: none; border-left: 1px solid var(--border-soft);
  background: var(--bg-panel); padding: 14px 16px; overflow-y: auto;
}
.sk-detail-empty { font-size: 11.5px; color: var(--text-mute); text-align: center; padding: 40px 12px; line-height: 1.9; }
.sk-detail h4 { margin: 0 0 4px; font-size: 13.5px; }
.sk-detail-meta { font-size: 10px; color: var(--text-mute); line-height: 1.7; margin-bottom: 10px; }
.sk-detail-body {
  font-size: 11.5px; line-height: 1.85; color: var(--text-dim);
  border-top: 1px solid var(--border-soft); padding-top: 10px;
  white-space: pre-wrap; word-break: break-word;
}
.sk-detail-body h1, .sk-detail-body h2, .sk-detail-body h3 { font-size: 12px; color: var(--text); margin: 12px 0 5px; }
.sk-source { display: inline-block; font-size: 9.5px; padding: 2px 7px; border-radius: 5px; background: var(--bg-hover); color: var(--text-mute); margin-top: 10px; }
.sk-foot { display: flex; align-items: center; gap: 10px; }
.sk-foot-note { font-size: 10px; color: var(--text-mute); margin-left: auto; }

/* ============================ 图片指令 ============================ */
.ip-card { width: min(980px, 94vw); max-width: none; max-height: 88vh; display: flex; flex-direction: column; }
.ip-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; overflow-y: auto; }
.ip-preview { border-radius: 12px; overflow: hidden; background: var(--bg-hover); border: 1px solid var(--border-soft); }
.ip-preview img { width: 100%; display: block; }
.ip-result { min-width: 0; }
.ip-sec { margin-bottom: 13px; }
.ip-sec h5 { margin: 0 0 4px; font-size: 10px; letter-spacing: .6px; color: var(--text-mute); font-weight: 600; }
.ip-sec p { margin: 0; font-size: 12px; line-height: 1.75; color: var(--text-dim); }
.ip-prompt {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.8; padding: 10px 12px;
  border-radius: 9px; background: var(--bg-panel); border: 1px solid var(--border-soft);
  color: var(--text-dim); white-space: pre-wrap; word-break: break-word;
}
.ip-palette { display: flex; gap: 6px; }
.ip-swatch { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border-soft); }
.ip-loading { display: flex; flex-direction: column; gap: 10px; padding: 20px 6px; }
.ip-skeleton { height: 13px; border-radius: 5px; background: var(--bg-hover); animation: pulse 1.4s ease-in-out infinite; }

@media (max-width: 880px) {
  .sk-body { flex-direction: column; }
  .sk-grid { grid-template-columns: 1fr; padding: 10px; }
  .sk-detail { width: 100%; border-left: 0; border-top: 1px solid var(--border-soft); max-height: 42%; }
  .skills-card { width: 96vw; height: 92vh; }
  .sk-search input { width: 110px; }
  .ip-body { grid-template-columns: 1fr; }
  .ip-preview { max-width: 240px; }
  .ip-card { max-height: 92vh; }
}

.composer.drop-hover {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ======================= 服务商预设与 Key 卡片 ======================= */
.provider-tag.on { background: rgba(34,197,94,.16); color: #4ade80; }
.provider-tag.warn { background: rgba(245,158,11,.16); color: #fbbf24; }
.provider-tag.soft { background: var(--bg-hover); color: var(--text-mute); }
.provider-note { margin: -4px 0 10px; font-size: 11px; line-height: 1.65; color: var(--text-mute); }

.pk-line { display: flex; align-items: flex-end; gap: 10px; }
.pk-field { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--text-mute); }
.pk-input { position: relative; display: flex; }
.pk-input input {
  width: 100%; padding: 9px 56px 9px 11px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg-input); color: var(--text);
  font-family: var(--mono); font-size: 12.5px; outline: none;
}
.pk-input input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pk-eye {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--text-mute); cursor: pointer;
  font-size: 10.5px; font-family: inherit; padding: 4px 7px; border-radius: 6px;
}
.pk-eye:hover { background: var(--bg-hover); color: var(--text); }
.key-link {
  flex: none; font-size: 11px; color: #93c8c0; text-decoration: none;
  padding: 9px 2px; white-space: nowrap;
}
.key-link:hover { color: var(--accent); text-decoration: underline; }

.pk-models {
  margin-top: 7px; font-size: 10.5px; line-height: 1.6; color: var(--text-mute);
  font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pk-models.empty { font-family: inherit; opacity: .8; }
.pk-adv { margin-top: 10px; border-top: 1px dashed var(--border-soft); padding-top: 8px; }
.pk-adv summary {
  font-size: 10.5px; color: var(--text-mute); cursor: pointer; list-style: none;
  user-select: none; padding: 2px 0;
}
.pk-adv summary::-webkit-details-marker { display: none; }
.pk-adv summary::before { content: '▸ '; }
.pk-adv[open] summary::before { content: '▾ '; }
.pk-adv summary:hover { color: var(--text-dim); }
.pk-adv .provider-grid { margin-top: 10px; }

.provider-card.just-added { animation: cardPulse 1.8s ease; }
@keyframes cardPulse {
  0% { box-shadow: 0 0 0 0 rgba(111,168,160,.55); }
  40% { box-shadow: 0 0 0 4px rgba(111,168,160,.16); }
  100% { box-shadow: 0 0 0 0 rgba(111,168,160,0); }
}

/* 预设选择弹层 */
.picker-card { width: min(880px, 94vw); max-width: none; height: 78vh; }
.picker-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 20px; border-bottom: 1px solid var(--border-soft); flex: none;
}
.picker-tabs { display: flex; gap: 5px; flex-wrap: wrap; }
.picker-body { flex: 1; overflow-y: auto; padding: 14px 18px; min-height: 0; }
.picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.picker-item {
  display: flex; flex-direction: column; gap: 5px; text-align: left;
  padding: 11px 13px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--border-soft); background: var(--bg-elev);
  font-family: inherit; color: var(--text); transition: all .15s ease;
}
.picker-item:hover { border-color: rgba(111,168,160,.55); background: var(--bg-hover); transform: translateY(-1px); }
.picker-item.added { border-style: dashed; }
.pi-head { display: flex; align-items: center; gap: 7px; }
.pi-head strong { font-size: 12.5px; font-weight: 600; }
.pi-added { margin-left: auto; font-style: normal; font-size: 9px; color: var(--ok); }
.pi-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.ptag { font-size: 9px; padding: 1px 6px; border-radius: 4px; background: var(--bg-active); color: var(--text-mute); }
.ptag.hot { background: rgba(111,168,160,.18); color: #93c8c0; }
.pi-url {
  font-family: var(--mono); font-size: 10px; color: var(--text-mute);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pi-foot { font-size: 10px; color: var(--text-mute); opacity: .85; }
.picker-empty { grid-column: 1 / -1; text-align: center; font-size: 12px; color: var(--text-mute); padding: 40px 12px; }
.picker-note { font-size: 10.5px; color: var(--text-mute); }

@media (max-width: 880px) {
  .picker-grid { grid-template-columns: 1fr; }
  .picker-card { width: 96vw; height: 88vh; }
  .picker-body { padding: 10px; }
  .pk-line { flex-direction: column; align-items: stretch; }
  .key-link { padding: 2px 0; }
}

/* ============================ 文风档案 ============================ */
.style-form { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; background: var(--bg-elev); }
.style-form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.style-list { display: flex; flex-direction: column; gap: 10px; }
.style-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg-elev); }
.style-item.active { border-color: rgba(111,168,160,.55); }
.style-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.style-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-mute); flex: none; }
.style-item.active .style-dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(111,168,160,.18); }
.style-on { font-size: 10px; color: var(--accent); border: 1px solid rgba(111,168,160,.4); padding: 1px 7px; border-radius: 999px; }
.style-spacer { flex: 1; }
.style-profile { font-size: 12px; color: var(--text-dim); line-height: 1.7; margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.style-foot { font-size: 10.5px; color: var(--text-mute); margin-top: 8px; }

/* ============================ 热点雷达 ============================ */
.hot-sources { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hot-sources .chip { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); font-size: 12px; color: var(--text-dim); background: transparent; }
.hot-sources .chip.active { border-color: rgba(111,168,160,.6); color: var(--accent); background: rgba(111,168,160,.08); }
.hot-sources .chip.ghost { border-style: dashed; }
.hot-meta { font-size: 10.5px; color: var(--text-mute); margin: 8px 2px 4px; }
.hot-meta.demo { color: #d08770; }
.hot-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--bg-elev); }
.hot-rank { flex: none; width: 24px; height: 24px; display: grid; place-items: center; font-size: 12px; font-weight: 650; color: var(--text-mute); border-radius: 8px; background: var(--bg-hover); }
.hot-rank.top { color: #e07a5f; background: rgba(224,122,95,.12); }
.hot-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.hot-title { font-size: 13px; color: var(--text); line-height: 1.5; }
.hot-sub { font-size: 10.5px; color: var(--text-mute); }
.hot-tools { flex: none; display: flex; gap: 6px; }

/* ============================ 稿内编辑器 ============================ */
.ac-editor { border: 1px solid rgba(111,168,160,.4); border-radius: 10px; padding: 10px; margin-top: 10px; background: var(--bg-elev); }
.ac-edit-area { width: 100%; min-height: 240px; resize: vertical; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 10px; font: 13px/1.8 ui-monospace, 'SF Mono', Consolas, monospace; }
.ac-edit-area:focus { outline: none; border-color: rgba(111,168,160,.55); }
.ac-edit-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ac-edit-chips .chip, .chip.sm { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); font-size: 11px; color: var(--text-dim); background: transparent; }
.ac-edit-chips .chip:hover, .chip.sm:hover { border-color: rgba(111,168,160,.5); color: var(--accent); }
.ac-edit-bar { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.ac-edit-instr { flex: 1; min-width: 180px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; color: var(--text); }
.ac-edit-instr:focus { outline: none; border-color: rgba(111,168,160,.55); }
.ac-edit-hint { font-size: 10.5px; color: var(--text-mute); margin-top: 6px; }

/* ============================ 热文榜增强 ============================ */
.hot-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; max-height: 96px; overflow-y: auto; }
.hot-cats .chip.sm { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); font-size: 11px; color: var(--text-dim); background: transparent; }
.hot-cats .chip.sm.active { border-color: rgba(111,168,160,.6); color: var(--accent); background: rgba(111,168,160,.08); }
.hot-cats[hidden] { display: none; }
.hot-item .hot-rank { min-width: 46px; padding: 0 8px; font-size: 11px; border-radius: 8px; }
.hot-item .hot-cat { font-style: normal; color: var(--accent); border: 1px solid rgba(111,168,160,.4); border-radius: 4px; padding: 0 5px; margin-right: 6px; font-size: 10px; }
.hot-sources[hidden] { display: none; }

/* ============================ 公众号草稿箱 ============================ */
.provider-actions .pane-tip { flex: 1; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ghost-btn.sm { padding: 6px 14px; font-size: 12px; }
#wxModal .field { margin-bottom: 12px; }
#wxModal input, #wxModal textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; color: var(--text); font-size: 13px; }
#wxModal input:focus, #wxModal textarea:focus { outline: none; border-color: rgba(111,168,160,.55); }
#wxStatus { min-height: 18px; }

/* ============================ GitHub 项目推文 ============================ */
.gh-title-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid rgba(111,168,160,.45); border-radius: 10px; background: var(--bg-elev); margin-bottom: 10px; }
.gh-label { flex: none; font-size: 11px; color: var(--accent); border: 1px solid rgba(111,168,160,.4); border-radius: 4px; padding: 2px 8px; margin-top: 2px; }
.gh-title { flex: 1; font-size: 15px; font-weight: 650; color: var(--text); line-height: 1.5; }
.gh-body-row { border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elev); padding: 12px; }
.gh-body-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.gh-body-head .hot-tools { margin-left: auto; }
.gh-body { max-height: 420px; overflow-y: auto; font-size: 13.5px; }
.gh-body .md-body { font-size: 13.5px; }
