/* ==========================================================================
   Eagle UI system · 复刻自后台模板 demo.mycreativetemplates.com.eagle.html
   - 左侧深蓝渐变导航 + 悬浮白色顶栏 + 浅灰画布 + 白色卡片
   - 主色 #2563eb，状态色 绿/红/橙/蓝，Plus Jakarta Sans + 系统中文字体
   - 本文件只做主题覆盖，加载于 app.css 之后；不改动页面结构
   ========================================================================== */

:root {
  /* 画布与墨色 */
  --canvas: #f0f2f8;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #64748b;
  --ink-4: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --hover-tint: #f8fafc;

  /* 品牌与状态 */
  --brand: #2563eb;
  --brand-ink: #1d4ed8;
  --brand-strong: #1e40af;
  --brand-soft: rgba(37, 99, 235, 0.1);
  --brand-line: #bfdbfe;
  --accent: #f43f5e;
  --accent-ink: #e11d48;
  --accent-strong: #be123c;
  --accent-soft: #fff1f2;
  --accent-line: #fecdd3;
  --teal: #22c55e;
  --teal-ink: #16a34a;
  --teal-soft: rgba(34, 197, 94, 0.1);
  --warn-ink: #b45309;
  --warn-soft: #fffbeb;
  --warn-line: #fde68a;

  /* 表面与阴影 */
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --glass-edge: #f1f5f9;
  --glass-highlight: transparent;
  --gloss-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 55%);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-pop: 0 8px 30px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-lift: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);

  /* 字体与圆角 */
  --font-sans: 'Plus Jakarta Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
    'Noto Sans CJK SC', 'Source Han Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: var(--font-sans);
  --font-mono: 'JetBrains Mono', 'Cascadia Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --radius-sm: 6px;
  --radius-lg: 10px;
  --radius-ctl: 10px;
  --radius-card: 12px;
  --radius-bar: 14px;

  /* 动效 */
  --dur-fast: 0.15s;
  --dur: 0.3s;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* 侧栏（与模板一致） */
  --sidebar-width: 270px;
  --header-height: 70px;
  --sidebar-surface: linear-gradient(150deg, #1e3a8a 0%, #172554 72%);
}

/* --------------------------------------------------------------------------
   基础
   -------------------------------------------------------------------------- */
body {
  background-image: none;
  background-color: var(--canvas);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
}
h1 {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.009em;
}
h2 {
  margin: 30px 0 12px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}
h3 {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--ink-3);
}
p { margin: 8px 0; }
a { color: var(--brand); }
a:hover { color: var(--brand-ink); }
code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--ink-2);
}
::selection {
  background: rgba(37, 99, 235, 0.15);
  color: var(--brand-ink);
}
:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.55);
  outline-offset: 2px;
  border-radius: 6px;
}

/* 公开页顶栏 / 页脚 */
.site-head {
  padding: 0 22px;
  height: var(--header-height);
  gap: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.site-head .brand {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.site-head .brand::before {
  display: none;
}
.site-head .brand .brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 4px 12px -4px rgba(37, 99, 235, 0.7);
}
.site-head nav a {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 13.5px;
}
.site-head nav a:hover {
  background: var(--hover-tint);
  color: var(--brand);
}
.lang {
  border-radius: 999px;
  background: #f8fafc;
}
.lang a.on {
  background: var(--brand);
  box-shadow: none;
  border-radius: 999px;
}
.site-foot {
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink-4);
  font-size: 12.5px;
}
.wrap { max-width: none; padding: 28px 22px 64px; }

/* --------------------------------------------------------------------------
   卡片
   -------------------------------------------------------------------------- */
