/* ==========================================================================
   海报投放管理页 · 浅色主题 · 手机/电脑自适应
   视觉基准：docs/design/design-system.html（工业青蓝色板 + token 化间距/字号/圆角/阴影）
   颜色语义（不可越界）：青蓝 = 云端已生效；琥珀 = 本地未发布/提醒；灰 = 无状态；
                        墨绿 = 成功；砖红 = 危险。

   【本轮视觉收敛纪要】（克制极简六旋钮，审计见 docs/06-视觉审计-克制极简六旋钮-2026-09-17.md）
     · 旋钮① 明度层级：合格，不动（文字灰阶 3 档）。
     · 旋钮② 字号对比：字号全部收敛到 6 档 token，标题÷正文 26÷14 = 1.86 ≥ 1.8。
     · 旋钮③ 留白密度：区块 16 > 卡内 12 > 元素 8，三层拉开；散值吸附到 4 的倍数。
     · 旋钮④ 光影层次：仅微调 --sh-1（近层 4%、远层 24px、补顶部高光）。
     · 旋钮⑤ 边缘精度：删除溢出的 5px / 9px 圆角，映射回 --r-sm / --r-md。
     · 旋钮⑥ 材质暗示：合格，不动（全站零装饰渐变）。

   【硬纪律】新增样式一律引用 token，禁止写死 px。间距/内边距/外边距/间距一律取 4 的倍数。
   唯一例外（必须保留，且已在本文件逐处注释）：
     a) .badge 的 11px 字号（胶囊角标，放大后会挤压缩略图）；
     b) 角标 / 图标 / 勾选框的 top/left/right/bottom 定位偏移；
     c) 1px / 1.5px / 2px 边框与视觉微调线、50% 居中、100% 铺满。
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  /* 中性 */
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #FBFCFE;
  --border: #E3E8EF;
  --border-strong: #CDD6E2;
  --text: #1B2430;
  --text-2: #5A6675;
  --text-3: #8A94A3;

  /* 主色：工业青蓝 */
  --brand-50: #EDF5FB;
  --brand-100: #D7E9F4;
  --brand-200: #AFD2E7;
  --brand-300: #7FB4D5;
  --brand-400: #4A93BE;
  --brand-500: #1F76A5;
  --brand-600: #155F87;
  --brand-700: #104A6A;
  --brand-800: #0C3A53;

  /* 语义色 */
  --ok: #127A4B;       --ok-soft: #E7F5EE;       --ok-border: #B6E2CC;
  --warn: #B26A00;     --warn-strong: #8A5200;   --warn-soft: #FFF4E0;  --warn-border: #F0D9A8;
  --danger: #C0392B;   --danger-soft: #FDECEA;   --danger-border: #F2C2BD;
  --neutral: #6B7686;  --neutral-soft: #F0F2F6;  --neutral-border: #D6DCE6;

  /* 圆角（4 档 + 必要的 50% 居中） */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-pill: 999px;

  /* 阴影 3 级
     [旋钮④] 主力卡片 --sh-1：双层 + 顶部高光；近层 1px/2px 且 4%（≤4% 红线）、
     远层扩散 40px（≥24px 红线）。纵深靠扩散半径造，不靠调高不透明度。
     --sh-2 / --sh-3 与焦点环、灯箱阴影保持不动。 */
  --sh-1: 0 1px 2px rgba(20, 35, 60, .04), 0 24px 40px rgba(20, 35, 60, .05), inset 0 1px 0 rgba(255, 255, 255, .9);
  --sh-2: 0 6px 20px rgba(20, 35, 60, .10);
  --sh-3: 0 16px 48px rgba(15, 25, 45, .26);

  /* 间距阶梯（只用 4 的倍数；三层：--s4 区块 > --s3 卡内 > --s2 元素） */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;

  /* 字号阶梯（收敛到 6 档；标题÷正文 = 26 ÷ 14 = 1.86 ≥ 1.8 红线） */
  --f-caption: 12px; --f-small: 13px; --f-body: 14px; --f-h3: 16px; --f-h2: 20px; --f-h1: 26px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--f-body);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: var(--brand-600); }
