/* ===== 基础 ===== */
:root {
  --blue: #2878ff;
  --blue-dark: #1c62e0;
  --blue-soft: #eaf2ff;
  --ink: #182132;
  --ink-2: #4a5568;
  --ink-3: #7d879b;
  --line: #e6eaf2;
  --line-2: #eef1f7;
  --bg: #f4f6fb;
  --white: #fff;
  --green: #12a05c;
  --green-soft: #e6f7ef;
  --amber: #b5730a;
  --amber-soft: #fff5e2;
  --red: #d93a3a;
  --red-soft: #fdecec;
  --gray-soft: #f1f3f8;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 31, 61, .05);
  --shadow: 0 8px 24px rgba(16, 31, 61, .08);
  --shadow-lg: 0 24px 60px rgba(16, 31, 61, .18);
  --side-w: 236px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
[hidden] { display: none !important; }

::selection { background: #cfe0ff; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ===== 通用控件 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s, border-color .16s, color .16s, transform .06s, box-shadow .16s;
}
.btn:hover { border-color: #d3dbea; background: #fafbfe; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(40, 120, 255, .22);
}
.btn.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn.primary:disabled { box-shadow: none; }

.btn.ghost { background: transparent; }
.btn.ghost:hover { background: #f3f6fc; }

.btn.danger { color: var(--red); border-color: #f2cfcf; background: #fff; }
.btn.danger:hover { background: var(--red-soft); border-color: #e9b4b4; }

.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--blue);
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--red); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover { background: var(--gray-soft); color: var(--ink); }
.icon-btn svg { width: 19px; height: 19px; }

input, select, textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  transition: border-color .16s, box-shadow .16s;
}
textarea { resize: vertical; min-height: 76px; line-height: 1.55; }
select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.6 4.4 6 7.8l3.4-3.4' fill='none' stroke='%237d879b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
}
input:hover, select:hover, textarea:hover { border-color: #d3dbea; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(40, 120, 255, .14);
}
input::placeholder, textarea::placeholder { color: #a8b1c3; }
input[type="color"] { padding: 3px; width: 52px; min-height: 38px; cursor: pointer; }
input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; accent-color: var(--blue); cursor: pointer; }

