/* ============================================================
   智云名片 · 管理后台样式
   设计基线：docs/design/design_handoff_admin_backoffice
   ============================================================ */

:root {
  color-scheme: light;

  /* 品牌 */
  --brand: #4a5ac2;
  --brand-strong: #3d4cae;
  --brand-bright: #5b6bd8;
  --brand-soft: #eef0fc;
  --brand-ring: rgba(74, 90, 194, 0.16);

  /* 中性 */
  --page: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #111827;
  --text-secondary: #374151;
  --muted: #667085;
  --faint: #9aa1af;
  --line: #e5e7eb;
  --neutral-soft: #f1f2f4;

  /* 状态 */
  --success: #16a34a;
  --success-text: #16803c;
  --success-soft: #e7f7ed;
  --warning: #d97706;
  --warning-text: #b45309;
  --warning-soft: #fef3e2;
  --danger: #dc2626;
  --danger-text: #c0272b;
  --danger-soft: #fdecec;

  /* 结构 */
  --radius-control: 6px;
  --radius-card: 8px;
  --radius-modal: 10px;
  --shadow-float: 0 12px 32px rgba(16, 24, 40, 0.12);
  --shadow-lift: 0 4px 14px rgba(16, 24, 40, 0.08);
  --shadow-brand: 0 8px 20px rgba(74, 90, 194, 0.35);

  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

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

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

* {
  scrollbar-width: thin;
  scrollbar-color: #d4d7de transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: #d4d7de;
}

*::-webkit-scrollbar-thumb:hover {
  background: #b8bdc9;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  min-height: 36px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-control);
  padding: 8px 16px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

button:hover {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
}

button:active {
  transform: scale(0.985);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-ring);
  border-color: var(--brand);
}

button.secondary,
button.ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text-secondary);
  font-weight: 500;
}

button.secondary:hover,
button.ghost:hover {
  border-color: #d4d7de;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

button.ghost {
  border-color: transparent;
}

button.danger-lite {
  border-color: #f3c2c4;
  background: var(--surface);
  color: var(--danger-text);
  font-weight: 500;
}

button.danger-lite:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger-text);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 8px 11px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #d4d7de;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

input[type="checkbox"] {
  width: auto;
  min-height: auto;
  accent-color: var(--brand);
  cursor: pointer;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--neutral-soft);
  color: var(--muted);
  cursor: not-allowed;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
}

h2 {
  font-size: 22px;
  line-height: 1.35;
  font-weight: 700;
}

h3 {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

tbody tr {
  transition: background 0.12s ease;
}

tbody tr:hover {
  background: var(--surface-soft);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td .status-chip {
  white-space: nowrap;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.hidden {
  display: none !important;
}

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

.login-shell {
  min-height: 100vh;
  display: flex;
  overflow: hidden;
  background: #070b1f;
}

/* 左侧视觉区 */

.login-visual {
  position: relative;
  flex: 1.15;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(1200px 760px at 18% -10%, #141c4a 0%, transparent 55%),
    linear-gradient(158deg, #070b1f 0%, #0b1030 55%, #070b1f 100%);
}

.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  will-change: transform, opacity;
}

.aurora-a {
  width: 620px;
  height: 620px;
  top: -180px;
  left: -120px;
  background: radial-gradient(circle, rgba(91, 107, 216, 0.55), transparent 65%);
  animation: auroraA 15s ease-in-out infinite alternate;
}

.aurora-b {
  width: 520px;
  height: 520px;
  right: -100px;
  bottom: -140px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.34), transparent 65%);
  animation: auroraB 19s ease-in-out infinite alternate;
}

.aurora-c {
  width: 460px;
  height: 460px;
  top: 34%;
  left: 42%;
  background: radial-gradient(circle, rgba(124, 92, 246, 0.3), transparent 65%);
  animation: auroraC 23s ease-in-out infinite alternate;
}

.login-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 216, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 216, 0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 45% 45%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 45% 45%, #000 30%, transparent 75%);
  pointer-events: none;
}

.login-particles span {
  position: absolute;
  bottom: -12px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(154, 171, 238, 0.85);
  box-shadow: 0 0 8px rgba(154, 171, 238, 0.6);
  opacity: 0;
  animation: particleRise 12s linear infinite;
}

.login-particles span:nth-child(1) { left: 8%; animation-delay: 0s; animation-duration: 11s; }
.login-particles span:nth-child(2) { left: 17%; animation-delay: 2.4s; animation-duration: 14s; }
.login-particles span:nth-child(3) { left: 26%; animation-delay: 5.1s; animation-duration: 10s; }
.login-particles span:nth-child(4) { left: 35%; animation-delay: 1.2s; animation-duration: 13s; }
.login-particles span:nth-child(5) { left: 47%; animation-delay: 7s; animation-duration: 12s; }
.login-particles span:nth-child(6) { left: 58%; animation-delay: 3.3s; animation-duration: 15s; }
.login-particles span:nth-child(7) { left: 67%; animation-delay: 8.6s; animation-duration: 11s; }
.login-particles span:nth-child(8) { left: 76%; animation-delay: 4.5s; animation-duration: 13s; }
.login-particles span:nth-child(9) { left: 85%; animation-delay: 6.2s; animation-duration: 10s; }
.login-particles span:nth-child(10) { left: 93%; animation-delay: 9.4s; animation-duration: 14s; }

.login-visual-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 46px 58px 50px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.login-brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(91, 107, 216, 0.5));
}

.login-hero {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 0;
  perspective: 1100px;
}

.glass-card-wrap {
  position: relative;
  isolation: isolate;
  animation: cardFloat 7s ease-in-out infinite;
  transform-style: preserve-3d;
}

.glass-card-wrap::before {
  content: "";
  position: absolute;
  inset: -72px -84px -68px;
  z-index: -1;
  border-radius: 38px;
  background: radial-gradient(circle at 50% 50%, rgba(74, 90, 194, 0.42), rgba(74, 90, 194, 0.18) 34%, transparent 72%);
  filter: blur(40px);
  opacity: 0.92;
  pointer-events: none;
}

.orbit {
  position: absolute;
  border: 1px dashed rgba(154, 171, 238, 0.22);
  border-radius: 50%;
  pointer-events: none;
}

.orbit::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.9);
}

.orbit-a {
  width: 480px;
  height: 480px;
  animation: orbitSpin 36s linear infinite;
}

.orbit-b {
  width: 620px;
  height: 620px;
  border-color: rgba(154, 171, 238, 0.12);
  animation: orbitSpin 55s linear infinite reverse;
}

.orbit-b::before {
  background: #8a9de6;
  box-shadow: 0 0 10px rgba(138, 157, 230, 0.9);
}

.glass-card {
  width: 452px;
  max-width: 88%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 22px;
  padding: 28px 30px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow:
    0 30px 70px rgba(3, 7, 26, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: #fff;
  transition: transform 0.2s ease-out;
  transform-style: preserve-3d;
  will-change: transform;
}

.gc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.gc-logo {
  position: relative;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  background: linear-gradient(135deg, #6675de, #3d4cae);
  box-shadow: 0 8px 18px rgba(74, 90, 194, 0.5);
}

.gc-logo::after {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
}

.gc-brand {
  flex: 1;
  min-width: 0;
}

.gc-brand strong,
.gc-brand small {
  display: block;
}

.gc-brand strong {
  font-size: 15px;
  letter-spacing: 0.5px;
}

.gc-brand small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  letter-spacing: 1.6px;
}

.gc-status {
  flex: none;
  padding: 4px 9px;
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
  font-size: 11px;
}

.gc-person {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
}

.gc-avatar {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #6675de, #414fb2);
  box-shadow: 0 10px 22px rgba(65, 79, 178, 0.55);
  font-size: 20px;
  font-weight: 700;
}

.gc-person strong,
.gc-person small {
  display: block;
}

.gc-person strong {
  font-size: 18px;
  letter-spacing: 0.5px;
}

.gc-person small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.gc-lines {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  letter-spacing: 0.4px;
}

.gc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}

.gc-chip {
  padding: 5px 10px;
  border: 1px solid rgba(138, 157, 230, 0.35);
  border-radius: 8px;
  background: rgba(91, 107, 216, 0.22);
  color: #c3cef3;
  font-size: 11px;
}

.gc-qr {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.9) 50%, transparent 50%) 0 0 / 10px 10px,
    linear-gradient(rgba(255, 255, 255, 0.9) 50%, transparent 50%) 0 0 / 10px 10px,
    rgba(255, 255, 255, 0.12);
  opacity: 0.9;
}

.hero-chip {
  position: absolute;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(13, 19, 56, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 30px rgba(3, 7, 26, 0.45);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.hero-chip::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.9);
  vertical-align: 1px;
}

.chip-a { top: 10%; left: 4%; animation: chipFloat 6s ease-in-out infinite; }
.chip-b { top: 18%; right: 4%; animation: chipFloat 7.5s ease-in-out 0.8s infinite; }
.chip-c { bottom: 15%; left: 10%; animation: chipFloat 6.8s ease-in-out 1.6s infinite; }

.login-tagline {
  max-width: 560px;
}

.login-tagline strong {
  display: block;
  color: #fff;
  font-size: 29px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.5px;
}

