/* ═══════════════════════════════════════════════════════════════
   光合引擎 · 云端版补充样式
   基础样式全部沿用 style.css（与本地工作台同源），这里只加
   云端版独有的：登录门、步骤条、两栏、流水表、码堆。
   ═══════════════════════════════════════════════════════════════ */

.hidden { display: none !important; }

/* ── 登录门 ── */
/* 基础样式里 input 的宽度规则只覆盖了 text/number/textarea/select，没含 password，
   导致密码框只有默认宽度 —— 这里补齐（只在本版补，不动本地工作台那份） */
input[type="password"] {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 11px; font: inherit; font-size: 13.5px; color: var(--text);
  background: #fff; outline: none;
}
input[type="password"]:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.gate {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 32px 18px;
}
.gate-card { width: 100%; max-width: 400px; padding: 26px 26px 22px; margin: 0; }
.brandline { display: flex; align-items: center; gap: 9px; justify-content: center; }
.brandline img { height: 26px; width: auto; display: block; }
.brandname { font-size: 13.5px; font-weight: 600; letter-spacing: .3px; }
.brandcap { text-align: center; font-size: 11.5px; color: var(--muted); margin: 6px 0 20px; }
.gate-foot { margin-top: 16px; text-align: center; max-width: 400px; }

.gate-card .seg { width: 100%; justify-content: space-between; }
.gate-card .seg button { flex: 1; padding: 6px 8px; font-size: 12.5px; }

/* 示例数据预览的顶部提示条（只在 ?demo=1 时出现） */
.demo-bar {
  background: var(--brand-soft); border: 1px solid #cfe0ff; color: #2c3f63;
  border-radius: 10px; padding: 9px 14px; font-size: 12.5px; margin-bottom: 16px;
}

.btn.wide { display: block; width: 100%; }
.btnlink {
  border: 0; background: transparent; color: var(--brand); font: inherit;
  font-size: 12.5px; padding: 0; cursor: pointer;
}
.btnlink:hover { text-decoration: underline; }
.btnlink.quiet { color: var(--muted); }
.links { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }

/* ── 步骤条（第一次使用：填邮箱 / 收邮件 / 设密码）── */
.steps { display: flex; gap: 8px; margin-bottom: 18px; }
.step { flex: 1; text-align: center; }
.step b {
  display: block; width: 22px; height: 22px; line-height: 22px; border-radius: 50%;
  background: #f1f3f6; color: var(--muted); font-size: 12px; margin: 0 auto 6px; font-weight: 600;
}
.step.on b { background: var(--brand); color: #fff; }
.step.done b { background: var(--brand-soft); color: var(--brand); }
.step em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.step.on em { color: var(--text); font-weight: 600; }

/* ── 顶栏的账号条 ── */
.acctbar { display: flex; align-items: center; gap: 10px; }

/* ── 总览的数字卡：略收窄，宽屏能一行放下 5 张（否则第五张孤零零换行）── */
.grid { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }

/* ── 两栏（账号页）── */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

/* ── 积分流水表 ── */
.ledger { width: 100%; border-collapse: collapse; font-size: 13px; }
.ledger th, .ledger td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.ledger th { color: var(--muted); font-weight: 500; font-size: 12px; }
.ledger tr:last-child td { border-bottom: 0; }
.ledger td:last-child { text-align: right; }
.minus { color: #d64545; }
.plus { color: var(--ok); }

/* ── 码堆（生成后一片可复制的码）── */
.codepile {
  max-height: 320px; overflow: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px;
}
.codepile .copyline { font-size: 12.5px; text-align: center; padding: 8px; letter-spacing: .4px; }

/* 空态／表格里的次级文字沿用 style.css，不再重复定义 */

/* ═══════════════════════════════════════════════════════════════
   以下是 2026-09-17 补的：把「提示」做成一定看得见的浮层，
   并补上本地工作台有、这份基础样式里没有的几个类。
   起因：原来的 .toast 只是"页面里的一行小字"，页面没插容器就完全不显示
   → 用户点了按钮像"没反应"。提示必须浮在最上层，任何页面都能看见。
   ═══════════════════════════════════════════════════════════════ */

/* ── 提示浮层：固定底部居中，出现即有底色与阴影 ── */
.toastbar {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(8px);
  z-index: 90; max-width: min(560px, calc(100vw - 32px)); margin: 0; padding: 0;
  pointer-events: none;
}
.toastbar .toast {
  padding: 10px 16px; border-radius: 10px; font-size: 13px; line-height: 1.5;
  background: #232a35; color: #fff; box-shadow: 0 8px 24px rgba(16, 24, 40, .22);
  opacity: 0; transition: opacity .18s ease, transform .18s ease;
}
.toastbar .toast.on { opacity: 1; transform: translateY(0); }
.toastbar .toast.ok { background: #146c43; }
.toastbar .toast.err { background: #b0322d; }

/* ── 全局错误条：任何未捕获的脚本错误都显示在这里（不许静默失败）── */
.errbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 120;
  background: #b0322d; color: #fff; font-size: 13px; line-height: 1.5;
  padding: 10px 16px; display: flex; align-items: flex-start; gap: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
/* ⚠️ 必须显式写 `[hidden]` 的隐藏：上面的 `display:flex` 会盖掉浏览器对 `hidden` 的默认 display:none，
   结果"空错误条"一直挂在页面顶端挡住内容（2026-09-17 截图自查抓到）。 */
.errbar[hidden] { display: none; }
.errbar b { font-weight: 600; }
.errbar .eb-close {
  margin-left: auto; border: 0; background: rgba(255, 255, 255, .18); color: #fff;
  font: inherit; font-size: 12.5px; padding: 3px 10px; border-radius: 7px; cursor: pointer; flex: 0 0 auto;
}
.errbar .eb-close:hover { background: rgba(255, 255, 255, .3); }

/* 有错误条时把整页往下让一点，别挡住顶栏 */
body.has-errbar .app, body.has-errbar .gate { padding-top: 44px; }

/* ── 二级筛选：整行下划线 tab（本地工作台同款，这份基础样式里没有）── */
.tabs.flat { gap: 20px; border-bottom: 1px solid var(--line); }
.tabs.flat .tab {
  border: 0; background: transparent; border-radius: 0; padding: 8px 0 10px;
  color: var(--muted); font-size: 13px;
}
.tabs.flat .tab:hover { background: transparent; color: var(--text); }
.tabs.flat .tab.active {
  color: var(--text); font-weight: 600; background: transparent; border-color: transparent;
  box-shadow: inset 0 -2px 0 var(--brand);
}
.tabs.flat .tab.dim { opacity: .45; }

/* 新生成 / 刚变更的那一行：短暂高亮 */
tbody tr.fresh { background: #f6f9ff; }
tbody tr.fresh td:first-child { box-shadow: inset 3px 0 0 var(--brand); }

/* 复盘的分项数字框：一排等宽小框，都不必填 */
.metrics { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 4px; }
.metric { display: flex; flex-direction: column; gap: 4px; flex: 1 1 96px; max-width: 152px; min-width: 88px; }
.metric em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.metric input { width: 100%; }

/* 内容详情里"只读段落"的阅读感：正文要有呼吸 */
.pre { white-space: pre-wrap; }

/* 侧栏导航分组标题（把"创作"与"账号/后台"分开） */
.nav-split { height: 1px; background: var(--line); margin: 10px 12px; }

/* ── 人设问答的对话气泡（建人设卡走问答，不让客户对着空字段发呆）──
   ⚠️ 字号别调小：这是客户要**读进去**的内容（AI 的提问、给的人设草稿），
   2026-09-18 阿和反馈 13.5px "太小、不显眼"，改成 15px 且行距放宽。 */
.chat { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.bubble {
  max-width: 82%; padding: 12px 16px; border-radius: 12px;
  font-size: 15px; line-height: 1.8; word-break: break-word;
}
.bubble.assistant { align-self: flex-start; background: #f4f6f9; border: 1px solid var(--line); color: var(--text); }
.bubble.user { align-self: flex-end; background: var(--brand); color: #fff; }
.bubble code { background: rgba(0, 0, 0, .07); padding: 1px 5px; border-radius: 5px; font-size: 13.5px; }
.bubble.user code { background: rgba(255, 255, 255, .22); }
/* 正在思考/正在输出：一直有个转圈 + 实时字数，客户知道"它在干活"，不是死机 */
.bubble.think {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); background: #f8fafc;
}
/* 出错：留在对话里（不是一闪而过的提示），带「重试」 */
.bubble.err { background: #fdf3f3; border-color: #f0c9c9; color: #a33232; align-self: flex-start; }
.bubble.err .anchor { color: #a33232; text-decoration: underline; }
/* 还没开始时的引导话术：比 .hint 大一档，别让人看不清 */
.chat-empty { padding: 2px 2px 0; }
.lead { font-size: 14px; color: #6b7480; line-height: 1.9; }

/* 输入行：输入框吃掉剩余宽度，按钮**永远不换行**（窄窗口也不许把按钮挤到下一行） */
.chatrow { display: flex; gap: 10px; align-items: center; }
.chatrow > input { flex: 1 1 auto; min-width: 0; }
.chatrow > .btn { flex: 0 0 auto; white-space: nowrap; }

.draftcard { background: #fbfcfe; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-top: 14px; }

/* 窄屏：两栏与工具条都堆叠，手机上也别挤成一团 */
@media (max-width: 860px) {
  .toolbar { flex-wrap: wrap; gap: 10px; }
  .toolbar .seg.seg-view { flex: 1 1 auto; }
  .toolbar .tabs.flat { flex: 1 1 100%; overflow-x: auto; }
  .metrics { gap: 8px 10px; }
  .metric { min-width: 82px; }
  .bubble { max-width: 92%; }
  .chatrow { flex-wrap: wrap; }
  .chatrow > input { flex: 1 1 100%; }
  .chatrow > .btn { flex: 1 1 100%; }
}
