/* tokens.css */
/* ==========================================================================
   一维云创 · 设计 token
   暗底 + 洋红。深色是本项目的主场，浅色只用于打印。
   ========================================================================== */

:root {
  color-scheme: dark;

  /* 底色层级 */
  --bg-0: #070406;
  --bg-1: #0c0709;
  --bg-2: #130b10;
  --bg-3: #1a1017;
  --bg-glass: rgba(19, 11, 16, 0.72);

  /* 文字 */
  --ink: #efe7ec;
  --ink-2: #c2b4bb;
  --ink-3: #8b7681;
  --ink-4: #6b5763;

  /* 品牌 */
  --brand: #ff2d6f;
  --brand-2: #ff5c8d;
  --brand-3: #ff8ab0;
  --brand-dim: rgba(255, 45, 111, 0.14);
  --brand-glow: rgba(255, 45, 111, 0.28);
  --violet: #a21caf;
  --plum: #d8a6f7;

  /* 语义色 */
  --ok: #48c98e;
  --ok-dim: rgba(72, 201, 142, 0.14);
  --warn: #f5b544;
  --warn-dim: rgba(245, 181, 68, 0.14);
  --danger: #ff5470;
  --danger-dim: rgba(255, 84, 112, 0.14);

  /* 线 */
  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.13);
  --line-3: rgba(255, 255, 255, 0.2);
  --line-brand: rgba(255, 45, 111, 0.32);

  /* 排版 */
  --font-sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
    "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono",
    "DejaVu Sans Mono", Menlo, Consolas, monospace;
  /* 小标签（eyebrow / 核心判断）：拉丁用 Inter，中文落 MiSans 子集 */
  --font-label: "Inter", "MiSans", "PingFang SC", "Microsoft YaHei",
    "Hiragino Sans GB", sans-serif;

  --fs-xs: 12px;
  --fs-sm: 13.5px;
  --fs-base: 16px;
  --fs-md: 17px;
  --fs-lg: 20px;
  --fs-xl: 26px;
  --fs-2xl: 34px;
  --fs-3xl: 44px;
  --fs-hero: clamp(40px, 5.6vw, 74px);

  /* 间距 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 128px;

  /* 容器 */
  --maxw: 1200px;
  --maxw-narrow: 820px;
  --gutter: 24px;

  /* 圆角 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* 阴影 */
  --shadow-card: 0 24px 60px -32px rgba(0, 0, 0, 0.9);
  --shadow-pop: 0 30px 80px -40px rgba(0, 0, 0, 1);
  --shadow-brand: 0 12px 40px -14px rgba(255, 45, 111, 0.5);

  /* 动效 */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.32s;

  --z-nav: 60;
  --z-drawer: 80;
  --z-toast: 100;
}

/* base.css */
/* ==========================================================================
   基础重置与小件
   ========================================================================== */

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

/* 浏览器默认的 [hidden] 会被组件里的 display 覆盖，这里统一兜住 */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 650;
  line-height: 1.22;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}

p { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

ul, ol { margin: 0; padding: 0; list-style: none; }

::selection {
  background: var(--brand);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 3px;
  border-radius: 6px;
}

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb {
  background: #2a1c24;
  border-radius: 999px;
  border: 2px solid var(--bg-0);
}
::-webkit-scrollbar-thumb:hover { background: #3a2833; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.container-narrow {
  max-width: var(--maxw-narrow);
}

/* 跳到正文（键盘用户） */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* 视觉隐藏 */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 滚动渐入：隐藏态由 JS 在「元素在首屏之外」时才添加，
   所以脚本失败或首屏元素不会被藏住。 */
.js .reveal.js-anim {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js .reveal.js-anim.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .js .reveal.js-anim,
  .js .reveal.js-anim.is-in { opacity: 1; transform: none; transition: none; }
}

/* admin.css */
/* ==========================================================================
   后台样式（manager）
   与官网同一套 token，但布局是「侧栏 + 密集表格 + 表单」的工作台形态。
   ========================================================================== */

/* ------------------------------ 基础 ------------------------------ */

body.admin {
  background: var(--bg-0);
  overflow-x: hidden;
}

.admin-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
  --help-w: clamp(360px, 26vw, 500px);
}

