/*
  华厦内容工作台 · 视觉系统（2026-11-07）
  方向：安静的纸感编辑工具。暖白纸面 + 华厦商标橄榄墨色，单一主操作色，
  状态色只用于草稿/快照/警告；信息靠排版层级而非堆叠卡片区分。
  明暗主题共用同一组语义变量；动效只用 opacity/transform，并尊重减少动态效果。
*/

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #f4f3ee;
  --bg-sidebar: #faf9f5;
  --surface: #ffffff;
  --surface-2: #f9f8f4;
  --sunken: #eeece5;
  --hover: #f1f0ea;
  --pressed: #e8e6de;
  --line: #e4e1d8;
  --line-soft: #eeece6;
  --line-strong: #d3cfc3;

  --ink: #1c201b;
  --ink-2: #454b43;
  --ink-3: #646a61;
  --ink-4: #8d9288;

  --brand: #38432a;
  --brand-hover: #2a3320;
  --brand-ink: #3d4a27;
  --brand-tint: #e9eddd;
  --brand-tint-2: #dfe5cd;
  --on-brand: #fbfaf4;

  --success: #2e6a43;
  --success-tint: #e5f0e7;
  --success-dot: #3f8f5a;
  --warning: #84560a;
  --warning-tint: #faf0da;
  --warning-line: #ecd6a2;
  --warning-dot: #c58a17;
  --danger: #a63a2e;
  --danger-tint: #fbebe8;
  --danger-line: #efc5be;
  --neutral-dot: #a3a79c;

  --focus: #4f6d1f;
  --focus-ring: 0 0 0 3px rgba(79, 109, 31, .22);
  --toast-bg: #21251e;
  --toast-ink: #f6f5ef;
  --backdrop: rgba(22, 25, 20, .44);
  --bg-glass: rgba(244, 243, 238, .88);
  --checker: #e7e5dd;

  --shadow-sm: 0 1px 2px rgba(28, 32, 27, .05);
  --shadow-md: 0 6px 20px rgba(28, 32, 27, .08), 0 1px 3px rgba(28, 32, 27, .05);
  --shadow-lg: 0 24px 64px rgba(20, 24, 18, .22), 0 2px 8px rgba(20, 24, 18, .08);
  --shadow-dock: 0 -8px 18px -12px rgba(20, 24, 18, .2);

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --sidebar-w: 236px;
  --topbar-h: 52px;
  --page-x: 32px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121411;
    --bg-sidebar: #161814;
    --surface: #1b1e19;
    --surface-2: #20231e;
    --sunken: #0e100d;
    --hover: #252922;
    --pressed: #2d3129;
    --line: #2d3129;
    --line-soft: #252822;
    --line-strong: #3c4137;

    --ink: #ecebe3;
    --ink-2: #c6c8bd;
    --ink-3: #9ea297;
    --ink-4: #73776c;

    --brand: #c4cea0;
    --brand-hover: #d3dcb2;
    --brand-ink: #cbd5a8;
    --brand-tint: #283020;
    --brand-tint-2: #323b27;
    --on-brand: #171a12;

    --success: #8fcc9f;
    --success-tint: #1a2a1f;
    --success-dot: #62b07b;
    --warning: #e6b862;
    --warning-tint: #2c2414;
    --warning-line: #4a3c1d;
    --warning-dot: #d39b2c;
    --danger: #f08c7e;
    --danger-tint: #321d1a;
    --danger-line: #5a2d27;
    --neutral-dot: #6f7368;

    --focus: #b9d17f;
    --focus-ring: 0 0 0 3px rgba(185, 209, 127, .26);
    --toast-bg: #ebe9e0;
    --toast-ink: #1a1d17;
    --backdrop: rgba(0, 0, 0, .6);
    --bg-glass: rgba(18, 20, 17, .86);
    --checker: #262922;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .3);
    --shadow-dock: 0 -8px 18px -12px rgba(0, 0, 0, .6);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; margin: 0; text-align: inherit; -webkit-tap-highlight-color: transparent; }
tr[data-action], summary, label { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
::selection { background: var(--brand-tint-2); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
.divider { height: 1px; background: var(--line-soft); margin: 18px 0; }
.recycle-copy { margin: 0; font-size: 13px; line-height: 1.65; color: var(--ink-3); }
p.recycle-copy { margin: 10px 0 0; }

/* ---------- App shell ---------- */
.shell { position: relative; display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 40;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  padding: 16px 12px 14px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 8px 16px; }
.brand-logo { display: block; width: 36px; height: 36px; object-fit: contain; flex: none; border-radius: 9px; }
.brand-name { min-width: 0; line-height: 1.25; }
.brand-name strong { display: block; font-size: 14px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; color: var(--ink); }
.brand-name span { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; }
.nav-scroll { position: relative; display: flex; flex-direction: column; min-height: 0; }
.nav-label { margin: 14px 0 6px; padding: 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--ink-3); }
.nav { display: grid; gap: 2px; }
.nav button {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 36px; padding: 0 10px;
  border-radius: var(--radius);
  color: var(--ink-2); font-size: 14px; text-align: left;
  transition: background-color .15s, color .15s;
}
.nav button .icon { width: 18px; height: 18px; color: var(--ink-3); transition: color .15s; }
.nav button:hover { background: var(--hover); color: var(--ink); }
.nav button:hover .icon { color: var(--ink-2); }
.nav button.active { background: var(--brand-tint); color: var(--brand-ink); font-weight: 600; }
.nav button.active .icon { color: var(--brand-ink); }
.nav button:focus-visible { outline-offset: -2px; }
.nav-count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: 999px; background: var(--sunken); color: var(--ink-2);
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.sidebar-bottom {
  position: relative;
  margin-top: auto; padding: 12px 10px 0 26px;
  border-top: 1px solid var(--line);
  font-size: 12px; line-height: 1.6; color: var(--ink-3);
}
.sidebar-bottom .demo-dot { position: absolute; left: 11px; top: 19px; }
.demo-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success-dot); }

.workspace { margin-left: var(--sidebar-w); width: calc(100% - var(--sidebar-w)); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--page-x);
  background: var(--bg-glass);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.crumb > span { overflow: hidden; text-overflow: ellipsis; }
.crumb b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.crumb-sep { color: var(--ink-4); }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 220px; font-size: 13px; color: var(--ink-2); }
.user-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand-ink);
  font-size: 12px; font-weight: 650; text-transform: uppercase;
}
.mode-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--warning-tint); color: var(--warning); font-size: 12.5px; font-weight: 500; }

