/*
 * 云拍拍 · 管理后台 —— 样式
 *
 * 参照妙片 UI 方案（v5.7）的令牌体系与设计原则，换成后台自己的强调色：
 *   1. 8px 间距：只用 4 / 8 / 12 / 16 / 20 / 24 / 32 / 40 / 48，32 以上只给区块级留白。
 *   2. 一套系统字体、两个字重（400 / 600）；正文、表格、表单、按钮 14px，12px 只给说明、标签、时间。不用等宽字体，数字统一 tabular-nums。
 *   3. 一色：中性底 4 级 + 文字 3 级；强调色只给主按钮、选中、链接、键盘焦点环；功能色只有成功、错误。
 *   4. 一层：用底色分层，卡片加 1px 细线收边；常驻元素没有阴影，阴影只给浮层（菜单、轻提示、对话框）。
 *   5. 一重：每个视图最多一个实心主按钮。
 *   6. 热区：控件视觉高度 32px，小按钮的点击热区补到 44px。
 *   圆角只有 4 / 6 / 8 / 12 / 全圆。
 *
 * 布局：左侧 72 宽导航轨，内容区贴着导航轨向右铺满（不居中限宽），页边 32。
 * 深浅两种模式：<html data-mode="light | dark">，默认浅色；所有颜色都走变量，不要写死色值。
 *
 * 目录：
 *   1. 令牌与基础       2. 外壳（导航轨、账号菜单）   3. 按钮与表单控件
 *   4. 页头、卡片、栅格 5. 表格与分页                 6. 标签、状态、提示条
 *   7. 加载 / 空 / 出错 8. 图片、视频、灯箱           9. 对话框与轻提示
 *   10. 上传、标签输入、开关                          11. 各页面的专用样式
 */

/* ============================== 1. 令牌与基础 ============================== */

/* ---- 浅色（默认：后台是办公场景） ---- */
:root, [data-mode="light"] {
  --chart-1: #a8432f;         /* 图表的柱子（单系列）：朱砂 */
  /* 中性底 4 级 */
  --bg-layout: #f5f5f7;       /* 页面底、导航轨 */
  --bg-container: #ffffff;    /* 卡片、面板 */
  --fill: #f0f0f3;            /* 输入底、胶囊、选中底、占位 */
  --bg-elevated: #ffffff;     /* 浮层 */
  --line: rgb(19 19 23 / .08);        /* 卡片细线 */
  --line-hover: rgb(19 19 23 / .18);
  --hover: rgb(19 19 23 / .05);       /* 悬停叠加层，不是新的底色层级 */
  --border: #d9d9de;          /* 只给控件 */
  --border-split: #ececf0;    /* 必要的分割线 */

  /* 文字 3 级 */
  --text-1: #131317;
  --text-2: #4e4e56;
  --text-3: #74757c;

  /* 功能色只有成功、错误 */
  --success: #1f9d55;
  --error: #e5383b;
  --error-text: #d92d2d;
  --success-soft: rgb(31 157 85 / .10);
  --error-soft: rgb(229 56 59 / .08);
  --scrim-rgb: 10 10 12;      /* 压在图片上的蒙层、灯箱，深浅模式不变 */

  /* 阴影：只给浮层 */
  --shadow-2: 0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05);
  --shadow-3: 0 6px 16px -8px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03);

  --brand-hover: #b5513d;
  --brand-text: #a8432f;
  --brand-soft: rgb(var(--brand-rgb) / .10);
  --brand-line: rgb(var(--brand-rgb) / .45);
  color-scheme: light;
}

/* ---- 深色 ---- */
[data-mode="dark"] {
  --chart-1: #c8674f;         /* 图表的柱子：深色底上比朱砂亮一档，和底色的对比才够 3:1 */
  --bg-layout: #131315;
  --bg-container: #1c1c1f;
  --fill: #252528;
  --bg-elevated: #2c2c30;
  --line: rgb(255 255 255 / .07);
  --line-hover: rgb(255 255 255 / .18);
  --hover: rgb(255 255 255 / .06);
  --border: #3a3a3e;
  --border-split: #27272b;

  --text-1: #f5f5f7;
  --text-2: #a7a7ab;
  --text-3: #7f8084;

  --success: #3fcf8e;
  --error: #ff6166;
  --error-text: #ff8f93;
  --success-soft: rgb(63 207 142 / .14);
  --error-soft: rgb(255 97 102 / .12);

  --shadow-2: 0 3px 6px -4px rgba(0, 0, 0, .48), 0 6px 16px 0 rgba(0, 0, 0, .32), 0 9px 28px 8px rgba(0, 0, 0, .20);
  --shadow-3: 0 6px 16px -8px rgba(0, 0, 0, .32), 0 9px 28px 0 rgba(0, 0, 0, .20), 0 12px 48px 16px rgba(0, 0, 0, .12);

  --brand-hover: #bb5843;
  --brand-text: #e9a08e;
  --brand-soft: rgb(var(--brand-rgb) / .20);
  --brand-line: rgb(var(--brand-rgb) / .60);
  color-scheme: dark;
}

