:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #1b2330;
  --muted: #6b7889;
  --line: #e6ebf2;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --ok: #0f9d70;
  --warn: #d98324;
  --fail: #d64545;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .6em; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 .8em; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 28px; height: 60px;
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.logo {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #2563eb, #4f8cff);
  color: #fff; display: grid; place-items: center; font-size: 16px;
}
.logo-img {
  width: 32px; height: 32px; border-radius: 8px;
  object-fit: contain; display: block; flex: none;
}
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  padding: 8px 14px; border-radius: 9px; color: var(--muted); font-weight: 500;
}
.nav a:hover { background: #f0f4fb; text-decoration: none; }
.nav a.active { background: #eaf1ff; color: var(--brand-dark); }
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.tenant { font-weight: 600; color: var(--ink); }
.logout-form { margin: 0; }
.linklike {
  background: none; border: 0; padding: 0; margin: 0;
  color: var(--muted); font: inherit; cursor: pointer;
}
.linklike:hover { color: var(--brand-dark); text-decoration: underline; }

.shell { max-width: 1120px; margin: 0 auto; padding: 28px 24px 80px; }

/* 卡片 */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 24px; margin-bottom: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }

/* 网格 */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  /* 顶栏改两行：第一行品牌 + 退出，第二行导航横向可滑，避免挤成竖排文字 */
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 6px 10px; }
  .brand { font-size: 15px; white-space: nowrap; }
  .logo { width: 26px; height: 26px; font-size: 14px; }
  .logo-img { width: 26px; height: 26px; border-radius: 7px; }
  .who { margin-left: auto; font-size: 12px; white-space: nowrap; }
  .who .tenant, .who .user { display: none; }
  .nav { order: 3; flex: 1 0 100%; width: auto; overflow-x: auto; gap: 2px; }
  .nav a { padding: 6px 12px; font-size: 13px; white-space: nowrap; }
}

