/* McAuto 管理后台样式 —— 无外部依赖，组件化 class，支持深色模式与移动端。 */

/* ========== 1. 设计变量 ========== */
:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --bg-soft: #eceef2;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef1f6;
  --border: #e2e5ea;
  --border-strong: #cfd4dc;
  --text: #1b1f24;
  --text-2: #4c5560;
  --text-3: #7b8592;
  --primary: #c8102e;
  --primary-hover: #a70d26;
  --primary-soft: #fdeaee;
  --on-primary: #ffffff;
  --ok: #177245;
  --ok-soft: #e6f4ec;
  --warn: #8a5a00;
  --warn-soft: #fff4d9;
  --danger: #b3261e;
  --danger-soft: #fdeceb;
  --info: #1f5f99;
  --info-soft: #e8f1fa;
  --focus: #2563eb;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 8px 28px rgba(16, 24, 40, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --sidebar-bg: #15181d;
  --sidebar-bg-2: #0f1216;
  --sidebar-text: #c7ccd4;
  --sidebar-muted: #8b93a0;
  --sidebar-active: #ffffff;
  --sidebar-active-bg: rgba(255, 255, 255, 0.09);
  --sidebar-width: 228px;
  --topbar-height: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1216;
  --bg-soft: #14181d;
  --surface: #171b21;
  --surface-2: #1c2128;
  --surface-3: #232a33;
  --border: #2a313b;
  --border-strong: #39424e;
  --text: #e8ebef;
  --text-2: #b3bcc7;
  --text-3: #8590a0;
  --primary: #ff5b6e;
  --primary-hover: #ff7c8b;
  --primary-soft: #3a1b22;
  --on-primary: #24070c;
  --ok: #5cd6a0;
  --ok-soft: #16302a;
  --warn: #f5c451;
  --warn-soft: #33290f;
  --danger: #ff7a72;
  --danger-soft: #3a1a18;
  --info: #7db8f0;
  --info-soft: #152a3c;
  --focus: #7db8f0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 10px 32px rgba(0, 0, 0, 0.5);
  --sidebar-bg: #0b0e12;
  --sidebar-bg-2: #090b0e;
  --sidebar-text: #aab2bd;
  --sidebar-muted: #727c89;
  --sidebar-active-bg: rgba(255, 255, 255, 0.08);
}

/* ========== 2. 基础 ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

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

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

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

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

::selection {
  background: var(--primary-soft);
  color: var(--text);
}

[hidden] {
  display: none !important;
}

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

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

.num {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--text-3);
}

.nowrap {
  white-space: nowrap;
}

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

.text-ok {
  color: var(--ok);
}

.text-warn {
  color: var(--warn);
}

/* ========== 3. 布局 ========== */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: var(--sidebar-text);
  transition: transform 0.22s ease;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-height);
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.5px;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand__name {
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.2px;
}

.brand__sub {
  color: var(--sidebar-muted);
  font-size: 11px;
  letter-spacing: 0.6px;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav__group {
  padding: 12px 10px 6px;
  color: var(--sidebar-muted);
  font-size: 11px;
  letter-spacing: 1px;
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 11px;
  border-radius: 9px;
  color: var(--sidebar-text);
  font-size: 14px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav__item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-decoration: none;
}

.nav__item.is-active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav__item .icon {
  opacity: 0.85;
}

.nav__badge {
  margin-left: auto;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.sidebar__foot {
  flex: none;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar__foot .nav__item {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}

.layout__main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-height);
  padding: 0 22px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

@supports not (backdrop-filter: blur(1px)) {
  .topbar {
    background: var(--surface);
  }
}

.topbar__title {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.2px;
}

.topbar__meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-3);
  font-size: 13px;
}

.topbar__user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
}

.live-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
}

.live-dot.is-on::before {
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}

.live-dot.is-off::before {
  background: var(--danger);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.content {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 22px 56px;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  background: rgba(8, 10, 14, 0.55);
}

body.sidebar-open {
  overflow: hidden;
}

/* ========== 4. 页头 / 工具条 ========== */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-head__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.3;
}

