/* ==================================================================
   佩姐AI卖货大师 · 样式表
   设计基线：精致现代风（暖白纸感底 + 品牌红渐变 + 双层阴影），定宽居中，三端自适应（桌面 / 平板 / 手机）
   约束：前端零依赖零 CDN，所有质感纯 CSS 实现。墨阶/线条/背景全部暖调（stone 系），与红色品牌协调。
   ================================================================== */

:root {
  --brand: #ff2442;
  --brand-strong: #e01e3a;
  --brand-soft: #fff0f3;
  --brand-line: #ffd3dc;
  /* 主渐变：按钮 / 徽标 / 激活态共用同一套，保证品牌色处处一致 */
  --brand-grad: linear-gradient(135deg, #ff4a55, var(--brand) 52%, var(--brand-strong));

  /* 暖灰墨阶（stone 系）：红是暖色，墨与线都带暖调才不"打架"，
     旧的冷蓝灰底就是整站"难看"的最大来源 */
  --ink-900: #1c1917;
  --ink-700: #44403c;
  --ink-500: #78716c;
  --ink-400: #a8a29e;

  --line: #e9e4de;
  --line-soft: #f2efea;
  --bg: #faf9f7;
  --card: #ffffff;

  --green: #0c9d6e;
  --blue: #2e6be6;
  --orange: #f5871f;
  --red: #e5484d;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* 双层阴影：一层贴地、一层扩散，卡片才浮得起来（单层淡阴影=贴纸感） */
  --sh-1: 0 1px 2px rgba(28, 25, 23, 0.04), 0 1px 3px rgba(28, 25, 23, 0.05);
  --sh-2: 0 1px 2px rgba(28, 25, 23, 0.05), 0 10px 28px -10px rgba(28, 25, 23, 0.12);
  --sh-3: 0 2px 4px rgba(28, 25, 23, 0.06), 0 24px 56px -12px rgba(28, 25, 23, 0.22);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  margin: 0;
  /* 背景放 html 上、body 留透明，光晕的 z-index:-1 才能落在页面底色之上、内容之下 */
  background: transparent;
  color: var(--ink-900);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 品牌光晕：两团极淡的品牌色柔光铺在页面顶端，暖白底就有了"空气感"，不再是一块平板。
   挂在 html 上是为了和空态那层更浓的光斑分开 —— body::before 留给空态做淡出过渡，
   两层各管各的，生成时背景才不是"啪"一下变白。 */
html::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(1000px 520px at 12% -10%, rgba(255, 36, 66, 0.055), transparent 62%),
    radial-gradient(900px 480px at 92% -14%, rgba(255, 138, 76, 0.05), transparent 62%);
}

/* 空态专用的一层更浓的氛围光：常驻 DOM，只切 opacity —— 生成时它会淡出，
   比"直接换掉背景"少一次生硬的闪断。 */
body::before {
  content: "";
  position: fixed;
  inset: -12% -12% auto;
  height: 124%;
  z-index: -2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  background:
    radial-gradient(46% 40% at 15% 4%, rgba(255, 60, 80, 0.19), transparent 72%),
    radial-gradient(44% 38% at 87% 0%, rgba(255, 168, 92, 0.23), transparent 74%),
    radial-gradient(60% 36% at 50% 104%, rgba(255, 36, 66, 0.1), transparent 72%);
}
@media (prefers-reduced-motion: reduce) {
  body::before { transition: none; }
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }

/* 键盘可达性：Tab 导航时焦点环清晰可见（鼠标点击不出现） */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* 全局滚动条：与暖底色一体，细圆条 + 透明轨道 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: #d6cfc6;
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #c2b9ae; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: #d6cfc6 transparent; }

/* 用户开了"减少动态效果"就全部瞬时应答 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
code { font-family: var(--mono); font-size: 0.88em; background: var(--line-soft); padding: 1px 5px; border-radius: 5px; }

.hidden { display: none !important; }

.wrap {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ------------------------------ 顶栏 ------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }

.brand-mark {
  flex: none;
  width: 34px;
  height: 34px;
  /* 与 logo.png 的圆角遮罩比例一致（26%），避免容器裁切露出白边 */
  border-radius: 24%;
  background: var(--brand-grad);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 8px rgba(255, 36, 66, 0.28);
  overflow: hidden;
}

/* 后台配置了 logo 图片时，brand-mark 填充图片（仍保留圆角与投影） */
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 有图片时必须去掉底色和内白线：logo 图四角是透明圆角，
   底下的白底/inset 白线会从角上透出来，看上去就是一圈白边 */
.brand-mark:has(img) {
  background: transparent;
  box-shadow: 0 2px 8px rgba(255, 36, 66, 0.28);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 15px; }
.brand-text em { font-style: normal; font-size: 11.5px; color: var(--ink-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-actions { display: flex; align-items: center; gap: 10px; flex: none; }

.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-400);
  box-shadow: 0 0 0 3px rgba(168, 162, 158, 0.18);
}
.status-dot.ok { background: var(--green); box-shadow: 0 0 0 3px rgba(0, 168, 112, 0.16); }
.status-dot.warn { background: var(--orange); box-shadow: 0 0 0 3px rgba(245, 135, 31, 0.16); }

.icon-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-700);
  font-size: 13.5px;
  transition: 0.18s;
}
.icon-btn:hover { border-color: var(--brand-line); color: var(--brand); background: var(--brand-soft); }

/* ------------------------------ Hero ------------------------------ */

.hero { padding: 44px 0 26px; text-align: center; }

.hero h1 {
  font-size: clamp(24px, 4.6vw, 38px);
  line-height: 1.28;
  margin-bottom: 12px;
}
.hero .hl {
  /* 品牌渐变字：比"底部划线"更有产品级的精致感 */
  background: linear-gradient(118deg, #ff5c47 0%, var(--brand) 55%, var(--brand-strong) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding: 0 2px;
}
.hero p {
  max-width: 760px;
  margin: 0 auto;
  color: var(--ink-500);
  font-size: 14.5px;
  text-wrap: balance;
}

.hero-tags {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin-top: 18px;
}
.hero-tags span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-500);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
}
/* 能力标签带图标：纯文字四个 pill 看起来像"填进去的占位"，加了图标才是功能位 */
.hero-tags svg {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--brand);
  opacity: 0.75;
}

/* 标题右上角的星芒（只在空态露出，生成后收起） */
.hero-spark {
  display: none;
  width: 0.56em;
  height: 0.56em;
  vertical-align: 0.6em;
  margin-left: 0.04em;
  color: var(--brand);
}

/* ------------------------------ 卡片 ------------------------------ */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-2);
}

.section { padding: 24px 26px; margin-bottom: 18px; }

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  /* 不加下边框分割线：卡片本身已经界定了区域，头部横线是重复信息 */
  padding-bottom: 2px;
  margin-bottom: 16px;
}
.section-head h2 {
  display: flex; align-items: center; gap: 10px;
  font-size: 16.5px;
}
.section-head .idx {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 6px;
  padding: 2px 7px;
}
.section-tools { display: flex; gap: 4px; flex-wrap: wrap; }

/* ------------------------ 结果区导航（吸顶 Tab） ------------------------ */

.result-tabs {
  position: sticky;
  top: 62px;
  z-index: 30;
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--sh-1);
  overflow-x: auto;
  scrollbar-width: none;
}
.result-tabs::-webkit-scrollbar { display: none; }

.rtab {
  flex: 1 1 0;
  min-width: 74px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--ink-500);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 999px;
  white-space: nowrap;
  transition: 0.18s;
}
.rtab:hover { color: var(--ink-900); background: var(--line-soft); }
.rtab.is-active {
  color: #fff;
  background: linear-gradient(135deg, #ff3d59, var(--brand-strong));
  box-shadow: 0 3px 10px rgba(255, 36, 66, 0.24);
}
.rtab em {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--line-soft);
  color: var(--ink-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.rtab em:empty { display: none; }
.rtab.is-active em { background: rgba(255, 255, 255, 0.26); color: #fff; }

.panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 44px 22px 36px;
  color: var(--ink-400);
  /* 虚线容器：空态有明确边界，大片空白不再显得"页面坏了" */
  border: 1.5px dashed var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, transparent 40%, rgba(255, 36, 66, 0.018));
}
.panel-empty .pe-icon { font-size: 34px; opacity: 0.75; filter: saturate(0.85); }
.panel-empty p { font-size: 13.5px; }

/* 结果位还没渲染时，不要把空容器画出来：
   .extra-col 自带边框、.summary-line 自带底色，空着看就是一坨突兀的方块。
   空状态统一交给 .panel-empty 表达，不要双重提示。 */
#overallBox:empty,
.score-grid:empty,
.extra-col:empty,
.summary-line:empty,
.keywords-row:empty,
.cat-group:empty,
#bannedBody:empty,
/* 空 badge 会变成一条 22×6 的灰条（.badge 自带 padding 和底色） */
.badge:empty { display: none; }

/* ------------------------------ 输入区 ------------------------------ */

/* 卡片总高会超过视口，所以左栏做成「sticky + 内部滚动」；
   这两个变量把卡片内边距暴露出来，供左下角的吸底操作条靠负外边距吃满（见 @media 840px）。 */
.input-card { padding: 22px 24px 24px; --ic-px: 24px; --ic-pb: 24px; }

.input-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  margin-bottom: 14px;
}

.seg {
  display: inline-flex;
  background: var(--line-soft);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.seg-item {
  border: 0; background: transparent;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink-500);
  transition: 0.18s;
  min-height: 34px;
  /* 带图标：两个模式的差别一眼可见（链接 / 剪贴板） */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.seg-item svg { width: 15px; height: 15px; flex: none; opacity: 0.55; transition: opacity 0.18s; }
.seg-item.is-active svg { opacity: 1; color: var(--brand); }
.seg-item.is-active {
  background: #fff;
  color: var(--ink-900);
  font-weight: 600;
  box-shadow: var(--sh-1);
}

.hint { font-size: 12.5px; color: var(--ink-400); }

.source-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fbfaf8;
  padding: 14px 15px;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink-900);
  resize: vertical;
  min-height: 122px;
  transition: 0.18s;
}
.source-input::placeholder { color: var(--ink-400); }

/* 输入框滚动条默认隐形：长文案粘进来时不糊一条灰杠，
   鼠标进框（hover）或正在框里编辑（focus）才浮出来。
   透明拇指 + stable gutter —— 显隐切换不会让文字重新折行。 */
.source-input {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  scrollbar-gutter: stable;
}
.source-input:hover,
.source-input:focus { scrollbar-color: rgba(120, 113, 108, 0.45) transparent; }
.source-input::-webkit-scrollbar { width: 8px; height: 8px; }
.source-input::-webkit-scrollbar-track { background: transparent; }
.source-input::-webkit-scrollbar-thumb {
  background: transparent;
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}
.source-input:hover::-webkit-scrollbar-thumb,
.source-input:focus::-webkit-scrollbar-thumb {
  background: rgba(120, 113, 108, 0.45);
  background-clip: padding-box;
}
.source-input:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 36, 66, 0.09), 0 1px 2px rgba(28, 25, 23, 0.04);
}

.text-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfaf8;
  padding: 10px 13px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink-900);
  transition: 0.18s;
  min-height: 40px;
}
.text-input:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 36, 66, 0.09);
}

.input-foot {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px;
}
.counter { margin-right: auto; font-size: 12.5px; color: var(--ink-400); }

.text-btn {
  border: 0; background: transparent;
  color: var(--ink-500);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: 0.18s;
  white-space: nowrap;
}
.text-btn:hover { color: var(--brand); background: var(--brand-soft); }

.styles-block { margin-top: 18px; }
.styles-head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 10px;
}
.styles-head .label { font-size: 13.5px; font-weight: 600; color: var(--ink-700); }
/* 分组标题的小图标：把「产出风格 / 额外要求」从文字行变成可扫读的功能位 */
.lbl-ico { width: 14px; height: 14px; flex: none; color: var(--brand); vertical-align: -2px; margin-right: 5px; }
.styles-head small { font-weight: 400; color: var(--ink-400); margin-left: 2px; }
.styles-head .hint { margin-left: auto; }

/* 风格芯片：6 个短标签固定排 3 列等宽。
   原来是 flex-wrap + justify-content:center，每行按内容宽度排、剩下的零头全堆在两侧：
   390 屏左右各空 13px、430 屏各空 34px、760 屏干脆排成 5+1 让最后一个孤零零居中。
   看过去就是"按钮挤在中间、两边很空"。6 个元素只有 1×6 / 2×3 / 3×2 三种排法算整齐，
   这里取 2×3；窄于 360px 退两列（见文件末尾），平板单栏宽到 700px 以上改 1×6。
   注意：≥840px 的工作台左栏用的是 .wb-left .chips（优先级更高），不受这里影响。 */
.chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--ink-700);
  transition: 0.18s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px;
}
.chip:hover { border-color: var(--brand-line); }