.card {
  margin: 16px 0;
  padding: 24px;
  border: 1px solid #f1f5f9;
  border-radius: var(--radius-card);
  background: #fff;
  background-image: none;
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.aside-title {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
/* 卡片内标题：与右侧栏标题同一套字号/分隔线 */
.panel-title {
  margin: 0 0 18px;
  padding: 0 0 12px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
/* 标题图标：卡片标题与表单分组标题统一使用品牌色线性图标 */
.panel-title,
.aside-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-title > i,
.aside-title > i {
  flex: none;
  font-size: 18px;
  line-height: 1;
  color: var(--brand);
}
.fieldset legend > i {
  margin-right: 6px;
  font-size: 16px;
  vertical-align: -2px;
  color: var(--brand);
}
/* 标题放进表格卡片时，贴齐容器内边距 */
.table-scroll > .panel-title {
  margin: 0;
  padding: 16px 18px 12px;
}
.table-scroll > p.muted {
  margin: 0;
  padding: 0 18px 16px;
}
/* stack 卡片内部由 gap 控制间距，标题只补足到 18px */
.stack > .panel-title {
  margin-bottom: 2px;
}
/* 卡片标题 + 紧随说明文字：统一「标题底边 → 说明文字」22px。
   .stack 卡片的 16px 由 grid gap 提供，标题不再额外留白；非 stack 卡片由标题下边距提供 16px；
   说明文字统一 6px 上边距（16 + 6 = 22）。标题下没有说明文字的卡片不匹配，保持原样。 */
.card > .panel-title:has(+ .hint),
.card > .panel-title:has(+ .muted) {
  margin-bottom: 16px;
}
.stack > .aside-title:has(+ .hint),
.stack > .aside-title:has(+ .muted),
.stack > .panel-title:has(+ .hint),
.stack > .panel-title:has(+ .muted) {
  margin-bottom: 0;
}
.card > .aside-title + .hint,
.card > .aside-title + .muted,
.card > .panel-title + .hint,
.card > .panel-title + .muted {
  margin-top: 6px;
}

/* 定义列表 */
dt {
  margin-top: 14px;
  color: var(--ink-4);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
}
dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   按钮
   -------------------------------------------------------------------------- */
.btn {
  min-height: 40px;
  padding: 0 18px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0;
  box-shadow: 0 1px 2px rgba(15, 26, 51, 0.07), 0 3px 8px -3px rgba(15, 26, 51, 0.12);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn:hover {
  background: #fff;
  border-color: var(--brand-line);
  color: var(--brand);
  box-shadow: 0 2px 4px rgba(15, 26, 51, 0.08), 0 8px 18px -6px rgba(15, 26, 51, 0.18);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 2px rgba(15, 26, 51, 0.14), 0 1px 1px rgba(15, 26, 51, 0.05);
}
.btn.primary {
  border-color: transparent;
  background: var(--brand);
  background-image: none;
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}
.btn.primary:hover {
  background: var(--brand-ink);
  color: #fff;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.36);
  transform: translateY(-1px);
}
.btn.danger {
  border-color: var(--accent-line);
  background: #fff;
  color: var(--accent-ink);
}
.btn.danger:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
  box-shadow: 0 2px 4px rgba(15, 26, 51, 0.06), 0 8px 18px -8px rgba(226, 83, 63, 0.35);
}
.btn-sm {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 9px;
}
/* 访问统计：KPI 与每日趋势条 */
.stats-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stats-kpi {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 18px 20px;
}
.stats-kpi-label {
  color: var(--ink-3);
  font-size: 12.5px;
}
.stats-kpi-value {
  color: var(--ink);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}
.stats-bar {
  display: block;
  width: 100%;
  min-width: 120px;
  height: 8px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}
.stats-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
}
@media (max-width: 900px) {
  .stats-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .stats-kpis { grid-template-columns: minmax(0, 1fr); }
}
/* 模板下载：绿色强调，与蓝色主按钮、红色危险按钮区分 */
.btn.download {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
  box-shadow: inset 0 1px 0 #fff, 0 2px 8px rgba(22, 101, 52, 0.08);
}
.btn.download:hover {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
  box-shadow: 0 4px 14px rgba(22, 101, 52, 0.16);
  transform: translateY(-1px);
}
.template-download {
  margin: 14px 0 0;
}
.btn[disabled],
.btn[aria-disabled='true'] {
  opacity: 0.5;
  box-shadow: none;
  transform: none;
}

/* --------------------------------------------------------------------------
   表单
   -------------------------------------------------------------------------- */
label {
  margin-bottom: 7px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}
label .req,
.fieldset legend .req { color: var(--accent); }
input,
select,
textarea {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder,
textarea::placeholder { color: var(--ink-4); }
input:hover,
select:hover,
textarea:hover { background: #fff; border-color: var(--line-strong); }
input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}
textarea { min-height: 112px; line-height: 1.6; }
/* 只读字段：与输入框同高同内边距，保证同排字段的标签与控件基线一致 */
.input-static {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f6f8fb;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
}
.hint {
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.55;
}
.fieldset {
  padding: 20px 22px;
  border: 1px solid #f1f5f9;
  border-radius: var(--radius-card);
  background: #fff;
  box-shadow: none;
}
.fieldset legend {
  padding: 0 8px;
  margin-left: -4px;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0;
}
.radio-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.radio-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.radio-item:hover { border-color: #cbd5e1; background: #f8fafc; }
.radio-item input[type="radio"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  margin: 0;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.15s;
}
.radio-item input[type="radio"]:checked {
  border-color: #2563eb;
}
.radio-item input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2563eb;
}
.radio-item:has(input:checked) {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.04);
}
.case-mode-info {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.case-mode-info strong {
  color: var(--ink);
  font-weight: 600;
}
/* 文档槽位「已上传」徽标：绝对定位贴右上角，不参与布局，空槽位与已上传槽位高度一致 */
.doc-slot { position: relative; }
.doc-slot h3 { padding-right: 66px; }
.doc-slot-flag {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-ink);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
}
/* 字段说明 tooltip（参考 eagle 模板 tooltip-lg：min 200 / max 280、10×16 内边距、13px、8px 菱形箭头）
   fixed 定位，避免被卡片或滚动容器裁切；宽度受 max-width 限制，窄屏不溢出视口。 */
.label-with-tip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
}
.label-with-tip label { margin-bottom: 0; }
.field-tip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-4);
  font-size: 16px;
  line-height: 1;
  cursor: help;
}
.field-tip-btn:hover,
.field-tip-btn[aria-expanded='true'] {
  background: var(--brand-soft);
  color: var(--brand);
}
.field-tip {
  position: fixed;
  z-index: 1300;
  width: max-content;
  min-width: 200px;
  max-width: min(280px, calc(100vw - 16px));
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--canvas);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.6;
  text-align: left;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), var(--shadow-pop);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.18s;
  pointer-events: none;
}
.field-tip.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.field-tip::after {
  content: '';
  position: absolute;
  left: var(--tip-arrow-x, 50%);
  bottom: -4px;
  width: 8px;
  height: 8px;
  background: var(--ink);
  transform: translateX(-50%) rotate(45deg);
}
.field-tip.is-above::after {
  bottom: auto;
  top: -4px;
}
.field-tip.is-right::after {
  left: -4px;
  top: var(--tip-arrow-y, 50%);
  bottom: auto;
  transform: translateY(-50%) rotate(45deg);
}
/* 单选项 tooltip 放在选项组下方时，箭头朝上指向选项 */
.field-tip.arrow-top::after {
  bottom: auto;
  top: -4px;
}
.field-tip .hint {
  margin: 0;
  padding: 0;
  color: var(--line-strong);
  font-size: 12.5px;
}
.field-tip .case-mode-info {
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--canvas);
  font-size: 13px;
}
.field-tip .case-mode-info strong { color: #fff; }
@media (prefers-reduced-motion: reduce) {
  .field-tip { transition: none; }
}
/* 分步表单向导 */
.form-step { display: none; }
.form-step.active { display: block; }

.stepper {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  gap: 0;
}
.stepper-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  position: relative;
}
.stepper-item:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  margin-left: 8px;
  transition: background 0.2s;
}
.stepper-item.completed:not(:last-child)::after { background: var(--brand); }
.stepper-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #cbd5e1;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.2s;
}
.stepper-label { white-space: nowrap; }
.stepper-item.active { color: var(--ink); }
.stepper-item.active .stepper-num {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.stepper-item.completed .stepper-num {
  border-color: var(--brand);
  background: #fff;
  color: var(--brand);
}
.stepper-item.completed { color: var(--ink-2); }

.step-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}
.step-actions-right { display: flex; gap: 10px; }
/* 操作栏不在卡片内，左右补上与卡片内容相同的缩进，按钮边缘才能和字段对齐 */
.admin-editor .step-actions { padding-left: 22px; padding-right: 22px; }