.page-head__desc {
  margin-top: 4px;
  color: var(--text-3);
  font-size: 13px;
}

.page-head__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stack--sm {
  gap: 10px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

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

.grid--sidebar {
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.row--between {
  justify-content: space-between;
}

.row--end {
  justify-content: flex-end;
}

.spacer {
  flex: 1;
}

/* ========== 5. 卡片 / 统计 ========== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.card__title {
  font-size: 15px;
  font-weight: 650;
}

.card__sub {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 400;
}

.card__body {
  padding: 18px;
}

.card__body--flush {
  padding: 0;
}

.card__foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.card--soft {
  background: var(--surface-2);
  box-shadow: none;
}

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

.stat {
  position: relative;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.stat__label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: 12.5px;
}

.stat__value {
  margin-top: 6px;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.4px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.stat__value--sm {
  font-size: 20px;
}

.stat__hint {
  margin-top: 4px;
  color: var(--text-3);
  font-size: 12px;
  min-height: 18px;
}

.stat--accent {
  background: linear-gradient(135deg, var(--primary) 0%, #8f0a20 100%);
  border-color: transparent;
  color: var(--on-primary);
}

.stat--accent .stat__label,
.stat--accent .stat__hint {
  color: color-mix(in srgb, var(--on-primary) 78%, transparent);
}

.stat--good .stat__value {
  color: var(--ok);
}

.stat--bad .stat__value {
  color: var(--danger);
}

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

.progress__bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #f2707f);
  transition: width 0.4s ease;
}

.progress--good .progress__bar {
  background: linear-gradient(90deg, var(--ok), #51c491);
}

/* ========== 6. 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--text-3);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-busy="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.btn--primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}

.btn--ghost:hover {
  background: var(--surface-3);
  border-color: transparent;
}

.btn--danger {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  color: var(--danger);
}

.btn--danger:hover {
  background: color-mix(in srgb, var(--danger) 16%, var(--surface));
  border-color: var(--danger);
}

.btn--ok {
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
  color: var(--ok);
}

.btn--outline-primary {
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
  color: var(--primary);
  background: transparent;
}

.btn--sm {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12.5px;
  border-radius: 7px;
}

.btn--block {
  width: 100%;
}

.btn--icon {
  width: 36px;
  padding: 0;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
}

.icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

.icon-btn--on-dark {
  color: var(--sidebar-text);
}

.icon-btn--on-dark:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-toggle {
  display: none;
}

/* ========== 7. 表单 ========== */
.filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field--grow {
  flex: 1 1 200px;
}

.field--sm {
  width: 140px;
}

.label {
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 550;
}

.label__optional {
  color: var(--text-3);
  font-weight: 400;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.55;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--text-3);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-3);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  background: var(--surface-2);
  color: var(--text-3);
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .input {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group__suffix {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 12.5px;
  white-space: nowrap;
}

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

.form-grid .field--full {
  grid-column: 1 / -1;
}

.hint {
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.5;
}

.form-error {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
}

/* 开关 */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

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

.switch__track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background 0.18s ease;
  flex: none;
}

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

.switch input:checked + .switch__track {
  background: var(--ok);
}

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

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

.switch input:disabled + .switch__track {
  opacity: 0.5;
  cursor: not-allowed;
}

.switch__text {
  font-size: 13px;
  color: var(--text-2);
}

.switch-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.switch-row:last-child {
  border-bottom: 0;
}

.switch-row__main {
  min-width: 0;
}

.switch-row__title {
  font-size: 13.5px;
  font-weight: 550;
}

.switch-row__desc {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.5;
}

/* ========== 8. 徽章 ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 550;
  line-height: 20px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}

.badge--plain::before {
  display: none;
}

.badge--ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge--warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge--info {
  background: var(--info-soft);
  color: var(--info);
}

.badge--muted {
  background: var(--surface-3);
  color: var(--text-3);
}

.badge--primary {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge--lg {
  padding: 2px 10px;
  font-size: 13px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--text-3);
  text-decoration: none;
}

.chip.is-active {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
  color: var(--primary);
  font-weight: 600;
}

/* ========== 9. 表格 ========== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 680px;
}

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.table tbody tr:hover {
  background: var(--surface-2);
}

.table--compact th,
.table--compact td {
  padding: 8px 12px;
}

.table__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table__actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.table tr.is-highlight {
  animation: rowHighlight 1.6s ease;
}

@keyframes rowHighlight {
  0% {
    background: color-mix(in srgb, var(--primary) 16%, transparent);
  }
  100% {
    background: transparent;
  }
}

.table__link {
  font-weight: 550;
}

.table-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--text-3);
}

/* ========== 10. 分页 ========== */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pagination__info {
  margin-right: auto;
  color: var(--text-3);
  font-size: 12.5px;
}

.page-btn {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--text-3);
  background: var(--surface-2);
  text-decoration: none;
}

