/* ============================================================
   提莫队长 · 管理后台
   Apple / iOS 风格
   ============================================================ */

:root {
  --bg:          #F4F5F7;
  --bg-deep:     #EDEFF3;
  --surface:     #FFFFFF;
  --surface-2:   #FAFBFC;
  --border:      #E4E7EC;
  --border-2:    #D5D9E0;

  --text:        #1D1D1F;
  --text-2:      #6E6E73;
  --text-3:      #A1A1A6;
  --text-4:      #C7C7CC;

  --blue:        #0071E3;
  --blue-lt:     #2E90FA;
  --blue-soft:   rgba(0, 113, 227, 0.10);

  --green:       #34C759;
  --green-soft:  rgba(52, 199, 89, 0.12);
  --amber:       #FF9F0A;
  --amber-soft:  rgba(255, 159, 10, 0.12);
  --red:         #FF3B30;
  --red-soft:    rgba(255, 59, 48, 0.10);

  --shadow-sm:   0 1px 3px rgba(120, 130, 145, 0.08);
  --shadow:      0 2px 8px rgba(120, 130, 145, 0.10);
  --shadow-lg:   0 8px 28px rgba(120, 130, 145, 0.14);

  --ease:        cubic-bezier(0.25, 0.8, 0.25, 1);
  --t:           all 0.28s cubic-bezier(0.25, 0.8, 0.25, 1);

  --radius:      14px;
  --radius-sm:   10px;

  --sidebar-w:   228px;
}

html[data-theme="dark"] {
  --bg:          #1A1C20;
  --bg-deep:     #15171A;
  --surface:     #24262B;
  --surface-2:   #2A2C32;
  --border:      #32353C;
  --border-2:    #3D4048;

  --text:        #F2F2F7;
  --text-2:      #A8A8B0;
  --text-3:      #6E6E78;
  --text-4:      #4A4A54;

  --blue:        #0A84FF;
  --blue-lt:     #409CFF;
  --blue-soft:   rgba(10, 132, 255, 0.15);

  --green:       #30D158;
  --green-soft:  rgba(48, 209, 88, 0.15);
  --amber:       #FFD60A;
  --red:         #FF453A;
  --red-soft:    rgba(255, 69, 58, 0.14);

  --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow:      0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-lg:   0 8px 28px rgba(0, 0, 0, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: -apple-system, "SF Pro Text", "PingFang SC",
               "Microsoft YaHei UI", system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s;
}

body { overflow: hidden; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ============ 登录页 ============ */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 20% -10%, rgba(0, 113, 227, 0.06), transparent 55%),
    radial-gradient(700px 400px at 90% 10%, rgba(255, 159, 10, 0.05), transparent 50%);
  z-index: 100;
}

html[data-theme="dark"] .login-screen {
  background-image:
    radial-gradient(900px 500px at 20% -10%, rgba(10, 132, 255, 0.10), transparent 55%),
    radial-gradient(700px 400px at 90% 10%, rgba(255, 214, 10, 0.05), transparent 50%);
}

.login-glow {
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.10), transparent 65%);
  filter: blur(50px);
  pointer-events: none;
  animation: glowFloat 10s var(--ease) infinite;
}

@keyframes glowFloat {
  0%, 100% { transform: translate(-40px, -30px) scale(1); }
  50%      { transform: translate(40px, 30px) scale(1.1); }
}

.login-box {
  position: relative;
  width: 380px;
  padding: 42px 36px 30px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  text-align: center;
  animation: boxIn 0.5s var(--ease) both;
}

@keyframes boxIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  color: var(--blue);
}

.login-logo svg { width: 100%; height: 100%; }

.login-title {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}

.login-sub {
  font-size: 12.5px;
  color: var(--text-3);
  margin-bottom: 28px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.field { position: relative; }

.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 7px;
  padding-left: 2px;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: var(--t);
}

.field input::placeholder { color: var(--text-4); }

