/* HZ-AI-STUDIO（中文版赫境）—— 「AI 智能体」游乐场样式：对话 / 写文章 / 生图 + 会话
   纯中文站点专用；**不含余额条 / 充值入口 / 扣费提示**，也不含任何套餐 / 席位 / 订阅 / 多租户元素。
   颜色全部走工作台既有 CSS 变量（--card / --border / --heading-text / --text / --text-dim / --accent …），
   浅色主题由 html.light 自动适配（深色为默认）。作用域：只影响 #hz-studio-root 内部。 */

#hz-studio-root { color: var(--heading-text); font-size: 13px; }
#hz-studio-root * { box-sizing: border-box; }

/* ---------- 面板（内嵌进 #tab-ai-agent） ---------- */
#hz-studio-root .hzs-panel {
  position: static; width: 100%; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  background: var(--card); color: var(--text); font-size: 13.5px; line-height: 1.55;
}
#hz-studio-root .hzs-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(126,200,255,.16), rgba(167,139,250,.12));
  border-bottom: 1px solid var(--border);
}
#hz-studio-root .hzs-title { font-weight: 700; font-size: 14.5px; color: var(--heading-text); }
#hz-studio-root .hzs-hbtn {
  border: 1px solid var(--border); background: transparent; color: var(--text);
  border-radius: 8px; padding: 3px 10px; font-size: 12px; cursor: pointer;
  font-family: inherit; white-space: nowrap; margin-left: auto;
}
#hz-studio-root .hzs-hbtn:hover { background: rgba(127,127,127,.14); }

/* ---------- 页签 ---------- */
#hz-studio-root .hzs-tabs { display: flex; gap: 6px; padding: 10px 14px 0; flex-wrap: wrap; }
#hz-studio-root .hzs-tab {
  flex: 0 1 auto; min-width: 88px; padding: 7px 16px; border-radius: 9px;
  border: 1px solid var(--border); background: transparent; color: var(--text-dim);
  font-size: 13px; cursor: pointer; font-family: inherit; font-weight: 600;
}
#hz-studio-root .hzs-tab:hover { color: var(--heading-text); }
#hz-studio-root .hzs-tab.active {
  background: rgba(126,200,255,.2); border-color: rgba(126,200,255,.6); color: var(--heading-text);
}

/* ---------- 主体 ---------- */
#hz-studio-root .hzs-body { padding: 12px 14px 16px; min-height: 320px; }
#hz-studio-root .hzs-view { display: flex; flex-direction: column; gap: 12px; }
#hz-studio-root .hzs-view[hidden] { display: none; }
#hz-studio-root .hzs-msgs {
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px;
  max-height: 46vh; overflow: auto;
}
#hz-studio-root .hzs-msg { display: flex; flex-direction: column; align-items: flex-start; }
#hz-studio-root .hzs-msg.user { align-items: flex-end; }
#hz-studio-root .hzs-bubble {
  max-width: 88%; padding: 9px 12px; border-radius: 12px; white-space: pre-wrap;
  word-break: break-word; background: rgba(127,127,127,.13); border: 1px solid var(--border);
}
#hz-studio-root .hzs-bubble > .hzs-rich { white-space: normal; }
#hz-studio-root .hzs-msg.user .hzs-bubble { background: rgba(126,200,255,.18); border-color: rgba(126,200,255,.42); }
#hz-studio-root .hzs-msg.sys .hzs-bubble {
  background: transparent; border-style: dashed; color: var(--text-dim); font-size: 12.5px;
}
#hz-studio-root .hzs-meta {
  margin-top: 5px; font-size: 11.5px; color: var(--text-dim); display: flex; gap: 10px; flex-wrap: wrap;
}
#hz-studio-root .hzs-err { color: var(--red); }

/* Markdown 轻量渲染 */
#hz-studio-root .hzs-p { margin: 0 0 6px; }
#hz-studio-root .hzs-h { margin: 8px 0 6px; color: var(--heading-text); font-weight: 700; }
#hz-studio-root h3.hzs-h { font-size: 15px; }
#hz-studio-root h4.hzs-h { font-size: 14px; }
#hz-studio-root h5.hzs-h { font-size: 13.5px; }
#hz-studio-root .hzs-ul { margin: 0 0 6px; padding-left: 20px; }
#hz-studio-root .hzs-gap { height: 4px; }
#hz-studio-root .hzs-code {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 12px; overflow: auto; white-space: pre;
}