select:disabled, input:disabled, textarea:disabled { background: #f7f9fc; color: var(--ink-3); cursor: not-allowed; }

/* ===== 表单结构 ===== */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid .span-2 { grid-column: span 2; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field > em { font-size: 12px; font-style: normal; color: var(--ink-3); }
.field input, .field select, .field textarea { font-size: 14px; }

.image-field { display: flex; flex-direction: column; gap: 8px; }
.image-field .image-file { display: none; }
.image-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.image-actions .btn { padding: 7px 12px; font-size: 13px; }
.image-status { color: var(--ink-3); font-size: 12px; }
.image-preview:empty { display: none; }
.image-preview {
  width: 92px;
  height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  font-size: 12px;
  color: var(--ink-3);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 6px;
}
.image-preview img { width: 100%; height: 100%; object-fit: cover; }

.form-msg {
  margin: 0;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid #f4d4d4;
}
.form-msg.ok { background: var(--green-soft); color: var(--green); border-color: #c8ecda; }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.panel > .form-actions { margin-top: 4px; }

.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type="color"] { flex: 0 0 auto; }

/* ===== 店铺设置分区 ===== */
.settings-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.settings-tab {
  flex: 0 0 auto;
  padding: 9px 16px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .16s, color .16s;
}
.settings-tab:hover { background: var(--blue-soft); color: var(--blue-dark); }
.settings-tab.active { background: var(--blue); color: #fff; }
.settings-tab:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.settings-pane { display: flex; flex-direction: column; gap: 16px; }
.settings-pane[hidden] { display: none; }

.field-group { display: flex; flex-direction: column; gap: 10px; }
.field-group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.field-group-head > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field-group-head > em { font-size: 12px; font-style: normal; color: var(--ink-3); }

.link-button-list { display: flex; flex-direction: column; gap: 8px; }
.link-button-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; gap: 8px; align-items: center; }
.link-button-row input { min-width: 0; }
.link-button-empty { font-size: 12.5px; color: var(--ink-3); }
.field-group > .btn { align-self: flex-start; }

.check-row { display: flex; flex-wrap: wrap; gap: 10px; }
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  background: #fff;
  font-size: 13px;
  color: var(--ink-2);
  transition: border-color .16s, background .16s;
}
.check:hover { border-color: #cfdcf5; }
.check:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 23px;
  border-radius: 99px;
  background: #d8dfec;
  transition: background .18s;
}
.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .18s;
}
.switch input:checked + .switch-ui { background: var(--blue); }
.switch input:checked + .switch-ui::after { transform: translateX(17px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ===== 登录 / 初始化 ===== */
.auth {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
  background:
    radial-gradient(900px 460px at 12% -8%, #e8f0ff 0%, rgba(232, 240, 255, 0) 62%),
    radial-gradient(700px 400px at 92% 108%, #eef3ff 0%, rgba(238, 243, 255, 0) 60%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 424px;
  padding: 32px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(16, 31, 61, .1);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-logo {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, #4b8dff, #1f63e8);
  box-shadow: 0 6px 16px rgba(40, 120, 255, .3);
  position: relative;
}
.auth-logo::after {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 3px;
  background: #fff;
  clip-path: polygon(0 0, 46% 0, 46% 54%, 100% 54%, 100% 100%, 54% 100%, 54% 46%, 0 46%);
}
.auth-brand-text { display: flex; flex-direction: column; line-height: 1.35; }
.auth-brand-text strong { font-size: 15px; }
.auth-brand-text small { font-size: 12px; color: var(--ink-3); }
.auth-card h1 { font-size: 21px; letter-spacing: -.01em; margin-bottom: 6px; }
.auth-desc { font-size: 13px; color: var(--ink-3); margin-bottom: 22px; }
.auth-foot { margin-top: 20px; font-size: 12px; color: #a3adc0; text-align: center; }
.auth-card .btn.primary { height: 42px; margin-top: 4px; }

/* ===== 主框架 ===== */
.shell { display: flex; min-height: 100%; }

/* 侧边栏：白底 + 蓝色选中 */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--side-w);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--line);
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 68px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line-2);
  flex: 0 0 auto;
}
.side-logo {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #4b8dff, #1c62e0);
  box-shadow: 0 4px 12px rgba(40, 120, 255, .3);
}
.side-brand-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.side-brand-text strong {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-brand-text small { font-size: 11px; color: var(--ink-3); letter-spacing: .04em; }

.nav { flex: 1 1 auto; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: .72; }
.nav-item:hover { background: #f5f8fe; color: var(--ink); }
.nav-item:hover svg { opacity: .95; }
.nav-item.active {
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-weight: 600;
}
.nav-item.active svg { opacity: 1; color: var(--blue); }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--blue);
}
.nav-sep { height: 1px; margin: 10px 12px; background: var(--line-2); }

.side-foot { flex: 0 0 auto; padding: 14px; border-top: 1px solid var(--line-2); }
.side-version { margin-top: 10px; text-align: center; font-size: 11px; color: #b3bccd; }

.main {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: var(--side-w);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 68px;
  padding: 0 26px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }

.content { padding: 24px 26px 56px; max-width: 1240px; width: 100%; }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(20, 30, 50, .38);
  backdrop-filter: blur(1px);
  animation: fade .18s ease;
}

/* ===== 视图 ===== */
.view { animation: rise .2s ease; }
.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.view-head h2 { font-size: 22px; letter-spacing: -.015em; }
.view-head .muted { margin-top: 4px; }
.view-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.view-actions select { width: auto; min-width: 150px; }

.muted { font-size: 13px; color: var(--ink-3); }

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}
.panel + .panel, .split + .panel, .stats + .panel, .panel + .split { margin-top: 16px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h3 { font-size: 15px; font-weight: 650; }

.split { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.split > .panel { margin: 0; }
.panel.narrow { max-width: 520px; }

.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--red-soft);
  border: 1px solid #f4d4d4;
  color: var(--red);
  font-size: 13px;
}
.alert-text { flex: 1 1 auto; }

.notice-bar {
  margin-bottom: 16px;
  padding: 12px 15px;
  border-radius: 10px;
  background: var(--blue-soft);
  border: 1px solid #d3e2ff;
  color: #24509f;
  font-size: 13px;
  line-height: 1.7;
}

/* ===== 统计卡 ===== */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stats.mini { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat {
  position: relative;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  right: -26px;
  top: -26px;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--blue-soft);
  opacity: .75;
}
.stat-label { position: relative; font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.stat-value { position: relative; margin-top: 8px; font-size: 25px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat.accent { background: linear-gradient(135deg, #2f7dff, #1c5fe0); border-color: transparent; }
.stat.accent .stat-label { color: rgba(255, 255, 255, .82); }
.stat.accent .stat-value { color: #fff; }
.stat.accent::after { background: rgba(255, 255, 255, .14); }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; margin: 0 -18px -18px; padding: 0 18px 4px; }
.panel > .table-wrap:first-child { margin-top: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 0 12px 10px;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafcff; }
.table .num { font-variant-numeric: tabular-nums; }
.table .strong { font-weight: 600; }
.table .nowrap { white-space: nowrap; }
.table .actions { display: flex; gap: 12px; justify-content: flex-end; white-space: nowrap; }
.table .col-actions { text-align: right; }
.table .col-product { min-width: 150px; }
.table .col-order-id .clip { max-width: 168px; }
.table .col-contact .clip { max-width: 120px; }
@media (max-width: 1440px) {
  .table .opt-col { display: none; }
}
.table .sub { display: block; font-size: 12px; color: var(--ink-3); }
.table .clip {
  display: inline-block;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

/* 商品行 */
.product-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.product-cell-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.45; }
.thumb {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
  background: var(--gray-soft);
}
.thumb-ph {
  display: grid;
  place-items: center;
  font-size: 13px;
  color: var(--ink-3);
  border: 1px solid var(--line);
}

.view-actions .search { display: block; width: 268px; }
.view-actions .search input { padding-left: 12px; }

.empty {
  padding: 34px 12px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
}
.empty strong { display: block; color: var(--ink-2); font-size: 14px; font-weight: 600; margin-bottom: 4px; }

/* ===== 徽标 / 状态 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.7;
  white-space: nowrap;
  background: var(--gray-soft);
  color: var(--ink-2);
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.mute { background: var(--gray-soft); color: var(--ink-3); }
.topbar .badge.warn { margin-left: 2px; }

/* ===== 吐司 ===== */
.toasts {
  position: fixed;
  z-index: 200;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  color: var(--ink);
  animation: toastIn .2s ease;
  pointer-events: auto;
  word-break: break-word;
}
.toast::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--blue);
}
.toast.ok { border-color: #c8ecda; }
.toast.ok::before { background: var(--green); }
.toast.err { border-color: #f4d4d4; }
.toast.err::before { background: var(--red); }
.toast.out { animation: toastOut .18s ease forwards; }

/* ===== 弹窗 ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 18px;
  background: rgba(17, 26, 43, .45);
  backdrop-filter: blur(2px);
  overflow-y: auto;
  animation: fade .16s ease;
}
.modal {
  width: 100%;
  max-width: 620px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  animation: rise .2s ease;
}
.modal.sm { max-width: 420px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-2);
}
.modal-head h3 { font-size: 16px; font-weight: 650; }
.modal-body { padding: 20px 22px; }
.modal-body .form { gap: 15px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 22px;
  border-top: 1px solid var(--line-2);
  background: #fbfcfe;
  border-radius: 0 0 14px 14px;
}
.modal-text { font-size: 14px; color: var(--ink-2); line-height: 1.75; }
.modal-text strong { color: var(--ink); }

/* ===== 滚动条 ===== */
.nav::-webkit-scrollbar, .table-wrap::-webkit-scrollbar, .modal-backdrop::-webkit-scrollbar { width: 8px; height: 8px; }
.nav::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb, .modal-backdrop::-webkit-scrollbar-thumb {
  background: #d9e0ec; border-radius: 8px;
}
.nav::-webkit-scrollbar-thumb:hover, .modal-backdrop::-webkit-scrollbar-thumb:hover { background: #c6d0e0; }

/* ===== 动画 ===== */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* ===== 响应式 ===== */
@media (max-width: 1180px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(16, 31, 61, .18); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; height: 60px; }
  .topbar-title { font-size: 16px; }
  .content { padding: 18px 16px 48px; }
  .view-head h2 { font-size: 19px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: span 1; }
  .view-actions { width: 100%; }
  .view-actions select, .view-actions .search { flex: 1 1 160px; }
  .view-actions .search { width: auto; }
  .stats.mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .link-button-row { grid-template-columns: minmax(0, 1fr); }
  .view-actions .search input { min-width: 0; }
  .modal-backdrop { padding: 16px 12px; align-items: flex-start; }
  .auth-card { padding: 24px 20px; }
}

@media (max-width: 560px) {
  .stats, .stats.mini { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat-value { font-size: 20px; }
  .panel { padding: 14px; }
  .table-wrap { margin: 0 -14px -14px; padding: 0 14px 4px; }
  .table th, .table td { padding: 10px 8px; }
  .toasts { right: 12px; left: 12px; bottom: 12px; max-width: none; }
  .table .clip { max-width: 160px; }
  .topbar-right .btn { padding: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