.confirm-summary .confirm-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 16px;
  margin: 14px 0 0;
  font-size: 13.5px;
}
.confirm-summary dt {
  color: var(--ink-3);
  font-weight: 600;
}
.confirm-summary dd {
  margin: 0;
  color: var(--ink);
  word-break: break-all;
}
@media (max-width: 720px) {
  .stepper { flex-wrap: wrap; }
  .stepper-item { flex: 1 1 33%; }
  .stepper-item:not(:last-child)::after { display: none; }
  .confirm-summary .confirm-grid { grid-template-columns: 90px 1fr; }
}

/* 胶囊标签页（参考 Eagle Admin 富内容标签页） */
.tabs-pills {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--canvas);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}
.tabs-pills .tab-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-sm);
  margin-bottom: 0;
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-3);
  background: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--dur-fast);
  white-space: nowrap;
  font-family: var(--font-sans);
}
.tabs-pills .tab-link:hover {
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.6);
}
.tabs-pills .tab-link.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.models-tabs-card {
  padding: 12px;
  margin-bottom: 16px;
}
.models-tabs {
  background: var(--canvas);
}
/* tab 标题后的条数：与标题同一行，不换行、不撑高 */
.models-tabs .tab-link {
  white-space: nowrap;
}
.models-tabs .tab-count {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.72;
}
.models-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.models-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.models-search input {
  width: 220px;
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.models-search input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.models-search .btn {
  min-height: 36px;
  padding: 0 12px;
}
.qr-count-link {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}
.qr-count-link:hover { text-decoration: underline; }
/* 型号列表二维码格：缩略图 + 数量同格；hover / focus 放大沿用 layout.php 的 .qr-thumb 机制 */
.qr-count-unit {
  margin-left: 2px;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
}
.qr-count-none {
  color: var(--ink-4);
  font-size: 12px;
  white-space: nowrap;
}
/* 型号编码：沿用原来的加粗墨色显示，只在 hover 时给可点提示 */
.model-id .model-code-link,
.batch-no-link {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.model-id .model-code-link:hover,
.model-id .model-code-link:focus-visible,
.batch-no-link:hover,
.batch-no-link:focus-visible {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 型号列表「公开状态」开关：真实表单提交（POST + CSRF），键盘可操作；文字与开关同时表达状态 */
.col-status { white-space: nowrap; }
.status-switch-form { margin: 0; }
.status-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 9px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--ink-3);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.status-switch-track {
  position: relative;
  display: block;
  width: 30px;
  height: 16px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background .18s ease;
}
.status-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .28);
  transition: transform .18s ease;
}
.status-switch.is-on { background: #e8f7ef; border-color: #bbe8cf; color: #047857; }
.status-switch.is-on .status-switch-track { background: #10b981; }
.status-switch.is-on .status-switch-knob { transform: translateX(14px); }
.status-switch:hover { border-color: var(--brand); }
.status-switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* 召回批次：开关锁定为关，明确提示去编辑页处理 */
.status-switch.is-locked { cursor: not-allowed; opacity: .7; }
.status-switch.is-locked:hover { border-color: var(--line); }

/* 批次列表：二维码缩略图（40px）+ 悬浮/聚焦放大浮层
   类名带 batch- 前缀：.qr-thumb / .qr-preview 是 app.css + layout.php 给 batch_units.php 的
   <img class="qr-thumb"> 用的全局机制，这里不能复用，否则会同时弹出两个浮层。 */
/* 批次表：单元格统一垂直居中，行高由最高单元格（二维码 44px）决定，
   其余文字、开关、按钮都按行中线对齐，换行内容也居中而不是贴顶 */
/* 列数多，1440 下要一屏容纳：占满卡片宽度 + 左右内边距收到 14px，
   少掉约 80px 后仍保持单行不换行，窄屏继续由 .table-scroll 横向滚动 */
.batch-table { width: 100%; }
.batch-table th,
.batch-table td { vertical-align: middle; padding-left: 14px; padding-right: 14px; }
/* 操作列三个按钮挤在一行：收窄左右内边距，避免把表格撑出横向滚动 */
.batch-table .col-ops .actions { flex-wrap: nowrap; gap: 6px; }
.batch-table .col-ops .btn { padding: 0 12px; }
/* 缩略图是 inline-flex 行内元素，父级 line-height 归零去掉基线留白，避免把中线顶偏 */
.batch-table .col-qr { line-height: 0; }
/* 开关同样是行内控件：去掉表单行的基线留白后与行中线严格对齐 */
.batch-table .status-switch-form { line-height: 0; }
.batch-table .status-switch { vertical-align: middle; }

/* 打包下载：工具栏行 + 弹窗 */
.toolbar-row { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; flex-wrap: wrap; }
.toolbar-row .hint { margin: 0; }
.pkg-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.pkg-modal[hidden] { display: none; }
.pkg-modal-mask { position: absolute; inset: 0; background: rgba(15, 26, 51, 0.42); }
.pkg-modal-box {
  position: relative;
  width: min(460px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 20px 22px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-pop);
}
.pkg-modal-box h3 { margin: 0 0 4px; font-size: 16px; }
.pkg-modal-box .muted { margin: 0 0 14px; color: var(--ink-4); font-size: 13px; }
.pkg-range { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pkg-range label { font-size: 13px; color: var(--ink-4); }
.pkg-range label.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pkg-range input {
  width: 96px; min-height: 34px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--radius-ctl);
  background: var(--canvas); color: var(--ink); font-size: 14px;
}
.pkg-modal-box .hint { margin: 0 0 12px; color: var(--ink-4); font-size: 12.5px; line-height: 1.5; }
.pkg-modal-box .actions { display: flex; gap: 10px; margin-top: 14px; }
#pkg-volumes { margin: 10px 0 0; padding-left: 18px; font-size: 13px; }
#pkg-volumes li { margin: 4px 0; }
#pkg-volumes .muted { color: var(--ink-4); }

.col-qr { width: 60px; }
.col-addr { width: 104px; position: relative; }
/* 5 位流水号定宽数字，起止序列号上下对齐，不随 8/1 等字形抖动 */
.batch-table .col-serial { font-variant-numeric: tabular-nums; }
.batch-qr-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: zoom-in;
  vertical-align: middle;
}
.batch-qr-thumb img { display: block; width: 40px; height: 40px; }
.batch-qr-thumb:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.batch-qr-thumb.is-error { cursor: default; }
.batch-qr-fallback { display: none; color: var(--ink-4); font-size: 20px; line-height: 1; }
.batch-qr-thumb.is-error .batch-qr-fallback { display: block; }
.batch-qr-zoom {
  position: fixed;
  z-index: 1200;
  width: 180px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .14s ease, visibility .14s ease;
}
.batch-qr-zoom.is-open { opacity: 1; visibility: visible; }
.batch-qr-zoom img { display: block; width: 168px; height: 168px; }
@media (prefers-reduced-motion: reduce) { .batch-qr-zoom { transition: none; } }

/* 批次地址复制：成功/失败反馈 + 手动复制兜底浮层 */
.copy-addr { white-space: nowrap; }
.copy-addr.is-copied { color: #047857; border-color: #bbe8cf; background: #e8f7ef; }
.copy-addr.is-failed { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.copy-addr-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.copy-addr-manual {
  position: fixed;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 460px;
  max-width: calc(100vw - 16px);
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .16);
  font-size: 12px;
  white-space: normal;
}
.copy-addr-manual > span {
  flex: none;
  white-space: nowrap;
}
.copy-addr-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 28px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--font-mono);
}
.copy-addr-close {
  flex: none;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
  .status-switch, .status-switch-track, .status-switch-knob { transition: none; }
}