.field input:focus {
  background: var(--surface);
  border-color: var(--blue);
  box-shadow: 0 0 0 3.5px var(--blue-soft);
}

.field.error input {
  border-color: var(--red);
  box-shadow: 0 0 0 3.5px var(--red-soft);
  animation: shake 0.4s var(--ease);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

.err {
  min-height: 15px;
  margin-top: 5px;
  padding-left: 3px;
  font-size: 11px;
  color: var(--red);
  opacity: 0;
  transition: var(--t);
}

.field.error .err { opacity: 1; }

.login-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-4);
}

/* ============ 按钮 ============ */
.btn-primary {
  height: 46px;
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, var(--blue-lt), var(--blue));
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.28);
  transition: var(--t);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 113, 227, 0.38);
}

.btn-primary:active:not(:disabled) { transform: translateY(0) scale(0.99); }

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost {
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: var(--t);
}

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

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

.btn-danger {
  height: 40px;
  padding: 0 18px;
  border: 1px solid rgba(255, 59, 48, 0.28);
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  color: var(--red);
  font-family: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: var(--t);
}

.btn-danger:hover:not(:disabled) {
  background: var(--red);
  color: #fff;
}

.btn-sm {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: var(--t);
}

.icon-btn svg { width: 17px; height: 17px; }

.icon-btn:hover {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--blue-soft);
}

/* ============ 主布局 ============ */
.app {
  display: flex;
  height: 100vh;
  background: var(--bg);
}

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: var(--t);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  color: var(--blue);
}

.brand-icon svg { width: 100%; height: 100%; }

.brand-name {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.brand-sub {
  font-size: 10.5px;
  color: var(--text-3);
  margin-top: 1px;
}

.nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--t);
  user-select: none;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: var(--t);
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.active {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 600;
}

.nav-item.active svg { transform: scale(1.05); }

.sidebar-foot {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 10px;
  background: var(--surface-2);
  min-width: 0;
}

.user-avatar {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--blue-lt), var(--blue));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.user-info { min-width: 0; }

.user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 1px;
}

.btn-logout {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: var(--t);
}

.btn-logout svg { width: 16px; height: 16px; }

.btn-logout:hover {
  background: var(--red-soft);
  color: var(--red);
}

/* 主内容区 */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 26px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.page-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.page-desc {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 3px;
}

.topbar-right {
  display: flex;
  gap: 8px;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 22px 26px 30px;
}

/* ============ 卡片 ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--t);
}

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

.card-title {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
}

.card-sub {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
}

/* 统计卡 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: var(--t);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-3);
  margin-bottom: 9px;
}

.stat-label svg { width: 14px; height: 14px; }

.stat-value {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.8px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  margin-left: 3px;
}

.stat-trend {
  font-size: 11px;
  margin-top: 6px;
  color: var(--text-3);
}

.stat-trend.up { color: var(--green); }
.stat-trend.warn { color: var(--amber); }
.stat-trend.bad { color: var(--red); }

/* ============ 表格 ============ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead {
  background: var(--surface-2);
}

th {
  padding: 11px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr {
  transition: background 0.15s;
}

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

.td-mono {
  font-family: "SF Mono", "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.2px;
  color: var(--text);
}

.td-strong {
  font-weight: 600;
  color: var(--text);
}

/* ============ 徽章 ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 21px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-blue   { background: var(--blue-soft);  color: var(--blue); }
.badge-green  { background: var(--green-soft); color: var(--green); }
.badge-amber  { background: var(--amber-soft); color: var(--amber); }
.badge-red    { background: var(--red-soft);   color: var(--red); }
.badge-gray   { background: var(--surface-2);  color: var(--text-3); }

/* ============ 工具栏 ============ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-3);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: var(--t);
}

.search-box input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.select {
  height: 38px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: var(--t);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%23A1A1A6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 14px;
}

.select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

/* ============ 分页 ============ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--text-3);
}

.page-btns {
  display: flex;
  gap: 6px;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: var(--t);
}

.page-btn:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
}

.page-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

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

/* ============ 空状态 ============ */
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-3);
}