:root {
  /* 强调色：和小程序同一个朱砂色。想换品牌色，改这三个值（和上面两种模式里的 --brand-hover / --brand-text） */
  --brand: #a8432f;
  --brand-rgb: 168 67 47;
  --brand-press: #8f3726;
  --text-on-brand: #ffffff;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, sans-serif;

  --fs-h1: 20px; --lh-h1: 28px;       /* 页面标题、统计数字 */
  --fs-h2: 16px; --lh-h2: 24px;       /* 区块标题、对话框标题 */
  --fs-base: 14px; --lh-base: 22px;   /* 正文、表格、表单、按钮、状态 */
  --fs-sm: 12px; --lh-sm: 18px;       /* 说明、标签、时间、导航标签 */

  --ctl-sm: 24px; --ctl: 32px; --ctl-lg: 40px;
  --hit: 44px;
  --rail-w: 72px;
  --page-x: 32px; --page-top: 32px; --gut: 16px; --sec-gap: 40px;

  --r-sm: 4px; --r: 6px; --r-lg: 8px; --r-xl: 12px; --r-full: 999px;

  --ease-out: cubic-bezier(.215, .61, .355, 1);
  --t-fast: .1s; --t-mid: .2s; --t-slow: .3s;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }

body {
  margin: 0;
  min-width: 1024px;
  background: var(--bg-layout);
  color: var(--text-1);
  font: 400 var(--fs-base)/var(--lh-base) var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, dd, figure, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: 600; }
h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 600; }
h3 { font-size: var(--fs-base); line-height: var(--lh-base); font-weight: 600; }
b, strong { font-weight: 600; }
code, kbd, pre, samp { font-family: inherit; }

a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }

img, video { display: block; max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

[hidden] { display: none !important; }

::selection { background: rgb(var(--brand-rgb) / .25); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* 焦点环只给键盘操作下的按钮、链接、胶囊；文本输入靠边框变化表达焦点 */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }

/* 线性图标 */
.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.mono { font-variant-numeric: tabular-nums; }   /* 编号、密钥、尺寸：不换字体，只对齐数字 */
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.boot {
  min-height: 100vh; display: flex; flex-direction: column; gap: 16px;
  align-items: center; justify-content: center; color: var(--text-2);
}

/* ============================== 2. 外壳 ============================== */

/* 导航轨 72 + 内容区；内容区自己滚动，导航轨不动 */
.app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); height: 100vh; }

.rail {
  position: relative; z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0;
  background: var(--bg-layout); box-shadow: inset -1px 0 0 var(--line);
}
.rail-logo {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 60px; padding: 4px 0; margin-bottom: 12px; border-radius: var(--r-xl);
  color: var(--text-1); font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 600; text-decoration: none;
}
.rail-logo:hover { text-decoration: none; }
.logo-mark {
  width: 32px; height: 32px; border-radius: var(--r-lg);
  background: var(--brand); color: var(--text-on-brand);
  display: grid; place-items: center; font-size: 16px; font-weight: 600; line-height: 1;
}
.rail-nav, .rail-bottom { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rail-bottom { margin-top: auto; }

/* 导航项 60 宽：图标 20 + 12px 标签；当前项用中性底块 + 600，不用强调色 */
.rail-item {
  width: 60px; min-height: 56px; padding: 6px 0 4px; border: 0; border-radius: var(--r-xl); background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); text-decoration: none;
  transition: color var(--t-mid), background var(--t-mid);
}
.rail-item .i { width: 20px; height: 20px; }
.rail-item:hover { color: var(--text-1); background: var(--hover); text-decoration: none; }
.rail-item.is-on { color: var(--text-1); font-weight: 600; background: var(--fill); }
.rail-me { position: relative; }
.rail-me .avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--fill); color: var(--text-1);
  display: grid; place-items: center; font-size: var(--fs-sm); font-weight: 600; line-height: 1;
}
.rail-me.is-dev .avatar::after {   /* 开发模式：头像右下角一个提醒点 */
  content: ""; position: absolute; right: 14px; top: 26px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--error); outline: 2px solid var(--bg-layout);
}

/* 账号菜单：浮层，贴着导航轨右侧 */
.rail-menu {
  position: fixed; left: calc(var(--rail-w) + 8px); bottom: 12px; z-index: 40; width: 240px; padding: 8px;
  background: var(--bg-elevated); border-radius: var(--r-lg); box-shadow: var(--shadow-2);
}
.rail-menu-head { padding: 8px 8px 12px; }
.rail-menu-name { font-weight: 600; }
.rail-menu-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 8px; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); }
.rail-menu-row span:last-child { color: var(--text-1); }
.rail-menu-sep { height: 1px; margin: 8px 0; background: var(--border-split); }
.rail-menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; height: var(--ctl); padding: 0 8px;
  border: 0; border-radius: var(--r); background: none; color: var(--text-1); text-align: left;
}
.rail-menu-item:hover { background: var(--hover); }

.main { min-width: 0; overflow: auto; }

/* 内容区：贴导航轨左对齐、向右铺满 */
.view { padding: var(--page-top) var(--page-x) 48px; outline: none; }

