/* ============================================================================
   DoSight · 排版与细节打磨（蓝色体系内的优化，不换视觉语言）
   目标：同一套蓝，靠字阶、字距、行高、间距节奏、边框层级把「模板感」压下去。
   只覆盖样式，不动结构与交互。删掉 index.html 里那行 <link href="/polish.css">
   即回到打磨前的样子。
   ========================================================================= */

:root {
  --page-bg: #f5f7fb;      /* 与 body / .workspace 的底色一致，悬浮输入区要用 */
  --p-line: #dfe6f3;
  --p-line-soft: #edf1f8;
  --p-ink: #0d1626;
  --p-ink-2: #27354d;
  --p-ink-3: #566179;
  --p-ink-4: #838da3;
  --p-brand: #2563eb;
  --p-brand-deep: #1d4ed8;
  --p-brand-soft: #eaf0fe;

  /* 统一行高与圆角节奏 */
  --p-r-lg: 14px;
  --p-r-md: 10px;
  --p-r-sm: 7px;
}

body {
  color: var(--p-ink-2);
  font-feature-settings: "tnum" 1, "cv11" 1;
  letter-spacing: -0.003em;
}

/* 数字一律等宽，避免表格里跳位 */
td, .stat-number, strong, .ws-starter-no, .ws-conv-id small,
.file-name small, .side-version, .ws-count, .copy-content {
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- 字阶
   只有五级：30 / 17 / 14 / 12.5 / 11。之前 12–30 之间塞了太多档，
   每块都在自己说话，整体就吵。 */
h1 {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.032em;
  line-height: 1.18;
  color: var(--p-ink);
}
h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.4;
  color: var(--p-ink);
}
h3 {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--p-ink);
}
p { line-height: 1.72; }
small { font-size: 11px; }

.eyebrow,
.ws-eyebrow {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--p-ink-4);
}

/* ---------------------------------------------------------------- 页头
   标题与副标题之间用 6px，页头与内容之间用 22px，去掉多余的居中/拉伸 */
.page-heading,
.ws-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 16px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--p-line);
}
.ws-top h1,
.page-heading h1 { margin: 7px 0 5px; }
.ws-top p,
.page-heading p {
  margin: 0;
  font-size: 12px;
  color: var(--p-ink-4);
  max-width: 620px;
}

/* ---------------------------------------------------------------- 卡片
   一个页面里只保留两级：面板（有边框）与分区（无边框、靠间距）。 */
.panel {
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-lg);
  box-shadow: 0 1px 2px rgba(13, 22, 38, 0.03);
  background: #fff;
}
.panel-heading {
  padding: 15px 18px;
  border-bottom: 1px solid var(--p-line-soft);
}
.panel-heading h2 { font-size: 13.5px; }
.panel-heading small { font-size: 10.5px; color: var(--p-ink-4); }

/* ---------------------------------------------------------------- 按钮 */
.btn {
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-sm);
  background: #fff;
  color: var(--p-ink-2);
  font-size: 12px;
  font-weight: 550;
  padding: 7px 13px;
  letter-spacing: -0.005em;
}
.btn:hover:not(:disabled) {
  background: #f7f9fd;
  border-color: #cfd9ea;
  color: var(--p-ink);
}
/* 主按钮：与左侧选中态同一支墨蓝（#30496C），亮蓝留给链接和强调点。
   保留一点上浅下深的体积感，但去掉蓝色外发光——那个才是「AI 感」的来源。 */
.btn.primary {
  background: linear-gradient(180deg, #37527a 0%, #2b4463 100%);
  border-color: #253a54;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 1px 2px rgba(12, 24, 40, 0.22);
}
.btn.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #3d5a86 0%, #304b6d 100%);
  border-color: #253a54;
  /* 上面的 .btn:hover 统一把字色压成深色，主按钮蓝底上会变黑字——
     这里必须显式拿回白色，否则悬停瞬间像被禁用。 */
  color: #fff;
}
.btn.subtle {
  border-color: transparent;
  background: transparent;
  color: var(--p-ink-3);
}
.btn.subtle:hover:not(:disabled) { background: var(--p-brand-soft); color: var(--p-brand-deep); }
.btn.small { font-size: 11.5px; padding: 5px 10px; }

/* ---------------------------------------------------------------- 表格 */
th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--p-ink-4);
  text-transform: uppercase;
  padding: 11px 15px;
  background: #fbfcfe;
  border-bottom: 1px solid var(--p-line);
}
td {
  font-size: 12px;
  padding: 14px 15px;
  border-bottom: 1px solid var(--p-line-soft);
  color: var(--p-ink-2);
}
tr:hover td { background: #fafcff; }
td strong { font-weight: 600; color: var(--p-ink); }
.cell-sub { font-size: 10.5px; color: var(--p-ink-4); margin-top: 3px; }

/* ---------------------------------------------------------------- 表单 */
.field > span {
  font-size: 11.5px;
  font-weight: 550;
  color: var(--p-ink-3);
}
.field input,
.field select,
.field textarea,
.search,
.inline-input {
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-sm);
  background: #fff;
  font-size: 12.5px;
  padding: 9px 11px;
  min-height: 38px;
  color: var(--p-ink);
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.search:focus,
.inline-input:focus {
  border-color: var(--p-brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ---------------------------------------------------------------- 标记 */
.badge {
  border-radius: 5px;
  font-size: 10px;
  font-weight: 550;
  letter-spacing: 0.01em;
  padding: 2px 7px;
}
.notice {
  border-radius: var(--p-r-md);
  font-size: 11.5px;
  line-height: 1.75;
}

/* ---------------------------------------------------------------- 工作台 */
.ws-grid { gap: 16px; }
.ws-conv {
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-lg);
  box-shadow: 0 1px 2px rgba(13, 22, 38, 0.03);
}
.ws-conv-head { padding: 13px 18px; border-bottom: 1px solid var(--p-line-soft); }
.ws-conv-id h2 { font-size: 13px; font-weight: 600; }
.ws-conv-id small { font-size: 10.5px; color: var(--p-ink-4); }
.ws-conv-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--p-brand-soft);
  color: var(--p-brand-deep);
  font-size: 12px;
}
.ws-mode select { font-size: 11.5px; padding: 5px 24px 5px 9px; }
.ws-text-btn { font-size: 11.5px; color: var(--p-ink-3); }
.ws-text-btn:hover:not(:disabled) { background: var(--p-brand-soft); color: var(--p-brand-deep); }

.ws-hint {
  padding: 8px 18px;
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--p-ink-4);
  background: #f8fafd;
  border-bottom: 1px solid var(--p-line-soft);
}