.main { width: 100%; max-width: 1360px; margin: 0 auto; padding: 28px var(--page-x) 64px; }
.main.is-editor { max-width: none; padding-top: 0; padding-bottom: 24px; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px 24px; margin-bottom: 20px; }
.page-title { min-width: 0; }
.page-head h1 { margin: 0; font-size: 24px; line-height: 1.3; font-weight: 650; letter-spacing: -.01em; color: var(--ink); }
.page-head p { margin: 6px 0 0; max-width: 68ch; font-size: 14px; line-height: 1.6; color: var(--ink-3); }
.head-actions, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.eyebrow { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.page-note { margin: 0 0 12px; font-size: 13px; line-height: 1.65; color: var(--ink-3); overflow-wrap: anywhere; }
.main > p:not([class]) { margin: 0 0 12px; font-size: 13px; line-height: 1.65; color: var(--ink-3); overflow-wrap: anywhere; }
.main > .hint-box, .main > p.hint-box { margin: 0 0 16px; }
.main > .tabs { margin-bottom: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font-size: 13.5px; font-weight: 500; line-height: 1; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
  -webkit-user-select: none; user-select: none;
}
.btn .icon { width: 16px; height: 16px; }
.btn:hover:not(:disabled) { background: var(--hover); }
.btn:active:not(:disabled) { background: var(--pressed); transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.primary:active:not(:disabled) { background: var(--brand-hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover:not(:disabled) { background: var(--danger-tint); border-color: var(--danger-line); }
.btn.text { border-color: transparent; background: transparent; box-shadow: none; color: var(--ink-2); }
.btn.text:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.btn.small { height: 30px; padding: 0 10px; border-radius: 7px; font-size: 13px; }
.btn.icon-only { width: 36px; padding: 0; }
.btn:disabled { opacity: .45; box-shadow: none; }
.inline-link {
  display: inline; padding: 2px 0; border-radius: 4px;
  color: var(--brand-ink); font-size: 13px; font-weight: 500;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px;
  transition: text-decoration-color .15s;
}
.inline-link:hover:not(:disabled) { text-decoration-color: currentColor; }
.inline-link:disabled { color: var(--ink-4); }
.back {
  flex: none; width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink-2);
  transition: background-color .15s, color .15s;
}
.back:hover { background: var(--hover); color: var(--ink); }
.back .icon { width: 16px; height: 16px; }

/* ---------- Form controls ---------- */
.field { display: block; margin: 0 0 14px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field input, .field textarea, .field select, .control,
.source-filter select, .board-card select, .surface-top label > select {
  width: 100%; min-height: 36px; padding: 7px 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font-size: 14px; line-height: 1.45;
  transition: border-color .15s, box-shadow .15s;
}
.field input:hover, .field textarea:hover, .field select:hover, .control:hover { border-color: var(--ink-4); }
.field input:focus, .field textarea:focus, .field select:focus, .control:focus,
.source-filter select:focus, .board-card select:focus, .surface-top label > select:focus {
  outline: none; border-color: var(--focus); box-shadow: var(--focus-ring);
}
/* Keyboard focus (every focused text field) also draws the 2px focus line other controls use. A 1px
   offset keeps it inside the 3px band the soft ring already took, so nothing new is clipped. */
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible, .control:focus-visible,
.source-filter select:focus-visible, .board-card select:focus-visible, .surface-top label > select:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 1px;
}
.field input[readonly], .control[readonly] { background: var(--sunken); color: var(--ink-2); border-color: var(--line); }
.field input[readonly]:hover { border-color: var(--line); }
.field textarea { min-height: 88px; resize: vertical; }
.field select { padding-right: 6px; }
::placeholder { color: var(--ink-4); opacity: 1; }
.field small { display: block; margin-top: 6px; font-size: 12.5px; line-height: 1.55; color: var(--ink-3); overflow-wrap: anywhere; }
.checkline { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); cursor: pointer; }
.checkline input, input[type="checkbox"] { width: 16px; height: 16px; flex: none; margin: 2px 0 0; accent-color: var(--brand); cursor: pointer; }

/* ---------- Surfaces ---------- */
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.surface + .surface { margin-top: 16px; }
.surface-top {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px;
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
}
.surface-top h2, .surface-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.surface-note { font-size: 12.5px; color: var(--ink-3); }
.surface-top label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.surface-top label > select { width: auto; min-height: 32px; padding: 4px 8px; font-size: 13px; }
.surface > .under-note { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line-soft); }
.surface > .page-note, .surface > p:not([class]) { margin: 0; padding: 10px 16px; font-size: 13px; color: var(--ink-2); }
.surface > h2:not([class]) { margin: 0; padding: 14px 16px 6px; font-size: 15px; font-weight: 600; }
.side-section { padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
.side-section:last-child { border-bottom: 0; }
.side-title, .side-section > h2 { margin: 0 0 12px; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.side-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.side-heading .side-title { margin: 0; }
.side-meta { font-size: 12px; color: var(--ink-3); }
.side-section > p:not([class]) { margin: 0 0 10px; font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }
/* Collapsed maintenance surfaces (e.g. 发布记录 · 官网撤下与维护核对) stay quiet until opened. */
details.surface > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 46px; padding: 10px 16px; list-style: none; cursor: pointer;
  font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--ink-2);
  transition: background-color .15s, color .15s;
}
details.surface > summary::-webkit-details-marker { display: none; }
details.surface > summary::after {
  content: ""; width: 8px; height: 8px; flex: none; margin-right: 4px;
  border-right: 1.75px solid var(--ink-3); border-bottom: 1.75px solid var(--ink-3);
  transform: translateY(-2px) rotate(45deg); transition: transform .2s var(--ease-out);
}
details.surface[open] > summary { border-bottom: 1px solid var(--line-soft); color: var(--ink); }
details.surface[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
details.surface > summary:hover { background: var(--hover); color: var(--ink); }
details.surface > summary:focus-visible { outline-offset: -2px; }

/* ---------- Filters (segmented) ---------- */
.tabs, .language-toggle {
  display: inline-flex; align-items: center; gap: 2px; max-width: 100%;
  padding: 3px; border-radius: 9px; background: var(--sunken);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar, .language-toggle::-webkit-scrollbar { display: none; }
.tab, .language-toggle button {
  position: relative; flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 12px; border-radius: 7px;
  color: var(--ink-3); font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.tab:hover, .language-toggle button:hover { color: var(--ink); }
.tab.active, .language-toggle button.active {
  background: var(--surface); color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--line);
}
.tab:focus-visible, .language-toggle button:focus-visible { outline-offset: -2px; }
.dirty-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--warning-dot); }

.search-wrap {
  display: flex; align-items: center; gap: 8px;
  height: 34px; min-width: 240px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink-3);
  transition: border-color .15s, box-shadow .15s;
}
/* Its only control is a text field, which always shows keyboard focus: the box draws the same 2px line. */
.search-wrap:focus-within { border-color: var(--focus); box-shadow: var(--focus-ring); outline: 2px solid var(--focus); outline-offset: 1px; }
.search-wrap .icon { width: 16px; height: 16px; }
.search-wrap input { -webkit-appearance: none; appearance: none; width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search-wrap input::-webkit-search-cancel-button { cursor: pointer; }
.source-filter { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.source-filter select { width: auto; max-width: 200px; min-height: 32px; padding: 4px 8px; font-size: 13px; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; }
.table { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0; text-align: left; font-variant-numeric: tabular-nums; }
.table th {
  padding: 9px 16px; white-space: nowrap;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  font-size: 12.5px; font-weight: 500; color: var(--ink-3);
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; line-height: 1.5; color: var(--ink-2); vertical-align: middle; overflow-wrap: break-word; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-action] { cursor: pointer; transition: background-color .12s; }
.table tbody tr[data-action]:hover { background: var(--hover); }
.table tbody tr[data-action]:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; background: var(--brand-tint); }
.table tbody tr[data-action]:focus-visible > td:first-child { box-shadow: inset 3px 0 0 var(--focus); }
.table .check-cell { width: 52px; }
.article-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.article-art { width: 40px; height: 40px; flex: none; border-radius: var(--radius); object-fit: cover; background: var(--sunken); border: 1px solid var(--line-soft); }
.thumb-tile {
  width: 40px; height: 40px; flex: none; border-radius: var(--radius);
  display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand-ink);
}
.thumb-tile.muted { background: var(--sunken); color: var(--ink-4); }
.thumb-tile .icon { width: 18px; height: 18px; }
.article-title { font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.article-sub { margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); overflow-wrap: anywhere; }
.row-arrow { width: 44px; text-align: right; color: var(--ink-4); }
.row-arrow .icon { width: 16px; height: 16px; vertical-align: middle; }
.table-footer {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px;
  padding: 10px 16px; border-top: 1px solid var(--line-soft); background: var(--surface-2);
  font-size: 12.5px; color: var(--ink-3);
}
.table-footer > span:last-child { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Status & chips ---------- */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px 0 8px; border-radius: 999px;
  background: var(--warning-tint); color: var(--warning);
  font-size: 12.5px; font-weight: 500; line-height: 1; white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }
.status.published, .status.valid { background: var(--success-tint); color: var(--success); }
.status.invalid, .status.neutral { background: var(--sunken); color: var(--ink-3); }
.status.danger { background: var(--danger-tint); color: var(--danger); }
.label-pill {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px;
  background: var(--success-tint); color: var(--success);
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.label-pill.warn { background: var(--warning-tint); color: var(--warning); }
.label-pill.muted { background: var(--sunken); color: var(--ink-3); }
.languages { display: flex; gap: 4px; }
.language-chip {
  display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--brand-tint); color: var(--brand-ink);
  font-size: 12px; font-weight: 600;
}
.language-chip.empty { background: transparent; border: 1px dashed var(--line-strong); color: var(--ink-4); font-weight: 500; }
.source-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--brand-tint); color: var(--brand-ink); font-size: 12.5px; font-weight: 500; overflow-wrap: anywhere; }

/* ---------- Summary, notes, empty & loading ---------- */
.summary { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 20px; margin: 0 0 14px; font-size: 13px; color: var(--ink-3); }
.summary strong { margin-right: 4px; font-size: 16px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.summary-divider { width: 1px; height: 14px; background: var(--line-strong); }
.under-note { display: flex; align-items: flex-start; gap: 8px; margin: 14px 2px 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-3); overflow-wrap: anywhere; }
.under-note .icon { width: 15px; height: 15px; margin-top: 2px; color: var(--ink-4); }
.empty-state {
  margin: 0; padding: 80px 24px 44px; text-align: center;
  font-size: 13.5px; line-height: 1.7; color: var(--ink-3);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d9288' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 13.5 6.5 5h11l2.5 8.5V19H4z'/%3E%3Cpath d='M4 13.5h4.5l1 2h5l1-2H20'/%3E%3C/svg%3E") no-repeat center 34px / 32px 32px;
}
.empty-state::first-line { font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.hint-box {
  padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: var(--surface-2); color: var(--ink-2);
  font-size: 13px; line-height: 1.65; overflow-wrap: anywhere;
}
.hint-box.warning { background: var(--warning-tint); border-color: var(--warning-line); color: var(--warning); }
.hint-box.error { background: var(--danger-tint); border-color: var(--danger-line); color: var(--danger); }
.hint-box strong { color: inherit; }
.hint-box + .hint-box, .hint-box + .field, .hint-box + .candidate, .hint-box + .live-actions, .hint-box + .product-group,
.candidate + .hint-box, .detail-grid + .hint-box { margin-top: 12px; }

/*
  Submission status (live.js submissionNotice). Markup order is fixed by JS:
  p 目标说明 → p 阶段/失败原因 → p 批次 → 刷新按钮 / 打开预览链接.
  Only typography and placement change here; every word comes from the real DOM.
*/
.hint-box[data-submission-status] {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 16px;
  padding: 9px 10px 9px 14px;
}
.hint-box[data-submission-status] > p { grid-column: 1; margin: 0; min-width: 0; }
.hint-box[data-submission-status] > p:first-child { font-size: 12.5px; line-height: 1.6; color: var(--ink-3); }
.hint-box[data-submission-status] > p + p { margin-top: 2px; font-size: 13.5px; font-weight: 600; line-height: 1.55; color: var(--ink); }
.hint-box[data-submission-status] > p + p + p { margin-top: 1px; font-size: 12.5px; font-weight: 400; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hint-box.warning[data-submission-status] > p { color: inherit; }
.hint-box[data-submission-status] > :is(.btn, a) { grid-column: 2; grid-row: 1 / span 3; align-self: center; justify-self: end; }
.hint-box[data-submission-status] > :is(.btn, a) ~ :is(.btn, a) { grid-row: auto; margin-top: 6px; }
.hint-box[data-submission-status] > a {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px 0 12px;
  border: 1px solid var(--line-strong); border-radius: 7px;
  background: var(--surface); color: var(--brand-ink); box-shadow: var(--shadow-sm);
  font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
/* Decorative "opens in a new tab" arrow; no text is generated. */
.hint-box[data-submission-status] > a::after {
  content: ""; width: 14px; height: 14px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
}
.hint-box[data-submission-status] > a:hover { background: var(--hover); border-color: var(--ink-4); }
.hint-box[data-submission-status] > a:active { background: var(--pressed); }
.main > .hint-box[data-submission-status] { margin: 0 0 12px; }

.loading-line, .login-card.is-loading { display: flex; align-items: center; gap: 10px; }
.loading-line::before, .login-card.is-loading::before {
  content: ""; width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 2px solid var(--line-strong); border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}

/* ---------- Editor ---------- */
.editor-head {
  position: sticky; top: var(--topbar-h); z-index: 25;
  flex-wrap: nowrap; align-items: center;
  height: 60px; margin: 0 calc(-1 * var(--page-x)) 12px; padding: 0 var(--page-x);
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.editor-title { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.editor-title > div { min-width: 0; }
.editor-head h1 { font-size: 17px; line-height: 1.35; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor-head p { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.editor-head p > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.editor-head .status { height: 20px; font-size: 12px; }
.meta-sep { color: var(--ink-4); }
.editor-head .head-actions { flex: none; flex-wrap: nowrap; }

.editor-layout {
  --sticky-top: calc(var(--topbar-h) + 72px);
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start;
}
.editor-main {
  position: sticky; top: var(--sticky-top);
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
  height: calc(100vh - var(--sticky-top) - 16px);
  height: calc(100dvh - var(--sticky-top) - 16px);
  min-height: 520px;
}
.editor-canvas { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.editor-toolbar { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 8px 10px 8px 8px; border-bottom: 1px solid var(--line-soft); }
.preview-hint { flex: 1 1 220px; min-width: 0; margin: 0; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-hint b { color: var(--ink-2); font-weight: 600; }
.toolbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.save-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.save-state::before { content: ""; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--neutral-dot); }
.save-state[data-state="dirty"] { color: var(--warning); font-weight: 500; }
.save-state[data-state="dirty"]::before { background: var(--warning-dot); }
.save-state[data-state="saved"]::before { background: var(--success-dot); }
.save-state[data-state="snapshot"]::before { background: var(--brand); }
.preview-outer { position: relative; flex: 1 1 auto; min-height: 0; background: var(--sunken); }
.preview-frame {
  position: absolute; top: 12px; left: 12px;
  display: block; width: calc(100% - 24px); height: calc(100% - 24px);
  border: 0; border-radius: var(--radius-sm);
  background: #fff; color-scheme: light;
  box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgba(20, 24, 18, .08);
}
.preview-empty {
  position: absolute; inset: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 24px; text-align: center; overflow: auto;
  border: 1.5px dashed var(--line-strong); border-radius: 10px; background: var(--surface);
  color: var(--ink-3);
}
.preview-empty .icon { width: 32px; height: 32px; margin-bottom: 8px; color: var(--ink-4); stroke-width: 1.4; }
.preview-empty strong { font-size: 15px; font-weight: 600; color: var(--ink); }
.preview-empty p { margin: 4px 0 14px; font-size: 13px; line-height: 1.7; }
.preview-foot { flex: none; display: flex; justify-content: space-between; gap: 12px; padding: 7px 14px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--ink-3); }
.preview-foot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-main > .under-note {
  flex: none; margin: 0 !important; padding: 9px 12px;
  border: 1px solid var(--warning-line); border-radius: var(--radius);
  background: var(--warning-tint); color: var(--warning);
}
.editor-main > .under-note .icon { color: currentColor; }

.editor-side { min-width: 0; }
.inspector .side-section { padding: 16px; }
.selection-section { scroll-margin-top: calc(var(--topbar-h) + 72px); }
.inspector-empty { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.6; color: var(--ink-3); }
.inspector-empty .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--ink-4); }
.inspector-figure {
  display: grid; place-items: center; margin-bottom: 12px; padding: 8px; border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background-color: var(--surface-2);
  background-image: conic-gradient(var(--checker) 25%, transparent 0 50%, var(--checker) 0 75%, transparent 0);
  background-size: 16px 16px;
}
.inspector-image { display: block; max-width: 100%; max-height: 180px; object-fit: contain; border-radius: 4px; }
.inspector-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.inspector-note { font-size: 12px; color: var(--ink-3); }
.selection-excerpt { margin: 12px 0 0; }
.selection-excerpt p {
  margin: 0; padding: 8px 10px; border-left: 2px solid var(--line-strong);
  font-size: 13px; line-height: 1.65; color: var(--ink-2); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden;
}
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; color: var(--ink-3); }
.history-row:last-child { border-bottom: 0; }
.history-row:first-of-type { padding-top: 0; }
.history-row > div { min-width: 0; }
.history-row strong { display: block; margin-bottom: 1px; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.history-row small { display: block; margin-top: 2px; color: var(--ink-3); overflow-wrap: anywhere; }
.inspector-empty + .history-row { margin-top: 0; }

/* Resource checks (markup from resource-checks.js) */
.resource-help {
  margin-top: 10px; padding: 10px 12px;
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: var(--surface-2); color: var(--ink-2);
  font-size: 13px; line-height: 1.6; overflow-wrap: anywhere;
}
.resource-help:first-child { margin-top: 0; }
.resource-help.warning { border-color: var(--warning-line); background: var(--warning-tint); }
.resource-help.warning strong { color: var(--warning); }
.resource-help strong { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.resource-help p { margin: 4px 0; }
.resource-help small { display: block; font-size: 12.5px; color: var(--ink-3); }
.resource-help details { margin: 6px 0 0; }
.resource-help summary { cursor: pointer; font-size: 12.5px; color: var(--ink-3); }
.resource-help summary:hover { color: var(--ink); }
.resource-help code { display: block; margin-top: 6px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--surface); font-family: var(--font-mono); font-size: 12px; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.resource-help .btn { margin-top: 8px; }
.hint-box + .resource-help { margin-top: 10px; }
.hint-box[data-source-issues] :is(p, ul) { margin: 4px 0 0; }
.hint-box[data-source-issues] ul { padding-left: 18px; }

/* ---------- Media ---------- */
.section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin: 24px 0 12px; }
.section-heading:first-child { margin-top: 0; }
.section-heading h2 { margin: 0; font-size: 15px; font-weight: 600; }
.section-heading span { font-size: 12.5px; color: var(--ink-3); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; }
.media-grid.picker { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-card {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.media-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.media-card:active { transform: translateY(1px); }
.media-image { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--sunken); }
.media-info { min-width: 0; padding: 9px 12px 11px; }
.media-info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--ink); }
.media-info span { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.upload-tile {
  align-items: center; justify-content: center; gap: 6px; min-height: 150px; padding: 16px; text-align: center;
  border: 1.5px dashed var(--line-strong); background: var(--surface-2); color: var(--ink-2); box-shadow: none;
}
.upload-tile:hover { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-ink); box-shadow: none; }
.upload-tile .icon { width: 24px; height: 24px; }
.upload-tile b { font-size: 14px; font-weight: 600; }
.upload-tile span { font-size: 12px; color: var(--ink-3); }
.media-preview {
  display: grid; place-items: center; padding: 12px; border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background-color: var(--surface-2);
  background-image: conic-gradient(var(--checker) 25%, transparent 0 50%, var(--checker) 0 75%, transparent 0);
  background-size: 16px 16px;
}
.media-preview img { display: block; max-width: 100%; max-height: 360px; object-fit: contain; }

/* ---------- Detail lists ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.detail-item { min-width: 0; padding: 0 0 10px; border-bottom: 1px solid var(--line-soft); }
.detail-item small { display: block; margin-bottom: 4px; font-size: 12.5px; color: var(--ink-3); }
.detail-item b, .detail-value { font-size: 14px; font-weight: 500; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; word-break: break-word; }
.detail-value { white-space: pre-wrap; }
.detail-item.full { grid-column: 1 / -1; }
.media-preview + .detail-grid { margin-top: 16px; }
.detail-heading { margin: 22px 0 12px; font-size: 14px; font-weight: 600; color: var(--ink); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--backdrop);
  animation: fade-in .16s ease-out;
}
.modal {
  display: flex; flex-direction: column; overflow: hidden;
  width: min(560px, 100%); max-height: min(88vh, 920px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: modal-in .2s var(--ease-out);
}
.modal:focus { outline: none; }
.modal.wide { width: min(920px, 100%); }
.modal-backdrop[data-reopen], .modal-backdrop[data-reopen] .modal { animation: none; }
.modal-head { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 16px 14px 24px; border-bottom: 1px solid var(--line-soft); }
.modal-head > div { min-width: 0; }
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 650; line-height: 1.4; color: var(--ink); }
.modal-head p { margin: 3px 0 0; font-size: 13px; line-height: 1.55; color: var(--ink-3); overflow-wrap: anywhere; }
.close { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--radius); color: var(--ink-3); transition: background-color .15s, color .15s; }
.close:hover { background: var(--hover); color: var(--ink); }
.close .icon { width: 18px; height: 18px; }
.modal-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 18px 24px 22px; }
.modal-body > h3:not([class]) { margin: 20px 0 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.modal-body > p:not([class]) { margin: 8px 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); overflow-wrap: anywhere; }
.modal-body > p:not([class]):first-child { margin-top: 0; }
.modal-body pre { margin: 10px 0; padding: 12px; overflow: auto; border-radius: var(--radius); background: var(--sunken); font-family: var(--font-mono); font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.modal-foot { flex: none; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line-soft); background: var(--surface-2); }
.modal-foot .foot-start { margin-right: auto; }
.candidate { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.candidate + .candidate { margin-top: 8px; }
.candidate .flag { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: var(--radius); background: var(--brand-tint); color: var(--brand-ink); font-size: 12px; font-weight: 700; }
.candidate-main, .candidate > div:not(.flag) { flex: 1; min-width: 0; }
.candidate strong { display: block; font-size: 14px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.candidate small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.candidate p { margin: 4px 0 0; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.release-status { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--success-tint); color: var(--success); font-size: 13.5px; line-height: 1.6; }
.release-status.fail { background: var(--danger-tint); color: var(--danger); }
.release-status + .candidate, .release-status + .recycle-copy { margin-top: 14px; }
.release-steps { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 14px 0; font-size: 12.5px; color: var(--ink-3); }
.release-steps .done { color: var(--success); }
.live-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }

/* ---------- Toast & busy ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90;
  max-width: min(560px, calc(100vw - 32px));
  padding: 10px 16px; border-radius: 10px;
  background: var(--toast-bg); color: var(--toast-ink);
  font-size: 13.5px; line-height: 1.55; text-align: center;
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
  animation: toast-in .22s var(--ease-out);
  overflow-wrap: anywhere;
}
/* Session reminder (live.js): persistent until renewed or expired; sits above dialogs, below toasts. */
.session-banner {
  position: fixed; top: 12px; left: 50%; z-index: 80;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
  width: max-content; max-width: min(640px, calc(100vw - 32px));
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--warning-line); border-radius: var(--radius-lg);
  background: var(--warning-tint); color: var(--warning);
  box-shadow: var(--shadow-md);
  font-size: 13.5px; line-height: 1.55;
  transform: translateX(-50%);
  animation: banner-in .22s var(--ease-out);
}
.session-banner p { flex: 1 1 240px; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.session-banner .btn { flex: none; }
@keyframes banner-in { from { opacity: 0; transform: translate(-50%, -8px); } }
#app[inert]::before {
  content: ""; position: fixed; top: 0; left: 0; z-index: 100;
  width: 36%; height: 2px; border-radius: 2px; background: var(--brand);
  animation: busy-slide 1.15s ease-in-out infinite, appear .2s .25s both;
}

/* ---------- Login ---------- */
.login-shell {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; padding: 32px 16px;
  background: radial-gradient(1100px 520px at 50% -12%, var(--brand-tint), transparent 70%), var(--bg);
}
.login-card { width: min(100%, 400px); padding: 30px 32px 24px; border-radius: var(--radius-xl); box-shadow: var(--shadow-md); }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand img { width: 44px; height: 44px; object-fit: contain; flex: none; border-radius: 10px; }
.login-brand strong { display: block; font-size: 15px; font-weight: 650; color: var(--ink); line-height: 1.3; }
.login-brand span { display: block; font-size: 12.5px; color: var(--ink-3); }
.login-card h1 { margin: 26px 0 6px; font-size: 22px; font-weight: 650; line-height: 1.35; letter-spacing: -.01em; }
.login-card > p { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-3); }
.login-card form { margin-top: 22px; }
.login-card form > .hint-box { margin-bottom: 12px; }
.login-card form > .btn { width: 100%; height: 40px; margin-top: 6px; font-size: 14px; }
.login-card .login-foot { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 12.5px; line-height: 1.6; color: var(--ink-3); }
.login-card.is-loading { display: flex; align-items: center; justify-content: center; gap: 12px; width: auto; padding: 18px 24px; font-size: 14px; color: var(--ink-2); }

/* ---------- Product editor (modal) ---------- */
.product-group { border-top: 1px solid var(--line-soft); }
.product-group:first-of-type { margin-top: 14px; }
.product-group > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 2px; list-style: none; cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--ink);
  border-radius: var(--radius-sm);
}
.product-group > summary::-webkit-details-marker { display: none; }
.product-group > summary::after {
  content: ""; width: 8px; height: 8px; flex: none; margin-right: 6px;
  border-right: 1.75px solid var(--ink-3); border-bottom: 1.75px solid var(--ink-3);
  transform: translateY(-2px) rotate(45deg); transition: transform .2s var(--ease-out);
}
.product-group[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.product-group > summary:hover { color: var(--brand-ink); }
.product-group[open] { padding-bottom: 18px; }
.product-group > summary + * { margin-top: 2px; }
.product-group h3 { margin: 16px 0 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.product-group > .detail-grid + .detail-grid { margin-top: 14px; }
.product-group > .btn { margin-top: 4px; }
.product-repeat { margin: 10px 0; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface-2); }
.product-repeat .detail-grid { margin-top: 8px; }
.product-repeat strong { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.product-repeat > .inline-link { margin-top: 8px; display: inline-block; }
.product-image-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.product-thumb { width: 72px; height: 72px; flex: none; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--sunken); }
.product-thumb.empty { display: grid; place-items: center; color: var(--ink-4); }
.product-thumb.empty .icon { width: 22px; height: 22px; }
.product-modes { display: flex; flex-wrap: wrap; gap: 0 20px; }
.product-group #product-url-preview { overflow-wrap: anywhere; }
.product-group .detail-grid > .field { margin-bottom: 0; }
.product-repeat .detail-grid > div > .field:last-child { margin-bottom: 0; }
.field.slug-field { margin-top: 14px; }

/* Submission status docks above 取消／预览／提交 so the target and live result stay visible in long forms. */
.modal-body:has(> [data-submission-status]) { padding-bottom: 0; scroll-padding-bottom: 104px; }
.modal-body > .hint-box[data-submission-status] {
  position: sticky; bottom: 0; z-index: 2;
  margin: 18px -24px 0; padding: 10px 16px 10px 24px;
  border-width: 1px 0 0; border-radius: 0;
  box-shadow: var(--shadow-dock);
}
.modal-body > .hint-box[data-submission-status]:not(.warning) { border-color: var(--line); }
.modal-body > .hint-box[data-submission-status] + .divider { margin-top: 20px; }

/*
  产品资料预览 (live.js productPreview) is the only modal body with direct <section> children:
  image/no-image note, meta line, 中文 section, English section, then shared 合作方式/成分 lines.
*/
.modal-body > section {
  min-width: 0; margin: 12px 0; padding: 14px 16px 16px;
  border: 1px solid var(--line-soft); border-radius: var(--radius-lg); background: var(--surface-2);
}
.modal-body > section > h3 {
  margin: 0 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft);
  font-size: 14.5px; font-weight: 600; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere;
}
.modal-body > section > p { margin: 8px 0 0; font-size: 13px; line-height: 1.65; color: var(--ink-2); overflow-wrap: anywhere; }
.modal-body > section > h3 + p { margin-top: 0; font-size: 13.5px; color: var(--ink); }
.modal-body > section > p:empty { display: none; }
.modal-body:has(> section) {
  display: grid; grid-template-columns: 88px minmax(0, 1fr) 88px minmax(0, 1fr);
  gap: 14px 16px; align-content: start;
}
.modal-body:has(> section) > * { grid-column: 1 / -1; min-width: 0; margin: 0; }
.modal-body:has(> section) > p:not([class]) { margin: 0; font-size: 13px; line-height: 1.65; color: var(--ink-2); }
.modal-body:has(> section) > section { grid-column: span 2; margin: 0; }
.modal-body:has(> section) > :first-child { grid-column: 1; }
.modal-body:has(> section) > :first-child + p { grid-column: 2 / -1; align-self: center; font-size: 13.5px; color: var(--ink-2); }
.modal-body:has(> section) > img.product-thumb { width: 88px; height: 88px; }
.modal-body:has(> section) > p:first-child {
  display: grid; place-items: center; width: 88px; height: 88px; padding: 6px;
  border: 1.5px dashed var(--line-strong); border-radius: 10px; background: var(--surface-2);
  font-size: 12px; line-height: 1.45; text-align: center; color: var(--ink-3);
}
.modal-body:has(> section) > section + p { padding-top: 2px; }