/* 对勾槽位常驻：宽度固定、未选中只隐藏不塌陷，
   否则选中瞬间按钮凭空变宽 ~17px，整行按钮跟着位移。
   槽位压到 9px，手机端再收 padding 补齐，保证一行仍是 3 个。 */
.chip::before {
  content: "✓";
  width: 9px;
  flex: none;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.15s;
}
.chip.is-on {
  background: linear-gradient(180deg, #fff5f7, var(--brand-soft));
  border-color: #ffb3c2;
  color: var(--brand-strong);
  font-weight: 600;
  box-shadow: 0 1px 6px rgba(255, 36, 66, 0.1);
}
.chip.is-on::before { opacity: 1; }

.actions {
  display: flex; gap: 10px;
  margin-top: 22px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  padding: 0 22px;
  height: 46px;
  border: 1px solid transparent;
  transition: 0.18s;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(180deg, #ff4a63, var(--brand) 45%, #f01e3c);
  color: #fff;
  /* 顶部内高光让按钮有"体积感"，平底渐变+外阴影是廉价感的组合 */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 14px rgba(255, 36, 66, 0.28);
  flex: 1;
}
/* 主按钮两端各一个符号：左星芒（AI 生成）+ 右箭头（行动方向），
   hover 时箭头前移一点 —— 静态按钮里这是成本最低的"可点"暗示 */
.btn-primary .bi-spark { width: 17px; height: 17px; flex: none; }
.btn-primary .bi-arrow { width: 17px; height: 17px; flex: none; margin-left: 1px; transition: transform 0.18s; }
.btn-primary:hover:not(:disabled) .bi-arrow { transform: translateX(3px); }
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 22px rgba(255, 36, 66, 0.36);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 8px rgba(255, 36, 66, 0.26); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-700);
  flex: none;
}
.btn-ghost:hover { border-color: var(--brand-line); color: var(--brand); background: var(--brand-soft); }

/* ------------------------------ 进度 ------------------------------ */

.progress-card { padding: 20px 24px; margin-bottom: 18px; }

.steps { display: flex; gap: 8px; flex-wrap: wrap; }
.step {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px;
  color: var(--ink-400);
  background: var(--line-soft);
  border-radius: 999px;
  padding: 6px 14px 6px 10px;
  transition: 0.25s;
}
.step i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-400);
  transition: 0.25s;
}
.step.is-active { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
/* 进行中用旋转圆环代替静态圆点：静止的小点看不出「在跑」 */
.step.is-active i {
  width: 11px; height: 11px;
  background: transparent;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: stepSpin 0.72s linear infinite;
}
@keyframes stepSpin { to { transform: rotate(360deg); } }
.step.is-done { color: var(--green); background: rgba(0, 168, 112, 0.08); }
.step.is-done i { background: var(--green); }
.step.is-fail { color: var(--red); background: rgba(229, 72, 77, 0.08); }
.step.is-fail i { background: var(--red); }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.45; }
}