/* ------------------------------ 侧栏 ------------------------------ */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  padding: 18px 14px 14px;
  gap: 4px;
  overflow-y: auto;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.side-brand img { width: 26px; height: 26px; }
.side-brand .sb-cn { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.side-brand .sb-en {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--ink-4);
  text-transform: uppercase;
}

.side-group {
  padding: 14px 10px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--ink-2);
  font-size: 13.5px;
  transition: background 0.18s, color 0.18s;
  position: relative;
}
.side-link svg { width: 17px; height: 17px; opacity: 0.75; flex: none; }
.side-link:hover { background: rgba(255, 255, 255, 0.04); color: var(--ink); }
.side-link.is-active {
  background: linear-gradient(90deg, rgba(255, 45, 111, 0.15), rgba(255, 45, 111, 0.04));
  color: var(--ink);
}
.side-link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 2px;
  background: var(--brand);
}
.side-link.is-active svg { opacity: 1; color: var(--brand-2); }
.side-link .badge-dot {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  display: grid;
  place-items: center;
}

.side-foot {
  margin-top: auto;
  padding: 12px 10px 4px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-4);
  line-height: 1.6;
}
.side-foot a { color: var(--ink-3); }
.side-foot a:hover { color: var(--brand-2); }

/* ------------------------------ 主区 ------------------------------ */

.main { min-width: 0; display: flex; flex-direction: column; }

/* 内容 + 右侧操作说明：说明面板跟着页面走，不挡内容 */
.main-body {
  display: flex;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}
.main-body > .content { flex: 1; min-width: 0; }

.help-panel {
  flex: none;
  width: var(--help-w);
  border-left: 1px solid var(--line);
  background: #fff;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 58px);
  position: sticky;
  top: 58px;
  min-height: 0;
}
.help-panel[hidden] { display: none; }

.help-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}
.help-head h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.help-head .spacer { flex: 1; }