[hidden] { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
  padding: var(--s2) var(--s4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--sh-1);
}

.brand { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  /* 9px 溢出档位 → --r-md（旋钮⑤ 圆角收敛） */
  border-radius: var(--r-md);
  background: var(--brand-600);
  color: #fff;
  font-weight: 700;
  font-size: var(--f-small);
  letter-spacing: .5px;
}

/* 页面主标题取 --f-h1（= 26px），与正文 14px 拉开到 1.86 ≥ 1.8；副标保持 --f-caption。 */
.brand-text h1 { font-size: var(--f-h1); font-weight: 700; }
.brand-text .sub { font-size: var(--f-caption); color: var(--text-3); }

.conn { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }

.light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--neutral);
  box-shadow: 0 0 0 3px rgba(107, 118, 134, .18);
}
.light-connected { background: var(--ok); box-shadow: 0 0 0 3px rgba(18, 122, 75, .18); }
.light-disconnected { background: var(--danger); box-shadow: 0 0 0 3px rgba(192, 57, 43, .18); }
.light-checking { background: var(--warn); box-shadow: 0 0 0 3px rgba(178, 106, 0, .18); }

.status-text { font-size: var(--f-small); color: var(--text-2); }

/* ---------- 按钮 ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: var(--s2) var(--s3);
  font-size: var(--f-small);
  line-height: 1.2;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s, border-color .12s, opacity .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--neutral-soft); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-sm { padding: var(--s1) var(--s2); font-size: var(--f-small); }
.btn-primary { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-primary:hover { background: var(--brand-700); border-color: var(--brand-700); }
.btn-danger { color: var(--danger); border-color: var(--danger-border); background: var(--surface); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--neutral-soft); }
.btn-block { width: 100%; display: block; padding: var(--s3); font-size: var(--f-body); font-weight: 600; }
.btn-icon { padding: var(--s1) var(--s2); font-size: var(--f-small); line-height: 1; }

/* ---------- 布局（桌面 2 列 / 手机纵向） ----------
 * [改造 2026-10-20] 由「3 列等宽」改为「2 列 + 内容主次」：
 *   · 左主列（宽）：图库（选料）→ 本次编辑（排片）
 *   · 右侧栏（窄、粘性）：播放设置（参数）+ 发布（动作）
 * 原 3 列下右栏内容稀疏、留白失衡；2 列让"选料—排片"同屏连贯，
 * 右侧固定为"参数 + 发布"一条纵向主轴。
 * [旋钮③] 区块间距 = --s4(16) > 卡内 --s3(12) > 元素 --s2(8)：三层逐级递减。 */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.9fr);
  gap: var(--s4);
  padding: var(--s3);
  align-items: start;
  max-width: 1440px;
  margin: 0 auto;
}
.col { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }

/* 右侧栏：随滚动保持可见（桌面），保证「发布」随时可点 */
.side {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  min-width: 0;
  position: sticky;
  top: var(--s3);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: var(--s3);
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  margin-bottom: var(--s2);
  flex-wrap: wrap;
}
.panel-head h2 { font-size: var(--f-h3); font-weight: 700; }
.panel-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }

.panel-tools { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s2); }

.muted { color: var(--text-3); font-size: var(--f-small); }
.hint { color: var(--text-3); font-size: var(--f-caption); margin: var(--s1) 0 var(--s2); }

/* ---------- 说明折叠（改造 2026-10-20）----------
 * 常驻的解释性小字是"视觉噪音"的主要来源：把长说明收进 <details>，
 * 主界面只留一句要点。默认收起，需要时点开。 */
