/* ==========================================================================
   途掣电解质片 · Web 管理后台样式
   运动科技 × 国潮质感：深蓝 / 天蓝 / 金色点缀
   零外部依赖，仅使用系统字体栈
   ========================================================================== */

:root {
  --brand: #00a0e9;
  --brand-dark: #007bb8;
  --brand-deep: #008fce;
  --brand-soft: rgba(0, 160, 233, 0.1);
  --ink: #062b45;
  --ink-2: #0b3a5c;
  --gold: #c8a45d;
  --gold-dark: #9a7635;
  --gold-soft: rgba(200, 164, 93, 0.14);
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #172b3f;
  --text-2: #4a5d70;
  --muted: #7b8ca0;
  --line: #e4eaf1;
  --line-2: #eef2f7;
  --danger: #d64545;
  --danger-dark: #b23636;
  --danger-soft: #fdecec;
  --success: #1f9d6b;
  --success-soft: #e9f7f1;
  --warn: #b47c1a;
  --warn-soft: #fdf4e3;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(6, 43, 69, 0.05), 0 4px 14px rgba(6, 43, 69, 0.04);
  --shadow-md: 0 10px 34px rgba(6, 43, 69, 0.13);
  --sidebar-w: 240px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

html.modal-open,
html.modal-open body {
  overflow: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--brand-dark);
  text-decoration: none;
}

a:hover {
  color: var(--brand-deep);
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(0, 160, 233, 0.18);
}