.help-body {
  padding: 14px 16px 26px;
  overflow-y: auto;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-2);
}
.help-body h2 {
  margin: 2px 0 10px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.help-body h3 { margin: 18px 0 6px; font-size: 13px; color: var(--ink); }
.help-body p { margin: 8px 0; }
.help-body ul, .help-body ol { margin: 8px 0; padding-left: 18px; }
.help-body li { margin: 3px 0; }
.help-body strong { color: var(--ink); }
.help-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 11.5px;
}
.help-body th, .help-body td {
  border: 1px solid var(--line);
  padding: 5px 7px;
  text-align: left;
  vertical-align: top;
}
.help-body th { background: #fafbfc; font-weight: 600; }
.help-body code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: #f3f4f6;
  border: 1px solid var(--line);
  padding: 1px 4px;
  border-radius: 4px;
  color: #b3195b;
}
.help-body pre {
  margin: 10px 0;
  padding: 10px 12px;
  background: #12090d;
  border-radius: 8px;
  overflow-x: auto;
}
.help-body pre code { background: none; border: 0; padding: 0; color: #f3d9e4; }
.help-body blockquote {
  margin: 10px 0;
  padding: 6px 12px;
  border-left: 3px solid var(--brand);
  background: #fff7fa;
  border-radius: 0 6px 6px 0;
}
.help-foot {
  border-top: 1px solid var(--line);
  padding: 9px 14px;
  font-size: 11px;
  color: var(--ink-4);
}

.topbar .btn-help {
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #d9d3dc;
  background: transparent;
  font-size: 12.5px;
}
.topbar .btn-help:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

/* 说明收起后贴在右边缘的竖标签 */
.help-tab {
  position: fixed;
  right: 0;
  top: 42%;
  z-index: 25;
  writing-mode: vertical-rl;
  letter-spacing: 0.14em;
  padding: 16px 9px;
  font-size: 12px;
  color: #3d4450;
  background: #fff;
  border: 1px solid rgba(17, 24, 39, 0.14);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  cursor: pointer;
  box-shadow: -3px 2px 12px rgba(17, 24, 39, 0.1);
}
.help-tab:hover { color: #e11d48; border-color: rgba(225, 29, 72, 0.3); }
.help-tab[hidden] { display: none; }

@media (max-width: 1099px) {
  .help-panel { display: none !important; }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 26px;
  background: rgba(7, 4, 6, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.topbar-title {
  font-size: 12.5px;
  color: var(--ink-4);
  letter-spacing: 0.01em;
}
.topbar .crumb {
  font-size: 12px;
  color: var(--ink-4);
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 5px 6px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.user-chip:hover { border-color: var(--line-2); }
.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #ff2d6f, #a21caf);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.content {
  padding: clamp(22px, 1.6vw, 36px);
  flex: 1;
  width: 100%;
  /* 大屏也给内容区足够的宽度：上限放宽并居中，避免右边一大片空白 */
  max-width: 2200px;
  margin-inline: auto;
}

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}
.page-head h2 { font-size: 21px; font-weight: 650; letter-spacing: -0.02em; }
.page-head .desc { margin-top: 6px; font-size: 13px; color: var(--ink-3); max-width: 620px; line-height: 1.7; }
.page-head .head-actions { margin-left: auto; display: flex; gap: 8px; flex: none; }

/* ------------------------------ 按钮 ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  transition: background 0.18s, border-color 0.18s, transform 0.15s, opacity 0.18s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: linear-gradient(135deg, #ff3d7c, #e0155c);
  color: #fff;
  box-shadow: 0 8px 22px -12px rgba(255, 45, 111, 0.8);
}
.btn-primary:hover { filter: brightness(1.07); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--line-2);
  color: var(--ink);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--line-3); }

.btn-quiet {
  background: transparent;
  color: var(--ink-2);
}
.btn-quiet:hover { background: rgba(255, 255, 255, 0.05); color: var(--ink); }

.btn-danger {
  background: var(--danger-dim);
  border-color: rgba(255, 84, 112, 0.32);
  color: #ff8fa3;
}
.btn-danger:hover { background: rgba(255, 84, 112, 0.22); }

.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { width: 30px; height: 30px; padding: 0; }
.btn-block { width: 100%; }

/* ------------------------------ 面板 ------------------------------ */

.panel {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.panel + .panel { margin-top: 16px; }
.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-head h3 { font-size: 13.5px; font-weight: 600; }
.panel-head .ph-desc { font-size: 12px; color: var(--ink-4); }
.panel-head .ph-actions { margin-left: auto; display: flex; gap: 8px; }
.panel-body { padding: 18px; }
.panel-body.tight { padding: 0; }

/* ------------------------------ 概览卡 ------------------------------ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 70%);
}
.stat-card .sc-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.stat-card .sc-value {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat-card .sc-value.brand { color: var(--brand-2); }
.stat-card .sc-note { margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }

/* ------------------------------ 表格 ------------------------------ */

.table-wrap { width: 100%; overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th {
  padding: 10px 18px;
  text-align: left;
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-4);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
  white-space: nowrap;
}
table.data td {
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: rgba(255, 255, 255, 0.018); }
table.data .cell-main { color: var(--ink); font-weight: 500; }
table.data .cell-mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
table.data .cell-actions { text-align: right; white-space: nowrap; }
table.data .row-link { cursor: pointer; }

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.table-toolbar .spacer { margin-left: auto; }

.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-3);
}
.pager .spacer { margin-left: auto; }

/* ------------------------------ 标签 ------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}
.badge.new { color: #ff9ab5; background: var(--brand-dim); border-color: rgba(255, 45, 111, 0.3); }
.badge.contacted { color: #8fc7ff; background: rgba(90, 160, 255, 0.14); border-color: rgba(90, 160, 255, 0.3); }
.badge.quoted { color: var(--warn); background: var(--warn-dim); border-color: rgba(245, 181, 68, 0.32); }
.badge.closed { color: var(--ok); background: var(--ok-dim); border-color: rgba(72, 201, 142, 0.3); }
.badge.spam { color: var(--ink-4); }
.badge.ok { color: var(--ok); background: var(--ok-dim); border-color: rgba(72, 201, 142, 0.3); }
.badge.warn { color: var(--warn); background: var(--warn-dim); border-color: rgba(245, 181, 68, 0.3); }
.badge.off { color: var(--ink-3); }

/* ------------------------------ 表单 ------------------------------ */

.field { margin-bottom: 14px; }
.field > label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--ink-3);
}
.field > label .req { color: var(--brand); margin-left: 3px; }
.field .hint { margin-top: 5px; font-size: 11.5px; color: var(--ink-4); }
.field .err { margin-top: 5px; font-size: 11.5px; color: var(--danger); }