.page-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-ellipsis {
  color: var(--text-3);
  padding: 0 2px;
}

/* ========== 11. 状态：空 / 加载 / 错误 ========== */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 20px;
  text-align: center;
  color: var(--text-3);
}

.empty__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 2px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-3);
}

.empty__title {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
}

.empty__hint {
  max-width: 420px;
  font-size: 12.5px;
  line-height: 1.6;
}

.empty__action {
  margin-top: 6px;
}

.loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 44px 20px;
  color: var(--text-3);
  font-size: 13px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: none;
}

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

.skeleton {
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--surface-3) 25%,
    color-mix(in srgb, var(--surface-3) 60%, var(--surface)) 37%,
    var(--surface-3) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.skeleton--text {
  height: 13px;
}

.skeleton--stat {
  height: 74px;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
}

.alert__icon {
  flex: none;
  margin-top: 1px;
}

.alert--error {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
  color: var(--danger);
}

.alert--warn {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
  color: var(--warn);
}

.alert--info {
  background: var(--info-soft);
  border-color: color-mix(in srgb, var(--info) 30%, transparent);
  color: var(--info);
}

.alert--ok {
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
  color: var(--ok);
}

.alert code {
  font-family: var(--mono);
  font-size: 12px;
}

.error-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ========== 12. Toast ========== */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--info);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  pointer-events: auto;
  animation: toastIn 0.2s ease;
}

.toast.is-leaving {
  animation: toastOut 0.18s ease forwards;
}

.toast--success {
  border-left-color: var(--ok);
}

.toast--error {
  border-left-color: var(--danger);
}

.toast--warn {
  border-left-color: var(--warn);
}

.toast--info {
  border-left-color: var(--info);
}

.toast__body {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.toast__trace {
  display: block;
  margin-top: 2px;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 11px;
}

.toast__close {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--text-3);
  padding: 0 2px;
  line-height: 1;
  font-size: 16px;
}

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

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ========== 13. 弹窗 ========== */
.modal-root:empty {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(8, 10, 14, 0.58);
  animation: fadeIn 0.16s ease;
}

.modal__panel {
  width: 100%;
  max-width: 520px;
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: modalIn 0.18s ease;
}

.modal__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.modal__title {
  font-size: 16px;
  font-weight: 650;
}

.modal__close {
  margin-left: auto;
}

.modal__body {
  padding: 18px;
  overflow-y: auto;
}

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal__message {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.modal__summary {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 13px;
}

.modal--danger .modal__title {
  color: var(--danger);
}

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

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
}

/* ========== 14. 抽屉 ========== */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 14, 0.55);
  animation: fadeIn 0.16s ease;
}

.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: drawerIn 0.22s ease;
}

.drawer__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.drawer__title {
  font-size: 16px;
  font-weight: 650;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}

