/* ============================================================
   吉灵 Hub 管理后台 · 暖白杏橙现代风
   奶白底 + 杏橙主色 + 精致侧边栏 + 顶栏 + 卡片布局
   ============================================================ */
:root {
  --bg: #f6f3ee;
  --bg-card: #ffffff;
  --bg-soft: #faf6ef;
  --bg-hover: #fbf4ea;
  --border: #ece3d6;
  --border-strong: #ddcfbc;
  --fg: #3d3228;
  --fg-muted: #85745f;
  --fg-subtle: #b3a48d;
  --primary: #e08a45;
  --primary-hover: #cc7634;
  --primary-soft: #fbe9d3;
  --success: #3e9b6c;
  --success-bg: #e4f3ea;
  --warning: #c08a2d;
  --warning-bg: #faf0d8;
  --danger: #d9685c;
  --danger-bg: #fbeae7;
  --info: #5b8fc7;
  --info-bg: #e8f0f9;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 2px rgba(93, 68, 42, 0.04), 0 4px 16px rgba(93, 68, 42, 0.06);
  --shadow-pop: 0 8px 30px rgba(93, 68, 42, 0.14);
  --shadow-modal: 0 24px 60px rgba(60, 40, 20, 0.22);
  --font: -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Consolas", "Menlo", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(224, 138, 69, 0.06), transparent);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 18px;
}
.brand__logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: transparent;
  color: var(--primary);
  border: 1.6px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand__logo svg { width: 30px; height: 30px; display: block; }
.login-card__logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: transparent;
  color: var(--primary);
  border: 1.6px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.login-card__logo svg { width: 40px; height: 40px; display: block; }
.brand__text { min-width: 0; }
.brand__name { font-size: 16px; font-weight: 700; color: var(--fg); line-height: 1.3; letter-spacing: 0.3px; }
.brand__sub { font-size: 11.5px; color: var(--fg-subtle); letter-spacing: 0.5px; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 11px; color: var(--fg-subtle); font-weight: 600; letter-spacing: 1px; padding: 14px 10px 6px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--fg-muted);
  font-size: 14.5px;
  font-weight: 500;
  font-family: inherit;
  text-align: left;
  transition: background 0.16s, color 0.16s, transform 0.1s;
}
.nav-item:hover { background: var(--bg-hover); color: var(--fg); }
.nav-item:active { transform: scale(0.98); }
.nav-item--active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item__icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.75; }
.nav-item--active .nav-item__icon { opacity: 1; }

.sidebar__foot {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-soft);
}
.user-info { font-size: 13px; color: var(--fg); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-info small { display: block; color: var(--fg-subtle); font-weight: 400; font-size: 11px; }

/* ---------- 主内容 ---------- */
.main { flex: 1; min-width: 0; padding: 0 32px 56px; }
.tab-panel { display: none; }
.tab-panel--active { display: block; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 4px 14px;
  margin-bottom: 8px;
}
.topbar__title h1 { font-size: 20px; font-weight: 700; color: var(--fg); letter-spacing: 0.2px; }
.topbar__title p { font-size: 13px; color: var(--fg-muted); margin-top: 1px; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }

/* ---------- 统计卡 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  position: relative;
  overflow: hidden;
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
}
.stat-card::after {
  content: '';
  position: absolute;
  right: -22px;
  top: -22px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 138, 69, 0.12), transparent 70%);
  opacity: 0;
  transition: opacity 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); border-color: var(--border-strong); }
.stat-card:hover::after { opacity: 1; }
.stat-card--active { border-color: var(--primary); background: var(--primary-soft); }
.stat-card--active::after { opacity: 1; }
.stat-card__label { font-size: 13px; color: var(--fg-muted); font-weight: 500; }
.stat-card__value { font-size: 28px; font-weight: 700; color: var(--fg); line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat-card__value--green { color: var(--success); }
.stat-card__value--amber { color: var(--warning); }
.stat-card__value--red { color: var(--danger); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--fg);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.25;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.btn:hover { background: var(--bg-hover); border-color: var(--primary); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(224, 138, 69, 0.3); }
.btn--primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn--danger { color: var(--danger); border-color: rgba(217, 104, 92, 0.4); }
.btn--danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--fg-muted); }
.btn--ghost:hover { background: var(--bg-hover); border-color: transparent; color: var(--fg); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn--sm { padding: 5px 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn--block { display: flex; width: 100%; padding: 11px 24px; font-size: 15px; font-weight: 600; }

/* ---------- 筛选栏 ---------- */
.toolbar { margin-bottom: 16px; }
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
}
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-group--grow { flex: 1; min-width: 220px; }
.filter-label { font-size: 12.5px; color: var(--fg-muted); font-weight: 600; }
.filter-bar input[type="search"],
.filter-bar select {
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-card);
  font-size: 14px;
  font-family: inherit;
  color: var(--fg);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.filter-bar input[type="search"] { min-width: 240px; }
