/* ============ KAM 共享设计系统 ============ */
:root {
  --bg: #0a0e1a;
  --bg-2: #0e1424;
  --card: rgba(255, 255, 255, 0.045);
  --card-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e7eaf3;
  --muted: #8b93a9;
  --dim: #5d6478;
  --accent: #22d3ee;
  --accent-2: #818cf8;
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --grad: linear-gradient(120deg, #22d3ee, #818cf8);
  --radius: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(700px 420px at 12% -8%, rgba(34, 211, 238, 0.13), transparent 60%),
    radial-gradient(760px 460px at 88% 4%, rgba(129, 140, 248, 0.13), transparent 60%),
    radial-gradient(900px 600px at 50% 110%, rgba(52, 211, 153, 0.06), transparent 60%);
}
a { color: var(--accent); text-decoration: none; }
::selection { background: rgba(34, 211, 238, 0.3); }

/* Logo（共享） */
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16.5px; letter-spacing: 0.5px; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--grad); flex: none;
  display: grid; place-items: center; color: #06121a; font-weight: 900; font-size: 14px;
  box-shadow: 0 4px 16px rgba(34,211,238,0.4);
}

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 20px; border-radius: 11px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; color: #06121a;
  background: var(--grad); box-shadow: 0 4px 20px rgba(34, 211, 238, 0.25);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), opacity 0.2s;
  user-select: none; white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(34, 211, 238, 0.38); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.ghost {
  background: transparent; color: var(--text); border-color: var(--border-strong); box-shadow: none;
}
.btn.ghost:hover { background: var(--card-hover); border-color: rgba(255,255,255,0.3); }
.btn.danger { background: linear-gradient(120deg, #f87171, #fb7185); color: #2a0709; box-shadow: 0 4px 20px rgba(248,113,113,0.25); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }
.btn.xs { padding: 4px 9px; font-size: 12px; border-radius: 8px; box-shadow: none; }

/* 输入 */
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; border-radius: 11px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: var(--text); font-size: 14px; outline: none; font-family: inherit;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.input:focus { border-color: rgba(34,211,238,0.55); box-shadow: 0 0 0 3px rgba(34,211,238,0.14); background: rgba(255,255,255,0.07); }
.input::placeholder { color: var(--dim); }
textarea.input { resize: vertical; min-height: 90px; }
select.input option { background: #131a2c; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; letter-spacing: 0.4px; }

/* 卡片 */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: border-color 0.3s, transform 0.3s var(--ease), background 0.3s;
}
.card.hover:hover { border-color: var(--border-strong); background: var(--card-hover); transform: translateY(-3px); }

/* 徽章 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3.5px 10px; border-radius: 99px; font-size: 12px; font-weight: 600;
  border: 1px solid transparent; line-height: 1.5; white-space: nowrap;
}
.badge.green { color: #6ee7b7; background: rgba(52,211,153,0.1); border-color: rgba(52,211,153,0.3); }
.badge.red { color: #fca5a5; background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.3); }
.badge.amber { color: #fcd34d; background: rgba(251,191,36,0.1); border-color: rgba(251,191,36,0.3); }
.badge.gray { color: #a8b0c3; background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.14); }
.badge.blue { color: #93c5fd; background: rgba(96,165,250,0.1); border-color: rgba(96,165,250,0.3); }

/* 模态框 */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(4, 7, 15, 0.66); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; transition: opacity 0.28s var(--ease); padding: 20px;
}
.modal-mask.show { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-width: 520px; max-height: 86vh; overflow: auto;
  background: linear-gradient(165deg, #131a2e, #0e1424);
  border: 1px solid var(--border-strong); border-radius: 18px; padding: 26px;
  transform: translateY(22px) scale(0.96); opacity: 0;
  transition: transform 0.34s var(--ease), opacity 0.3s;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
}
.modal-mask.show .modal { transform: translateY(0) scale(1); opacity: 1; }
.modal h3 { font-size: 17px; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.modal .modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* Toast */
#toasts { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 240px; max-width: 380px; padding: 13px 16px; border-radius: 13px; font-size: 13.5px;
  background: linear-gradient(160deg, #182036, #101627); border: 1px solid var(--border-strong);
  box-shadow: 0 14px 40px rgba(0,0,0,0.5); display: flex; gap: 9px; align-items: flex-start;
  animation: toastIn 0.4s var(--ease);
}
.toast.out { animation: toastOut 0.3s var(--ease) forwards; }
.toast .t-ico { font-size: 15px; line-height: 1.35; }
.toast.ok .t-ico { color: var(--green); }
.toast.err .t-ico { color: var(--red); }
.toast.info .t-ico { color: var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* 工具 */
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-family: ui-monospace, "SF Mono", Consolas, "Courier New", monospace; }
.spin {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.25); border-top-color: rgba(0,0,0,0.75);
  animation: rot 0.7s linear infinite; display: inline-block;
}
.spin.light { border-color: rgba(255,255,255,0.25); border-top-color: #fff; }
@keyframes rot { to { transform: rotate(360deg); } }

/* 表格 */
.tbl-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.tbl th {
  text-align: left; padding: 11px 13px; color: var(--muted); font-weight: 600; font-size: 12px;
  letter-spacing: 0.5px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.03);
  white-space: nowrap; position: sticky; top: 0;
}
.tbl td { padding: 11px 13px; border-bottom: 1px solid rgba(255,255,255,0.05); white-space: nowrap; }
.tbl tbody tr { transition: background 0.2s; }
.tbl tbody tr:hover { background: rgba(255,255,255,0.04); }
.tbl tbody tr:last-child td { border-bottom: none; }

/* 分页 */
.pager { display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin-top: 14px; font-size: 13px; color: var(--muted); }
.pager .pg-btns { display: flex; gap: 6px; }
.pager button {
  padding: 6px 12px; border-radius: 9px; background: var(--card); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; font-size: 13px; transition: all 0.2s;
}
.pager button:hover:not(:disabled) { border-color: var(--border-strong); background: var(--card-hover); }
.pager button:disabled { opacity: 0.35; cursor: not-allowed; }

/* 动画 */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