.input, .textarea, .select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font-size: 13px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.65; }
.textarea.tall { min-height: 180px; }
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 45, 111, 0.14);
}
.input:disabled { opacity: 0.55; }
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.checkbox input { accent-color: var(--brand); width: 14px; height: 14px; }

/* ------------------------------ 列表编辑器 ------------------------------ */

.list-editor { display: grid; gap: 8px; }
.list-item {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.014);
  padding: 10px 12px;
}
.list-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 11.5px;
  color: var(--ink-4);
}
.list-item-head .spacer { margin-left: auto; }
.list-item .field { margin-bottom: 8px; }
.list-item .field:last-child { margin-bottom: 0; }
.list-empty {
  padding: 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-4);
  border: 1px dashed var(--line-2);
  border-radius: 9px;
}

/* ------------------------------ 区块列表 ------------------------------ */

.block-list { display: grid; gap: 8px; }
.block-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.014);
  transition: border-color 0.18s, background 0.18s;
}
.block-row:hover { border-color: var(--line-2); background: rgba(255, 255, 255, 0.028); }
.block-row.is-hidden { opacity: 0.5; }
.block-type {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-2);
  border: 1px solid rgba(255, 45, 111, 0.28);
  background: var(--brand-dim);
  padding: 3px 7px;
  border-radius: 5px;
  flex: none;
}
.block-name {
  min-width: 0;
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.block-sub { font-size: 11.5px; color: var(--ink-4); }
.block-actions { margin-left: auto; display: flex; gap: 4px; flex: none; }

/* ------------------------------ 空状态 ------------------------------ */

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--ink-4);
}
.empty .em-title { font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.empty .em-desc { font-size: 12.5px; line-height: 1.7; }

/* ------------------------------ 抽屉 ------------------------------ */

.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: var(--z-drawer);
  opacity: 0;
  transition: opacity 0.22s;
}
.drawer-mask.is-open { opacity: 1; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(520px, 92vw);
  background: var(--bg-1);
  border-left: 1px solid var(--line-2);
  z-index: calc(var(--z-drawer) + 1);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s var(--ease);
  box-shadow: -30px 0 60px -30px rgba(0, 0, 0, 0.9);
}
.drawer.is-open { transform: none; }
.drawer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h3 { font-size: 14.5px; }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }
.drawer-foot {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}
.drawer-foot .spacer { margin-left: auto; }