:focus-visible {
  outline: 2px solid rgba(0, 160, 233, 0.5);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-thumb {
  background: #c9d5e0;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

.icon {
  flex: none;
  display: block;
}

.mono {
  font-family: var(--mono);
  font-size: 0.92em;
  letter-spacing: 0.01em;
}

.num {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.text-warn {
  color: var(--warn);
  font-weight: 600;
}

.text-brand {
  color: var(--brand-dark);
}

.block {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.noscript {
  margin: 40px auto;
  max-width: 560px;
  padding: 24px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  text-align: center;
}

/* --------------------------------------------------------------------------
   启动 / 登录
   -------------------------------------------------------------------------- */

.boot {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(900px 500px at 50% 40%, #0d4a70 0%, #062b45 55%, #041f30 100%);
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
}

.boot-brand {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(150deg, #0aa7ee, #0076ae);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.boot .spinner {
  border-color: rgba(255, 255, 255, 0.16);
  border-top-color: var(--gold);
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 160, 233, 0.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: tc-spin 0.8s linear infinite;
}

@keyframes tc-spin {
  to {
    transform: rotate(360deg);
  }
}

.login-root {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(420px, 0.94fr);
  background: var(--bg);
}

.login-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 56px clamp(36px, 6vw, 90px);
  color: #fff;
  background: radial-gradient(1100px 620px at 12% 8%, #10567f 0%, #062b45 46%, #041f30 100%);
}

.login-brand-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(ellipse at 35% 40%, #000 0%, transparent 74%);
  mask-image: radial-gradient(ellipse at 35% 40%, #000 0%, transparent 74%);
  pointer-events: none;
}

.login-brand::after {
  content: "";
  position: absolute;
  left: -18%;
  bottom: -34%;
  width: 76%;
  height: 76%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 160, 233, 0.18), transparent 66%);
  pointer-events: none;
}

.login-brand-inner {
  position: relative;
  z-index: 2;
  max-width: 520px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-logo-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(150deg, #0aa7ee, #0076ae);
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 10px 24px rgba(0, 0, 0, 0.26);
}

.login-logo-text strong {
  display: block;
  font-size: 22px;
  letter-spacing: 0.16em;
  line-height: 1.1;
}

.login-logo-text small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.44);
  font-size: 9.5px;
  letter-spacing: 0.22em;
}

.login-eyebrow {
  margin-top: 54px;
  color: var(--gold);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.24em;
}

.login-headline {
  margin-top: 14px;
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.login-headline em {
  font-style: normal;
  background: linear-gradient(92deg, #d8bd82 0%, #f0e0b7 55%, #c8a45d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-sub {
  margin-top: 18px;
  max-width: 380px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  line-height: 1.8;
}

.login-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 34px;
  max-width: 400px;
}

.login-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12.5px;
  backdrop-filter: blur(4px);
}

.login-points li span {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.login-quote {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.38);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.login-brand-ring {
  position: absolute;
  right: -150px;
  top: 50%;
  width: 440px;
  height: 440px;
  margin-top: -220px;
  border-radius: 50%;
  border: 1px solid rgba(200, 164, 93, 0.18);
  pointer-events: none;
}

.login-brand-ring::before,
.login-brand-ring::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.login-brand-ring::before {
  inset: 54px;
}

.login-brand-ring::after {
  inset: 120px;
  border-color: rgba(0, 160, 233, 0.22);
}

.login-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 40px clamp(24px, 5vw, 70px);
}

.login-card {
  width: min(410px, 100%);
  padding: 34px 34px 30px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}

.login-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.login-mobile-brand .login-logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 17px;
}

.login-mobile-brand .login-logo-text strong {
  color: var(--ink);
  font-size: 18px;
}

.login-mobile-brand .login-logo-text small {
  color: var(--muted);
}

.login-title {
  margin-top: 8px;
  color: var(--ink);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.login-subtitle {
  margin-top: 8px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.login-form .field {
  gap: 7px;
}

.login-form input {
  height: 42px;
  background: #fbfdff;
}

.password-wrap {
  position: relative;
  display: block;
}

.password-wrap input {
  padding-right: 58px;
}

.password-toggle {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
}

.password-toggle:hover {
  background: #f1f6fa;
  color: var(--text);
}

.login-error {
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--danger-soft);
  border: 1px solid #f6d5d5;
  color: var(--danger-dark);
  font-size: 12.5px;
  line-height: 1.6;
}

.login-hint {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
  text-align: center;
}

.login-hint code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #f2f6fa;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11px;
}

.login-foot {
  color: #9aa9b8;
  font-size: 11px;
  text-align: center;
}

.btn-block {
  width: 100%;
}

/* --------------------------------------------------------------------------
   基础组件
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #08a5ec 0%, #0085c6 100%);
  border-color: #0085c6;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 160, 233, 0.22);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #14aef2 0%, #007ab8 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 160, 233, 0.28);
}

.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--text-2);
}

.btn-ghost:hover:not(:disabled) {
  border-color: #c8d8e6;
  background: #fafcfe;
  color: var(--ink);
}

.btn-subtle {
  background: #eef5fb;
  border-color: #e2edf6;
  color: var(--brand-dark);
}

.btn-subtle:hover:not(:disabled) {
  background: #e4f1fb;
  color: var(--brand-deep);
}

.btn-danger-solid {
  background: linear-gradient(135deg, #dd5454 0%, #c23c3c 100%);
  border-color: #c23c3c;
  color: #fff;
  box-shadow: 0 4px 12px rgba(214, 69, 69, 0.2);
}

.btn-danger-solid:hover:not(:disabled) {
  background: linear-gradient(135deg, #e46060 0%, #b23636 100%);
  color: #fff;
}

.btn-danger-ghost {
  background: #fff8f8;
  border-color: #f0d0d0;
  color: var(--danger);
}

.btn-danger-ghost:hover:not(:disabled) {
  background: var(--danger-soft);
  border-color: #e8bcbc;
  color: var(--danger-dark);
}

.btn-sm {
  height: 30px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 12px;
}

.btn-sm .icon {
  width: 14px;
  height: 14px;
}

.btn.is-busy {
  gap: 7px;
}

.btn.is-busy .spinner {
  width: 13px;
  height: 13px;
  border-width: 2px;
}

.btn-primary.is-busy .spinner,
.btn-danger-solid.is-busy .spinner {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  background: #f2f6fa;
  color: var(--ink);
  border-color: var(--line);
}

.topbar-action {
  border-color: var(--line);
  background: #fff;
  color: var(--text-2);
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef5fb;
  border: 1px solid #dfeaf4;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.chip-gold {
  background: var(--gold-soft);
  border-color: rgba(200, 164, 93, 0.28);
  color: var(--gold-dark);
}

/* ------------------------------- 表单 -------------------------------- */

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select {
  height: 38px;
  padding: 0 11px;
}

textarea {
  display: block;
  padding: 9px 11px;
  line-height: 1.65;
  resize: vertical;
}

select {
  padding-right: 30px;
}

input::placeholder,
textarea::placeholder {
  color: #a9b7c4;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #61c4ef;
  box-shadow: 0 0 0 3px rgba(0, 160, 233, 0.12);
}

input[readonly] {
  background: #f7fafc;
  color: var(--text-2);
}

input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field-label {
  display: block;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
}

.field-label em {
  color: var(--danger);
  font-style: normal;
  font-weight: 700;
}

.field-hint {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.field-error {
  display: block;
  color: var(--danger);
  font-size: 11.5px;
  line-height: 1.5;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea,
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #e0a0a0;
  background: #fffafa;
}

input[aria-invalid="true"]:focus,
textarea[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.1);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.input-sm {
  height: 32px !important;
  padding: 0 8px !important;
  font-size: 12px !important;
  border-radius: 6px !important;
}

.json-editor {
  min-height: 260px;
  background: #f8fafc;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
}

.cover-field {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cover-inputs {
  flex: 1;
  min-width: 0;
}

.cover-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.image-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.image-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.image-preview-item {
  display: inline-flex;
  width: 54px;
  height: 54px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f7fafc;
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   主框架
   -------------------------------------------------------------------------- */

.app {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  padding: 0 14px;
  color: #fff;
  background: linear-gradient(180deg, #0b4266 0%, #062b45 50%, #041f30 100%);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.04);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 76px;
  padding: 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  flex: none;
}

.brand:hover {
  color: #fff;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(150deg, #0aa7ee, #0076ae);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 6px 16px rgba(0, 0, 0, 0.22);
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--gold);
  box-shadow: 0 0 0 2px #062b45;
}

.brand-text strong {
  display: block;
  font-size: 18px;
  letter-spacing: 0.16em;
  line-height: 1.1;
}

.brand-text small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 8.5px;
  letter-spacing: 0.2em;
}

.side-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0 18px;
  scrollbar-width: thin;
}

.side-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
}

.nav-group-label {
  padding: 14px 12px 6px;
  color: rgba(255, 255, 255, 0.34);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  margin: 2px 0;
  padding: 0 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13.5px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item .icon {
  opacity: 0.8;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(0, 160, 233, 0.24), rgba(0, 160, 233, 0.07));
  color: #fff;
  font-weight: 600;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #5bc8f5, var(--gold));
}

.nav-item.active .icon {
  opacity: 1;
  color: #7fd4f7;
}

.side-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 10px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex: none;
}

.side-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(200, 164, 93, 0.13);
}

.side-foot strong {
  display: block;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11.5px;
  font-weight: 600;
}

.side-foot span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.36);
  font-size: 10.5px;
}