.hint-details {
  margin: var(--s2) 0;
  padding: var(--s2) var(--s3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--f-caption);
  color: var(--text-3);
}
.hint-details > summary {
  cursor: pointer;
  color: var(--text-2);
  font-weight: 600;
  list-style: none;
  user-select: none;
}
.hint-details > summary::-webkit-details-marker { display: none; }
.hint-details > summary::before { content: '▸ '; color: var(--text-3); }
.hint-details[open] > summary::before { content: '▾ '; }
.hint-details[open] > summary { margin-bottom: var(--s2); }
.hint-details p { margin: var(--s1) 0; line-height: 1.7; }

/* 行内「?」小按钮：展开该行说明 */
.hint-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: var(--s1);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-3);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}
.hint-more:hover { border-color: var(--brand-300); color: var(--brand-600); }
.error { color: var(--danger); font-size: var(--f-small); min-height: 16px; margin: var(--s2) 0; }

/* ---------- 拖拽上传区 ---------- */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: var(--s2);
  transition: border-color .15s, background .15s;
  position: relative;
}
.dropzone.dragging { border-color: var(--brand-500); background: var(--brand-50); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(134px, 1fr));
  gap: var(--s2);
}

.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.card:hover { border-color: var(--border-strong); }
.card.selected { border-color: var(--brand-600); box-shadow: 0 0 0 2px rgba(21, 95, 135, .18); }

.thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #EEF1F6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-missing { color: var(--text-3); font-size: var(--f-caption); }

.thumb-zoom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: var(--s1) var(--s2);
  font-size: var(--f-caption);
  line-height: 1.2;
  text-align: center;
  color: #fff;
  background: linear-gradient(to top, rgba(12, 16, 24, .78), rgba(12, 16, 24, 0));
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
}
.thumb:hover .thumb-zoom { opacity: 1; }
@media (hover: none) { .thumb-zoom { opacity: 1; } }

/* 定位偏移例外：勾选框贴左上角 6px，不受 4 的倍数约束（旋钮③ 明示豁免项）。 */
.card-check { position: absolute; top: 6px; left: 6px; width: 18px; height: 18px; cursor: pointer; margin: 0; }

/* ---------- 角标（四态互斥，本轮表达核心） ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  /* 唯一例外：胶囊角标。此处刻意脱 token 保留 11px —— 四态角标要贴在缩略图右上角，
     放大到 12px 后会挤压缩略图、并让卡片顶部信息过载。除此之外全站字号一律引用 token。 */
  font-size: 11px;
  line-height: 1;
  padding: var(--s1) var(--s2);
  border-radius: var(--r-pill);
  font-weight: 600;
  white-space: nowrap;
}
/* 图库卡片上的角标贴在右上角（仅卡片上下文绝对定位，其它场景内联）。
   top / right 的 6px 属「定位偏移」例外，不受 4 的倍数约束。 */
.card > .badge { position: absolute; top: 6px; right: 6px; z-index: 2; }

/* 四态角标语义**平级**，不得给其中一两态分主次（红线②）。
   做法：统一 1px 描边几何（实心件也补 1px 同色描边，四者外框尺寸一致），
   只保留「实心 vs 描边」的填充之别，同色相、同字重 600 —— 把强度差收小。 */