/* ---------- 表单控件 ---------- */
#hz-studio-root .hzs-tools { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
#hz-studio-root .hzs-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 160px; min-width: 130px; }
#hz-studio-root .hzs-field > span { font-size: 11.5px; color: var(--text-dim); }
#hz-studio-root .hzs-input,
#hz-studio-root .hzs-select,
#hz-studio-root .hzs-area {
  width: 100%; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--field-bg); color: var(--field-text); font-family: inherit; font-size: 13px;
}
#hz-studio-root .hzs-area { min-height: 76px; resize: vertical; line-height: 1.5; }
#hz-studio-root .hzs-input:focus,
#hz-studio-root .hzs-select:focus,
#hz-studio-root .hzs-area:focus { outline: none; border-color: var(--accent); }
#hz-studio-root .hzs-btn {
  padding: 8px 18px; border-radius: 9px; border: 1px solid rgba(126,200,255,.6);
  cursor: pointer; background: rgba(126,200,255,.2); color: var(--heading-text);
  font-family: inherit; font-size: 13px; font-weight: 600;
}
#hz-studio-root .hzs-btn:hover { background: rgba(126,200,255,.32); }
#hz-studio-root .hzs-btn[disabled] { opacity: .55; cursor: default; }
#hz-studio-root .hzs-btn.ghost { border-color: var(--border); background: transparent; font-weight: 400; }
#hz-studio-root .hzs-hint { font-size: 11.5px; color: var(--text-dim); }
/* 尺寸下拉（v2.1.0）：单档模型置灰；档位下方一行说明 */
#hz-studio-root .hzs-select[disabled] { opacity: .55; cursor: not-allowed; }
#hz-studio-root .hzs-sizehint { font-size: 11px; color: var(--text-dim); line-height: 1.3; }
#hz-studio-root .hzs-sizehint:empty { display: none; }

/* ---------- 图片 ---------- */
#hz-studio-root .hzs-imgwrap { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
#hz-studio-root .hzs-img {
  max-width: 100%; border-radius: 10px; border: 1px solid var(--border);
  display: block; background: #fff;
}
#hz-studio-root .hzs-imgcap { font-size: 11.5px; color: var(--text-dim); }

/* ---------- 卡片 / 会话 ---------- */
#hz-studio-root .hzs-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  background: rgba(127,127,127,.06); display: flex; flex-direction: column; gap: 10px;
}
#hz-studio-root .hzs-card h4 { margin: 0; font-size: 13.5px; color: var(--heading-text); }
#hz-studio-root .hzs-sess {
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px;
  max-height: 180px; overflow: auto;
}
#hz-studio-root .hzs-sess li {
  display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 9px;
  cursor: pointer; border: 1px solid var(--border); font-size: 12.5px;
}
#hz-studio-root .hzs-sess li:hover { background: rgba(127,127,127,.12); }
#hz-studio-root .hzs-sess .hzs-sess-t { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hz-studio-root .hzs-sess .hzs-sess-m { color: var(--text-dim); font-size: 11.5px; white-space: nowrap; }

/* ---------- 浅色主题适配 ---------- */
html.light #hz-studio-root .hzs-panel,
html.light #hz-studio-root .hzs-card { background: #fffdfa; }
html.light #hz-studio-root .hzs-bubble { background: #f4f1e8; border-color: rgba(21,26,43,.14); color: #2a2c33; }
html.light #hz-studio-root .hzs-msg.user .hzs-bubble { background: rgba(138,98,18,.12); border-color: rgba(138,98,18,.3); }
html.light #hz-studio-root .hzs-tab.active { background: rgba(138,98,18,.16); border-color: rgba(138,98,18,.45); }
html.light #hz-studio-root .hzs-btn { background: rgba(138,98,18,.14); border-color: rgba(138,98,18,.4); }
html.light #hz-studio-root .hzs-code { background: #faf7f0; }

/* ---------- 窄屏 ---------- */
@media (max-width: 640px) {
  #hz-studio-root .hzs-bubble { max-width: 96%; }
  #hz-studio-root .hzs-msgs { max-height: none; }
  #hz-studio-root .hzs-tab { min-width: 70px; padding: 6px 10px; font-size: 12px; }
}


/* ---------- 动作行（按钮行）与上方字段的间距（HZS-ACTION-ROW-GAP-V211） ----------
   实测问题：卡片内所有子元素统一用 .hzs-card 的 gap:10px，于是「🎨 一键生图」
   「⚡ 一键生成文章」这类动作按钮行紧贴上方输入框（1440 与 390 两宽度实测均为 10.00px）。
   做法：沿用面板既有间距尺度，不写死魔数 ——
     --hzs-gap     = 10px（与 .hzs-card / .hzs-tools / .hzs-msgs 既有 gap 同一档）
     --hzs-gap-lg  = 16px（与 .hzs-body 既有 padding-bottom 同一档＝面板最大的一档）
   动作行视为「新的一组」：与上方字段的实际间距 = --hzs-gap + margin-top = --hzs-gap-lg。
   作用域仅 .hzs-card 的最后一个 .hzs-tools（写文章 / 生图 两张卡片），会话卡片末位是
   单个 button，不受影响。 */
#hz-studio-root { --hzs-gap: 10px; --hzs-gap-lg: 16px; }
#hz-studio-root .hzs-card > .hzs-tools:last-child {
  margin-top: calc(var(--hzs-gap-lg) - var(--hzs-gap));
}