.filter-bar input:focus, .filter-bar select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(224, 138, 69, 0.22);
}
.meta { align-self: center; color: var(--fg-subtle); font-size: 13px; margin-left: 4px; white-space: nowrap; }

/* ---------- 表格 ---------- */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th {
  background: var(--bg-soft);
  color: var(--fg-muted);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
td { font-size: 14px; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: var(--bg-hover); }
tbody tr:last-child td { border-bottom: none; }
.mono { font-family: var(--font-mono); font-size: 13px; }
.ops { white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.empty { text-align: center; color: var(--fg-subtle); padding: 56px 16px; font-size: 14px; }
.empty::before { content: '◌'; display: block; font-size: 34px; margin-bottom: 10px; opacity: 0.5; }

/* ---------- 状态徽章 ---------- */
.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.5;
  white-space: nowrap;
}
.badge--inactive { background: var(--warning-bg); color: var(--warning); }
.badge--active { background: var(--success-bg); color: var(--success); }
.badge--disabled { background: var(--danger-bg); color: var(--danger); }
.badge--info { background: var(--info-bg); color: var(--info); }

/* ---------- 分页 ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
  color: var(--fg-muted);
  font-size: 14px;
}
.pager .btn { min-width: 84px; }

/* ---------- 表单卡片 ---------- */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  max-width: 720px;
  box-shadow: var(--shadow-card);
}
.form-card--wide { max-width: 1100px; }
.form-card--hero { max-width: 980px; }
.form-hero { display: grid; grid-template-columns: 1.35fr 0.85fr; gap: 22px; align-items: start; }
.form-hero__main { min-width: 0; }
.form-hero__side {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.form-hero__side .section-label { margin-bottom: 12px; }
.side-fields { display: flex; flex-direction: column; gap: 0; }
.side-fields .form-row { margin-bottom: 12px; }
.side-fields .form-row:last-child { margin-bottom: 0; }
.batch-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 22px; align-items: start; }
.batch-grid__main { min-width: 0; }
.batch-grid__side {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.form-card__head h3 { color: var(--fg); font-size: 16px; font-weight: 700; margin-bottom: 4px; letter-spacing: 0.2px; }
.form-card__head .hint { margin-bottom: 20px; }
.hint { color: var(--fg-muted); font-size: 13px; margin-bottom: 18px; line-height: 1.7; }
.form-row { margin-bottom: 16px; }
.form-row--mac { margin-bottom: 8px; }
.form-row--mac input { font-family: var(--font-mono); letter-spacing: 0.6px; }
.form-card__section {
  margin: 14px 0 18px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.section-label { font-size: 12px; color: var(--fg-muted); font-weight: 600; letter-spacing: 0.4px; margin-bottom: 12px; }
.form-metas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-metas .form-row { margin-bottom: 0; }
.form-actions { margin-top: 10px; }
.form-card h3 { color: var(--fg); font-size: 16px; font-weight: 700; margin-bottom: 6px; letter-spacing: 0.2px; }
.form-row label {
  display: block;
  margin-bottom: 6px;
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 600;
}
.form-row input, .form-row textarea, .preset-col textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--fg);
  background: var(--bg-card);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-row input:focus, .form-row textarea:focus, .preset-col textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(224, 138, 69, 0.22);
}
.form-row input.invalid, .form-row textarea.invalid { border-color: var(--danger); }
.form-row input.invalid:focus, .form-row textarea.invalid:focus { box-shadow: 0 0 0 3px rgba(217, 104, 92, 0.2); }
.form-row textarea { font-family: var(--font-mono); resize: vertical; }
.form-card .btn--primary { padding: 8px 24px; font-size: 14px; }
.result { margin-top: 16px; }
.success {
  color: var(--success);
  padding: 10px 14px;
  background: var(--success-bg);
  border-radius: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.7;
}
.error {
  color: var(--danger);
  padding: 10px 14px;
  background: var(--danger-bg);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.7;
}