.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: var(--sidebar-w);
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.crumb-root {
  flex: none;
}

.crumb-sep {
  color: #c2cedb;
}

#crumb-current {
  overflow: hidden;
  color: var(--ink);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.admin-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.admin-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #0b4a70, #062b45);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.admin-meta strong {
  display: block;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
}

.admin-meta small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.2;
}

.mobile-nav {
  display: none;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.mobile-nav::-webkit-scrollbar {
  display: none;
}

.mobile-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 7px 11px;
  border-radius: 999px;
  background: #f3f7fa;
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
}

.mobile-nav a.active {
  background: var(--ink);
  color: #fff;
}

.view {
  flex: 1;
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 24px 28px 10px;
}

.view-loading {
  padding: 40px 0;
}

.app-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 22px 28px 26px;
  color: #9aa9b8;
  font-size: 11px;
}

/* --------------------------------------------------------------------------
   页面标题 / 卡片
   -------------------------------------------------------------------------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.page-title {
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.page-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card + .card,
.card + .dash-grid,
.dash-grid + .card {
  margin-top: 16px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line-2);
}

.card-title {
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.4;
}

.card-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.card-body {
  padding: 20px;
}

.card-body.flush {
  padding: 0;
}

.filter-card {
  margin-bottom: 16px;
}

.filter-card + .card {
  margin-top: 0;
}

/* --------------------------------------------------------------------------
   列表 / 表格
   -------------------------------------------------------------------------- */

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.list-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tabs-scroll {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-scroll::-webkit-scrollbar {
  display: none;
}

.tabs {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid #e6edf4;
  border-radius: 10px;
  background: #eef3f8;
  max-width: 100%;
}

.tab {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  background: #fff;
  color: var(--brand-dark);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(6, 43, 69, 0.15);
}

.search {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  min-width: 270px;
  padding: 0 4px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.search:focus-within {
  border-color: #61c4ef;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 160, 233, 0.1);
}

.search-icon {
  display: grid;
  place-items: center;
  color: #93a5b7;
  flex: none;
}

.search input {
  flex: 1;
  width: auto !important;
  min-width: 120px;
  height: 34px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 12.5px;
}

.select {
  width: auto;
  min-width: 128px;
  height: 36px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text-2);
  font-size: 12.5px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  min-width: 700px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.table th {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: #7a8ca0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-2);
  color: var(--text);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr {
  transition: background 0.12s ease;
}

.table tbody tr:hover {
  background: #fbfdff;
}

.table .mono {
  white-space: nowrap;
}

.table.compact th {
  padding: 9px 14px;
}

.table.compact td {
  padding: 10px 14px;
}

.th-right,
.td-right {
  text-align: right !important;
}

.cell-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cell-main strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
}

.cell-sub {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
  word-break: break-word;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}

.link {
  color: var(--brand-dark);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.link:hover {
  color: var(--brand-deep);
  text-decoration: underline;
}

/* -------------------------------- 徽标 -------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}

.badge-info {
  background: #eaf6fd;
  border-color: #d3edfb;
  color: #0b77b5;
}

.badge-success {
  background: #eaf7f1;
  border-color: #d2eedf;
  color: #187a55;
}

.badge-warn {
  background: #fdf5e5;
  border-color: #f5e4be;
  color: #94610f;
}

.badge-danger {
  background: #fdeded;
  border-color: #f6d5d5;
  color: #b23a3a;
}

.badge-muted {
  background: #f2f5f8;
  border-color: #e5ebf1;
  color: #64798c;
}

.badge-brand {
  background: #eaf8ff;
  border-color: #ccecfb;
  color: #0079b6;
}

.badge-gold {
  background: #fbf5e8;
  border-color: #efe2c6;
  color: #8a6a2f;
}

/* ------------------------------- 分页 -------------------------------- */

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-top: 1px solid var(--line-2);
}

.pager-info {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.pager-info strong {
  color: var(--text-2);
  font-weight: 600;
}

.page-size {
  width: auto;
  height: 28px;
  padding: 0 24px 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text-2);
  font-size: 11.5px;
}

.pager-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.page-btn:hover:not(:disabled) {
  border-color: #bfd6e6;
  color: var(--ink);
}

.page-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 600;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-ellipsis {
  padding: 0 4px;
  color: #a8b6c4;
  font-size: 12px;
}

/* ----------------------------- 加载 / 空态 ---------------------------- */

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 54px 20px;
  color: var(--muted);
  font-size: 12.5px;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 54px 20px;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: #f1f6fa;
  color: #93a8ba;
}

.empty-title {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
}

.empty-desc {
  margin-top: 4px;
  max-width: 380px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.empty .btn {
  margin-top: 16px;
}

.empty-actions {
  display: flex;
  justify-content: center;
  padding: 0 20px 40px;
  margin-top: -26px;
}

.state-error .empty-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

/* --------------------------------------------------------------------------
   看板
   -------------------------------------------------------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -44px;
  top: -52px;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 160, 233, 0.1), transparent 68%);
  pointer-events: none;
}

.stat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-top: -2px;
  border-radius: 9px;
  background: #eef7fd;
  color: var(--brand-dark);
}

.stat-value {
  margin-top: 10px;
  color: var(--ink);
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.stat-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
}

.stat-gold .stat-icon {
  background: var(--gold-soft);
  color: var(--gold-dark);
}

.stat-gold::after {
  background: radial-gradient(circle, rgba(200, 164, 93, 0.13), transparent 68%);
}

.stat-ink .stat-icon {
  background: #e9eff5;
  color: var(--ink-2);
}

.stat-slate .stat-icon {
  background: #f0f3f6;
  color: #64798c;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr);
  gap: 16px;
  margin-bottom: 16px;
}

.dash-grid-bottom {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
}

.dash-grid .card {
  margin: 0;
  min-width: 0;
}

.chart-body {
  padding: 10px 18px 14px;
}

.chart {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 236px;
  padding: 10px 4px 0;
}

.chart-grid {
  position: absolute;
  left: 0;
  right: 0;
  top: 30px;
  height: 160px;
  background-image: repeating-linear-gradient(
    to top,
    var(--line-2) 0,
    var(--line-2) 1px,
    transparent 1px,
    transparent 40px
  );
  pointer-events: none;
}

.chart-col {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
  min-width: 0;
}

.chart-val {
  display: block;
  width: 100%;
  height: 20px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 20px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-track {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 160px;
}

.chart-bar {
  display: block;
  width: min(38px, 58%);
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #4cc5f5 0%, #00a0e9 56%, #087fb9 100%);
  box-shadow: 0 6px 14px rgba(0, 160, 233, 0.17);
}

.chart-x {
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.4;
}

.chart-sub {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.pending-body {
  padding: 12px 14px 14px;
}

.pending-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pending-item + .pending-item {
  margin-top: 4px;
}

.pending-item:hover {
  background: #f7fafd;
  border-color: var(--line);
  color: inherit;
}

.pending-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  background: #f1f6fa;
  color: var(--text-2);
}

.pending-item.has-items .pending-icon {
  background: var(--warn-soft);
  color: var(--warn);
}

.pending-meta {
  flex: 1;
  min-width: 0;
}

.pending-meta strong {
  display: block;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
}

.pending-meta small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.pending-count {
  color: var(--ink);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pending-item.has-items .pending-count {
  color: var(--warn);
}

.pending-arrow {
  color: #b6c6d4;
}

.stock-list {
  padding: 2px 0;
}

.stock-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 76px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line-2);
}

.stock-row:last-child {
  border-bottom: 0;
}

.stock-meta {
  min-width: 0;
}

.stock-meta strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-meta span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef3f8;
}

.stock-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f3b64b, #e59a2b);
}

.stock-num {
  text-align: right;
}

.stock-num strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stock-num small {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
}

.mini-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 9px;
  background: #f7fbf9;
  border: 1px solid #e2f0ea;
}

.mini-empty-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
}

.mini-empty strong {
  display: block;
  font-size: 12.5px;
  color: var(--text);
}

.mini-empty p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
}

.recent-table {
  min-width: 640px;
}

/* --------------------------------------------------------------------------
   订单 / 售后详情
   -------------------------------------------------------------------------- */

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.modal-body .table {
  min-width: 520px;
}

.modal-body .sku-table {
  min-width: 900px;
}

.detail-eyebrow {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.detail-no {
  margin-top: 4px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-all;
}

.detail-time {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.detail-status {
  flex: none;
  padding-top: 2px;
}

.detail-block {
  padding: 18px 0;
  border-bottom: 1px solid var(--line-2);
}

.detail-block:last-child {
  padding-bottom: 4px;
  border-bottom: 0;
}

.detail-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.detail-title::before {
  content: "";
  width: 3px;
  height: 14px;
  flex: none;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand), var(--gold));
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 22px;
}

.detail-grid-2 {
  gap: 14px 22px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.detail-item-block {
  gap: 5px;
}

.detail-label {
  color: var(--muted);
  font-size: 11.5px;
}

.detail-value {
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}

.order-item-text {
  min-width: 0;
}

.order-item-text strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}

.order-item-text span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.amount-list {
  padding: 12px 16px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #f8fafc;
}

.amount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  color: var(--text-2);
  font-size: 12.5px;
}

.amount-row.total {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed #d8e2ec;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.address-box {
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #fbfdff;
}

.address-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.address-line strong {
  color: var(--ink);
  font-size: 13px;
}

.address-line span {
  color: var(--text-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.address-box p {
  margin-top: 5px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.65;
  word-break: break-word;
}

.note-box {
  margin-top: 2px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.65;
  word-break: break-word;
  white-space: pre-wrap;
}

.note-box.is-empty {
  color: var(--muted);
  font-style: italic;
}

.invoice-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 40px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.6;
}

.invoice-box strong {
  color: var(--text);
  font-weight: 600;
}

.express-line {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f2f9fe;
  border: 1px solid #dceffa;
  color: var(--text-2);
  font-size: 12.5px;
}

.logistics-list {
  margin-top: 10px;
}

.logistics-list li {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line-2);
  font-size: 12px;
}

.logistics-list li:last-child {
  border-bottom: 0;
}

.logistics-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.logistics-text {
  color: var(--text-2);
}

.timeline {
  padding-left: 4px;
}

.timeline-item {
  position: relative;
  padding: 0 0 16px 20px;
  border-left: 1px solid var(--line);
}

.timeline-item:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}