.login-tagline em {
  font-style: normal;
  background: linear-gradient(92deg, #8a9de6 0%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 右侧表单区 */

.login-form-panel {
  flex: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px;
  background:
    linear-gradient(180deg, rgba(74, 90, 194, 0.08) 0%, rgba(74, 90, 194, 0.02) 22%, transparent 22%),
    repeating-linear-gradient(135deg, rgba(17, 24, 39, 0.03) 0 1px, transparent 1px 18px),
    var(--page);
  overflow-y: auto;
}

.login-form {
  position: relative;
  width: min(440px, 100%);
  padding: 28px 28px 24px;
  border: 1px solid rgba(230, 234, 242, 0.95);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(249, 251, 255, 0.965));
  box-shadow:
    0 32px 84px rgba(16, 24, 40, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  overflow: hidden;
  animation: fadeUp 0.5s ease both;
}

.login-form::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #4a5ac2 0%, #2f6fed 52%, #22d3ee 100%);
}

.login-form > * {
  animation: fadeUp 0.45s ease both;
}

.login-form > *:nth-child(1) { animation-delay: 0.05s; }
.login-form > *:nth-child(2) { animation-delay: 0.1s; }
.login-form > *:nth-child(3) { animation-delay: 0.15s; }
.login-form > *:nth-child(4) { animation-delay: 0.2s; }
.login-form > *:nth-child(5) { animation-delay: 0.25s; }
.login-form > *:nth-child(6) { animation-delay: 0.3s; }
.login-form > *:nth-child(7) { animation-delay: 0.35s; }
.login-form > *:nth-child(8) { animation-delay: 0.4s; }
.login-form > *:nth-child(9) { animation-delay: 0.45s; }

.login-panel-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  padding-top: 4px;
}

.login-panel-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.login-panel-brand img {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  box-shadow: 0 10px 18px rgba(74, 90, 194, 0.18);
}

.login-panel-brand strong,
.login-panel-brand small {
  display: block;
}

.login-panel-brand strong {
  font-size: 15px;
  font-weight: 700;
}

.login-panel-brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.login-form > h1 {
  margin-bottom: 4px;
  font-size: 24px;
  font-weight: 700;
}

.login-sub {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}

.login-role-tabs {
  position: relative;
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid rgba(228, 233, 242, 0.96);
  border-radius: 999px;
  background: rgba(239, 242, 247, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.login-role-slider {
  position: absolute;
  inset: 4px auto 4px 4px;
  width: calc((100% - 12px) / 2);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 252, 0.98));
  box-shadow:
    0 10px 24px rgba(16, 24, 40, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.login-role-tabs[data-active-role="platform"] .login-role-slider {
  transform: translateX(calc(100% + 4px));
}

.login-role-tabs button {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 58px;
  border: 0;
  border-radius: 999px;
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-role-tabs button span {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.login-role-tabs button small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.login-role-tabs button:hover {
  color: var(--text);
  transform: none;
}

.login-role-tabs button.active {
  color: var(--brand-strong);
  transform: none;
}

.login-role-tabs button.active small {
  color: rgba(74, 90, 194, 0.76);
}

.login-scan-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 0;
  padding: 0 2px 8px;
  border-bottom: 1px solid rgba(228, 233, 242, 0.9);
  background: transparent;
}

.login-section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 10px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.login-scan-section {
  display: grid;
  gap: 14px;
  margin-top: 2px;
  padding-top: 2px;
}

.login-scan-tabs button {
  position: relative;
  flex: 1;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0 0 12px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: color 0.25s ease, transform 0.25s ease;
}

.login-scan-tabs button::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: -1px;
  left: 22px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-bright));
  opacity: 0;
  transform: scaleX(0.25);
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.login-scan-tabs button span {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.login-scan-tabs button small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.login-scan-tabs button:hover {
  color: var(--text);
  transform: none;
}

.login-scan-tabs button.active {
  color: var(--brand-strong);
  transform: none;
}

.login-scan-tabs button.active::after {
  opacity: 1;
  transform: scaleX(1);
}

.login-scan-tabs button.active small {
  color: rgba(74, 90, 194, 0.72);
}

.login-form .stack-form {
  gap: 14px;
  margin-top: 2px;
  padding: 16px;
  border: 1px solid rgba(232, 237, 245, 0.95);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(252, 253, 255, 0.98), rgba(248, 250, 255, 0.96));
}

.login-form label,
.stack-form label,
.confirm-dialog label {
  display: grid;
  gap: 6px;
}

.login-form input {
  min-height: 42px;
  border-radius: 10px;
  font-size: 14px;
}

label span,
.hint,
.page-head p,
.panel-head p,
.status-strip span {
  color: var(--muted);
  font-size: 12px;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  color: var(--faint);
  transition: background 0.15s ease, color 0.15s ease;
}

.password-toggle:hover {
  background: var(--neutral-soft);
  color: var(--brand);
}

.password-toggle:active {
  transform: translateY(-50%);
}

.login-form.has-error input,
.login-form.has-error .password-field input {
  border-color: var(--danger);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.remember-box {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
}

.remember-box:hover {
  color: var(--text-secondary);
  background: transparent;
}

.remember-check {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid #d8dbe2;
  border-radius: 4px;
  background: var(--surface);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.remember-box[aria-pressed="true"] .remember-check {
  border-color: var(--brand);
  background: var(--brand);
  transform: scale(1.05);
}

.remember-box[aria-pressed="true"] .remember-check::before {
  content: "✓";
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}

.login-submit {
  position: relative;
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(135deg, var(--brand-bright), var(--brand));
  box-shadow: var(--shadow-brand);
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.login-submit::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 55%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-18deg);
  transition: left 0.55s ease;
}

.login-submit:hover {
  border: 0;
  box-shadow: 0 12px 28px rgba(74, 90, 194, 0.45);
  transform: translateY(-1px);
}

.login-submit:hover::after {
  left: 130%;
}

.login-submit:active {
  transform: translateY(0);
}

.login-submit:disabled {
  opacity: 0.85;
  cursor: wait;
  transform: none;
}

.login-spinner {
  display: none;
  width: 15px;
  height: 15px;
  margin-right: 8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: -3px;
  animation: spin 0.8s linear infinite;
}

.login-submit:disabled .login-spinner {
  display: inline-block;
}

.login-scan-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(250, 252, 255, 0.965));
  box-shadow:
    0 16px 40px -10px rgba(0, 0, 0, 0.06),
    0 0 1px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.login-scan-card button {
  width: 100%;
  min-height: 42px;
}

.login-scan-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
}

.login-scan-card #gateLocalScanHint {
  text-align: center;
}

.login-scan-copy {
  margin: 0;
}

.login-scan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.login-scan-head strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.login-scan-head p {
  margin: 4px 0 0;
}

.login-scan-badge {
  flex: none;
  padding: 4px 8px;
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.05);
  color: #2f8d4a;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.login-scan-badge.alt {
  border-color: rgba(74, 90, 194, 0.18);
  background: rgba(74, 90, 194, 0.05);
  color: var(--brand-strong);
}

.login-qr-shell {
  display: grid;
  place-items: center;
  padding: 20px;
  border: 1px solid rgba(227, 232, 243, 0.9);
  border-radius: 18px;
  background: linear-gradient(180deg, #f9fbff, #eef2ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.login-scan-card img {
  display: block;
  width: min(208px, 56vw);
  height: auto;
  margin: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(43, 57, 112, 0.14);
}

.login-scan-card img.hidden {
  display: none;
}

.login-scan-refresh {
  min-height: 44px;
}

.login-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #edf1f7;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
}

/* ---------- 登录页：扫码框精确稿 ---------- */

.login-form {
  position: relative;
  width: min(502px, 100%);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  animation: none;
}

.login-form::before {
  content: none;
}

.login-form > * {
  animation: none;
}

.login-panel-top {
  position: absolute;
  top: 9px;
  right: 0;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
}

.login-panel-brand {
  display: none;
}

.login-panel-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 13px 5px 12px;
  border: 0;
  border-radius: 999px;
  background: #edf0ff;
  color: #4f63d8;
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
}

.login-panel-chip::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.login-form > h1 {
  padding-top: 4px;
  margin: 0 126px 5px 0;
  color: #172033;
  font-size: 29px;
  font-weight: 800;
  line-height: 40px;
}

.login-sub {
  margin: 0 0 29px;
  color: #6f7788;
  font-size: 15px;
  line-height: 22px;
}

.login-section-label {
  display: block;
  margin: 0 0 12px;
  color: #9aa2b1;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 20px;
  text-transform: none;
}

.login-section-label::after {
  content: none;
}

.login-role-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  height: 72px;
  margin: 0 0 36px;
  padding: 4px;
  border-radius: 13px;
  background: #e9ebf1;
}

.login-role-tabs button {
  min-height: 64px;
  border: 0;
  border-radius: 9px;
  padding: 12px 14px 11px;
  background: transparent;
  color: #667085;
  text-align: center;
  box-shadow: none;
  transform: none;
}

.login-role-tabs button span {
  color: #5f687a;
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
}

.login-role-tabs button small {
  margin-top: 2px;
  color: #7b8495;
  font-size: 13px;
  line-height: 18px;
}

.login-role-tabs button.active {
  background: #ffffff;
  color: #171f2f;
  box-shadow: 0 2px 6px rgba(20, 27, 42, 0.12);
  transform: none;
}

.login-role-tabs button.active span {
  color: #171f2f;
}

.login-role-tabs button.active small {
  color: #5f687a;
}

.login-section-label + .login-scan-section {
  margin-top: -44px;
}