/* ------------------------------ 弹窗 ------------------------------ */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: calc(var(--z-drawer) + 2);
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.2s;
}
.modal-mask.is-open { opacity: 1; }
.modal {
  width: min(560px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-pop);
  transform: translateY(8px) scale(0.99);
  transition: transform 0.24s var(--ease);
}
.modal-mask.is-open .modal { transform: none; }
.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 14.5px; }
.modal-body { padding: 20px; overflow-y: auto; font-size: 13px; color: var(--ink-2); line-height: 1.75; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

/* ------------------------------ 提示 ------------------------------ */

.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  background: #1d1119;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-pop);
  color: var(--ink);
  animation: toast-in 0.26s var(--ease);
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.ok { border-color: rgba(72, 201, 142, 0.4); }
.toast.err { border-color: rgba(255, 84, 112, 0.45); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------ 登录 ------------------------------ */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto;
  height: 100%;
  background:
    radial-gradient(40% 50% at 50% 0%, rgba(255, 45, 111, 0.16), transparent 70%),
    radial-gradient(40% 40% at 80% 60%, rgba(162, 28, 175, 0.1), transparent 70%);
  pointer-events: none;
}
.login-card {
  position: relative;
  width: min(400px, 100%);
  padding: 30px 28px 26px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(23, 13, 19, 0.95), rgba(13, 8, 12, 0.98));
  box-shadow: var(--shadow-pop);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 26px;
}
.login-brand img { width: 34px; height: 34px; }
.login-brand .lb-cn { font-size: 15px; font-weight: 650; }
.login-brand .lb-en {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--ink-4);
  text-transform: uppercase;
}
.login-card h1 { font-size: 19px; letter-spacing: -0.02em; }
.login-card .sub { margin: 7px 0 22px; font-size: 12.5px; color: var(--ink-3); line-height: 1.7; }
.login-card .field { margin-bottom: 12px; }
.code-row { display: flex; gap: 8px; }
.code-row .input { flex: 1; }
.code-row .btn { flex: none; height: 38px; min-width: 104px; }
.login-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-4);
  line-height: 1.7;
}
.login-err {
  margin-bottom: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--danger-dim);
  border: 1px solid rgba(255, 84, 112, 0.3);
  color: #ff9db0;
  font-size: 12.5px;
}

/* ------------------------------ 杂项 ------------------------------ */