/* ============================== 3. 按钮与表单控件 ============================== */

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--ctl); padding: 0 16px;
  border: 1px solid var(--border); border-radius: var(--r);
  background: transparent; color: var(--text-1);
  font-size: var(--fs-base); font-weight: 400; line-height: var(--lh-base); white-space: nowrap; text-decoration: none;
  transition: background var(--t-mid), color var(--t-mid), border-color var(--t-mid);
}
.btn:hover { color: var(--brand-text); border-color: var(--brand-line); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { color: var(--text-3); border-color: var(--border); opacity: .4; }
.btn-sm { height: var(--ctl-sm); padding: 0 8px; gap: 4px; border-radius: var(--r-sm); }
.btn-sm::after { content: ""; position: absolute; inset: -10px 0; }   /* 24 高的小按钮：热区补到 44 */
.btn-block { width: 100%; }

/* 实心主按钮：每个视图最多一个 */
.btn-primary { background: var(--brand); border-color: transparent; color: var(--text-on-brand); font-weight: 600; }
.btn-primary:hover { background: var(--brand-hover); border-color: transparent; color: var(--text-on-brand); }
.btn-primary:active { background: var(--brand-press); }
.btn-primary:disabled { background: var(--brand); color: var(--text-on-brand); border-color: transparent; }

/* 危险操作的确认按钮（对话框里）：红色实心 */
.btn-dark { background: var(--error); border-color: transparent; color: #fff; font-weight: 600; }
.btn-dark:hover { background: var(--error-text); border-color: transparent; color: #fff; }
.btn-dark:disabled { background: var(--error); color: #fff; border-color: transparent; }

/* 文字按钮 / 链接按钮 */
.btn-link {
  display: inline; padding: 0; border: 0; background: none;
  color: var(--brand-text); font-size: inherit; line-height: inherit;
}
.btn-link:hover { text-decoration: underline; }
.btn-link:disabled { color: var(--text-3); opacity: .4; text-decoration: none; }
.btn-link.is-quiet { color: var(--text-2); }

.input, .select, .textarea {
  height: var(--ctl); padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--bg-container); color: var(--text-1);
  transition: border-color var(--t-mid);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-hover); }
/* 聚焦 = 边框提亮一档；不变色、不加光环 */
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--text-3); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--fill); color: var(--text-3); }
.textarea { height: auto; padding: 8px 12px; line-height: var(--lh-base); resize: vertical; width: 100%; display: block; }
.select { padding-right: 28px; cursor: pointer; }
.input-full { width: 100%; }
.input-mono { font-variant-numeric: tabular-nums; }

/* 带放大镜的搜索框：回车搜索 */
.search-box { position: relative; display: inline-flex; align-items: center; }
.search-box .i { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.search-box .input { width: 240px; padding-left: 36px; }
.search-box .input::-webkit-search-cancel-button { cursor: pointer; }

.field { display: block; margin-top: 16px; }
.field:first-child { margin-top: 0; }
.field-label { display: block; margin-bottom: 8px; color: var(--text-1); }
.field .input, .field .select { width: 100%; }
.hint { display: block; margin-top: 4px; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-3); }
.field-error { margin-top: 8px; color: var(--error-text); }

/* 筛选行：筛选胶囊在左，「清除筛选」跟在后面 */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; }

/* 筛选胶囊：未选 = 细线 + 次级文字；选中 = 中性填充 + 主文字。强调色留给主按钮 */
.fchips { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip, .chip-btn {
  display: inline-flex; align-items: center; gap: 4px; height: var(--ctl); padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: none;
  color: var(--text-2); font-size: var(--fs-base); white-space: nowrap; text-decoration: none;
  transition: background var(--t-mid), color var(--t-mid);
}
.fchip:hover, .chip-btn:hover { color: var(--text-1); background: var(--hover); text-decoration: none; }
.fchip.is-on, .chip-btn.is-on { background: var(--fill); border-color: transparent; color: var(--text-1); font-weight: 600; }
.chip-btn.is-sm { height: var(--ctl-sm); padding: 0 8px; border-radius: var(--r); font-size: var(--fs-sm); }

/* 分段切换（待打款 / 已打款 / 失败） */
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--r); background: var(--fill); }
.seg-item {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px;
  border-radius: var(--r-sm); color: var(--text-2); text-decoration: none; transition: color var(--t-mid), background var(--t-mid);
}
.seg-item:hover { color: var(--text-1); text-decoration: none; }
.seg-item.is-on { background: var(--bg-elevated); color: var(--text-1); font-weight: 600; }
[data-mode="light"] .seg-item.is-on { box-shadow: 0 0 0 1px var(--line); }

/* 页签：当前项主文字 + 600 + 2px 强调色下划线 */
.tabs { display: flex; gap: 32px; margin-bottom: 24px; box-shadow: inset 0 -1px 0 var(--border-split); }
.tab {
  position: relative; display: inline-flex; align-items: center; height: var(--hit);
  color: var(--text-2); text-decoration: none; transition: color var(--t-mid);
}
.tab:hover { color: var(--text-1); text-decoration: none; }
.tab.is-on { color: var(--text-1); font-weight: 600; }
.tab.is-on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 1px; background: var(--brand); }

/* ============================== 4. 页头、卡片、栅格 ============================== */

/* 页头：一行，最少 40 高。标题 20 + 副标题同行，右侧是 32 高的控件（搜索、筛选、主按钮在最右） */
.page-head { display: flex; align-items: center; gap: 12px; min-height: 40px; margin-bottom: 24px; }
.page-head-main { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-width: 0; }
.page-sub { color: var(--text-3); }
.page-actions { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.page-head + .tabs { margin-top: -12px; }
.crumb { margin: -8px 0 12px; }
.crumb a { color: var(--text-2); }
.crumb a:hover { color: var(--text-1); text-decoration: none; }

.card {
  background: var(--bg-container); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 24px; margin-bottom: var(--gut);
}
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 16px; }
.card-head .muted { color: var(--text-3); }
.card-flush > .card-head { padding: 16px 24px 0; margin-bottom: 8px; }
.card-head .card-tools { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.card-note { margin-top: 12px; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-3); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--gut); align-items: stretch; }
.grid-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gut); align-items: stretch; }
.grid-2 > .card, .grid-even > .card { margin-bottom: 0; height: 100%; }
.grid-2, .grid-even { margin-bottom: var(--gut); }
@media (max-width: 1279px) { .grid-2, .grid-even { grid-template-columns: minmax(0, 1fr); } }