@media (max-width: 720px) {
  .models-tabs-bar { flex-direction: column; align-items: stretch; }
  .models-search input { width: 100%; }
}

.admin-editor .fieldset,
.units-status > .fieldset {
  padding: 20px 22px;
  background: #fff;
  border-color: #f1f5f9;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.admin-editor .fieldset legend,
.units-status > .fieldset > legend {
  float: left;
  width: 100%;
  margin: 0 0 16px;
  padding: 0 0 12px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.admin-editor .fieldset legend + *,
.units-status > .fieldset > legend + * {
  clear: both;
}
input[type='file'] {
  padding: 10px 12px;
  font-size: 13px;
}
input[type='checkbox'],
input[type='radio'] { accent-color: var(--brand); }
label.check {
  font-size: 13.5px;
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   提示条 / 徽标
   -------------------------------------------------------------------------- */
.notice {
  margin: 16px 0;
  padding: 14px 18px;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-card);
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 13.5px;
}
.notice::before { content: none; display: none; }
.notice.bad {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: #9f1239;
}
.notice.warn {
  border-color: var(--warn-line);
  background: var(--warn-soft);
  color: var(--warn-ink);
}
.notice.ok {
  border-color: rgba(34, 197, 94, 0.3);
  background: #f0fdf4;
  color: #15803d;
}
.badge {
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.1);
  color: var(--teal-ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1px;
}
.badge.draft {
  background: #f1f5f9;
  color: var(--ink-3);
}
.badge.recall {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.badge-info {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}
.badge-muted {
  background: #f1f5f9;
  color: var(--ink-3);
}
.badge-uploaded {
  margin-left: auto;
  height: 28px;
  padding: 0 14px;
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
  font-size: 13px;
  font-weight: 700;
}

/* 表格与筛选 */
.filters--search .actions {
  grid-column: auto;
  margin-top: 0;
}
/* 筛选条件一行铺开，按钮靠右对齐 */
.filters--right {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 16px;
}
.filters--right > div:not(.actions) {
  flex: 1 1 180px;
  min-width: 150px;
}
.filters--right .actions {
  flex: 0 0 auto;
  margin: 0 0 0 auto;
}
@media (max-width: 720px) {
  .filters--right .actions {
    width: 100%;
    margin-left: 0;
  }
}
.table-scroll {
  margin: 16px 0;
  border: 1px solid #f1f5f9;
  border-radius: var(--radius-bar);
  background: #fff;
  box-shadow: var(--shadow-card);
  /* 窄屏横向滚动：列多时不挤压列宽，也不撑破页面 */
  overflow-x: auto;
}
table { font-size: 13.5px; }
caption {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}
th, td { padding: 13px 18px; }
thead th {
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
tbody td {
  border-bottom: 1px solid #f1f5f9;
  color: var(--ink-2);
}
tbody tr:hover td { background: #f8fafc; }
td strong { color: var(--ink); }
/* 列表数据单行展示：超长内容由表格容器横向滚动，不在单元格内换行 */
.admin-body .table-scroll th,
.admin-body .table-scroll td { white-space: nowrap; }
.table-scroll .btn { border-radius: 8px; }

/* 列表卡片（公开首页） */
.list li {
  padding: 18px 20px 18px 62px;
  border: 1px solid #f1f5f9;
  border-radius: var(--radius-card);
  background: #fff;
  box-shadow: var(--shadow-card);
}
.list li::before {
  border-color: var(--brand-line);
  background: var(--brand-soft);
  color: var(--brand-ink);
  border-radius: 9px;
}
.list li a { color: var(--ink); font-weight: 700; }
.list li a:hover { color: var(--brand); }

/* 分页与进度 */
.pager .btn { border-radius: 8px; }

/* Eagle 分页条：结果数量 + 页码 + 上一页/下一页 */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin: 18px 0 0;
  padding: 14px 18px;
  border: 1px solid #f1f5f9;
  border-radius: var(--radius-card);
  background: #f8fafc;
}
.pagination-summary {
  color: var(--ink-3);
  font-size: 13.5px;
}
.pagination-summary strong {
  color: var(--ink);
  font-weight: 700;
}
.pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.pagination-link:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  text-decoration: none;
}
.pagination-link.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.pagination-link.pagination-nav {
  width: auto;
  gap: 4px;
  padding: 0 14px;
  font-size: 13px;
}
.pagination-link.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pagination-link.is-disabled:hover {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-2);
}
.pagination-ellipsis {
  padding: 0 4px;
  color: var(--ink-4);
  font-size: 14px;
}
.progress { background: #eef2f7; }
.progress > span { background-image: linear-gradient(90deg, var(--brand), #60a5fa); }

/* --------------------------------------------------------------------------
   公开页 Hero / 二维码
   -------------------------------------------------------------------------- */
.hero .badge { background: #fff; color: var(--brand-ink); }

/* --------------------------------------------------------------------------
   后台外壳：侧栏 + 顶栏 + 主区
   -------------------------------------------------------------------------- */
.admin-body {
  display: block;
  min-height: 100vh;
  background: var(--canvas);
}
.eagle-wrapper {
  display: flex;
  min-height: 100vh;
}
.eagle-sidebar {
  position: fixed;
  top: 12px;
  left: 12px;
  width: var(--sidebar-width);
  height: calc(100vh - 24px);
  z-index: 200;
  overflow: hidden auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: var(--sidebar-surface);
  box-shadow: 0 10px 32px rgba(2, 6, 23, 0.28);
  scrollbar-width: none;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.eagle-sidebar::-webkit-scrollbar { display: none; }
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--header-height);
  padding: 0 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
}
.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand-icon {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
}
.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.2px;
}
.sidebar-brand-text small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
}
.sidebar-menu { padding-bottom: 20px; }
.sidebar-menu-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 22px 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.sidebar-menu-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}
.sidebar-nav {
  margin: 0;
  padding: 0;
  list-style: none;
}
.sidebar-nav-item { margin: 1px 10px; }
.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.sidebar-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}
.sidebar-nav-link.active {
  color: #fff;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 3px 0 0 #93c5fd;
}
.sidebar-nav-link i {
  font-size: 18px;
  opacity: 0.9;
}
.sidebar-nav-link .nav-text { flex: 1; white-space: nowrap; }

.eagle-content {
  flex: 1;
  min-width: 0;
  /* 侧栏 fixed 在 left:12px，内容区让出侧栏宽度与两侧 12px 间隙，避免顶栏贴住侧栏 */
  margin-left: calc(var(--sidebar-width) + 12px);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.eagle-header {
  position: sticky;
  top: 12px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-height);
  margin: 12px 16px 0;
  padding: 0 20px;
  border: 1px solid #f1f5f9;
  border-radius: var(--radius-bar);
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-right { gap: 8px; }
.header-page {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.header-page-label {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.1px;
}
.header-page-sub {
  margin-top: 2px;
  color: var(--ink-4);
  font-size: 11.5px;
  letter-spacing: 0.3px;
}
.sidebar-toggle {
  display: none;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-2);
  font-size: 18px;
  cursor: pointer;
}
.sidebar-toggle:hover {
  border-color: var(--brand-line);
  color: var(--brand);
  background: var(--brand-soft);
}
.eagle-main {
  flex: 1;
  width: 100%;
  /* 宽屏下不再限制最大宽度，内容随窗口自适应 */
  max-width: none;
  margin: 0 auto;
  padding: 28px 30px 56px;
}
.eagle-wide { max-width: none; }
.eagle-footer {
  padding: 18px 30px 26px;
  color: var(--ink-4);
  font-size: 12px;
  text-align: center;
}
.eagle-footer p { margin: 0; }
.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(15, 23, 42, 0.45);
}

/* 后台页头与分栏编辑区在侧栏布局下的尺寸 */
.admin-head {
  margin: 0 0 22px;
  gap: 14px 24px;
}
.admin-head h1 { font-size: 24px; font-weight: 800; }
.admin-head > div > p { font-size: 13.5px; color: var(--ink-3); }
.admin-editor {
  gap: 24px;
  margin-top: 0;
}
.admin-editor-main {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}
.editor-aside { grid-column: 2; }
.editor-aside { top: 96px; }

/* 系统设置：左侧分区导航 + 右侧卡片内容（参考 eagle settings 版式） */
.settings-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.settings-nav { position: sticky; top: 96px; }
.settings-nav-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #f1f5f9;
  border-radius: var(--radius-card);
  background: #fff;
  box-shadow: var(--shadow-card);
}
.settings-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.settings-nav-link > i { flex: none; font-size: 18px; color: var(--ink-3); }
.settings-nav-link:hover { background: var(--canvas); color: var(--ink); }
.settings-nav-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.settings-nav-link.active > i { color: var(--brand); }
.settings-nav-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.settings-panels {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.settings-panels .settings-card {
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.settings-panels .settings-panel[hidden] { display: none; }
.settings-card-head {
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
}
.settings-card-head .settings-card-title { margin: 0 0 6px; }
.settings-card-sub {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.65;
}
.settings-card-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 24px;
}
.settings-card-foot {
  display: flex;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
  background: #fafbfd;
}
.settings-card-foot .btn { display: inline-flex; align-items: center; gap: 6px; }

/* 设置项开关：登录安全等布尔选项 */
.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.toggle-row input[type='checkbox'] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--brand);
}
.toggle-row label { font-weight: 600; color: var(--ink); cursor: pointer; }
.toggle-row .hint { margin-top: 4px; }
.settings-panels .settings-group {
  padding-top: 0;
  border-top: 0;
}
.settings-panels .settings-group + .settings-group {
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}
.settings-panels .settings-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
}
#group-site,
#settings-translator,
#settings-password { scroll-margin-top: 96px; }
@media (max-width: 1023px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; }
  .settings-nav-card {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px;
    scrollbar-width: none;
  }
  .settings-nav-card::-webkit-scrollbar { display: none; }
  .settings-nav-link { flex: none; width: auto; white-space: nowrap; padding: 8px 12px; }
}
@media (max-width: 640px) {
  .settings-card-head,
  .settings-card-body,
  .settings-card-foot { padding-left: 16px; padding-right: 16px; }
}