.badge-cloud-live { background: var(--brand-600); color: #fff; border: 1px solid var(--brand-600); }
.badge-pending-out { background: var(--warn); color: #fff; border: 1px solid var(--warn); }
.badge-pending-in { background: var(--warn-soft); color: var(--warn-strong); border: 1px solid var(--warn); }
.badge-none { background: var(--surface); color: var(--text-3); border: 1px solid var(--neutral-border); }
.badge-ok { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-border); }
.badge-danger { background: var(--danger); color: #fff; border: 1px solid var(--danger); }

.card-body { padding: var(--s1) var(--s2) var(--s2); }
.card-name {
  font-size: var(--f-small);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-meta { font-size: var(--f-caption); color: var(--text-3); margin-top: var(--s1); }
.card-actions { margin-top: var(--s2); display: flex; gap: var(--s1); }
.card-actions .btn-rename { padding: var(--s1) var(--s2); font-size: var(--f-caption); }

/* 图库角标图例 */
.legend-hint { margin-top: var(--s2); }
.legend-cloud { color: var(--brand-700); font-weight: 600; }
.legend-warn { color: var(--warn-strong); font-weight: 600; }
.legend-none { color: var(--text-3); }

/* ---------- 上传状态 ---------- */
.upload-list { margin-top: var(--s2); display: flex; flex-direction: column; gap: var(--s1); }
.upload-item {
  font-size: var(--f-caption);
  padding: var(--s1) var(--s2);
  border-radius: var(--r-sm);
  background: var(--neutral-soft);
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-item.status-ok { background: var(--ok-soft); color: var(--ok); }
.upload-item.status-error { background: var(--danger-soft); color: var(--danger); }
.upload-item.status-uploading,
.upload-item.status-compressing { background: var(--brand-50); color: var(--brand-700); }

/* ---------- 分区容器（云端只读 / 本次编辑） ---------- */
.zone {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-1);
  background: var(--surface);
}
.zone-head { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); flex-wrap: wrap; }
.zone-head .t { font-size: var(--f-small); font-weight: 700; }
.zone-head .sub { font-size: var(--f-caption); color: var(--text-3); }
.zone-head .zone-ico { font-size: var(--f-small); }
.zone-count { margin-left: auto; }
.zone-cloud .zone-head { background: var(--brand-50); border-bottom: 1px solid var(--brand-100); }
.zone-edit .zone-head { background: var(--warn-soft); border-bottom: 1px solid var(--warn-border); }
.zone-body { padding: var(--s3); background: var(--surface); }

.lock {
  font-size: var(--f-caption);
  color: var(--brand-700);
  background: var(--surface);
  border: 1px solid var(--brand-200);
  border-radius: var(--r-pill);
  padding: var(--s1) var(--s2);
}

/* 云端区摘要行（手机端默认折叠为这一行，点击展开） */
.summary-line {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--f-caption);
  color: var(--text-2);
  background: var(--brand-50);
  border-top: 1px solid var(--brand-100);
  padding: var(--s2) var(--s3);
}
.cloud-caret { color: var(--brand-500); font-weight: 700; }

/* ---------- 只读条目（云端投放中区） ---------- */
.item {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  flex-wrap: wrap;
  margin-bottom: var(--s2);
}
.item.readonly { background: var(--surface-2); }
.item .ord {
  width: 20px; height: 20px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-100); color: var(--brand-700);
  border-radius: 50%; font-size: var(--f-caption); font-weight: 700;
}
.item .th { width: 42px; height: 32px; flex: none; border-radius: var(--r-sm); overflow: hidden; background: #EEF1F6; }
.item .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item .nm {
  flex: 1 1 80px; min-width: 56px;
  font-size: var(--f-small);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.readonly-mark { font-size: var(--f-caption); color: var(--text-3); }

/* ---------- 状态条（与云端一致 / 有改动待发布） ---------- */
.status-bar {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--f-small);
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm);
  margin-bottom: var(--s2);
}
.status-bar.is-diff { background: var(--warn-soft); border: 1px solid var(--warn-border); color: var(--warn-strong); }
.status-bar.is-sync { background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--brand-700); }

/* ---------- 投放条目（本次编辑区） ---------- */
.playlist { display: flex; flex-direction: column; gap: var(--s2); }

.play-item {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  flex-wrap: wrap;
}
.play-item.dragging { opacity: .5; }
.play-item.drop-target { border-color: var(--brand-600); box-shadow: 0 0 0 2px rgba(21, 95, 135, .18); }

.play-item.is-missing { border-color: var(--danger-border); background: var(--danger-soft); }
.tag-missing {
  display: inline-block;
  margin-left: var(--s2);
  flex: none;
  font-size: var(--f-caption);
  line-height: 1;
  padding: var(--s1) var(--s2);
  border-radius: var(--r-pill);
  color: #fff;
  background: var(--danger);
}

