/* 逍遥智能体工作台 · 共享界面样式（D14）
   口径来源：对标「殊师工作台 · 手机验证码登录」，先模仿其移动优先的版式与交互，再超越。
   模仿了什么：纯白底 / 紫色主色 / 全宽大按钮（≥48px 高，好点）/ 输入框 16px（iOS 不缩放）/
   圆角卡片 + 浅描边 / 绿·红提示条 / 底部深色引导卡 / 大字号 + 松间距。
   超越了哪里：把「三态卡、过程时间线、成本看板、确认卡、文件区」这些它没有的东西做成同一套视觉语言。
   用法：页面在 </style> 之后引这一份即可（后加载覆盖旧的内联样式）。 */

:root {
  --brand: #4b3a63;        /* 主色：沉稳紫 */
  --brand-dark: #3a2c4e;
  --brand-soft: #f4f1f8;
  --bg: #ffffff;
  --panel: #ffffff;
  --soft: #f7f7f9;
  --line: #e5e5ea;
  --ink: #1f1b24;
  --muted: #7b7482;
  --ok: #2e7d32;
  --ok-bg: #e9f7ea;
  --warn: #b3261e;
  --warn-bg: #fdecea;
  --r: 12px;
  --r-btn: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

/* ── 布局 ───────────────────────────────────────────── */
.wrap { max-width: 760px; margin: 0 auto; padding: 16px 16px 40px; }

header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
header h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .02em; }

