/* ============================================================
   赢之有道 全局样式
   纯 CSS，无任何外部字体/框架，蓝灰主色调的 SaaS 后台风
   ============================================================ */

/* ---------- 设计变量 ----------
   【为什么分成"色""面""动"三组】
   原来只有一个 --shadow 和一个 --radius,于是卡片、弹层、下拉、toast
   共用同一档阴影 —— 弹层该"浮得很高"、卡片只该"贴着纸面",
   一样重的阴影会把层级抹平。这里按"离纸面多远"分四档:
     xs = 描边级(输入框/小块)、sm = 卡片、md = 悬停/吸底栏、lg = 弹层/toast。
   --shadow 保留原名(全站几十处在用),只是值调柔了。 */
:root {
  /* 主色:色相一字未改。pages/ 里有 323 处硬编码 #2563eb,
     改色相 = 全站两种蓝花着用,反而比现在难看。 */
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff4ff;
  --blue-100: #dde8ff;          /* 比 soft 深一档:选中态的底 */
  --blue-line: #cfe0ff;         /* 蓝系描边(原来满地写死的那个值) */
  --blue-ink: #1e40af;          /* 蓝底上的深蓝字 */
  --blue-grad: linear-gradient(135deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
  --ink: #1f2937;
  --ink-2: #4b5563;
  --muted: #94a3b8;
  --line: #e6eaf0;
  --line-soft: #eef1f6;         /* 卡片内部分隔:比外框更淡,不把一张卡切成好几块 */
  --bg: #f4f6fb;
  --card: #ffffff;
  --green: #16a34a;
  --green-soft: #eafaf0;
  --red: #dc2626;
  --red-soft: #fdecec;
  --amber-bg: #fff8e6;
  --amber-line: #f5d98a;

  /* 面:圆角三档 + 阴影四档 */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .05);
  --shadow-md: 0 2px 6px rgba(16, 24, 40, .06), 0 12px 28px rgba(16, 24, 40, .08);
  --shadow-lg: 0 8px 20px rgba(16, 24, 40, .10), 0 28px 60px rgba(16, 24, 40, .14);
  /* 主色按钮的彩色阴影:灰阴影压在饱和蓝上会发脏 */
  --shadow-blue: 0 1px 2px rgba(29, 78, 216, .18), 0 6px 16px rgba(37, 99, 235, .22);

  /* 动:焦点环和缓动曲线全站只此一份 */
  --ring: 0 0 0 3px rgba(37, 99, 235, .16);
  --ring-red: 0 0 0 3px rgba(220, 38, 38, .16);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --t-fast: .14s var(--ease);
  --t: .2s var(--ease);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  /* 【字体栈为什么把微软雅黑挪到后面】
     雅黑的西文字形(尤其是数字)比中文窄一大截且笔画发虚,
     而这个后台满屏都是数字和英文字段名。system-ui 在 Win11 上是
     Segoe UI Variable(西文),中文自动落回雅黑 —— 中英文各用各的好字形。
     雅黑仍然留在栈里:老 Win 没有 system-ui 时还是它接住。 */
  font-family: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI",
    "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  /* 满屏小字的后台,不开抹平会发毛 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- 顶部标题栏 ---------- */
.topbar {
  height: 60px;
  background: linear-gradient(90deg, #1e3a8a, #2563eb);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 36px; height: 36px;
  background: rgba(255, 255, 255, .18);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
}
.brand-text h1 { margin: 0; font-size: 17px; font-weight: 600; }
.brand-text p { margin: 0; font-size: 11px; opacity: .8; }
/* 副标题为空时不占位。amway 赛道现在没有副标题(顶栏只写产品名),
   但这个 <p> 必须留着 —— 博主/通用赛道要往里填自己的那句(app.js 的 applyBrand 找的就是它)。 */
.brand-text p:empty { display: none; }
.topbar-right .pill { font-size: 12px; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: calc(100vh - 60px); }

/* ---------- 左侧导航(二级菜单) ----------
   底色只有一层:侧边栏、分组标题、二级项容器全部落在 var(--card) 上,
   不给标题/子菜单加灰底或分隔条带 —— 层级只靠字重、字号、缩进和图标区分,
   状态只靠 hover/active 的蓝色表达,这样滚动时不会出现深浅不一的色块。 */
.sidebar {
  width: 208px;
  background: var(--card);
  border-right: 1px solid var(--line);
  /* 2026-09-17:上内边距从 0 改回 12px。原来给 0 是因为顶上钉着 .nav-pinned
     (position:sticky 钉不住 padding 那条缝,滚过去的导航项会从缝里露出半行)。
     钉住区已经整块撤掉了,这里就该老老实实自己留出上间距。 */
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  /* 8 个分组全展开会超过一屏,这里自己滚;scrollbar-gutter 预留滚动条位置,
     避免滚动条出现/消失时菜单文字左右跳动,也不会盖住右侧文字 */
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #d5dbe6 transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #d5dbe6; border-radius: 3px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: #bcc5d4; }

/* 【2026-09-17 第三轮】侧栏底部的「菜单开关区」(新手模式 / 菜单摊开)。
   ── 它为什么在**底部**,而且不再钉住 ──
     这一块前后被退回过三次:先是钉一整坨(开关 + 接下来做这个 + 最近用过 ≈ 277px,
     导航项从它底下穿过去,用户原话「很难看」),再收成恒高的窄条,
     最后用户说「你把这些东西放在其他地方,别放在左上角」。
     结论不是"再调一版尺寸",而是**侧栏顶上只放菜单本身** ——
     "关于菜单的开关"不是菜单,挪到菜单末尾去。
   ── 试过但**不能用**的做法:滚动时才收窄(留着,别再试一遍)──
     真机上当场翻车:收窄省下 ~220px,侧栏立刻不再溢出 → 浏览器把 scrollTop 夹回 0
     → 判定又变成"没滚" → 展开 → 又溢出 → 无限抖。
   ── 为什么"藏功能的开关挪到底部"不算把出口锁进抽屉 ──
     新手模式下侧栏只剩十来项,**底部本来就在视野里**;
     全量模式下它在最底下,但那个模式没藏任何东西,不需要一眼看见的出口。
     所以 .nav-switches 不许被折进「更多 N 项」,也不许跟着谁一起隐藏。 */
.nav-switches {
  margin: 14px 0 0;
  padding: 10px 0 0;
  border-top: 1px dashed var(--line);
}

/* 新手模式开关(2026-09-17 起在侧栏**最下面**的 .nav-switches 里)。
   刻意做得比导航项更"像个按钮"而不是像一个菜单项 —— 它不是第 88 个功能,
   而是决定另外 87 个显不显示的那个开关,长得一样就没人会注意到它。
   收成**一行**(当初是因为钉在顶上不许占两行;挪到底部之后继续保持一行 ——
   两行会让它看着像"又一组菜单",而它是一个开关):
   左边是当前模式,右边一小行是**点下去会发生什么** —— 后者挤不下时会省略号,
   但按钮的 title 里写了全句,不会真的丢掉。 */
.nav-mode { margin: 0; } /* 在 .nav-switches 里,间距由那一块统一出 */

/* 「接下来做这个」:侧栏常驻的下一步。紧挨着钉住的那一条,但**自己不钉** ——
   它是一张 90px 的卡片,钉住它就是用户说的那个"很难看"的大头。
   它答的是"接下来干什么",不是"我要立刻点的快捷方式",滚走了不影响。 */
.nav-next { margin: 0 0 10px; }
.nav-next-box {
  position: relative;
  padding: 10px 11px 11px;
  border: 1px solid var(--blue);
  border-radius: 10px;
  background: var(--blue-soft);
}
.nav-next-k { font-size: 11px; font-weight: 700; color: var(--blue); letter-spacing: .02em; }
.nav-next-t { font-size: 12.8px; font-weight: 650; line-height: 1.5; margin: 4px 0 8px; color: var(--ink); padding-right: 14px; }
.nav-next-t span { font-weight: 500; color: var(--muted); font-size: 11.5px; }
.nav-next-go {
  width: 100%; padding: 6px 8px; border: none; border-radius: 7px;
  background: var(--blue); color: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.nav-next-go:hover { filter: brightness(1.08); }
.nav-next-no { font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.nav-next-all {
  width: 100%; margin-top: 6px; padding: 4px; border: none; background: none;
  font-size: 11.5px; color: var(--muted); cursor: pointer;
}
.nav-next-all:hover { color: var(--blue); text-decoration: underline; }
.nav-next-x {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px;
  border: none; background: none; color: var(--muted); font-size: 12px; cursor: pointer; line-height: 1;
}
.nav-next-x:hover { color: var(--ink); }
/* 「最近用过」:侧栏第三种状态。它是快捷方式,不是第 97 个功能 ——
   所以刻意比导航项**矮一点、淡一点**,长得一模一样会让人以为侧栏多了一份重复菜单。
   2026-09-17 起它钉在顶上,形态改成**一排会换行的小药丸**:
     · 竖着排 6 行 = 又一坨浮层(就是被投诉的那个);横着排一行会横滚,
       而横滚里看不见的项等于没有(流程条上栽过一次)。所以是 flex-wrap:wrap;
     · 每一项带 title,名字被挤掉时鼠标一停还看得见。
   注意类名是 .nav-recent-item 不是 .nav-item:四道门和「共 N 项」的计数都按 .nav-item 扫,
   混进去会被当成真导航项收起来、也会把项数算多。 */
/* 【2026-09-17】侧栏折叠总开关(「更多 N 项」这一层的总闸)。
   刻意做得比导航项**轻** —— 它不是第 N 个功能,是一个观感偏好,
   做得和菜单项一样重会变成新的噪音,而噪音正是它要治的东西。 */
.nav-fold { margin: 6px 0 0; }
.nav-fold-btn {
  width: 100%; text-align: left; cursor: pointer;
  font-family: inherit; font-size: 11.5px; line-height: 1.4;
  padding: 4px 10px; border-radius: 8px;
  border: 1px dashed var(--line); background: transparent; color: var(--muted);
  /* 侧栏只有 ~180px:折行会在末尾吊一个孤字,比省略号难看得多。
     挤不下就省略号 —— 整句写在 button 的 title 里,鼠标一停还在。 */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-fold-btn:hover { background: var(--blue-soft); color: var(--ink-2); border-style: solid; }

/* 【2026-09-17】从钉住块挪到侧栏最下面(见 index.html 那段注释)。
   挪下来之后要和菜单最后一组拉开距离并画条虚线,否则它会像是"系统管理组里多出来的几项"。 */
.nav-recent {
  margin: 12px 0 4px;
  padding: 9px 4px 0;
  border-top: 1px dashed var(--line);
  display: flex; flex-wrap: wrap; gap: 3px;
}
.nav-recent-hd {
  width: 100%;
  font-size: 11px; font-weight: 700; color: var(--muted);
  padding: 0 4px 3px; letter-spacing: .02em;
}
.nav-recent-item {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 4px 8px; border: none; border-radius: 999px; background: var(--blue-soft);
  font-family: inherit; font-size: 12px; color: var(--ink-2);
  text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-recent-item:hover { background: var(--blue); color: #fff; }
.nav-recent-item.active { background: var(--blue); color: #fff; font-weight: 600; }
.nav-recent-item .nav-ico { font-size: 12px; flex: none; }

.nav-mode-btn {
  width: 100%; text-align: left; cursor: pointer;
  /* 一行:第二行那句"点这里会怎样"移到 title 里(renderSimpleToggle 里写),鼠标一停还在。 */
  display: flex; align-items: baseline; gap: 6px;
  padding: 5px 10px; border-radius: 9px;
  border: 1px dashed var(--line); background: transparent;
  font-family: inherit; color: var(--ink-2);
  transition: background .15s, border-color .15s;
}
.nav-mode-btn b { font-size: 12.5px; font-weight: 700; flex: none; }
.nav-mode-btn span {
  font-size: 11px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-mode-btn:hover { background: var(--blue-soft); border-color: var(--blue); }
.nav-mode-btn.on { background: rgba(34, 197, 94, .08); border-color: #86efac; border-style: solid; }
.nav-mode-btn.on b { color: #15803d; }

.nav-group { display: flex; flex-direction: column; }
/* 分组标题:可点击折叠。故意不带 data-view,否则会被 bindEvents 的 .nav-item 逻辑误伤 */
.nav-group-hd {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  background: transparent;      /* 与侧边栏同底色,不做色块 */
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;             /* 层级靠字重体现 */
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.nav-group-hd:hover { background: var(--blue-soft); color: var(--blue); }
.nav-caret {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  transition: transform .15s;   /* 后台工具,动画只做到"看得出方向"为止 */
}
.nav-group.collapsed .nav-caret { transform: rotate(-90deg); }
/* 收起直接 display:none:比高度动画省事,也不会在长列表上掉帧 */
.nav-group.collapsed .nav-group-body { display: none; }
.nav-group-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 6px;
}

/* 二级项:保留原有 .nav-item 类名与 DOM 形态(app.js 的 switchView/角色裁剪全靠它),
   只在视觉上左缩进 + 字号略小,表示它比分组标题低一级 */
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px 8px 22px;
  border: none;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
  font-family: inherit;
}
.nav-item:hover { background: var(--blue-soft); color: var(--blue); }
.nav-item.active { background: var(--blue); color: #fff; font-weight: 600; }
.nav-ico { font-size: 15px; flex: none; }
.sidebar-foot { padding: 8px 4px 4px; } /* 上面紧挨 .nav-switches,不再需要 margin-top:auto 把它推到底 */
.sidebar-foot p { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.5; }

/* ---------- 内容区 ---------- */
.content { flex: 1; padding: 24px 28px; overflow-x: hidden; }
.view { display: none; animation: fade .2s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.view-head { margin-bottom: 16px; }
.view-head h2 { margin: 0 0 2px; font-size: 20px; }
.view-sub { margin: 0; color: var(--muted); font-size: 13px; }

/* ---------- 卡片 & 栅格 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- 表单 ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.label-text { font-size: 13px; color: var(--ink-2); font-weight: 500; }
/* 【勾选项】`.form label` 是 flex-direction:column —— 那是给"标题在上、输入框在下"
   那种字段用的。勾选框套进去会变成:方框一行、说明文字被 <strong>/<em> 切成好几行,
   每一段各占一行。设置页里那些「自动采集数据」「密码必须含字母数字」全是这个样子,
   看起来像排版坏了。
   这里改回**普通行内流**:方框和说明在同一行,长说明自然折行,
   里面的 <strong>/<em> 也就还是行内强调而不是各自成段。 */
.form label.chk { display: block; font-weight: 400; line-height: 1.7; }
.form label.chk input[type="checkbox"] { width: auto; margin-right: 6px; vertical-align: -1px; }
.form label.chk em { font-style: normal; color: var(--muted, #8a8f98); }
input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
textarea { resize: vertical; }

/* ---------- 按钮 ---------- */
.btn {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .05s;
  font-weight: 500;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:disabled { background: var(--muted); cursor: not-allowed; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: #f6cccc; }
.btn-danger:hover { background: #f9dada; }
.btn-block { width: 100%; margin-top: 4px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ---------- 提示条 ---------- */
.banner {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
}
.banner-ico { font-size: 16px; flex-shrink: 0; }
.banner-warn { background: var(--amber-bg); border: 1px solid var(--amber-line); color: #8a6d1a; }
.banner-info { background: var(--blue-soft); border: 1px solid #cfe0ff; color: #1e40af; }
/* 危险色横幅:留给"这个操作会真的动外部世界"的场景(如发布模式=直接发布)。
   颜色本身就是信息 —— 用户不读字也该一眼看出这一页比平时危险。 */
.banner-danger { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }

/* ---------- 富文本编辑器 ---------- */
/* 写稿页「从链接导入」那一行 */
.w-import { display: flex; gap: 8px; align-items: center; }
.w-import input { flex: 1; min-width: 0; }
.w-import .btn { white-space: nowrap; }

.editor-toolbar { display: flex; gap: 6px; flex-wrap: wrap; }
.editor-toolbar button {
  padding: 5px 10px; font-size: 12px;
  border: 1px solid var(--line); background: #fff; border-radius: 7px;
  cursor: pointer; color: var(--ink-2); font-family: inherit;
}
.editor-toolbar button:hover { background: var(--blue-soft); color: var(--blue); border-color: #cfe0ff; }
.editor {
  min-height: 240px;
  max-height: 460px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  background: #fff;
  outline: none;
  line-height: 1.7;
}
.editor:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.editor:empty:before { content: attr(data-placeholder); color: var(--muted); }
.editor h3 { font-size: 16px; margin: 12px 0 6px; }
.editor p { margin: 8px 0; }
.editor img { max-width: 100%; }
.edit-hint { font-size: 12px; color: var(--blue); margin: 0; }

/* ---------- 内容库卡片 ---------- */
.draft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.draft-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 8px;
  transition: box-shadow .15s, transform .1s;
}
.draft-card:hover { box-shadow: 0 8px 26px rgba(16, 24, 40, .1); transform: translateY(-2px); }
.draft-card h3 { margin: 0; font-size: 15px; }
.draft-excerpt { color: var(--ink-2); font-size: 13px; max-height: 44px; overflow: hidden; }
.draft-meta { color: var(--muted); font-size: 12px; }
.draft-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { background: var(--blue-soft); color: var(--blue); font-size: 11px; padding: 2px 8px; border-radius: 20px; }
.draft-actions { display: flex; gap: 8px; margin-top: 4px; }

/* ---------- 平台选择 ---------- */
/* 平台勾选区。
   【2026-09-10 改】原来是写死的两列。平台从 15 涨到 37 之后，两列意味着
   一屏放不下、要滚三屏才滚到发布按钮，而且滚过去的绝大多数是当前根本发不了的平台。
   改成按宽度自适应的多列 + 由 app.js 把「发不了的」折叠起来（见 decoratePlatformPicker）。 */
.platform-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; align-items: start; }

/* 平台勾选区上方的一句话小结：先说「现在能真发几个」，再让人去挑。
   这一句比 37 个红标签有用 —— 红标签要一个个读，这一句一眼就知道要不要先去抓登录态。 */
.p-sum { display:flex; align-items:center; gap:10px; flex-wrap:wrap; font-size:12.5px;
  border:1px solid var(--line); border-radius:9px; padding:8px 11px; margin-bottom:8px; }
.p-sum b { font-size:13px; }
.p-sum.ok { border-color:#bbf7d0; background:#f0fdf4; }
.p-sum.none { border-color:#fecaca; background:#fef2f2; }
.p-sum .p-sum-act { margin-left:auto; }

/* 「暂时发不了的 N 个」折叠块 */
.p-off-hd { display:flex; align-items:center; gap:6px; width:100%; margin:10px 0 0;
  background:none; border:none; padding:6px 0; cursor:pointer; color:var(--muted); font-size:12.5px; text-align:left; }
.p-off-hd:hover { color:var(--ink-2); }
.p-off-hd .p-caret { transition:transform .15s; }
.p-off-hd.open .p-caret { transform:rotate(90deg); }

/* 发布按钮吸底：平台多的时候，勾到一半按钮早滚出屏幕了。 */
.p-sticky { position:sticky; bottom:0; z-index:2; padding-top:10px; margin-top:2px;
  background:linear-gradient(180deg, transparent, var(--card) 22%); }
.platform-chk {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; row-gap: 3px;
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
  cursor: pointer; font-size: 13px; transition: border .15s, background .15s;
}
/* ⚠️ 这条选择器必须比 `.form label`(第 176 行,flex-direction:column)更具体。
   平台勾选框是 <label>,一直被那条规则按住 —— 所以它从来都是"勾选框一行、平台名一行、
   标记又一行"地竖着堆、还居中,看着像一堆没对齐的碎块。这不是本次改出来的,是一直如此。
   这里恢复成一行:勾选框 + 平台名同行,标记和发布方式在放不下时退到第二行。 */
.platform-picker .platform-chk { flex-direction: row; align-items: center; }
.platform-chk > span:first-of-type { flex: 1 1 auto; min-width: 0; }
.platform-chk .plat-live { margin-left: 21px; }
.platform-chk:hover { background: var(--blue-soft); }
.platform-chk input { width: auto; }
.platform-chk.checked { border-color: var(--blue); background: var(--blue-soft); }
.platform-mode { color: var(--muted); font-size: 11px; margin-left: auto; }
/* 平台勾选框上的「能不能真发」标记(见 app.js 的 decoratePlatformPicker)。
   没登录态的平台发过去只会静默降级成模拟发布,这个标是勾之前唯一的提醒。 */
.plat-live { font-size: 10.5px; border-radius: 4px; padding: 1px 5px; margin-left: 6px; white-space: nowrap; cursor: help; }
.plat-live.ok { background: #dcfce7; color: #15803d; }
.plat-live.warn { background: #fef3c7; color: #92400e; }
.plat-live.bad { background: #fee2e2; color: #b91c1c; font-weight: 600; }

/* ---------- 写稿页:工具条分层 + 高级选项折叠(2026-09-10) ---------- */
/* 「⋯ 更多工具」按钮本身要看得出是"还有东西在后面",不能和工具按钮混成一片 */
.ai-more-btn { margin-left: auto; color: var(--muted); }
.ai-tools-more { margin-top: 0; padding-top: 8px; border-top: 1px dashed var(--line); }

.w-adv-hd {
  display: flex; align-items: center; gap: 6px; width: 100%;
  background: none; border: none; padding: 8px 0; margin: 2px 0;
  cursor: pointer; font-size: 13px; color: var(--ink-2); text-align: left;
}
.w-adv-hd:hover { color: var(--ink); }
.w-adv-hd .p-caret { transition: transform .15s; }
.w-adv-hd.open .p-caret { transform: rotate(90deg); }
/* 折叠条上那行小结:收起状态下唯一能看见"我挂了什么设置"的地方,所以不许省 */
.w-adv-sum { margin-left: auto; font-size: 11.5px; color: var(--muted);
  max-width: 58%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-adv-sum.on { color: var(--blue); }
.w-adv { display: flex; flex-direction: column; gap: 10px;
  border-left: 2px solid var(--line); padding-left: 10px; margin-bottom: 6px; }

/* ---------- 发布结果 ---------- */
.result-list { display: flex; flex-direction: column; gap: 10px; }
.result-item {
  border: 1px solid var(--line); border-left-width: 4px; border-radius: 9px; padding: 10px 14px;
}
.result-item.ok { border-left-color: var(--green); background: var(--green-soft); }
.result-item.fail { border-left-color: var(--red); background: var(--red-soft); }
.result-item .r-head { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.result-item .r-msg { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.result-item a { color: var(--blue); font-size: 12px; word-break: break-all; }

/* ---------- 账号列表 ---------- */
.account-list { display: flex; flex-direction: column; gap: 10px; }
.account-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px;
}
.account-row .a-info { flex: 1; }
.account-row .a-name { font-weight: 600; }
.account-row .a-sub { font-size: 12px; color: var(--muted); }

/* ---------- 徽标 / 状态 ---------- */
.pill { padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; display: inline-block; }
.pill-ok { background: var(--green-soft); color: var(--green); }
.pill-fail { background: var(--red-soft); color: var(--red); }
.pill-muted { background: rgba(255, 255, 255, .2); color: #fff; }
.pill-plat { background: #eef2f7; color: var(--ink-2); }

/* ---------- 表格 ---------- */
.table-card { padding: 0; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.data-table th { background: #f8fafc; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbfe; }
.data-table a { color: var(--blue); word-break: break-all; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: var(--muted); padding: 40px 16px; font-size: 13px; }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; top: 74px; right: 22px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 220px; max-width: 340px;
  padding: 11px 16px; border-radius: 10px; color: #fff; font-size: 13px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .18);
  animation: toast-in .2s ease;
}
.toast.info { background: #334155; }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- 加载中 ---------- */
.spinner {
  width: 15px; height: 15px; border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff; border-radius: 50%;
  display: inline-block; vertical-align: -2px; margin-right: 6px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* ---------- 顶部用户框 / 退出按钮 ---------- */
.user-box { display: inline-flex; align-items: center; gap: 8px; margin-left: 14px; color: #fff; }
.user-ico { font-size: 14px; opacity: .9; }
.user-name { font-size: 13px; font-weight: 600; }
.user-team { display: inline-block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; opacity: .9; }
.btn-logout {
  font-family: inherit; font-size: 12px; color: #fff;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3);
  padding: 4px 12px; border-radius: 8px; cursor: pointer; transition: background .15s;
}
.btn-logout:hover { background: rgba(255, 255, 255, .32); }

/* ---------- 登录 / 注册 遮罩 ---------- */
.auth-mask {
  position: fixed; inset: 0; z-index: 200;
  background: linear-gradient(135deg, #1e3a8a, #2563eb 70%, #3b82f6);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-card {
  width: 100%; max-width: 380px;
  background: #fff; border-radius: 16px;
  box-shadow: 0 20px 60px rgba(16, 24, 40, .35);
  padding: 30px 28px;
  animation: fade .25s ease;
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 22px;
}
.auth-brand h2 { margin: 0; font-size: 18px; color: var(--ink); }
.auth-brand p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

.auth-tabs {
  display: flex; gap: 6px; margin-bottom: 18px;
  background: var(--bg); padding: 4px; border-radius: 10px;
}
.auth-tab {
  flex: 1; padding: 8px 0; border: none; background: transparent;
  font-family: inherit; font-size: 14px; color: var(--ink-2);
  border-radius: 8px; cursor: pointer; transition: background .15s, color .15s; font-weight: 500;
}
.auth-tab.active { background: #fff; color: var(--blue); font-weight: 600; box-shadow: var(--shadow); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-msg { margin: 0; font-size: 13px; color: var(--red); min-height: 18px; }
.auth-hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- 系统设置页 ---------- */
.preset-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
code { background: #f1f5f9; color: #be123c; padding: 1px 6px; border-radius: 5px; font-size: 12px; }

/* ---------- 写稿页 AI 工具 ---------- */
.ai-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.ai-tools-label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.ai-mode { padding: 5px 8px; font-size: 12px; }
.ai-result { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.ai-result-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--ink); }
.ai-title-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
.ai-summary-text { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.7; color: var(--ink-2); margin-bottom: 8px; }
.sens-ok { color: var(--green); font-size: 13px; font-weight: 500; }
.sens-hits { display: flex; flex-wrap: wrap; gap: 8px; }
.sens-hit { background: var(--red-soft); color: var(--red); border: 1px solid #f6cccc; border-radius: 8px; padding: 4px 10px; font-size: 13px; }
.sens-hit em { font-style: normal; color: var(--muted); margin-left: 6px; font-size: 11px; }
.img-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.img-pick-item { width: 80px; height: 80px; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: transform .1s, border-color .1s; }
.img-pick-item:hover { transform: scale(1.05); border-color: var(--blue); }

/* ================================================================
   手机端响应式适配
   思路:
   - 电脑端(默认):汉堡按钮和遮罩都隐藏,侧边栏正常竖排在左边;
   - 手机端(≤768px):侧边栏变成"抽屉"——平时移到屏幕外藏起来,
     点顶栏 ☰ 才滑出来,并盖一层半透明遮罩,点遮罩/点菜单即收起。
   ================================================================ */

/* 汉堡按钮 & 遮罩:电脑端默认不显示 */
.nav-toggle {
  display: none;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 38px; height: 38px;
  font-size: 20px;
  cursor: pointer;
  margin-right: 6px;
  flex: 0 0 auto;
}
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;              /* 上下左右都为 0,即铺满全屏 */
  background: rgba(0, 0, 0, .4);
  z-index: 40;
}

@media (max-width: 768px) {
  /* 顶栏更紧凑,标题副标题可省 */
  .topbar { padding: 0 12px; }
  .brand-text p { display: none; }
  .brand-text h1 { font-size: 15px; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }

  /* 侧边栏 → 抽屉:固定定位、默认移出屏幕左侧,加过渡动画 */
  .sidebar {
    position: fixed;
    top: 60px; left: 0;
    z-index: 45;
    width: 76vw; max-width: 300px;
    height: calc(100vh - 60px);
    transform: translateX(-100%);      /* 平时藏在屏幕左边外面 */
    transition: transform .25s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, .12);
    overflow-y: auto;
  }
  /* 给 layout 加了 sidebar-open 类时:抽屉滑入 + 遮罩显示 */
  .layout.sidebar-open .sidebar { transform: translateX(0); }
  .layout.sidebar-open .nav-overlay { display: block; }

  /* 内容区占满宽度、内边距收窄 */
  .content { padding: 16px 14px; }
  .view-head h2 { font-size: 18px; }

  /* 卡片、表单在窄屏更省地方 */
  .card { padding: 14px 14px; }

  /* 表格类:允许横向滑动,避免撑破屏幕 */
  .shots-table, table { display: block; overflow-x: auto; white-space: nowrap; }

  /* 一排按钮换行不挤 */
  .row-end { flex-wrap: wrap; }
}

/* ===== AI 改稿助手 对话面板 ===== */
.ai-chat-panel{margin-top:10px;border:1px solid var(--line,#e6eaf0);border-radius:10px;background:#fafbfc;overflow:hidden}
.ai-chat-head{display:flex;align-items:center;gap:8px;padding:9px 12px;border-bottom:1px solid var(--line,#e6eaf0);font-weight:600;font-size:14px;background:#fff}
.ai-chat-head .ai-chat-tip{font-weight:400;font-size:12px;color:var(--muted,#94a3b8);flex:1;min-width:0}
.ai-chat-msgs{max-height:300px;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:10px}
.ai-chat-empty{color:var(--muted,#94a3b8);font-size:13px;text-align:center;padding:14px 6px}
.ai-chat-msg{display:flex;gap:8px;align-items:flex-start}
.ai-chat-msg.ai-chat-user{flex-direction:row-reverse}
.ai-chat-who{flex-shrink:0;width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;color:#fff}
.ai-chat-user .ai-chat-who{background:var(--blue,#2563eb)}
.ai-chat-bot .ai-chat-who{background:#10b981}
.ai-chat-bubble{max-width:80%;padding:9px 13px;border-radius:12px;font-size:13.5px;line-height:1.6;white-space:normal;word-break:break-word}
.ai-chat-user .ai-chat-bubble{background:var(--blue-soft,#eff4ff);color:var(--ink,#1f2937);border-top-right-radius:3px}
.ai-chat-bot .ai-chat-bubble{background:#fff;border:1px solid var(--line,#e6eaf0);color:var(--ink,#1f2937);border-top-left-radius:3px}
.ai-chat-input{display:flex;gap:8px;padding:10px 12px;border-top:1px solid var(--line,#e6eaf0);background:#fff}
.ai-chat-input input{flex:1;min-width:0;padding:9px 12px;border:1px solid var(--line,#e6eaf0);border-radius:8px;font-size:14px;font-family:inherit;outline:none}
.ai-chat-input input:focus{border-color:var(--blue,#2563eb)}

/* ===== 写稿页:提示词模板 / 自动配图选项 ===== */
.w-prompt-hint{margin:-4px 0 2px;font-size:12px;line-height:1.6;color:var(--muted,#94a3b8)}
.w-prompt-ta{width:100%;box-sizing:border-box;padding:9px 12px;border:1px solid var(--line,#e6eaf0);
  border-radius:8px;font-size:13px;line-height:1.7;font-family:inherit;color:var(--ink,#1f2937);
  outline:none;resize:vertical}
.w-prompt-ta:focus{border-color:var(--blue,#2563eb)}
.w-img-opts{display:flex;gap:10px;flex-wrap:wrap;padding:10px 12px;border:1px dashed var(--line,#e6eaf0);
  border-radius:8px;background:#fafbfc}
.w-img-opts label{flex:1;min-width:130px;font-size:12.5px;margin:0}
.w-img-opts select{width:100%}

/* ===== 写稿页:一键适配各平台面板 ===== */
.adapt-panel{margin-top:10px;border:1px solid var(--line,#e6eaf0);border-radius:10px;background:#fafbfc;overflow:hidden}
.adapt-panel-head{display:flex;align-items:center;gap:8px;padding:9px 12px;border-bottom:1px solid var(--line,#e6eaf0);
  font-weight:600;font-size:14px;background:#fff}
.adapt-panel-tip{font-weight:400;font-size:12px;color:var(--muted,#94a3b8);flex:1;min-width:0}
.adapt-panel-body{padding:12px}
.adapt-plats{display:flex;flex-wrap:wrap;gap:8px}
.adapt-plat{display:inline-flex;align-items:center;gap:5px;padding:5px 11px;border:1px solid var(--line,#e6eaf0);
  border-radius:18px;cursor:pointer;font-size:13px;user-select:none;background:#fff;transition:.15s}
.adapt-plat.on{border-color:var(--blue,#2563eb);color:var(--blue,#2563eb);background:var(--blue-soft,#eff4ff)}
.adapt-panel-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:10px}
.adapt-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px;margin-top:12px}
.adapt-card{border:1px solid var(--line,#e6eaf0);border-radius:10px;background:#fff;padding:11px 12px}
.adapt-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.adapt-card-title{font-weight:600;font-size:14px}
.adapt-card-len{font-size:11.5px;color:var(--muted,#94a3b8)}
.adapt-card-len.over{color:#e63946;font-weight:600}
.adapt-card-body{background:var(--bg,#f7f9fc);border:1px solid var(--line,#e6eaf0);border-radius:8px;
  padding:10px 11px;font-size:13px;line-height:1.75;max-height:220px;overflow:auto;word-break:break-word}
.adapt-card-tags{margin-top:7px;font-size:12px;color:var(--blue,#2563eb);line-height:1.7;word-break:break-all}
.adapt-card-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end;margin-top:9px}

/* ===== 写稿页:自动配图结果条 ===== */
.illu-list{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.illu-list img{width:88px;height:88px;object-fit:cover;border-radius:8px;border:1px solid var(--line,#e6eaf0)}

/* ============================================================
   视觉精修层(2026-09-28)

   ── 这一段只管"观感":颜色深浅、阴影、圆角、过渡、焦点环。
      结构与行为(display / position / 谁显谁隐 / 尺寸)全部在上面那些节里,
      要改布局请上去改,**不要在这里加第二份布局规则**。

   ── 为什么集中在文件末尾,而不是逐条插进上面各节:
      上面几乎每一节都带着"为什么这么写、被退回过几次"的坑位注释,
      挨个插手会把那些注释切碎;集中一段既好读,也能整段摘掉回到原样。
   ============================================================ */

/* ---------- 全局:选中色 / 滚动条 / 焦点可见 / 减少动效 ---------- */
::selection { background: rgba(37, 99, 235, .18); color: var(--ink); }

/* 滚动条原来只有 .sidebar 调过,内容区、弹层、表格横滚都还是系统那条又宽又灰的。
   统一成细圆条:靠 background-clip 留出 3px 透明边,滚动条看起来是"浮"在槽里的。 */
* { scrollbar-width: thin; scrollbar-color: #d5dbe6 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #d9dfe9; border-radius: 999px;
  border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #c2cad8; background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* 【键盘焦点】原来只有输入框有焦点样式,按 Tab 走按钮和导航是**一点反馈都没有**的
   (浏览器默认的 outline 被 `border: 1px solid transparent` 和 `border: none` 吃掉了)。
   :focus-visible 只在键盘操作时出现,鼠标点击不会闪一圈框。 */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
/* 这几类自己已经有焦点环(box-shadow),再叠一圈 outline 就是两层框 */
input:focus-visible, select:focus-visible, textarea:focus-visible,
.editor:focus-visible, .ai-chat-input input:focus-visible { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  /* 但转圈**不能**停:它是"还在跑"的唯一信号,停住等于告诉用户已经跑完了。
     前庭不适来自大幅位移和视差,一个 15px 的小圈不在此列。 */
  .spinner { animation-duration: .7s !important; animation-iteration-count: infinite !important; }
}

/* ---------- 顶栏 ---------- */
.topbar {
  background: linear-gradient(118deg, #1b3a8f 0%, #1d4ed8 46%, #2f6bf0 100%);
  /* 上沿一条内高光 + 下方一点投影 = 顶栏"压"在内容之上,而不是和内容拼在一个平面 */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 1px 0 rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .10);
}
.logo {
  background: rgba(255, 255, 255, .18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 2px 8px rgba(8, 20, 60, .18);
}
.brand-text h1 { letter-spacing: .012em; }
.btn-logout { transition: background var(--t-fast), border-color var(--t-fast); }
.btn-logout:hover { border-color: rgba(255, 255, 255, .5); }
.nav-toggle { transition: background var(--t-fast); }
.nav-toggle:hover { background: rgba(255, 255, 255, .3); }

/* ---------- 侧栏 ---------- */
/* 选中项从平涂实心蓝换成渐变 + 彩色阴影:一眼还是"那条蓝的",
   但不再像一块贴上去的色纸。hover 态一个字没动(上面调过好几轮)。 */
.nav-item.active, .nav-recent-item.active {
  background: var(--blue-grad);
  box-shadow: var(--shadow-blue);
}
.nav-item, .nav-group-hd, .nav-recent-item, .nav-mode-btn, .nav-fold-btn {
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
.nav-recent-item:hover { background: var(--blue); color: #fff; box-shadow: var(--shadow-blue); }
.nav-next-box { box-shadow: var(--shadow-xs); border-color: var(--blue-line); }
.nav-next-go { background: var(--blue-grad); box-shadow: var(--shadow-blue); transition: filter var(--t-fast), transform .08s var(--ease); }
.nav-next-go:active { transform: translateY(1px); }

/* ---------- 内容区 ---------- */
.view-head h2 { letter-spacing: .01em; font-weight: 650; }
/* 进入动画原来是"整块上移 4px 淡入",在长页面上像抖了一下;改成只淡入 + 1px */
@keyframes fade { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

/* ---------- 卡片 ---------- */
.card {
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  transition: box-shadow var(--t), border-color var(--t);
}
.card-title { letter-spacing: .01em; font-weight: 650; }
/* 内容库卡片是可点的,给它"抬起来"的反馈;不可点的 .card 不给,
   否则鼠标扫过整页卡片全在动,像页面在呼吸。 */
.draft-card { transition: box-shadow var(--t), transform var(--t), border-color var(--t); }
.draft-card:hover { box-shadow: var(--shadow-md); border-color: var(--blue-line); transform: translateY(-2px); }

/* ---------- 按钮 ---------- */
.btn {
  font-weight: 550;
  letter-spacing: .012em;
  transition: background var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform .08s var(--ease);
}
.btn-primary { background: var(--blue-grad); box-shadow: var(--shadow-blue); }
.btn-primary:hover {
  background: linear-gradient(135deg, #4a8bf8 0%, #2563eb 55%, #1a44c0 100%);
  box-shadow: 0 2px 4px rgba(29, 78, 216, .22), 0 10px 24px rgba(37, 99, 235, .3);
  transform: translateY(-1px);
}
.btn-primary:disabled { background: #cbd5e1; color: #fff; box-shadow: none; transform: none; }
.btn-ghost { box-shadow: var(--shadow-xs); }
.btn-ghost:hover { background: #fff; color: var(--blue); border-color: var(--blue-line); box-shadow: var(--shadow); }
.btn-danger:hover { box-shadow: 0 4px 12px rgba(220, 38, 38, .16); }
.btn:disabled { box-shadow: none; transform: none; opacity: .75; }
/* 必须排在上面那条 :hover 之后:同时 hover + 按下时,按下的手感优先 */
.btn:active:not(:disabled) { transform: translateY(1px); }

/* ---------- 表单 ---------- */
input, select, textarea {
  box-shadow: var(--shadow-xs);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
input:hover:not(:focus):not(:disabled),
select:hover:not(:focus):not(:disabled),
textarea:hover:not(:focus):not(:disabled) { border-color: #ccd5e3; }
input:focus, select:focus, textarea:focus { box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: #aab4c4; }
input:disabled, select:disabled, textarea:disabled {
  background: #f6f8fc; color: var(--muted); cursor: not-allowed; box-shadow: none;
}
/* 【下拉箭头】Windows 上原生 select 的箭头是个又粗又黑的三角,
   和这一页其它元素完全不是一套。换成自画的细箭头。
   :not([multiple]):not([size]) 是因为多选框和列表框没有箭头位,
   套上 appearance:none 会把它们压成一行。 */
select:not([multiple]):not([size]) {
  -webkit-appearance: none; appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}
select:not([multiple]):not([size]):focus {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%232563eb' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* 勾选框原来是系统默认的灰方块,和满页的蓝对不上 */
input[type="checkbox"], input[type="radio"] { accent-color: var(--blue); cursor: pointer; }
.editor:focus { box-shadow: var(--ring); }
.editor-toolbar button { transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }

/* ---------- 提示条 ---------- */
.banner { border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.banner-info { background: linear-gradient(180deg, #f6f9ff, #eef4ff); border-color: var(--blue-line); }
.banner-warn { background: linear-gradient(180deg, #fffcf2, #fff6e0); }
.banner-danger { background: linear-gradient(180deg, #fef4f4, #fde5e5); }

/* ---------- 徽标 ---------- */
/* 内描边让浅底标签在白卡片上也有边界,但又不像加了一圈硬框 */
.pill { font-weight: 600; letter-spacing: .01em; }
.pill-ok { box-shadow: inset 0 0 0 1px rgba(22, 163, 74, .18); }
.pill-fail { box-shadow: inset 0 0 0 1px rgba(220, 38, 38, .18); }
.pill-plat { box-shadow: inset 0 0 0 1px rgba(71, 85, 105, .1); }
.tag { font-weight: 500; box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .1); }

/* ---------- 表格 ---------- */
.table-card { border-radius: var(--radius); }
.data-table th {
  background: linear-gradient(180deg, #fbfcfe, #f4f7fb);
  font-size: 12.5px; letter-spacing: .02em; color: #64748b;
  border-bottom-color: var(--line);
}
.data-table td { border-bottom-color: var(--line-soft); }
.data-table tbody tr { transition: background var(--t-fast); }
.data-table tr:hover td { background: var(--blue-soft); }

/* ---------- 空状态 ---------- */
.empty { line-height: 1.8; }

/* ---------- toast ---------- */
.toast {
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  font-weight: 500; letter-spacing: .01em;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.toast.info { background: rgba(30, 41, 59, .94); }
.toast.success { background: linear-gradient(135deg, #18ad51, #12803f); }
.toast.error { background: linear-gradient(135deg, #ef4444, #cf2020); }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- 登录 / 注册 ---------- */
/* 原来是一条直上直下的蓝渐变,平得像张色卡。两团光晕给它一点纵深;
   ::before 铺在遮罩上、卡片抬到 z-index:1,顺序不能反,否则卡片被光晕蒙住。 */
.auth-mask { background: linear-gradient(140deg, #16307a 0%, #1d4ed8 55%, #3b82f6 100%); overflow: hidden; }
.auth-mask::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(760px 520px at 14% 10%, rgba(255, 255, 255, .22), transparent 62%),
    radial-gradient(680px 460px at 88% 92%, rgba(56, 189, 248, .3), transparent 64%);
}
.auth-card { position: relative; z-index: 1; border-radius: 18px; box-shadow: var(--shadow-lg); }
.auth-logo { background: var(--blue-grad); box-shadow: var(--shadow-blue); }
.auth-tab { transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.auth-tab.active { box-shadow: var(--shadow-xs); }

/* ---------- 零碎 ---------- */
code { border: 1px solid #e2e8f0; }
.adapt-plat { transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }
.adapt-plat.on { box-shadow: inset 0 0 0 1px var(--blue-line); }
.platform-chk { transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast); }
.platform-chk.checked { box-shadow: inset 0 0 0 1px var(--blue-line); }
.img-pick-item { transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast); }
.img-pick-item:hover { box-shadow: var(--shadow-md); }

/* ============================================================
   两处"本来就破着"的地方(2026-09-28 美化时在真浏览器里点出来的)

   这两条和上面那层不一样 —— 它们不是"更好看",是**现在就是坏的**。
   ============================================================ */

/* ---------- 一、窄屏顶栏会叠成一坨 ---------- */
/* 【现象】390px 宽(拿手机直接开电脑版网址,同事转发网址就是这个场景)下:
   「赢之有道」被挤成竖排两行、右边四个 pill 和用户名/退出**互相压在一起**,
   字摞着字,一个都点不准。
   【真因】`.topbar-right` 是个普通的 <div> —— 里面的 pill 是 inline-block,
   走的是**文字折行**那一套。地方不够就换行,而 .topbar 的高度写死 60px
   且 align-items:center,于是第二行直接从顶栏里溢出来,盖在第一行上。
   一直如此,不是这次改出来的;宽屏够宽,折不了行,所以从没露过馅。
   【为什么是横滑而不是藏起来】顶栏这几个 pill 是「搜一下 / 手机端 / 这页怎么用 /
   额度 / AI 状态」—— 全是"和当前页无关、但随时要用"的入口,而且每一个
   在别处都没有第二条路(手机端入口尤其:藏了它,59 个页面的手机端就又没人知道了)。
   窄屏上该让它滑,不该让它消失。
   【为什么 :first-child 上是 margin-left:auto,而不是 justify-content:flex-end】
   flex 容器一旦溢出,flex-end 会把开头那几个顶到**滚动区左边界之外**,
   怎么滑都滑不回来(经典坑)。auto margin 在不溢出时照样把整排推到右边,
   溢出时它自动归零,于是从左边开始排、一路能滑到最后一个。 */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.topbar-right > * { flex: none; }
.brand { min-width: 0; }
.brand-text h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 768px) {
  .topbar { gap: 6px; }
  /* 品牌**文字**在窄屏让位给右边那排入口。
     【为什么这次是"隐藏"而不是"截断"】先试过 min-width:0 + 省略号,
     390px 上只剩「赢之…」—— 一个被腰斩的产品名比没有更难看,
     而且它照样吃掉 60px,右边该滑的还是得滑。
     它也不是入口:logo 那个「赢」还在原地,标签页标题里也还是全名,
     隐藏它一条路都不少。上面那条 h1 的 nowrap/ellipsis 继续留着 ——
     769~900px 这一段宽度不够但又没进窄屏档时,靠它兜住。 */
  .brand-text { display: none; }
  .topbar-right {
    flex: 1 1 auto;
    overflow-x: auto;
    overflow-y: hidden;
    /* 顶栏里再画一条滚动条就太吵了;滑动手势本身还在 */
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .topbar-right::-webkit-scrollbar { display: none; }
  .topbar-right > :first-child { margin-left: auto; }
  /* 用户名在窄屏让位:它只是"我是谁",而旁边的「退出」是真按钮。
     头像图标留着,身份提示不丢。 */
  .user-box { margin-left: 8px; }
  .user-name { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* AI 状态那条文案最长("未配置 AI Key · 使用示例文章"),
     窄屏给个上限,点开还是完整的 */
  #ai-status { max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- 二、登录卡里两个输入框不一样宽 ---------- */
/* 【现象】「用户名」和「密码」两个框宽度不同,右边缘参差不齐 —— 登录页是
   所有人看到的第一屏,这一眼就显得没做完。
   【真因】上面那条把字段排成"标题在上、输入框在下"的规则选择器是 `.form label`,
   而登录卡这块的类名是 `.auth-form` —— 压根没被它命中。于是 label 退回普通
   行内流:文字和 <input> 并排,而 input 不给宽度时宽度由 size 属性算,
   两个框的 placeholder 不一样长,宽度就不一样。
   邀请码那一栏(注册时才出现)同理,所以三栏一起收口。 */
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
}
.auth-form label input { width: 100%; }

/* ============================================================
   跨页版式统一层(2026-09-29)

   用户原话:「你再美化下,当前项目的各个页面,让项目各端打开更美观,更好看」。
   上一批(09-28 的「视觉精修层」)把观感调好了,但它只调到**共用类**为止 ——
   而这个项目的页面**各写各的类名**:31 个文件自己写 `.xx-table`、
   十几个文件自己写 `.xx-grid` / `.xx-actions` / `.xx-note`。
   于是出现了很具体的落差:共用的 `.data-table` 已经是"只留横线 + 外面一圈框",
   而 `tm-table / an-table / fin-table / lr-table …` 还全都是
   `th,td{border:1px solid}` 的**网格纸**。一页一个样,正是"不好看"的根。

   ── 这一段管什么 ────────────────────────────────────────────
   把上面那套已经定好的观感和版式,**按命名约定**带到各页自己的类上。
   它不发明新样式:表头底色、横线、hover 取的都是 `.data-table` 那一份。

   ── 🔴 为什么是属性选择器,不是逐页去改 ──────────────────────
   106 个页面,一个能同时命中它们的类**根本不存在**。而这套命名约定是实打实的
   (kit.css 文件头就在数 `.xx-table 12 个`、`.xx-toolbar 10 个`)。
   逐页改的代价不在"改得慢",在**改完维护不住**:下一页新建时照样自己写一套,
   而这一层对新页面是自动生效的。

   ── 🔴 特异度:必须多带一层祖先/元素 ─────────────────────────
   页面的 `<style>` 是**运行时** append 到 <head> 的(PageKit.css),排在本文件之后。
   同特异度时页面赢(这是对的,页面的明确选择该赢)。所以凡是要盖过页面默认写法的,
   都写成 `table[class$="-table"] td`(0,1,2)去压 `.tm-table td`(0,1,1);
   不需要盖的就保持低特异度,页面想改随时改得动。
   ⚠️ `[class$="-x"]` 命中不了 `class="a-x b"`(结尾不是它),所以每条都配一个
   `[class*="-x "]`。少写那一半的表现是"有些页面生效、有些不生效",而且看不出规律。

   ── 整段摘掉就回到 09-28 的样子。────────────────────────────
   ============================================================ */

/* ---------- 一、表格:31 个页面各一份网格纸,统一成横线表 ---------- */
table[class$="-table"], table[class*="-table "],
table[class$="-tbl"], table[class*="-tbl "] {
  width: 100%;
  border-collapse: collapse;
  /* 数字等宽:同一列的 12 和 99 左右边缘对得齐(表格里满屏都是数) */
  font-variant-numeric: tabular-nums;
  border-radius: var(--radius-sm);
  /* 外面一圈框用 inset 阴影画,不用 border —— border-collapse 下的
     border 不认圆角,画出来是方角套圆角。 */
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
table[class$="-table"] th, table[class*="-table "] th,
table[class$="-tbl"] th, table[class*="-tbl "] th {
  border: 0;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfcfe, #f4f7fb);
  color: #64748b;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .02em;
  text-align: left;
  /* 表头折行最难看,而表头本来就短 */
  white-space: nowrap;
}
table[class$="-table"] td, table[class*="-table "] td,
table[class$="-tbl"] td, table[class*="-tbl "] td {
  border: 0;
  /* 行线比外框更淡:一眼看过去是"一张表",不是"一格一格" */
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table[class$="-table"] tbody tr:last-child td, table[class*="-table "] tbody tr:last-child td,
table[class$="-tbl"] tbody tr:last-child td, table[class*="-tbl "] tbody tr:last-child td {
  border-bottom: 0;   /* 最后一行的线和外框重了,是两条 */
}
table[class$="-table"] tbody tr, table[class*="-table "] tbody tr,
table[class$="-tbl"] tbody tr, table[class*="-tbl "] tbody tr {
  transition: background var(--t-fast);
}
table[class$="-table"] tbody tr:hover td, table[class*="-table "] tbody tr:hover td,
table[class$="-tbl"] tbody tr:hover td, table[class*="-tbl "] tbody tr:hover td {
  background: var(--blue-soft);
}

/* ---------- 二、表格里这几样不许折行 ---------- */
/* 「微信公众号」这种平台名被压成两行、日期断成「2026-09-」+「14」,
   是表格最常见的两处难看。它们本来就短,该挤的是那几列说明文字。 */
td .pill, td .tag,
td [class$="-tag"], td [class*="-tag "],
td [class$="-chip"], td [class*="-chip "],
td [class$="-plat"], td [class*="-plat "],
td [class$="-st"], td [class*="-st "],
td time { white-space: nowrap; }

/* ---------- 三、一行别太长 ---------- */
/* 一张卡宽 1150px,13px 的灰色小字铺满整行 = 一行七八十个字,
   眼睛从行尾回到下一行行首容易丢行。62em ≈ 60 个中文字,是中文正文的舒适区间。

   🔴🔴 这一条第一版写成了"所有 `-note` / `-hint` 一律限宽",**当场在截图里露馅**:
   「全网好视频」那一页的 `.gm-note` 是**横排 flex 里的一个 flex 子项**,
   靠"占满整行"把自己挤到下一行去(flex-wrap 的常用写法)。一限宽它就不再占满,
   于是缩到按钮旁边、整段文字右移成锯齿状 —— 比不限宽难看得多,而且一个报错都没有。
   实测(真浏览器逐元素量父级 display):288 处 `gm-note`、30 处 `adapt-panel-tip`、
   15 处 `ai-chat-tip`、13 处 `rec-bulk-note` 的父级都是**横排 flex**。
   CSS 选不出"父级不是横排",所以第二版退到 `.card > xxx`(卡片是块级)。
   🔴 **第二版也退掉了** —— 截图里看得很清楚:同一页上有的说明段落限了宽、
   有的(在横排 flex 里的那些)没限,一页之内两种行宽,比统一的"太长"更像没做完。
   **一条排版规则只管住一半,通常比一条都不管更难看。**

   所以最后只留 `.view-sub`:它是页面副标题,91 个页面都有、位置固定
   (永远在 `.view-head` 这个块里)、一页只有一条 —— 不存在"一页两种宽度"。
   卡片里那些说明段落要限宽,得先把它们从"靠占满整行来换行"的写法里搬出来,
   那是改结构,不是加一层样式能办的事。 */
.view-sub { max-width: 62em; }

/* ---------- 四、卡片网格:等高卡片里,操作行贴底对齐 ---------- */
/* 【现象】内容库一排四张卡,正文长短不一 → 四张卡的「编辑 / 去分发 / 预览」
   按钮各在各的高度上,一排看过去是锯齿状的。
   【为什么不是给卡片定高】定高就要截断正文;网格本来就把同一行拉成等高了,
   缺的只是"把操作行推到底"这一下。 */
[class$="-grid"] > .card, [class*="-grid "] > .card,
[class$="-cards"] > .card, [class*="-cards "] > .card,
.draft-grid > .card {
  display: flex;
  flex-direction: column;
}
[class$="-grid"] > .card [class$="-actions"], [class*="-grid "] > .card [class$="-actions"],
[class$="-cards"] > .card [class$="-actions"], [class*="-cards "] > .card [class$="-actions"],
.draft-grid > .card [class$="-actions"] {
  margin-top: auto;   /* ← 就是这一下。父级不是 flex 列时它什么也不做,所以安全 */
}

/* ---------- 五、选中的那一项要看得出来 ---------- */
/* 设置页那排赛道、各页的单选卡片:选中和没选中只差一个小圆点,
   一屏九行时根本找不到自己选的是哪条。
   🔴 底色用 background 不用 border-color:这些行的边框多半是**行内样式**写的
      (`style="border:1px solid var(--line)"`),样式表改不动它;
      要在边上也有反应,只能靠 inset 阴影盖在内侧。
   🔴 关在 @supports 里:`:has()` 不支持的浏览器会把**整条规则**丢掉,
      而不是只丢这一句 —— 不关的话旁边那些规则会跟着一起没。 */
@supports selector(:has(*)) {
  label[class$="-opt"]:has(> input:checked), label[class*="-opt "]:has(> input:checked),
  label[class$="-option"]:has(> input:checked), label[class*="-option "]:has(> input:checked),
  label[class$="-choice"]:has(> input:checked), label[class*="-choice "]:has(> input:checked) {
    background: var(--blue-soft);
    box-shadow: inset 0 0 0 1px var(--blue-line);
  }
}

/* ---------- 六、大数字用等宽数形 ---------- */
/* 看板/统计那排数字是会变的(45 → 8 → 132)。比例数形下每次变宽度都在跳,
   一排卡片跟着左右晃。 */
.stat-num, [class$="-num"], [class*="-num "],
[class$="-kpi"], [class*="-kpi "],
[class$="-count"], [class*="-count "] { font-variant-numeric: tabular-nums; }