.drag-handle { cursor: grab; color: var(--text-3); user-select: none; font-size: var(--f-h3); }
.play-order {
  width: 20px; height: 20px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-100); color: var(--brand-700);
  border-radius: 50%; font-size: var(--f-caption); font-weight: 700;
}
.play-thumb { width: 42px; height: 32px; flex: none; border-radius: var(--r-sm); overflow: hidden; background: #EEF1F6; }
.play-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play-name {
  flex: 1 1 90px;
  min-width: 70px;
  font-size: var(--f-small);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sec-field, .enable-field { display: inline-flex; align-items: center; gap: var(--s1); font-size: var(--f-caption); color: var(--text-2); }
.sec-field .sec-input {
  width: 58px; padding: var(--s1); font-size: var(--f-caption);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm); text-align: center;
}
.play-actions { display: inline-flex; gap: var(--s1); margin-left: auto; }

/* ---------- 空态 / 加载态 ---------- */
.empty {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: var(--s5) var(--s4);
  text-align: center;
  color: var(--text-3);
  font-size: var(--f-small);
  background: var(--surface-2);
}
/* 图库空态嵌在已是虚线的拖拽区里：去掉重复描边，避免"框中框" */
.dropzone .empty { border: none; background: transparent; }

/* ---------- 空状态引导卡（改造 2026-10-20）----------
 * 把"看图库为空"升级为"告诉你下一步做什么"。
 * 空状态是首页高频形态，必须能引导，而不只是陈述。 */
.empty-guide {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
  padding: var(--s6) var(--s4);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.empty-guide .eg-title {
  margin: 0;
  font-size: var(--f-h3);
  font-weight: 700;
  color: var(--text);
}
.empty-guide .eg-desc {
  margin: 0;
  font-size: var(--f-small);
  color: var(--text-2);
}
.empty-guide .btn { margin-top: var(--s2); }
.panel .empty, .zone .empty { margin-top: var(--s2); }

/* ---------- 表单 ---------- */
.field { margin-bottom: var(--s3); }
.field-label { display: block; font-size: var(--f-small); font-weight: 600; margin-bottom: var(--s1); }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }

input[type="text"], input[type="password"], input[type="number"], input[type="time"], select {
  width: 100%;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: var(--f-small);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}
input:focus, select:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(31, 118, 165, .15); }

.radio-row { display: flex; gap: var(--s4); flex-wrap: wrap; }
.radio { display: inline-flex; align-items: center; gap: var(--s1); font-size: var(--f-small); cursor: pointer; }

.field.disabled { opacity: .55; }
.tip-warn {
  color: var(--warn-strong);
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
  border-radius: var(--r-sm);
  padding: var(--s2);
  margin: var(--s1) 0 var(--s2);
}

.schedule-list { display: flex; flex-direction: column; gap: var(--s2); }
.schedule-rule {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--s2);
  background: var(--surface-2);
}
.rule-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s2); }
.rule-title { font-size: var(--f-small); font-weight: 700; }
.rule-row { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s2); }
.time-field { flex: 1 1 120px; display: block; font-size: var(--f-caption); color: var(--text-2); }
.time-field input { margin-top: var(--s1); }
.rule-label { font-size: var(--f-caption); color: var(--text-2); margin: var(--s1) 0 var(--s1); }
.weekdays { display: flex; flex-wrap: wrap; gap: var(--s2); }
.wd { display: inline-flex; align-items: center; gap: var(--s1); font-size: var(--f-small); cursor: pointer; }
.rule-files { width: 100%; }

/* ---------- 发布区 ---------- */
.publish-box { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--border); }
.tech-line { margin-top: var(--s2); text-align: center; font-size: var(--f-caption); color: var(--text-3); }
.tech-note { text-align: center; margin: var(--s1) 0 0; }