h1 { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
h2 { font-size: 15px; font-weight: 600; color: var(--muted); margin: 0 0 10px; letter-spacing: .04em; }

/* ── 卡片 ───────────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  margin-bottom: 14px;
}
.card > h2:first-child { margin-top: 0; }

/* 底部引导卡（模仿殊师「首次使用？请联系推荐官」） */
.promo {
  background: var(--brand-dark); color: #fff;
  border: 0; border-radius: var(--r); padding: 20px; margin-bottom: 14px;
}
.promo h2 { color: #fff; font-size: 19px; font-weight: 700; margin: 0 0 8px; letter-spacing: 0; }
.promo p { margin: 0; color: #e7e2ee; font-size: 15px; }

/* ── 文字 ───────────────────────────────────────────── */
.sub { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.muted { color: var(--muted); font-size: 14px; }
.big { font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1.35; margin: 2px 0 4px; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.hidden { display: none !important; }
.spacer { flex: 1; }
a.link { color: var(--brand); text-decoration: none; font-weight: 600; }

/* ── 表单 ───────────────────────────────────────────── */
label { display: block; font-size: 15px; font-weight: 600; margin: 14px 0 6px; }
input, select, textarea {
  width: 100%; min-height: 48px;
  border: 1px solid var(--line); border-radius: var(--r-btn);
  padding: 11px 14px; font: inherit; font-size: 16px;
  background: #fff; color: var(--ink);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
input::placeholder, textarea::placeholder { color: #b6b0bc; }
input[type="checkbox"] { width: auto; min-height: 0; }

/* ── 按钮（功能键）：默认全宽大按钮，移动端好点 ───────── */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 20px;
  border-radius: var(--r-btn); border: 1px solid var(--brand);
  background: var(--brand); color: #fff;
  font: inherit; font-size: 16px; font-weight: 600;
  cursor: pointer; text-decoration: none; width: 100%;
}
button.ghost, .btn-ghost { background: #fff; color: var(--brand); }
button.danger, .btn-danger { background: #fff; color: var(--warn); border-color: #e7c4c0; }
button:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; }
button:active { transform: translateY(1px); }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > button, .row > .btn { flex: 1 1 100%; }

/* ── 提示条（模仿「验证码已发送，请查收短信。」）──────── */
.hint-ok, .hint-warn, .note {
  display: block; border-radius: var(--r-btn);
  padding: 13px 15px; font-size: 15px; margin: 12px 0; border: 0;
}
.hint-ok { background: var(--ok-bg); color: var(--ok); }
.hint-warn { background: var(--warn-bg); color: var(--warn); }
.note { background: var(--soft); color: var(--muted); }
.note b { color: var(--ink); }

/* ── 顶部小标签 ─────────────────────────────────────── */
.chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px;
  font-size: 13px; color: var(--muted); background: #fff; text-decoration: none;
}
.chip b { color: var(--brand); font-weight: 700; }
.badge {
  display: inline-block; border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 9px; font-size: 12px; color: var(--muted); background: #fff;
}
.badge.deliver { color: var(--brand); border-color: #d8cfe6; background: var(--brand-soft); }

/* ── 三态卡 / 数据卡 ────────────────────────────────── */
.states { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.states > div { background: var(--soft); border: 1px solid var(--line); border-radius: var(--r-btn); padding: 14px 8px; }
.states b { display: block; font-size: 17px; color: var(--brand); font-weight: 700; }
.states span { font-size: 12px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stats > div { background: var(--soft); border: 1px solid var(--line); border-radius: var(--r-btn); padding: 12px; }
.stats .big { font-size: 22px; color: var(--brand); margin: 0; }

/* ── 任务清单 / 进度 ───────────────────────────────── */
.steps { display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--muted); }
.step .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 auto; margin-top: 3px; }
.step.done { color: var(--ink); }
.step.done .dot { background: var(--brand); border-color: var(--brand); }
.bar { height: 8px; background: #efece9; border-radius: 999px; overflow: hidden; margin: 12px 0 8px; }
.bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .3s; }

/* ── 表格 ───────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }

/* ── 时间线 / 日志块 ───────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow: auto; }
.tl-item { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; font-size: 14px; }
.tl-item .tl-head { color: var(--muted); font-size: 12.5px; margin-bottom: 2px; }
.tl-item.assistant { border-left-color: var(--brand); }
.tl-item.error { border-left-color: var(--warn); }
pre {
  background: var(--soft); border: 1px solid var(--line); border-radius: var(--r-btn);
  padding: 12px; white-space: pre-wrap; word-break: break-word; font: 13.5px/1.6 inherit; margin: 10px 0 0;
}
.grid2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
.statusline { margin-top: 10px; font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
details { margin-top: 8px; }
summary { cursor: pointer; color: var(--brand); font-size: 15px; font-weight: 600; }
.sec { font-size: 14px; margin-top: 6px; }
.sec b { display: inline-block; min-width: 76px; color: var(--muted); font-weight: 600; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.chart > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.chart i { display: block; width: 100%; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.chart span { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── 桌面端：一屏更宽、按钮不必全宽 ─────────────────── */
@media (min-width: 720px) {
  .wrap { padding: 24px 24px 60px; }
  .row > button, .row > .btn { flex: 0 1 auto; width: auto; min-width: 132px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .grid2 { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   D14 第二版：照殊师「概览 / 购买 / 账户设置」三屏补齐的组件
   —— 顶部栏 / 底部 Tab / Hero / 深色卡 / 胶囊 / 状态卡 / 空态 / 错误态
   ═══════════════════════════════════════════════════════════════ */

/* 顶部栏：汉堡（左）+ 页面名（中）+ 使用教程（右） */
.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line);
}
.appbar .menu, header .menu {
  width: 42px; height: 42px; min-height: 0; padding: 0;
  flex: 0 0 auto;
  border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
}
.appbar .title { flex: 1; text-align: center; font-size: 17px; font-weight: 700; }
.appbar .action { color: var(--brand); font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; }

/* 底部 Tab 栏（吸底，四项，当前项淡紫高亮） */
.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: 10px; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 6px; box-shadow: 0 6px 24px rgba(40, 30, 60, .10);
  max-width: 736px; margin: 0 auto;
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; border-radius: 14px; text-decoration: none;
  color: var(--muted); font-size: 12px; min-height: 0;
}
.tabbar a .ico { font-size: 19px; line-height: 1; }
.tabbar a.on { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
body.has-tabbar { padding-bottom: 96px; }

/* Hero 区：浅紫底带 + 小标签 + 超大标题 + 副标题 */
.hero { background: linear-gradient(180deg, #faf8fc 0%, #fff 100%); padding: 18px 0 6px; margin-bottom: 6px; }
.hero-tag { color: #8b3a4a; font-size: 14px; font-weight: 700; letter-spacing: .06em; margin-bottom: 6px; }
.hero-title { font-size: 34px; line-height: 1.2; font-weight: 800; margin: 0 0 10px; letter-spacing: -.01em; }
.hero-sub { font-size: 16px; line-height: 1.6; color: #6f6878; margin: 0; }

/* 深色大卡片（殊师 hero 卡） */
.hero-dark {
  background: #2f2a3d; color: #fff; border-radius: 18px;
  padding: 26px 20px; text-align: center; margin-bottom: 18px;
}
.hero-dark .logo {
  width: 150px; height: 150px; margin: 0 auto 16px; border-radius: 26px;
  border: 1px solid rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center;
  font-size: 52px;
}
.hero-dark .h-title { font-size: 22px; font-weight: 700; color: #fff; margin: 12px 0 6px; }
.hero-dark .h-sub { font-size: 15px; color: #cfc9dc; margin: 0; }

/* 胶囊标签 */
.pill {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; background: var(--brand-soft); color: var(--brand);
}
.pill.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #cfe8d1; }
.pill.gray { background: #f0eff3; color: #6f6878; border: 1px solid var(--line); }
.hero-dark .pill.ok { background: var(--ok-bg); color: var(--ok); }

/* 独立状态卡：标题 + 胶囊 + 说明（比三小格清楚） */
.statecard { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 16px; }
.statecard h3 { margin: 0 0 14px; font-size: 21px; font-weight: 700; color: var(--ink); letter-spacing: 0; }
.statecard p { margin: 10px 0 0; font-size: 15px; color: #6f6878; }

/* 未开放 / 空态：居中胶囊 + 居中标题 + 居中说明 */
.emptybox { text-align: center; padding: 30px 20px; }
.emptybox h3 { font-size: 20px; font-weight: 700; margin: 14px 0 8px; }
.emptybox p { color: #6f6878; font-size: 15px; margin: 0; }

/* 错误态卡片：红圆角图标 + 标题 + 说明 + 重试按钮 */
.errbox { text-align: left; }
.errbox .e-ico {
  width: 54px; height: 54px; border-radius: 16px; background: var(--warn-bg); color: var(--warn);
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; margin-bottom: 14px;
}
.errbox h3 { font-size: 20px; font-weight: 700; margin: 0 0 8px; }
.errbox p { color: #6f6878; font-size: 15px; margin: 0 0 16px; }
.errbox button { width: auto; min-width: 132px; }

/* 主按钮（紫色实心）与按钮尺寸统一到对标的观感 */
.btn-primary { background: var(--brand); color: #fff; }
.btn-lg { min-height: 52px; font-size: 17px; }

/* ═══════════════════════════════════════════════════════════════
   D14 第三版：照殊师「侧边栏 / 工作台」两屏补齐
   —— 抽屉菜单 / 用户卡 / toast / 虚线输入框 / 圆形发送 / 左侧图标条
   ═══════════════════════════════════════════════════════════════ */

/* 侧边栏抽屉（汉堡点开） */
.scrim { position: fixed; inset: 0; background: rgba(20,15,30,.42); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; width: 78%; max-width: 340px; z-index: 50;
  background: #fff; border-right: 1px solid var(--line);
  transform: translateX(-102%); transition: transform .22s ease; overflow-y: auto;
  display: flex; flex-direction: column;
}
.drawer.on { transform: none; }
.drawer .dhead { padding: 18px 18px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.drawer .dhead .logo { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); display: flex; align-items: center; justify-content: center; font-size: 21px; }
.drawer .dhead b { display: block; font-size: 16px; }
.drawer .dhead .en { font-size: 10.5px; letter-spacing: .16em; color: var(--muted); }
.drawer .group { padding: 10px 0 4px; }
.drawer .group > .gt { font-size: 13px; color: var(--muted); padding: 8px 18px 4px; }
.drawer a.item {
  display: flex; align-items: center; gap: 12px; padding: 15px 18px;
  color: var(--ink); text-decoration: none; font-size: 16.5px; min-height: 0;
}
.drawer a.item .ico { width: 22px; text-align: center; color: #6f6878; }
.drawer a.item.on { background: var(--brand-soft); color: var(--brand); font-weight: 700; border-left: 4px solid var(--brand); padding-left: 14px; }
.drawer .dfoot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 0 18px; }
.drawer .me { display: flex; align-items: center; gap: 12px; padding: 12px 18px; }
.drawer .me .av { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; }
.drawer .me b { display: block; font-size: 16px; }
.drawer .me span { font-size: 13px; color: var(--muted); }

/* 顶部黑色 toast（照对标：正在连接工作台… / 连接暂不可用…） */
.toast {
  position: fixed; top: 64px; right: 14px; z-index: 60; max-width: 76%;
  background: #1c1a22; color: #fff; border-radius: 14px; padding: 12px 16px;
  font-size: 14.5px; line-height: 1.5; box-shadow: 0 8px 24px rgba(0,0,0,.22);
  opacity: 0; transform: translateY(-6px); transition: all .2s;
}
.toast.on { opacity: 1; transform: none; }

/* 左侧图标竖条（工作台页，照对标把导航收成图标列） */
.rail {
  position: fixed; left: 0; top: 0; bottom: 0; width: 58px; z-index: 25;
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0;
}
.rail button, .rail a {
  width: 42px; height: 42px; min-height: 0; padding: 0; border: 0; background: transparent;
  color: #6f6878; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.rail button:hover, .rail a:hover { background: var(--brand-soft); color: var(--brand); }
.rail .brand { font-size: 22px; margin-bottom: 8px; }
.rail .bottom { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
body.has-rail { padding-left: 58px; }

/* 虚线大输入框 + 圆形发送（照对标工作台首页） */
.composer-dash { border: 1.5px dashed #d9d4e2; border-radius: 18px; padding: 16px 16px 12px; background: #fff; }
.composer-dash textarea { border: 0; padding: 0; min-height: 56px; font-size: 17px; }
.composer-dash .cfoot { display: flex; align-items: flex-end; gap: 10px; margin-top: 6px; }
.composer-dash .cfoot .plus {
  width: 44px; height: 44px; min-height: 0; border-radius: 50%; border: 0; background: var(--soft); color: #6f6878; font-size: 20px;
}
.send-fab {
  margin-left: auto; width: 46px; height: 46px; min-height: 0; padding: 0; border-radius: 50%;
  background: var(--brand); color: #fff; border: 0; font-size: 19px; display: flex; align-items: center; justify-content: center;
}
.send-fab:disabled { background: #c9c3d4; }
.ws-title { text-align: center; padding: 26px 16px 10px; }
.ws-title .logo { font-size: 34px; }
.ws-title b { display: block; font-size: 24px; font-weight: 800; margin-top: 8px; }
.ws-title .en { font-size: 11px; letter-spacing: .18em; color: var(--muted); }

/* ═══════════════════════════════════════════════════════════════
   D15 桌面工作台外壳（对标殊师「电脑端」= Codex 风格三栏）
   左侧会话/工作区树 · 中间对话 · 底部状态栏 · 白底细线小字零装饰
   ═══════════════════════════════════════════════════════════════ */
.app { display: flex; flex-direction: column; height: 100vh; background: #fff; color: #1a1a1a; }
.app-body { flex: 1; display: flex; min-height: 0; }
.side { width: 272px; flex: 0 0 272px; background: #fafafa; border-right: 1px solid #ececec; display: flex; flex-direction: column; min-height: 0; }
.side .brand { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid #f0f0f0; }
.side .brand .lg { width: 26px; height: 26px; border-radius: 7px; background: #f2eef8; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.side .brand b { font-size: 13px; }
.side .brand .en { font-size: 9px; letter-spacing: .14em; color: #9a9a9a; display: block; }
.side .newbtn { margin: 10px 12px 6px; min-height: 34px; font-size: 13px; border-radius: 9px; background: #fff; color: #1a1a1a; border: 1px solid #e4e4e4; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; width: auto; }
.side .newbtn:hover { background: #f4f4f5; }
.side .sect { display: flex; align-items: center; gap: 6px; padding: 10px 14px 4px; font-size: 11px; color: #8a8a8a; }
.side .tree { flex: 1; overflow: auto; padding: 0 8px 8px; }
.side .tree .grp { display: flex; align-items: center; gap: 6px; padding: 7px 8px; font-size: 12.5px; color: #444; border-radius: 7px; }
.side a.item { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 22px; font-size: 12.5px; color: #333; border-radius: 7px; text-decoration: none; cursor: pointer; }
.side a.item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side a.item .age { font-size: 11px; color: #a0a0a0; }
.side a.item:hover { background: #f1f1f2; }
.side a.item.on { background: #ececee; font-weight: 600; }
.side .sidefoot { border-top: 1px solid #f0f0f0; padding: 8px 10px 12px; }
.side .sidefoot a { display: flex; align-items: center; gap: 8px; padding: 7px 6px; font-size: 12.5px; color: #333; text-decoration: none; border-radius: 7px; }
.side .sidefoot a:hover { background: #f1f1f2; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.mainhead { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid #f0f0f0; }
.mainhead .ttl { font-size: 13.5px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mainhead .ghostbtn { width: auto; min-height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; background: #fff; color: #333; border: 1px solid #e4e4e4; }
.tabs { display: flex; gap: 16px; padding: 0 18px; border-bottom: 1px solid #f0f0f0; }
.tabs a { padding: 9px 0; font-size: 12.5px; color: #7a7a7a; text-decoration: none; border-bottom: 2px solid transparent; cursor: pointer; }
.tabs a.on { color: #1a1a1a; font-weight: 600; border-bottom-color: #4b3a63; }
.stream { flex: 1; overflow: auto; padding: 18px 22px 8px; }
.msg { max-width: 760px; margin: 0 auto 16px; font-size: 13.5px; line-height: 1.75; }
.msg.user { margin-left: auto; margin-right: 22px; background: #f4f2f8; border-radius: 12px; padding: 10px 14px; max-width: 620px; }
.msg.assistant { color: #22201f; }
.tool { max-width: 760px; margin: 0 auto 8px; font-size: 12px; color: #8a8a8a; display: flex; gap: 8px; align-items: baseline; }
.tool .tname { color: #555; }
.msg.error { color: #b3261e; max-width: 760px; margin: 0 auto 12px; font-size: 12.5px; }
.actions { display: flex; gap: 10px; max-width: 760px; margin: 2px auto 14px; color: #9a9a9a; font-size: 13px; }
.actions span { cursor: pointer; }
.actions span:hover { color: #4b3a63; }
.taskbar { border-top: 1px solid #f0f0f0; padding: 8px 18px; font-size: 12px; color: #666; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.taskbar .spacer { flex: 1; }
.taskpanel { border-top: 1px solid #f5f5f5; background: #fcfcfc; padding: 10px 18px 14px; font-size: 12.5px; color: #444; max-height: 30vh; overflow: auto; }
.taskpanel.hide { display: none; }
.composer-wrap { padding: 10px 18px 12px; }
.composer-dash { border: 1px solid #e6e6e6; border-radius: 14px; padding: 12px 14px 8px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.composer-dash textarea { border: 0; padding: 0; min-height: 44px; font-size: 14px; }
.composer-dash .cfoot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.composer-dash .pillbtn { width: auto; min-height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; background: #fff; color: #444; border: 1px solid #e6e6e6; gap: 5px; }
.composer-dash .plus { width: 30px; height: 30px; min-height: 0; border-radius: 8px; border: 1px solid #e6e6e6; background: #fff; color: #666; font-size: 15px; }
.send-fab { width: 34px; height: 34px; min-height: 0; border-radius: 50%; background: #4b3a63; color: #fff; border: 0; font-size: 15px; margin-left: auto; }
.send-fab:disabled { background: #d5d0dd; }
.statusbar { border-top: 1px solid #f0f0f0; padding: 6px 18px; font-size: 11px; color: #8f8f8f; display: flex; gap: 14px; flex-wrap: wrap; }
.statusbar b { color: #555; font-weight: 600; }
@media (max-width: 900px) {
  .side { display: none; }
  .msg { max-width: none; }
  .mainhead { padding: 10px 12px; }
  .stream { padding: 12px 14px 4px; }
  .statusbar { gap: 8px; font-size: 10.5px; }
}/* 左下角「模型行」（对标 Codex 底部的模型名 + 设置） */
.side .modrow { display: flex; align-items: center; gap: 8px; padding: 8px 6px; font-size: 12.5px; color: #333; }
.side .modrow .dot { width: 8px; height: 8px; border-radius: 50%; background: #34a853; flex: 0 0 auto; }
.side .modrow a { color: #6a6a6a; text-decoration: none; font-size: 14px; padding: 2px 4px; }/* 桌面端不显示手机用的底部 Tab（≥900px）；窄屏才出现 */
@media (min-width: 901px) { body.has-tabbar { padding-bottom: 0; } .tabbar { display: none !important; } }
/* 停止生成等小按钮别被全宽规则撑开 */
.taskbar button { width: auto; min-height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.taskbar button.ghostbtn { background: #fff; color: #333; border: 1px solid #e4e4e4; }/* D16：侧栏照 Codex——品牌行可折叠样式 + 纯行式功能键（新聊天）+ 分组标题 */
.side .brand { cursor: pointer; }
.side .brand .caret { margin-left: auto; color: #9a9a9a; font-size: 12px; }
.side .rowbtn { display: flex; align-items: center; gap: 8px; margin: 8px 8px 4px; padding: 8px 10px; font-size: 13px; color: #222; border-radius: 8px; cursor: pointer; }
.side .rowbtn:hover { background: #f1f1f2; }
.side .sect { padding: 12px 14px 4px; }
.side .tree .item.muted { padding-left: 10px; font-size: 12.5px; color: #9a9a9a; }
.side .tree .item .age { color: #c2c2c2; font-size: 11px; }
/* ═══════════════════════════════════════════════════════════════
   D17 照殊师/Codex 截图补回「工作区」结构
   —— 侧栏工作区分组 + 主区工作区选择器 + 斜杠命令面板
   ═══════════════════════════════════════════════════════════════ */
.side .sect .sicons { margin-left: auto; display: flex; gap: 6px; opacity: .55; font-size: 13px; }
.side .sect .sicons span { cursor: pointer; }
.side .wsrow { display: flex; align-items: center; gap: 8px; padding: 7px 8px; font-size: 12.5px; color: #222; border-radius: 7px; cursor: pointer; }
.side .wsrow:hover { background: #f1f1f2; }
.side .wsrow .fi { opacity: .75; }
.side .wsrow .cnt { margin-left: auto; font-size: 11px; color: #a8a8a8; }
.side .wsrow.on { background: #ececee; font-weight: 600; }
.side .sub a.item { padding-left: 34px; }
.side .addws { display: flex; align-items: center; gap: 8px; padding: 8px; margin: 2px 8px 0; font-size: 12.5px; color: #4b3a63; border-radius: 7px; cursor: pointer; }
.side .addws:hover { background: #f4f1f8; }
.wssel { position: relative; }
.wssel .cur { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #333; border: 1px solid #e6e6e6; border-radius: 8px; padding: 5px 10px; cursor: pointer; background: #fff; }
.wssel .menu { position: absolute; left: 0; top: 34px; z-index: 40; min-width: 260px; background: #fff; border: 1px solid #e6e6e6; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.10); padding: 8px; display: none; }
.wssel .menu.on { display: block; }
.wssel .menu a { display: flex; align-items: center; gap: 8px; padding: 9px 10px; font-size: 13px; color: #222; text-decoration: none; border-radius: 8px; }
.wssel .menu a:hover { background: #f4f4f5; }
.wssel .menu a .tick { margin-left: auto; color: #4b3a63; }
.wssel .menu .sep { height: 1px; background: #f0f0f0; margin: 6px 4px; }
.cmdpanel { max-width: 760px; margin: 0 auto 8px; background: #fff; border: 1px solid #e6e6e6; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.08); overflow: hidden; display: none; }
.cmdpanel.on { display: block; }
.cmdpanel .hd { padding: 8px 12px; font-size: 11.5px; color: #9a9a9a; border-bottom: 1px solid #f2f2f2; }
.cmdpanel a { display: flex; align-items: baseline; gap: 10px; padding: 10px 12px; text-decoration: none; color: #222; font-size: 13px; }
.cmdpanel a:hover, .cmdpanel a.on { background: #f6f4f9; }
.cmdpanel a b { min-width: 76px; font-weight: 600; }
.cmdpanel a span { color: #8a8a8a; font-size: 12.5px; }

/* ═══════════════════════════════════════════════════════════════
   D20 照截图 2 / 截图 4：「选择工作区目录」（客户自建，文件夹落在云端）
   + 「工作区文件」弹窗（上传 / 刷新列表 / 下载）
   口径：工作区＝Codex 的「项目」。云端没有本地磁盘，所以「主目录」= 账号的云端根目录；
   客户自己建、自己删，不再把这件事推回给开通人（修订 D17 的「由开通人开通」）。
   ═══════════════════════════════════════════════════════════════ */
/* 侧栏会话行：标题 + 相对时间（照截图 1 的「1天」小字） */
.side .tree .sub a.item { display: flex; align-items: center; gap: 8px; }
.side .tree .sub a.item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .tree .sub a.item .tm { color: #a9a3b0; font-size: 11px; }

/* 弹窗外壳 */
.wsmask { position: fixed; inset: 0; background: rgba(0, 0, 0, .34); display: none; align-items: center; justify-content: center; z-index: 90; padding: 16px; }
.wsmask.on { display: flex; }
.wsdlg { width: min(560px, 94vw); max-height: 84vh; display: flex; flex-direction: column; background: var(--panel); border-radius: 16px; box-shadow: 0 24px 64px rgba(0, 0, 0, .22); overflow: hidden; }
.wsdlg .hd { display: flex; align-items: center; padding: 18px 20px 10px; font-size: 15px; font-weight: 600; color: var(--ink); }
.wsdlg .hd .xbtn { width: auto; min-height: 0; margin-left: auto; border: none; background: none; font-size: 15px; color: var(--muted); cursor: pointer; padding: 4px 6px; }
.wsdlg .sub2 { padding: 0 20px 12px; font-size: 12.5px; color: var(--muted); }
.wsdlg .path { display: flex; align-items: center; padding: 6px 20px 12px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--soft); }
.wsdlg .path .pen { margin-left: auto; color: #c0c0c0; }
.wsdlg .list { flex: 1; overflow: auto; padding: 8px 10px; }
.wsdlg .list .it { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: var(--r-btn); text-decoration: none; color: var(--ink); font-size: 14px; cursor: pointer; }
.wsdlg .list .it:hover { background: var(--brand-soft); }
.wsdlg .list .it.on { background: var(--brand-soft); }
.wsdlg .list .it .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wsdlg .list .it .tick { color: var(--brand); font-weight: 700; }
.wsdlg .list .it .chev { color: #c8c8c8; }
.wsdlg .newrow { display: none; padding: 4px 20px 10px; }
.wsdlg .newrow.on { display: block; }
.wsdlg .newrow input { width: 100%; border: 1px solid var(--line); border-radius: var(--r-btn); padding: 12px; font-size: 15px; }
.wsdlg .newrow input:focus { outline: none; border-color: var(--brand); }
.wsdlg .tip { padding: 0 20px 6px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.wsdlg .err { padding: 0 20px 2px; font-size: 12.5px; color: var(--warn); min-height: 15px; }
.wsdlg .ft { display: flex; align-items: center; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid var(--soft); }
.wsdlg .ft .newfolder { font-size: 13px; color: #5a5a5a; text-decoration: none; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-btn); cursor: pointer; white-space: nowrap; }
.wsdlg .ft .newfolder:hover { background: var(--soft); }
.wsdlg .ft .spacer { flex: 1; }
.wsdlg .ft .btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: var(--r-btn); padding: 10px 18px; font-size: 13.5px; cursor: pointer; }
.wsdlg .ft .btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 工作区文件弹窗（截图 4） */
.wsdlg .fbtns { display: flex; gap: 10px; padding: 0 20px 12px; }
.wsdlg .fbtns .btn { flex: 1; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: var(--r-btn); padding: 11px 14px; font-size: 14px; cursor: pointer; }
.wsdlg .fbtns .btn.dark { background: var(--brand); border-color: var(--brand); color: #fff; }
.wsdlg .flist { flex: 1; overflow: auto; padding: 2px 12px; min-height: 120px; }
.wsdlg .flist .fitem { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--soft); }
.wsdlg .flist .fitem .fi2 { flex: 1; min-width: 0; }
.wsdlg .flist .fitem .fi2 b { display: block; font-size: 13.5px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wsdlg .flist .fitem .fi2 span { font-size: 11.5px; color: var(--muted); }
/* 注意：共享样式里 button 默认 width:100%（移动端全宽大按钮），行内的按钮必须显式收回宽度 */
.wsdlg .flist .fitem .btn { width: auto; min-height: 34px; border: 1px solid var(--line); background: var(--panel); color: var(--brand); border-radius: var(--r-btn); padding: 8px 16px; font-size: 13px; cursor: pointer; }
.wsdlg .ft .btn { width: auto; }
.wsdlg .ft .newfolder { width: auto; }
