/* 问渠工作台 —— 样式（clean / 安静 / 文档工作空间） */
:root {
  --bg: #F7F8F6;
  --surface: #FFFFFF;
  --text: #202522;
  --text-2: #6B746F;
  --border: #E5E9E6;
  --accent: #2F6B57;
  --accent-soft: #EDF3F0;
  --accent-ink: #24523F;
  --danger: #B4433A;
  --danger-soft: #FBEDEB;
  --demo: #8A6D2F;
  --demo-soft: #F6F0E3;
  --radius: 11px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(32, 37, 34, 0.04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; font-size: 14px; cursor: pointer; }
button:focus-visible, a:focus-visible, [contenteditable]:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ---- 图标 ---- */
.icon { display: inline-flex; width: 18px; height: 18px; flex: none; align-items: center; justify-content: center; }
.icon svg { width: 100%; height: 100%; }

/* ---- 应用布局 ---- */
.app { display: flex; min-height: 100vh; }

/* 移动端顶栏 */
.topbar { display: none; }

/* ---- 侧栏 ---- */
.sidebar {
  width: 220px;
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 16px 12px 14px;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 14px; }
.brand-mark {
  font-weight: 650;
  font-size: 17px;
  letter-spacing: 0.06em;
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand-mark::before {
  content: "";
  width: 18px; height: 18px;
  background: var(--accent);
  border-radius: 6px;
  display: inline-block;
}
.sidebar .sidebar-close { display: none; }

.btn-new {
  margin: 0 4px 14px;
  width: calc(100% - 8px);
  justify-content: center;
  gap: 6px;
}

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.side-link:hover { background: var(--accent-soft); text-decoration: none; }
.side-link.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.side-link .icon { color: var(--text-2); }
.side-link.active .icon { color: var(--accent); }
.side-link-muted { color: var(--text-2); }

.side-section { margin-top: 18px; flex: 1; overflow-y: auto; }
.side-section-title {
  font-size: 12px;
  color: var(--text-2);
  padding: 0 10px 6px;
  letter-spacing: 0.02em;
}
.recent-item {
  display: flex;
  flex-direction: column;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.recent-item:hover { background: var(--accent-soft); }
.recent-name { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-time { font-size: 12px; color: var(--text-2); }
.side-empty { padding: 4px 10px; font-size: 13px; color: var(--text-2); }

.sidebar-foot { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.side-btn { font-size: 13.5px; }
.prototype-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 4px 0;
  padding: 7px 9px;
  font-size: 12px;
  color: var(--text-2);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
}
.prototype-note .icon { width: 15px; height: 15px; color: var(--accent); }

.sidebar-scrim { display: none; }

/* ---- 主内容 ---- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---- 首页 ---- */
.home { display: flex; align-items: flex-start; justify-content: center; padding: 64px 24px 40px; min-height: 100vh; }
.home-center { width: 100%; max-width: 640px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.home-brand-word { font-size: 14px; color: var(--accent-ink); letter-spacing: 0.2em; margin-bottom: 14px; }
.home-title { font-size: 30px; font-weight: 650; margin: 0 0 10px; color: var(--text); letter-spacing: -0.01em; }
.home-sub { font-size: 15px; color: var(--text-2); margin: 0 0 30px; }

.home-input-wrap {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.home-input {
  width: 100%;
  border: none;
  resize: none;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: transparent;
  padding: 6px 4px;
}
.home-input:focus { outline: none; }
.home-send { display: inline-flex; gap: 6px; }

.quick-entries { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
.quick-entry {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}
.quick-entry:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.quick-entry .icon { color: var(--accent); }

.home-recent { width: 100%; margin-top: 40px; text-align: left; }
.home-section-title { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.home-recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-align: left;
}
.recent-card:hover { border-color: var(--accent); }
.recent-card > .icon:first-child { color: var(--accent); }
.recent-card-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.recent-card-name { font-size: 15px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-card-time { font-size: 12.5px; color: var(--text-2); }
.recent-chev { color: var(--text-2); }
.home-empty { padding: 20px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--text-2); font-size: 14px; }

.demo-entry {
  margin-top: 26px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 14px;
  padding: 6px 10px;
}
.demo-entry:hover { color: var(--accent-ink); }
.demo-entry .icon { color: var(--demo); }

/* ---- 通用页面 ---- */
.page { padding: 36px 40px; max-width: 860px; margin: 0 auto; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.page-head h2 { font-size: 22px; margin: 0; font-weight: 650; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 44px 20px;
  color: var(--text-2);
}
.empty-state .icon { width: 30px; height: 30px; color: #B9C2BD; margin-bottom: 12px; }
.empty-state p { margin: 4px 0; font-size: 14.5px; }
.empty-state .muted, .muted { color: var(--text-2); font-size: 13px; }

.list-block { display: flex; flex-direction: column; gap: 8px; }
.list-block-title { font-size: 12.5px; color: var(--text-2); margin: 6px 2px; }
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  text-align: left;
  color: var(--text);
}
.list-row-clickable { cursor: pointer; }
.list-row-clickable:hover { border-color: var(--accent); }
.list-row > .icon:first-child { color: var(--text-2); }
.list-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-row-name { font-size: 15px; font-weight: 550; }
.list-row-sub { font-size: 12.5px; color: var(--text-2); }
.row-actions { display: inline-flex; gap: 2px; }

.mini-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.status-todo { background: #B9C2BD; }
.status-doing { background: #2F6B57; }
.status-done { background: #8FAE9F; }

/* ---- 工作区 ---- */
.workspace { display: flex; flex-direction: column; min-height: 100vh; }

.demo-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--demo-soft);
  color: var(--demo);
  font-size: 13px;
  border-bottom: 1px solid #E8DEC7;
}
.demo-banner .icon { color: var(--demo); }

.ws-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.ws-title-group { min-width: 0; }
.ws-project-name { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 650; }
.ws-name-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-project-name .icon-btn { opacity: 0; transition: opacity 0.15s; }
.ws-project-name:hover .icon-btn { opacity: 1; }
.ws-save-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); margin-top: 3px; }
.save-dot { width: 7px; height: 7px; border-radius: 50%; background: #8FAE9F; }
.ws-actions { flex: none; }

.ws-tabs {
  display: flex;
  gap: 2px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.ws-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.ws-tab:hover { color: var(--text); }
.ws-tab.active { color: var(--accent-ink); font-weight: 600; border-bottom-color: var(--accent); }
.ws-tab .icon { width: 16px; height: 16px; }

.ws-body { flex: 1; }
.ws-body.dual { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: calc(100vh - 120px); overflow: hidden; }
.ws-body.dual .dual-chat { border-right: 1px solid var(--border); display: flex; min-width: 0; }
.ws-body.dual .dual-chat .ws-chat { flex: 1; height: auto; }
.ws-body.dual .dual-editor { min-width: 0; overflow-y: auto; }

/* ---- 对话 ---- */
.ws-chat { display: flex; flex-direction: column; height: calc(100vh - 120px); }
.chat-messages { flex: 1; overflow-y: auto; padding: 22px 24px; }
.chat-scroll-inner { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }

.chat-empty { text-align: center; color: var(--text-2); padding: 40px 0; }
.chat-empty .icon { width: 30px; height: 30px; color: #B9C2BD; margin-bottom: 8px; }

.msg { display: flex; flex-direction: column; }
.msg-user { align-items: flex-end; }
.msg-assistant { align-items: flex-start; }
.msg-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14.5px;
  line-height: 1.65;
  word-break: break-word;
}
.msg-user .msg-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg-assistant .msg-bubble { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg-time { font-size: 11.5px; color: var(--text-2); margin-top: 4px; }
.msg-assistant .badge { margin-bottom: 5px; }
.msg-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text-2);
}
.msg-notice .icon { color: var(--accent); flex: none; margin-top: 2px; }

.chat-composer { border-top: 1px solid var(--border); padding: 12px 24px 14px; background: var(--surface); }
.composer-tools { max-width: 720px; margin: 0 auto 8px; display: flex; gap: 8px; }
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
}
.tool-btn:hover { color: var(--accent-ink); border-color: var(--accent); }
.tool-btn .icon { width: 15px; height: 15px; }
.tool-btn-demo { color: var(--demo); border-color: #E8DEC7; background: var(--demo-soft); }
.tool-btn-demo:hover { color: #6b531f; border-color: var(--demo); }
.tool-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.composer-row { max-width: 720px; margin: 0 auto; display: flex; gap: 10px; align-items: flex-end; }
.composer-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.6;
  resize: none;
  color: var(--text);
  background: var(--bg);
}
.composer-input:focus { background: var(--surface); outline: none; border-color: var(--accent); }
.composer-send { flex: none; padding: 9px 14px; }
.composer-hint { max-width: 720px; margin: 6px auto 0; font-size: 12px; color: var(--text-2); }

/* ---- 面板 ---- */
.ws-panel { padding: 24px; max-width: 860px; margin: 0 auto; width: 100%; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-title { font-size: 17px; font-weight: 650; }

/* ---- 作品编辑器 ---- */
.ws-editor { max-width: none; display: flex; flex-direction: column; }
.editor-title-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.editor-title {
  min-width: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 17px;
  font-weight: 650;
  outline: none;
}
.editor-title:hover { border-color: var(--border); }
.editor-title:focus { border-color: var(--accent); background: var(--surface); }
.editor-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.editor-meta { font-size: 12.5px; color: var(--text-2); margin-bottom: 12px; }
.editor-history { margin-bottom: 14px; }
.history-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.history-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.history-item:last-child { border-bottom: none; }
.history-item-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.history-time { font-size: 13px; color: var(--text-2); }
.history-note { font-size: 13px; color: var(--text); }
.editor-content {
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text);
  resize: vertical;
  background: var(--surface);
}
.editor-content[readonly] { background: var(--bg); color: var(--text-2); }
.editor-content:focus { outline: none; border-color: var(--accent); }
.editor-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.editor-note { flex: 1; min-width: 160px; }
.editor-foot-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- 表单字段 ---- */
.field {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  margin-bottom: 10px;
}
.field:focus { outline: none; border-color: var(--accent); }
textarea.field { resize: vertical; line-height: 1.6; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.form-actions { display: flex; gap: 8px; }
.form-hint { font-size: 12px; color: var(--text-2); flex: 1; }

.material-form, .task-form {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
  background: var(--surface);
}

/* ---- 资料 ---- */
.material-list { display: flex; flex-direction: column; gap: 12px; }
.material-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 17px; }
.material-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; }
.material-title { font-size: 15px; font-weight: 600; }
.material-verified { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); margin-bottom: 7px; }
.material-verified .icon { width: 14px; height: 14px; color: var(--text-2); }
.material-link { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 7px; word-break: break-all; }
.material-link .icon { width: 14px; height: 14px; color: var(--text-2); }
.material-excerpt { font-size: 13.5px; line-height: 1.7; color: var(--text); white-space: pre-wrap; margin-bottom: 7px; }
.material-note { font-size: 12.5px; color: var(--text-2); margin-bottom: 7px; }
.material-time { font-size: 11.5px; color: #9AA39E; }

/* ---- 进展 ---- */
.ws-progress { max-width: 1000px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.progress-col { min-width: 0; }
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-item { display: flex; align-items: center; gap: 10px; padding: 11px 13px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.task-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.task-title { font-size: 14px; }
.task-due { font-size: 12px; color: var(--text-2); }

.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1px; background: var(--border); }
.timeline-item { position: relative; padding: 0 0 18px 10px; }
.timeline-dot { position: absolute; left: -18px; top: 5px; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.timeline-demo .timeline-dot { background: var(--demo); }
.timeline-text { font-size: 14px; }
.timeline-demo .timeline-text { color: var(--text-2); }
.timeline-time { font-size: 12px; color: var(--text-2); }

/* ---- 徽章 ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 550;
  padding: 1px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-prototype { background: var(--accent-soft); color: var(--accent-ink); }
.badge-demo { background: var(--demo-soft); color: var(--demo); }
.badge-sim { background: var(--demo-soft); color: var(--demo); }
.badge-ai { background: var(--accent-soft); color: var(--accent-ink); }
.badge-ver { background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.12s, border-color 0.12s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #93372f; }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border); padding: 5px 11px; font-size: 13px; }
.btn-ghost:hover { color: var(--accent-ink); border-color: var(--accent); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-2);
}
.icon-btn:hover { background: var(--accent-soft); color: var(--accent-ink); }
.icon-btn-danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---- 抽屉 / 弹层 ---- */
.overlay { position: fixed; inset: 0; background: rgba(32, 37, 34, 0.28); z-index: 60; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 420px;
  max-width: 92vw;
  background: var(--surface);
  z-index: 61;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 24px rgba(32, 37, 34, 0.08);
  animation: slideIn 0.18s ease;
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head, .modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.drawer-head h3, .modal-head h3 { margin: 0; font-size: 16px; }
.drawer-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }
.ov-label { display: block; font-size: 12.5px; color: var(--text-2); margin: 6px 0 5px; font-weight: 550; }

.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 560px;
  max-width: 94vw;
  max-height: 86vh;
  background: var(--surface);
  border-radius: 14px;
  z-index: 61;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 50px rgba(32, 37, 34, 0.18);
  animation: modalIn 0.16s ease;
}
@keyframes modalIn { from { transform: translate(-50%, -48%); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
.modal-sm { width: 460px; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

.help-body h4 { margin: 18px 0 6px; font-size: 14.5px; }
.help-body p { margin: 6px 0; font-size: 14px; color: var(--text); }
.help-body ul { margin: 6px 0; padding-left: 20px; }
.help-body li { margin: 3px 0; font-size: 13.5px; }
.help-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 13px;
  font-size: 13.5px;
  color: var(--accent-ink);
  margin: 10px 0;
}
.help-note .icon { color: var(--accent); flex: none; margin-top: 2px; }
.data-actions { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.data-actions .btn { justify-content: center; }

/* ---- Toast ---- */
.toast-host { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--text);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 6px 18px rgba(0,0,0,0.14);
}
.toast.show { opacity: 1; transform: none; }
.toast-error { background: var(--danger); }

/* ---- 响应式 ---- */
@media (max-width: 900px) {
  .topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 40;
  }
  .topbar-brand { font-weight: 650; color: var(--accent-ink); }
  .topbar-spacer { flex: 1; }

  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 70;
    box-shadow: none;
  }
  .sidebar.open { transform: none; box-shadow: 8px 0 30px rgba(0,0,0,0.12); }
  .sidebar .sidebar-close { display: inline-flex; }
  .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(32,37,34,0.28); z-index: 65; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
  .sidebar-scrim.show { opacity: 1; pointer-events: auto; }

  .home { padding: 36px 18px 32px; }
  .home-title { font-size: 24px; }
  .quick-entries { flex-direction: column; width: 100%; }
  .quick-entry { justify-content: center; }

  .page { padding: 24px 16px; }

  .ws-body.dual { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .ws-body.dual .dual-chat { display: none; }

  .ws-topbar { padding: 12px 16px; }
  .ws-tabs { padding: 0 8px; overflow-x: auto; }
  .ws-chat { height: calc(100vh - 168px); }
  .chat-messages { padding: 16px 14px; }
  .chat-composer { padding: 10px 14px 12px; }
  .ws-panel { padding: 18px 16px; }
  .ws-progress { grid-template-columns: 1fr; }
  .editor-foot { flex-direction: column; align-items: stretch; }
  .editor-foot-actions { justify-content: flex-start; }
  .drawer { width: 100%; max-width: 100vw; }
}

/* ---- 登录 / 认证 ---- */
.auth-mode .sidebar,
.auth-mode .topbar,
.auth-mode .sidebar-scrim { display: none; }

.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
}
.auth-brand { font-size: 18px; font-weight: 700; color: var(--accent-ink); letter-spacing: 0.5px; }
.auth-title { font-size: 20px; margin: 10px 0 6px; }
.auth-sub { color: var(--text-2); margin: 0 0 20px; font-size: 14px; }
.auth-label { display: block; font-size: 13px; color: var(--text-2); margin: 14px 0 6px; }
.auth-input { width: 100%; }
.auth-tabs { display: flex; gap: 6px; margin-top: 14px; border-bottom: 1px solid var(--border); }
.auth-tab {
  flex: 1;
  border: none;
  background: none;
  padding: 8px 4px;
  color: var(--text-2);
  font-size: 14px;
  border-bottom: 2px solid transparent;
}
.auth-tab.active { color: var(--accent-ink); font-weight: 600; border-bottom-color: var(--accent); }
.auth-otp-row { display: flex; gap: 8px; }
.auth-otp-row .auth-input { flex: 1; }
.auth-submit { width: 100%; margin-top: 20px; }
.auth-error {
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.auth-note { margin-top: 16px; font-size: 12px; color: var(--text-2); }

/* ---- 侧栏账号卡片与退出 ---- */
.account-box { padding: 10px 4px 4px; border-top: 1px solid var(--border); margin-top: 6px; }
.account-email { font-size: 12px; color: var(--text-2); padding: 0 12px 8px; word-break: break-all; }
.btn-logout { width: 100%; }

/* 账号卡片：常驻显示当前登录身份，点击展开退出 */
.account-card {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 9px; text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
  transition: background .15s, border-color .15s;
}
.account-card:hover, .account-card.open { background: var(--accent-soft); border-color: var(--border); }
.account-avatar {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 50%; font-size: 12px; font-weight: 500; letter-spacing: .02em;
}
.account-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.account-name {
  font-size: 13px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.account-mail {
  font-size: 11.5px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.account-caret { width: 14px; height: 14px; color: var(--text-2); flex-shrink: 0; transition: transform .15s; }
.account-card.open .account-caret { transform: rotate(90deg); }

.account-menu { margin-top: 4px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.account-menu-mail {
  font-size: 11.5px; color: var(--text-2); padding: 4px 8px 8px;
  word-break: break-all; border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.account-menu-item {
  display: flex; align-items: center; gap: 7px; width: 100%;
  padding: 7px 8px; font-size: 13px; color: var(--text);
  background: transparent; border: none; border-radius: 6px; text-align: left;
}
.account-menu-item:hover { background: var(--accent-soft); color: var(--accent-ink); }
.account-menu-item .icon { width: 14px; height: 14px; }

/* ---- 登录页免登录入口 ---- */
.auth-guest { width: 100%; margin-top: 12px; }

/* ---- 访客只读预览 ---- */
.guest-mode .sidebar,
.guest-mode .topbar,
.guest-mode .sidebar-scrim { display: none; }

.guest { min-height: 100vh; background: var(--bg); }
.guest-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.guest-brand { font-weight: 700; color: var(--accent-ink); font-size: 16px; }
.guest-body { max-width: 760px; margin: 0 auto; padding: 28px 20px 60px; }
.guest-title { font-size: 22px; margin: 0 0 8px; }
.guest-sub { color: var(--text-2); margin: 0 0 16px; }
.guest-banner {
  background: var(--accent-soft);
  color: var(--accent-ink);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: 14px;
}
.guest-body h2 { font-size: 16px; margin: 28px 0 12px; }
.guest-interest {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
}
.guest-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.guest-step-title { font-weight: 600; color: var(--accent-ink); margin-bottom: 6px; }
.guest-step-body { white-space: pre-wrap; }
.guest-step-note { color: var(--demo); font-size: 12px; margin-top: 6px; }
.guest-mat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 8px;
}
.guest-mat-title { font-weight: 600; margin-bottom: 4px; }
.guest-mat-body { color: var(--text-2); font-size: 13px; }
.guest-work {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.guest-work h4 { margin: 0 0 10px; }
.guest-work pre { white-space: pre-wrap; font-family: inherit; font-size: 14px; margin: 0; color: var(--text); }
.guest-cta { text-align: center; margin-top: 28px; }

/* ============================================================
   起步入口层：欢迎区 / 双模式 / 阶段定位 / 情境卡片
   ============================================================ */
.home-launcher { flex-direction: column; align-items: stretch; padding: 44px 24px 40px; }
/* 覆盖 .home-center 的 max-width:640px，首页主容器需要更宽以容纳卡片与输入框 */
.home-center-wide {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  align-items: stretch;
}
.home-center-input { max-width: 760px; margin: 32px auto 0; }

.lc-home { display: flex; flex-direction: column; align-items: center; width: 100%; }

.lc-welcome { text-align: center; margin-bottom: 26px; }
.lc-welcome-title {
  font-size: 27px; font-weight: 650; margin: 0 0 8px;
  color: var(--text); letter-spacing: -0.01em;
}
.lc-welcome-sub { font-size: 14px; color: var(--text-2); margin: 0; }

/* 双模式入口 */
.lc-modes { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }
.lc-mode {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px 14px 16px; min-width: 244px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  text-align: left; transition: border-color .15s, background .15s, transform .15s;
}
.lc-mode:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.lc-mode-icon {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 9px; background: var(--accent-soft); color: var(--accent);
}
.lc-mode-primary .lc-mode-icon { background: var(--accent); color: #fff; }
.lc-mode-body { display: flex; flex-direction: column; gap: 2px; }
.lc-mode-label { font-size: 15px; font-weight: 500; color: var(--text); }
.lc-mode-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }

/* 阶段定位条 */
.lc-stage-wrap { width: 100%; }
.lc-stage-label { font-size: 12px; color: var(--text-2); margin-bottom: 9px; letter-spacing: .02em; }
.lc-stages { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 7px; }
.lc-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px; font-size: 13px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; color: var(--text-2);
  transition: border-color .15s, background .15s, color .15s;
}
.lc-chip .icon { width: 14px; height: 14px; }
.lc-chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.lc-chip-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.lc-chip-on .icon { color: #fff; }
.lc-stage-hint { font-size: 12.5px; color: var(--text-2); margin-bottom: 18px; }

/* 情境卡片 */
.lc-scenes { width: 100%; }
.lc-scenes-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 11px; flex-wrap: wrap; }
.lc-scenes-title { font-size: 14px; font-weight: 500; color: var(--text); }
.lc-scenes-note { font-size: 12.5px; color: var(--text-2); }
.lc-scene-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); gap: 10px; }
.lc-scene {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 13px 32px 13px 13px; text-align: left;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: border-color .15s, background .15s, transform .15s;
}
.lc-scene:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.lc-scene-icon {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 8px; background: var(--accent-soft); color: var(--accent);
}
.lc-scene-title { font-size: 13.5px; color: var(--text); line-height: 1.45; }
.lc-scene-arrow {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  width: 13px; height: 13px; color: var(--text-2); opacity: .55;
}
.lc-scene:hover .lc-scene-arrow { color: var(--accent); opacity: 1; }
.lc-scenes-foot { font-size: 12px; color: var(--text-2); margin-top: 11px; }

@media (max-width: 640px) {
  .home-launcher { padding: 28px 16px 32px; }
  .home-input-hero .home-input { min-height: 140px; }
  .lc-welcome-title { font-size: 22px; }
  .lc-modes { flex-direction: column; }
  .lc-mode { width: 100%; min-width: 0; }
  .lc-scene-grid { grid-template-columns: 1fr; }
}

/* 对话回应操作条：存为作品 */
.msg-actions { display: flex; gap: 6px; margin-top: 6px; }
.msg-action {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; font-size: 12px;
  color: var(--text-2); background: transparent;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .15s, color .15s, background .15s;
}
.msg-action .icon { width: 12px; height: 12px; }
.msg-action:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }

/* 登录页：忘记密码入口与提示 */
.auth-link {
  background: none; border: none; padding: 4px 0; margin-top: 2px;
  font-size: 12.5px; color: var(--accent); text-decoration: none; cursor: pointer;
}
.auth-link:hover { text-decoration: underline; }
.auth-link-inline { display: inline; padding: 0; margin: 0; font-size: inherit; }
.auth-hint {
  font-size: 12px; color: var(--text-2); margin: 6px 0 0; line-height: 1.55;
}
#authResetRow { margin-top: 4px; }
#authResetRow .form-actions { margin-top: 12px; }


/* 首页主入口：输入框位于情境卡片之后，作为自由输入的收口 */
.lc-hero { display: flex; flex-direction: column; align-items: center; margin-top: 30px; }
.lc-hero-label { font-size: 13px; color: var(--text-2); margin-bottom: 11px; }
/* 主输入框：加高到约原来的两倍，避免 placeholder 被截断出现滚动条 */
/* 主输入框：宽度不再依赖父级百分比计算（.home-center 是 flex+align-items:center，
   子元素会按内容收缩），直接给足确定宽度，避免看起来比上方卡片区窄 */
.home-input-hero {
  width: 100%;
  max-width: none;
  align-self: stretch;
  margin-left: 0;
  margin-right: 0;
}
.home-input-hero .home-input {
  min-height: 190px;
  padding: 12px 10px;
  font-size: 15px;
  line-height: 1.75;
}
.home-input-hero .home-input::placeholder { color: var(--text-2); opacity: .85; }
.home-input-hero .home-send { margin-top: 2px; }
.home-more {
  background: none; border: none; padding: 0; font-size: 12.5px;
  color: var(--accent); cursor: pointer; text-decoration: underline;
}
.home-more:hover { color: var(--accent-ink); }
.home-section-title { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }

/* 主容器 stretch 后，文字型区块需自行居中 */
.lc-welcome, .lc-stage-label, .lc-stage-hint, .lc-scenes-head, .lc-scenes-foot,
.home-section-title, .home-empty, .demo-entry { text-align: center; }
.lc-welcome { display: flex; flex-direction: column; align-items: center; }
.lc-scene-grid { justify-content: stretch; }