/* 持久发布成功确认卡（需求 1 / P0-3） */
.publish-success {
  margin-top: var(--s2);
  border: 1px solid var(--ok-border);
  background: var(--ok-soft);
  border-radius: var(--r-lg);
  padding: var(--s4);
  box-shadow: var(--sh-1);
}
.publish-success .head { display: flex; align-items: center; gap: var(--s2); font-size: var(--f-h3); font-weight: 700; color: var(--ok); }
.publish-success .tick {
  display: inline-flex; width: 24px; height: 24px; border-radius: 50%;
  background: var(--ok); color: #fff; align-items: center; justify-content: center; font-size: var(--f-body);
}
.publish-success .kv { margin-top: var(--s2); display: grid; grid-template-columns: auto 1fr; gap: var(--s1) var(--s3); font-size: var(--f-small); }
.publish-success .kv dt { color: var(--text-2); }
.publish-success .kv dd { font-weight: 600; }
.publish-success .foot { margin-top: var(--s2); display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; font-size: var(--f-caption); color: var(--text-2); }

/* ---------- 弹窗 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 25, 38, .45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--s4);
  z-index: 50;
}
.overlay.open { display: flex; }

.modal {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  padding: var(--s4);
  max-height: 92vh;
  overflow: auto;
}
.modal h2 { font-size: var(--f-h2); margin-bottom: var(--s2); }
.modal-wide { max-width: 620px; }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s2); }
.modal-actions.modal-actions-split { align-items: center; flex-wrap: wrap; }
.modal-actions-split .spacer { flex: 1 1 auto; }

/* ---------- 关于 / 更新日志 ---------- */
.about-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s2); }
.about-head h2 { margin-bottom: 0; }
.cl-ver { background: var(--neutral-soft); color: var(--text-2); border: 1px solid var(--neutral-border); }
.changelog-list { display: flex; flex-direction: column; gap: var(--s3); margin-top: var(--s2); }
.cl-entry { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s3); background: var(--surface-2); }
.cl-head { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.cl-title { font-size: var(--f-small); font-weight: 700; }
.cl-date { font-size: var(--f-caption); color: var(--text-3); margin-left: auto; }
.cl-items { margin-top: var(--s2); display: flex; flex-direction: column; gap: var(--s2); }
.cl-items li {
  font-size: var(--f-caption);
  color: var(--text-2);
  padding-left: var(--s4);
  position: relative;
}
.cl-items li::before { content: '·'; position: absolute; left: 4px; color: var(--brand-500); font-weight: 700; }

/* 「屏端 APP」分区标题：eyebrow 降级分组（小字 + 次信息色 + 字重 600 + 上下留白）。
   一律引用既有 token（字号/间距/文字色），零写死色值或字号；不使用主色、不加底色、不放大。 */
.about-eyebrow {
  font-size: var(--f-caption);
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: .08em;
  margin: var(--s4) 0 var(--s2);
}

/* ---------- 上传前命名面板 ---------- */
.naming-list {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  max-height: 52vh;
  overflow: auto;
  margin: var(--s2) 0 var(--s1);
}
.naming-row {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.naming-thumb {
  width: 64px; height: 48px; flex: none;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: #EEF1F6;
  display: flex; align-items: center; justify-content: center;
}
.naming-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.naming-meta { flex: 1 1 auto; min-width: 0; }
.naming-file {
  font-size: var(--f-caption);
  color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: var(--s1);
}
.naming-input { width: 100%; }

/* ==========================================================================
   图片全屏预览（灯箱）：点击缩略图看大图
   ========================================================================== */
.preview-overlay {
  background: rgba(12, 16, 24, .9);
  padding: 0;
  align-items: stretch;
  justify-content: center;
}
.preview-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: min(1180px, 100%);
  min-height: 0;
  padding: var(--s2) var(--s3) var(--s3);
  gap: var(--s2);
}
.preview-stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.preview-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--r-sm);
  background: #0D121B;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5); /* 灯箱内元素：全屏遮罩语境，保持不动 */
}
.preview-img.is-placeholder { filter: blur(6px); }
.preview-img.is-actual { max-width: none; max-height: none; }
.preview-message {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 82%;
  padding: var(--s2) var(--s4);
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .58);
  color: #fff;
  font-size: var(--f-small);
  text-align: center;
  word-break: break-word;
}
.preview-bar {
  flex: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s2);
  flex-wrap: wrap;
}
.preview-info { min-width: 0; }
.preview-title {
  color: #fff;
  font-size: var(--f-h3);
  font-weight: 700;
  max-width: 62vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.preview-meta { color: rgba(255, 255, 255, .76); font-size: var(--f-caption); margin-top: var(--s1); word-break: break-all; }
.preview-tools { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.preview-counter { color: rgba(255, 255, 255, .88); font-size: var(--f-small); }
.preview-tools .btn {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .3);
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.preview-tools .btn:hover { background: rgba(255, 255, 255, .26); }
.preview-tools .btn:disabled { opacity: .45; }

.preview-btn {
  position: absolute;
  z-index: 2;
  appearance: none;
  border: none;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.preview-btn:hover { background: rgba(255, 255, 255, .3); }
.preview-btn:disabled { opacity: .35; cursor: not-allowed; }
/* 定位偏移例外：灯箱控件 top/left/right 的 10px / 12px 不受 4 的倍数约束。 */
.preview-close { top: 10px; right: 12px; width: 40px; height: 40px; font-size: var(--f-h2); }
.preview-nav { top: 50%; transform: translateY(-50%); width: 44px; height: 44px; font-size: var(--f-h1); line-height: 1; }
.preview-prev { left: 10px; }
.preview-next { right: 10px; }

/* ---------- Toast ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  z-index: 80;
  width: min(92vw, 460px);
  pointer-events: none;
}
.toast {
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  font-size: var(--f-small);
  color: #fff;
  background: #333C4D;
  box-shadow: var(--sh-2);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  word-break: break-word;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-ok { background: var(--ok); }
.toast-error { background: var(--danger); }
.toast-warn { background: var(--warn); }
.toast-info { background: #2A3546; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1120px) {
  .layout { grid-template-columns: 1fr; }
  /* 手机端：云端投放中默认折叠为一行摘要，点击摘要展开缩略图列表 */
  .zone-cloud .zone-body { display: none; }
  .zone-cloud.expanded .zone-body { display: block; }
  .summary-line { cursor: pointer; }
}

@media (min-width: 1121px) {
  .cloud-caret { display: none; }
}

@media (max-width: 640px) {
  /* [改造 2026-10-20] 手机端防横向溢出：
   * 130px 下限 + 2 列可保证 360~430px 宽度下卡片完整、不被切边；
   * 原先 118px 在 430px 屏上会挤出第 3 列的一角。 */
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .layout { padding: var(--s2); }
  /* 手机端面板内边距收紧，把宽度让给内容 */
  .panel-head, .zone-head { padding: var(--s2); }
  .layout { padding: var(--s2); }
  .preview-wrap { padding: var(--s2) var(--s2) var(--s3); }
  .preview-close { top: 8px; right: 8px; width: 44px; height: 44px; font-size: var(--f-h2); }
  .preview-nav { width: 48px; height: 48px; font-size: var(--f-h1); }
  .preview-prev { left: 2px; }
  .preview-next { right: 2px; }
  .preview-bar { flex-direction: column; align-items: stretch; gap: var(--s2); }
  .preview-title { max-width: 100%; font-size: var(--f-body); white-space: normal; }
  .preview-tools { justify-content: space-between; }
  .preview-tools .btn { padding: var(--s2) var(--s3); font-size: var(--f-small); }
  .naming-row { align-items: flex-start; }
  .naming-thumb { width: 52px; height: 40px; }
}