.timeline-dot {
  position: absolute;
  left: -4px;
  top: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px #eaf6fd;
}

.timeline-content strong {
  display: block;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
}

.timeline-content span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
}

.alert-box {
  padding: 12px 14px;
  border: 1px solid #d9edfa;
  border-radius: 10px;
  background: #f2f9fe;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.65;
}

.alert-box + .form-grid {
  margin-top: 14px;
}

.alert-box strong {
  color: var(--text);
  font-weight: 600;
}

.alert-box p {
  margin-top: 4px;
}

.alert-box .link {
  display: inline-block;
  margin-top: 6px;
}

.alert-box.alert-warn {
  border-color: #f3e4c4;
  background: #fef9ef;
}

.alert-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.alert-head .num {
  margin-left: auto;
  color: var(--ink);
  font-weight: 700;
}

.reason-box {
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #fbfdff;
}

.reason-box strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.reason-box p {
  margin-top: 5px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.proof-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.proof {
  position: relative;
  width: 96px;
  height: 96px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f4f7fa;
  overflow: hidden;
}

.proof img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.proof-hint {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 0;
  background: rgba(6, 43, 69, 0.72);
  color: #fff;
  font-size: 10.5px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.proof:hover .proof-hint {
  opacity: 1;
}

/* -------------------------------- 缩略图 ------------------------------- */

.thumb {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1f5f9;
  color: #9aaaba;
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb img.is-broken {
  display: none;
}

.thumb-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 4px;
  font-size: 9.5px;
}

.thumb img.is-broken + .thumb-fallback {
  display: flex;
}

.thumb-sm {
  width: 38px;
  height: 38px;
}

.thumb-md {
  width: 52px;
  height: 52px;
}

.thumb-lg {
  width: 76px;
  height: 76px;
}

.thumb-wide {
  width: 126px;
  height: 56px;
  border-radius: 7px;
}

.thumb-empty {
  color: #9aaaba;
}

.thumb-button {
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 7px;
}

.thumb-button:hover .thumb {
  border-color: #b9d8e9;
}

/* --------------------------------------------------------------------------
   商品 / 优惠券 / 用户 / 评价
   -------------------------------------------------------------------------- */

.product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.product-cell-text {
  min-width: 0;
}

.product-cell-text strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
}

.products-table,
.coupons-table,
.orders-table,
.aftersales-table,
.users-table,
.reviews-table,
.banners-table {
  min-width: 820px;
}

.sku-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.sku-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.sku-head .detail-title {
  margin-bottom: 4px;
}

.sku-head .field-hint {
  margin-top: 0;
}

.sku-table {
  min-width: 900px;
}

.sku-table th,
.sku-table td {
  padding: 8px;
}

.sku-table .input-sm {
  min-width: 72px;
}

.sku-table td:first-child .input-sm {
  min-width: 150px;
}

.status-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.5;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #b5c2ce;
}