/* 数字卡片 */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gut); margin-bottom: var(--gut); }
.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat { background: var(--bg-container); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 16px 24px; transition: border-color var(--t-mid); }
.stat-label { color: var(--text-2); }
.stat-value { margin-top: 4px; font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: 600; }
.stat-note { margin-top: 4px; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-3); }
a.stat-link { display: block; color: inherit; text-decoration: none; }
a.stat-link:hover { border-color: var(--line-hover); text-decoration: none; }
a.stat-link.is-on { border-color: var(--brand-line); }

/* 「名称：值」的定义列表 */
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; }
.kv-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kv-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kv-1 { grid-template-columns: minmax(0, 1fr); }
.kv dt { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-3); }
.kv dd { margin-top: 4px; min-height: 22px; overflow-wrap: anywhere; }
.kv .kv-wide { grid-column: 1 / -1; }

/* 一行一条「名称 …… 值」 */
.rows > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border-split); }
.rows > div:first-child { border-top: 0; padding-top: 0; }
.rows > div:last-child { padding-bottom: 0; }
.rows dt { color: var(--text-2); }
.rows dd { font-weight: 600; text-align: right; }

.plain-list li { position: relative; padding-left: 16px; margin-top: 8px; }
.plain-list li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 4px; height: 4px; border-radius: 50%; background: var(--text-3); }
.quote { margin-top: 16px; padding: 8px 12px; border-radius: var(--r); background: var(--fill); overflow-wrap: anywhere; white-space: pre-wrap; }

.text-block { white-space: pre-wrap; overflow-wrap: anywhere; }
.inset { padding: 0 24px; }
.mt-24 { margin-top: 24px; }
.notice-inline { margin: 16px 0 0; }

/* ============================== 5. 表格与分页 ============================== */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  height: 40px; padding: 0 12px; text-align: left; white-space: nowrap;
  font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 400; color: var(--text-3);
  border-bottom: 1px solid var(--border-split);
}
.table td { height: 48px; padding: 8px 12px; border-bottom: 1px solid var(--border-split); vertical-align: middle; }
.table tbody tr:last-child > td { border-bottom: 0; }
.table tbody tr > td { transition: background var(--t-fast); }
.table tbody tr:hover > td { background: var(--hover); }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table th.num { text-align: right; }
.table tr.is-link { cursor: pointer; }
/* 整行都能点的表格里，第一列的编号不用强调色（一整列太吵），悬停时才显出来 */
.table tr.is-link > td:first-child > a { color: var(--text-1); }
.table tr.is-link:hover > td:first-child > a { color: var(--brand-text); text-decoration: none; }
.table .sub { display: block; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-3); }
.table .ops { white-space: nowrap; text-align: right; }
.table .ops > * + * { margin-left: 16px; }
.table .clip { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 卡片里不贴边的表格 */
.card:not(.card-flush) .table th:first-child, .card:not(.card-flush) .table td:first-child { padding-left: 0; }
.card:not(.card-flush) .table th:last-child, .card:not(.card-flush) .table td:last-child { padding-right: 0; }

/* 展开的子行（门店的团员列表）：用底色区分，不再套一层描边的框 */
.table tr.sub-row > td { padding: 0 24px 16px; background: var(--hover); height: auto; }
.table tr.sub-row:hover > td { background: var(--hover); }
.sub-panel { background: var(--bg-container); border-radius: var(--r-lg); overflow: hidden; }
.sub-panel .table th:first-child, .sub-panel .table td:first-child { padding-left: 16px; }
.sub-panel .table th:last-child, .sub-panel .table td:last-child { padding-right: 16px; }

.chev-btn {
  position: relative; width: var(--ctl-sm); height: var(--ctl-sm); margin-right: 4px; padding: 0; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--text-2); vertical-align: middle;
}
.chev-btn::after { content: ""; position: absolute; inset: -10px; }
.chev-btn:hover { background: var(--hover); color: var(--text-1); }
.chev-btn::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-top: -2px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform var(--t-mid);
}
.chev-btn[aria-expanded="true"]::before { transform: rotate(45deg); }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 24px; border-top: 1px solid var(--border-split); }
.pager-info { margin-right: 8px; color: var(--text-3); }

.is-refreshing { opacity: .55; pointer-events: none; transition: opacity var(--t-mid); }

/* ============================== 6. 标签、状态、提示条 ============================== */

/* 标签：只有中性、强调两种 */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: var(--r-sm); font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 400; white-space: nowrap;
  background: var(--fill); color: var(--text-2);
}
.badge.t-accent { background: var(--brand-soft); color: var(--brand-text); }
.badge.t-dark { color: var(--text-1); font-weight: 600; }
.badge.t-mute { background: transparent; color: var(--text-3); padding: 0; }
.badge + .badge { margin-left: 4px; }