/* Accordion 可折叠卡片 */
.accordion { padding: 0; overflow: hidden; }
.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  transition: background var(--dur-fast);
}
.accordion-header:hover { background: var(--canvas); }
.accordion-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.accordion-title > i { color: var(--brand); font-size: 18px; }
.accordion-sub {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ink-3);
  margin-left: 4px;
}
.accordion-chevron {
  font-size: 20px;
  color: var(--ink-3);
  transition: transform var(--dur-base);
  flex-shrink: 0;
}
.accordion.collapsed .accordion-chevron { transform: rotate(-90deg); }
.accordion-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows var(--dur-base) ease;
  padding: 0 20px 20px;
}
.accordion-body > * { overflow: hidden; }
.accordion.collapsed .accordion-body { grid-template-rows: 0fr; }
.accordion-body > .card-subtitle { margin-bottom: 14px; }
.accordion-body .doc-assets { padding-top: 4px; }
@media (min-width: 1024px) {
  .eagle-main .editor-aside { top: 96px; }
}

/* --------------------------------------------------------------------------
   登录页
   -------------------------------------------------------------------------- */
.auth-body {
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(37, 99, 235, 0.06), transparent 60%),
    var(--canvas);
}
.auth-body .site-head,
.auth-body .site-foot { display: none; }
.auth-body .wrap {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px 20px;
}
.auth-body .auth-shell { margin: 0; }
.auth-shell {
  width: 100%;
  max-width: 420px;
  margin: 8vh auto 0;
}
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
}
.auth-mark {
  height: 44px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
}
.auth-brand-text {
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.auth-shell .notice { margin: 0 0 16px; }
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: none;
  margin: 0;
  padding: 32px 28px;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -12px rgba(15, 23, 42, 0.12);
}
.login-form .field {
  position: relative;
}
.login-form .field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 20px;
  height: 20px;
  color: var(--ink-3);
  transform: translateY(-50%);
  pointer-events: none;
}
.login-form .field input {
  min-height: 46px;
  padding-left: 46px;
}
.login-form .btn {
  display: flex;
  width: 100%;
  min-height: 46px;
  font-size: 15px;
}