.login-scan-section {
  display: grid;
  gap: 12px;
  padding: 0;
}

.login-scan-tabs {
  justify-self: end;
  display: flex;
  gap: 8px;
  height: 34px;
  margin: 0 0 0 auto;
  padding: 0;
  background: transparent;
}

.login-scan-tabs button {
  min-height: 34px;
  border: 1px solid #dfe3ea;
  border-radius: 999px;
  padding: 6px 14px;
  background: #ffffff;
  color: #687184;
  text-align: center;
  box-shadow: none;
  transform: none;
}

.login-scan-tabs button span {
  color: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 20px;
}

.login-scan-tabs button small {
  display: none;
}

.login-scan-tabs button.active {
  border-color: #c9d2ff;
  background: #f0f2ff;
  color: #4f63d8;
  box-shadow: none;
  transform: none;
}

.login-scan-card {
  gap: 0;
  min-height: 448px;
  padding: 24px 25px;
  border: 1px solid #e3e7ee;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(31, 41, 55, 0.04);
}

.login-scan-head {
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 15px;
}

.login-scan-head strong {
  color: #151c2c;
  font-size: 17px;
  font-weight: 800;
  line-height: 24px;
}

.login-scan-head p {
  margin: 4px 0 0;
  color: #687286;
  font-size: 14px;
  line-height: 20px;
}

.login-scan-badge {
  margin-top: 1px;
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: #e8f9ef;
  color: #12a957;
  font-size: 13px;
  font-weight: 800;
  line-height: 18px;
}

.login-scan-badge.alt {
  background: #eef0ff;
  color: #4f63d8;
}

.wecom-auth-panel {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 248px;
  margin: 2px 0 18px;
  padding: 30px 28px;
  border: 1px solid #e4e8f0;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(239, 242, 255, 0.72), rgba(255, 255, 255, 0.96)),
    #ffffff;
  text-align: center;
}

.wecom-auth-mark {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #25c76f, #16a85d);
  box-shadow: 0 14px 28px rgba(22, 168, 93, 0.18);
}

.wecom-auth-mark::before,
.wecom-auth-mark::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: #ffffff;
}

.wecom-auth-mark::before {
  width: 34px;
  height: 24px;
  left: 14px;
  top: 18px;
}

.wecom-auth-mark::after {
  width: 11px;
  height: 11px;
  left: 38px;
  top: 35px;
  box-shadow: -20px -10px 0 -3px #16a85d, -8px -10px 0 -3px #16a85d;
  transform: rotate(45deg);
}

.wecom-auth-panel strong {
  color: #151c2c;
  font-size: 16px;
  font-weight: 800;
  line-height: 24px;
}

.wecom-auth-panel p {
  max-width: 324px;
  margin-top: 8px;
  color: #687286;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
}

.wecom-scan-submit {
  min-height: 51px;
  border-color: #d9def8;
  background: #f2f4ff;
  color: #4f63d8;
  font-size: 15px;
  font-weight: 800;
}

.wecom-scan-submit:hover {
  border-color: #c9d2ff;
  background: #eef1ff;
  color: #4257cc;
}

.login-qr-shell {
  width: 232px;
  height: 232px;
  margin: 0 auto 16px;
  padding: 13px;
  border: 1px solid #e6e9ef;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: none;
}

.login-scan-card img {
  width: 206px;
  height: 206px;
  border-radius: 0;
  box-shadow: none;
  object-fit: contain;
}

.login-scan-card #gateLocalScanHint {
  min-height: 22px;
  margin: 0 0 14px;
  color: #9aa2b1;
  font-size: 14px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
}

.login-scan-refresh {
  width: 100%;
  min-height: 51px;
  border-color: #dfe3ea;
  border-radius: 9px;
  background: #ffffff;
  color: #2d3443;
  font-size: 15px;
  font-weight: 800;
}

.login-scan-refresh:hover {
  border-color: #cfd5df;
  background: #ffffff;
  color: #2d3443;
}

.login-footer {
  margin-top: 41px;
  padding: 0;
  border: 0;
  color: #9aa2b1;
  font-size: 14px;
  line-height: 20px;
}

/* ---------- 全局 Shell ---------- */

.admin-shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 18px 16px 14px;
}

.brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 15px;
  font-weight: 700;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.nav-list {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 4px 10px;
  overflow-y: auto;
}

.nav-item {
  width: 100%;
  min-height: 36px;
  justify-content: flex-start;
  border: 0;
  border-radius: var(--radius-control);
  padding: 9px 12px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background 0.13s ease, color 0.13s ease;
}

.nav-item:hover {
  background: var(--surface-soft);
  color: var(--text);
  transform: none;
}

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
}

.nav-item:active {
  transform: none;
}

.sidebar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: var(--radius-card);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.sidebar-account .account-meta {
  min-width: 0;
  flex: 1;
}

.sidebar-account .account-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-account button {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12px;
}

.workspace {
  min-width: 0;
  padding: 0 24px 34px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 52px;
  margin: 0 -24px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}

.topbar > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.topbar h1 {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

#pageSubtitle {
  color: var(--faint);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-load-error {
  margin: 4px 0 0;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--danger);
  background: var(--danger-soft);
  color: var(--danger-text);
  font-size: 12px;
  white-space: normal;
}

.page-load-error.pending {
  border-color: var(--line);
  background: var(--surface);
  color: var(--faint);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: none;
}

.topbar-actions button {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.api-base {
  display: grid;
  gap: 4px;
  width: 320px;
}

.api-base input {
  min-height: 30px;
  font-size: 12px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 14px 0 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  overflow: hidden;
}

.status-strip div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 14px;
  border-right: 1px solid var(--line);
}

.status-strip div:last-child {
  border-right: 0;
}

.status-strip span {
  flex: none;
  font-size: 11px;
}