.drawer__foot {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

@keyframes drawerIn {
  from {
    transform: translateX(24px);
    opacity: 0.6;
  }
}

/* ========== 15. 档位切换 / 标签页 ========== */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 10px;
  background: var(--surface-3);
  border: 1px solid var(--border);
}

.segmented__item {
  min-height: 30px;
  padding: 4px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}

.segmented__item:hover {
  color: var(--text);
}

.segmented__item.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.tab {
  padding: 9px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-3);
  font-size: 13.5px;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ========== 16. 描述列表 / 时间线 ========== */
.kv {
  display: flex;
  flex-direction: column;
}

.kv__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}

.kv__row:last-child {
  border-bottom: 0;
}

.kv__key {
  flex: none;
  width: 112px;
  color: var(--text-3);
}

.kv__val {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.kv__val--strong {
  font-weight: 600;
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 4px;
}

.timeline__item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 0 0 18px 18px;
  border-left: 1px solid var(--border);
}

.timeline__item:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.timeline__dot {
  position: absolute;
  top: 5px;
  left: -5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border-strong);
  box-shadow: 0 0 0 3px var(--surface);
}

.timeline__dot--ok {
  background: var(--ok);
}

.timeline__dot--warn {
  background: var(--warn);
}

.timeline__dot--danger {
  background: var(--danger);
}

.timeline__body {
  min-width: 0;
  flex: 1;
}

.timeline__title {
  font-size: 13.5px;
  font-weight: 600;
}

.timeline__meta {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 12px;
}

.timeline__reason {
  margin-top: 3px;
  color: var(--text-2);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

/* ========== 17. 商品 / 购物车 ========== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}

.product-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  text-align: left;
  padding: 0;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.product-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  text-decoration: none;
}

.product-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  color: var(--text-3);
  font-size: 20px;
  font-weight: 700;
  overflow: hidden;
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 11px 12px;
  flex: 1;
}

.product-card__name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.product-card__price {
  color: var(--primary);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.product-card__tags {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 4px;
}

.product-card__add {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--primary);
  font-size: 16px;
  line-height: 1;
}

.product-card__add:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.category-block + .category-block {
  margin-top: 22px;
}

.category-block__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14.5px;
  font-weight: 650;
}

.category-block__count {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 400;
}

.cart-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.cart-line:last-child {
  border-bottom: 0;
}

.cart-line__main {
  flex: 1;
  min-width: 0;
}

.cart-line__name {
  font-size: 13.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.cart-line__opts {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.cart-line__price {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 13px;
}

.cart-line__remove {
  border: 0;
  background: transparent;
  color: var(--text-3);
  padding: 0 2px;
  font-size: 16px;
  line-height: 1;
}

.cart-line__remove:hover {
  color: var(--danger);
}

.cart-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  font-size: 13.5px;
}

.cart-total__value {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
}

.stepper button {
  width: 30px;
  height: 30px;
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
}

.stepper button:disabled {
  color: var(--text-3);
  cursor: not-allowed;
}

.stepper__value {
  min-width: 34px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
}

/* ========== 18. 会员 ========== */
.member-card {
  position: relative;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #241014 0%, #3d1119 55%, #1a0d10 100%);
  color: #fff;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.member-card::after {
  content: "";
  position: absolute;
  right: -46px;
  bottom: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 107, 126, 0.28), transparent 68%);
  pointer-events: none;
}

.member-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.member-card__name {
  font-size: 17px;
  font-weight: 700;
}