/* 状态：文字不带底色，只有圆点带颜色（成功绿、要人处理的红、进行中的强调色，其余灰） */
.st, .badge.t-ok, .badge.t-warn {
  display: inline-flex; align-items: center; gap: 8px; height: auto; padding: 0; background: none;
  font-size: var(--fs-base); line-height: var(--lh-base); font-weight: 400; color: var(--text-1); white-space: nowrap;
}
.st::before, .badge.t-ok::before, .badge.t-warn::before {
  content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3);
}
.st.t-ok::before, .badge.t-ok::before { background: var(--success); }
.st.t-warn::before, .badge.t-warn::before { background: var(--error); }
.st.t-accent::before { background: var(--brand); }
.st.t-dark::before { background: var(--text-1); }
.st.t-mute, .st.t-neutral { color: var(--text-2); }
.st.is-live::before { box-shadow: 0 0 0 3px var(--brand-soft); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgb(var(--brand-rgb) / 0); } }
.st + .badge, .badge + .st { margin-left: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: var(--r-sm); background: var(--fill); color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); white-space: nowrap;
}
.chip + .chip { margin-left: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.chips .chip + .chip { margin-left: 0; }
.chip-x { position: relative; padding: 0 2px; border: 0; background: none; color: var(--text-3); font-size: 14px; line-height: 1; text-decoration: none; }
.chip-x::after { content: ""; position: absolute; inset: -12px -8px; }
.chip-x:hover { color: var(--text-1); text-decoration: none; }
.filters > .chip { height: var(--ctl); padding: 0 12px; border-radius: var(--r-lg); font-size: var(--fs-base); color: var(--text-1); }

/* 提示条：中性底；要人留意的用浅红底，成功的用浅绿底。文字都是主文字色 */
.notice {
  padding: 12px 16px; margin-bottom: 16px; border-radius: var(--r-lg);
  background: var(--fill); color: var(--text-1); line-height: var(--lh-base);
}
.notice-warn { background: var(--error-soft); }
.notice-ok { background: var(--success-soft); }
.notice p + p { margin-top: 4px; }
.notice a { text-decoration: underline; }

.copy-btn {
  position: relative; margin-left: 8px; padding: 0 8px; height: 22px; border: 0; border-radius: var(--r-sm);
  background: var(--fill); color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); vertical-align: middle;
  transition: color var(--t-mid);
}
.copy-btn::after { content: ""; position: absolute; inset: -11px -4px; }
.copy-btn:hover { color: var(--text-1); }

/* ============================== 7. 加载 / 空 / 出错 ============================== */

.state {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 200px; padding: 32px 24px; color: var(--text-3); text-align: center;
}
.state-sm { min-height: 80px; padding: 16px; }
.state-title { color: var(--text-2); }
.state-error .state-title { color: var(--error-text); }
.state .btn { margin-top: 8px; }

.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border-split); border-top-color: var(--text-2);
  animation: spin .8s linear infinite;
}
.spinner-sm { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================== 8. 图片、视频、灯箱 ============================== */

/* 缩略图：点击看大图。图片坏了（临时链接过期）时显示占位，不显示破图 */
.thumb {
  position: relative; display: block; flex: none; padding: 0; overflow: hidden;
  width: 96px; aspect-ratio: 3 / 4;
  border: 0; border-radius: var(--r-lg); background: var(--fill);
  color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm);
}
button.thumb { cursor: zoom-in; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease-out); }
button.thumb:hover img { transform: scale(1.04); }
.thumb-xs { width: 40px; border-radius: var(--r-sm); }
.thumb-s { width: 48px; border-radius: var(--r); }
.thumb-l { width: 144px; }
.thumb-xl { width: 192px; }
.thumb-sq { aspect-ratio: 1; }
.thumb.is-empty, .thumb.is-broken { display: grid; place-items: center; text-align: center; cursor: default; }
.thumb.is-broken img { display: none; }
.thumb.is-broken::after { content: "图片已失效"; padding: 4px; }
.thumb-xs.is-broken::after, .thumb-s.is-broken::after { content: "失效"; }
.thumb-play::after {
  content: ""; position: absolute; left: 50%; top: 50%; margin: -7px 0 0 -4px;
  border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent #fff;
  filter: drop-shadow(0 0 2px rgb(var(--scrim-rgb) / .6));
}
.thumb-play.is-broken::after { all: unset; content: "失效"; }
.thumb-play.no-cover { background: rgb(var(--scrim-rgb) / .55); }

.video-box {
  position: relative; width: 192px; aspect-ratio: 9 / 16; overflow: hidden;
  border-radius: var(--r-lg); background: rgb(var(--scrim-rgb));
}
.video-box video { width: 100%; height: 100%; object-fit: contain; background: rgb(var(--scrim-rgb)); }
.video-box.is-broken video { display: none; }
.video-box.is-broken { display: grid; place-items: center; background: var(--fill); color: var(--text-3); font-size: var(--fs-sm); padding: 12px; text-align: center; }
.video-box.is-broken::after { content: "视频放不出来：链接可能已过期，刷新页面后再试"; }
.video-box.is-empty { display: grid; place-items: center; background: var(--fill); color: var(--text-3); font-size: var(--fs-sm); }

.figs { display: flex; flex-wrap: wrap; gap: 16px; }
.fig { display: flex; flex-direction: column; gap: 8px; }
.fig figcaption { max-width: 192px; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); overflow-wrap: anywhere; }
.fig .thumb + figcaption { max-width: 96px; }
.fig .thumb-l + figcaption { max-width: 144px; }