.status-strip strong {
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast {
  position: fixed;
  z-index: 60;
  right: 24px;
  top: 20px;
  max-width: 360px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  color: var(--text);
  font-size: 13px;
  animation: toastIn 0.22s ease both;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.danger { border-left: 3px solid var(--danger); }

/* ---------- 页面与面板 ---------- */

.page {
  display: none;
}

.page.active {
  display: grid;
  gap: 16px;
  padding-top: 18px;
  animation: fadeUp 0.25s ease both;
}

.page-head,
.panel-head,
.toolbar,
.inline-actions,
.table-footer,
.dialog-actions,
.drawer-head,
.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-head h2 {
  font-size: 24px;
}

.page-head p {
  margin-top: 4px;
  font-size: 13px;
}

.panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.panel-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.panel-head h3 {
  font-size: 15px;
}

.panel-head .status-chip {
  flex: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 102px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  text-align: left;
  color: var(--text);
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

button.metric {
  cursor: pointer;
  font-weight: 400;
}

button.metric:hover {
  border-color: #d4d7de;
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}

button.metric:active {
  transform: translateY(0);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.content-grid {
  display: grid;
  gap: 14px;
  align-items: start;
}

.content-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.toolbar {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.toolbar input {
  max-width: 320px;
}

.toolbar select {
  max-width: 180px;
}

.table-wrap {
  margin-top: 4px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.table-footer {
  justify-content: flex-end;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.table-footer strong {
  font-weight: 500;
}

.table-footer button {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  width: fit-content;
  padding: 3px 9px;
  border-radius: 5px;
  background: var(--neutral-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.status-chip.success { background: var(--success-soft); color: var(--success-text); }
.status-chip.warning { background: var(--warning-soft); color: var(--warning-text); }
.status-chip.danger { background: var(--danger-soft); color: var(--danger-text); }
.status-chip.brand { background: var(--brand-soft); color: var(--brand); }
.status-chip.muted { background: var(--neutral-soft); color: var(--muted); }

.task-list {
  display: grid;
  gap: 8px;
}

.task-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  transition: border-color 0.13s ease, background 0.13s ease;
}

.task-item:hover {
  border-color: #d4d7de;
  background: var(--surface-soft);
}

.task-item strong {
  font-size: 13px;
  font-weight: 500;
}

.task-item button {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12px;
}

.risk-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
}

.risk-dot.success { background: var(--success); }
.risk-dot.warning { background: var(--warning); }
.risk-dot.danger { background: var(--danger); }

.capability-list {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 16px;
  font-size: 13px;
}

.capability-list span {
  color: var(--muted);
}

.capability-list strong {
  font-weight: 500;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-grid button {
  min-height: 42px;
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid label {
  display: grid;
  gap: 6px;
}

.stack-form {
  display: grid;
  gap: 12px;
}

.compact-form {
  margin: 4px 0 12px;
}

.wide {
  grid-column: 1 / -1;
}

.check-line {
  display: inline-flex !important;
  align-items: center;
  gap: 8px !important;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}

/* ---------- 企业主页搭建器 ---------- */

.company-builder-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -24px -24px 0;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.company-builder-top h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.company-builder-top p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.company-builder-actions {
  align-items: center;
  flex-wrap: wrap;
}

.company-dirty-tag {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning-text);
  font-size: 12px;
  font-weight: 700;
}

.builder-completeness {
  display: grid;
  grid-template-columns: auto 120px auto;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.company-builder-shell {
  display: grid;
  grid-template-columns: 300px minmax(420px, 1fr) 430px;
  min-height: calc(100vh - 116px);
  margin: 0 -24px -24px;
  background: var(--page);
}

.company-builder-nav,
.company-inspector {
  background: var(--surface);
}

.company-builder-nav {
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  overflow: auto;
}

.builder-label {
  margin-bottom: 10px;
  color: #3f4b63;
  font-size: 12px;
  font-weight: 800;
}

.builder-label--spaced {
  margin-top: 28px;
}

.builder-structure {
  display: grid;
  gap: 8px;
}

.builder-structure-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-card);
  cursor: pointer;
}

.builder-structure-item:hover,
.builder-structure-item.active {
  border-color: var(--brand-bright);
  background: var(--brand-soft);
}

.builder-grip {
  color: #c0c6d2;
  font-size: 12px;
  line-height: 1;
}

.builder-structure-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.builder-structure-main strong,
.builder-structure-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builder-structure-main small {
  color: var(--muted);
  font-size: 11px;
}

.builder-structure-status .status-chip {
  padding: 3px 7px;
}

.builder-switch {
  position: relative;
  display: inline-flex;
  width: 34px;
  height: 20px;
  flex: none;
  cursor: pointer;
}

.builder-switch input {
  position: absolute;
  opacity: 0;
}

.builder-switch i {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #c9ced8;
  transition: background 0.15s ease;
}

.builder-switch i::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
  transition: transform 0.15s ease;
}

.builder-switch input:checked + i {
  background: var(--brand-bright);
}

.builder-switch input:checked + i::after {
  transform: translateX(14px);
}

.builder-help {
  margin: 14px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.builder-style-list {
  display: grid;
  gap: 10px;
}

.builder-style-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.builder-style-card::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
}

.builder-style-card--active {
  border-color: var(--brand-bright);
  box-shadow: 0 0 0 1px var(--brand-bright) inset;
}

.builder-style-card--active::after {
  background: var(--brand-bright);
}

.builder-style-card strong,
.builder-style-card small {
  grid-column: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builder-style-card small {
  color: var(--muted);
  font-size: 12px;
}

.style-thumb {
  grid-row: 1 / span 2;
  width: 64px;
  height: 42px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.style-thumb--classic {
  background:
    linear-gradient(#fff, #fff) 10px 10px / 28px 4px no-repeat,
    linear-gradient(rgba(255,255,255,.34), rgba(255,255,255,.34)) 10px 22px / 42px 5px no-repeat,
    linear-gradient(135deg, #1f68f5, #5272d6);
}

.style-thumb--plain {
  background:
    linear-gradient(#2f6df6, #2f6df6) 10px 10px / 18px 4px no-repeat,
    linear-gradient(#d2d7df, #d2d7df) 10px 23px / 34px 5px no-repeat,
    #fff;
}

.style-thumb--dark {
  background:
    linear-gradient(#edf2ff, #edf2ff) 10px 10px / 20px 4px no-repeat,
    linear-gradient(#46505f, #46505f) 10px 24px / 40px 5px no-repeat,
    #171d2b;
}

.builder-swatches {
  display: flex;
  gap: 12px;
  align-items: center;
}

.builder-swatches button {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  min-height: 28px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.12);
  cursor: pointer;
}

.builder-swatches button.active {
  outline: 2px solid var(--brand-bright);
  outline-offset: 3px;
}

.builder-brand-custom {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.builder-brand-custom input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  font-family: "SFMono-Regular", Consolas, monospace;
  text-transform: uppercase;
}

input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(217, 45, 32, .12);
}

.company-builder-stage {
  min-width: 0;
  padding: 24px 20px 40px;
  overflow: auto;
  display: flex;
  justify-content: center;
}

.company-phone {
  position: sticky;
  top: 92px;
  width: 440px;
  height: 860px;
  max-height: calc(100vh - 116px);
  padding: 18px 12px;
  border-radius: 34px;
  background: #161b24;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.18);
}

.company-phone__screen {
  height: 100%;
  overflow: auto;
  border-radius: 26px;
  background: #f4f6fa;
  padding: 18px 14px 24px;
}

.company-preview-hero,
.preview-module {
  border-radius: var(--radius-card);
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.company-preview-hero {
  padding: 18px;
  border-top: 48px solid var(--brand-bright);
}

.company-style-classic .company-preview-hero {
  color: #fff;
  border-top: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.18) 0 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(155deg, var(--brand-strong), var(--brand-bright));
}

.company-style-classic .preview-title small,
.company-style-classic .preview-basics {
  color: rgba(255, 255, 255, 0.78);
}

.company-style-classic .preview-basics span {
  border-top-color: rgba(255, 255, 255, 0.18);
}

.company-style-classic .preview-logo {
  background: rgba(255, 255, 255, 0.96);
}

.company-style-plain .company-preview-hero {
  border-top-width: 4px;
}

.company-style-dark .company-phone__screen {
  background: #101723;
}

.company-style-dark .company-preview-hero,
.company-style-dark .preview-module {
  border-top: 0;
  background: #171d2b;
  color: #f6f8fb;
  box-shadow: none;
}

.company-style-dark .preview-title small,
.company-style-dark .preview-basics,
.company-style-dark .preview-module p,
.company-style-dark .preview-list-item span,
.company-style-dark .preview-service-content span,
.company-style-dark .preview-empty {
  color: #aab3c2;
}

.company-style-dark .preview-basics span {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.company-style-dark .preview-list-item,
.company-style-dark .preview-service-item,
.company-style-dark .preview-media-box {
  background: #222b3b;
}

.preview-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.preview-logo {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 12px;
  background: #edf2ff;
  color: var(--brand-bright);
  font-weight: 800;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.preview-logo img,
.asset-preview img,
.asset-editor-preview img,
.gallery-editor-item img,
.preview-media-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-title {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.preview-title strong,
.preview-title small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-title strong {
  font-size: 17px;
}

.preview-title small,
.preview-basics {
  color: var(--muted);
  font-size: 12px;
}

.preview-basics {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.preview-basics span {
  padding: 9px 0;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.builder-phone-modules {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.preview-module {
  padding: 16px;
}

.preview-module h4 {
  margin: 0 0 10px;
  font-size: 16px;
}

.preview-module p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
}

.preview-media-box {
  height: 150px;
  margin-top: 12px;
  border-radius: 8px;
  background: #eaf0ff;
  color: #9aa8c9;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.preview-list {
  display: grid;
  gap: 9px;
}

.preview-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.preview-list-item strong,
.preview-list-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-list-item span,
.preview-empty {
  color: var(--muted);
  font-size: 12px;
}

.preview-services {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.preview-service-item {
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-soft);
}

.preview-service-item img {
  display: block;
  width: 100%;
  height: 86px;
  object-fit: cover;
  background: #edf1f6;
}

.preview-service-content {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
}

.preview-service-content strong,
.preview-service-content span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-service-content span {
  color: var(--muted);
  font-size: 12px;
}

.preview-services--graphic .preview-service-item {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
}

.preview-services--graphic .preview-service-item--no-image {
  grid-template-columns: minmax(0, 1fr);
}

.preview-services--graphic .preview-service-item img {
  height: 100%;
  min-height: 62px;
}

.preview-services--grid,
.preview-services--image {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.preview-services--grid .preview-service-item img {
  height: 74px;
}

.preview-services--grid .preview-service-content {
  padding: 8px 9px;
}

.preview-services--carousel {
  display: flex;
  padding-bottom: 4px;
  overflow-x: auto;
}

.preview-services--carousel .preview-service-item {
  width: 190px;
  flex: 0 0 190px;
}

.preview-services--text .preview-service-content {
  padding: 9px 12px;
}

.preview-services--image .preview-service-item {
  min-height: 92px;
  background: #edf1f6;
}

.preview-services--image .preview-service-item img {
  height: 100%;
  min-height: 92px;
}

.preview-video-card {
  position: relative;
  min-height: 170px;
  margin-top: 4px;
  border-radius: 10px;
  background: #1a1d1f;
  color: #fff;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.preview-video-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .78;
}

.preview-video-play {
  position: relative;
  z-index: 1;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
}

.preview-video-play::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 15px;
  border-left: 16px solid #1a1d1f;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}

.preview-video-title {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.company-inspector {
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  border-left: 1px solid var(--line);
  overflow: auto;
}

.inspector-head {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.inspector-head h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.inspector-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.company-inspector > .hint {
  margin: 14px 22px 0;
}

.company-tab {
  display: none;
}

.company-tab.active {
  display: grid;
  gap: 12px;
}

.company-editor-panels,
.inspector-form {
  display: grid;
  gap: 12px;
}

.company-editor-panels {
  padding: 18px 22px 30px;
}

.inspector-form label {
  display: grid;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 13px;
}

.asset-row,
.asset-editor {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
}

.asset-row {
  grid-template-columns: 56px minmax(0, 1fr) auto auto;
  align-items: center;
}

.asset-row strong,
.asset-row p {
  display: block;
  margin: 0;
}

.asset-row p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.asset-preview {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #edf2ff;
  color: var(--brand-bright);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 800;
}

.layout-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.layout-choice {
  display: grid;
  gap: 3px;
  min-width: 88px;
  padding: 9px 11px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.layout-choice.active {
  border-color: var(--brand-bright);
  background: var(--brand-soft);
  color: var(--brand-strong);
  box-shadow: 0 0 0 1px var(--brand-bright) inset;
}

.layout-choice small {
  color: var(--muted);
  font-size: 11px;
}

.builder-subhead {
  display: grid;
  gap: 10px;
}

.builder-list {
  display: grid;
  gap: 10px;
}

.builder-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.builder-item:focus-within {
  border-color: var(--brand-bright);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.builder-item-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.builder-type {
  min-width: 42px;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.builder-item-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.builder-item-main strong,
.builder-item-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builder-item-main small {
  color: var(--muted);
  font-size: 12px;
}

.builder-item-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

button.compact {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 12px;
}

.builder-input,
.builder-textarea,
.gallery-editor-item input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: #fff;
}

.builder-textarea {
  min-height: 92px;
  resize: vertical;
}

.asset-editor {
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: start;
}

.asset-editor-preview {
  width: 96px;
  height: 72px;
  border-radius: 8px;
  background: #eaf0ff;
  color: #9aa8c9;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.asset-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.asset-editor > .builder-input {
  grid-column: 1 / -1;
}

.gallery-editor {
  display: grid;
  gap: 10px;
}

.gallery-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.gallery-editor-item {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.gallery-editor-item img,
.gallery-editor-item > span {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  background: #eaf0ff;
  display: grid;
  place-items: center;
  color: #9aa8c9;
  overflow: hidden;
}

.video-picker {
  display: grid;
  gap: 8px;
}

.video-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  cursor: pointer;
}

.video-choice.active {
  border-color: var(--brand-bright);
  background: var(--brand-soft);
}

.video-choice span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.video-choice strong,
.video-choice small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-feature-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
}

.video-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
}

.video-upload-action {
  margin-left: auto;
}

.video-upload-progress {
  display: grid;
  gap: 9px;
  margin: 12px 0 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.video-upload-progress--success {
  border-color: #b9e2c5;
  background: var(--success-soft);
}

.video-upload-progress--error,
.video-upload-progress--cancelled {
  border-color: #f2c4c4;
  background: var(--danger-soft);
}

.video-upload-progress__head,
.video-upload-progress__footer {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.video-upload-progress__identity {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.video-upload-progress__identity strong,
.video-upload-progress__identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-upload-progress__identity small,
.video-upload-progress__footer {
  color: var(--muted);
  font-size: 12px;
}

.video-upload-progress__head b {
  flex: 0 0 auto;
  color: var(--brand-strong);
  font-variant-numeric: tabular-nums;
}

.video-upload-progress__track {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--neutral-soft);
}

.video-upload-progress__track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 160ms ease;
}

.video-upload-progress--success .video-upload-progress__track i {
  background: var(--success);
}

.company-video-manager {
  margin: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.company-video-manager__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.company-video-manager__head > div,
.company-video-editor__fields {
  display: grid;
  gap: 4px;
}

.company-video-manager__head small {
  color: var(--muted);
}

.company-video-list {
  display: grid;
  gap: 10px;
  padding-bottom: 12px;
}

.company-video-editor {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.company-video-editor video {
  width: 112px;
  max-width: 100%;
  min-width: 0;
  aspect-ratio: 16 / 9;
  align-self: start;
  border-radius: 4px;
  background: #111827;
  object-fit: cover;
}

.company-video-editor__fields {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  min-width: 0;
}

.company-video-editor__fields > input,
.company-video-editor__fields > select {
  width: 100%;
  min-width: 0;
}

.company-video-editor__fields > input:first-child {
  grid-column: 1 / -1;
}

.company-video-editor__fields .check-line,
.company-video-editor__actions {
  grid-column: 1 / -1;
}

.company-video-editor__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .video-status {
    flex-wrap: wrap;
  }

  .video-upload-action {
    width: 100%;
    margin-left: 0;
  }

  .company-video-editor {
    grid-template-columns: 1fr;
  }

  .company-video-editor video {
    width: 100%;
  }

  .company-video-editor__fields {
    grid-template-columns: 1fr;
  }

  .company-video-editor__actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

.video-feature-current {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.video-feature-thumb {
  position: relative;
  height: 58px;
  border-radius: 8px;
  background: #1a1d1f;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.video-feature-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-feature-thumb::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-40%, -50%);
  border-left: 12px solid #fff;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.video-feature-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.video-feature-main strong,
.video-feature-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publish-check-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.publish-check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.publish-check-row strong {
  display: block;
  font-size: 13px;
}

.publish-check-row small {
  color: var(--muted);
  font-size: 12px;
}

.publish-check-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--success);
}

.publish-check-row.is-warning .publish-check-dot {
  background: var(--warning);
}

.company-publish-card {
  width: min(460px, calc(100vw - 32px));
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, .42);
}

.modal-card {
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
  padding: 18px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.modal-head h3,
.modal-head p {
  margin: 0;
}

.modal-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.video-choice small {
  color: var(--muted);
  font-size: 12px;
}

.builder-empty {
  min-height: 74px;
  padding: 22px;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-card);
  color: var(--muted);
  background: var(--surface-soft);
  display: grid;
  place-items: center;
  text-align: center;
}

.editor-stack {
  gap: 10px;
}

.editor-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.5fr) minmax(110px, 0.8fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
}

.editor-row.service,
.editor-row.intro,
.editor-row.honor {
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.5fr) minmax(0, 1fr) auto;
}

.editor-row.feature-row {
  grid-template-columns: minmax(160px, 1fr) minmax(90px, 0.4fr) minmax(150px, 0.7fr) auto;
}

.editor-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.editor-main strong {
  overflow-wrap: anywhere;
}

.editor-main code {
  color: var(--muted);
  font-size: 12px;
}

.inline-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.inline-actions.end {
  justify-content: flex-end;
  margin: 14px 0 0;
}

.phone-preview {
  position: sticky;
  top: 76px;
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 560px;
  padding: 28px 20px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}

.phone-preview > span {
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.phone-preview strong {
  font-size: 20px;
}

.phone-preview p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.preview-modules {
  display: grid;
  gap: 8px;
}

.preview-modules div {
  padding: 10px 12px;
  border-radius: var(--radius-card);
  background: var(--surface-soft);
  font-size: 13px;
}

/* ---------- 趋势图 ---------- */

.trend-bars {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(7, minmax(28px, 1fr));
  min-height: 180px;
  padding-top: 8px;
}

.trend-item {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-rows: 1fr auto;
  height: 160px;
  justify-items: center;
}

.trend-item span {
  align-self: end;
  background: var(--brand-bright);
  border-radius: 5px 5px 2px 2px;
  display: inline-block;
  grid-row: 1;
  opacity: 0.85;
  width: 10px;
  transition: opacity 0.15s ease;
}

.trend-item:hover span {
  opacity: 1;
}

.trend-item span.accent {
  background: var(--success);
  margin-left: 14px;
}

.trend-item small {
  color: var(--muted);
  font-size: 12px;
  grid-column: 1 / span 2;
  grid-row: 2;
}

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

.empty-state {
  display: grid;
  gap: 8px;
  min-height: 180px;
  align-content: center;
  justify-items: center;
  color: var(--muted);
  text-align: center;
}

.empty-state h3 {
  color: var(--text);
}

.empty-state p {
  font-size: 13px;
}

.join-code-preview {
  min-height: 240px;
  display: grid;
  place-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
  color: var(--muted);
}

.join-code-shell {
  width: min(100%, 760px);
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.join-code-qr {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.join-code-qr img {
  width: 208px;
  height: 208px;
  display: block;
  object-fit: contain;
}

.join-code-error {
  display: grid;
  gap: 8px;
  justify-items: start;
  min-height: 0;
  width: min(100%, 560px);
  padding: 18px;
  border: 1px solid var(--danger);
  border-radius: var(--radius-card);
  background: var(--danger-soft);
  color: var(--danger-text);
}

.join-code-error p {
  margin: 0;
}

.join-code-meta {
  display: grid;
  gap: 8px;
  align-content: center;
}

.join-code-meta strong {
  font-size: 16px;
  color: var(--text);
}

.join-code-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.join-code-meta span {
  color: var(--muted);
  font-size: 12px;
}

.join-code-actions {
  grid-column: 2;
  justify-content: flex-start;
  margin-top: 4px;
}

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

.drawer {
  position: fixed;
  z-index: 40;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(600px, 100vw);
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  animation: drawerIn 0.24s cubic-bezier(0.32, 0.72, 0.35, 1) both;
}

.drawer-head {
  align-items: flex-start;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
  font-size: 18px;
}

.drawer-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.drawer-body {
  min-height: 0;
  overflow: auto;
  padding: 18px 20px;
}

.drawer-body label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.drawer-footer {
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
}

.detail-item span {
  color: var(--muted);
  font-size: 12px;
}

.detail-item strong {
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

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

.confirm-dialog {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius-modal);
  padding: 0;
  box-shadow: var(--shadow-float);
}

.confirm-dialog::backdrop {
  background: rgba(17, 24, 39, 0.42);
}

.confirm-dialog[open] {
  animation: dialogIn 0.18s ease both;
}

.confirm-dialog form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.confirm-dialog h3 {
  font-size: 16px;
}

.confirm-dialog p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 4px;
}

.claim-dialog {
  width: min(480px, calc(100vw - 32px));
}

.claim-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dialog-close {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.claim-qr-wrap {
  display: grid;
  place-items: center;
  min-height: 268px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
}

.claim-qr-wrap img {
  width: min(240px, 70vw);
  aspect-ratio: 1;
  display: block;
  border: 10px solid #fff;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(17, 24, 39, 0.08);
}

.claim-qr-error {
  color: var(--danger-text);
  font-size: 14px;
}

.claim-code-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 12px;
  background: #eff6ff;
}

.claim-code-wrap[hidden] {
  display: none;
}

.claim-code-wrap span {
  color: var(--muted);
  font-size: 13px;
}

.claim-code-wrap strong {
  flex: 1;
  color: #1d4ed8;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 22px;
  letter-spacing: 2px;
}

/* ---------- 联调输出 ---------- */

.output {
  min-height: 160px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid #1f2937;
  border-radius: var(--radius-card);
  background: #101828;
  color: #d1fadf;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
}

/* ---------- dev-only ---------- */

body:not(.dev-mode) [data-dev-only] {
  display: none !important;
}

/* ---------- 动画 ---------- */

@keyframes auroraA {
  0% { transform: translate(0, 0) scale(1); opacity: 0.85; }
  50% { transform: translate(70px, 46px) scale(1.12); opacity: 1; }
  100% { transform: translate(-30px, 90px) scale(0.95); opacity: 0.8; }
}

@keyframes auroraB {
  0% { transform: translate(0, 0) scale(1); opacity: 0.8; }
  50% { transform: translate(-80px, -50px) scale(1.15); opacity: 1; }
  100% { transform: translate(-30px, -110px) scale(0.92); opacity: 0.75; }
}

@keyframes auroraC {
  0% { transform: translate(0, 0) scale(1); opacity: 0.7; }
  50% { transform: translate(-60px, 40px) scale(1.1); opacity: 0.95; }
  100% { transform: translate(50px, -60px) scale(1.05); opacity: 0.7; }
}

@keyframes particleRise {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  12% { opacity: 0.9; }
  85% { opacity: 0.5; }
  100% { transform: translateY(-88vh) scale(0.6); opacity: 0; }
}

@keyframes orbitSpin {
  to { transform: rotate(360deg); }
}

@keyframes cardFloat {
  0%, 100% { transform: translateY(0) rotateZ(-1.2deg); }
  50% { transform: translateY(-12px) rotateZ(1.2deg); }
}

@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes drawerIn {
  from { transform: translateX(32px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 响应式 ---------- */

@media (max-width: 1180px) {
  .topbar {
    flex-wrap: wrap;
    padding: 8px 24px;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .api-base {
    width: min(100%, 420px);
  }

  #pageSubtitle {
    display: none;
  }

  .company-builder-shell {
    grid-template-columns: 260px minmax(360px, 1fr);
  }

  .company-inspector {
    position: static;
    grid-column: 1 / -1;
    height: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .company-phone {
    position: static;
    width: 390px;
  }
}

@media (max-width: 900px) {
  .login-visual {
    display: none;
  }

  .login-form-panel {
    min-height: 100vh;
    align-items: start;
    justify-items: center;
    padding: 18px 16px 28px;
  }

  .login-form {
    width: min(502px, 100%);
    padding: 0;
  }

  .admin-shell,
  .status-strip,
  .metric-grid,
  .metric-grid.three,
  .content-grid.two,
  .content-grid.three,
  .form-grid,
  .company-builder-shell,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .company-builder-top {
    position: static;
    margin: -18px -16px 0;
    align-items: flex-start;
  }

  .company-builder-shell {
    margin: 0 -16px -24px;
  }

  .company-builder-nav {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .company-builder-stage {
    padding: 18px 12px 24px;
  }

  .company-phone {
    width: min(390px, 100%);
    height: 720px;
    max-height: none;
  }

  .builder-completeness {
    grid-template-columns: auto minmax(90px, 1fr) auto;
  }

  .asset-row {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .asset-row button {
    grid-column: span 1;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace {
    padding: 0 16px 24px;
  }

  .topbar {
    margin: 0 -16px;
    padding: 8px 16px;
  }

  .status-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .status-strip div:last-child {
    border-bottom: 0;
  }

  .page-head,
  .panel-head,
  .toolbar,
  .table-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar input,
  .toolbar select {
    max-width: none;
  }

  .editor-row,
  .editor-row.service,
  .editor-row.intro,
  .editor-row.honor,
  .editor-row.feature-row {
    grid-template-columns: 1fr;
  }

  .drawer {
    width: 100vw;
  }

  .join-code-shell {
    grid-template-columns: 1fr;
  }

  .join-code-actions {
    grid-column: 1;
  }
}

/* ---------- 系统后台：指标卡扩展 ---------- */

.metric-grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric strong.warning { color: var(--warning); }
.metric strong.danger { color: var(--danger); }

.health-card strong {
  font-size: 18px;
}

.page-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: none;
}

/* ---------- 系统后台：快捷入口 ---------- */

.quick-entry {
  display: grid;
  gap: 4px;
  justify-items: start;
  min-height: 68px;
  padding: 12px 16px;
  text-align: left;
}

.quick-entry strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.quick-entry span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

/* ---------- 系统后台：任务/风险行 ---------- */

.task-item {
  grid-template-columns: 10px 1fr auto auto;
}

.task-time {
  color: var(--faint);
  font-size: 12px;
  white-space: nowrap;
}

/* ---------- 链接式按钮 ---------- */

.link-btn {
  min-height: 0;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
}

.link-btn:hover {
  color: var(--brand-strong);
  text-decoration: underline;
  background: none;
}

.link-btn.danger-link {
  color: var(--danger);
}

.link-btn.danger-link:hover {
  color: var(--danger-text);
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- 系统后台：回调柱状图 ---------- */

.callback-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 148px;
  padding-top: 8px;
}

.chart-col {
  flex: 1;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  height: 100%;
  min-width: 0;
}

.chart-col > span {
  color: var(--faint);
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 100%;
}

.chart-bars .bar {
  width: 8px;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease;
}

.chart-bars .bar.ok { background: #b9c0ee; }
.chart-bars .bar.bad { background: var(--danger); }

.chart-col:hover .bar.ok { background: var(--brand-bright); }

.chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-left: 10px;
}

.legend-dot.ok { background: #b9c0ee; }
.legend-dot.bad { background: var(--danger); }

.error-cell {
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  color: var(--muted);
  font-size: 12px;
}

.muted-cell {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- 开关 ---------- */

.switch {
  position: relative;
  display: inline-flex;
  width: 40px;
  height: 22px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d5d9e0;
  transition: background 0.18s ease;
}

.switch .switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.25);
  transition: transform 0.18s ease;
}

.switch input:checked + .switch-track {
  background: var(--brand);
}

.switch input:checked + .switch-track::after {
  transform: translateX(18px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--brand-ring);
  outline-offset: 2px;
}

.limit-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.limit-field input {
  width: 84px;
  min-height: 32px;
}

/* ---------- 抽屉：遮罩与分区 ---------- */

.drawer-backdrop {
  position: fixed;
  z-index: 39;
  inset: 0;
  background: rgba(16, 24, 40, 0.38);
  animation: fadeIn 0.2s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.drawer {
  width: min(560px, 100vw);
}

.drawer-close {
  min-height: 32px;
  width: 32px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
}

.drawer-section {
  margin-bottom: 20px;
}

.drawer-section h3 {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.section-head-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-head-inline h3 {
  margin-bottom: 0;
}

.kv-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
}

.kv-row + .kv-row {
  border-top: 1px solid var(--line);
}

.kv-row > span {
  color: var(--muted);
  font-size: 13px;
}

.kv-row > strong {
  font-size: 13px;
  font-weight: 500;
  text-align: right;
}

.drawer-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.drawer-metric {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
}

.drawer-metric span {
  color: var(--muted);
  font-size: 12px;
}

.drawer-metric strong {
  font-size: 20px;
  font-weight: 700;
}

.drawer-metric strong small {
  color: var(--faint);
  font-size: 12px;
  font-weight: 400;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
}

.admin-list-item__main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.admin-list-item__main strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-list-item__main span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.admin-list-item__meta {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.empty-block {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.drawer-callbacks {
  display: grid;
  gap: 8px;
}

.callback-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.callback-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.callback-main strong {
  font-size: 13px;
  font-weight: 500;
}

.callback-main span {
  color: var(--muted);
  font-size: 12px;
}

.callback-side {
  display: grid;
  gap: 4px;
  justify-items: end;
  flex: none;
}

.callback-side span:not(.status-chip) {
  color: var(--faint);
  font-size: 11px;
}

@media (max-width: 1200px) {
  .metric-grid.five {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- 企业后台：状态卡 ---------- */

.status-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.status-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.status-card-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
}

.status-card-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.status-card-label {
  color: var(--muted);
  font-size: 13px;
}

.status-card-value {
  font-size: 15px;
  font-weight: 600;
}

.status-card-sub {
  color: var(--faint);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 企业后台：访问趋势图 ---------- */

.visit-chart .bar.visit {
  background: var(--brand-bright);
}

.visit-chart .bar.action {
  background: var(--success);
}

.chart-col:hover .bar.visit {
  background: var(--brand);
}

.visit-chart .hint {
  margin: auto;
}

.legend-dot.visit {
  background: var(--brand-bright);
}

.legend-dot.action {
  background: var(--success);
}

.trend-legend {
  margin-top: 10px;
}

/* ---------- 企业后台：互动漏斗 ---------- */

.funnel {
  display: grid;
  gap: 14px;
  padding: 6px 0 2px;
}

.funnel-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.funnel-label {
  color: var(--muted);
  font-size: 13px;
}

.funnel-track {
  height: 22px;
  border-radius: var(--radius-control);
  background: var(--neutral-soft);
  overflow: hidden;
}

.funnel-track i {
  display: block;
  height: 100%;
  border-radius: var(--radius-control);
  background: linear-gradient(90deg, var(--brand-bright), var(--brand));
  transition: width 0.3s ease;
}

.funnel-row:nth-child(2) .funnel-track i {
  background: linear-gradient(90deg, #8b97ea, var(--brand-bright));
}

.funnel-row:nth-child(3) .funnel-track i {
  background: linear-gradient(90deg, #b9c0ee, #9aa5ec);
}

.funnel-row strong {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.funnel-note {
  margin-top: 14px;
}

/* ---------- 企业后台：segmented 切换 ---------- */

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: var(--neutral-soft);
}

.segmented button {
  min-height: 26px;
  border: 0;
  border-radius: 6px;
  padding: 4px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.segmented button:hover {
  background: transparent;
  color: var(--text);
}

.segmented button.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: 0 1px 4px rgba(17, 24, 39, 0.12);
}

/* ---------- 企业后台：版本与额度 ---------- */

.plan-hero {
  display: grid;
  gap: 14px;
}

.plan-name {
  font-size: 24px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.plan-actions {
  margin-top: 14px;
}

.quota-bars {
  display: grid;
  gap: 20px;
  padding-top: 4px;
}

.quota-bar {
  display: grid;
  gap: 8px;
}

.quota-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quota-bar-head span {
  color: var(--muted);
  font-size: 13px;
}

.quota-bar-head strong {
  font-size: 13px;
  font-weight: 600;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--neutral-soft);
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--brand-bright);
  transition: width 0.3s ease;
}

.progress i.warn {
  background: var(--warning);
}

.delta-pos {
  color: var(--success-text);
  font-weight: 600;
}

.delta-neg {
  color: var(--danger-text);
  font-weight: 600;
}

/* ---------- 企业后台：可折叠额度账本 ---------- */

.ledger-details summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  list-style: none;
}

.ledger-details summary::-webkit-details-marker {
  display: none;
}

.ledger-details summary::before {
  content: "›";
  color: var(--faint);
  font-size: 14px;
  transition: transform 0.15s ease;
}

.ledger-details[open] summary::before {
  transform: rotate(90deg);
}

.ledger-details .ledger-title {
  margin-right: auto;
}

.ledger-details .table-wrap {
  margin-top: 14px;
}

@media (max-width: 1180px) {
  .status-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .status-card-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- 企业后台：企业主页完整度条 ---------- */

.completeness-bar {
  display: grid;
  gap: 10px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.completeness-info {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.completeness-info strong {
  font-size: 20px;
  font-weight: 700;
  color: var(--brand);
}

.completeness-info .hint {
  margin: 0;
}

/* ---------- 企业后台：企业主页编辑器 ---------- */

.editor-subhead {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.module-config {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.video-panel {
  display: grid;
  gap: 10px;
  max-width: 560px;
}

.video-panel p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
}

.video-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- 企业后台：企业主页实时预览卡 ---------- */

.company-preview {
  min-height: 0;
}

.preview-card {
  display: grid;
  gap: 14px;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(160deg, var(--brand-soft), var(--surface) 55%);
}

.preview-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.preview-logo {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  overflow: hidden;
}

.preview-logo b {
  font-size: 22px;
  font-weight: 700;
}

.preview-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--surface);
}

.preview-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.preview-title strong {
  font-size: 17px;
  overflow-wrap: anywhere;
}

.preview-title small {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-stats {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

.preview-stats strong {
  color: var(--brand);
  font-size: 15px;
  font-weight: 700;
}

/* ---------- 企业后台：说明条 ---------- */

.info-banner {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.info-banner.brand {
  border-color: transparent;
  background: var(--brand-soft);
  color: var(--brand);
}

/* ---------- 企业后台：模板卡片网格 ---------- */

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.template-card {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  overflow: hidden;
}

.template-card--selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-ring);
}

.template-swatch {
  position: relative;
  height: 92px;
}

.template-thumbs {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
}

.template-thumbs img {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
}

.template-card-body {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
}

.template-card-body > strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.template-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.template-form,
.template-workspace {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.template-workspace {
  display: grid;
  grid-template-columns: minmax(300px, .85fr) minmax(520px, 1.45fr);
  gap: 24px;
  align-items: start;
}

.template-live-preview {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.template-preview-card {
  --template-brand: #5272d6;
  --template-brand-deep: #4059a7;
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1.586 / 1;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(16, 24, 40, .08);
  border-radius: 8px;
  color: #172033;
  background-color: #fff;
  background-position: center;
  background-size: cover;
  box-shadow: 0 16px 38px rgba(16, 24, 40, .12);
}

.template-preview-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--template-brand);
}

.template-preview-card__brand,
.template-preview-card__person {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
}

.template-preview-card__brand {
  gap: 10px;
  font-size: 13px;
}

.template-preview-card__brand > span {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  overflow: hidden;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--template-brand);
  color: #fff;
}

.template-preview-card__brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.template-preview-card__person {
  align-items: flex-start;
  flex-direction: column;
  gap: 5px;
  margin-top: 22%;
}

.template-preview-card__person strong {
  font-size: 24px;
}

.template-preview-card__person span,
.template-preview-card__person small {
  color: #667085;
}

.template-preview-card__badge {
  position: absolute;
  right: 18px;
  top: 18px;
  padding: 4px 7px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--template-brand) 10%, white);
  color: var(--template-brand);
  font-size: 11px;
  font-weight: 700;
}

.template-preview-card--minimal::before {
  top: auto;
  right: 22px;
  bottom: 20px;
  left: 22px;
  width: auto;
  height: 3px;
}

.template-preview-card--brand-image,
.template-preview-card--campaign {
  color: #fff;
  background-color: var(--template-brand);
  background-blend-mode: multiply;
}

.template-preview-card--brand-image .template-preview-card__person span,
.template-preview-card--brand-image .template-preview-card__person small,
.template-preview-card--campaign .template-preview-card__person span,
.template-preview-card--campaign .template-preview-card__person small,
.template-preview-card--dark .template-preview-card__person span,
.template-preview-card--dark .template-preview-card__person small {
  color: rgba(255,255,255,.74);
}

.template-preview-card--dark {
  color: #fff;
  background-color: #171d2b;
}

.template-preview-card--portrait-photo .template-preview-card__person {
  width: 58%;
}

/* Mirrors the Mini Program card-style-editor preview contract. */
.template-preview-card {
  min-height: 340px;
  padding: 32px 32px 26px 37px;
}

.template-preview-card::before {
  width: 10px;
}

.template-preview-card__head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.template-preview-card__logo {
  width: 42px;
  height: 35px;
  flex: 0 0 42px;
}

.template-preview-card__logo img,
.template-preview-card__avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.template-preview-card__logo img {
  object-fit: contain;
}

.template-preview-card__company-short {
  color: #667085;
  font-size: 19px;
}

.template-preview-card__body {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 23px;
}

.template-preview-card__info {
  min-width: 0;
  flex: 1;
}

.template-preview-card__company {
  margin-bottom: 11px;
  color: #172033;
  font-size: 22px;
  line-height: 1.35;
}

.template-preview-card__name {
  display: block;
  font-size: 35px;
  line-height: 1.2;
}

.template-preview-card__role {
  display: block;
  margin-top: 6px;
  color: #667085;
  font-size: 22px;
}

.template-preview-card__contact {
  display: block;
  margin-top: 19px;
  color: #667085;
  font-size: 19px;
  line-height: 1.7;
}

.template-preview-card__avatar {
  width: 106px;
  height: 106px;
  flex: 0 0 106px;
  overflow: hidden;
  border-radius: 50%;
  background: #eef0f3;
}

.template-preview-card__avatar > span {
  width: 100%;
  height: 100%;
  display: block;
  background: #eef0f3 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='24' r='12' fill='%239aa1ac'/%3E%3Cpath d='M12 56c2.8-12 10.2-19 20-19s17.2 7 20 19' fill='%239aa1ac'/%3E%3C/svg%3E") center / 66% no-repeat;
}

.template-preview-card--minimal::before,
.template-preview-card--campaign::before,
.template-preview-card--brand-image::before,
.template-preview-card--dark::before {
  display: none;
}

.template-preview-card--minimal {
  padding: 35px 39px 30px;
}

.template-preview-card--minimal .template-preview-card__head {
  max-width: calc(100% - 126px);
  opacity: .72;
}

.template-preview-card--minimal .template-preview-card__logo {
  display: none;
}

.template-preview-card--minimal .template-preview-card__body {
  align-items: flex-start;
  margin-top: 27px;
}

.template-preview-card--minimal .template-preview-card__name {
  font-size: 39px;
}

.template-preview-card--minimal .template-preview-card__avatar {
  width: 90px;
  height: 90px;
  flex-basis: 90px;
}

.template-preview-card--minimal .template-preview-card__contact {
  margin-top: 68px;
}

.template-preview-card--brand-image,
.template-preview-card--dark {
  color: #fff;
}

.template-preview-card--brand-image .template-preview-card__company-short,
.template-preview-card--brand-image .template-preview-card__company,
.template-preview-card--brand-image .template-preview-card__name,
.template-preview-card--brand-image .template-preview-card__role,
.template-preview-card--brand-image .template-preview-card__contact,
.template-preview-card--dark .template-preview-card__company-short,
.template-preview-card--dark .template-preview-card__company,
.template-preview-card--dark .template-preview-card__name {
  color: rgba(255,255,255,.94);
}

.template-preview-card--brand-image .template-preview-card__name {
  margin-top: 71px;
  font-size: 40px;
}

.template-preview-card--dark .template-preview-card__role {
  color: rgba(214,223,238,.72);
}

.template-preview-card--dark .template-preview-card__contact {
  color: #a8c5ff;
}

.template-preview-card--dark .template-preview-card__avatar > span {
  background-color: rgba(255,255,255,.12);
}

.template-preview-card--portrait-photo {
  padding: 32px 235px 26px 37px;
}

.template-preview-card--portrait-photo::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 0;
  width: 250px;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.42));
}

.template-preview-card--portrait-photo .template-preview-card__head,
.template-preview-card--portrait-photo .template-preview-card__info {
  z-index: 2;
  max-width: 202px;
}

.template-preview-card--portrait-photo .template-preview-card__body {
  position: static;
  display: block;
  margin-top: 24px;
}

.template-preview-card--portrait-photo .template-preview-card__company,
.template-preview-card--portrait-photo .template-preview-card__name,
.template-preview-card--portrait-photo .template-preview-card__role,
.template-preview-card--portrait-photo .template-preview-card__contact {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-preview-card--portrait-photo .template-preview-card__name {
  font-size: 34px;
}

.template-preview-card--portrait-photo .template-preview-card__avatar {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 1;
  width: 235px;
  height: auto;
  border-radius: 0;
  background: transparent;
}

.template-preview-card--campaign {
  padding-top: 102px;
}

.template-preview-card--campaign::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 0;
  height: 90px;
  background: linear-gradient(120deg, var(--template-brand), var(--template-brand-soft));
}

.template-preview-card--campaign .template-preview-card__head {
  position: absolute;
  inset: 26px 35px auto;
}

.template-preview-card--campaign .template-preview-card__logo,
.template-preview-card--campaign .template-preview-card__company {
  display: none;
}

.template-preview-card--campaign .template-preview-card__company-short {
  color: #fff;
  font-size: 22px;
}

.template-preview-card--campaign .template-preview-card__body {
  margin-top: 0;
}

.template-preview-card--campaign .template-preview-card__avatar {
  border-radius: 14px;
  background: color-mix(in srgb, var(--template-brand) 8%, white);
}

.template-preview-card--campaign .template-preview-card__name {
  font-size: 37px;
}

.template-preview-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: baseline;
}

.template-preview-meta span,
.template-preview-meta small {
  color: var(--muted);
  font-size: 12px;
}

.template-preview-meta small {
  grid-column: 2;
}

.template-control-stack {
  min-width: 0;
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.template-control-section {
  display: grid;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.template-control-section:first-child {
  padding-top: 0;
}

.template-control-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.template-control-head > div {
  display: grid;
  gap: 3px;
}

.template-control-head small {
  color: var(--muted);
  font-size: 12px;
}

.template-control-head code {
  color: var(--muted);
  font-size: 12px;
}

.template-field-grid,
.template-asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.template-field-grid label,
.template-range-field {
  display: grid;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
}

.template-variant-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.template-variant-choice {
  min-width: 0;
  padding: 8px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 8px;
  text-align: left;
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.template-variant-choice.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand) inset;
}

.template-variant-choice strong,
.template-variant-choice small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-variant-choice small {
  color: var(--muted);
  font-size: 10px;
}

.template-variant-thumb {
  grid-row: 1 / span 2;
  width: 48px;
  height: 32px;
  border: 1px solid rgba(16,24,40,.08);
  border-radius: 5px;
  background: linear-gradient(90deg, var(--brand) 4px, #fff 4px);
  background-position: center;
  background-size: cover;
}

.template-variant-thumb--minimal { background: linear-gradient(#fff 26px, var(--brand) 26px 29px, #fff 29px); }
.template-variant-thumb--brand-image { background: var(--brand); }
.template-variant-thumb--portrait-photo { background: radial-gradient(circle at 75% 50%, #cbd5e1 0 8px, transparent 9px), #fff; }
.template-variant-thumb--dark { background: #171d2b; }
.template-variant-thumb--campaign { background: linear-gradient(135deg, var(--brand), #f0830f); }

.template-color-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.template-color-choice {
  width: 32px;
  height: 32px;
  min-height: 32px;
  flex: 0 0 32px;
  aspect-ratio: 1;
  padding: 0;
  border: 3px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
}

.template-color-choice.active {
  box-shadow: 0 0 0 2px var(--brand);
}

.template-custom-color {
  display: grid;
  grid-template-columns: auto minmax(120px, 180px) 38px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.template-custom-color input[type="color"] {
  width: 38px;
  height: 36px;
  padding: 3px;
}

.template-asset-field {
  display: grid;
  gap: 8px;
  align-content: start;
  color: var(--text-secondary);
  font-size: 12px;
}

.template-asset-preview {
  width: 100%;
  height: 92px;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--muted);
}

.template-asset-preview--wide {
  aspect-ratio: 1.586 / 1;
  height: auto;
  max-height: 140px;
}

.template-asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.template-range-field {
  margin-top: 4px;
}

.template-range-field span {
  display: flex;
  justify-content: space-between;
}

.template-workspace-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 18px;
}

@media (max-width: 1180px) {
  .template-workspace {
    grid-template-columns: 1fr;
  }

  .template-live-preview {
    position: static;
    max-width: 620px;
  }

  .template-control-stack {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 720px) {
  .template-variant-grid,
  .template-field-grid,
  .template-asset-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- 企业后台：独立名片模板工作台 ---------- */

.template-page {
  --studio-editor: 520px;
}

.template-page-head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.template-page-head h2 {
  margin-top: 3px;
}

.template-studio {
  display: grid;
  grid-template-columns: var(--studio-editor) minmax(520px, 760px);
  align-items: start;
  justify-content: center;
  min-height: calc(100vh - 190px);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  overflow: clip;
}

.template-inspector {
  min-width: 0;
  min-height: calc(100vh - 190px);
  background: var(--surface);
}

.template-canvas-head {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.template-canvas {
  min-width: 0;
  min-height: calc(100vh - 190px);
  background: #f6f7f9;
}

.template-canvas-head {
  background: rgba(255, 255, 255, .86);
}

.template-canvas-head > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.template-canvas-head span {
  color: var(--muted);
  font-size: 11px;
}

.template-canvas-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.template-preview-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.template-preview-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.template-page .template-live-preview {
  position: sticky;
  top: 84px;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: clamp(44px, 8vh, 84px) 32px 36px;
}

.template-page .template-preview-card {
  width: min(100%, 540px);
  max-width: 540px;
  padding: 26px;
  box-shadow: 0 18px 46px rgba(16, 24, 40, .13);
}

.template-page .template-preview-meta {
  width: min(100%, 540px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.template-page .template-preview-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-inspector {
  border-right: 1px solid var(--line);
}

.template-inspector form {
  display: grid;
  padding: 0 20px 24px;
}

.template-page .template-control-section {
  gap: 12px;
  padding: 17px 0;
}

.template-page .template-control-section:first-child {
  padding-top: 17px;
}

.template-page .template-field-grid {
  grid-template-columns: minmax(0, 1fr) 112px;
}

.template-page .template-variant-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.template-page .template-variant-choice {
  grid-template-columns: 42px minmax(0, 1fr);
  min-height: 54px;
  padding: 7px;
}

.template-page .template-variant-thumb {
  width: 42px;
  height: 30px;
}

.template-page .template-custom-color {
  grid-template-columns: 28px minmax(0, 1fr) 36px;
}

.template-asset-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.template-asset-label span,
.template-asset-field--inline > div:last-child > span {
  color: var(--muted);
  font-size: 11px;
}

.template-background-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.template-background-preset {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.template-background-preset:hover {
  border-color: var(--brand);
}

.template-background-preset.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand);
}

.template-background-preset img {
  width: 72px;
  height: 42px;
  border-radius: 4px;
  object-fit: cover;
}

.template-background-preset span {
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-asset-field--inline {
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.template-asset-field--inline .template-asset-preview {
  height: 58px;
  border-style: solid;
  background: var(--surface);
}

.template-asset-field--inline > div:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.template-asset-field--inline .inline-actions {
  justify-content: flex-start;
  margin-top: 4px;
}

.template-page .template-asset-preview--wide {
  max-height: 116px;
}

@media (max-width: 1500px) {
  .template-page {
    --studio-editor: 460px;
  }

  .template-studio {
    grid-template-columns: var(--studio-editor) minmax(440px, 1fr);
  }
}

@media (max-width: 1180px) {
  .template-studio {
    grid-template-columns: 1fr;
  }

  .template-inspector {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .template-inspector form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
  }
}

@media (max-width: 760px) {
  .template-studio {
    grid-template-columns: 1fr;
  }

  .template-canvas,
  .template-inspector {
    min-height: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .template-page .template-live-preview {
    position: static;
    padding: 28px 18px;
  }

  .template-inspector form {
    grid-template-columns: 1fr;
  }
}

/* ---------- 审计：操作日志视图 ---------- */

.audit-view {
  display: grid;
  gap: 16px;
}

.ops-target {
  overflow-wrap: anywhere;
}

.audit-kv .kv-row > strong {
  overflow-wrap: anywhere;
}

.audit-detail-label {
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.audit-detail-json {
  min-height: 0;
  max-height: 340px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