.member-card__sub {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.member-card__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.member-card__label {
  color: rgba(255, 255, 255, 0.58);
  font-size: 11.5px;
}

.member-card__value {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.benefit {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.benefit:last-child {
  border-bottom: 0;
}

.benefit__main {
  flex: 1;
  min-width: 0;
}

.benefit__name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13.5px;
  font-weight: 600;
}

.benefit__desc {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.55;
}

.benefit__remaining {
  flex: none;
  text-align: right;
  min-width: 84px;
}

.benefit__num {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.benefit__num--unknown {
  color: var(--text-3);
  font-size: 14px;
  font-weight: 600;
}

.benefit__num-label {
  color: var(--text-3);
  font-size: 11px;
}

/* ========== 19. 套餐选择（商品详情） ========== */
.round-block {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.round-block:first-of-type {
  border-top: 0;
}

.round-block__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 650;
}

.round-block__required {
  color: var(--danger);
  font-size: 11px;
  font-weight: 500;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
}

.choice:hover {
  border-color: var(--border-strong);
}

.choice:has(input:checked) {
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
  background: var(--primary-soft);
}

.choice input {
  accent-color: var(--primary);
  margin: 0;
}

.choice__name {
  flex: 1;
  min-width: 0;
}

.choice__price {
  color: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.choice__disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ========== 20. 渠道 / 能力矩阵 ========== */
.channel-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.channel-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.channel-card__name {
  font-size: 14px;
  font-weight: 650;
}

.channel-card__meta {
  color: var(--text-3);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.cap-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.matrix td:first-child {
  font-weight: 550;
}

/* ========== 21. 登录页 ========== */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 15% -10%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 60%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 30px 28px 26px;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  text-align: center;
}

.auth-brand__mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}

.auth-brand__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.auth-brand__sub {
  color: var(--text-3);
  font-size: 12.5px;
}

.auth-foot {
  margin-top: 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
}

/* ========== 22. 错误页 ========== */
.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.error-card {
  max-width: 460px;
  text-align: center;
}

.error-code {
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.error-title {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 700;
}

.error-desc {
  margin-top: 8px;
  margin-bottom: 20px;
  color: var(--text-3);
  font-size: 13.5px;
  line-height: 1.7;
}

/* ========== 23. 工具类 ========== */
.mt-0 {
  margin-top: 0;
}
.mt-1 {
  margin-top: 6px;
}
.mt-2 {
  margin-top: 12px;
}
.mt-3 {
  margin-top: 18px;
}
.mb-1 {
  margin-bottom: 6px;
}
.mb-2 {
  margin-bottom: 12px;
}
.mb-3 {
  margin-bottom: 18px;
}
.w-full {
  width: 100%;
}
.flex-none {
  flex: none;
}
.hidden {
  display: none !important;
}

/* ========== 24. 响应式 ========== */
@media (max-width: 1180px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid--sidebar {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: var(--shadow);
  }
  body.sidebar-open .sidebar-backdrop {
    display: block;
  }
  .layout__main {
    margin-left: 0;
  }
  .nav-toggle {
    display: inline-grid;
  }
  .content {
    padding: 18px 16px 48px;
  }
  .topbar {
    padding: 0 14px;
  }
}

@media (max-width: 760px) {
  .grid--2,
  .grid--3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .page-head__title {
    font-size: 19px;
  }
  .page-head {
    align-items: flex-start;
  }
  .filters {
    padding: 12px;
  }
  .field--sm {
    width: 100%;
    flex: 1 1 130px;
  }
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat {
    padding: 13px 14px;
  }
  .stat__value {
    font-size: 21px;
  }
  .member-card__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .topbar__meta .topbar__user {
    display: none;
  }
  .modal {
    align-items: flex-end;
    padding: 0;
  }
  .modal__panel {
    max-width: none;
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .modal__foot {
    border-radius: 0;
  }
}

@media (max-width: 520px) {
  .content {
    padding: 14px 12px 40px;
  }
  .stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .toast-stack {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
  }
  .pagination {
    justify-content: center;
  }
  .pagination__info {
    width: 100%;
    margin: 0 0 4px;
    text-align: center;
  }
}

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

/* 订单表在窄屏保留可读列宽 */
.table--orders {
  min-width: 920px;
}

@media (max-width: 760px) {
  .hide-sm {
    display: none !important;
  }
}

/* 列表条目（通知、退款、付款） */
.list-item {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.list-item:first-child {
  padding-top: 0;
}
.list-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.list-item__title {
  font-size: 13.5px;
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}
.list-item__meta {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.5;
}
.list-item__body {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

/* 门店选择（管理端菜单页） */
.store-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: inherit;
  text-align: left;
}
.store-option:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.store-option + .store-option {
  margin-top: 7px;
}
.store-option__main {
  flex: 1;
  min-width: 0;
}
.store-option__name {
  font-size: 13.5px;
  font-weight: 600;
}
.store-option__meta {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.store-option__distance {
  flex: none;
  color: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.store-option__action {
  flex: none;
  color: var(--primary);
  font-size: 12.5px;
}

/* 商品卡图片兜底 */
.product-card__media img,
.buyer-product__media img {
  position: absolute;
  inset: 0;
}

/* 门店上下文条（管理端菜单页） */
.store-context {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 12.5px;
}
.store-context__name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.store-context__change {
  flex: none;
  border: 0;
  background: none;
  color: var(--primary);
  font-size: 12.5px;
  padding: 2px;
}

/* 设置项 */
.setting-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.setting-item:first-child {
  padding-top: 0;
}
.setting-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.setting-item__main {
  flex: 1;
  min-width: 0;
}
.setting-item__control {
  flex: none;
  width: min(280px, 46%);
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 8px;
}
.setting-item__control .input,
.setting-item__control .select,
.setting-item__control .textarea {
  min-width: 0;
}
.setting-item__control .textarea {
  min-height: 70px;
}
.setting-item__danger {
  margin-left: 6px;
}
@media (max-width: 760px) {
  .setting-item {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .setting-item__control {
    width: 100%;
    justify-content: flex-start;
  }
  .setting-item__control .input,
  .setting-item__control .textarea {
    width: 100%;
  }
}

/* 原始汇总折叠 */
.raw-summary summary {
  padding: 14px 18px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  list-style-position: inside;
}
.raw-summary[open] summary {
  border-bottom: 1px solid var(--border);
}
.raw-summary pre {
  margin: 0;
  padding: 14px 18px;
  max-height: 460px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* 日志详情 */
.log-detail {
  margin: 0;
  padding: 8px 10px;
  max-height: 220px;
  overflow: auto;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text-2);
}
.log-detail summary {
  cursor: pointer;
  color: var(--text-3);
  font-family: var(--font);
  font-size: 12px;
}

/* ===== 管理端与买家端共享的商品详情 / 报价明细 / 取餐码样式 ===== */
.pd-hero {
  display: flex;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.pd-hero__media {
  width: 96px;
  height: 96px;
  flex: none;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  color: var(--text-3);
  font-size: 24px;
  font-weight: 700;
}
.pd-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pd-hero__main {
  flex: 1;
  min-width: 0;
}
.pd-hero__name {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.4;
}
.pd-hero__price {
  margin-top: 4px;
  color: var(--primary);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pd-hero__hint {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 11.5px;
  line-height: 1.5;
}
.pd-section {
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.pd-section:last-child {
  border-bottom: 0;
}
.pd-section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13.5px;
  font-weight: 650;
}
.pd-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}
.pd-qty__label {
  font-size: 13.5px;
  font-weight: 650;
}
.cart-summary {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  font-size: 13px;
  color: var(--text-2);
}
.summary-row__value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.summary-row--total {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}
.summary-row--total .summary-row__value {
  color: var(--primary);
  font-size: 20px;
  font-weight: 700;
}
.summary-note {
  margin-top: 8px;
  color: var(--text-3);
  font-size: 11.5px;
  line-height: 1.55;
}
.pickup-box {
  margin-top: 14px;
  padding: 16px;
  border: 1px dashed color-mix(in srgb, var(--primary) 45%, transparent);
  border-radius: var(--radius);
  background: var(--primary-soft);
  text-align: center;
}
.pickup-box__label {
  color: var(--text-3);
  font-size: 11.5px;
}
.pickup-box__code {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary);
  overflow-wrap: anywhere;
}
.pickup-box__hint {
  margin-top: 4px;
  color: var(--text-3);
  font-size: 11.5px;
}