/* 空态：标题压到 20px，说明压到 11.5px，卡片保持 12px 圆角 */
.ws-empty-head h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.026em;
  margin-bottom: 6px;
}
.ws-empty-head p { font-size: 11.5px; color: var(--p-ink-4); margin-bottom: 16px; max-width: 470px; }
.ws-starter {
  border-radius: 12px;
  border-color: var(--p-line);
  background: #fcfdff;
  padding: 13px 13px 14px;
}
.ws-starter:hover:not(:disabled) {
  background: #fff;
  border-color: var(--p-brand);
  box-shadow: 0 6px 16px -12px rgba(37, 99, 235, 0.45);
}
.ws-starter-no { font-size: 10px; letter-spacing: 0.1em; color: var(--p-ink-4); font-weight: 600; }
.ws-starter-label { font-size: 12.5px; font-weight: 600; color: var(--p-ink); }
.ws-starter-q { font-size: 10.5px; color: var(--p-ink-4); line-height: 1.62; }

/* 输入区：蓝色发送，focus 只留一圈蓝 */
.ws-composer { padding: 13px 16px 14px; background: linear-gradient(180deg, #fcfdff, #f8fafd); }
.ws-composer textarea {
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-md);
  font-size: 12.5px;
  line-height: 1.72;
  padding: 10px 12px;
  min-height: 58px;
}
.ws-composer textarea:focus {
  border-color: var(--p-brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.ws-chip {
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-sm);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--p-ink-3);
  padding: 5px 9px;
}
.ws-chip:hover:not(:disabled) { border-color: #cfd9ea; color: var(--p-ink); background: #fff; }
.ws-hintline { font-size: 10px; color: var(--p-ink-4); }
.ws-send {
  background: var(--p-brand);
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 550;
  padding: 8px 16px;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.24);
}
.ws-send:hover:not(:disabled) { background: var(--p-brand-deep); }
.ws-send:disabled { box-shadow: none; }

/* 右栏：不用卡片也不用竖线，只靠留白与主画布分开 */
.ws-rail { border-left: 0; padding-left: 0; }
.ws-rail-head h2 { font-size: 12.5px; font-weight: 600; }
.ws-count { font-size: 10px; background: var(--p-brand-soft); color: var(--p-brand-deep); }
.ws-rail-sub { font-size: 10.5px; color: var(--p-ink-4); line-height: 1.7; }
/* 空态只留一圈虚线，不再填白：底部那排「可以先准备」去掉后，它一个人立在右栏，
   带底板会显得像一张空卡片悬在那里。 */
.ws-rail-empty {
  margin: 0;
  border: 1px dashed var(--p-line);
  border-radius: 12px;
  background: transparent;
}
.ws-rail-empty b { font-size: 11px; font-weight: 550; color: var(--p-ink-3); }
.ws-rail-empty p { font-size: 10px; color: var(--p-ink-4); }

/* 消息：头像用蓝、正文行高 1.85、去掉多余的描边 */
.ws-conv .message-avatar {
  border-radius: 8px;
  font-size: 11px;
  background: var(--p-brand-soft);
  border: 1px solid #dbe6fb;
  color: var(--p-brand-deep);
}
.ws-conv .from-user .message-avatar { background: #f1f3f8; border-color: var(--p-line); color: var(--p-ink-4); }
.ws-conv .message-meta b { font-size: 11px; font-weight: 600; color: var(--p-ink-2); }
.ws-conv .message-meta span { font-size: 10px; color: var(--p-ink-4); }
.ws-conv .message-text { font-size: 12.5px; line-height: 1.85; }
.ws-conv .from-user .message-text {
  background: #f6f9fe;
  border: 1px solid var(--p-line-soft);
  border-radius: 2px 12px 12px 12px;
}

/* ---------------------------------------------------------------- 数据卡 */
.stat {
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-lg);
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(13, 22, 38, 0.03);
}
.stat-label { font-size: 11px; color: var(--p-ink-4); }
.stat-number { font-size: 27px; font-weight: 600; letter-spacing: -0.035em; color: var(--p-ink); }
.stat-number span { font-size: 10.5px; font-weight: 500; color: var(--p-ink-4); }

.footer-note { font-size: 10.5px; color: var(--p-ink-4); border-top: 1px solid var(--p-line-soft); padding-top: 14px; }

/* 弹窗与提示 */
dialog { border-radius: var(--p-r-lg); border: 1px solid var(--p-line); }
.modal-heading h2 { font-size: 17px; }
.toast {
  border-radius: var(--p-r-md);
  font-size: 11.5px;
  background: #0f1a2c;
  color: #eaf0fe;
  border: 0;
}
.toast.error-toast { background: #8f2b22; color: #fff; }

/* 计算器：跟其它页同一套字阶 */
.calc-field > span { font-size: 11.5px; }
.calc-suffix { font-size: 10px; color: var(--p-ink-4); }
.calc-hint { font-size: 10px; color: var(--p-ink-4); }
.calc-chip { border-radius: var(--p-r-sm); font-size: 11px; }
.calc-hero-main strong { letter-spacing: -0.035em; }

/* ---------------------------------------------------------------- 收尾微调
   1) 去掉顶部的蓝色光晕（最典型的「AI 渐变」痕迹）
   2) 底色收一档，让白卡片真正浮起来
   3) 侧栏选中态用蓝，不再用灰白
   4) 输入区去渐变，改纯色；卡片高度收紧 */
/* ---------------------------------------------------------------- 全站顶部晕染
   原来只在毛利计算页铺的那层蓝青雾，现在提到 .main-content 上，所有窗口共用。
   三个要点（跟计算页那版同源）：
   · 只用径向渐变，不放纯色底衬——否则会出现带直角的矩形；
   · 在 y=76（顶栏下沿）处透明度必须为 0：线性 mask 从 13% 起色，此时正好过了这条线，
     否则接缝两侧有 1–2 个色阶差，整幅宽的一条直线会被眼睛放大；
   · 线性 mask 收上下 + 径向 mask 收左右，两张取交集，四条边才不会硬切。 */
.main-content { position: relative; isolation: isolate; }
.main-content::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -76px;
  /* 高度按窗口走，不再写死 880px：写死会让伪元素比页面还高，
     把 .workspace 的滚动区撑出一大截空白（表现为「能往上滚但什么都没有」）。 */
  height: 100vh;
  height: 100dvh;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(70% 58% at 6% 48%, rgba(37, 99, 235, 0.3), rgba(37, 99, 235, 0) 70%),
    radial-gradient(62% 52% at 28% 40%, rgba(56, 189, 248, 0.24), rgba(56, 189, 248, 0) 72%),
    radial-gradient(58% 50% at 50% 52%, rgba(129, 140, 248, 0.18), rgba(129, 140, 248, 0) 74%),
    radial-gradient(56% 48% at 72% 38%, rgba(14, 165, 233, 0.2), rgba(14, 165, 233, 0) 76%),
    radial-gradient(64% 54% at 96% 50%, rgba(37, 99, 235, 0.18), rgba(37, 99, 235, 0) 78%);
  filter: blur(90px) saturate(104%);
  -webkit-mask-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, #000 9%, #000 91%, rgba(0, 0, 0, 0) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 15%, rgba(0, 0, 0, 0.45) 24%, #000 42%, rgba(0, 0, 0, 0.45) 74%, rgba(0, 0, 0, 0) 92%),
    radial-gradient(150% 125% at 50% 42%, #000 24%, rgba(0, 0, 0, 0.45) 64%, transparent 90%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, #000 9%, #000 91%, rgba(0, 0, 0, 0) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 15%, rgba(0, 0, 0, 0.45) 24%, #000 42%, rgba(0, 0, 0, 0.45) 74%, rgba(0, 0, 0, 0) 92%),
    radial-gradient(150% 125% at 50% 42%, #000 24%, rgba(0, 0, 0, 0.45) 64%, transparent 90%);
  mask-composite: intersect;
}

body { background: #f5f7fb; background-image: none; }
.workspace { background: #f5f7fb; }

.sidebar .nav-item.active {
  background: rgba(37, 99, 235, 0.16);
  color: #fff;
}
.sidebar .nav-item.active::before { background: #60a5fa; box-shadow: none; }
.sidebar .nav-item.active .nav-symbol { color: #93c5fd; }
.conversation-item.selected {
  background: rgba(37, 99, 235, 0.18);
  box-shadow: none;
}

.ws-composer { background: #fbfcfe; }
.ws-conv { min-height: 530px; }
.ws-rail { min-height: 530px; }

.ws-rail-head { flex-direction: row; align-items: center; }
.ws-rail-head h2 { font-size: 12.5px; }
.ws-count {
  font-size: 9.5px;
  font-weight: 600;
  padding: 0 6px;
  border-radius: 4px;
  line-height: 17px;
}

/* 计算器顶部那条说明与按钮，间距对齐工作台 */
.calc-panel-note { font-size: 10.5px; color: var(--p-ink-4); }

/* 移动端：竖向排列时必须左对齐，否则会被 align-items:flex-end 推到右边并撑破视口 */
@media (max-width: 760px) {
  .ws-top,
  .page-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 18px;
  }
  .ws-pill { margin-bottom: 0; }
  .ws-top h1,
  .page-heading h1 { font-size: 26px; }
}

/* ---------------------------------------------------------------- 栅格防溢出
   grid 子项默认 min-width:auto：侧栏里一排 nowrap 的导航项会把整条轨道撑到
   600px 以上，导致窄屏整页横向溢出。历史教训，这里统一钉死。 */
.shell,
.workspace,
.main-content,
.sidebar,
.ws-grid,
.ws-conv,
.ws-rail,
.ws-empty,
.ws-starters {
  min-width: 0;
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { width: auto; }
  .nav { min-width: 0; }
  .conversation-list { min-width: 0; }
}

/* ---------------------------------------------------------------- 去掉页头英文小标签
   形如 BUSINESS WORKSPACE / UNIT ECONOMICS / REPORTS & INSIGHTS 的那行。
   这些都是「模板化」的痕迹：中文标题上面再压一行大写字距英文，信息量为零。
   只隐藏「页头里的」，登录页品牌文案（.story-body .eyebrow）与账户页的
   分区标签（.service-card .eyebrow）保留。 */
.page-heading .eyebrow,
.ws-eyebrow { display: none; }

/* 少了这一行，标题上边距收到 0，靠页头内边距控制节奏 */
.page-heading h1,
.ws-top h1 { margin-top: 0; }

/* ---------------------------------------------------------------- 页头副标题也去掉
   标题下那行说明（「整理经营问题，让每一份资料都有迹可循。」这类）。
   去掉后页头只剩标题本身，右侧仍保留操作按钮。 */
.page-heading p,
.ws-top p { display: none; }

.page-heading h1,
.ws-top h1 { margin-bottom: 0; }

/* 副标题没了，页头不需要那么高的下内边距 */
.page-heading,
.ws-top { padding-bottom: 14px; }

/* ---------------------------------------------------------------- 页头整块去掉
   页面名称已经在顶栏面包屑里（深圳跨境优选 / 经营工作台），正文再放一个大标题
   是重复的。这里把标题块整个拿掉，只留右上角的功能按钮。
   - 工作台那块只有装饰性的「对话与资料」标签，连整块一起收掉
   - 其它页保留右侧按钮/状态，做成一条紧凑工具行 */
.ws-top { display: none; }

.page-heading {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0 0 14px;
  border-bottom: 0;
}
.page-heading > div:first-child { display: none; }

/* ---------------------------------------------------------------- 输入区（圆角矩形）
   参考形态：整块是一个圆角矩形，里面上方是输入区，下方一排是
   ＋（上传）· 模型选择 · 发送（圆形箭头）。 */
.ws-composer {
  padding: 12px 14px 10px;
  background: none;
  border-top: 1px solid var(--p-line-soft);
}
.ws-box {
  border: 1px solid var(--p-line);
  border-radius: 18px;
  background: #fff;
  padding: 9px 11px 7px;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.ws-box:focus-within {
  border-color: var(--p-brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.ws-box textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  max-height: 180px;
  padding: 3px 4px 7px;
  border: 0 !important;
  border-radius: 0;
  background: transparent;
  box-shadow: none !important;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--p-ink);
  resize: none;
}
.ws-box textarea::placeholder { color: var(--p-ink-4); }
.ws-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ws-orb {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--p-line);
  border-radius: 50%;
  background: #fff;
  color: var(--p-ink-3);
  font: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease);
}
.ws-orb:hover:not(:disabled) { background: #f5f8fd; border-color: #cfd9ea; color: var(--p-ink); }
.ws-orb:disabled { opacity: 0.45; cursor: not-allowed; }

.ws-model-wrap { position: relative; flex-shrink: 0; }
.ws-model {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--p-ink-3);
  font: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
}
.ws-model:hover:not(:disabled) { background: #f3f7fd; color: var(--p-ink); }
.ws-model i { font-style: normal; font-size: 10px; color: var(--p-ink-4); }
.ws-model-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 20;
  min-width: 232px;
  padding: 5px;
  border: 1px solid var(--p-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 44px -22px rgba(13, 22, 38, 0.5);
}
.ws-model-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.ws-model-item span { font-size: 12px; color: var(--p-ink); }
.ws-model-item em { font-style: normal; font-size: 10px; color: var(--p-ink-4); }
.ws-model-item:hover { background: #f5f8fd; }
.ws-model-item.on { background: var(--p-brand-soft); }
.ws-model-item.on span { color: var(--p-brand-deep); font-weight: 600; }

.ws-send {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--p-brand);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.ws-send:hover:not(:disabled) { background: var(--p-brand-deep); }
.ws-send:disabled { background: #c8d5ee; cursor: not-allowed; }

@media (max-width: 720px) {
  .ws-model-menu { min-width: 200px; }
}

/* 输入区不再单独画分割线，让圆角矩形自己浮在面板底部 */
.ws-composer { border-top: 0; padding-top: 4px; }

/* ---------------------------------------------------------------- 账户页 · 外观
   两张带缩略预览的选项卡，点一下即时切换，不需要保存按钮。 */
.theme-panel { padding: 22px 26px 24px; margin-top: 16px; }
.theme-panel h3 { margin-bottom: 3px; }
.theme-note { font-size: 11px; line-height: 1.7; color: var(--p-ink-4); margin: 0 0 15px; }
.theme-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--p-line);
  border-radius: 11px;
  background: var(--card);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.theme-choice:hover { border-color: #cfd9ea; }
.theme-choice.on { border-color: var(--p-brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.theme-choice-text { min-width: 0; }
.theme-choice-text b { display: block; font-size: 12.5px; font-weight: 600; color: var(--p-ink); }
.theme-choice-text small { display: block; margin-top: 2px; font-size: 10.5px; line-height: 1.5; color: var(--p-ink-4); }

/* 缩略预览：三根横线模拟「标题 / 正文 / 正文」，两套底色各画一遍 */
.theme-preview {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 34px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(13, 22, 38, 0.12);
}
.theme-preview i {
  position: absolute;
  left: 7px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.42;
}
.theme-preview i:nth-child(1) { top: 8px; width: 15px; opacity: 0.9; }
.theme-preview i:nth-child(2) { top: 16px; width: 30px; }
.theme-preview i:nth-child(3) { top: 23px; width: 23px; }
.theme-preview.light { background: linear-gradient(180deg, #f7f9fd, #eef2f9); color: #0d1626; }
.theme-preview.dark { background: linear-gradient(180deg, #151d29, #0d131c); color: #eef3fa; }
html[data-theme="dark"] .theme-preview { border-color: rgba(255, 255, 255, 0.14); }
html[data-theme="dark"] .theme-choice:hover { border-color: #3c4a5d; }

@media (max-width: 720px) {
  .theme-choices { grid-template-columns: 1fr; }
  .theme-panel { padding: 18px 20px 20px; }
}

/* ---------------------------------------------------------------- 工作台去掉外框
   原来整个对话区是一张带描边和圆角的卡片，视觉上像「里面又装了一个窗口」。
   现在直接坐在页面底色上：没有边框、没有底色、没有圆角，靠留白分栏。 */
.ws-grid { gap: 34px; }
.ws-conv { background: none; border: 0; border-radius: 0; }
.ws-conv-head { padding: 0 0 6px; }
.ws-conv-id { gap: 9px; }
.ws-conv-id h2 { font-size: 14px; }
.ws-conv-id small { color: var(--p-ink-4); }

/* ---------------------------------------------------------------- 左栏对话行
   每行 = 「打开对话」+ 悬停出现的铅笔。改名不再放在对话抬头里。 */
.conversation-row {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 7px;
}
.conversation-row .conversation-item { flex: 1 1 auto; min-width: 0; }
/* 底色挂到整行上（含右侧铅笔），否则高亮只包住文字、铅笔孤零零挂在外边 */
.conversation-row:hover { background: rgba(255, 255, 255, 0.05); }
.conversation-row.selected {
  background: rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.conversation-row:hover .conversation-item,
.conversation-row.selected .conversation-item {
  background: transparent;
  box-shadow: none;
  color: var(--night-text);
}
.conversation-row.selected .conversation-item { color: #fff; }
.conversation-rename {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-right: 1px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--night-faint);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s var(--ease), background 0.14s var(--ease), color 0.14s var(--ease);
}
.conversation-rename svg { width: 12px; height: 12px; }
.conversation-row:hover .conversation-rename,
.conversation-row.selected .conversation-rename,
.conversation-row:focus-within .conversation-rename { opacity: 1; pointer-events: auto; }
.conversation-rename:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); color: #fff; }
.conversation-rename:disabled { opacity: 0.25; cursor: not-allowed; }

@media (max-width: 760px) {
  /* 手机上没有 hover，也不适合每颗 chip 都挂一个铅笔（一排全是图标很乱）：
     只在当前打开的那条上显示，想改别的先点开再改。 */
  .conversation-row { flex: 0 0 auto; }
  .conversation-row .conversation-item { flex: 0 0 auto; }
  .conversation-rename { width: 20px; height: 20px; opacity: 0; pointer-events: none; }
  .conversation-row.selected .conversation-rename { opacity: 1; pointer-events: auto; }
}

/* theme.css 给 .chat-feed 铺了一层 --card-2，去掉外框后这层底色会露出一个方块 */
.ws-conv .chat-feed { background: none; }

/* 用户气泡不要拉满整行：满宽读起来像输入框，不像一句发言 */
.ws-conv .from-user .message-text {
  display: inline-block;
  max-width: min(100%, 78%);
  margin-left: 0;
}

/* ---------------------------------------------------------------- 资料栏改为按需展开
   默认收起（单列），点右上角那颗按钮才推出来；收起时对话区占满整行。 */
.ws-grid { grid-template-columns: minmax(0, 1fr); }
.ws-grid.with-rail { grid-template-columns: minmax(0, 1fr) 268px; }

.ws-rail-toggle-row {
  display: flex;
  justify-content: flex-end;
  padding: 0 0 4px;
}
.ws-rail-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 27px;
  padding: 0 9px 0 8px;
  border: 1px solid var(--p-line);
  border-radius: 8px;
  background: transparent;
  color: var(--p-ink-3);
  font: inherit;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease);
}
.ws-rail-toggle svg { width: 13px; height: 13px; opacity: 0.75; }
.ws-rail-toggle b {
  font-weight: 600;
  color: var(--p-ink-2);
  font-variant-numeric: tabular-nums;
}
.ws-rail-toggle i {
  font-style: normal;
  font-size: 9px;
  opacity: 0.55;
  transition: transform 0.15s var(--ease);
}
.ws-rail-toggle:hover { border-color: #cfd9ea; color: var(--p-ink); background: var(--card); }
.ws-rail-toggle.on {
  background: var(--p-brand-soft);
  border-color: #dbe6fb;
  color: var(--p-brand-deep);
}
.ws-rail-toggle.on b { color: var(--p-brand-deep); }
.ws-rail-toggle.on i { transform: rotate(180deg); }
.ws-rail-toggle:focus-visible { outline: 2px solid var(--p-brand); outline-offset: 2px; }

@media (max-width: 1180px) {
  /* 窄屏即使展开也不并排：资料栏落到对话下方 */
  .ws-grid,
  .ws-grid.with-rail { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- 发送键的状态切换
   同一个圆钮：空闲是 ↑，生成中变成停止方块（点了会真的停），上传/提交中转圈。 */
.ws-send.is-stop { background: var(--p-brand); }
.ws-send.is-stop:hover:not(:disabled) { background: #1d4ed8; }
.ws-stop-mark {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 2.5px;
  background: #fff;
}
.ws-send.is-busy { cursor: progress; }
.ws-spin {
  display: block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.6px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: ws-spin 0.7s linear infinite;
}
@keyframes ws-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ws-spin { animation-duration: 1.6s; }
}

/* ---------------------------------------------------------------- 对话左右分栏
   问答现在都挤在左边，扫读时分不清谁在说。改成：用户整行反向（头像在右、气泡贴右），
   AI 保持左侧；时间与署名默认藏起来，鼠标移到这条消息上才出现。 */
.ws-conv .message.from-user { flex-direction: row-reverse; }
.ws-conv .message.from-user .message-body {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.ws-conv .message.from-user .message-meta { justify-content: flex-end; }
.ws-conv .message.from-user .message-text {
  max-width: min(100%, 76%);
  /* 尖角朝右上，指向右侧头像，方向感与左栏的 AI 消息对称 */
  border-radius: 12px 2px 12px 12px;
}
.ws-conv .message.from-user .message-attachments { display: flex; flex-direction: column; align-items: flex-end; }

/* 时间 / 署名：默认不显示，悬停或聚焦这条消息才出现。
   用 visibility 而不是 display:none —— 高度保留，出现时消息不会上下跳。 */
.ws-conv .message-meta {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s var(--ease);
}
.ws-conv .message:hover .message-meta,
.ws-conv .message:focus-within .message-meta {
  opacity: 1;
  visibility: visible;
}
/* 触屏没有 hover，一直藏着就等于永远看不到时间 */
@media (hover: none) {
  .ws-conv .message-meta { opacity: 1; visibility: visible; }
}

/* 发送箭头：原来是「↑」字形，细线在中文字体里又轻又软。换成实心箭头，
   与停止方块同一种重量，两种状态切换时视觉不会跳。 */
.ws-send-arrow {
  display: block;
  width: 16px;
  height: 16px;
  fill: currentColor;
  /* 同一个颜色描一圈圆角接头：实心多边形的尖角会显得硬，描边等于给三个顶点倒角 */
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linejoin: round;
}

/* AI 消息的署名与时间也挨在一起（原来 space-between 会把时间顶到最右边，
   和左边的「DoSight」离得太远，看着像两件事） */
.ws-conv .message.from-assistant .message-meta { justify-content: flex-start; }

/* ---------------------------------------------------------------- 输入区固定
   对话变长以后，输入框会被顶到页面最下面，滚上去看历史就够不着了。
   这里把它钉在视口底部（sticky，而不是 fixed）：短对话时它仍在原位，
   页面需要滚动时才浮起来，不会把布局撕开。 */
.ws-composer {
  position: sticky;
  bottom: 0;
  z-index: 6;
  margin-top: 6px;
  padding-bottom: 12px;
  background: var(--page-bg);
}
/* 浮起来时，上方消息是从它底下滚过去的，加一条渐隐免得被硬切 */
.ws-composer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 20px;
  background: linear-gradient(180deg, rgba(245, 247, 251, 0) 0%, var(--page-bg) 85%);
  pointer-events: none;
}

/* 用户消息不再显示「我」这个头像方块：右侧的气泡位置本身已经说明了是谁，
   多一个方块只是占地方。AI 的 D 头像保留。 */
.ws-conv .from-user .message-avatar { display: none; }

/* ---------------------------------------------------------------- 顶栏：玻璃泡 + 天际线
   原来这里是整条通栏 + 一条底线，等于给页面盖了个盖子。
   现在只留两件东西：左边一枚半透明玻璃泡（面包屑），右边一条贴着右边缘的像素天际线。
   日期不再放（用户明确去掉），顶栏因此没有右侧文字，图案可以放开占位。
   正文滚过去时靠 `::before` 的顶部渐隐收边，不会硬切。 */
.topbar {
  height: 76px;
  padding: 0 34px;
  gap: 14px;
  background: transparent;
  border-bottom: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.topbar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 76px;
  background: linear-gradient(180deg, rgba(245, 247, 251, 0.96) 0%, rgba(245, 247, 251, 0.7) 46%, rgba(245, 247, 251, 0) 100%);
  pointer-events: none;
}
/* 原来那条通栏冷光线跟悬浮气泡不相容，收掉 */
.topbar::after { display: none; }

/* 面包屑：半透玻璃泡，顶白底浅蓝 + 内侧高光 + 落影 */
.breadcrumb {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 16px;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background:
    radial-gradient(130% 150% at 28% -10%, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.72) 52%, rgba(233, 240, 253, 0.62) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(255, 255, 255, 0.35),
    0 2px 4px rgba(17, 28, 54, 0.05),
    0 14px 28px -16px rgba(17, 28, 54, 0.5),
    0 0 0 1px rgba(37, 99, 235, 0.05);
  backdrop-filter: blur(14px) saturate(190%);
  -webkit-backdrop-filter: blur(14px) saturate(190%);
}
.breadcrumb span[aria-hidden] { opacity: 0.38; }
.breadcrumb b { font-weight: 600; }

/* ---------------------------------------------------------------- 顶栏右侧插画
   素材：`web/assets/topbar-city.webp`（蓝色像素天际线，原图 1024×559，已裁掉底部「视觉中国」水印）。
   只贴在右边：贴住右边缘、坐在底线上，左缘渐隐融进底色。
   不放日期之后右侧全空出来了，所以这里可以拉长（480）并吃满整条高度（76），
   图案不再是角落小装饰，而是顶栏右侧的一整条城市天际线。 */
.topbar > .topbar-art {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 480px;
  height: 76px;
  /* 不再直接把图当 background，而是「拿图的 alpha 当遮罩，自己填色」。
     这样浅色/深色只需要换一个颜色，不用 invert 反相——
     反相会把纯蓝翻成脏白灰，在暗底上就是一块发白的斑点（之前那版的问题）。 */
  background: #1263be;
  opacity: 1;
  pointer-events: none;
  -webkit-mask-image: url("/assets/topbar-city.webp"), linear-gradient(90deg, transparent 0%, #000 38%);
  -webkit-mask-size: 100% 100%, 100% 100%;
  -webkit-mask-position: right bottom, 0 0;
  -webkit-mask-repeat: no-repeat, no-repeat;
  -webkit-mask-composite: source-in;
  mask-image: url("/assets/topbar-city.webp"), linear-gradient(90deg, transparent 0%, #000 38%);
  mask-size: 100% 100%, 100% 100%;
  mask-position: right bottom, 0 0;
  mask-repeat: no-repeat, no-repeat;
  mask-composite: intersect;
}

@media (min-width: 761px) and (max-width: 1120px) {
  .topbar > .topbar-art { width: 340px; }
}
@media (max-width: 760px) {
  .topbar { height: 52px; padding: 0 14px; }
  .topbar::before { height: 52px; }
  .breadcrumb { height: 30px; padding: 0 12px; }
  .topbar > .topbar-art { width: 210px; height: 52px; }
}

/* ---------------------------------------------------------------- 侧栏选中：透明玻璃泡
   原来是一块实的蓝底（rgba(37,99,235,.16)），跟顶栏那几颗气泡是两种材质。
   这里换成同一套语言：径向高光（左上打光）+ 竖向蓝玻璃 + 内侧白边 + 外发光，
   底下那层斜纹噪点还能透上来，才看得出是「泡」而不是「块」。 */
.sidebar .nav-item {
  border-radius: 11px;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.sidebar .nav-item.active {
  color: #fff;
  background:
    radial-gradient(140% 170% at 22% -18%, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 46%, rgba(255, 255, 255, 0) 72%),
    linear-gradient(180deg, rgba(226, 236, 255, 0.075) 0%, rgba(198, 216, 250, 0.038) 56%, rgba(170, 196, 245, 0.015) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    inset 0 0 0 1px rgba(147, 197, 253, 0.18),
    0 10px 22px -14px rgba(2, 8, 20, 0.9),
    0 0 20px -8px rgba(59, 130, 246, 0.5);
  backdrop-filter: blur(12px) saturate(170%);
  -webkit-backdrop-filter: blur(12px) saturate(170%);
}
/* 左侧那根 2px 竖条跟着改成玻璃边的颜色，别再用纯色硬条 */
.sidebar .nav-item.active::before {
  background: linear-gradient(180deg, #dbeafe, #60a5fa);
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.7);
}
/* 未选中项悬停也给一层很淡的玻璃，鼠标扫过时材质一致 */
.sidebar .nav-item:not(.active):hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* ---------------------------------------------------------------- 报告中心 v2
   原来的问题：页头被全局隐藏，页面只剩右上一排按钮 + 两条「先准备…」绿横幅
   + 一张稀疏表格，看不出来这页干什么。这里改成「说明 → 三步流程 → 历史报告」，
   报告从表格行改成卡片行（标题/区间 + 三个关键数 + 操作）。全部用主题令牌，
   浅色深色同一套。 */
.rp-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 28px;
  margin: 0 0 22px;
}
.rp-head-text { max-width: 720px; min-width: 0; }
.rp-head-text h1 { margin: 0; font-size: 26px; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); }
.rp-head-text p { margin: 0; font-size: 13px; line-height: 1.85; color: var(--ink-3); }
.rp-head-text b { color: var(--ink); font-weight: 600; }
.rp-head-actions { display: flex; gap: 8px; flex: none; padding-top: 4px; }

.rp-flow {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.rp-flow li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  min-width: 0;
}
.rp-flow b {
  flex: none;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 6px;
  padding: 4px 6px;
  line-height: 1;
}
.rp-flow div { min-width: 0; }
.rp-flow strong { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.rp-flow span { display: block; font-size: 11.5px; line-height: 1.75; color: var(--ink-4); }
.rp-flow .btn { flex: none; align-self: center; margin-left: auto; }

.rp-history { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.rp-history-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.rp-history-head h2 { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.rp-history-head small { font-size: 11px; color: var(--ink-4); }

.rp-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 34px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.15s var(--ease);
}
.rp-card:last-child { border-bottom: 0; }
.rp-card:hover { background: var(--card-2); }
.rp-tag { display: inline-block; font-size: 10px; letter-spacing: 0.03em; padding: 2px 7px; border-radius: 5px; background: var(--brand-soft); color: var(--brand-deep); }
.rp-tag.cat { background: var(--accent-soft); color: #0b7ea8; }
.rp-card-main { min-width: 0; }
.rp-card-main h3 { margin: 9px 0 5px; font-size: 14px; font-weight: 600; line-height: 1.4; }
.rp-card-main h3 button { border: 0; background: none; padding: 0; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.rp-card-main h3 button:hover { color: var(--brand); }
.rp-card-main p { margin: 0; font-size: 11px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.rp-metrics { display: flex; gap: 26px; margin: 0; }
.rp-metrics div { min-width: 0; }
.rp-metrics dt { font-size: 10.5px; color: var(--ink-5); margin-bottom: 5px; }
.rp-metrics dd { margin: 0; font-size: 14px; font-weight: 550; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.rp-metrics dd.negative { color: #b0553c; }
.rp-actions { display: flex; gap: 6px; flex: none; }
.rp-empty { padding: 46px 20px; text-align: center; }
.rp-empty p { margin: 0; font-size: 12px; color: var(--ink-4); }

/* 详情页：全局把 .page-heading 的标题块藏了，报告详情会把报告名一起吞掉，
   这里在报告详情作用域内恢复标题与副标题。 */
.rp-detail .page-heading { display: flex; justify-content: space-between; align-items: flex-end; margin: 0 0 18px; }
.rp-detail .page-heading > div:first-child { display: block; }
.rp-detail .page-heading .eyebrow { display: none; }
.rp-detail .page-heading h1 { margin: 0 0 7px; font-size: 24px; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); }
.rp-detail .page-heading p { display: block; margin: 0; font-size: 11.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) {
  .rp-flow { grid-template-columns: 1fr; }
  .rp-card { grid-template-columns: minmax(0, 1fr) auto; }
  .rp-metrics { display: none; }
}
@media (max-width: 760px) {
  .rp-head { flex-direction: column; gap: 14px; }
  .rp-head-text h1 { font-size: 22px; }
  .rp-head-actions { flex-wrap: wrap; }
  .rp-card { grid-template-columns: 1fr; gap: 12px; }
  .rp-metrics { display: flex; gap: 20px; }
  .rp-actions { justify-content: flex-start; }
}

/* ---------------------------------------------------------------- 输入区：浮在晕染上
   原来这块 form 自己铺了一层不透明底色（var(--page-bg)），在晕染上就是一条带硬边的
   浅色横带——用户看到的那条「分界线」就是它。这里把底色和顶部那条 20px 渐隐一起去掉：
   外框透明，只有里面那枚 .ws-box 是实体，加上落影，读起来就是「输入框浮在雾上」。 */
.ws-composer {
  background: transparent;
  border-top: 0;
  padding-bottom: 16px;
}
.ws-composer::before { display: none; }
.ws-composer .ws-box {
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    inset 0 1px 0 #fff,
    0 1px 2px rgba(17, 28, 54, 0.05),
    0 18px 40px -28px rgba(17, 28, 54, 0.55);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}

/* ---------------------------------------------------------------- 登录页：全屏建筑照
   素材：`web/assets/login-tower.webp`（仰拍的金色曲面高楼，已裁掉原图底部「视觉中国」水印）。
   这张照片的斜线很强，全亮会跟右侧白卡抢视线，所以压四层：
     ① 左浓右淡的主体压暗——左边白色标题必须可读；
     ② 四周暗角——注意力收到中间，边缘不留亮块；
     ③ 上下收边——页脚那两行小字压在暗处，否则会飘；
     ④ 极淡的冷蓝罩——把偏金的整体色调往品牌蓝拉一点，不然整页暖黄，跟产品不是一个色系。
   原来的网格底纹（.auth-shell::before）叠在照片上会变成噪点，关掉；
   左栏那七根柱状装饰也去掉——照片本身就是主体，再加一组柱子是两套语言。 */
.auth-shell {
  background-color: #06090f;
  background-image:
    linear-gradient(0deg, rgba(4, 8, 14, 0.62) 0%, rgba(4, 8, 14, 0) 30%),
    linear-gradient(180deg, rgba(4, 8, 14, 0.5) 0%, rgba(4, 8, 14, 0) 22%),
    linear-gradient(96deg, rgba(5, 9, 15, 0.95) 0%, rgba(5, 9, 15, 0.86) 28%, rgba(5, 9, 15, 0.73) 52%, rgba(5, 9, 15, 0.66) 74%, rgba(5, 9, 15, 0.62) 100%),
    radial-gradient(118% 96% at 52% 44%, rgba(4, 7, 12, 0) 26%, rgba(4, 7, 12, 0.42) 72%, rgba(4, 7, 12, 0.66) 100%),
    linear-gradient(180deg, rgba(12, 26, 48, 0.14) 0%, rgba(10, 22, 42, 0.2) 54%, rgba(8, 16, 32, 0.18) 100%),
    url("/assets/login-tower.webp");
  background-size: cover;
  background-position: center, center, center, center, center, 50% 44%;
  background-repeat: no-repeat;
}
.auth-shell::before { display: none; }
.story-art { display: none; }
/* 照片比原来的纯色底亮，左栏那两行说明字要提一档才看得清 */
.story-body > p { color: rgba(232, 237, 245, 0.66); }

/* 矮屏（笔记本 720/768）：注册页那张卡本来就高（5 个字段 + 提示条），
   收紧留白与行距，尽量让它在一屏内看完；实在超出时页面还能滚，不会挡住按钮。 */
@media (max-height: 800px) {
  .auth-main { padding: 16px 32px; }
  .auth-form-wrap { padding: 22px 26px 18px; }
  .auth-form-wrap h2 { font-size: 22px; }
  .auth-intro { margin-bottom: 14px; }
  .auth-form-wrap .field { margin-bottom: 11px; }
  .auth-main .field input { min-height: 38px; }
  .auth-main .btn.primary.full { min-height: 40px; }
  .auth-bottom { margin-top: 14px; }
  .dev-notice { margin-top: 12px; }
}

@media (max-width: 1100px) {
  .auth-shell {
    background-image:
      linear-gradient(0deg, rgba(4, 8, 14, 0.6) 0%, rgba(4, 8, 14, 0) 32%),
      linear-gradient(180deg, rgba(4, 8, 14, 0.55) 0%, rgba(4, 8, 14, 0) 26%),
      linear-gradient(180deg, rgba(5, 9, 15, 0.86) 0%, rgba(5, 9, 15, 0.78) 42%, rgba(5, 9, 15, 0.9) 100%),
      linear-gradient(180deg, rgba(12, 26, 48, 0.14), rgba(8, 16, 32, 0.2)),
      url("/assets/login-tower.webp");
    background-size: cover;
    background-position: center, center, center, center, 50% 38%;
  }
}
/* 平板宽度下别让白卡贴满屏，留出照片的边（不写嵌套，旧内核也能吃） */
@media (min-width: 481px) and (max-width: 1100px) {
  .auth-form-wrap { max-width: 430px; margin: 0 auto; }
}

/* ---------------------------------------------------------------- 登录页：把蓝降成「商业蓝」
   原来的两处蓝是电动色：标题第二行 #6fa4ff→#3b7bf8，主按钮 #3b82f6→#1d4ed8。
   压在金色建筑照上，等于把一对高饱和互补色并排，会「跳」；而且这套语汇是 SaaS 的，
   不像做生意的界面。这里只在登录作用域内换材质，产品内部的蓝（侧栏、图表）不动：
     · 标题强调：冷白 → 灰蓝，仍在蓝区，饱和度压掉近一半，靠明度拉开层次；
     · 主按钮：深钢蓝，靠顶部一线高光和更实的边界提气，不靠亮度喊人；
     · 眉题、链接一并降饱和——一页里出现三四种蓝，本身就是廉价感的来源。 */
.auth-shell {
  --auth-accent-1: #e8f1f9;
  --auth-accent-2: #93b8d8;
  --auth-accent-3: #6a90b6;
  --auth-cta-1: #3a6a9c;
  --auth-cta-2: #23466b;
  --auth-cta-edge: #1c3a5a;
  --auth-link: #2c5b8c;
  --auth-muted-blue: #8aa6c4;
}

.story-body h1 span {
  background-image: linear-gradient(96deg, var(--auth-accent-1) 0%, var(--auth-accent-2) 46%, var(--auth-accent-3) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  /* 原来这里挂了一层偏绿的辉光 rgba(53,221,151,.22)，蓝字上会泛出一圈脏光 */
  filter: drop-shadow(0 8px 22px rgba(6, 16, 30, 0.45));
}
.story-body .eyebrow { color: var(--auth-muted-blue); }
.story-body .eyebrow::before {
  background: var(--auth-muted-blue);
  box-shadow: 0 0 10px rgba(138, 166, 196, 0.5);
}

.auth-main .btn.primary,
.auth-main .btn.primary.full {
  background: linear-gradient(180deg, var(--auth-cta-1), var(--auth-cta-2));
  border-color: var(--auth-cta-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 2px 6px rgba(8, 20, 36, 0.28);
}
.auth-main .btn.primary:hover:not(:disabled),
.auth-main .btn.primary.full:hover:not(:disabled) {
  background: linear-gradient(180deg, #43749f, #2a4f74);
  border-color: #1c3a5a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 4px 12px rgba(8, 20, 36, 0.32);
}
.auth-main .btn.primary:active:not(:disabled),
.auth-main .btn.primary.full:active:not(:disabled) {
  background: linear-gradient(180deg, #315d8a, #1d3c5c);
}
.auth-main a,
.auth-main .auth-bottom a { color: var(--auth-link); }
.auth-main .helper-line a:hover,
.auth-main .auth-bottom a:hover { color: #1f466f; }

/* 深色主题：卡片是暗底，钢蓝要提一档明度，否则按钮会沉进卡片里 */
html[data-theme="dark"] .auth-main .btn.primary,
html[data-theme="dark"] .auth-main .btn.primary.full {
  background: linear-gradient(180deg, #3f6f9e, #24486c);
  border-color: #1f3c58;
}
html[data-theme="dark"] .auth-main .btn.primary:hover:not(:disabled),
html[data-theme="dark"] .auth-main .btn.primary.full:hover:not(:disabled) {
  background: linear-gradient(180deg, #4d82b3, #2f5a83);
}
html[data-theme="dark"] .auth-main a,
html[data-theme="dark"] .auth-main .auth-bottom a { color: #8fb3d6; }

/* 焦点环也跟着降饱和：否则点过按钮留下一圈电动蓝，跟新按钮不是一套 */
.auth-main :focus-visible { outline-color: #4f7ba6; }
.auth-main .eyebrow::before { background: var(--auth-muted-blue); box-shadow: none; }

/* 模型菜单：上游目录一多（智谱 + 硅基流动 + 魔搭 + 面壁），一屏放不下，
   给个上限并允许内部滚动；右侧那列是供应商名，不再写「免费」。 */
.ws-model-menu { max-height: 340px; overflow-y: auto; }
.ws-model-menu::-webkit-scrollbar { width: 6px; }
.ws-model-menu::-webkit-scrollbar-thumb { background: rgba(17, 28, 54, 0.16); border-radius: 3px; }
/* 原来供应商名单独占一行（当年写的是「免费」两个字，够短），
   现在要放供应商名、条目又多，两行一屏装不下几项——改成同一行左右分布。 */
.ws-model-item {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
}
.ws-model-item em { white-space: nowrap; margin-left: auto; }

/* 演示环境角标：只在 DOSIGHT_DEMO=1 时出现，提醒访客数据是样例 */
.demo-chip {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 38, 0.82);
  color: #efe6d4;
  font-size: 11.5px;
  line-height: 1;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 26px -14px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
}
@media (max-width: 760px) {
  .demo-chip { right: 12px; bottom: 12px; font-size: 10.5px; padding: 6px 10px; }
}

/* 演示环境：登录页只给一行账号提示，登录必须自己输入 */
.auth-demo-hint {
  margin: -6px 0 18px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-4);
  letter-spacing: 0.2px;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- 视口锁定（修「点了页面就往上跳」）
   背景：.shell 原来只有 min-height:100vh，工作台的最小高度（.ws-conv 566px + 顶栏 + 页脚）
   在矮窗口里会超过一屏，于是文档自身变成可滚动。点一下对话框/发送键，浏览器把焦点滚进视野，
   整页就往上窜：侧栏品牌被切掉、页面底部留白。这跟点哪个页面无关，是「文档在滚」。
   修法：应用壳钉死一屏，纵向滚动交给右栏和侧栏各自承担，文档永不为内容而增高。 */
@media (min-width: 761px) {
  .shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  /* 壳已经一屏高了，侧栏不需要 sticky；改回普通块并自己滚，历史列表再长也不撑高文档 */
  .sidebar {
    position: relative;
    top: auto;
    height: auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .workspace {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  /* 对话页最小高度跟随窗口：矮窗口里不再硬撑 566px，输入框保持可见 */
  .ws-conv { min-height: min(566px, calc(100dvh - 258px)); }
  /* 侧栏历史「吃掉」中间所有剩余空间：不再是写死的 330px/40px 限高，
     窗口多高就排几行（至少留两行半），超出部分自己滚，账号区始终贴底。 */
  .sidebar { display: flex; flex-direction: column; }
  .sidebar .conversation-nav {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .sidebar .conversation-list {
    flex: 1 1 auto;
    min-height: 96px;
    max-height: none;
    overflow-y: auto;
  }
  .sidebar .side-bottom { flex: none; margin-top: 0; }
}

/* 笔记本半屏 / 缩放 150% 这类「一屏不到 860px」的窗口：侧栏收紧留白，
   把省下的高度让给对话历史。 */
@media (min-width: 761px) and (max-height: 860px) {
  .sidebar { padding-top: 18px; padding-bottom: 14px; gap: 16px; }
  .sidebar .brand { margin-bottom: 2px; }
  .sidebar .nav-item { padding: 9px 13px; }
  .sidebar .conversation-nav { gap: 8px; }
  .side-bottom { padding-top: 14px; }
  .side-version { margin-top: 10px; }
}

/* 更矮（半屏浏览器、缩放 150% 的 1080p）：先收导航行高和装饰件，
   把高度让给对话历史——宁可每行紧一点，也不要只剩一行。 */
@media (min-width: 761px) and (max-height: 720px) {
  .sidebar .side-version { display: none; }
  .sidebar .nav-item { padding: 7px 13px; font-size: 12.5px; }
  .sidebar .nav { gap: 3px; }
  .sidebar .side-label { margin-bottom: 6px; }
  .conversation-nav .side-label { display: none; }
  .sidebar .brand { font-size: 20px; }
  .sidebar .conversation-list { min-height: 96px; }
}

/* ---------------------------------------------------------------- 细滚动条（滑的时候才出现）
   默认的 Windows 滚动条带上下箭头、宽度 17px，放在深色侧栏里非常扎眼。
   这里统一改成 4px 圆角小条：平时完全透明，滚动时淡入，停手约 0.9 秒后淡出。
   注意：Chrome 121+ 一旦设了 scrollbar-width:thin，会忽略 ::-webkit-scrollbar 定制，
   所以这几个容器反过来显式写回 auto（原样式表里有些地方留了 thin）。 */
.sidebar,
.conversation-list,
.workspace,
.table-wrap,
.chat-feed,
.thread-files,
dialog {
  scrollbar-width: auto;
}
.sidebar::-webkit-scrollbar,
.conversation-list::-webkit-scrollbar,
.workspace::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.chat-feed::-webkit-scrollbar,
.thread-files::-webkit-scrollbar,
dialog::-webkit-scrollbar {
  display: block;
  width: 10px;
  height: 10px;
}
.sidebar::-webkit-scrollbar-track,
.conversation-list::-webkit-scrollbar-track,
.workspace::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.chat-feed::-webkit-scrollbar-track,
.thread-files::-webkit-scrollbar-track,
dialog::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb,
.conversation-list::-webkit-scrollbar-thumb,
.workspace::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.chat-feed::-webkit-scrollbar-thumb,
.thread-files::-webkit-scrollbar-thumb,
dialog::-webkit-scrollbar-thumb {
  /* 3px 透明边框 + content-box 裁切：视觉宽度 4px，圆角小条 */
  border: 3px solid transparent;
  border-radius: 999px;
  background-color: transparent;
  background-clip: content-box;
  transition: background-color 0.25s var(--ease);
}
.sidebar::-webkit-scrollbar-thumb:hover,
.conversation-list::-webkit-scrollbar-thumb:hover,
.workspace::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover,
.chat-feed::-webkit-scrollbar-thumb:hover,
.thread-files::-webkit-scrollbar-thumb:hover,
dialog::-webkit-scrollbar-thumb:hover {
  background-color: rgba(15, 23, 42, 0.38);
}
/* 滚动期间（app.js 打上的 is-scrolling）才显形 */
.is-scrolling::-webkit-scrollbar-thumb {
  background-color: rgba(15, 23, 42, 0.26);
}
.is-scrolling::-webkit-scrollbar-thumb:hover {
  background-color: rgba(15, 23, 42, 0.42);
}
/* 左侧导航栏底色常年是深近黑（与明暗主题无关），滑块必须反过来用白色，
   否则深灰条压在深底上等于没画。 */
.sidebar.is-scrolling::-webkit-scrollbar-thumb,
.conversation-list.is-scrolling::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.22);
}
.sidebar.is-scrolling::-webkit-scrollbar-thumb:hover,
.conversation-list.is-scrolling::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.36);
}
::-webkit-scrollbar-corner { background: transparent; }