/* ---------- Inquiries ---------- */
.inquiry-person { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.inquiry-person strong { display: block; font-size: 19px; font-weight: 650; color: var(--ink); }
.inquiry-person span { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.attribution-note { margin-bottom: 16px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-soft); }
.attribution-note p { margin: 8px 0 0; font-size: 13px; line-height: 1.65; color: var(--ink-2); overflow-wrap: anywhere; }
.raw-fields { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--ink-3); }
.raw-fields summary { cursor: pointer; color: var(--brand-ink); font-weight: 500; }
.raw-fields pre { margin: 10px 0; padding: 12px; border-radius: var(--radius); background: var(--sunken); font-family: var(--font-mono); font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.inquiry-toolbar { align-items: center; }

/* ---------- Operations board (首富模拟器) ---------- */
.board-caption { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 15px; margin-bottom: 14px; font-size: 12.5px; color: var(--ink-3); }
.board-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 28px; }
.board-hero > div > strong { display: block; font-size: 60px; font-weight: 600; line-height: 1.1; letter-spacing: -.03em; color: var(--brand-ink); font-variant-numeric: tabular-nums; }
.board-hero strong small { margin-left: 6px; font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--ink-3); }
.board-hero p { margin: 6px 0 14px; font-size: 13px; color: var(--ink-3); }
.month-goal { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 13px; color: var(--ink-2); }
.month-goal > small { font-size: 12px; color: var(--ink-3); }
.goal-ring { position: relative; width: 120px; height: 120px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--success-dot) var(--progress), var(--sunken) 0); }
.goal-ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface); }
.goal-ring b { position: relative; font-size: 26px; font-weight: 650; color: var(--ink); }
.goal-ring b small { font-size: 14px; font-weight: 400; color: var(--ink-3); }
.board-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.board-metrics > .surface { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; text-align: left; font-size: 13px; color: var(--ink-3); }
.board-metrics > button.surface { transition: border-color .15s, box-shadow .15s; }
.board-metrics > button.surface:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.board-metrics strong { font-size: 28px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.board-metrics small { font-size: 12px; color: var(--ink-3); }
.board-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.board-grid > .surface + .surface { margin-top: 0; }
.board-card { padding: 18px 20px; }
.board-card > .section-heading { margin: 0 0 12px; }
.board-card h2 { margin: 0; font-size: 15px; font-weight: 600; }
.board-card > .section-heading .checkline { margin: 0; white-space: nowrap; }
.board-card select { width: auto; min-height: 30px; padding: 3px 8px; font-size: 13px; }
.board-sub { margin: 0 0 16px; font-size: 12.5px; line-height: 1.65; color: var(--ink-3); }
.board-empty { padding: 20px 0; font-size: 13px; color: var(--ink-3); }
.rank-list { margin: 0; padding: 0; list-style: none; }
.rank-list li { display: grid; grid-template-columns: minmax(90px, 1.2fr) minmax(40px, 1fr) 56px; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; color: var(--ink-2); }
.rank-list li:last-child { border-bottom: 0; }
.rank-list li > span { overflow-wrap: anywhere; }
.rank-list b { text-align: right; font-size: 13px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.rank-track { height: 6px; overflow: hidden; border-radius: 6px; background: var(--sunken); }
.rank-track i { display: block; height: 100%; border-radius: 6px; background: var(--success-dot); }
.board-plot { position: relative; }
.board-chart { display: block; width: 100%; height: 180px; }
.chart-axis { position: absolute; left: 0; top: 23px; bottom: 30px; display: flex; flex-direction: column; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); }
.chart-legend { display: flex; justify-content: center; gap: 20px; padding-bottom: 10px; font-size: 12px; color: var(--ink-3); }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 14px; height: 3px; border-radius: 3px; }
.board-card > .raw-fields { margin-top: 12px; }
.surface.table-scroll + .board-grid, .summary + .page-note { margin-top: 0; }