/* 指标 */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric { background: #f8faff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.metric .num { font-size: 24px; font-weight: 700; color: var(--ink); }
.metric .lbl { font-size: 12px; color: var(--muted); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px; border: 1px solid transparent;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: .15s; white-space: nowrap; flex: none;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
/* 所有按钮、页签、标签一律不拆字：空间不足时整体换行，而不是「不够/好」竖排 */
button, .btn, .tag, .nav a, .chip { white-space: nowrap; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: #f6f8fc; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 表单 */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid #d8e0ec; border-radius: 10px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid #c7dbff; border-color: var(--brand); }
textarea { min-height: 88px; resize: vertical; }
.field { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .form-row { grid-template-columns: 1fr; } }

/* 提示 */
.flashes { margin-bottom: 16px; }
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 8px; font-size: 14px; }
.flash.ok { background: #e9f8f2; color: #08674b; border: 1px solid #bfe9da; }
.flash.error { background: #fdeeee; color: #9b2c2c; border: 1px solid #f3caca; }

/* 状态标签 */
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.tag.ok { background: #e9f8f2; color: #08674b; }
.tag.warn { background: #fdf3e6; color: #8a5a12; }
.tag.fail { background: #fdeeee; color: #9b2c2c; }
.tag.info { background: #eaf1ff; color: var(--brand-dark); }

/* 选题卡 */
.topic {
  border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 10px; background: #fff;
}
.topic:hover { border-color: #c7dbff; }
.topic .q { font-weight: 600; }
.topic .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 资料库 */
.completeness { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.bar { flex: 1; height: 10px; background: #edf1f7; border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #2563eb, #59a1ff); }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.checklist li:last-child { border-bottom: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.fail { background: var(--fail); }

/* 文稿 */
.article-body { white-space: pre-wrap; font-size: 15px; line-height: 1.85; }
.article-body.md-rendered { white-space: normal; }
.article-body .md-h { font-size: 17px; font-weight: 600; margin: 18px 0 8px; }
.article-body .md-p { margin: 0 0 10px; }
.article-body .md-gap { height: 6px; }
.article-body ul, .article-body ol { margin: 0 0 10px 22px; }
.article-title-input {
  width: 100%; border: 0; background: transparent; color: inherit;
  font-size: 22px; font-weight: 700; line-height: 1.35; padding: 2px 0;
}
.article-title-input:focus { outline: none; border-bottom: 1px solid var(--line); }
.article-editor-bar { display: flex; align-items: center; gap: 10px; margin: 10px 0 8px; }
.article-editor {
  display: block; width: 100%; min-height: 58vh; padding: 14px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  color: inherit; font: inherit; font-size: 15px; line-height: 1.85;
  resize: vertical; box-sizing: border-box;
}
.article-editor:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .08);
}
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { padding: 7px 14px; border-radius: 9px; background: #f1f5fb; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 600; border: 0; }
.tab.active { background: var(--brand); color: #fff; }

/* 视频进度 */
.progress { height: 10px; background: #edf1f7; border-radius: 999px; overflow: hidden; margin: 10px 0; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2563eb, #59a1ff); transition: width .4s; }
.logbox { background: #0f172a; color: #cfe0ff; border-radius: 10px; padding: 12px 14px; font-family: Consolas, monospace; font-size: 12px; max-height: 220px; overflow: auto; white-space: pre-wrap; }

/* 登录页 */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 20% 0%, #e8f0ff, #f5f7fb 60%); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 32px; }
.auth-card .brand { justify-content: center; margin-bottom: 8px; }
.auth-card h1 { font-size: 22px; text-align: center; margin-bottom: 4px; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.auth-foot { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }

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

.steps { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.step { padding: 6px 12px; border-radius: 999px; background: #eef3fb; color: var(--muted); font-size: 12px; font-weight: 600; }
.step.on { background: var(--brand); color: #fff; }
.step.done { background: #e9f8f2; color: #08674b; }

.notice { background: #fff8e8; border: 1px solid #f2e0b8; color: #7a5410; padding: 12px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }

/* 一行式输入（自己出题） */
.inline-form { display: flex; gap: 10px; align-items: center; }
.inline-form input[type=text] { flex: 1; }
@media (max-width: 700px) { .inline-form { flex-direction: column; align-items: stretch; } }

/* 首页互动输入 */
.hero-ask input#hero-ask-input {
  padding: 14px 16px; font-size: 15px; border-radius: 12px;
  border: 1px solid #cfdbee; background: #fbfcff;
}
.hero-ask input#hero-ask-input:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.hero-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.hero-chips button {
  border: 1px solid var(--line); background: #f6f9ff; color: var(--muted);
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer;
}
.hero-chips button:hover { color: var(--brand-dark); border-color: #c7dbff; }
.topic-cards { margin-top: 8px; width: 100%; }
.topic-item {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px;
  margin-bottom: 8px; background: #fff;
}
.topic-q { font-size: 13px; color: var(--ink); line-height: 1.5; }
.topic-meta { font-size: 11px; color: var(--muted); margin: 3px 0 6px; }
.topic-pick {
  border: 0; border-radius: 8px; padding: 5px 12px; font-size: 12px;
  background: var(--brand); color: #fff; cursor: pointer;
}
.topic-pick:disabled { opacity: .5; cursor: not-allowed; }
.topic-picks { display: flex; gap: 6px; flex-wrap: wrap; }
.topic-form { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.platform-select {
  width: auto; padding: 6px 8px; font-size: 13px; border-radius: 8px;
}

/* 工作台内联对话 */
.chat-inline { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.chat-inline .chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 12px; border-bottom: 1px solid var(--line); background: #f8faff;
}
.chat-mode { display: block; font-size: 11px; color: var(--muted); }
.chat-inline .chat-body { max-height: 420px; min-height: 72px; overflow-y: auto; padding: 14px; background: #fbfcfe; }
.msg { display: flex; flex-direction: column; margin-bottom: 12px; }
.msg.user { align-items: flex-end; }
.msg.assistant { align-items: flex-start; }
.bubble {
  max-width: 86%; padding: 10px 14px; border-radius: 18px;
  font-size: 14px; line-height: 1.65; white-space: pre-wrap; word-break: break-word;
}
/* 对齐主流 AI App：用户浅灰气泡，助手更浅的灰底，去掉硬边框 */
.msg.user .bubble {
  background: #f1f2f4; color: var(--ink); border-bottom-right-radius: 6px;
}
.msg.assistant .bubble {
  background: #f7f8fa; color: var(--ink); border: 0; border-bottom-left-radius: 6px;
}
.msg.assistant .bubble { white-space: normal; }
.bubble .md-p { margin: 0 0 4px; }
.bubble .md-gap { height: 6px; }
.bubble .md-h { font-weight: 600; margin: 8px 0 4px; }
.bubble ul, .bubble ol { margin: 4px 0 4px 18px; padding: 0; }
.bubble li { margin: 2px 0; }
.bubble code {
  background: #f1f4f9; border-radius: 4px; padding: 1px 4px;
  font-size: 12px; font-family: Consolas, Menlo, monospace;
}
.bubble pre {
  background: #f6f8fb; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; overflow-x: auto; margin: 6px 0;
}
.bubble pre code { background: none; padding: 0; }
.bubble .caret {
  display: inline-block; width: 6px; height: 14px; margin-left: 2px;
  background: var(--brand); vertical-align: -2px; animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.dots { display: inline-flex; gap: 4px; align-items: center; height: 16px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: #b6c3d6; animation: bounce 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
/* 等待中的“正在干活”状态 */
/* 模型工作时的状态条：贴齐内容宽度，像一条轻量的活动提示 */
.msg.assistant .bubble.working {
  width: 100%; max-width: 100%; padding: 2px 0 10px;
  background: transparent; border: 0; border-radius: 0;
  border-bottom: 1px solid #eef0f3;
}
.work-head { display: flex; align-items: center; gap: 9px; color: #8b929c; font-size: 13.5px; }
.work-spin {
  width: 16px; height: 16px; flex: none; border: 0; border-radius: 0;
  background-image: radial-gradient(circle, #c1c7d0 1.1px, transparent 1.2px);
  background-size: 5px 5px;
  animation: work-dots 1.2s ease-in-out infinite;
}
@keyframes work-dots { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.work-text { color: #707782; opacity: 1; }
.work-time { margin-left: auto; font-size: 12px; color: #a2a8b2; font-variant-numeric: tabular-nums; }
.work-track {
  margin-top: 8px; height: 2px; border-radius: 2px; overflow: hidden;
  background: #f0f2f5;
}
.work-track i {
  display: block; width: 36%; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #c9d6ea, #9fb4d4);
  animation: work-slide 1.5s ease-in-out infinite;
}
@keyframes work-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}
button.msg-link { border: 0; cursor: pointer; font-family: inherit; }
button.msg-link:disabled { opacity: .5; cursor: not-allowed; }
.msg-links { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.msg-link { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: #eaf1ff; color: var(--brand-dark); }
.msg-link:hover { text-decoration: none; background: #dbe8ff; }
.chat-quick { display: flex; gap: 6px; padding: 8px 12px; flex-wrap: wrap; border-top: 1px solid var(--line); background: #fff; }
.chat-quick button {
  border: 1px solid var(--line); background: #f8faff; color: var(--muted);
  border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.chat-quick button:hover { color: var(--brand-dark); border-color: #c7dbff; }
/* 拖拽文件到对话区时的高亮 */
#chat-body.drop-active {
  outline: 2px dashed var(--brand);
  outline-offset: -6px;
  background: #f4f8ff;
  border-radius: 12px;
}
/* 输入区：一整颗圆润胶囊，加号在左、发送在右 */
.chat-form {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 12px 12px; padding: 7px 7px 7px 8px;
  border: 1px solid #e9ecf1; border-radius: 999px; background: #f7f8fa;
  box-shadow: none;
}
.chat-form:focus-within {
  background: #fff; border-color: #d9e2f2;
  box-shadow: 0 4px 16px rgba(37, 99, 235, .10);
}
.chat-form input {
  flex: 1; min-width: 0; padding: 8px 6px; border: 0; outline: none;
  background: transparent; font-size: 14px;
}
.chat-form button {
  border: 0; border-radius: 999px; padding: 8px 16px; background: var(--brand);
  color: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.chat-form button:disabled { opacity: .5; cursor: not-allowed; }
.chat-form .attach-btn {
  width: 38px; height: 38px; padding: 0; flex: none; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink);
  font-size: 24px; line-height: 1; font-weight: 300;
}
.chat-form .attach-btn:hover { background: #eef4ff; color: var(--brand); }
.chat-form .send-btn {
  width: 38px; height: 38px; padding: 0; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; line-height: 1;
}
.attach-list:empty { display: none; }
.attach-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 0; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 999px; background: #eef4ff; color: var(--brand-dark); font-size: 12px;
}
.attach-chip button {
  border: 0; background: none; color: inherit; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0;
}
.msg.user .attach-inline { margin-top: 6px; font-size: 11.5px; opacity: .9; }

/* 添加附件：手机从底部弹起，桌面居中，不再直接甩出系统文件框 */
.sheet-mask {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(15, 23, 42, .38); animation: mask-in .18s ease;
}
.sheet-mask[hidden] { display: none; }
.sheet {
  width: 100%; max-width: 460px; background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 8px 14px calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 32px rgba(15, 23, 42, .18);
  animation: sheet-up .24s cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 821px) {
  .sheet-mask { align-items: center; }
  .sheet { border-radius: 20px; margin: 0 16px; padding-bottom: 14px; }
}
.sheet-handle {
  width: 38px; height: 4px; border-radius: 999px;
  background: #e2e7ef; margin: 6px auto 10px;
}
.sheet-title {
  font-size: 13px; color: var(--muted);
  text-align: center; margin-bottom: 4px;
}
.sheet-item {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 11px 8px; border: 0; border-radius: 14px;
  background: transparent; text-align: left; cursor: pointer;
  font-family: inherit;
}
.sheet-item:hover, .sheet-item:active { background: #f5f8fd; }
.sheet-ic {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #eef4ff; color: var(--brand);
}
.sheet-text b { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.sheet-text small {
  display: block; margin-top: 2px; font-size: 12px;
  color: var(--muted); white-space: normal;
}
.sheet-hint {
  margin: 6px 8px 0; font-size: 11.5px; line-height: 1.5;
  color: var(--muted); text-align: center; white-space: normal;
}
.sheet-cancel {
  width: 100%; margin-top: 8px; padding: 13px; border: 0;
  border-radius: 14px; background: #f4f6f9; color: var(--ink);
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
}
body.sheet-open { overflow: hidden; }
@keyframes sheet-up {
  from { transform: translateY(18px); opacity: .6; }
  to { transform: none; opacity: 1; }
}
@keyframes mask-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 520px) {
  .chat-panel { right: 8px; left: 8px; width: auto; bottom: 8px; height: 78vh; }
  .chat-fab { right: 14px; bottom: 14px; }
}

/* 工作台双栏：左边对话，右边 SOP 结果；整页固定，只在各自区域内滚动 */
body.fixed-page { height: 100vh; overflow: hidden; }
body.fixed-page .shell {
  height: calc(100vh - 60px);
  max-width: none;
  padding: 14px 14px;
  box-sizing: border-box;
}
.split {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(0, 1.3fr);
  gap: 14px;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}
.pane-chat { display: flex; flex-direction: column; margin-bottom: 0; min-height: 0; overflow: hidden; }
.pane-chat .chat-inline {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
  margin-top: 10px; border: 0;
}
.pane-chat .chat-inline .chat-body {
  flex: 1; min-height: 0; height: auto; max-height: none;
  border: 1px solid var(--line); border-radius: 12px;
}
.pane-sop {
  display: flex; flex-direction: column; gap: 0;
  min-height: 0; overflow: hidden; padding-right: 4px;
}
.pane-sop .card { margin-bottom: 0; }
/* 右栏贴齐左栏底部：内容少时卡片内部留白，内容多时在卡片内滚动 */
.pane-sop .sop-pane { flex: 1; min-height: 0; }
#sop-output-card {
  flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
}
#sop-output { flex: 1; min-height: 0; overflow-y: auto; }
.sop { list-style: none; margin: 0; padding: 0; }
.sop-step { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.sop-step:last-child { border-bottom: 0; padding-bottom: 0; }
.sop-no {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: #eef2f8; color: var(--muted); font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.sop-step.done .sop-no { background: #e7f7ee; color: #067647; }
.sop-t { font-size: 13.5px; font-weight: 600; }
.sop-d { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.6; }
.result-list { display: flex; flex-direction: column; }
.result-row {
  display: flex; gap: 8px; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px dashed var(--line); color: var(--ink);
}
.result-row:last-child { border-bottom: 0; }
.result-row:hover { text-decoration: none; color: var(--brand-dark); }
.result-t { font-size: 13px; line-height: 1.45; }
.out-block { margin-bottom: 12px; }
.out-title { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.out-link {
  display: block; padding: 9px 11px; margin-bottom: 8px;
  background: #eaf1ff; border-radius: 8px; font-size: 13px; color: var(--brand-dark);
}
.out-link:hover { text-decoration: none; background: #dbe8ff; }
.out-article-title { margin: 0 0 10px; font-size: 17px; line-height: 1.45; }
.out-tabs { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.out-tab {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 4px 12px; font-size: 12px; cursor: pointer; color: var(--muted);
}
.out-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.out-article-body {
  max-height: none; overflow: visible; padding: 12px 2px 4px;
  border-top: 1px solid var(--line);
  font-size: 13px; line-height: 1.75;
}
.out-article-body .md-h { font-weight: 600; margin: 10px 0 4px; font-size: 14px; }
.out-article-body .md-p { margin: 0 0 6px; }
.out-article-body .md-gap { height: 6px; }
.out-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.out-hint { margin-top: 12px; font-size: 12px; color: var(--muted); }
.video-flow { padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; }
.article-collapsed-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; margin-bottom: 10px;
  background: #f8faff; border: 1px solid var(--line); border-radius: 9px;
}
.vf-label { font-size: 12px; font-weight: 600; color: var(--muted); margin: 10px 0 6px; }
.vf-loading-text { font-size: 13px; color: var(--muted); }
.vf-progress {
  height: 4px; margin-top: 10px; overflow: hidden;
  background: #eef2f8; border-radius: 999px;
}
.vf-progress-bar {
  width: 38%; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #60a5fa);
  animation: vf-slide 1.3s ease-in-out infinite;
}
.vf-status { margin-top: 8px; font-size: 12px; color: var(--muted); }
.voice-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.voice-card {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px;
}
.voice-card.chosen { border-color: var(--brand); background: #f5f9ff; }
.voice-name { font-size: 13px; font-weight: 600; min-width: 120px; }
.voice-card audio { height: 32px; max-width: 260px; }
.mat-row { padding: 9px 0; border-bottom: 1px solid var(--line); }
.mat-shot { font-size: 12px; font-weight: 600; color: var(--muted); }
.mat-visual { font-size: 13px; margin: 3px 0; }
.mat-cur { font-size: 12px; color: var(--muted); }
.mat-picker { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.mat-muted { font-size: 12px; color: var(--muted); }
.shot-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.shot-card {
  width: 118px; padding: 5px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; display: flex; flex-direction: column; gap: 5px;
}
.shot-card.chosen { border-color: var(--brand); background: #f5f9ff; }
.shot-thumb {
  display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover;
  border-radius: 5px; background: #eef2f8; flex: 0 0 auto;
}
.shot-thumb-broken {
  font-size: 0; background: #eef2f8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='%23b9c4d4'%3E%3Cpath d='M4 6h24v20H4z' fill='none' stroke='%23b9c4d4' stroke-width='2'/%3E%3Cpath d='M7 22l6-7 4 4 3-3 5 6z'/%3E%3C/svg%3E") center no-repeat;
}
.shot-name {
  font-size: 11px; color: var(--muted); line-height: 1.3;
  height: 2.6em; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
/* 卡片高度一致，按钮统一贴底，不会高高低低 */
.shot-card .btn { margin-top: auto; width: 100%; }
@keyframes vf-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.vf-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 8px; }
.vf-step {
  flex: 0 0 auto; white-space: nowrap; cursor: pointer;
  font-family: inherit; font-size: 12px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; background: #fff;
}
.vf-step:disabled { opacity: .5; cursor: default; }
.vf-step.done { color: #15803d; border-color: #bbf7d0; background: #f0fdf4; }
.vf-step.active { color: #fff; background: var(--brand); border-color: var(--brand); }
.vf-effects-tab { border-style: dashed; }
.vf-select {
  width: 100%; max-width: 260px; padding: 7px 10px; font-size: 13px;
  color: var(--ink); background: #fff; border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer;
}
.fx-preview { margin-top: 10px; }
.fx-preview-video {
  display: block; width: 100%; max-width: 240px; border-radius: 10px;
  background: #000;
}
.vf-article { font-size: 13px; margin-bottom: 4px; }
.vf-note { font-size: 12px; color: var(--muted); }
.vf-content { margin-top: 10px; }
.vf-loading { font-size: 12px; color: var(--muted); padding: 8px 0; }
.vf-script {
  max-height: 300px; overflow: auto; font-size: 13px; line-height: 1.8;
  background: #fafbfc; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px;
}
.vf-table {
  width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.6;
  table-layout: fixed;
}
.vf-table th, .vf-table td {
  border: 1px solid var(--line); padding: 6px 8px; vertical-align: top;
  word-break: break-word;
}
.vf-table th { background: #f7f8fa; font-weight: 600; color: var(--muted); }
.vf-table th:nth-child(1), .vf-table td:nth-child(1) { width: 42px; text-align: center; }
.vf-table th:nth-child(2), .vf-table td:nth-child(2) { width: 52px; text-align: center; }
.vf-table th:nth-child(3), .vf-table td:nth-child(3) { width: 56px; }
.out-script { margin: 6px 0 8px; font-size: 12px; }
.out-script summary { cursor: pointer; color: var(--brand-dark); }
.out-script-body {
  margin-top: 6px; max-height: 240px; overflow: auto;
  border-left: 2px solid var(--line); padding-left: 10px;
}
.out-video { margin-top: 8px; font-size: 12px; color: var(--muted); }
.out-video-player {
  width: 100%; max-height: 380px; margin-top: 8px;
  border-radius: 8px; background: #000;
}
.material-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}
.material-item {
  position: relative; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; cursor: pointer; background: #f7f8fa;
}
.material-item img, .material-item video {
  width: 100%; height: 78px; object-fit: cover; display: block;
}
.material-doc {
  height: 78px; display: flex; align-items: center; justify-content: center;
  padding: 6px; font-size: 12px; color: var(--muted); text-align: center;
}
.material-name {
  padding: 4px 6px; font-size: 11px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.material-item.off { opacity: .4; }
.material-item .material-check {
  position: absolute; top: 4px; right: 4px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--brand); color: #fff;
  font-size: 11px; line-height: 16px; text-align: center;
}
.material-item.off .material-check { background: #b9bec9; }
.pane-sop .card { padding: 18px 20px; }
.status-line { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.status-line.ok { color: #15803d; }
.dot.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: .35 } 50% { opacity: 1 } }
.progress {
  height: 6px; background: #eef2f8; border-radius: 999px;
  margin: 10px 0 6px; overflow: hidden;
}
.progress i {
  display: block; height: 100%; background: var(--brand);
  border-radius: 999px; transition: width .4s ease;
}
.action-t { font-weight: 600; margin-bottom: 4px; }
.out-group { display: flex; flex-direction: column; gap: 8px; }
.out-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.out-k { width: 60px; color: #6b7280; }
.score-chip {
  padding: 2px 8px; border-radius: 999px; background: #eef4ff;
  color: var(--brand-dark); font-size: 12px;
}
.metric-row { display: flex; gap: 22px; align-items: baseline; }
.metric-row strong { font-size: 20px; }
.metric-row .up { color: #15803d; }
.metric-row .down { color: #b91c1c; }
@media (min-width: 1360px) {
  .pane-sop .topic-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .pane-sop .topic-item { margin-bottom: 0; }
}
/* 企业问卷 */
.onb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.onboarding-card h1 { margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  border: 1px solid #d8e0ec; border-radius: 999px; background: #fff;
  font-size: 13px; cursor: pointer;
}
.chip input { width: auto; margin: 0; }
.chip:has(input:checked) { border-color: var(--brand); background: #eef4ff; color: var(--brand-dark); }
a.chip { color: inherit; text-decoration: none; }
a.chip:hover { border-color: var(--brand); }
a.chip.active { border-color: var(--brand); background: #eef4ff; color: var(--brand-dark); font-weight: 600; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.files-search { display: flex; gap: 8px; margin-bottom: 14px; }
.files-search input[type="search"] { max-width: 320px; }
.row-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.onb-actions { display: flex; gap: 8px; margin-top: 6px; }
.onb-actions .btn { flex: 1; justify-content: center; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 工作区：单列滚动，不再分页 */
.sop-pane { display: flex; flex-direction: column; gap: 18px; }
.sop-pane[hidden] { display: none; }
.pane-sop > .card { flex: none; }

/* 案例文件上传 */
.upload-block { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.upload-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.file-list { list-style: none; padding: 0; margin: 0 0 12px; }
.file-list li {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 6px; background: #fbfcfe; font-size: 13px;
}
.file-list li a { flex: 1; min-width: 120px; word-break: break-all; }
.file-list form { margin: 0; }
.upload-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upload-form input[type=file] { flex: 1; min-width: 180px; font-size: 13px; }
.upload-note {
  flex: 1; min-width: 160px; padding: 8px 10px; border: 1px solid #d8e0ec;
  border-radius: 10px; font-size: 13px;
}
.file-group { margin-bottom: 10px; }
.file-cat {
  font-size: 12px; font-weight: 600; color: var(--brand-dark);
  margin: 8px 0 6px;
}
/* 文稿质量反馈 */
.feedback-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 0 2px; border-top: 1px dashed var(--line); margin-top: 10px;
}
.feedback-row form { margin: 0; display: flex; align-items: center; gap: 6px; flex: none; }
.feedback-row input[type=text] {
  padding: 7px 10px; border: 1px solid #d8e0ec; border-radius: 9px;
  font-size: 12.5px; min-width: 130px;
}

/* 进度跟踪 */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 4px; font-size: 24px; }
.timeline { list-style: none; padding: 0; margin: 12px 0 0; }
.tl-item { display: flex; gap: 12px; padding: 8px 0; position: relative; }
.tl-item::before {
  content: ''; position: absolute; left: 7px; top: 26px; bottom: -6px;
  width: 2px; background: var(--line);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid #cbd5e4;
  background: #fff; flex: none; margin-top: 2px; z-index: 1;
}
.tl-item.done .tl-dot { background: #22a06b; border-color: #22a06b; }
.tl-item.running .tl-dot {
  background: #2a6fdb; border-color: #2a6fdb;
  box-shadow: 0 0 0 4px rgba(42, 111, 219, .15);
}
.tl-item.error .tl-dot { background: #d64545; border-color: #d64545; }
.tl-title {
  font-weight: 600; font-size: 13.5px; display: flex; gap: 6px;
  align-items: center; flex-wrap: wrap;
}
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-item {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; background: #fbfcfe;
}
.task-item summary {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; cursor: pointer;
}
.task-goal { flex: 1; min-width: 180px; font-weight: 500; font-size: 13.5px; }
.task-item .timeline { margin-left: 4px; }

/* 账户管理 */
.account-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.account-head h1 { margin: 0 0 4px; font-size: 22px; }
.account-tabs { display: flex; gap: 6px; margin: 16px 0; flex-wrap: wrap; }
.account-tabs a {
  padding: 8px 14px; border-radius: 10px; background: #eef2f8;
  color: var(--muted); font-size: 13.5px;
}
.account-tabs a.active { background: var(--brand); color: #fff; }
.table-wrap { overflow-x: auto; }
.inline-form { margin: 0; }
.inline-form select {
  padding: 6px 8px; border: 1px solid #d8e0ec; border-radius: 8px; font-size: 12.5px;
}
.member-add { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.member-form { display: flex; gap: 8px; flex-wrap: wrap; }
.member-form input, .member-form select {
  padding: 9px 10px; border: 1px solid #d8e0ec; border-radius: 9px;
  font-size: 13px; flex: 1; min-width: 140px;
}
.member-form .btn { flex: none; }

.mobile-only { display: none; }
.chat-head-actions { display: flex; align-items: center; gap: 8px; }
.pane-sop-bar { display: none; }

@media (max-width: 820px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric .lbl { white-space: nowrap; }
  .account-table thead { display: none; }
  .account-table tr {
    display: block; padding: 12px 0 10px;
    border-bottom: 1px solid var(--line);
  }
  .account-table td { display: block; border: 0; padding: 2px 0; }
  .account-table td:nth-child(2) { margin-top: 6px; }
  .account-table td:nth-child(3) { font-size: 12px; color: var(--muted); }
  .account-table td:nth-child(4) { margin-top: 4px; }
  .account-head h1 { font-size: 19px; }
  /* 手机端：单列对话；右侧工作区变成全屏滑出面板，避免一屏堆满卡片 */
  body.fixed-page { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
  body.panel-open { overflow: hidden; }
  body.fixed-page .topbar { flex: none; position: static; }
  body.fixed-page .shell {
    flex: 1; min-height: 0; height: auto; overflow: hidden;
    display: flex; flex-direction: column; padding: 10px 10px 0;
  }
  .split { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .pane-chat { flex: 1; height: auto; min-height: 0; }
  .pane-chat .chat-inline { flex: 1; min-height: 0; margin-top: 8px; }
  .pane-chat .chat-inline .chat-body { flex: 1; min-height: 0; height: auto; max-height: none; }
  /* 手机端不要标题块，整屏从对话开始 */
  .pane-chat .card-head { display: none; }
  .pane-chat .chat-inline { margin-top: 0; }
  /* 手机端不要导航栏，整屏都留给对话 */
  .nav { display: none; }
  .topbar { padding: 8px 12px; }
  body.fixed-page { background: #fff; }
  body.fixed-page .shell { padding: 6px 12px 0; }
  .pane-chat { background: transparent; border: 0; box-shadow: none; }
  .pane-chat .chat-inline { border: 0; border-radius: 0; background: transparent; }
  .pane-chat .chat-inline .chat-body {
    background: #fff; padding: 8px 2px 4px;
  }
  .chat-quick { border-top: 0; background: transparent; padding: 6px 0; }
  .bubble { max-width: 92%; }
  .pane-chat .card-head p { display: none; }
  #chat-mode { display: none; }
  .chat-quick { flex-wrap: nowrap; overflow-x: auto; }
  .chat-form {
    flex: none; margin: 8px 0 calc(8px + env(safe-area-inset-bottom));
    padding: 6px 6px 6px 8px; border-radius: 999px;
  }
  .chat-form input { font-size: 16px; padding: 9px 2px; }
  .chat-form .send-btn { width: 40px; height: 40px; font-size: 20px; }
  .chat-form .attach-btn { width: 38px; height: 38px; font-size: 22px; }
  .attach-list { padding: 8px 2px 0; }
  .mobile-only { display: none; }

  /* 手机端只有一个对话流：不再滑出右侧工作区，结果直接内联在对话里 */
  .pane-sop, .pane-sop-bar { display: none; }
  body.panel-open { overflow: auto; }
  .msg.assistant .bubble.inline-result {
    max-width: 100%; width: 100%; padding: 12px 0; background: #fff;
  }
  .bubble.inline-result .out-article-body { max-height: none; }
}

/* 数据看板图示：所有条形长度都由同一条记录集算出的比例决定 */
.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-row {
  display: grid; grid-template-columns: 84px 1fr auto; gap: 10px; align-items: center;
}
.bar-name {
  font-size: 13px; color: var(--ink); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.bar-track { height: 10px; background: #eef2f8; border-radius: 999px; overflow: hidden; }
.bar-fill {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}
.bar-fill.muted { background: linear-gradient(90deg, #b6c2d4, #d3dbe8); }
.bar-fill.warn { background: linear-gradient(90deg, #d98324, #f5b45c); }
.bar-fill.ok { background: linear-gradient(90deg, #0f9d70, #4ecfa6); }
.bar-val {
  font-size: 12px; color: var(--muted); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chart-note { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

.trend { display: flex; align-items: flex-end; gap: 8px; height: 150px; margin-top: 4px; }
.trend-col {
  flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column;
  justify-content: flex-end; align-items: center; gap: 4px;
}
.trend-v { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.trend-bar {
  width: 100%; max-width: 42px; min-height: 3px; border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}
.trend-bar.empty { background: #e6ebf2; }
.trend-day { font-size: 11px; color: var(--muted); white-space: nowrap; }

.quality { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.donut {
  --pct: 0;
  width: 132px; height: 132px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--ok) calc(var(--pct) * 1%), #eef2f8 0);
  display: flex; align-items: center; justify-content: center;
}
.donut-in {
  width: 96px; height: 96px; border-radius: 50%; background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px var(--line);
}
.donut-in strong { font-size: 22px; line-height: 1.2; }
.quality-facts { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 180px; }
.quality-fact { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.quality-fact b { font-variant-numeric: tabular-nums; }

@media (max-width: 820px) {
  .bar-row { grid-template-columns: 68px 1fr auto; gap: 8px; }
  .bar-val { font-size: 11px; }
  .trend { gap: 4px; height: 120px; }
  .quality { gap: 16px; }
}

/* 文风复刻：文风卡 */
.style-card {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; background: #fbfcfe;
}
.style-details { margin: 6px 0 2px; }
.style-details summary { cursor: pointer; }
.style-profile {
  list-style: none; padding: 6px 0 0; margin: 0;
  font-size: 12.5px; color: var(--muted); line-height: 1.7;
}
.style-profile b { color: var(--ink); font-weight: 600; }
