/* public/css/wxstudio.css —— 校园创作工作台 v3.0
   设计取向：老师是主角，界面不抢戏。
   · 左栏是"做事的地方"（三步：写什么 → 改一改 → 发出去）
   · 右栏是"看到结果的地方"（真机预览 + 合规体检），所见即所得
   · 配色克制：中性灰底 + 一个主色（正红，与校园场景一致），状态色只用在体检结论上

   ★★ v3.0.1 起改为主色域 CSS ★★
   这套样式现在同时供两个入口使用：
     ① 独立整页 /wxstudio.html
     ② 平台内路由 #/studio（点侧栏「校园创作」就地打开，不再弹新窗口）
   因此**所有选择器都必须挂在 .ws-app 下**：原来写在 :root / body / * 上的全局
   规则，一旦被 paper 平台页加载就会污染整个后台（正文行高、字号、盒模型全变）。
   设计变量也从 :root 挪到 .ws-app 上——它随子树继承，作用域正好。
*/
.ws-app {
  --ws-bg: #f4f5f7;
  --ws-card: #ffffff;
  --ws-line: #e6e8ec;
  --ws-text: #1f2329;
  --ws-text2: #5c6675;
  --ws-muted: #98a2b3;
  --ws-accent: #c8102e;
  --ws-accent-bg: #fdf2f3;
  --ws-ok: #0b8a5b;
  --ws-warn: #b7791f;
  --ws-err: #d92d20;
  --ws-radius: 12px;
  box-sizing: border-box;
  background: var(--ws-bg); color: var(--ws-text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden;
}
.ws-app *, .ws-app *::before, .ws-app *::after { box-sizing: border-box; }
/* 独立整页时 .ws-app 直接挂在 body 上（body 由 wxstudio.html 撑满 100vh）；
   内嵌进平台时由 app.js 的 body.page-ws 规则让它铺满内容区。 */
.ws-app.is-standalone { height: 100vh; }

/* ---------- 顶栏 ---------- */
.ws-top {
  height: 58px; flex: none; background: #fff; border-bottom: 1px solid var(--ws-line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
}
.ws-brand { display: flex; align-items: center; gap: 10px; }
.ws-logo {
  width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #c8102e, #8e0b20);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.ws-brand b { font-size: 15px; display: block; }
.ws-brand i { font-style: normal; font-size: 12px; color: var(--ws-muted); }
.ws-top-act { display: flex; align-items: center; gap: 10px; }
.ws-chip {
  font-size: 12px; color: var(--ws-text2); background: #f2f3f5; border-radius: 999px;
  padding: 4px 12px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ws-chip.is-ok { background: #eaf7f0; color: var(--ws-ok); }
.ws-chip.is-bad { background: #fdeceb; color: var(--ws-err); }

/* ---------- 内嵌进平台时的顶栏（#/studio） ----------
   平台本来就有顶栏（页面标题 + 搜索 + 主题切换），工作台再顶一条 58px 的
   品牌条就是"两层脑袋"。所以内嵌时压扁成一条 44px 的状态条：
   保留品牌名（告诉老师这是哪个工具）与大模型状态（AI 是否可用必须一直看得见），
   去掉「返回平台」——它已经在平台里了。 */
.ws-app.is-embed .ws-top { height: 46px; padding: 0 16px; border-radius: 10px; }
.ws-app.is-embed .ws-logo { width: 24px; height: 24px; border-radius: 7px; font-size: 13px; }
.ws-app.is-embed .ws-brand b { font-size: 13px; display: inline; }
.ws-app.is-embed .ws-brand i { display: none; }
.ws-app.is-embed .ws-back { display: none; }
.ws-app.is-embed .ws-main { padding: 12px 16px 16px; }

.ws-btn {
  border: 1px solid var(--ws-line); background: #fff; color: var(--ws-text); cursor: pointer;
  border-radius: 8px; padding: 7px 14px; font-size: 13px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; transition: .15s;
}
.ws-btn:hover { border-color: #cfd4dc; background: #fafbfc; }
.ws-btn-primary { background: var(--ws-accent); border-color: var(--ws-accent); color: #fff; font-weight: 600; }
.ws-btn-primary:hover { background: #a90d26; border-color: #a90d26; }
.ws-btn-sm { padding: 5px 12px; font-size: 12px; }
.ws-btn-ghost { background: transparent; }
.ws-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 布局 ---------- */
.ws-main { flex: 1; display: flex; gap: 16px; padding: 16px; min-height: 0; }
.ws-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ws-right { width: 420px; flex: none; display: flex; flex-direction: column; gap: 10px; min-height: 0; }

/* ---------- 步骤条 ---------- */
.ws-steps { display: flex; gap: 8px; }
.ws-step {
  flex: 1; display: flex; align-items: center; gap: 8px; cursor: pointer;
  background: #fff; border: 1px solid var(--ws-line); border-radius: 10px;
  padding: 10px 14px; font-size: 13px; color: var(--ws-text2); transition: .15s;
}
.ws-step em {
  font-style: normal; width: 20px; height: 20px; border-radius: 50%; background: #eef0f3;
  color: var(--ws-text2); font-size: 12px; display: flex; align-items: center; justify-content: center;
}
.ws-step.is-on { border-color: var(--ws-accent); color: var(--ws-text); font-weight: 600; background: var(--ws-accent-bg); }
.ws-step.is-on em { background: var(--ws-accent); color: #fff; }
.ws-step.is-done em { background: var(--ws-ok); color: #fff; }

/* ---------- 面板 ---------- */
.ws-panel {
  flex: 1; background: #fff; border: 1px solid var(--ws-line); border-radius: var(--ws-radius);
  padding: 18px; overflow: auto; min-height: 0;
}
.ws-h { font-size: 14px; font-weight: 700; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.ws-h small { font-weight: 400; color: var(--ws-muted); font-size: 12px; }
.ws-block { margin-bottom: 20px; }
.ws-label { font-size: 13px; color: var(--ws-text2); margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.ws-label b { color: var(--ws-accent); font-weight: 600; }

.ws-genres { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ws-genre {
  border: 1px solid var(--ws-line); border-radius: 10px; padding: 12px 10px; cursor: pointer;
  text-align: center; transition: .15s; background: #fff;
}
.ws-genre:hover { border-color: #cfd4dc; }
.ws-genre.is-on { border-color: var(--ws-accent); background: var(--ws-accent-bg); }
.ws-genre i { font-size: 20px; font-style: normal; display: block; margin-bottom: 4px; }
.ws-genre b { font-size: 13px; display: block; }
.ws-genre span { font-size: 11px; color: var(--ws-muted); display: block; margin-top: 2px; line-height: 1.5; }

/* ---------- 排版风格 v4.0：两维选择（15 配色 × 5 版式 = 75 套） ----------
   ★ 为什么不再是卡片墙：meta.themes 从 6 条涨到 75 条之后，原来那个 3 列卡片
     列表会变成一堵 25 行的墙，老师只会放弃挑选、退回默认风格。改成秀米那种
     两维选择后，屏幕上只有 20 个可点目标，而二维组合天然覆盖全部 75 套。
   （旧样式 .ws-theme-list / .ws-tcard 已无引用，随这次改版一并删除。） */
.ws-style-box { display: block; }
.ws-style-now {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px;
  border: 1px solid var(--ws-line); border-radius: 10px; background: #fafbfc;
}
.ws-style-sw { width: 16px; height: 16px; border-radius: 5px; flex: none; }
.ws-style-now b { font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-mini {
  flex: none; border: 1px solid var(--ws-line); background: #fff; color: var(--ws-text2);
  border-radius: 999px; padding: 3px 10px; font-size: 11px; cursor: pointer; transition: .15s;
}
.ws-mini:hover { border-color: var(--ws-accent); color: var(--ws-accent); }
.ws-sub {
  font-size: 11px; color: var(--ws-muted); margin: 14px 0 6px;
  font-weight: 600; letter-spacing: .4px;
}
.ws-look-row { display: flex; gap: 6px; flex-wrap: wrap; }
.ws-look {
  flex: 1; min-width: 74px; border: 1px solid var(--ws-line); background: #fff;
  border-radius: 8px; padding: 9px 6px; font-size: 12px; cursor: pointer;
  color: var(--ws-text2); transition: .15s;
}
.ws-look:hover { border-color: #cfd4dc; }
.ws-look.is-on { border-color: var(--ws-accent); background: var(--ws-accent-bg); color: var(--ws-accent); font-weight: 600; }
.ws-pal-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ws-pal {
  display: flex; align-items: center; gap: 5px; border: 1px solid var(--ws-line);
  background: #fff; border-radius: 8px; padding: 7px 7px; font-size: 11px;
  cursor: pointer; color: var(--ws-text2); transition: .15s; min-width: 0;
}
.ws-pal i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.ws-pal:hover { border-color: #cfd4dc; }
.ws-pal.is-on { border-color: var(--ws-accent); background: var(--ws-accent-bg); color: var(--ws-text); font-weight: 600; }

.ws-inp, .ws-ta, .ws-sel {
  width: 100%; border: 1px solid var(--ws-line); border-radius: 8px; padding: 9px 12px;
  font-size: 13px; font-family: inherit; color: var(--ws-text); background: #fff; outline: none;
}
.ws-inp:focus, .ws-ta:focus, .ws-sel:focus { border-color: var(--ws-accent); box-shadow: 0 0 0 3px rgba(200,16,46,.06); }
.ws-ta { resize: vertical; line-height: 1.7; }
.ws-row { display: flex; gap: 10px; }
.ws-row > * { flex: 1; }
.ws-hint { font-size: 12px; color: var(--ws-muted); margin: 6px 0 0; line-height: 1.6; }

.ws-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ws-big { padding: 11px 22px; font-size: 14px; }

/* ---------- 编辑器 ---------- */
.ws-edit-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; align-items: center; }
.ws-tool {
  border: 1px solid var(--ws-line); background: #fff; border-radius: 7px; padding: 5px 11px;
  font-size: 12px; cursor: pointer; color: var(--ws-text2);
}
.ws-tool:hover { border-color: var(--ws-accent); color: var(--ws-accent); }
.ws-tool.is-on { background: var(--ws-accent); border-color: var(--ws-accent); color: #fff; }
.ws-md {
  width: 100%; min-height: 320px; border: 1px solid var(--ws-line); border-radius: 10px;
  padding: 14px; font: 13px/1.85 ui-monospace, "SF Mono", Consolas, Menlo, monospace;
  resize: vertical; outline: none; color: #23282f; background: #fcfcfd;
}
.ws-md:focus { border-color: var(--ws-accent); }

/* ---------- 右栏预览 ---------- */
.ws-pv-bar { display: flex; align-items: center; gap: 10px; }
.ws-pv-title { font-size: 13px; font-weight: 700; flex: none; }
.ws-themes { flex: 1; display: flex; gap: 5px; overflow-x: auto; padding-bottom: 2px; }
.ws-themes button {
  border: 1px solid var(--ws-line); background: #fff; border-radius: 999px; padding: 3px 10px;
  font-size: 11px; cursor: pointer; white-space: nowrap; color: var(--ws-text2);
  display: inline-flex; align-items: center; gap: 5px;
}
.ws-themes button i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.ws-themes button.is-on { border-color: var(--ws-accent); color: var(--ws-accent); font-weight: 600; }

.ws-phone {
  flex: 1; min-height: 0; background: #fff; border: 1px solid var(--ws-line);
  border-radius: 18px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 8px 30px -18px rgba(15,23,42,.25);
}
.ws-phone-top {
  flex: none; height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 14px;
  background: #fafbfc; border-bottom: 1px solid var(--ws-line); font-size: 12px; color: var(--ws-text2);
}
.ws-phone-top span { width: 8px; height: 8px; border-radius: 50%; background: #d9dde3; }
.ws-phone-top b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-phone-body { flex: 1; overflow: auto; background: #fff; padding: 12px 10px 30px; }
.ws-empty { text-align: center; color: var(--ws-muted); padding: 60px 20px; }
.ws-empty-i { font-size: 34px; margin-bottom: 10px; }
.ws-empty p { font-size: 13px; line-height: 1.9; margin: 0; }

/* ---------- 体检 ---------- */
.ws-check { flex: none; max-height: 210px; overflow: auto; }
.ws-ck {
  background: #fff; border: 1px solid var(--ws-line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
  font-size: 12px; line-height: 1.7;
}
.ws-ck.is-ok { border-color: #cdeadd; background: #f6fdf9; }
.ws-ck.is-bad { border-color: #f6d4d1; background: #fef8f8; }
.ws-ck b { font-size: 12.5px; }
.ws-ck ul { margin: 6px 0 0; padding-left: 16px; }
.ws-ck li { margin-bottom: 3px; }
.ws-imgs { display: flex; flex-direction: column; gap: 6px; }

/* ---------- 复制弹层 / 封面对话 ---------- */
.ws-modal { position: fixed; inset: 0; background: rgba(15,23,42,.42); display: none; z-index: 60; }
.ws-modal.is-on { display: flex; align-items: center; justify-content: center; }
.ws-modal-box {
  background: #fff; border-radius: 14px; padding: 20px; width: 620px; max-width: 94vw; max-height: 88vh; overflow: auto;
}
.ws-modal-box h3 { margin: 0 0 6px; font-size: 16px; }
.ws-modal-box p { margin: 0 0 14px; font-size: 13px; color: var(--ws-text2); line-height: 1.8; }
.ws-cv-wrap { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.ws-cv-wrap canvas { border: 1px solid var(--ws-line); border-radius: 8px; max-width: 100%; }
.ws-cv-mini { display: flex; gap: 10px; align-items: flex-end; }

/* ---------- 风格网格弹层：15 行（配色）× 5 列（版式） ----------
   「展开全部 75 套」走这里。它同时承担「看清楚自己有多少选择」和
   「一眼比完所有配色」两件事 —— 两维选择器负责快，网格负责全。 */
.ws-modal-box--wide { width: 880px; }
.ws-modal-h {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--ws-line);
}
.ws-modal-h b { font-size: 15px; flex: none; }
.ws-modal-h span { font-size: 12px; color: var(--ws-muted); flex: 1; }
.ws-modal-x {
  flex: none; width: 28px; height: 28px; border: 1px solid var(--ws-line); background: #fff;
  border-radius: 8px; cursor: pointer; color: var(--ws-text2); font-size: 13px; line-height: 1;
}
.ws-modal-x:hover { border-color: var(--ws-accent); color: var(--ws-accent); }
.ws-sgrid { display: flex; flex-direction: column; gap: 6px; }
.ws-sg-h, .ws-sg-r { display: grid; grid-template-columns: 132px repeat(5, 1fr); gap: 6px; align-items: center; }
.ws-sg-h { padding-bottom: 6px; border-bottom: 1px solid var(--ws-line); }
.ws-sg-c { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ws-muted); }
.ws-sg-hc { font-size: 11px; color: var(--ws-text2); font-weight: 600; text-align: center; }
.ws-sg-sw { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.ws-sg-i {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  border: 1px solid var(--ws-line); background: #fff; border-radius: 8px;
  padding: 7px 6px; font-size: 11px; color: var(--ws-text2); cursor: pointer; transition: .12s;
  min-width: 0;
}
.ws-sg-i:hover:not(:disabled) { border-color: var(--ws-accent); }
.ws-sg-i.is-on { border-color: var(--ws-accent); background: var(--ws-accent-bg); color: var(--ws-accent); font-weight: 600; }
.ws-sg-i:disabled { opacity: .32; cursor: not-allowed; }
.ws-sg-b {
  flex: none; width: 14px; height: 14px; border-radius: 4px; color: #fff;
  font-size: 10px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.ws-sg-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 提示 ---------- */
.ws-toast {
  position: fixed; left: 50%; bottom: 36px; transform: translate(-50%, 20px);
  background: #1f2329; color: #fff; font-size: 13px; padding: 10px 18px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 80; max-width: 70vw;
}
.ws-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.ws-toast.is-err { background: var(--ws-err); }
.ws-toast.is-ok { background: var(--ws-ok); }

.ws-spin {
  width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff;
  border-radius: 50%; animation: ws-spin .8s linear infinite; display: inline-block;
}
.ws-spin-dark { border-color: #e3e6ea; border-top-color: var(--ws-accent); }
@keyframes ws-spin { to { transform: rotate(360deg); } }

.ws-kv { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ws-text2); }
.ws-kv span { background: #f2f3f5; border-radius: 6px; padding: 3px 9px; }
.ws-note {
  background: #fff8ec; border: 1px solid #f6e3c4; color: #8a5a12; border-radius: 10px;
  padding: 10px 12px; font-size: 12px; line-height: 1.7; margin-bottom: 12px;
}

@media (max-width: 1180px) {
  .ws-right { width: 340px; }
  .ws-genres { grid-template-columns: repeat(2, 1fr); }
  .ws-pal-row { grid-template-columns: repeat(3, 1fr); }
  .ws-sg-h, .ws-sg-r { grid-template-columns: 96px repeat(5, 1fr); }
  .ws-sg-n { display: none; }
  .ws-modal-box--wide { width: 94vw; }
}

/* ==========================================================================
 *  平台内嵌（#/studio）的满高布局
 *  工作台是「左边写字 / 右边手机预览」两栏各自滚动，必须拿到一个确定的高度。
 *  平台默认的 .body 是「上 26 / 下 60 内边距 + 整页滚动」，套进去会让工作台
 *  只有半个屏幕高、还多出一层滚动条。所以进入该页时由 app.js 给 body 挂
 *  page-ws：去掉内边距、把高度交给工作台自己管；离开页面时摘掉，其他页面
 *  （报刊大厅、文稿创作…）完全不受影响。
 * ======================================================================== */
body.page-ws .shell { height: 100vh; min-height: 0; overflow: hidden; }
body.page-ws .main { min-height: 0; }
body.page-ws .body { padding: 0; display: flex; min-height: 0; overflow: hidden; }
body.page-ws #content.wrap--full { flex: 1; display: flex; min-width: 0; min-height: 0; }
body.page-ws #content > .ws-app { flex: 1; min-width: 0; min-height: 0; }