/* 进度条：宽度由 JS 按阶段推进，内部一条流光持续扫过 */
.pg-track {
  position: relative;
  height: 5px;
  margin-top: 14px;
  border-radius: 999px;
  background: var(--line-soft);
  overflow: hidden;
}
.pg-track i {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 2%;
  border-radius: inherit;
  overflow: hidden;
  background: linear-gradient(90deg, #ff8b9d 0%, var(--brand) 55%, #ff4a63 100%);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.pg-track i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 22%, rgba(255, 255, 255, 0.9) 50%, transparent 78%);
  transform: translateX(-100%);
  animation: pgSheen 1.25s linear infinite;
}
@keyframes pgSheen { to { transform: translateX(100%); } }

.progress-row { display: flex; align-items: center; gap: 9px; margin-top: 11px; }

.pg-dot {
  flex: none;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0.28;
}
.progress-card.is-running .pg-dot { opacity: 1; animation: pulse 1.2s ease-in-out infinite; }
.progress-card.is-fail .pg-dot { background: var(--red); opacity: 1; animation: none; }

.progress-text { flex: 1; min-width: 0; margin: 0; font-size: 13px; color: var(--ink-500); }
.progress-text.is-swap { animation: pgTextIn 0.32s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes pgTextIn { from { opacity: 0; transform: translateY(5px); } }

.pg-time {
  flex: none;
  font-size: 12px;
  color: var(--ink-400);
  font-variant-numeric: tabular-nums;
}
.progress-card.is-running .pg-time { color: var(--brand-strong); font-weight: 600; }

/* 失败：进度条停住并转红，别装成已完成 */
.progress-card.is-fail .pg-track i { background: var(--red); }
.progress-card.is-fail .pg-track i::after { animation: none; opacity: 0.25; }

/* ------------------------------ 原文 ------------------------------ */

.note-top { display: flex; gap: 16px; align-items: flex-start; }

.note-covers {
  display: flex; gap: 8px; flex: none;
  max-width: 46%;
  overflow-x: auto;
  padding-bottom: 2px;
}
.note-covers img {
  width: 108px; height: 144px;
  object-fit: cover;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--line-soft);
  flex: none;
}

.note-main { flex: 1; min-width: 0; }

.note-title { font-size: 17px; font-weight: 700; line-height: 1.45; margin-bottom: 10px; }
.note-text { color: var(--ink-700); font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }

.note-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.note-tags span {
  font-size: 12.5px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-radius: 7px;
  padding: 3px 9px;
}

.note-meta {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px; color: var(--ink-400);
}
.note-meta b { color: var(--ink-700); font-weight: 600; }

.badge {
  font-size: 12px;
  border-radius: 999px;
  padding: 3px 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-soft { background: var(--line-soft); color: var(--ink-500); }
.badge-none { background: rgba(0, 168, 112, 0.1); color: var(--green); }
.badge-low { background: rgba(46, 107, 230, 0.1); color: var(--blue); }
.badge-mid { background: rgba(245, 135, 31, 0.12); color: #c96b0d; }
.badge-high { background: rgba(229, 72, 77, 0.1); color: var(--red); }

.warn-list {
  margin-top: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.warn-list p {
  font-size: 13px;
  color: #a35a06;
  background: rgba(245, 135, 31, 0.07);
  border: 1px solid rgba(245, 135, 31, 0.18);
  border-radius: 10px;
  padding: 9px 13px;
}

/* ------------------------------ 诊断 ------------------------------ */

/* 评分面板：成品 / 原文切换。默认看成品，原文分退居对比基线 */
.score-switch {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.seg-sm { padding: 2px; border-radius: 9px; }
.seg-sm .seg-item { padding: 5px 12px; font-size: 12.5px; min-height: 28px; border-radius: 7px; }
.seg-sm .seg-item:disabled { opacity: 0.42; }
.score-state { font-size: 12px; color: var(--ink-400); }
.score-state.is-loading { color: var(--brand); }

/* 「原文 6.4 → 成品 8.3 ↑1.9」——这行是整个面板的说服力所在 */
.score-delta {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 10px 13px;
  margin-bottom: 12px;
  border-radius: var(--r-md);
  background: linear-gradient(120deg, rgba(255, 36, 66, 0.06), rgba(255, 120, 60, 0.05));
  border: 1px solid rgba(255, 36, 66, 0.12);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.score-delta .sd-label { color: var(--ink-400); font-size: 11.5px; }
.score-delta .sd-from { color: var(--ink-500); }
.score-delta .sd-arrow { color: var(--ink-400); opacity: 0.6; }
.score-delta .sd-to { font-weight: 700; }
.score-delta .sd-up {
  margin-left: auto; font-weight: 700; color: #fff;
  background: var(--brand-grad);
  padding: 2px 8px; border-radius: 999px; font-size: 11.5px;
}
.score-delta .sd-down,
.score-delta .sd-flat { margin-left: auto; font-size: 11.5px; color: var(--ink-400); }

/* 各版本综合分：条状对比，点哪行看哪版的四维 */
.score-versions { display: flex; flex-direction: column; gap: 6px; margin-top: 13px; }
.score-versions .sv-title { font-size: 11.5px; color: var(--ink-400); }
.sv-row {
  display: flex; align-items: center; gap: 9px;
  width: 100%; text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  transition: 0.18s;
}
.sv-row:hover { border-color: var(--brand-line); }
.sv-row.is-on {
  border-color: var(--brand-line);
  background: rgba(255, 36, 66, 0.035);
}
.sv-name {
  font-size: 12.5px; color: var(--ink-700);
  flex: 0 0 auto; max-width: 40%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sv-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--line-soft); overflow: hidden; min-width: 20px; }
.sv-bar i { display: block; height: 100%; border-radius: 3px; transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.sv-row b { font-size: 13px; font-variant-numeric: tabular-nums; width: 26px; text-align: right; flex: none; }

.score-verdict { margin-top: 13px; display: flex; flex-direction: column; gap: 9px; }
.sv-verdict {
  font-size: 12.5px; line-height: 1.65; color: var(--ink-700);
  padding: 11px 13px;
  background: #fcfbf9;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.sv-fix {
  font-size: 12.5px; line-height: 1.65; color: var(--ink-500);
  padding: 11px 13px;
  background: rgba(46, 107, 230, 0.05);
  border: 1px solid rgba(46, 107, 230, 0.14);
  border-radius: var(--r-md);
}
.sv-fix b { display: block; font-size: 11.5px; color: #2e6be6; margin-bottom: 4px; }

/* 已经替用户改好了：改成「完成态」，重点放在改了什么，而不是又给一条待办 */
.sv-fix.is-applied {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  background: rgba(20, 122, 64, 0.055);
  border-color: rgba(20, 122, 64, 0.2);
  color: var(--ink-700);
}
.sv-fix.is-applied b {
  color: #147a40;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}
.sv-fix.is-applied b::before {
  content: '✓';
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #147a40;
  color: #fff;
  font-size: 9px;
  line-height: 1;
}
.sv-ops { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.sv-op {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  line-height: 1.5;
}
.sv-op i {
  font-style: normal;
  font-size: 10.5px;
  color: var(--ink-400);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 5px;
}
.sv-op del { color: var(--ink-400); text-decoration-thickness: 1px; }
.sv-op .sv-arrow { color: var(--ink-400); font-size: 11px; }
.sv-op ins {
  text-decoration: none;
  color: #147a40;
  font-weight: 600;
  background: rgba(20, 122, 64, 0.1);
  border-radius: 4px;
  padding: 0 4px;
}
.sv-why { font-size: 12px; line-height: 1.6; color: var(--ink-500); }
.sv-undo {
  font-size: 11.5px;
  color: var(--ink-500);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 11px;
  transition: 0.18s;
}
.sv-undo:hover { color: var(--brand); border-color: var(--brand-line); }
.sv-fix.is-undone b { color: var(--ink-400); }

.overall b.is-muted { color: var(--ink-400); }

.overall {
  display: flex; align-items: baseline; gap: 6px;
}
.overall b { font-size: 26px; font-weight: 700; line-height: 1; }
.overall span { font-size: 12.5px; color: var(--ink-400); }

.score-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.score-item {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  background: #fcfbf9;
}

.ring-wrap { position: relative; width: 58px; height: 58px; flex: none; }
.ring { width: 58px; height: 58px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.ring .bg { stroke: var(--line-soft); }
.ring .fg { transition: stroke-dashoffset 0.9s cubic-bezier(0.22, 1, 0.36, 1); }
.ring-num {
  position: absolute; inset: 0;
  /* 显式 <b>+<small> 两行、flex 竖排居中。不能用 grid + 裸文本：
     匿名文本和 small 会被拆成两个 grid item，各自扩行高后数字偏上、
     /10 偏下直接压在环线上（实测 50px 环里两行 34.8px）。 */
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px;
  line-height: 1;
  font-size: 16px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ring-num b { font-weight: 700; }
.ring-num small { font-size: 9px; font-weight: 500; color: var(--ink-400); }

.score-body { flex: 1; min-width: 0; }
.score-label { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.score-comment {
  font-size: 12.5px; color: var(--ink-500); line-height: 1.62;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.score-comment.is-open { display: block; -webkit-line-clamp: unset; overflow: visible; }
.score-more {
  border: 0; background: transparent; padding: 0;
  margin-top: 3px;
  font-size: 12px; color: var(--brand);
}
.score-more:hover { text-decoration: underline; }
/* 简评未超行数时隐藏按钮但保留占位，保证四张卡等高 */
.score-more.is-off { visibility: hidden; pointer-events: none; }

.analysis-extra {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}
.extra-col {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
}
.extra-col h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.extra-col h4 i { font-style: normal; font-size: 14px; }
.extra-col ul { margin: 0; padding-left: 18px; }
.extra-col li { font-size: 13px; color: var(--ink-700); margin-bottom: 6px; line-height: 1.6; }
.extra-col li:last-child { margin-bottom: 0; }

.summary-line {
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--ink-700);
  background: var(--line-soft);
  border-radius: var(--r-md);
  padding: 13px 16px;
  line-height: 1.7;
}

.keywords-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 14px;
}
.keywords-row .kw-label { font-size: 12.5px; color: var(--ink-400); }
.keywords-row .kw {
  font-size: 12.5px;
  border: 1px dashed var(--brand-line);
  color: var(--brand-strong);
  border-radius: 999px;
  padding: 3px 11px;
}

/* ------------------------------ 文案版本 ------------------------------ */

.versions { display: flex; flex-direction: column; gap: 16px; }

.version {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: 0.2s;
  background: #fff;
}
.version:hover { border-color: var(--brand-line); box-shadow: var(--sh-2); }

.version-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px;
  background: linear-gradient(180deg, #fff, #fcfbf9);
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.version-style {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--brand-grad);
  border-radius: 8px;
  padding: 3px 11px;
  box-shadow: 0 1px 5px rgba(255, 36, 66, 0.22);
}
.version-style.plain { background: var(--ink-700); }

/* 成品分徽章：评分是异步补上的，没分时整块 hidden，不占位 */
.v-score {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  animation: score-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.v-score.is-best::before { content: "★"; margin-right: 3px; }
@keyframes score-in {
  from { opacity: 0; transform: translateY(-3px) scale(0.92); }
  to { opacity: 1; transform: none; }
}

.version-tools { margin-left: auto; display: flex; gap: 2px; align-items: center; }
.version-len { font-size: 12px; color: var(--ink-400); margin-right: 6px; font-variant-numeric: tabular-nums; }

.version-body { padding: 18px; }

.v-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 12px;
  color: var(--ink-900);
}
.v-text {
  font-size: 14.5px;
  color: var(--ink-700);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.8;
}
.v-tags {
  display: flex; flex-wrap: wrap; gap: 7px;
  margin-top: 14px; padding-top: 13px;
  border-top: 1px dashed var(--line);
}
.v-tags span {
  font-size: 12.5px; color: var(--blue);
  background: rgba(46, 107, 230, 0.07);
  border-radius: 7px; padding: 3px 9px;
}

.v-warn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  border-radius: 999px; padding: 3px 10px;
}
.v-warn.ok { color: var(--green); background: rgba(0, 168, 112, 0.09); }
.v-warn.bad { color: var(--red); background: rgba(229, 72, 77, 0.09); }
.v-fixed {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  border-radius: 999px; padding: 3px 10px;
  color: var(--green); background: rgba(0, 168, 112, 0.09);
}

.typing::after {
  content: "";
  display: inline-block;
  width: 2px; height: 15px;
  background: var(--brand);
  margin-left: 2px;
  vertical-align: -2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ------------------------------ 生成中骨架 ------------------------------ */
/* 推理模型要先思考十几秒才吐正文，这段时间用骨架卡表达「在干活」 */

.gen-skeleton { display: flex; flex-direction: column; gap: 16px; }

.skel-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #fff;
  animation: skelIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
@keyframes skelIn { from { opacity: 0; transform: translateY(10px); } }

/* 整卡斜向扫光：卡片是白底，光带只在灰条/徽标上显形，像有东西正在被写出来 */
.skel-sweep {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.85) 50%, transparent 62%);
  transform: translateX(-120%);
  animation: skelSweep 3s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  animation-delay: var(--d, 0s);
}
@keyframes skelSweep {
  0% { transform: translateX(-120%); }
  55%, 100% { transform: translateX(120%); }
}

.skel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px;
  background: linear-gradient(180deg, #fff, #fcfbf9);
  border-bottom: 1px solid var(--line-soft);
}

.skel-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-500);
  background: #f2efeb;
  border-radius: 8px;
  padding: 3px 11px;
}

.skel-status {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: auto;
  font-size: 12px;
  color: var(--brand-strong);
  font-weight: 600;
}
.skel-status i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
  animation: pulse 1.1s ease-in-out infinite;
}

/* 「创作中…」的三点依次跳动，比一整串静态字更像在打字 */
.skel-dots { display: inline-flex; }
.skel-dots b { animation: dotHop 1.3s ease-in-out infinite; }
.skel-dots b:nth-child(2) { animation-delay: 0.16s; }
.skel-dots b:nth-child(3) { animation-delay: 0.32s; }
@keyframes dotHop {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.skel-body { padding: 18px; display: flex; flex-direction: column; gap: 11px; }

.skel-caret {
  width: 2px; height: 13px;
  margin-top: -2px;
  border-radius: 1px;
  background: var(--brand);
  animation: caretBlink 1s steps(2, start) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

.skel-line {
  height: 11px;
  border-radius: 6px;
  /* 明暗差拉到纯白，否则在米白底上几乎看不出在流动（旧版 0.06 的差太淡） */
  background: linear-gradient(100deg, #ece7e1 18%, #f8f5f1 38%, #ffffff 50%, #f8f5f1 62%, #ece7e1 82%);
  background-size: 300% 100%;
  animation: skelShimmer 1.6s ease-in-out infinite;
}
/* 每行错开一点，整体像一条条被依次"写"出来，而不是整齐同步闪 */
.skel-line:nth-child(2) { animation-delay: 0.1s; }
.skel-line:nth-child(3) { animation-delay: 0.2s; }
.skel-line:nth-child(4) { animation-delay: 0.3s; }
.skel-line:nth-child(5) { animation-delay: 0.4s; }
@keyframes skelShimmer {
  0% { background-position: 130% 0; }
  100% { background-position: -30% 0; }
}
.skel-line.w72 { width: 72%; }
.skel-line.w96 { width: 96%; }
.skel-line.w90 { width: 90%; }
.skel-line.w80 { width: 80%; }
.skel-line.w64 { width: 64%; }

/* 生成失败空态：给原因 + 一键重试，别让面板空白 */
.gen-failed {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 22px;
  border: 1px dashed var(--brand-line);
  border-radius: var(--r-lg);
  background: rgba(255, 36, 66, 0.03);
}
.gf-icon {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(229, 72, 77, 0.1);
  color: var(--red);
  font-weight: 800;
  font-size: 15px;
}
.gf-title { font-size: 14px; font-weight: 700; color: var(--ink-900); }
.gf-desc { margin-top: 5px; font-size: 13px; line-height: 1.65; color: var(--ink-500); }
.gf-retry {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-strong);
  background: #fff;
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
  transition: 0.18s;
}
.gf-retry:hover { background: var(--brand-soft); }


/* ------------------------------ 违禁词 ------------------------------ */

.risk-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.risk-cell {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  text-align: center;
}
.risk-cell b { display: block; font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.risk-cell span { font-size: 12.5px; color: var(--ink-400); }
.risk-cell.lv-high b { color: var(--red); }
.risk-cell.lv-mid b { color: #c96b0d; }
.risk-cell.lv-low b { color: var(--blue); }
.risk-cell.lv-ok b { color: var(--green); }

.hit-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hit-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-400);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.hit-table td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.hit-table tr:last-child td { border-bottom: 0; }
.hit-word {
  font-weight: 700;
  color: var(--red);
  font-family: var(--mono);
  font-size: 12.5px;
}
.hit-ctx { color: var(--ink-400); font-size: 12.5px; }
.hit-sug { color: var(--green); font-size: 12.5px; }

.clean-state {
  text-align: center;
  padding: 26px 0 12px;
}
.clean-state .icon { font-size: 34px; }
.clean-state p { font-size: 14px; color: var(--ink-500); margin-top: 8px; }
.clean-state .clean-note { font-size: 12.5px; color: var(--ink-400); margin-top: 4px; }

.cat-group { margin-bottom: 16px; }
.cat-group h5 {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-500);
  display: flex; align-items: center; gap: 7px;
}
.cat-group h5 em {
  font-style: normal;
  font-size: 11px;
  background: var(--line-soft);
  border-radius: 999px;
  padding: 1px 8px;
  color: var(--ink-400);
}

/* ------------------------------ 弹窗 ------------------------------ */

.modal {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 20px;
}
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(28, 25, 23, 0.4);
  backdrop-filter: blur(6px);
}
.modal-panel {
  position: relative;
  width: 100%; max-width: 460px;
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  animation: rise 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.98); } }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 14px;
}
.modal-head h3 { font-size: 16.5px; }
.modal-head .icon-btn { border: 0; height: 32px; padding: 0 10px; font-size: 15px; }

.modal-body { padding: 0 22px 8px; }
.modal-desc { font-size: 13px; color: var(--ink-500); line-height: 1.7; margin-bottom: 18px; }

.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-700); margin-bottom: 7px; }

.advanced { margin-bottom: 16px; }
.advanced summary {
  font-size: 13px; color: var(--ink-500); cursor: pointer;
  padding: 6px 0; user-select: none;
}
.advanced summary:hover { color: var(--brand); }
.advanced .field { margin-top: 10px; }

/* 字段标题行：左边名称，右边操作（去创建 / 恢复默认） */
.field span.field-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.field-head em { font-style: normal; }

.mini-link {
  font: inherit; font-size: 12px; font-weight: 500;
  color: var(--brand); background: none; border: 0; padding: 0;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.mini-link:hover { text-decoration: underline; }

.modal-tip { font-size: 12.5px; color: var(--ink-400); min-height: 18px; margin-bottom: 8px; }
.modal-tip.ok { color: var(--green); }
.modal-tip.bad { color: var(--red); }

.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px 22px;
}
.modal-foot .btn { height: 42px; padding: 0 20px; font-size: 14px; flex: none; }

/* ------------------------------ Toast ------------------------------ */

.toast {
  position: fixed;
  left: 50%; bottom: 34px;
  transform: translate(-50%, 20px);
  background: var(--ink-900);
  color: #fff;
  font-size: 13.5px;
  border-radius: 11px;
  padding: 11px 20px;
  opacity: 0;
  pointer-events: none;
  transition: 0.24s;
  z-index: 200;
  max-width: min(90vw, 420px);
  text-align: center;
  box-shadow: var(--sh-3);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--red); }

.foot {
  text-align: center;
  padding: 26px 0 40px;
  font-size: 12.5px;
  color: var(--ink-400);
}

/* ==================================================================
   响应式：平板（≤ 900px）与手机（≤ 640px）
   ================================================================== */

@media (max-width: 900px) {
  .score-grid { grid-template-columns: repeat(2, 1fr); }
  .risk-summary { grid-template-columns: repeat(2, 1fr); }
  .note-top { flex-direction: column; }
  .note-covers { max-width: 100%; }
  .note-covers img { width: 96px; height: 128px; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 16px; }

  .topbar-inner { height: 56px; }
  /* 手机端：图标略缩 + 标题加大加粗，图标与文字比例更协调 */
  .brand-mark { width: 30px; height: 30px; font-size: 15px; }
  .brand-text strong { font-size: 16px; font-weight: 700; letter-spacing: 0.2px; }
  .brand-text em { display: none; }
  .icon-btn span { display: none; }
  .icon-btn { padding: 0 10px; }

  .hero { padding: 28px 0 20px; }
  .hero p { font-size: 13.5px; }
  .hero-tags { gap: 6px; }
  .hero-tags span { font-size: 12px; padding: 3px 10px; }

  .card { border-radius: var(--r-lg); }
  .section { padding: 18px 16px; margin-bottom: 14px; }
  .section-head { padding-bottom: 2px; margin-bottom: 13px; }
  .section-head h2 { font-size: 15.5px; }
  .section-tools { width: 100%; }

  .input-card { padding: 16px; }
  .input-head { gap: 10px; }
  .seg { width: 100%; }
  .seg-item { flex: 1; padding: 8px 10px; }
  .hint { font-size: 12px; }
  #modeHint { display: none; }

  /* 手机端 chip 收紧，3 列等宽（列数在基础样式里定，这里只调疏密）。
     390 屏实测每列 104px、430 屏 117px，5 个字仍是一行不折。
     必须用 grid 而不是让内容撑宽：flex 下 390 屏整行只占 298.5px，
     居中后左右各留 13px 空气，屏越宽空得越多。 */
  .chips { gap: 8px 6px; }
  /* padding 与 gap 收紧，抵掉常驻对勾槽位让出的宽度，一行仍排得下 3 个 */
  .chip { font-size: 12.5px; padding: 6px 9px; gap: 4px; }

  .actions { flex-direction: column-reverse; }
  /* flex: none 是关键：竖向排列时 .btn-primary 的 flex:1 会把 flex-basis 变成 0，
     高度属性会被完全忽略，按钮塌成一行文字的高度（实测只有 22px）。 */
  .btn { width: 100%; height: 48px; min-height: 48px; flex: none; }

  .result-tabs { top: 56px; margin-bottom: 13px; }
  .rtab { font-size: 13.5px; padding: 8px 10px; min-width: 64px; min-height: 42px; }
  .panel-empty { padding: 36px 0 30px; }

  .score-grid { grid-template-columns: 1fr; gap: 9px; }
  .score-item { padding: 13px 14px; }
  .ring-wrap, .ring { width: 52px; height: 52px; }
  .ring-num { font-size: 15px; }
  .score-comment { font-size: 12px; -webkit-line-clamp: 4; }

  .analysis-extra { grid-template-columns: 1fr; gap: 10px; }
  .extra-col { padding: 14px; }

  .note-covers img { width: 84px; height: 112px; }
  .note-title { font-size: 15.5px; }

  .version-head { padding: 11px 14px; }
  .version-body { padding: 14px; }
  .version-tools { width: 100%; margin-left: 0; }
  .version-len { margin-right: auto; }
  .v-title { font-size: 15px; }
  .v-text { font-size: 14px; }

  .risk-summary { gap: 10px; }
  .risk-cell { padding: 12px 10px; }
  .risk-cell b { font-size: 19px; }

  .hit-table thead { display: none; }
  .hit-table, .hit-table tbody, .hit-table tr, .hit-table td { display: block; width: 100%; }
  .hit-table tr {
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 12px 14px;
    margin-bottom: 10px;
  }
  .hit-table td { border: 0; padding: 2px 0; }
  .hit-table td::before {
    content: attr(data-label);
    display: inline-block;
    min-width: 52px;
    color: var(--ink-400);
    font-size: 12px;
  }

  .modal { padding: 12px; align-items: flex-end; }
  .modal-panel {
    max-width: 100%;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    max-height: 92vh;
  }

  .toast { bottom: 20px; font-size: 13px; padding: 10px 16px; }
}

@media (max-width: 380px) {
  .score-grid { grid-template-columns: 1fr; }
  .risk-summary { grid-template-columns: 1fr 1fr; }
}

/* 芯片列数的两个例外档（基础档见 .chips「6 个短标签排 3 列」处）：

   ① 窄于 370px（360 安卓小屏）：3 列只剩 94px，5 个字的标签会被挤成两行（实测 46px 高），
      退成 2 列 × 3 行，宁可多一行也要每列富余。
   ② 740~840px 的单栏平板/窄窗口：一整行 6 个放得下（每列 ≥106px），
      别让它折成 4+2 或 5+1 那种带残行的排法。 */
@media (max-width: 369.98px) {
  .chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 740px) and (max-width: 839.98px) {
  .chips { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  /* 列宽只有 ~100px，沿用桌面的 13px/14px 内边距会把 5 个字挤折行，跟着手机端收紧 */
  .chip { font-size: 12.5px; padding: 6px 9px; gap: 4px; }
}

/* 触屏设备取消 hover 位移，避免粘连 */
@media (hover: none) {
  .btn-primary:hover:not(:disabled) { transform: none; }
  .version:hover { border-color: var(--line); box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}


/* ==================================================================
   账号体系：顶栏用户区 / 配额条 / 登录注册 / 激活升级 / 历史记录
   ================================================================== */

/* ------------------------------ 顶栏用户区 ------------------------------ */

.user-menu { position: relative; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 10px 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-700);
  transition: border-color 0.18s, background 0.18s;
}
.user-chip:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.user-chip svg { color: var(--ink-400); flex: none; }

.uc-avatar {
  width: 26px; height: 26px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #ff6b81);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}
.uc-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; max-width: 132px; }
.uc-text b { font-size: 13px; font-weight: 600; color: var(--ink-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 132px; }
.uc-text em { font-style: normal; font-size: 11px; color: var(--ink-400); }
.user-chip.is-pro .uc-avatar { background: linear-gradient(135deg, #b8860b, #e0a93b); }
.user-chip.is-pro .uc-text em { color: #b07d0a; font-weight: 600; }

.user-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 268px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  padding: 6px;
  z-index: 60;
  animation: popIn 0.16s ease-out;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.up-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.up-head-line { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.up-head-line b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.plan-tag {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--line-soft);
  color: var(--ink-500);
}
.plan-tag.is-pro { background: #fdf3dd; color: #b07d0a; }

.up-quota { font-size: 12.5px; color: var(--ink-400); margin-top: 5px; }
.up-quota b { color: var(--brand); }

.up-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  font-size: 13.5px;
  color: var(--ink-700);
  text-align: left;
  text-decoration: none; /* 管理后台是 <a>，吃掉浏览器默认下划线 */
  transition: background 0.15s, color 0.15s;
}
.up-item:hover { background: var(--brand-soft); color: var(--brand); }
.up-item.danger:hover { background: #fff1f1; color: var(--red); }
.up-ico { font-size: 13px; width: 16px; text-align: center; flex: none; }
.pro-dot {
  margin-left: auto;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 600;
  color: #b07d0a;
  background: #fdf3dd;
  border-radius: 999px;
  padding: 1px 7px;
}

/* ------------------------------ 配额条 ------------------------------ */

.quota-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 0;
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: #fffaeb;
  border: 1px solid #ffe6b0;
  font-size: 13px;
  color: #8a6100;
}
.quota-bar b { font-weight: 700; }
.quota-bar .qb-spacer { flex: 1; }
.quota-bar.is-pro { background: #f3fbf6; border-color: #c6ecd8; color: #0a7a52; }
.quota-bar.is-out { background: #fff3f3; border-color: #ffd0d0; color: #b3261e; }
.quota-bar .qb-btn {
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.quota-bar .qb-btn:hover { background: currentColor; }
.quota-bar .qb-btn:hover span { color: #fff; }

/* 免费版被限制的风格芯片 */
.chip.is-limit { position: relative; opacity: 0.55; }
.chip.is-limit::after {
  content: 🔒;
  font-size: 9px;
  margin-left: 5px;
}

@keyframes chipShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
.chip.shake { animation: chipShake 0.28s ease-in-out; border-color: var(--red) !important; }

/* ------------------------------ 登录 / 注册（分栏 + 插画） ------------------------------
   版式：左品牌面板（渐变粉红 + 3D 插画 + 2×2 能力卡 + 三卖点）+ 右表单卡。
   窄屏（< 1240）先撤掉插画让文案独占；< 1000 收成顶部通栏 + 表单。
   高度约束：1440×900 / 1366×768 下整屏不滚动（gateScroll 必须为 0）。
   ---------------------------------------------------------------------------------- */

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow-y: auto;
  background: var(--bg);
}

.auth-inner {
  display: grid;
  /* 右栏是「表单卡 + 一条信任卖点」，540 够放 430 的卡且两侧留白匀称；
     参考稿里右侧约占 1/3，这里同步压到 34%（1920 上命中 540 上限）。 */
  grid-template-columns: minmax(0, 1fr) clamp(460px, 36%, 620px);
  width: 100%;
  min-height: 100%;
}

/* ---------- 左侧品牌面板 ---------- */

.auth-aside {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 4vh, 50px) clamp(24px, 3.4vw, 64px) clamp(20px, 3vh, 30px);
  color: #fff;
  /* 左上偏玫红、右下偏粉橙：纯 #ff2442 铺满会太"塑料"，加两层径向光让红有厚度 */
  background:
    radial-gradient(920px 620px at 88% -8%, rgba(255, 255, 255, 0.3), transparent 62%),
    radial-gradient(760px 560px at 4% 108%, rgba(255, 158, 90, 0.46), transparent 66%),
    linear-gradient(152deg, #d71b3c 0%, #e52342 28%, #ff4b67 62%, #ff8272 100%);
}

.aa-stage {
  position: relative;
  z-index: 2;
  display: grid;
  /* 文案列弹性 + 插画列定比：1440 下文案 ~500 / 插画 ~270，1920 下 700 / 300 */
  grid-template-columns: minmax(0, 1fr) clamp(230px, 24vw, 420px);
  align-items: center;
  gap: clamp(12px, 1.6vw, 30px);
  width: 100%;
  max-width: clamp(720px, 72vw, 1120px);
  margin: 0 auto;
}

.aa-copy { min-width: 0; }

.aa-art {
  display: flex;
  justify-content: center;
  min-width: 0;
}
.art-svg {
  width: 100%;
  height: auto;
  max-height: min(66vh, 540px);
  overflow: visible;
}

/* 装饰：两团柔光 + 点阵。纯 CSS，不加图片 */
.aa-glow { position: absolute; border-radius: 50%; filter: blur(62px); pointer-events: none; z-index: 0; }
.aa-glow-a {
  width: clamp(440px, 30vw, 760px); height: clamp(440px, 30vw, 760px);
  right: -140px; top: -180px; background: rgba(255, 255, 255, 0.24);
}
.aa-glow-b {
  width: clamp(380px, 26vw, 660px); height: clamp(380px, 26vw, 660px);
  left: -140px; bottom: -170px; background: rgba(255, 176, 120, 0.3);
}
.aa-dots {
  position: absolute; inset: 0; z-index: 1; opacity: 0.32; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(clamp(600px, 32vw, 880px) clamp(500px, 28vw, 760px) at 84% 78%, #000, transparent 70%);
  mask-image: radial-gradient(clamp(600px, 32vw, 880px) clamp(500px, 28vw, 760px) at 84% 78%, #000, transparent 70%);
}

.auth-brand { display: flex; align-items: center; gap: clamp(11px, 1.1vw, 15px); margin-bottom: clamp(20px, 3vh, 32px); }
.aa-brand-text { display: flex; flex-direction: column; line-height: 1.28; min-width: 0; }
.aa-brand-text strong { font-size: clamp(20px, 1.5vw, 26px); font-weight: 700; letter-spacing: 0.01em; }
.aa-brand-text em { font-style: normal; font-size: clamp(11.5px, 0.88vw, 13.5px); color: rgba(255, 255, 255, 0.78); margin-top: 3px; }

/* logo：白底圆角方 + 外投影，从红底上「浮」出来；后台换图片 logo 时图片撑满方块 */
.aa-mark {
  width: clamp(62px, 7.4vh, 84px);
  height: clamp(62px, 7.4vh, 84px);
  border-radius: 24%;
  font-size: clamp(28px, 3.4vh, 38px);
  background: #fff;
  color: var(--brand);
  box-shadow: 0 18px 34px -14px rgba(96, 0, 18, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

/* 图片版不能用白底：logo 图自身四角是透明的（圆角 26%），
   白底会顺着四个角透出来，红底上就是一圈显眼的白边。
   容器也一起打开 overflow + 裁成同一圆角，避免图片边角溢出。 */
.aa-mark:has(img) {
  background: transparent;
  box-shadow: 0 18px 34px -14px rgba(96, 0, 18, 0.55);
  overflow: hidden;
}

.aa-title {
  margin: 0 0 clamp(12px, 1.8vh, 18px);
  font-size: clamp(30px, 3.9vw, 68px);
  line-height: 1.28;
  letter-spacing: -0.022em;
  font-weight: 800;
  text-shadow: 0 2px 16px rgba(96, 0, 18, 0.16);
}

/* 关键词下的手绘波浪线：铺在字下方一条，跟着字号缩放。
   用 .3em 高度 + bottom 负值，字号变化时线不会盖住字脚。 */
.aa-u { position: relative; display: inline-block; }
.aa-ul {
  position: absolute;
  left: -2px;
  bottom: -0.1em;
  width: calc(100% + 4px);
  height: 0.3em;
  overflow: visible;
}

.aa-sub {
  margin: 0 0 clamp(18px, 2.6vh, 26px);
  max-width: 100%;
  font-size: clamp(13.5px, 1vw, 16.5px);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.9);
}

/* 2×2 能力卡：白底半透明，图标是彩色圆角方块 */
.auth-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 0.9vw, 12px);
  max-width: clamp(440px, 42vw, 720px);
}
.auth-cards li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  padding: clamp(10px, 1.4vh, 14px) clamp(11px, 0.9vw, 15px);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 15px;
  box-shadow: 0 12px 26px -20px rgba(96, 0, 18, 0.8);
  transition: transform 0.18s, box-shadow 0.18s;
}
.auth-cards li:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px -20px rgba(96, 0, 18, 0.8);
}
.ac-ico {
  grid-row: span 2;
  width: clamp(28px, 3.1vh, 34px);
  height: clamp(28px, 3.1vh, 34px);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 6px 12px -6px rgba(96, 0, 18, 0.55);
}
.ac-ico svg { width: 55%; height: 55%; }
.ac-red { background: linear-gradient(140deg, #ff6076, #e8173a); }
.ac-orange { background: linear-gradient(140deg, #ffb15c, #ff8a1f); }
.ac-blue { background: linear-gradient(140deg, #83aaff, #4b7bec); }
.ac-green { background: linear-gradient(140deg, #63d99b, #22b573); }
.auth-cards b { font-size: clamp(13px, 0.94vw, 14.5px); color: #2b1216; font-weight: 700; letter-spacing: 0.01em; }
.ac-desc { font-size: clamp(11px, 0.79vw, 12.5px); line-height: 1.45; color: #8f6a72; }

.aa-perks {
  position: relative;
  z-index: 2;
  list-style: none;
  margin: clamp(16px, 2.4vh, 26px) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(10px, 1.5vw, 26px);
  max-width: clamp(720px, 62vw, 1120px);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.aa-perks li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: clamp(11.5px, 0.85vw, 13.5px);
  color: rgba(255, 255, 255, 0.94);
}
.aa-perks i {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.26);
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 9px;
  line-height: 1;
}

.aa-foot {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: clamp(720px, 62vw, 1120px);
  margin: clamp(12px, 1.8vh, 20px) auto 0;
  font-size: 11.5px;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.58);
}

/* ---------- 右侧表单 ---------- */

.auth-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.2vh, 24px);
  padding: clamp(46px, 6vh, 70px) clamp(16px, 1.8vw, 36px) clamp(24px, 4vh, 40px);
  background:
    radial-gradient(760px 520px at 76% -8%, #fff0f3, transparent 62%),
    radial-gradient(620px 460px at 104% 106%, #fff6ef, transparent 60%),
    #fdfbfa;
}

/* 返回首页：固定在视口右上，长表单滚动时也够得着 */
.auth-close {
  position: fixed;
  top: 22px;
  right: 26px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 15px;
  border: 1px solid rgba(28, 25, 23, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-500);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--sh-1);
  backdrop-filter: blur(8px);
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.auth-close:hover {
  border-color: var(--brand-line);
  color: var(--brand);
  background: #fff;
}

.auth-card {
  width: 100%;
  max-width: clamp(400px, 92%, 480px);
  padding: clamp(28px, 3.8vh, 40px) clamp(24px, 2.4vw, 34px) clamp(20px, 2.8vh, 28px);
  background: #fff;
  border: 1px solid rgba(28, 25, 23, 0.05);
  border-radius: 22px;
  box-shadow: 0 34px 70px -34px rgba(255, 36, 66, 0.34), 0 2px 8px rgba(28, 25, 23, 0.04);
}

.auth-head h3 {
  margin: 0 0 7px;
  font-size: clamp(21px, 1.5vw, 26px);
  letter-spacing: -0.02em;
  line-height: 1.35;
  font-weight: 800;
}
.ah-brand { font-style: normal; color: var(--brand); }
.auth-head p { margin: 0 0 clamp(16px, 2.2vh, 22px); font-size: clamp(12.5px, 0.9vw, 13.5px); color: var(--ink-500); }

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: clamp(14px, 2vh, 20px);
  background: #f6f3f0;
  border-radius: 12px;
}
.atab {
  flex: 1;
  height: clamp(36px, 4.2vh, 42px);
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-family: inherit;
  font-size: clamp(13.5px, 0.95vw, 14.5px);
  font-weight: 600;
  color: var(--ink-400);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.atab:hover { color: var(--ink-700); }
.atab.is-active { background: #fff; color: var(--ink-900); box-shadow: 0 1px 3px rgba(28, 25, 23, 0.14); }

/* 输入框：图标在左，标签在框内上方（两行），焦点时整框描边
   —— 比「标签在框外」更紧凑，也是参考稿的样式。 */
.auth-form .field { margin-bottom: 11px; }
.auth-form .field-ico {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  cursor: text;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.auth-form .field-ico:focus-within {
  border-color: var(--brand-line);
  box-shadow: 0 0 0 3px rgba(255, 36, 66, 0.08);
}
/* 覆盖通用的 .field span（它是给「标签在框外」写的：13px 粗体 + 下边距） */
.auth-form .field-ico > .fi {
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--ink-400);
}
.auth-form .field-ico .fi svg { width: 17px; height: 17px; display: block; }
.auth-form .field-ico .fb { display: flex; flex-direction: column; min-width: 0; margin: 0; }
.auth-form .field-ico .fl {
  display: block;
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink-400);
}
.auth-form .field-ico .pw-wrap {
  display: block;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  position: relative;
}
/* 框内的 input 不再自带边框/底色，样式交给外层 .field-ico */
.auth-form .field-ico .text-input,
.auth-form .field-ico .text-input:focus {
  min-height: 0;
  height: 23px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: clamp(13.5px, 0.95vw, 15px);
  color: var(--ink-900);
  outline: none;
}
.auth-form .field-ico .text-input::placeholder { color: var(--ink-400); }
.auth-form .field-ico .pw-wrap .text-input { padding-right: 30px; }

.pw-eye {
  position: absolute;
  top: 50%;
  right: -2px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-400);
  cursor: pointer;
  transition: color 0.16s, background 0.16s;
}
.pw-eye:hover { color: var(--brand); background: var(--brand-soft); }
.pw-eye svg { width: 16px; height: 16px; display: block; }
.pw-eye .pe-on { display: none; }
.pw-eye.is-on .pe-off { display: none; }
.pw-eye.is-on .pe-on { display: block; }

.check-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: clamp(12px, 0.86vw, 13px);
  color: var(--ink-500);
  margin: 9px 0 12px;
  cursor: pointer;
}
.check-line input { width: 15px; height: 15px; accent-color: var(--brand); margin: 0; }

.auth-msg { font-size: 12.5px; color: var(--red); min-height: 17px; margin-bottom: 7px; line-height: 1.5; }
.auth-msg.ok { color: var(--green); }
/* 「为什么弹这个窗」的说明性提示：用中性色。
   默认的红色是报错色，用在引导语上会让人以为出了问题。 */
.auth-msg.is-tip { color: var(--ink-500); }

.btn-block { width: 100%; }

/* 主 CTA：整张表单唯一的实心色块，落点清晰 */
.auth-form .btn-primary {
  min-height: clamp(46px, 5.2vh, 54px);
  margin-top: 2px;
  border-radius: 12px;
  font-size: clamp(14.5px, 1vw, 16px);
  letter-spacing: 0.02em;
}

.auth-foot {
  margin: 15px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: clamp(12px, 0.86vw, 13px);
  color: var(--ink-400);
  text-align: center;
}
.auth-foot .mini-link { font-size: inherit; font-weight: 600; }

/* 卡片下方一条信任卖点：图标 + 标题 + 说明 */
.auth-trust {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: clamp(400px, 92%, 480px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.auth-trust li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 6px;
  align-items: center;
  color: var(--ink-400);
}
.auth-trust svg { grid-row: span 2; width: 17px; height: 17px; color: #cfc4bf; }
.auth-trust b { font-size: 11px; font-weight: 600; color: var(--ink-700); line-height: 1.4; }
.auth-trust span { font-size: 10.5px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 宽度分档 ---------- */

/* < 1240：插画让位。文案列本来就只有 ~420，再分 200 给插画会把 2×2 卡压成一行两字 */
@media (max-width: 1239.98px) {
  .aa-stage { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
  .aa-art { display: none; }
  .aa-perks, .aa-foot { max-width: 640px; }
}

/* < 1000：收成顶部通栏 + 表单（左面板不再占半屏） */
@media (max-width: 999.98px) {
  .auth-inner { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-aside {
    padding: 26px clamp(20px, 4vw, 40px) 26px;
    border-radius: 0 0 26px 26px;
  }
  .aa-stage { max-width: 660px; }
  .aa-mark { width: 54px; height: 54px; font-size: 24px; border-radius: 16px; }
  .aa-brand-text strong { font-size: 18px; }
  .aa-brand-text em { font-size: 11.5px; }
  .auth-brand { gap: 12px; margin-bottom: 18px; }
  .aa-title { font-size: clamp(22px, 4.2vw, 30px); margin-bottom: 10px; }
  .aa-sub { margin-bottom: 16px; font-size: 12.5px; line-height: 1.65; }
  .aa-sub .aa-br-sub { display: none; }
  .auth-cards { max-width: none; }
  .aa-perks { margin-top: 15px; }
  .aa-foot { max-width: none; margin-top: 12px; }
  .aa-glow-a { width: 320px; height: 320px; right: -120px; top: -140px; }
  .aa-glow-b { display: none; }
  .aa-dots { opacity: 0.26; }

  .auth-panel { padding: 14px 22px 40px; justify-content: flex-start; }
  .auth-card {
    max-width: 440px;
    padding: 22px 22px 18px;
    box-shadow: 0 22px 46px -30px rgba(255, 36, 66, 0.26), 0 1px 4px rgba(28, 25, 23, 0.04);
  }
  .auth-head h3 { font-size: 22px; }
  .auth-close {
    top: 14px;
    right: 14px;
    height: 32px;
    padding: 0 12px;
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    box-shadow: none;
  }
  .auth-close:hover { background: rgba(255, 255, 255, 0.3); color: #fff; border-color: #fff; }
}

/* 平板（640~999）：通栏很宽，文案居中 + 能力卡一行两列撑满 */
@media (min-width: 640px) and (max-width: 999.98px) {
  .aa-stage, .aa-copy { text-align: center; }
  .auth-brand { justify-content: center; }
  .aa-title { max-width: 600px; margin-left: auto; margin-right: auto; }
  .aa-sub { margin-left: auto; margin-right: auto; }
  .auth-cards { max-width: 560px; margin: 0 auto; text-align: left; }
  .aa-perks { justify-content: center; max-width: 600px; }
  .aa-foot { text-align: center; }
}

/* 手机（< 640）：能力卡让位给输入框，只留 logo / 标题 / 副标题 / 三卖点 */
@media (max-width: 639.98px) {
  .auth-aside { padding: 20px 18px 22px; }
  .auth-brand { margin-bottom: 14px; }
  .aa-title { font-size: 22px; }
  .aa-sub { font-size: 12px; margin-bottom: 12px; }
  .aa-sub .aa-br-sub { display: none; }
  .auth-cards { display: none; }
  .aa-perks { margin-top: 12px; gap: 8px 12px; justify-content: center; }
  .aa-perks li { font-size: 11px; }
  .aa-perks i { width: 14px; height: 14px; font-size: 8px; }
  .aa-foot { display: none; }
  .auth-panel { padding: 12px 16px 34px; }
  .auth-card { padding: 20px 18px 16px; }
  .auth-trust li span { display: none; }
  .auth-trust b { font-size: 10.5px; }
}

/* 超小屏（360 / 320）：上方通栏 + 卡片 会差 ~25px 出屏，整体再收一档 */
@media (max-width: 380px) {
  .auth-aside { padding: 16px 16px 18px; }
  .auth-brand { margin-bottom: 11px; }
  .aa-mark { width: 48px; height: 48px; font-size: 21px; border-radius: 14px; }
  .aa-title { font-size: 20px; }
  .aa-sub { font-size: 11.5px; margin-bottom: 10px; }
  .aa-perks { margin-top: 9px; gap: 6px 10px; }
  .aa-perks li { font-size: 10.5px; }
  .auth-panel { padding: 10px 14px 26px; }
  .auth-card { padding: 16px 14px 13px; border-radius: 18px; }
  .auth-head h3 { font-size: 19px; }
  .auth-head p { margin-bottom: 12px; font-size: 12px; }
  .auth-tabs { margin-bottom: 12px; }
  .auth-form .field { margin-bottom: 9px; }
  .auth-form .field-ico { padding: 7px 11px; gap: 9px; }
  .check-line { margin: 7px 0 9px; }
  .auth-msg { min-height: 15px; margin-bottom: 5px; }
  .auth-foot { margin-top: 12px; padding-top: 11px; }
}

/* 矮屏压缩竖向节奏（1280×800 / 1366×768 这类笔记本屏） */
@media (min-width: 1000px) and (max-height: 940px) {
  .aa-foot { margin-top: 12px; }
}

@media (min-width: 1000px) and (max-height: 880px) {
  .auth-aside { padding: 26px clamp(30px, 4.4vw, 74px) 20px; }
  /* 1366×768 上 logo 不能跟着 vh 涨：多 8px 就多 5px 滚动 */
  .aa-mark { width: 60px; height: 60px; font-size: 27px; }
  .auth-brand { margin-bottom: 18px; }
  .aa-title { font-size: clamp(28px, 2.6vw, 38px); margin-bottom: 10px; }
  .aa-sub { margin-bottom: 14px; font-size: 13px; }
  .art-svg { max-height: 38vh; }
  .auth-cards li { padding: 9px 11px; }
  .ac-ico { width: 26px; height: 26px; border-radius: 8px; }
  .auth-cards b { font-size: 12.5px; }
  .ac-desc { font-size: 10.5px; line-height: 1.4; }
  .aa-perks { margin-top: 14px; }
  .aa-foot { margin-top: 10px; font-size: 11px; }
  .auth-card { padding: 24px 26px 18px; }
  .auth-head p { margin-bottom: 14px; }
  .auth-tabs { margin-bottom: 12px; }
  .auth-form .field { margin-bottom: 9px; }
  .auth-form .field-ico { padding: 7px 12px; }
  .auth-form .btn-primary { min-height: 44px; }
  .auth-foot { margin-top: 12px; padding-top: 11px; }
}

/* ------------------------------ 激活升级 ------------------------------ */

.modal-wide { max-width: 560px; }

.plan-state {
  font-size: 13px;
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 18px;
  background: var(--line-soft);
  color: var(--ink-500);
  line-height: 1.6;
}
.plan-state.is-pro { background: #f3fbf6; color: #0a7a52; }
.plan-state b { color: inherit; }

.plan-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.plan-col {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  background: #fcfbf9;
}
.plan-col h4 {
  font-size: 13.5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.plan-col h4 i {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #b8860b, #e0a93b);
  border-radius: 999px;
  padding: 1px 7px;
}
.plan-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plan-col li { font-size: 12.5px; color: var(--ink-500); line-height: 1.55; padding-left: 15px; position: relative; }
.plan-col li::before { content: ·; position: absolute; left: 4px; color: var(--ink-400); }
.plan-col.pro { border-color: #f0dcb0; background: linear-gradient(180deg, #fffdf7, #fffaf0); }
.plan-col.pro li { color: var(--ink-700); }
.plan-col.pro li::before { content: ✓; font-size: 10px; color: #c9971f; left: 1px; top: 3px; }
.plan-col.pro li b { color: var(--ink-900); }

.code-input {
  font-family: var(--mono);
  /* 16px 是 iOS 的分水岭：小于它聚焦时 Safari 会自动放大整页 */
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ------------------------------ 历史记录 ------------------------------ */

.hist-list { display: grid; gap: 8px; max-height: 56vh; overflow-y: auto; }
.hist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fcfbf9;
  padding: 12px 14px;
  transition: border-color 0.16s, background 0.16s, transform 0.16s;
}
.hist-item:hover { border-color: var(--brand-line); background: var(--brand-soft); transform: translateY(-1px); }
.hist-main { flex: 1; min-width: 0; }
.hist-main b { display: block; font-size: 13.5px; color: var(--ink-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-main span { font-size: 12px; color: var(--ink-400); }
.hist-go { flex: none; font-size: 12.5px; font-weight: 600; color: var(--brand); }

.hist-empty { text-align: center; padding: 30px 0; color: var(--ink-400); font-size: 13.5px; }
.hist-empty .he-icon { font-size: 30px; display: block; margin-bottom: 8px; }

/* ------------------------------ 三端适配 ------------------------------ */

@media (max-width: 640px) {
  .uc-text { display: none; }
  .user-chip { padding: 0 8px 0 5px; gap: 4px; }
  /* 手机端弹层改 fixed 锚定视口：原来 right:-46px 会把 250px 弹层推出
     视口右缘（实测 390 宽视口溢出到 421），整页出现横向滚动、内容被挤开。
     fixed 相对视口定位，永不溢出。top 与手机端顶栏高度 56px 联动。 */
  .user-pop {
    position: fixed;
    top: 64px;
    right: 12px;
    left: auto;
    width: min(268px, calc(100vw - 24px));
  }
  .plan-compare { grid-template-columns: 1fr; }
  .quota-bar { font-size: 12.5px; padding: 10px 12px; }
  .hist-list { max-height: 62vh; }
}

@media (max-width: 380px) {
  .uc-avatar { width: 24px; height: 24px; font-size: 12px; }
}


/* 登录浮层打开时锁住页面滚动 */
body.gate-open { overflow: hidden; }

/* 提交失败时轻微抖动，比单纯变红更容易被注意到 */
.auth-form.shake { animation: chipShake 0.3s ease-in-out; }


/* iOS Safari 在聚焦字号小于 16px 的输入框时会自动放大整页，
   手机上把输入类控件统一提到 16px，避免登录时整页被顶飞。 */
@media (max-width: 640px) {
  .text-input,
  .source-input,
  .code-input { font-size: 16px; }
}


/* ==================================================================
   工作台布局：左输入 / 中文案 / 右诊断
   ------------------------------------------------------------------
   同一套 DOM，三档由视口宽度决定：

     ≥1200px    三栏 —— 输入常驻左栏，文案在中栏，诊断与合规在右栏，
                        四个面板同时可见，不再需要 Tab
     840~1200px 两栏 —— 输入常驻左栏，右侧结果全宽；面板同样全部同屏
     <840px     单栏 —— 回到顶部吸顶 Tab 切换，与移动端行为一致

   ⚠️ 关键前提：宽屏下面板「全部常显」，所以显隐由这里的 CSS 决定。
   此时 JS 不能再给 .tab-panel 加 .hidden（那是 display:none !important，
   会盖过这里的规则），详见 app.js 的 applyPanelVisibility()。
   ================================================================== */

.workbench { display: block; }

.wb-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.wb-col + .wb-col { margin-top: 18px; }

.ws-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* flex 容器已用 gap 控制间距，卡片自带的下边距必须清零，否则会叠加 */
.wb-col > .card,
.ws-group > .section,
.ws-group > .result-tabs { margin-bottom: 0; }

/* ------------------------------ 宽屏（≥840px）共用 ------------------------------ */

@media (min-width: 840px) {
  /* 面板同屏展示后，吸顶 Tab 已无意义 */
  #resultTabs { display: none; }

  /* 多栏后画布要跟着放宽：两栏区给到 1240（≥1200 的三栏块再提到 1760）。
     基础 .wrap 的 1060 是给单栏长页定的，横向排版下会把中栏压窄。 */
  .wrap { max-width: 1240px; }

  .wb-col + .wb-col { margin-top: 0; }

  /* 中栏宽度有限，封面图横排会把正文挤扁，改为竖排 */
  .wb-mid .note-top { flex-direction: column; }
  .wb-mid .note-covers { max-width: 100%; }

  /* hero 收成一行：左栏是 sticky + 内部滚动容器，hero 每高一点左栏就矮一点，
     主 CTA 就更容易被挤到折叠线以下。收成一行后左栏从 y≈114 起，900px 视口内能整栏放下。 */
  .hero { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 14px; padding: 14px 0 12px; text-align: left; }
  .hero h1 { font-size: 21px; margin: 0; }
  .hero p { font-size: 13px; margin: 0; max-width: none; }
  .hero-tags { display: none; }

  /* 左栏常驻：滚动时钉在顶栏下方；内容超出视口则左栏自身滚动，
     这样滚到再下面也能随时改要求、点生成。
     136px = 顶栏 62 + hero ~52 + 上下留白 22 —— 调 hero 高度时这个数要跟着改。 */
  .wb-left {
    position: sticky;
    top: 82px;
    max-height: calc(100vh - 136px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  /* 滚动条出现时不挤压卡片内容 */
  .wb-left { scrollbar-gutter: stable; }

  /* 输入卡片实测 810px 高，而左栏 max-height 只有 calc(100vh - 104px)：
     800px 高的笔记本上只有 696px，主 CTA 会被挤进内部滚动区 —— 不滚内部滚动条就看不到
     「开始生成文案」（游客态还多一块额度提示，更高）。所以把操作条钉在滚动容器底部，
     无论卡片多高都永远可见。负外边距吃满卡片内边距、铺不透明背景 + 上沿细线，
     让上方内容从它下面滚过去，视觉上仍是卡片的收尾。 */
  .wb-left .actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    background: var(--card);
    margin-left: calc(var(--ic-px, 24px) * -1);
    margin-right: calc(var(--ic-px, 24px) * -1);
    margin-bottom: calc(var(--ic-pb, 24px) * -1);
    padding: 12px var(--ic-px, 24px) var(--ic-pb, 24px);
    /* 去掉上边线后用一层极浅上投影提示「下面还有内容被盖住」 */
    box-shadow: 0 -12px 14px -14px rgba(28, 25, 23, 0.22);
    border-radius: 0 0 var(--r-xl) var(--r-xl);
  }

  /* 宽屏下压缩左栏，把垂直空间让给结果 */
  /* 左栏是竖长的表单：宽度不够时 .input-head 会把说明文字挤在分段控件右侧
     那点零头里折成 4 行窄条，整块看起来就是"挤在一起"。所以左栏优先给宽。 */
  .wb-left .input-card { padding: 22px; --ic-px: 22px; --ic-pb: 22px; }
  /* rows=4 的自然高度只有 ~129，min-height 必须超过它才起效（之前写 96 等于没写）。
     200：一段两百字的笔记粘进来刚好露出四行半，不用边写边滚。 */
  .wb-left .source-input { min-height: 200px; }
  .wb-left .styles-block { margin-top: 18px; }
  /* 芯片按内容宽度 wrap 会参差不齐；等宽两列 + 文字居中更整齐 */
  .wb-left .chips { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .wb-left .chip { justify-content: center; }
  .wb-left .actions { margin-top: 18px; }
  .wb-left .progress-card { padding: 16px 22px; }

  /* 分段控件与说明文字改成上下两段（并排时说明只有 ~90px 宽、要折 4 行；
     整宽后只需 2 行，卡片总高反而更低），模式按钮均分整行。 */
  .wb-left .input-head { flex-direction: column; align-items: stretch; gap: 9px; margin-bottom: 12px; }
  .wb-left .seg { width: 100%; }
  .wb-left .seg-item { flex: 1; }
  .wb-left .hint { line-height: 1.65; }
  .wb-left .input-foot { gap: 10px; margin-top: 10px; }
}

/* ------------------------------ 两栏（840 ~ 1200px） ------------------------------ */

@media (min-width: 840px) and (max-width: 1199.98px) {
  .workbench {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }
  .wb-left { grid-column: 1; grid-row: 1; }
  .wb-mid { grid-column: 2; grid-row: 1; }
  .wb-right { grid-column: 2; grid-row: 2; }
}

/* ------------------------------ 三栏（≥1200px） ------------------------------ */

@media (min-width: 1200px) {
  /* 三栏需要更宽的画布；仍是居中定宽，不是全宽拉伸。
     1760 在 1920 屏上左右各留 60px，2560 屏各留 380px，1920 以下跟着视口走。 */
  .wrap { max-width: 1760px; }

  /* 两侧栏用「百分比 + 下限」而不是固定像素：
     固定 336/308 在 1200px 刚进三栏时会把中栏压到 468px，比手机还窄。
     左栏给到 29% 是因为它装了分段控件 + 说明 + 输入框 + 风格芯片 + 额外要求 +
     配额条 + 按钮组，是全场最长的表单，窄一点整块就"挤在一起"（用户两次反馈）。
     右栏反而可以收一点：它只有诊断与合规，本来就是单列紧凑版。 */
  .workbench {
    display: grid;
    grid-template-columns: minmax(368px, 29%) minmax(0, 1fr) minmax(300px, 22%);
    gap: 20px;
    align-items: start;
  }
  .wb-left { grid-column: 1; grid-row: 1; }
  .wb-mid { grid-column: 2; grid-row: 1; }
  .wb-right { grid-column: 3; grid-row: 1; }

  /* hero 已在 ≥840 的共用块收成一行（.hero 的 flex 版式），这里只放大标题字号，
     不要再改 padding / margin —— 左栏的 max-height 是按 hero 高度算死的 */
  .hero h1 { font-size: 23px; }

  /* 右栏约 348px，诊断与合规仍走单列紧凑版（两列的话每格只有 ~168px，
     ring + 说明文字挤成一团） */
  .wb-right .section { padding: 18px 18px; }
  .wb-right .section-head { padding-bottom: 0; margin-bottom: 12px; }
  .wb-right .section-head h2 { font-size: 15px; }
  .wb-right .overall b { font-size: 22px; }

  .wb-right .score-grid { grid-template-columns: 1fr; gap: 9px; }
  .wb-right .score-item { padding: 12px 13px; gap: 11px; border-radius: var(--r-md); }
  .wb-right .ring-wrap,
  .wb-right .ring { width: 50px; height: 50px; }
  .wb-right .ring-num { font-size: 15px; }
  .wb-right .score-label { font-size: 13px; }
  .wb-right .score-comment { font-size: 12px; }

  .wb-right .analysis-extra { grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
  .wb-right .extra-col { padding: 13px 14px; border-radius: var(--r-md); }
  .wb-right .extra-col li { font-size: 12.5px; }
  .wb-right .summary-line { font-size: 12.5px; padding: 11px 13px; margin-top: 13px; }

  .wb-right .risk-summary { grid-template-columns: repeat(2, 1fr); gap: 9px; margin-bottom: 14px; }
  .wb-right .risk-cell { padding: 11px 8px; }
  .wb-right .risk-cell b { font-size: 19px; }
  .wb-right .risk-cell span { font-size: 11.5px; }
  .wb-right .panel-empty { padding: 34px 0 26px; }

  /* 命中表格在窄栏里横向放不下，改成卡片块（与手机端同一套做法） */
  .wb-right .hit-table thead { display: none; }
  .wb-right .hit-table,
  .wb-right .hit-table tbody,
  .wb-right .hit-table tr,
  .wb-right .hit-table td { display: block; width: 100%; }
  .wb-right .hit-table tr {
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 11px 12px;
    margin-bottom: 9px;
  }
  .wb-right .hit-table td { border: 0; padding: 2px 0; }
  .wb-right .hit-table td::before {
    content: attr(data-label);
    display: inline-block;
    min-width: 48px;
    color: var(--ink-400);
    font-size: 11.5px;
  }
  .wb-right .clean-state { padding: 18px 0 8px; }
  .wb-right .clean-state .icon { font-size: 28px; }

  /* 中栏的文案卡片在宽栏里不必撑满，行宽过长的正文反而难读 */
  .wb-mid .v-text { font-size: 15px; }
}

/* ==================================================================
   空态（≥840px，body.ws-empty）
   ------------------------------------------------------------------
   还没生成过文案时，中栏/右栏是两块空占位卡，又空又散。
   此时只保留输入面板并加宽到视口的 58%（封顶 920），页面聚焦在
   一件事上：粘贴 → 生成。宽屏下这是一张「产品首页级」的大卡，
   而不是缩在角落的小表单。

   ⚠️ ws-empty 必须写在 index.html 的 <body class="ws-empty"> 上：
   等 JS 初始化再加，首帧会先画出中右栏空占位再收起 —— 用户看到
   的就是「中间闪一下就没了」。
   开始生成时 app.js 摘掉该类，输入卡 FLIP 滑向左栏、中右栏错峰
   淡入（见 syncEmptyState）。
   ================================================================== */
@media (min-width: 840px) {
  /* 背景分三层：品牌柔光（-2）→ 点阵（-1）→ 内容。
     纯白底上放一张白卡像"没做完的页面"；有了纵深，同样的卡才有了
     产品首页的分量。光斑用 fixed，滚动时不动，不会跟着页面"漂"。 */
  body.ws-empty::before { opacity: 1; }
  body.ws-empty::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(rgba(28, 25, 23, 0.055) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse 74% 56% at 50% 16%, #000 0%, transparent 74%);
    mask-image: radial-gradient(ellipse 74% 56% at 50% 16%, #000 0%, transparent 74%);
  }

  body.ws-empty .wb-mid,
  body.ws-empty .wb-right { display: none; }

  body.ws-empty .workbench { display: block; }
  body.ws-empty .wb-left {
    /* 单卡独占页面：不需要 sticky 内滚，也不需要吸底操作条。
       宽度按视口 64% 走（1440 → 922），封顶 1000：再宽就成"被拉扁的表单"，
       超宽屏那一档（≥1600）单独放宽到 1320，见文件末尾的「超宽屏」段。
       ⚠️ .hero-art 的容器宽度用同一个表达式 +480，改这里要一起改。 */
    position: static;
    width: 100%;
    max-width: clamp(720px, 64vw, 1000px);
    margin: 0 auto;
    max-height: none;
    overflow: visible;
  }

  /* 大卡：内距、输入区、投影一起加一档 —— 有分量才叫大气。
     投影里掺一点品牌色，卡片像"浮"在暖底上，而不是贴了张灰纸。
     顶部一道渐变高光线：极细，但让卡片边缘有"被光打亮"的质感。 */
  body.ws-empty .wb-left .input-card {
    position: relative;
    padding: 26px;
    --ic-px: 26px;
    --ic-pb: 26px;
    border-radius: 26px;
    box-shadow: var(--sh-3), 0 44px 84px -46px rgba(255, 36, 66, 0.18);
  }
  body.ws-empty .wb-left .input-card::before {
    content: "";
    position: absolute;
    left: 26px;
    right: 26px;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 36, 66, 0.6), rgba(255, 168, 92, 0.55), transparent);
    pointer-events: none;
  }
  /* 输入区做大是这张卡的主体，但 1440×900 的笔记本屏上要留出底部 CTA：
     192 时按钮离屏底还有 29px。加到 216（+24）会把余量吃到 5px，
     所以风格区上边距同时从 18 收到 14 把空间补回来 */
  body.ws-empty .wb-left .source-input { min-height: 216px; font-size: 15px; }
  body.ws-empty .wb-left .styles-block { margin-top: 14px; }
  /* 分段控件不跟着卡片一路撑满，收在 460px 更精致 */
  body.ws-empty .wb-left .seg { max-width: 460px; }
  /* 6 种风格排 3 列：版面舒展，也少一行高度 */
  body.ws-empty .wb-left .chips { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  /* 大卡里的芯片比三栏时更饱满（三栏里 chip 被挤在 300px 内，这里不缺宽度） */
  body.ws-empty .wb-left .chip { min-height: 42px; font-size: 13.5px; padding: 8px 14px; }
  /* 主按钮在大卡里跟着放大，视觉落点更重 */
  body.ws-empty .wb-left .btn-primary { min-height: 52px; font-size: 15.5px; }
  /* 次要按钮跟着同一高度，否则「加载示例」在 52px 的主按钮旁边矮一截 */
  body.ws-empty .wb-left .btn { height: 52px; }
  body.ws-empty .wb-left .actions { gap: 12px; }

  body.ws-empty .wb-left .actions {
    position: static;
    margin: 18px 0 0;
    padding: 0;
    background: none;
    box-shadow: none;
    border-radius: 0;
  }

  /* 空态 hero 从「一行小标题」放回居中堆叠的首屏标题（展开后自动收回一行）。
     注意必须改 flex-direction：横向排列时 p 的 margin:auto 会吃掉剩余空间，
     把标题和说明顶到两端。 */
  body.ws-empty .hero {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    /* 1440×900 上整卡底边必须留在首屏（实测 18/10 会让卡底出屏 8px） */
    padding: 12px 0 6px;
    text-align: center;
  }
  body.ws-empty .hero h1 {
    font-size: clamp(27px, 2.8vw, 37px);
    letter-spacing: -0.5px;
    margin: 0 0 11px;
  }
  body.ws-empty .hero p { font-size: 14.5px; max-width: 720px; margin: 0 auto; }
  /* 宽屏平时把能力标签藏起来（生成后要收紧版面），空态放出来当首屏说明 */
  body.ws-empty .hero-tags { display: flex; margin-top: 13px; }
  body.ws-empty .hero-spark { display: inline-block; }
  body.ws-empty .hero-tags span {
    padding: 5px 13px;
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(255, 36, 66, 0.12);
    color: var(--ink-600);
    font-weight: 500;
  }

  /* 操作条往上收一点，抵掉 hero 放大带来的高度 —— 1440×900 首屏必须留住 CTA */
  body.ws-empty .wb-left .actions { margin-top: 8px; }
  body.ws-empty .wb-left .btn-primary {
    box-shadow: 0 12px 26px -14px rgba(255, 36, 66, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  }
}

/* ==================================================================
   空态装饰插画（≥1360px）
   ------------------------------------------------------------------
   单栏卡居中后两侧是空的。参考稿用「笔记卡 + 手写体 + 箭头」和
   「App 图标 + 徽标」把这块空间填成品牌氛围 —— 而不是再加一栏内容
   （右侧曾经塞过一块「生成效果预览」，反馈是多出来的，已删）。
   插画层 fixed，容器宽 = 卡片宽 + 两侧各 240（插画 214 + 26 间距），
   用同一个 clamp 表达式居中摆放，所以任何视口下插画与卡片的间距都是 26px，
   卡片变宽它也等比外扩。1360 以下两侧塞不下，直接不显示。
   ================================================================== */
.hero-art {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  /* 卡片宽度 + 两侧各 240（插画 214 + 26 间距），所以跟卡片永远保持 26px。
     表达式必须和 body.ws-empty .wb-left 的 max-width 一致。 */
  width: calc(clamp(720px, 64vw, 1000px) + 480px);
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
  /* 不做 display:none —— 那样没法淡出。用 visibility 收掉命中与朗读 */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0s 0.5s;
}
.hero-art > * { position: absolute; }

.ha-note {
  left: 0;
  top: 288px;
  width: 214px;
  transform: rotate(-7deg);
  filter: drop-shadow(0 20px 34px rgba(255, 36, 66, 0.12));
}
.ha-arrow { left: 146px; top: 448px; width: 86px; opacity: 0.92; }

/* 手写体：楷体系（Mac 楷体/华文楷体、Win KaiTi），安卓落到系统 serif ——
   没有手写字体时宁可"偏文气"也不要"偏 UI" */
.ha-script {
  left: 12px;
  top: 544px;
  margin: 0;
  font-family: "Kaiti SC", "STKaiti", KaiTi, "KaiTi_GB2312", "Songti SC", serif;
  font-size: 21px;
  line-height: 1.5;
  letter-spacing: 2px;
  color: #b8526a;
  transform: rotate(-4deg);
  text-shadow: 0 1px 0 #fff;
}

/* 右侧 App 图标：直接拿站点 logo 当"3D 图标"，后台换 logo 会跟着变，
   不用再维护一张装饰图片。旋转 + 大投影 + 顶部高光造体积。 */
.ha-app {
  right: 84px;
  top: 244px;
  width: 124px;
  height: 124px;
  transform: rotate(8deg);
  filter: drop-shadow(0 28px 40px rgba(255, 36, 66, 0.34)) drop-shadow(0 6px 12px rgba(255, 36, 66, 0.22));
}
.ha-app .brand-mark {
  width: 100%;
  height: 100%;
  border-radius: 30px;
  font-size: 48px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3);
}
/* 图片 logo 自带高光，inset 白线会浮在图片上沿，一起去掉 */
.ha-app .brand-mark:has(img) { box-shadow: none; }

.ha-badge {
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 36, 66, 0.1);
  box-shadow: 0 10px 22px -12px rgba(255, 36, 66, 0.5);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
  white-space: nowrap;
}
.ha-badge-a { right: 30px; top: 204px; transform: rotate(3deg); }
/* 卡片右边缘到图标左边缘只有 32px，塞不下 96px 的胶囊 —— 放到图标下沿，
   稍微压住图标一点点，读作「从图标里飞出来的」。 */
.ha-badge-b { right: 118px; top: 372px; transform: rotate(-5deg); color: #e8622f; }

.ha-star { color: #ffb3c2; }
.ha-star-a { left: 176px; top: 566px; width: 15px; }
.ha-star-b { right: 96px; top: 194px; width: 19px; color: #ffc9a0; }
.ha-star-c { right: 224px; top: 430px; width: 9px; color: #ffd3dc; }

@media (min-width: 1360px) {
  body.ws-empty .hero-art {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease;
  }
}
/* ==================================================================
   空态卡片里的细节（≥1200px）
   ================================================================== */
@media (min-width: 1200px) {
  /* 6 种风格排一行：和参考稿一致，也省下一行 52px 的高度 */
  body.ws-empty .wb-left .chips { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  /* 列宽最窄时（1200 附近 ~111px）只有内边距能省，收紧一点给文字留余量 */
  body.ws-empty .wb-left .chip { padding: 8px 10px; }
}

/* ==================================================================
   超宽屏（≥1600px）
   ------------------------------------------------------------------
   1440 以下那套尺寸是按笔记本屏定的：卡片封顶 1000、标题封顶 37px、
   顶栏 62px。放到 2160 / 2560 的屏上，等于把一整页 1440 的版式原样
   摆在更大的画布中央 —— 四周全是空白，读起来就是「缩在中间的一小块」。
   这里按视口重新给一档，而不是把原来的版式横向拉宽：
     · 卡片跟着变宽，但恒定给两侧插画留 260（100vw - 520），封顶 1320；
     · 顶栏、插画、字号、输入区、按钮一起放大，整页等比"抬一档"；
     · 只有高度也够（≥1010）时才放大竖向尺寸，否则 1600×900 的窗口
       会把底部 CTA 顶出首屏。
   ================================================================== */
@media (min-width: 1600px) {
  /* 顶栏：34px 的 logo + 15px 的站名在 2160 屏上像没做完 */
  .topbar-inner { height: 68px; }
  /* ⚠️ 必须限定 .topbar-inner：登录页的 .aa-mark 也带 .brand-mark，
     裸写会把 76~108 的登录 logo 一起压成 40 */
  .topbar-inner .brand-mark { width: 38px; height: 38px; font-size: 18px; }
  .brand-text strong { font-size: 16px; }
  .brand-text em { font-size: 12px; }
  .user-chip { height: 42px; }
  /* 顶栏高了 6px，工作台左栏的吸顶位与可用高度同步 +6 */
  .wb-left { top: 88px; max-height: calc(100vh - 142px); }
  /* 顶上多占的 6px 从 hero 的上下留白里扣回来，1600×900 才不会出屏 */
  body.ws-empty .hero { padding: 6px 0 2px; }

  /* 卡片 + 两侧插画：两个表达式必须一致 */
  body.ws-empty .wb-left { max-width: min(1200px, calc(100vw - 580px)); }
  .hero-art { width: calc(min(1200px, calc(100vw - 580px)) + 480px); }

  /* 字号可以随宽度走，高度不行：1600×900 上多 8px 就把 CTA 顶出屏 */
  body.ws-empty .wb-left .source-input { font-size: 15.5px; }

  /* 插画同步放大。改尺寸的同时反推偏移，保证与卡片的 26px 间距不变：
     笔记卡 214→240，左边距 0→-26（右边缘仍是 214）；logo 124→140，right 84→68。 */
  .ha-note { width: 240px; left: -26px; top: 296px; }
  .ha-arrow { left: 152px; top: 470px; width: 96px; }
  .ha-script { font-size: 23px; left: 6px; top: 574px; }
  .ha-app { width: 140px; height: 140px; right: 68px; top: 232px; }
  .ha-app .brand-mark { font-size: 56px; border-radius: 34px; }
  .ha-badge { font-size: 13px; padding: 8px 16px; }
  .ha-badge-a { right: 26px; top: 196px; }
  .ha-badge-b { right: 104px; top: 384px; }
  .ha-star-a { left: 190px; top: 600px; }
  .ha-star-b { right: 78px; top: 182px; }
  .ha-star-c { right: 250px; top: 448px; }

  /* 登录页：右栏命中 620 上限后，卡片再放大一档，两侧留白才不会越拉越大 */
  .auth-card, .auth-trust { max-width: 520px; }
  .art-svg { max-height: 520px; }
}

/* 高度也够（≥1010）时，把排版整体放大一档 —— 这才是"大气"的来源：
   同样的内容在更大的屏上要有更大的字、更大的控件，而不是更大的空白。 */
@media (min-width: 1600px) and (min-height: 1050px) {
  /* 竖向居中：整块内容（顶栏 + hero + 卡）大约 1060 高，
     多出来的高度对半分给顶部，2560×1440 才不会"全挤在上面、下面一大片白" */
  /* 顶部最多补 120px：2560×1440 下整块 1267 高，补满 190 虽然更居中，
     但点「开始生成」时要一次性塌掉 190px，跳得太狠；120 已经在视觉上够平衡 */
  body.ws-empty .hero { padding: clamp(10px, calc((100vh - 1060px) / 2), 120px) 0 4px; }
  body.ws-empty .hero h1 {
    font-size: clamp(40px, 2.7vw, 58px);
    letter-spacing: -1px;
    margin-bottom: 14px;
  }
  body.ws-empty .hero p { font-size: 16px; max-width: 840px; }
  body.ws-empty .hero-tags { margin-top: 16px; gap: 10px; }
  body.ws-empty .hero-tags span { font-size: 13.5px; padding: 6px 16px; }
  body.ws-empty .hero-tags svg { width: 15px; height: 15px; }

  body.ws-empty .wb-left .input-card {
    padding: 32px;
    --ic-px: 32px;
    --ic-pb: 32px;
    border-radius: 30px;
  }
  body.ws-empty .wb-left .input-card::before { left: 32px; right: 32px; }
  body.ws-empty .wb-left .source-input {
    /* 23vh：1920×1080 时 248（原 21vh/227 偏矮，四五行文案只占半截） */
    min-height: clamp(240px, 23vh, 300px);
    font-size: 16px;
  }
  body.ws-empty .wb-left .input-foot { font-size: 13px; }
  body.ws-empty .wb-left .styles-block { margin-top: 22px; }
  body.ws-empty .wb-left .styles-head { margin-bottom: 12px; }
  body.ws-empty .wb-left .styles-head .label { font-size: 14.5px; }
  body.ws-empty .wb-left .seg { max-width: 520px; }
  body.ws-empty .wb-left .seg-item { min-height: 40px; font-size: 14.5px; padding: 8px 20px; }
  body.ws-empty .wb-left .chips { gap: 12px; }
  body.ws-empty .wb-left .chip { min-height: 50px; font-size: 14.5px; padding: 8px 16px; }
  body.ws-empty .wb-left .text-input { min-height: 50px; font-size: 15px; }
  body.ws-empty .wb-left .btn { height: 58px; }
  body.ws-empty .wb-left .btn-primary { min-height: 58px; font-size: 17px; }
  body.ws-empty .wb-left .actions { gap: 14px; margin-top: 10px; }

  /* 插画跟着卡片竖向居中：上面这些 top 都是按 1080 高、卡顶 256 定的绝对值。
     1440 高的屏上卡会被推到 436，插画却还停在 296 —— 变成飘在卡片上方。
     改成「视口中心 ± 偏移」，1080 下结果与原来逐像素相同，高屏上与卡同步下移。 */
  .ha-note { top: calc(50% - 244px); }
  .ha-arrow { top: calc(50% - 70px); }
  .ha-script { top: calc(50% + 34px); }
  .ha-app { top: calc(50% - 308px); }
  .ha-badge-a { top: calc(50% - 344px); }
  .ha-badge-b { top: calc(50% - 156px); }
  .ha-star-a { top: calc(50% + 60px); }
  .ha-star-b { top: calc(50% - 358px); }
  .ha-star-c { top: calc(50% - 92px); }
}

/* ==================================================================
   4K 屏（≥2200px，常见于 2560×1440 的视口）
   ------------------------------------------------------------------
   ≥1600 那一档把卡片放到 1200 就封顶了，到 2560 上只占 47%，又回到
   "缩在中间的一小块"。这一档只放大三个落点：卡片、标题、登录表单，
   其余保持上一档，避免层级太多。
   ================================================================== */
@media (min-width: 2200px) {
  body.ws-empty .wb-left { max-width: 1360px; }
  .hero-art { width: 1840px; }
  body.ws-empty .hero h1 { font-size: 64px; }
  body.ws-empty .hero p { font-size: 17px; max-width: 900px; }

  /* 插画同步放大，右边缘/左边缘反推，保持与卡片 26px 的间距 */
  .ha-note { width: 280px; left: -66px; }
  .ha-app { width: 168px; height: 168px; right: 40px; }
  .ha-app .brand-mark { font-size: 68px; border-radius: 40px; }
  .ha-badge-a { right: 6px; }
  .ha-badge-b { right: 76px; }

  .auth-card, .auth-trust { max-width: 560px; }
  .aa-title { font-size: 64px; }
  .aa-mark { width: 92px; height: 92px; font-size: 42px; }
  .art-svg { max-height: 580px; }
}

/* ==================================================================
   手机端底部固定导航（< 640px）
   ------------------------------------------------------------------
   手机上放不下三栏，改成「一次只显示一个视图」：
     输入视图 = 左栏（输入卡；进度卡会被挪到结果视图顶部，见 app.js）
     结果视图 = 中栏 + 右栏，只显示当前选中的那一个面板
   底部导航接管了原来顶部吸顶 Tab 的职责，所以顶部那个在手机上隐藏。
   ================================================================== */

.mobile-tabs { display: none; }

/* ------------------------------ 封面图灯箱 ------------------------------ */

.lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(28, 25, 23, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: lbIn 0.16s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lbIn { from { opacity: 0; } }

.lightbox img {
  max-width: min(92vw, 1080px);
  max-height: 88vh;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  background: var(--card);
  user-select: none;
  -webkit-user-drag: none;
}

.lb-btn {
  position: absolute;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 22px; line-height: 1;
  transition: 0.16s;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.26); }
.lb-btn.is-off { display: none; }
.lb-close { top: 18px; right: 18px; font-size: 17px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }

.lb-count {
  position: absolute;
  left: 50%; bottom: 22px; transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}
.lb-count:empty { display: none; }

/* ------------------------------ 交互动效 ------------------------------
   统一节奏：进场 0.16-0.3s、ease-out、位移 ≤14px；prefers-reduced-motion
   已在 :root 级全局兜底，这里的动画无需逐个判断。 */

/* Tab / 面板从隐藏变可见时的一次性轻进场（display:none 无法 transition，用 keyframes） */
@keyframes panelIn { from { opacity: 0; transform: translateY(6px); } }
.tab-panel.panel-in { animation: panelIn 0.18s ease-out; }

/* 版本卡交错进场：新卡创建时挂 .enter，delay 由 JS 内联写入 */
.version.enter { animation: rise 0.3s cubic-bezier(0.22, 1, 0.36, 1) backwards; }

/* 复制成功的就地反馈 */
.text-btn.copied { color: var(--green); font-weight: 600; }

/* 生成按钮 loading：spinner 顶替原本的 sparkle 图标（不叠加、不挤位） */
.btn-primary.is-busy { position: relative; }
.btn-primary.is-busy > svg { display: none; }
.btn-primary.is-busy::before {
  content: '';
  display: inline-block;
  width: 17px; height: 17px;
  margin-right: 8px;
  flex: none;
  vertical-align: -3px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 风格芯片选中的「按下去」手感（点击时由 JS 重播） */
@keyframes chipPop { 0% { transform: scale(1); } 45% { transform: scale(1.06); } 100% { transform: scale(1); } }
.chip.pop { animation: chipPop 0.18s ease; }

/* ------------------------------ 添加到桌面 ------------------------------ */

/* 顶栏入口：小胶囊「＋ 桌面」 */
.desk-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-700);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.desk-btn:hover { color: var(--brand); border-color: var(--brand-line); background: var(--brand-soft); }
.desk-btn svg { flex: none; }

/* 引导浮层：与 authGate 同语言的居中卡片 */
.desk-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(28, 25, 23, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: lbIn .18s ease;
}
.desk-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  padding: 24px 22px 22px;
  animation: popIn .2s ease;
}
.desk-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 30px; height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--line-soft);
  color: var(--ink-500);
  font-size: 14px;
  display: grid;
  place-items: center;
}
.desk-close:hover { background: var(--line); color: var(--ink-900); }

.desk-head { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-bottom: 14px; }
.desk-badge {
  width: 40px; height: 40px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: var(--brand-grad);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 12px rgba(255, 36, 66, 0.25);
}
.desk-head h3 { font-size: 17px; }
.desk-head p { font-size: 13px; color: var(--ink-500); }

.desk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.desk-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-700);
}
.desk-list b:first-child {
  flex: none;
  width: 20px; height: 20px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  display: grid;
  place-items: center;
}
.desk-list span svg { vertical-align: -8px; color: var(--brand); }

@media (max-width: 639.98px) {
  .desk-gate { align-items: flex-end; padding: 12px; }
  .desk-card { animation: rise .22s cubic-bezier(0.22, 1, 0.36, 1); }
}

@media (max-width: 639.98px) {
  .lightbox img { max-width: 94vw; max-height: 74vh; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}

@media (max-width: 639.98px) {
  /* 上下各挂一套导航会让人困惑，手机端只留底部这一套 */
  #resultTabs { display: none; }

  /* 默认（刚打开、或点了「输入」）只看输入区 */
  body:not(.mb-result) .wb-mid,
  body:not(.mb-result) .wb-right { display: none; }
  body.mb-result .wb-left { display: none; }

  /* 结果视图里两个栏容器都可能承载当前面板，空的那个不该撑出间距 */
  .wb-col + .wb-col { margin-top: 0; }

  /* 给底部导航留出空间，否则页面最后一截会被盖住 */
  main.wrap { padding-bottom: calc(58px + env(safe-area-inset-bottom) + 16px); }
  .foot { padding: 18px 0 8px; }

  /* 手机屏只有 844px 高，hero 在**每个**视图里都重复占掉近 1/3 屏，
     看文案时尤其浪费（用户已经在结果里了，不需要再被推销一遍）。
     所以只在结果视图把 hero 收成一行小标题；输入视图仍保留完整的首屏介绍。 */
  body.mb-result .hero { padding: 16px 0 10px; text-align: left; }
  body.mb-result .hero h1 { font-size: 20px; margin-bottom: 0; }
  body.mb-result .hero p,
  body.mb-result .hero-tags { display: none; }

  .mobile-tabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--line);
    /* iPhone 底部小黑条 */
    padding-bottom: env(safe-area-inset-bottom);
    /* 底部导航悬浮感：向上柔光 */
    box-shadow: 0 -6px 20px rgba(28, 25, 23, 0.06);
  }
  .mobile-tabs::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
    pointer-events: none;
  }

  .mb-tab {
    /* 竖向排列时不要用 flex:1 —— flex-basis 会变成 0 从而忽略 height，
       按钮会塌成一行文字的高度（这个坑在响应式按钮上踩过一次） */
    flex: none;
    height: 58px;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    background: transparent;
    color: var(--ink-400);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: color 0.18s, transform 0.12s;
    -webkit-tap-highlight-color: transparent;
  }
  /* 触摸按压反馈：整列轻微下压 */
  .mb-tab:active { transform: scale(0.94); }

  .mb-ico {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .mb-tab.is-active { color: var(--brand); }
  /* 选中瞬间图标弹一下（手动重播 class，见 app.js） */
  .mb-tab.is-active .mb-ico { transform: translateY(-1px); }
  .mb-tab.pop .mb-ico { animation: mb-pop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1); }
}
@keyframes mb-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.18) translateY(-1.5px); }
  100% { transform: scale(1) translateY(-1px); }
}