.overlay {
  position: fixed; inset: 0; z-index: 50; overflow-y: auto;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 24px 24px; background: rgb(var(--scrim-rgb) / .45);
  animation: fade-in var(--t-mid) var(--ease-out);
}
@keyframes fade-in { from { opacity: 0; } }

.lightbox { padding: 24px; align-items: center; background: rgb(var(--scrim-rgb) / .92); cursor: zoom-out; }
.lightbox-stage { cursor: default; max-width: 100%; }
.lightbox-stage img, .lightbox-stage video { max-width: calc(100vw - 96px); max-height: calc(100vh - 96px); border-radius: var(--r-sm); }
.lightbox-stage.is-broken img, .lightbox-stage.is-broken video { display: none; }
.lightbox-stage.is-broken::after { content: "链接已失效，请刷新页面后再看"; color: #fff; }
.lightbox-close {
  position: fixed; top: 16px; right: 16px; width: var(--ctl-lg); height: var(--ctl-lg); padding: 0;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 22px; line-height: 1;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .24); }
.lightbox-open { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); color: rgba(255, 255, 255, .8); }
.lightbox-open:hover { color: #fff; }

/* ============================== 9. 对话框与轻提示 ============================== */

/* 对话框：页脚右对齐，取消（描边）在左、确认（主按钮）在右；危险确认是红色主按钮 */
.dialog {
  width: 440px; max-width: 100%; padding: 24px;
  background: var(--bg-elevated); border-radius: var(--r-xl); box-shadow: var(--shadow-3);
  animation: dialog-in var(--t-slow) var(--ease-out);
}
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px); } }
.dialog-wide { width: 640px; }
.dialog-title { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 600; overflow-wrap: anywhere; }
.dialog-body { margin-top: 16px; color: var(--text-1); }
.dialog-body > p + p { margin-top: 8px; }
.dialog-body > p + .field { margin-top: 16px; }
.dialog-error { margin-top: 16px; padding: 8px 12px; border-radius: var(--r); background: var(--error-soft); color: var(--text-1); }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }

/* 轻提示：顶部居中，浮层 + 状态圆点 */
.toasts { position: fixed; top: 16px; left: 0; right: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: baseline; gap: 8px; max-width: 480px; padding: 8px 16px;
  border-radius: var(--r-lg); background: var(--bg-elevated); color: var(--text-1);
  box-shadow: var(--shadow-2); cursor: pointer;
  animation: toast-in var(--t-mid) var(--ease-out);
}
.toast::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); transform: translateY(-2px); }
.toast.t-ok::before { background: var(--success); }
.toast.t-error::before { background: var(--error); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ============================== 10. 上传、标签输入、开关 ============================== */

.uploader-label { margin-bottom: 8px; color: var(--text-1); }
.uploader-row { display: flex; gap: 16px; align-items: flex-start; }
.uploader-preview {
  flex: none; width: 96px; aspect-ratio: 3 / 4; overflow: hidden;
  border: 1px dashed var(--border); border-radius: var(--r-lg); background: var(--fill);
  display: grid; place-items: center; color: var(--text-3); font-size: var(--fs-sm); text-align: center;
}
.uploader-preview.has-media { border-color: transparent; }
.uploader-preview img, .uploader-preview video { width: 100%; height: 100%; object-fit: cover; }
.uploader-preview.is-video { width: 108px; aspect-ratio: 9 / 16; background: rgb(var(--scrim-rgb)); }
.uploader-preview.is-video:not(.has-media) { background: var(--fill); }
.uploader-preview.is-video video { object-fit: contain; }
.uploader-preview.is-wide { width: 160px; aspect-ratio: 4 / 3; }
.uploader-side { flex: 1; min-width: 0; }
.uploader-pick { cursor: pointer; }
.uploader-pick:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.uploader-pick.is-disabled { opacity: .4; pointer-events: none; }
.uploader-status { margin-top: 8px; color: var(--text-2); overflow-wrap: anywhere; }
.uploader-status.is-ok { color: var(--success); }
.uploader-status.is-error { color: var(--error-text); }

.progress { height: 4px; margin-top: 8px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--brand); transition: width var(--t-mid); }

.taginput-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: var(--ctl); padding: 4px 8px;
  border: 1px solid var(--border); border-radius: var(--r); background: var(--bg-container); transition: border-color var(--t-mid);
}
.taginput-box:hover { border-color: var(--line-hover); }
.taginput-box:focus-within { border-color: var(--text-3); }
.taginput-box input { flex: 1; min-width: 120px; height: 22px; padding: 0 4px; border: 0; outline: none; background: none; }
.taginput-box .chip { margin-left: 0; }
.taginput-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-size: var(--fs-sm); color: var(--text-3); }

/* 启用开关 */
.switch {
  position: relative; width: 36px; height: 20px; padding: 0; border: 0; border-radius: 10px;
  background: var(--border); transition: background var(--t-mid); vertical-align: middle;
}
.switch::before { content: ""; position: absolute; inset: -12px -4px; }   /* 热区 44 */
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform var(--t-mid) var(--ease-out);
}
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }
.switch:disabled { opacity: .4; }

.form-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
.form-narrow { max-width: 560px; }
.form-foot { display: flex; align-items: center; gap: 16px; margin-top: 24px; }