/* ---------- 表单校验提示 ---------- */
.field-hint { margin-top: 6px; font-size: 13px; color: var(--fg-subtle); min-height: 18px; }
.field-hint--error { color: var(--danger); font-weight: 500; }
.field-hint--ok { color: var(--success); }

/* ---------- 注册结果卡片 ---------- */
.reg-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
}
.reg-card__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.reg-card__row:last-child { border-bottom: none; }
.reg-card__row label { flex-shrink: 0; width: 72px; font-size: 13px; color: var(--fg-muted); font-weight: 600; }
.reg-card__value { flex: 1; min-width: 0; font-size: 14px; word-break: break-all; }

/* ---------- 绑定状态查询 ---------- */
.binding-query { margin-bottom: 22px; }
.binding-query__title { margin: 0 0 10px; font-size: 14px; color: var(--fg); font-weight: 700; }
.binding-query__row { display: flex; gap: 8px; }
.binding-query__row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--fg);
}
.binding-query__row input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(224, 138, 69, 0.22); }
.binding-query__result {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.binding-query__item { display: flex; gap: 12px; }
.binding-query__item > span:first-child { width: 90px; color: var(--fg-subtle); flex-shrink: 0; }
.binding-query__unbound { color: var(--danger); font-weight: 600; }
.binding-query__hint { color: var(--fg-subtle); }
.binding-query__err { color: var(--danger); }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__mask { position: absolute; inset: 0; background: rgba(61, 50, 40, 0.5); backdrop-filter: blur(2px); }
.modal__body {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 720px;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  animation: modalIn 0.2s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  font-size: 15px;
  font-weight: 700;
}
.modal__close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--fg-subtle);
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.modal__close:hover { background: var(--bg-hover); color: var(--fg); }
.modal__content { padding: 22px; overflow-y: auto; }
.modal__content h4 { color: var(--fg-muted); margin: 22px 0 12px; font-size: 14px; }
.trace-dev {
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 14px;
  line-height: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 4px 20px;
}
.trace-dev b { color: var(--fg-muted); font-weight: 600; }
.loading { text-align: center; color: var(--fg-subtle); padding: 32px; font-size: 14px; }
.loading::after {
  content: '';
  display: inline-block;
  width: 16px; height: 16px;
  margin-left: 8px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 时间线 ---------- */
.timeline { display: flex; flex-direction: column; gap: 8px; }
.tl-item {
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.tl-item__type {
  flex-shrink: 0;
  width: 56px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--warning);
}
.tl-item--auth .tl-item__type { background: var(--info); }
.tl-item--bind .tl-item__type { background: var(--success); }
.tl-item--session .tl-item__type { background: var(--primary); }
.tl-item__body { flex: 1; min-width: 0; }
.tl-item__detail { font-size: 14px; color: var(--fg); word-break: break-all; }
.tl-item__time { font-size: 12px; color: var(--fg-subtle); margin-top: 4px; }

/* ---------- 三要素复制卡片 ---------- */
.cred-card { display: flex; flex-direction: column; gap: 14px; }
.cred-row { display: flex; flex-direction: column; gap: 6px; }
.cred-row label { font-size: 12px; color: var(--fg-muted); font-weight: 600; }
.cred-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--bg-soft);
  color: var(--fg);
  cursor: text;
}
.cred-input:focus { outline: none; border-color: var(--primary); background: var(--bg-card); box-shadow: 0 0 0 3px rgba(224, 138, 69, 0.22); }

