/* 设备预约系统 · 浅色主题样式 */

:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --border: #e5e9f2;
  --border-strong: #d5dbe8;
  --text: #1b2333;
  --text-2: #4a5568;
  --muted: #7a8699;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eaf1ff;
  --success: #16a34a;
  --success-soft: #e9f8ef;
  --warn: #d97706;
  --warn-soft: #fff6e8;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 48px rgba(16, 24, 40, .16);
  --topbar-h: 58px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

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

.hidden { display: none !important; }
.ta-r { text-align: right; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.mt { margin-top: 8px; }

/* ------------------------------ 顶栏 ------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 6px 5px 5px 5px;
  border-radius: 2px;
  border: 2px solid rgba(255, 255, 255, .95);
  border-top-width: 5px;
}

.nav {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav a:hover { background: #f1f4f9; text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--success-soft);
  color: #15803d;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.announcement {
  background: linear-gradient(90deg, #eef4ff, #f6f0ff);
  color: #3730a3;
  border-bottom: 1px solid #dfe6fb;
  padding: 9px 20px;
  font-size: 13px;
  text-align: center;
}

.view {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 20px 40px;
}

.footer {
  padding: 18px 20px 28px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* ------------------------------ 通用组件 ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { border-color: #b9c2d4; background: #fafbfd; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-icon { width: 34px; padding: 0; font-size: 17px; line-height: 1; }

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

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

.btn-danger-ghost { color: var(--danger); border-color: #f2caca; background: #fff; }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: #e9b3b3; }

.btn-warn { color: var(--warn); border-color: #f0d3a4; background: #fff; }
.btn-warn:hover { background: var(--warn-soft); }

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

.input, .select {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
textarea.input { height: auto; padding: 8px 11px; resize: vertical; line-height: 1.6; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

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

.panel-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
}
.panel-head .panel-title { margin: 0; }

.count {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 999px;
  background: #eef1f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.tip { color: var(--muted); font-size: 12px; margin: 8px 0 0; }

.loading {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.empty h3 { margin: 0 0 6px; color: var(--text-2); font-size: 15px; }
.empty p { margin: 0; font-size: 13px; }
.empty.error { border-color: #f2caca; background: var(--danger-soft); color: #b91c1c; }
.empty.error h3 { color: #b91c1c; }

.empty-row { text-align: center; color: var(--muted); padding: 28px; }

/* ------------------------------ 工具栏 ------------------------------ */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  padding: 14px;
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tool-group { display: flex; align-items: center; gap: 8px; }
.tool-group.right { margin-left: auto; }
.tool-group .select { width: 240px; }

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

.week-nav { gap: 6px; }
.week-range { margin-left: 6px; color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }

.segmented {
  display: inline-flex;
  padding: 3px;
  background: #f1f4f9;
  border-radius: 999px;
}
.segmented button {
  padding: 5px 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.segmented button.active { background: #fff; color: var(--primary-dark); font-weight: 600; box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }

/* ------------------------------ 日历 ------------------------------ */

.cal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.eq-card { display: flex; align-items: center; gap: 10px; }
.eq-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.eq-name { font-weight: 700; }
.eq-sub { color: var(--muted); font-size: 12px; }
.eq-desc { color: var(--text-2); font-size: 12px; }

.legend { display: flex; gap: 14px; color: var(--muted); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-approved { background: #dbeafe; border-left: 3px solid #2563eb; }
.lg-pending { background: var(--warn-soft); border-left: 3px solid #d97706; }
.lg-past { background: #f1f3f7; }

.cal-scroll {
  overflow: auto;
  max-height: 72vh;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cal-grid {
  display: grid;
  grid-template-columns: 62px repeat(7, minmax(122px, 1fr));
  min-width: 940px;
}

.cal-time-col { position: sticky; left: 0; z-index: 3; background: #fff; border-right: 1px solid var(--border); }
.cal-time-slots { padding-top: 0; }
.time-label {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-right: 8px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  transform: translateY(-6px);
}

.cal-day { border-left: 1px solid var(--border); min-width: 0; }
.cal-day.is-today { background: #fcfdff; }
.cal-day.is-closed .cal-day-body { background: repeating-linear-gradient(45deg, #fafbfc, #fafbfc 8px, #f3f4f7 8px, #f3f4f7 16px); }

.cal-day-head {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 6px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.cal-day.is-today .cal-day-head { background: #f5f9ff; }
.cal-day-head .dow { font-weight: 600; font-size: 12px; }
.cal-day-head .dnum { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.cal-day-head .usage { width: 100%; text-align: center; color: var(--muted); font-size: 11px; }

.cal-day-body { position: relative; }
.cal-slot { border-bottom: 1px dashed #f0f2f7; cursor: pointer; }
.cal-slot.hour { border-bottom: 1px solid var(--border); }
.cal-slot.past { background: #fafbfc; cursor: not-allowed; }
.cal-slot:hover { background: var(--primary-soft); }
.cal-slot.past:hover { background: #f1f3f7; }

.bk {
  position: absolute;
  left: 3px;
  right: 3px;
  padding: 3px 7px;
  border-radius: 6px;
  border-left: 3px solid var(--primary);
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  cursor: pointer;
  transition: filter .15s, transform .1s;
}
.bk:hover { filter: brightness(.97); transform: translateY(-1px); }
.bk-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.bk-name { font-weight: 600; }
.bk-purpose { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-pending { border-left-style: dashed; }

/* ------------------------------ 设备总览 ------------------------------ */

.ov-scroll { overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.ov { width: 100%; min-width: 900px; border-collapse: collapse; }
.ov th, .ov td { border: 1px solid var(--border); padding: 8px; vertical-align: top; }
.ov thead th { background: #f8fafc; font-size: 12px; font-weight: 600; text-align: center; }
.ov thead th.is-today { background: var(--primary-soft); color: var(--primary-dark); }
.ov-date { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.ov-eq, .ov-eq-head { width: 190px; background: #f8fafc; text-align: left; }
.ov-eq-name { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.ov-eq-sub { color: var(--muted); font-size: 11px; }
.ov-cell { height: 66px; cursor: pointer; transition: background .12s; }
.ov-cell:hover { background: #f7faff; }
.ov-cell.is-today { background: #fbfdff; }
.ov-cell.is-closed { background: #f6f7f9; cursor: not-allowed; }
.ov-empty { color: #b6bfcd; font-size: 11px; }
.ov-empty-row { text-align: center; color: var(--muted); padding: 30px; }

.chip {
  padding: 2px 6px;
  margin-bottom: 3px;
  border-radius: 5px;
  border-left: 3px solid var(--primary);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.chip-pending { border-left-style: dashed; }
.chip-more { color: var(--primary); font-size: 11px; cursor: pointer; }

/* ------------------------------ 表格 ------------------------------ */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.table thead th { background: #f8fafc; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.table tbody tr:hover { background: #fafbfd; }
.cell-strong { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.cell-sub { color: var(--muted); font-size: 12px; }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.tag-approved { background: var(--success-soft); color: #15803d; }
.tag-pending { background: var(--warn-soft); color: #b45309; }
.tag-rejected { background: var(--danger-soft); color: #b91c1c; }
.tag-cancelled { background: #f1f3f7; color: #6b7280; }
.tag-blue { background: var(--primary-soft); color: var(--primary-dark); }
.tag-gray { background: #f1f3f7; color: #6b7280; }
.tag-eq-available { background: var(--success-soft); color: #15803d; }
.tag-eq-maintenance { background: var(--warn-soft); color: #b45309; }
.tag-eq-retired { background: #f1f3f7; color: #6b7280; }
.tag-ext { background: var(--primary-soft); color: var(--primary-dark); margin-left: 4px; }
.tag-user-pending { background: var(--warn-soft); color: #b45309; }
.tag-user-active { background: var(--success-soft); color: #15803d; }
.tag-user-disabled { background: #f1f3f7; color: #6b7280; }
.tag-user-rejected { background: var(--danger-soft, #fee2e2); color: #b91c1c; }

/* ------------------------------ 登录 / 注册 ------------------------------ */

.auth-wrap {
  max-width: 420px;
  margin: 40px auto 60px;
}
.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 28px 24px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-brand h1 { font-size: 19px; margin: 0 0 6px; }
.auth-brand p { margin: 0; color: var(--muted); font-size: 13px; }
.auth-tabs {
  display: flex;
  gap: 4px;
  background: #f1f3f7;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 18px;
}
.auth-tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 8px 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.auth-tab.active { background: #fff; color: var(--primary-dark); box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08); }
.auth-form .field { margin-bottom: 14px; }
.auth-tip { text-align: center; font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.auth-tip a { color: var(--primary); text-decoration: none; font-weight: 500; }
.auth-tip a:hover { text-decoration: underline; }
.auth-tip.muted { font-size: 12px; margin-top: 6px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }
.btn-block { width: 100%; display: block; }
.sep { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

.readonly-box {
  padding: 9px 12px;
  border-radius: 8px;
  background: #f1f3f7;
  border: 1px solid var(--border);
  font-size: 14px;
}
.nowrap { white-space: nowrap; }
.warn-text { color: #b45309; }
.nav-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  margin-left: 5px;
  vertical-align: middle;
}
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.chip-filter {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
  cursor: pointer;
}
.chip-filter b { color: inherit; }
.chip-filter.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.panel-tools { display: flex; gap: 8px; align-items: center; }
.input-sm { padding: 6px 10px; font-size: 13px; }

/* 设备表单：外链开关 */
.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.check-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.ext-field { display: flex; flex-direction: column; gap: 6px; }
.ext-field .input { margin-top: 0; }
.field-hint { font-size: 12px; color: var(--muted); line-height: 1.5; }
.input-disabled { opacity: 0.5; background: #f1f3f7; cursor: not-allowed; }
.ext-tip {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  line-height: 1.5;
}

/* 预约成功跳转弹窗 */
.ext-jump {
  text-align: center;
  padding: 6px 0 2px;
}
.ext-jump .ext-icon { font-size: 34px; line-height: 1; margin-bottom: 10px; }
.ext-jump p { margin: 0 0 14px; color: var(--muted); font-size: 13px; word-break: break-all; }
.ext-jump .btn-primary { min-width: 200px; }

/* ------------------------------ 统计 ------------------------------ */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat-value { font-size: 24px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-card.stat-warn .stat-value { color: var(--warn); }
.stat-card.stat-ok .stat-value { color: var(--success); }

.mini-chart { display: flex; align-items: flex-end; gap: 14px; height: 130px; padding-top: 6px; }
.mini-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.mini-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.mini-bar {
  width: 60%;
  min-height: 3px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  transition: height .3s;
}
.mini-x { color: var(--muted); font-size: 11px; }
.mini-v { font-size: 12px; font-weight: 600; }

.rank-list { display: flex; flex-direction: column; gap: 9px; }
.rank-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.rank-no {
  width: 20px; height: 20px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 5px; background: #eef1f7; color: var(--muted); font-size: 11px; font-weight: 700;
}
.rank-name { width: 160px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar { flex: 1; height: 8px; background: #eef1f7; border-radius: 999px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #60a5fa, #2563eb); }
.rank-val { color: var(--muted); font-size: 12px; white-space: nowrap; }

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

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 12px;
  margin-bottom: 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.filter-bar .field { margin: 0; }
.filter-bar .input { width: 150px; }
.filter-bar .grow .input { width: 200px; }

.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.inline-form .field { min-width: 180px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field.span2 { grid-column: span 2; }
.field label { color: var(--text-2); font-size: 12px; font-weight: 600; }
.field label b { color: var(--danger); font-weight: 700; }
.field.grow { flex: 1; }

.check-row { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 400 !important; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

.color-picker { display: flex; gap: 8px; padding-top: 4px; }
.color-dot {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}
.color-dot.active { border-color: #fff; box-shadow: 0 0 0 2px var(--primary); }

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

.form-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 12px;
  margin: 4px 0 10px;
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--primary-dark);
}
.sum-item b { font-size: 13px; }

.form-error {
  padding: 8px 12px;
  margin-bottom: 10px;
  background: var(--danger-soft);
  border: 1px solid #f2caca;
  border-radius: var(--radius-sm);
  color: #b91c1c;
  font-size: 12px;
}
.hint-box {
  padding: 8px 12px;
  margin: 0 0 12px;
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  color: var(--primary-dark);
  font-size: 12px;
}

.confirm-text { margin: 0 0 12px; font-size: 13px; color: var(--text-2); }

.detail { display: grid; grid-template-columns: 64px 1fr; gap: 8px 12px; margin: 0; font-size: 13px; }
.detail dt { color: var(--muted); font-size: 12px; }
.detail dd { margin: 0; }

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

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px 16px;
  background: rgba(15, 23, 42, .38);
  opacity: 0;
  transition: opacity .18s;
  overflow-y: auto;
}
.modal-mask.show { opacity: 1; }

.modal {
  width: 100%;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  transform: translateY(-8px);
  transition: transform .18s;
}
.modal-mask.show .modal { transform: translateY(0); }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.modal-close {
  width: 28px; height: 28px;
  border: none; border-radius: 6px;
  background: transparent; color: var(--muted);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.modal-close:hover { background: #f1f4f9; color: var(--text); }

.modal-body { padding: 18px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: #fafbfd;
  border-radius: 0 0 14px 14px;
}

/* ------------------------------ Toast ------------------------------ */

.toast-root {
  position: fixed;
  top: 70px;
  left: 50%;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  padding: 9px 18px;
  border-radius: 999px;
  background: #1f2937;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .24);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #15803d; }
.toast-error { background: #b91c1c; }
.toast-warn { background: #b45309; }

/* ------------------------------ 其他 ------------------------------ */

.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .topbar { gap: 12px; padding: 0 12px; }
  .brand span:last-child { display: none; }
  .view { padding: 14px 12px 32px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span2 { grid-column: span 1; }
  .tool-group .select { width: 100%; }
  .tool-group.right { margin-left: 0; width: 100%; justify-content: space-between; }
  .rank-name { width: 100px; }
}