/* ============================== 11. 各页面的专用样式 ============================== */

/* ---- 登录 ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 32px; }
.login-card {
  width: 384px; padding: 32px; background: var(--bg-container);
  border: 1px solid var(--line); border-radius: var(--r-xl);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-name { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 600; }
.brand-sub { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-3); }
.login-card h1 { margin-top: 32px; }
.login-card .field { margin-top: 16px; }
.input-code {
  width: 100%; height: 48px; text-align: center; text-transform: uppercase;
  font-size: 20px; font-weight: 600; letter-spacing: .3em; padding-left: calc(12px + .3em); border-radius: var(--r-lg);
}
.input-code::placeholder { font-size: var(--fs-base); font-weight: 400; letter-spacing: 0; text-transform: none; }
.login-card .btn-primary { height: var(--ctl-lg); margin-top: 16px; font-size: var(--fs-h2); border-radius: var(--r-lg); }
.login-notice { margin-top: 16px; margin-bottom: 0; }
.login-alt { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border-split); text-align: center; }

/* ---- 订单详情 ---- */
.order-id { overflow-wrap: anywhere; }
.section-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: var(--sec-gap) 0 16px; }
.section-title:first-child { margin-top: 0; }
.section-title .muted { color: var(--text-3); }
.section-title .card-tools { margin-left: auto; display: flex; gap: 16px; }
.section-title + .card, .section-title ~ .grid-even { margin-top: 0; }

.subhead { margin: 24px 0 8px; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-3); }
.subhead:first-child { margin-top: 0; }

/* 一次模型调用：折叠时一行摘要，展开看全部 */
.job { background: var(--bg-container); border: 1px solid var(--line); border-radius: var(--r-xl); margin-bottom: 8px; transition: border-color var(--t-mid); }
.job:hover { border-color: var(--line-hover); }
.job-sum {
  display: flex; align-items: center; gap: 16px; min-height: 56px; padding: 8px 24px;
  cursor: pointer; list-style: none; border-radius: var(--r-xl);
}
.job-sum::-webkit-details-marker { display: none; }
.job[open] > .job-sum { box-shadow: inset 0 -1px 0 var(--border-split); border-radius: var(--r-xl) var(--r-xl) 0 0; }
.job-title { width: 168px; flex: none; font-weight: 600; }
.job-title small { display: block; font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 400; color: var(--text-3); }
.job-meta { color: var(--text-2); white-space: nowrap; }
.job-meta b { color: var(--text-1); font-weight: 600; }
.job-fail { color: var(--error-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.job-sum .chev { margin-left: auto; flex: none; width: 8px; height: 8px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(45deg); transition: transform var(--t-mid); }
.job[open] > .job-sum .chev { transform: rotate(-135deg); }
.job-body { padding: 24px; }
.job-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 32px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border-split); }
.job-col > h3 { margin-bottom: 12px; }

.prompt-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-3); }
.prompt {
  padding: 12px 16px; border-radius: var(--r-lg); background: var(--fill);
  line-height: 24px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow-y: auto;
}

.params { width: 100%; border-collapse: collapse; }
.params th, .params td { padding: 8px 0; border-top: 1px solid var(--border-split); text-align: left; vertical-align: top; }
.params tr:first-child th, .params tr:first-child td { border-top: 0; }
.params th { width: 46%; font-weight: 400; color: var(--text-2); padding-right: 12px; }
.params th code { display: block; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-3); }
.params td { overflow-wrap: anywhere; }

.result + .result { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-split); }
.result-meta { margin-top: 8px; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-3); }
.result.is-old .thumb img, .result.is-old .video-box video { opacity: .5; }

/* ---- 提现处理 ---- */
.payout { display: flex; align-items: center; gap: 24px; padding: 20px 24px; border-top: 1px solid var(--border-split); }
.payout:first-child { border-top: 0; }
.payout-main { flex: 1; min-width: 0; }
.payout-amount { font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: 600; }
.payout-name { font-weight: 600; }
.payout-actions { display: flex; gap: 8px; flex: none; }

/* ---- 素材 ---- */
.sort-btns { display: inline-flex; gap: 4px; }
.sort-btn {
  position: relative; width: var(--ctl-sm); height: var(--ctl-sm); padding: 0; border: 0; border-radius: var(--r-sm); background: none;
  color: var(--text-2); font-size: var(--fs-sm); line-height: 1; transition: background var(--t-mid), color var(--t-mid);
}
.sort-btn::after { content: ""; position: absolute; inset: -10px -2px; }
.sort-btn:hover { background: var(--hover); color: var(--text-1); }
.sort-btn:disabled { opacity: .3; background: none; }
.asset-desc { max-width: 32vw; color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tagbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.tagbar-label { color: var(--text-3); margin-right: 4px; }

.import-item { display: flex; align-items: flex-start; gap: 16px; padding: 12px 24px; border-top: 1px solid var(--border-split); }
.import-item:first-child { border-top: 0; }
.import-no { width: 24px; flex: none; color: var(--text-3); text-align: right; }
.import-main { flex: 1; min-width: 0; }
.import-url { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-msg { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-3); overflow-wrap: anywhere; }
.import-msg.is-fail { color: var(--error-text); }

/* ---- 模型配置 ---- */
.cfg-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 8px 24px; padding: 16px 0; border-top: 1px solid var(--border-split); }
.cfg-row:first-of-type { border-top: 0; padding-top: 0; }
.cfg-label { padding-top: 5px; }
.cfg-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: var(--ctl); }
.cfg-line .input { width: 320px; max-width: 100%; }
.cfg-line .input-num { width: 120px; }
.cfg-unit { color: var(--text-3); }
.cfg-row .hint { max-width: 560px; }
.cfg-source { margin-top: 4px; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-3); }
.cfg-source .btn-link { margin-left: 12px; }
.cfg-calc { padding-top: 5px; color: var(--text-2); }
.cfg-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-split); }
.cfg-test { flex: 1; min-width: 240px; color: var(--text-3); }
.cfg-test.t-ok { color: var(--success); }
.cfg-test.t-warn { color: var(--error-text); }
.cfg-test.t-neutral { color: var(--text-3); }
.card > .notice { margin-bottom: 16px; }
/* 保存条：贴在内容区底部，页面长也够得着 */
.save-bar {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 16px;
  margin: 8px calc(var(--page-x) * -1) -48px; padding: 12px var(--page-x);
  background: var(--bg-layout); box-shadow: inset 0 1px 0 var(--border-split);
}
.save-bar .muted { color: var(--text-3); }
.clip-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.price-table td { height: 64px; }
.input.price-input { width: 104px; text-align: right; }
.is-neg { color: var(--error-text); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .spinner { animation: none; border-top-color: var(--border-split); border-right-color: var(--text-2); }
}