/* ---------- 注册结果区操作行 ---------- */
.opt-hint { color: var(--fg-subtle); font-weight: 400; font-size: 12px; }

/* ---------- 预设管理三列 ---------- */
.preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.preset-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.preset-card__header { display: flex; align-items: center; gap: 8px; }
.preset-card__header label { font-size: 13px; color: var(--fg); font-weight: 700; }
.preset-card__dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.preset-card__dot--model { background: var(--primary); }
.preset-card__dot--type { background: #5b8fc7; }
.preset-card__dot--factory { background: #3e9b6c; }
.preset-card__btn { align-self: flex-start; }
.preset-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; }
.preset-col__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.preset-col__hint { font-size: 11px; color: var(--fg-subtle); background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; }

/* ---------- 租户 / 管理员 / 客户 Key 双列布局 ---------- */
.tenant-layout,
.admin-layout,
.key-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.tenant-form,
.admin-form,
.key-form { display: flex; flex-direction: column; }
.tenant-form input,
.tenant-form select,
.admin-form input,
.admin-form select,
.key-form input,
.key-form textarea,
.key-form select { width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 14px; font-family: inherit; background: var(--bg-card); }
.tenant-form input:focus,
.admin-form input:focus,
.key-form input:focus,
.key-form textarea:focus,
.tenant-form select:focus,
.admin-form select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(224, 138, 69, 0.22); }
.tenant-table-wrap,
.admin-table-wrap { min-width: 0; }
.tenant-table-wrap .table-wrap,
.admin-table-wrap .table-wrap,
.key-layout .table-wrap { overflow-x: auto; }

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%) translateY(16px);
  background: #3d3228;
  color: #fff;
  padding: 11px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
  max-width: 80vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--shadow-pop);
}
.toast--show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 登录页 ---------- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.login-card {
  background: var(--bg-card);
  border-radius: 20px;
  box-shadow: var(--shadow-modal);
  padding: 44px 40px;
  width: 400px;
  max-width: 100%;
  border: 1px solid var(--border);
}
.login-card__logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f4ad6d, #dd7f3b);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 6px 18px rgba(221, 127, 59, 0.35);
}
.login-card h1 { text-align: center; margin: 0 0 4px; font-size: 22px; color: var(--fg); letter-spacing: 0.3px; }
.login-card .sub { text-align: center; color: var(--fg-subtle); font-size: 13px; margin-bottom: 30px; }
.login-card .form-row { margin-bottom: 18px; }
.login-card label { display: block; font-size: 13px; color: var(--fg-muted); font-weight: 600; margin-bottom: 6px; }
.login-card input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login-card input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(224, 138, 69, 0.22); }
.login-card .btn { width: 100%; margin-top: 10px; padding: 11px; font-size: 15px; font-weight: 600; }
.login-card .error { color: var(--danger); font-size: 13px; margin-top: 10px; text-align: center; display: none; }
.login-card .foot { text-align: center; margin-top: 18px; font-size: 13px; color: var(--fg-subtle); }
.login-card .foot a { color: var(--primary); text-decoration: none; font-weight: 600; }
.login-card .foot a:hover { text-decoration: underline; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .brand { padding: 14px 16px 10px; }
  .nav { flex-direction: row; overflow-x: auto; padding: 4px 12px; }
  .nav-label { display: none; }
  .nav-item { flex-shrink: 0; }
  .sidebar__foot { margin-top: 0; }
  .main { padding: 16px 16px 40px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .filter-group--grow { flex-basis: 100%; }
  .filter-group--grow input { width: 100%; }
  .form-hero, .batch-grid { grid-template-columns: 1fr; }
  .preset-grid { grid-template-columns: 1fr; }
  .tenant-layout,
  .admin-layout,
  .key-layout { grid-template-columns: 1fr; }
  .ops { flex-wrap: wrap; }
  .topbar { flex-direction: column; align-items: flex-start; }
}