/* 登录验证码：图片 + 输入框 + 换一张；窄屏自动堆叠，不出现横向滚动 */
.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.captcha-img {
  flex: 0 0 auto;
  width: 150px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.captcha-row input {
  flex: 1 1 96px;
  min-width: 0;
  min-height: 52px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.login-form .captcha-refresh {
  width: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 14px;
  white-space: nowrap;
}
@media (max-width: 460px) {
  .captcha-row { flex-wrap: wrap; }
  .captcha-img { flex: 0 0 auto; width: 150px; max-width: 100%; }
  .captcha-row input { flex: 1 1 100%; }
  .login-form .captcha-refresh { flex: 1 1 100%; width: 100%; }
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .eagle-sidebar {
    top: 0;
    left: 0;
    height: 100vh;
    border-radius: 0 16px 16px 0;
    transform: translateX(-108%);
  }
  body.sidebar-open .eagle-sidebar { transform: translateX(0); }
  .eagle-content { margin-left: 0; }
  .eagle-header { margin: 8px 10px 0; top: 8px; }
  .sidebar-toggle { display: grid; }
  .eagle-main { padding: 20px 16px 44px; }
  .editor-aside { top: auto; grid-column: auto; }
  .admin-editor-main { grid-column: auto; }
  .header-page-sub { display: none; }
}

/* --------------------------------------------------------------------------
   仪表盘
   -------------------------------------------------------------------------- */
.dash { display: flex; flex-direction: column; gap: 18px; }
.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.dash-title { margin: 0; font-size: 22px; font-weight: 800; color: var(--ink); }
.dash-sub { margin: 4px 0 0; font-size: 13px; color: var(--ink-4); }
.dash-head-actions { display: flex; gap: 8px; }

.dash-kpi {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.dash-kpi:hover { transform: translateY(-2px); text-decoration: none; }
.dash-kpi-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  font-size: 20px;
  margin-bottom: 4px;
}

.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}
.dash-card { padding: 22px; }
.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.dash-card-head h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.dash-link { font-size: 13px; color: #2563eb; text-decoration: none; }
.dash-link:hover { text-decoration: underline; }

.dash-legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-4); }
.dash-legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: middle;
}
.dash-legend .dot.pv { background: #2563eb; }
.dash-legend .dot.uv { background: #bbd800; }

.dash-chart {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 160px;
  padding-top: 10px;
}
.dash-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.dash-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
}
.dash-bar {
  width: 12px;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height 0.3s ease;
}
.dash-bar.pv { background: #2563eb; }
.dash-bar.uv { background: #bbd800; }
.dash-col-label { font-size: 11px; color: var(--ink-4); }

.dash-today {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dash-today-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border-radius: 12px;
  background: #f8fafc;
}
.dash-today-value { font-size: 30px; font-weight: 800; color: var(--ink); line-height: 1; }
.dash-today-label { font-size: 13px; color: var(--ink-4); }

@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-kpi-icon { width: 36px; height: 36px; font-size: 18px; }
  .dash-bar { width: 10px; }
}
@media (max-width: 720px) {
  .eagle-header {
    height: auto;
    min-height: 58px;
    padding: 10px 12px;
    gap: 8px;
  }
  .header-right .btn { min-height: 32px; padding: 0 10px; font-size: 12.5px; }
  .header-page-label { font-size: 13.5px; }
  .eagle-main { padding: 16px 12px 40px; }
  .card { padding: 18px; }
  .fieldset { padding: 16px 16px 18px; }
  .admin-head h1 { font-size: 21px; }
  /* 窄屏下搜索框与按钮改为上下两行，避免按钮被挤出视口 */
  .filters--search .actions { grid-column: auto; }
}

/* --------------------------------------------------------------------------
   发布前预览（仅后台）：顶部提示 + 预览附加信息面板
   -------------------------------------------------------------------------- */
.pp-preview {
  /* 与下方正文之间保持站点统一的分区间距（正文卡片间距 24px） */
  margin: 0 0 24px;
  padding: 18px 20px;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: 12px;
  background: #fffbeb;
}
.pp-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.pp-preview-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: #92400e;
}
.pp-preview-head h2 > i { color: #d97706; font-size: 18px; }
.pp-preview-head p {
  margin: 0 0 6px;
  color: #78350f;
  font-size: 13px;
}
.pp-preview-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pp-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pp-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.pp-preview-block {
  padding: 14px 16px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fff;
}
.pp-preview-block--wide { grid-column: 1 / -1; }
.pp-preview-block h3 {
  margin: 0 0 10px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--glass-edge);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.pp-preview-qr {
  display: block;
  width: 180px;
  height: 180px;
  margin: 0 auto 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
/* 二维码与地址并排，避免整块面板里 180px 图独占一行 */
.pp-preview-qr-row { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.pp-preview-qr-row .pp-preview-qr { flex: none; margin: 0; }
.pp-preview-qr-row .pp-preview-kv { flex: 1 1 240px; }
/* 逐条表里的每条二维码：缩略图 + 查看 / 下载 */
.pp-preview-qr-cell { display: flex; align-items: center; gap: 8px; }
.pp-preview-qr-cell > span { display: flex; flex-direction: column; gap: 2px; }
.pp-preview-qr-mini {
  display: block;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
/* 生成失败时用同尺寸占位，避免把逐条表行高顶开 */
.pp-preview-qr-mini-fallback {
  display: none;
  flex: none;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink-4);
  font-size: 24px;
  line-height: 1;
}
.pp-preview-qr-cell.is-error .pp-preview-qr-mini-fallback { display: inline-flex; }
/* 预览面板里的四项批次指标：与二维码块分开成组，紧凑排列 */
.pp-preview-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 8px;
}
.pp-preview-stats > div {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.pp-preview-stats dt { margin: 0 0 2px; color: var(--ink-4); font-size: 11.5px; line-height: 1.4; }
.pp-preview-stats dd { margin: 0; color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1.4; }
/* 型号指标 5 格：宽屏一行五格，窄屏按 150px 自动折行 */
.pp-preview-stats--model { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pp-preview-kv { display: grid; gap: 6px; margin: 0; }
.pp-preview-kv > div { display: flex; gap: 8px; align-items: baseline; }
.pp-preview-kv dt { margin: 0; flex: none; color: var(--ink-4); font-size: 12px; }
.pp-preview-kv dd {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  word-break: break-all;
}
.pp-preview-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.pp-preview-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
}
.pp-preview-key { flex: none; min-width: 116px; color: var(--ink-3); }
.pp-preview-val { color: var(--ink); font-weight: 600; }
.pp-preview-table { overflow-x: auto; }
.pp-preview-table table { min-width: 520px; }
.pp-preview-table th,
.pp-preview-table td {
  padding: 8px 10px;
  font-size: 12.5px;
  white-space: nowrap;
}
.pp-preview-table th { font-size: 11.5px; }
.pp-preview-foot {
  margin: 12px 0 0;
  color: #92400e;
  font-size: 12px;
}
/* 预览里的空值占位：统一灰底虚线，避免看成真实数据 */
.pp-preview-empty {
  display: inline-block;
  padding: 1px 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--ink-4);
  font-size: 11.5px;
  font-weight: 500;
}
.pp-preview-empty--inline { margin: 0 4px; }
/* 卡片正文里的空值占位：块级，允许换行，避免溢出窄栏 */
.pp-media-body .pp-preview-empty {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  line-height: 1.5;
  white-space: normal;
  text-align: center;
}
@media (max-width: 900px) {
  .pp-preview-grid { grid-template-columns: minmax(0, 1fr); }
  .pp-preview-block--wide { grid-column: auto; }
}

/* --------------------------------------------------------------------------
   后台账号：顶栏当前用户、用户管理、只读权限、锁屏页
   -------------------------------------------------------------------------- */
.header-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 200px;
  padding: 0 10px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
}
.header-user i { color: var(--ink-3); font-size: 14px; }
.header-role {
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
}

.settings-user-add { display: flex; flex-direction: column; gap: 14px; }
.settings-user-add .row3 { margin: 0; }
.settings-user-add select { width: 100%; }
.settings-users-table td { vertical-align: middle; white-space: nowrap; }
.settings-users-table .badge + .badge { margin-left: 4px; }
.settings-user-row { display: inline-flex; align-items: center; gap: 6px; }
.settings-user-row select {
  width: auto;
  min-width: 110px;
  min-height: 32px;
  padding: 0 8px;
  font-size: 12.5px;
}
.settings-user-row input[type="password"] {
  width: 132px;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12.5px;
}
.settings-users-table .muted { font-size: 12px; }

/* 只读账号：写操作入口隐藏（后端同样按路由拒绝，隐藏只是减少误点） */
body.role-readonly form[method="post"]:not(.allow-readonly):not([action$="/admin/logout"]):not([action$="/admin/lock"]):not([action*="/units/export"]) {
  display: none !important;
}
body.role-readonly a[href*="/admin/models/new"],
body.role-readonly a[href*="/batches/new"],
body.role-readonly a[href*="/edit"],
body.role-readonly a[href*="/admin/import"] {
  display: none !important;
}

/* 锁屏页：复用登录卡片与输入框，只补说明文字与只读账号输入 */
.lock-sub {
  margin: -6px 0 0;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}
.lock-hint {
  margin: 0;
  color: var(--ink-4);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}
.login-form .field input[readonly] {
  background: #f8fafc;
  color: var(--ink-2);
  cursor: default;
}
@media (max-width: 720px) {
  .header-user { max-width: 120px; }
  .header-user i { display: none; }
}
.settings-row-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.settings-users-table th,
.settings-users-table td { padding-left: 10px; padding-right: 10px; }
.settings-users-table { font-size: 13px; }
.settings-users-table th,
.settings-users-table td { padding-left: 8px; padding-right: 8px; }
.settings-user-row input[type="password"] { width: 122px; }
.settings-scroll-hint { display: none; }
@media (max-width: 640px) {
  .settings-scroll-hint { display: block; }
  .settings-users-table th:nth-child(3),
  .settings-users-table td:nth-child(3),
  .settings-users-table th:nth-child(4),
  .settings-users-table td:nth-child(4) { display: none; }
}
@media (max-width: 520px) {
  .header-page { display: none; }
  .header-right { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .header-right .btn { padding: 0 8px; }
  .header-user { max-width: 88px; overflow: hidden; text-overflow: ellipsis; display: inline-flex; }
}