/* 定价的两张表（照片、视频）列宽一致，上下对得齐 */
.price-table { table-layout: fixed; }
.price-table th:nth-child(1) { width: 22%; }
.price-table th:nth-child(2) { width: 16%; }
.price-table th:nth-child(3), .price-table th:nth-child(4) { width: 13%; }
.price-table th:nth-child(5) { width: 16%; }
.price-table th:nth-child(6) { width: 10%; }

/* 金额、数量这类短输入不拉满整行 */
.field .input[inputmode="decimal"], .field .input[type="number"] { max-width: 240px; }

/* 按链接下载：进度里每条的操作、截取对话框 */
.import-item .thumb { margin-top: 2px; }
.import-ops { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 4px; }
.import-ops .badge + .badge { margin-left: 0; }
.import-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.table .strong + .badge { margin-left: 8px; }
.clip-box { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 24px; align-items: start; }
.clip-video { width: 100%; max-height: 56vh; border-radius: var(--r-lg); background: rgb(var(--scrim-rgb)); }
.clip-form .field .input { max-width: 240px; }

/* ---------------------------------------------------------------- 营收统计 */

/* 走势图：一组柱子，一个系列。柱子最宽 24px、顶端 4px 圆角、从同一条基线长出来；网格和坐标轴退到最淡 */
.rev-chart { position: relative; display: flex; gap: 12px; padding-top: 24px; }
.rev-axis { display: flex; flex-direction: column; justify-content: space-between; height: 200px; min-width: 40px; text-align: right;
  font-size: var(--fs-sm); line-height: 1; color: var(--text-3); }
.rev-cols { flex: 1; min-width: 0; display: flex; align-items: stretch;
  background: linear-gradient(var(--border-split), var(--border-split)) 0 0 / 100% 1px no-repeat,
              linear-gradient(var(--border-split), var(--border-split)) 0 100px / 100% 1px no-repeat; }
.rev-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; border-radius: var(--r-sm); outline-offset: -2px; }
.rev-plot { position: relative; width: 100%; height: 200px; display: flex; align-items: flex-end; justify-content: center;
  box-shadow: inset 0 -1px 0 var(--line-hover); }
.rev-bar { display: block; width: calc(100% - 2px); max-width: 24px; min-width: 2px; border-radius: 4px 4px 0 0; background: var(--chart-1); transition: opacity var(--t-mid); }
.rev-col:hover .rev-plot, .rev-col:focus-visible .rev-plot { background: var(--hover); }
.rev-peak { position: absolute; left: 50%; transform: translateX(-50%); margin-bottom: 4px; white-space: nowrap;
  font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 600; color: var(--text-1); pointer-events: none; }
.rev-tick { height: 24px; padding-top: 6px; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-3); white-space: nowrap; }
.rev-tip { position: absolute; top: 0; z-index: 2; min-width: 132px; padding: 8px 12px; border-radius: var(--r-lg);
  background: var(--bg-elevated); box-shadow: var(--shadow-2); font-size: var(--fs-sm); line-height: var(--lh-sm); pointer-events: none; }
.rev-tip-head { color: var(--text-3); margin-bottom: 4px; }
.rev-tip strong { font-size: var(--fs-base); line-height: var(--lh-base); color: var(--text-1); margin-right: 8px; }
.rev-tip span { color: var(--text-2); }
.rev-details { margin-top: 16px; }
.rev-details > summary { cursor: pointer; color: var(--brand-text); width: fit-content; }
.rev-details .table-wrap { margin: 12px -24px -24px; max-height: 320px; overflow: auto; border-top: 1px solid var(--border-split); }
.rev-sub { display: block; font-size: var(--fs-sm); line-height: var(--lh-sm); }
.rev-metric { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 600; }
.rev-note { font-size: var(--fs-sm); line-height: var(--lh-sm); min-height: 0 !important; margin-top: 2px !important; }
.rev-foot { font-size: var(--fs-sm); line-height: var(--lh-sm); margin-top: var(--gut); }
@media (max-width: 1099px) { .stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