.status-dot.is-ok {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}

.status-dot.is-off {
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-soft);
}

.rating-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.stars {
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 1.5px;
  line-height: 1;
}

.review-cell {
  max-width: 340px;
}

.review-text {
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.65;
  word-break: break-word;
  white-space: pre-wrap;
}

.review-thumbs {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.review-thumb {
  width: 38px;
  height: 38px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f7fa;
}

.review-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}

.user-cell-text {
  min-width: 0;
}

.user-cell-text strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #eff5fa;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar img.is-broken {
  display: none;
}

.avatar-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.avatar img.is-broken + .avatar-fallback {
  display: grid;
}

.avatar-text {
  background: linear-gradient(135deg, #e7f3fb, #dcebf6);
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   设置 / 内容
   -------------------------------------------------------------------------- */

.settings-card {
  margin-bottom: 16px;
}

.settings-card + .settings-card {
  margin-top: 0;
}

.settings-card:last-of-type {
  margin-bottom: 0;
}

.settings-actions {
  margin-top: 16px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}

.settings-grid .field.full {
  grid-column: 1 / -1;
}

.settings-actions {
  position: static;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.settings-actions .field-hint {
  margin-left: auto;
}

.content-note {
  margin-top: 16px;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast-root {
  position: fixed;
  top: 78px;
  left: 50%;
  right: auto;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(460px, calc(100vw - 40px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-md);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.55;
  pointer-events: auto;
  animation: tc-toast-in 0.18s ease;
}

@keyframes tc-toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.toast-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.toast-close {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #a7b5c2;
}

.toast-close:hover {
  background: #f2f6fa;
  color: var(--text);
}

.toast-success {
  border-left-color: var(--success);
}

.toast-success .toast-icon {
  background: var(--success-soft);
  color: var(--success);
}

.toast-error {
  border-left-color: var(--danger);
}

.toast-error .toast-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.toast-info .toast-icon {
  background: #eef5fb;
  color: var(--brand-dark);
}

/* --------------------------------------------------------------------------
   弹窗 / 抽屉 / 图片预览
   -------------------------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 24, 38, 0.5);
  backdrop-filter: blur(2px);
  animation: tc-fade-in 0.15s ease;
}

.modal-overlay.is-drawer {
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
}

@keyframes tc-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-panel {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(88vh, 900px);
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(2, 18, 30, 0.32);
  animation: tc-pop-in 0.18s ease;
}

@keyframes tc-pop-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-sm {
  width: min(430px, 100%);
}

.modal-md {
  width: min(600px, 100%);
}

.modal-lg {
  width: min(780px, 100%);
}

.modal-xl {
  width: min(1020px, 100%);
}

.drawer-panel {
  width: min(660px, 100%);
  height: 100%;
  max-height: none;
  border-radius: 14px 0 0 14px;
  animation: tc-slide-in 0.2s ease;
}

@keyframes tc-slide-in {
  from {
    transform: translateX(28px);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex: none;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line-2);
}

.modal-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-x {
  width: 30px;
  height: 30px;
  flex: none;
}

.modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  flex: none;
  padding: 13px 20px;
  border-top: 1px solid var(--line-2);
  background: #fcfdff;
}

.modal-foot:empty {
  display: none;
}

.confirm {
  padding: 2px 0;
}

.confirm-text {
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.7;
  word-break: break-word;
}

.confirm-note {
  margin-top: 8px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  word-break: break-word;
}

.lightbox {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}

.lightbox img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 8px;
  object-fit: contain;
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 1240px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
  }

  .stat-value {
    font-size: 23px;
  }
}

@media (max-width: 1080px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-grid,
  .dash-grid-bottom {
    grid-template-columns: minmax(0, 1fr);
  }

  .dash-grid-top .card:first-child {
    order: 1;
  }

  .dash-grid-top .card:last-child {
    order: 2;
  }

  .pending-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 980px) {
  .login-root {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-brand {
    display: none;
  }

  .login-mobile-brand {
    display: flex;
  }

  .login-panel {
    min-height: 100vh;
    padding: 28px 20px 36px;
    background: radial-gradient(600px 360px at 50% -10%, #eaf6fc, transparent 70%), var(--bg);
  }

  .login-card {
    border-radius: 14px;
  }
}

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
  }

  .mobile-nav {
    display: flex;
    position: sticky;
    top: 58px;
    z-index: 85;
  }

  .topbar {
    height: 58px;
    padding: 0 16px;
  }

  .view {
    padding: 18px 16px 8px;
  }

  .app-foot {
    padding: 18px 16px 22px;
  }

  .admin-meta {
    display: none;
  }

  .admin-chip {
    padding: 3px;
  }

  .page-title {
    font-size: 20px;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1;
  }

  .list-toolbar {
    align-items: stretch;
  }

  .list-toolbar-right {
    width: 100%;
  }

  .list-toolbar-right .select {
    flex: 1;
  }

  .search {
    min-width: 0;
    flex: 1 1 240px;
  }

  .settings-actions {
    bottom: 8px;
  }

  .settings-actions .field-hint {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  .stat-grid {
    gap: 12px;
  }

  .stat-card {
    padding: 14px 14px 13px;
  }

  .stat-value {
    font-size: 20px;
  }

  .form-grid,
  .settings-grid,
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-card {
    padding: 26px 22px 24px;
  }

  .login-title {
    font-size: 22px;
  }

  .modal-overlay {
    padding: 10px;
    align-items: flex-end;
  }

  .modal-panel {
    width: 100%;
    max-height: calc(100vh - 20px);
    border-radius: 14px 14px 10px 10px;
  }

  .modal-overlay.is-drawer {
    padding: 0;
  }

  .drawer-panel {
    border-radius: 0;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-head {
    padding: 14px 16px;
  }

  .modal-foot {
    padding: 12px 16px;
  }

  .card-head {
    padding: 14px 15px;
  }

  .card-body {
    padding: 15px;
  }

  .page-head {
    gap: 12px;
  }

  .settings-actions {
    padding: 12px;
    bottom: 6px;
  }

  .settings-actions .btn {
    flex: 1;
  }

  .pager {
    padding: 12px 14px;
  }

  .pager-info {
    width: 100%;
    justify-content: space-between;
  }

  .pager-btns {
    width: 100%;
  }

  .page-btn {
    flex: 1;
  }

  .chart {
    gap: 5px;
    height: 218px;
  }

  .chart-track {
    height: 142px;
  }

  .chart-grid {
    top: 30px;
    height: 142px;
  }

  .chart-val {
    font-size: 9px;
  }

  .chart-sub {
    display: none;
  }

  .stock-row {
    grid-template-columns: minmax(0, 1fr) 64px 64px;
  }

  .cover-field {
    flex-direction: column;
    align-items: stretch;
  }

  .thumb-wide {
    width: 100%;
    height: 96px;
  }

  .toast-root {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    transform: none;
  }

  .empty-actions {
    margin-top: -18px;
    padding-bottom: 28px;
  }

  .pending-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "top icon" "value icon" "sub icon";
    align-items: center;
    column-gap: 10px;
  }

  .stat-top {
    grid-area: top;
  }

  .stat-icon {
    grid-area: icon;
  }

  .stat-value {
    grid-area: value;
    margin-top: 6px;
  }

  .stat-sub {
    grid-area: sub;
    margin-top: 2px;
  }

  .page-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .page-actions .btn {
    width: 100%;
  }

  .tabs {
    padding: 3px;
  }

  .tab {
    padding: 0 10px;
  }

  .admin-chip {
    display: none;
  }

  .topbar-right {
    margin-left: auto;
  }

  .login-points {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- 账号安全 / 修改密码 ---- */
.password-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.password-tip {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f7f9fb;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.7;
}

.password-form .form-error {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12.5px;
  line-height: 1.6;
}

.password-form .form-error[hidden] {
  display: none;
}

.login-security {
  margin: 8px 0 0;
  text-align: center;
  color: #9aa8b6;
  font-size: 11.5px;
  letter-spacing: 0.4px;
}


/* 用户详情 */
.user-detail-head { display: flex; align-items: center; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.user-detail-head .avatar { width: 64px; height: 64px; flex: 0 0 64px; }
.user-detail-meta h3 { margin: 0 0 4px; font-size: 20px; color: var(--ink); }
.user-detail-meta p { margin: 3px 0; color: var(--muted); font-size: 12px; }
.detail-section { margin-top: 20px; }
.detail-section h4 { margin: 0 0 10px; font-size: 14px; color: var(--ink); }
.detail-list { display: grid; gap: 8px; }
.detail-list-item { padding: 10px 12px; border-radius: 8px; background: var(--bg); display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.detail-list-row { flex-direction: row; justify-content: space-between; gap: 12px; }
.detail-list-item strong { color: var(--text); font-weight: 600; }

/* 客服消息 */
.support-thread-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 2px 0 14px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.support-messages { max-height: 340px; overflow: auto; padding: 16px 0; display: flex; flex-direction: column; gap: 12px; }
.support-message { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.support-message-admin { align-items: flex-end; }
.support-message-bubble { max-width: 78%; padding: 10px 13px; border-radius: 4px 14px 14px 14px; background: var(--bg); color: var(--text); font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.support-message-admin .support-message-bubble { border-radius: 14px 4px 14px 14px; background: var(--ink); color: #fff; }
.support-message-time { font-size: 11px; color: var(--muted); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-muted { background: var(--line-2); color: var(--muted); }
@media (max-width: 720px) {
  .user-detail-head { align-items: flex-start; }
  .support-messages { max-height: 46vh; }
  .support-message-bubble { max-width: 88%; }
}


/* 看板周期切换 / 横向滚动趋势 */
.range-tabs { display: inline-flex; padding: 3px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.range-tab { border: 0; background: transparent; color: var(--text-2); padding: 6px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.range-tab.active { background: var(--ink); color: #fff; }
.chart-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
.chart-scroll .chart { min-height: 236px; }
@media (max-width: 520px) {
  .range-tabs { width: 100%; justify-content: space-between; }
  .range-tab { flex: 1; padding: 6px 4px; }
}


/* 手机后台：核心列表只保留最常用列，减少横向滑动 */
@media (max-width: 720px) {
  .orders-table,
  .users-table,
  .support-table {
    min-width: 0;
  }
  .orders-table th:nth-child(2), .orders-table td:nth-child(2),
  .orders-table th:nth-child(3), .orders-table td:nth-child(3) {
    display: none;
  }
  .users-table th:nth-child(2), .users-table td:nth-child(2),
  .users-table th:nth-child(3), .users-table td:nth-child(3),
  .users-table th:nth-child(4), .users-table td:nth-child(4),
  .users-table th:nth-child(5), .users-table td:nth-child(5) {
    display: none;
  }
  .support-table th:nth-child(2), .support-table td:nth-child(2),
  .support-table th:nth-child(3), .support-table td:nth-child(3),
  .support-table th:nth-child(5), .support-table td:nth-child(5) {
    display: none;
  }
  .table th, .table td { padding: 9px 8px; }
  .row-actions { flex-wrap: wrap; gap: 5px; }
  .month-picker { width: 100%; }
}


/* 客服状态筛选 */
.status-tabs { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.status-tab { border: 0; background: transparent; color: var(--text-2); padding: 7px 11px; border-radius: 6px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.status-tab.active { background: var(--ink); color: #fff; }
@media (max-width: 720px) { .status-tabs { width: 100%; overflow-x: auto; } .status-tab { flex: none; } }