.loading {
  padding: 60px 0;
  text-align: center;
  color: var(--ink-4);
  font-size: 13px;
}
.spinner {
  width: 18px;
  height: 18px;
  margin: 0 auto 12px;
  border: 2px solid var(--line-2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
.muted { color: var(--ink-4); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.stack { display: grid; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row .spacer { margin-left: auto; }
.section-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 22px 0 10px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.media-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-2);
  position: relative;
}
.media-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #000;
}
.media-item .mi-meta {
  padding: 7px 9px;
  font-size: 10.5px;
  color: var(--ink-4);
  font-family: var(--font-mono);
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.media-item .mi-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.18s;
}
.media-item:hover .mi-actions { opacity: 1; }

.dropzone {
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  padding: 28px;
  text-align: center;
  color: var(--ink-4);
  font-size: 13px;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone.is-over { border-color: var(--brand); background: var(--brand-dim); }

@media (max-width: 1080px) {
  .admin-shell { grid-template-columns: 68px minmax(0, 1fr); }
  .sidebar { padding: 14px 8px; }
  .side-brand .sb-cn, .side-brand .sb-en, .side-group, .side-link span, .side-foot { display: none; }
  .side-link { justify-content: center; padding: 11px 0; }
  .side-brand { justify-content: center; padding: 4px 0 14px; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   内容区浅色主题
   侧栏与顶栏保持暗色，右侧工作区换成白底。
   只覆盖内容区里的组件：换一套 CSS 变量，再把少量写死的 rgba 改掉。
   ========================================================================== */

.main { background: #f4f5f7; }

/* 内容区浅色后，页面底部不该再露出深色 body；登录页自己铺暗底 */
body.admin { background: #f4f5f7; }
.login-wrap { background: var(--bg-0); }

/* 顶栏跟着侧栏走实色暗底，避免半透明压在浅色内容上发灰 */
.topbar {
  background: #0d0a0c;
  backdrop-filter: none;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.content,
.drawer,
.modal,
.help-panel {
  color-scheme: light;
  color: var(--ink);

  --bg-0: #f4f5f7;
  --bg-1: #ffffff;
  --bg-2: #ffffff;
  --bg-3: #eef0f3;
  --bg-glass: rgba(255, 255, 255, 0.82);

  --ink: #171a20;
  --ink-2: #3d4450;
  --ink-3: #5f6876;
  --ink-4: #7b8390;

  --line: rgba(17, 24, 39, 0.08);
  --line-2: rgba(17, 24, 39, 0.14);
  --line-3: rgba(17, 24, 39, 0.24);
  --line-brand: rgba(225, 29, 72, 0.3);

  --brand: #e11d48;
  --brand-2: #e11d48;
  --brand-3: #be123c;
  --brand-dim: rgba(225, 29, 72, 0.08);
  --brand-glow: rgba(225, 29, 72, 0.2);

  --violet: #7c3aed;
  --plum: #7c3aed;

  --ok: #047857;
  --ok-dim: rgba(4, 120, 87, 0.1);
  --warn: #b45309;
  --warn-dim: rgba(180, 83, 9, 0.1);
  --danger: #dc2626;
  --danger-dim: rgba(220, 38, 38, 0.08);

  --shadow-card: 0 10px 30px -18px rgba(17, 24, 39, 0.28);
  --shadow-pop: 0 24px 60px -30px rgba(17, 24, 39, 0.35);
  --shadow-brand: 0 10px 26px -14px rgba(225, 29, 72, 0.5);
}

.content { background: var(--bg-0); }

/* 白底上靠很淡的投影分层 */
.content .panel,
.content .stat-card {
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}
.content .stat-card { background: #fff; border-color: var(--line); }

/* 表格 */
.content table.data th { background: #fafbfc; }
.content table.data tbody tr:hover td { background: #f8fafc; }

/* 按钮 */
.content .btn-ghost,
.drawer .btn-ghost,
.modal .btn-ghost {
  background: #fff;
  border-color: var(--line-2);
  color: var(--ink);
}
.content .btn-ghost:hover,
.drawer .btn-ghost:hover,
.modal .btn-ghost:hover { background: #f3f4f6; border-color: var(--line-3); }

.content .btn-quiet:hover,
.drawer .btn-quiet:hover,
.modal .btn-quiet:hover { background: #f3f4f6; color: var(--ink); }

.content .btn-danger,
.drawer .btn-danger,
.modal .btn-danger {
  color: #be123c;
  background: var(--danger-dim);
  border-color: rgba(220, 38, 38, 0.22);
}

/* 表单 */
.content .input,
.content .textarea,
.content .select,
.drawer .input,
.drawer .textarea,
.drawer .select,
.modal .input,
.modal .textarea,
.modal .select {
  background: #fff;
  border-color: var(--line-2);
  color: var(--ink);
}
.content .input:focus,
.content .textarea:focus,
.content .select:focus,
.drawer .input:focus,
.drawer .textarea:focus,
.drawer .select:focus,
.modal .input:focus,
.modal .textarea:focus,
.modal .select:focus {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
}
.content .input::placeholder,
.content .textarea::placeholder,
.drawer .input::placeholder,
.drawer .textarea::placeholder { color: #9aa2ae; }

/* 区块与条目列表 */
.content .block-row,
.content .list-item,
.drawer .list-item { background: #fff; border-color: var(--line); }
.content .block-row:hover { background: #fafbfc; border-color: var(--line-2); }
.content .list-item { background: #fafbfc; }

/* 徽章 */
.content .badge,
.drawer .badge {
  background: #f3f4f6;
  color: var(--ink-2);
  border-color: var(--line-2);
}
.content .badge.new,
.drawer .badge.new {
  color: #be123c;
  background: rgba(225, 29, 72, 0.08);
  border-color: rgba(225, 29, 72, 0.2);
}
.content .badge.contacted,
.drawer .badge.contacted {
  color: #1d4ed8;
  background: rgba(29, 78, 216, 0.08);
  border-color: rgba(29, 78, 216, 0.2);
}
.content .badge.quoted,
.drawer .badge.quoted {
  color: #b45309;
  background: rgba(180, 83, 9, 0.09);
  border-color: rgba(180, 83, 9, 0.22);
}
.content .badge.closed,
.drawer .badge.closed {
  color: #047857;
  background: rgba(4, 120, 87, 0.09);
  border-color: rgba(4, 120, 87, 0.2);
}

/* 媒体库 */
.content .media-item { background: #fff; }
.content .media-item img { background: #f3f4f6; }

/* 抽屉 / 弹窗 */
.drawer,
.modal { background: #fff; }
.drawer { box-shadow: -24px 0 60px -36px rgba(17, 24, 39, 0.45); }
.modal { box-shadow: 0 30px 70px -30px rgba(17, 24, 39, 0.4); }
.drawer-head,
.drawer-foot,
.modal-head,
.modal-foot { border-color: var(--line); }

/* 空状态 */
.content .empty { color: var(--ink-4); }
.content .empty .em-title { color: var(--ink-2); }

/* ------------------------------ 图片字段 / 媒体选择器 ------------------------------ */

.image-field-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.image-field-row .input { flex: 1; min-width: 180px; }

.inline-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.inline-group .input { flex: none; }

.image-preview { margin-top: 10px; }
.image-preview img {
  display: block;
  max-width: 100%;
  max-height: 180px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.media-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 2px;
}
.media-pick-item {
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: #fff;
  padding: 0;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s, transform 0.18s;
}
.media-pick-item:hover { border-color: var(--brand); transform: translateY(-1px); }
.media-pick-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f3f4f6;
}
.media-pick-item .mp-name {
  display: block;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 多选标记 */
.media-pick-item { position: relative; }
.media-pick-item .mp-check {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.media-pick-item.is-chosen { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-dim); }
.media-pick-item.is-chosen .mp-check { display: grid; }

/* 视频 */
.media-item .mi-video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #000;
}
.media-item .mi-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  pointer-events: none;
}
.media-pick-item video.mp-video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #000;
}
.media-pick-item .mp-badge {
  position: absolute;
  left: 6px;
  bottom: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 10.5px;
  pointer-events: none;
}
.video-embed-note {
  padding: 10px 12px;
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-3);
  background: var(--bg-3);
}

/* ------------------------------ 裁剪 ------------------------------ */

.crop-wrap {
  display: grid;
  place-items: center;
  background: #0f0b0e;
  border-radius: 10px;
  padding: 14px;
}
.crop-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  touch-action: none;
  user-select: none;
}
.crop-img { display: block; max-width: 100%; max-height: 56vh; }
.crop-box {
  position: absolute;
  border: 1px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  cursor: move;
}
.crop-box::before {
  content: '';
  position: absolute;
  inset: 33.33% 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.35);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.35);
}
.crop-box::after {
  content: '';
  position: absolute;
  inset: 0 33.33%;
  border-left: 1px dashed rgba(255, 255, 255, 0.35);
  border-right: 1px dashed rgba(255, 255, 255, 0.35);
}
.crop-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.crop-handle.nw { left: -6px; top: -6px; cursor: nwse-resize; }
.crop-handle.ne { right: -6px; top: -6px; cursor: nesw-resize; }
.crop-handle.sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.crop-handle.se { right: -6px; bottom: -6px; cursor: nwse-resize; }

.crop-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.crop-toolbar .btn.is-active {
  background: var(--brand-dim);
  border-color: var(--line-brand);
  color: var(--brand-2);
}

/* ------------------------------ 图集编辑 ------------------------------ */

.gallery-editor-list { display: grid; gap: 10px; }
.gallery-item-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  align-items: center;
}
.gic-thumb {
  width: 88px;
  height: 66px;
  border-radius: 6px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid var(--line);
}
.gic-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gic-fields { display: grid; gap: 6px; }
.gic-actions { display: flex; gap: 4px; align-items: center; }

@media (max-width: 720px) {
  .gallery-item-card { grid-template-columns: 1fr; }
  .gic-actions { justify-content: flex-end; }
}