.empty svg {
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  color: var(--text-4);
}

.empty-text {
  font-size: 13px;
  margin-bottom: 6px;
}

.empty-hint {
  font-size: 11.5px;
  color: var(--text-4);
}

/* ============ Toast ============ */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  white-space: nowrap;
  animation: toastIn 0.32s var(--ease) both;
}

.toast.ok  { color: var(--green); border-color: rgba(52, 199, 89, 0.3); }
.toast.err { color: var(--red);   border-color: rgba(255, 59, 48, 0.3); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.out { animation: toastOut 0.26s var(--ease) both; }

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}

/* ============ Modal ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: var(--t);
}

.modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: 380px;
  padding: 28px 26px 22px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  text-align: center;
  transform: scale(0.94) translateY(10px);
  transition: var(--t);
}

.modal-backdrop.show .modal {
  transform: scale(1) translateY(0);
}

.modal-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}

.modal-icon.ok   { background: var(--green-soft); color: var(--green); }
.modal-icon.err  { background: var(--red-soft);   color: var(--red); }
.modal-icon.warn { background: var(--amber-soft); color: var(--amber); }

.modal-title {
  font-size: 15.5px;
  font-weight: 650;
  margin-bottom: 9px;
}

.modal-body {
  font-size: 12.5px;
  line-height: 1.68;
  color: var(--text-2);
  white-space: pre-wrap;
  max-height: 260px;
  overflow-y: auto;
  text-align: left;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.modal-actions button {
  flex: 1;
  height: 40px;
}

/* ============ 加载 ============ */
.loading {
  padding: 50px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 12.5px;
}

.spinner {
  width: 26px;
  height: 26px;
  margin: 0 auto 12px;
  border: 2.5px solid var(--border-2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  :root { --sidebar-w: 64px; }

  .brand-text,
  .nav-item span,
  .user-info { display: none; }

  .brand { justify-content: center; padding: 18px 0; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .user-chip { justify-content: center; padding: 7px 0; }
  .sidebar-foot { flex-direction: column; }

  .content { padding: 16px 14px 24px; }
  .topbar { padding: 14px 16px; }
  .page-title { font-size: 17px; }
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .login-box { width: calc(100vw - 40px); padding: 32px 24px 24px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: none; }
}

/* ============ 趋势图 ============ */
.trend-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  height: 150px;
  padding-top: 10px;
}

.trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.trend-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.trend-bar {
  width: 70%;
  max-width: 34px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--blue-lt), var(--blue));
  transition: height 0.5s var(--ease);
  min-height: 4px;
  opacity: 0.85;
}

.trend-bar:hover { opacity: 1; }

.trend-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.trend-date {
  font-size: 10px;
  color: var(--text-4);
  margin-top: 2px;
  white-space: nowrap;
}

/* ============ 卡密类型列表 ============ */
.type-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.type-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: 8px;
  transition: var(--t);
}

.type-row:hover { background: var(--surface-2); }

.type-name {
  font-size: 12.5px;
  color: var(--text-2);
}

.type-num {
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.type-avail {
  font-weight: 700;
  color: var(--green);
}

.type-sep {
  color: var(--text-4);
  margin: 0 3px;
}

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

/* ============ Modal 内表单 ============ */
#modalBody .select,
#modalBody input[type="text"],
#modalBody input[type="password"],
#modalBody input[type="number"] {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: var(--t);
}

#modalBody .select:focus,
#modalBody input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

#modalBody select.select {
  height: 38px;
  padding: 0 30px 0 12px;
}

/* Modal 宽一点，容纳表单 */
.modal:has(#modalBody [id^="new"]) {
  width: 440px;
}

/* 表格内 checkbox */
input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--blue);
  cursor: pointer;
}

input[type="checkbox"]:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