/* ---------- Stats (backups) ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0 0 16px; }
.stat-row > div { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.stat-row b { display: block; margin-bottom: 2px; font-size: 20px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-row b small { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.stat-row span { font-size: 12.5px; color: var(--ink-3); }
.stat-row + .hint-box { margin-bottom: 16px; }

/* ---------- Diagnostics search ---------- */
.search-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.search-row .control { width: min(100%, 420px); flex: 0 1 420px; font-family: var(--font-mono); font-size: 13px; }
.surface.side-section > .field-label { margin-bottom: 8px; }
.surface.side-section > .under-note { margin-top: 10px; }
.incident-list { margin: 0; padding: 4px 16px 12px; list-style: none; }
.incident-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; color: var(--ink-2); }
.incident-list li:last-child { border-bottom: 0; }

/* ---------- Motion ---------- */
@keyframes fade-in { from { opacity: 0; } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes sheet-in { from { opacity: .6; transform: translateY(24px); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes busy-slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  #app[inert]::before { width: 100%; animation: none; opacity: .7; }
  .loading-line::before, .login-card.is-loading::before { animation: none; border-top-color: var(--line-strong); }
}

/* ---------- Dark-theme adjustments ---------- */
@media (prefers-color-scheme: dark) {
  .brand-logo, .login-brand img { padding: 3px; background: #ebe9df; }
  .tab.active, .language-toggle button.active { background: var(--hover); box-shadow: 0 0 0 1px var(--line-strong); }
  .btn, .hint-box[data-submission-status] > a { box-shadow: none; }
}

/* ---------- Responsive ---------- */
@media (min-width: 1680px) {
  .editor-layout { grid-template-columns: minmax(0, 1fr) 360px; }
}

/* Compact rail: labelled icons keep every module reachable at laptop/tablet widths. */
@media (max-width: 1279px) and (min-width: 720px) {
  :root { --sidebar-w: 84px; --page-x: 24px; }
  .sidebar { padding: 12px 8px; }
  .brand { justify-content: center; padding: 4px 0 12px; }
  .brand-name, .nav-label:not(.second), .sidebar-bottom { display: none; }
  .nav-label.second { height: 1px; margin: 8px 10px; padding: 0; overflow: hidden; background: var(--line); color: transparent; font-size: 0; }
  .nav button { flex-direction: column; justify-content: center; gap: 4px; min-height: 54px; padding: 8px 2px; text-align: center; font-size: 11px; line-height: 1.2; letter-spacing: 0; }
  .nav button .icon { width: 20px; height: 20px; }
  .nav button > span:not(.nav-count) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-count { position: absolute; top: 4px; right: 8px; min-width: 18px; height: 18px; margin: 0; padding: 0 5px; font-size: 11px; }
  .editor-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .board-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Stacked editor: preview first, inspector sections below. */
@media (max-width: 959px) {
  .editor-layout { grid-template-columns: minmax(0, 1fr); }
  .editor-main { position: static; height: 76vh; height: 76dvh; min-height: 480px; }
  .inspector { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inspector .side-section { border-bottom: 1px solid var(--line-soft); }
  .inspector .side-section:nth-child(odd) { border-right: 1px solid var(--line-soft); }
  .inspector .side-section:nth-last-child(-n + 2) { border-bottom: 0; }
  .preview-hint { display: none; }
  .board-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Phone: sidebar becomes a top bar with a scrollable module strip. */
@media (max-width: 719px) {
  :root { --page-x: 16px; --topbar-h: 0px; }
  .shell { display: block; }
  .sidebar { position: static; width: auto; padding: 0; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { height: 56px; padding: 0 16px; }
  .brand-logo { width: 32px; height: 32px; }
  .nav-scroll {
    flex-direction: row; align-items: center; gap: 6px;
    overflow-x: auto; padding: 0 16px 10px; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
  }
  .nav-scroll::-webkit-scrollbar { display: none; }
  .nav-label { display: none; }
  .nav-label.second { display: block; flex: none; width: 1px; height: 20px; margin: 0 4px; padding: 0; overflow: hidden; background: var(--line-strong); color: transparent; font-size: 0; }
  .nav { display: flex; gap: 6px; }
  .nav button { flex: none; width: auto; min-height: 34px; padding: 0 12px; gap: 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13.5px; white-space: nowrap; }
  .nav button .icon { width: 16px; height: 16px; }
  .nav button.active { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }
  .nav button.active .icon { color: var(--on-brand); }
  .nav-count { min-width: 18px; height: 18px; margin-left: 2px; font-size: 11px; }
  .nav button.active .nav-count { background: rgba(255, 255, 255, .2); color: inherit; }
  .sidebar-bottom { display: none; }
  .workspace { width: auto; margin-left: 0; }
  .topbar { position: absolute; top: 0; right: 0; z-index: 41; height: 56px; padding: 0 16px; border: 0; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .crumb, .user-chip span:last-child { display: none; }
  .main { padding: 18px 16px 48px; }
  .page-head { align-items: flex-start; flex-direction: column; margin-bottom: 16px; }
  .page-head h1 { font-size: 22px; }
  .page-head .head-actions { width: 100%; }
  .surface-top { align-items: stretch; flex-direction: column; }
  .surface-top > .tabs { align-self: flex-start; }
  .search-wrap { width: 100%; min-width: 0; }
  .summary { gap: 4px 14px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-item.full { grid-column: auto; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .media-grid.picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field input, .field textarea, .field select, .control, .search-wrap input { font-size: 16px; }
  .table-footer { padding: 10px 14px; }

  /* Article, product and recycle tables read as compact cards. */
  .table.cards { min-width: 0; }
  .table.cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table.cards, .table.cards tbody { display: block; }
  .table.cards tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
  .table.cards tbody tr:last-child { border-bottom: 0; }
  .table.cards td { display: flex; align-items: center; padding: 0; border: 0; font-size: 13px; }
  .table.cards td:first-child { flex: 1 1 100%; margin-bottom: 2px; }
  .table.cards td.row-arrow { display: none; }
  .table.cards td.cell-action { margin-left: auto; }
  .table.cards td:not(:first-child):not(.row-arrow):not(.cell-action) + td:not(.row-arrow):not(.cell-action)::before { content: "·"; margin-right: 10px; color: var(--ink-4); }

  .editor-head { position: static; flex-wrap: wrap; height: auto; margin: 0 -16px 12px; padding: 12px 16px; }
  .editor-head h1 { font-size: 17px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .editor-head .head-actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    justify-content: flex-end; gap: 8px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line);
    box-shadow: 0 -6px 18px rgba(20, 24, 18, .08);
  }
  .editor-head .head-actions .btn { height: 40px; }
  .editor-head .head-actions .btn.primary { flex: 1 1 auto; }
  .view-snapshot { width: 40px; padding: 0; }
  .view-snapshot .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .main.is-editor { padding-bottom: 96px; }
  .editor-main { height: 72vh; height: 72dvh; min-height: 440px; }
  .preview-outer { background: var(--sunken); }
  .preview-frame { top: 8px; left: 8px; width: calc(100% - 16px); height: calc(100% - 16px); }
  .preview-empty { inset: 8px; }
  .editor-toolbar { padding: 8px; }
  .toolbar-right { width: 100%; justify-content: space-between; margin-left: 0; }
  .preview-foot { flex-direction: column; gap: 2px; }
  .inspector { display: block; }
  .inspector .side-section:nth-child(odd) { border-right: 0; }
  .inspector .side-section:nth-last-child(2) { border-bottom: 1px solid var(--line-soft); }
  .selection-section { scroll-margin-top: 12px; }
  body:has(.editor-head) .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }

  .modal-backdrop { align-items: flex-end; padding: 12px 0 0; }
  .modal, .modal.wide { width: 100%; max-height: calc(100vh - 12px); max-height: calc(100dvh - 12px); border-radius: 18px 18px 0 0; border-bottom: 0; animation-name: sheet-in; }
  .modal-head { padding: 16px 12px 12px 18px; }
  .modal-body { padding: 16px 18px 20px; }
  .modal-foot { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1 1 auto; }
  .modal-foot .foot-start { flex: 0 1 auto; }

  /* Submission status: actions drop below the text instead of squeezing it. */
  .hint-box[data-submission-status] { grid-template-columns: minmax(0, 1fr); padding: 10px 12px; }
  .hint-box[data-submission-status] > :is(.btn, a) { grid-column: 1; grid-row: auto; justify-self: start; height: 36px; margin-top: 8px; }
  .modal-body > .hint-box[data-submission-status] { margin: 16px -18px 0; padding: 10px 18px; }
  .modal-body:has(> section) { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
  .modal-body:has(> section) > img.product-thumb, .modal-body:has(> section) > p:first-child { width: 72px; height: 72px; }
  .modal-body > section { padding: 12px 14px 14px; }

  .board-hero { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px; }
  .board-hero > div > strong { font-size: 52px; }
  .board-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .board-metrics > .surface { padding: 14px; }
  .rank-list li { grid-template-columns: minmax(80px, 1fr) minmax(35px, .6fr) 48px; }
  .board-card { padding: 16px; }
  .board-card > .section-heading { flex-wrap: wrap; }
  .login-card { padding: 26px 20px 20px; }
  .stat-row { grid-template-columns: minmax(0, 1fr); }
}
.recycle-copy.intro { margin: 0 0 14px; }
.release-status + .recycle-copy.intro { margin-top: 14px; }
.media-info { display: block; }
.btn.text.danger { color: var(--danger); }
.btn.text.danger:hover:not(:disabled) { background: var(--danger-tint); color: var(--danger); }
.detail-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.url-preview { display: block; margin-top: 6px; }
.url-preview small { margin-top: 0; font-family: var(--font-mono); font-size: 12px; }
.product-image-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.product-image-actions small { font-size: 12.5px; color: var(--ink-3); }
.product-repeat .side-heading { margin-bottom: 0; }
@media (max-width: 719px) {
  .detail-grid.three { grid-template-columns: minmax(0, 1fr); }
}
.modal-body > p.mono { margin: 8px 0; line-height: 1.7; overflow-wrap: anywhere; }
.side-title + .resource-help, .side-title + .hint-box { margin-top: 0; }

.resource-thumbnail{display:block;width:100%;max-height:120px;object-fit:contain;border-radius:8px;margin:10px 0;background:var(--bg)}
.resource-help>.btn+.btn{margin-left:6px}

/* Material library: filters and explicit cleanup. */
.media-library-filters{display:grid;grid-template-columns:minmax(160px,2fr) repeat(4,minmax(110px,1fr)) auto;gap:14px;padding:20px;align-items:end;margin-bottom:20px}
.media-library-filters .field{margin:0;min-width:0}
.media-library-filters input,.media-library-filters select{width:100%;min-width:0}
.media-filter-actions{position:relative;display:flex;gap:8px;flex-wrap:wrap;padding-bottom:1px}
/* Sits in the label row above 筛选, out of flow, so showing it never resizes the filter grid. */
.media-filter-pending{position:absolute;left:0;bottom:calc(100% + 6px);font-size:12.5px;font-weight:500;line-height:1.4;color:var(--warning);white-space:nowrap}
.media-library-selection{display:flex;align-items:center;gap:18px;flex-wrap:wrap;padding:14px 18px;margin-bottom:20px}
.media-library-selection label,.media-library-card-top label{display:flex;align-items:center;gap:10px;min-height:32px;cursor:pointer}
.media-library-selection input,.media-library-card-top input{width:18px;height:18px;accent-color:var(--brand);flex:none}
.media-library-selection>div{display:flex;gap:8px;margin-left:auto}
.media-library-card{position:relative;min-width:0;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg,12px);overflow:hidden}
.media-library-card-top{padding:8px 12px;border-bottom:1px solid var(--line-soft)}
.media-library-card .media-card{width:100%;border:0;border-radius:0;box-shadow:none}
.media-library-card time{display:block;padding:0 14px 14px;color:var(--ink-3);font-size:12px}
.media-library-pagination>div{display:flex;align-items:center;gap:12px}
@media(max-width:1200px){.media-library-filters{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:600px){.media-library-filters{grid-template-columns:repeat(2,minmax(0,1fr));padding:16px;gap:12px}.media-library-filters>.field:first-child,.media-filter-actions{grid-column:1/-1}.media-filter-pending{position:static;align-self:center}.media-library-selection{gap:10px;padding:12px}.media-library-selection>div{width:100%;margin-left:0}.media-library-pagination{gap:12px;flex-wrap:wrap}}
