/* 全站基础样式：设计变量、按钮、表单、弹窗、表格、提示 */

:root {
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #475569;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e5e8f0;
  --line-strong: #d7dbe7;
  --bg: #f6f7fb;
  --bg-2: #eef1f8;
  --panel: #ffffff;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-2: #7c3aed;
  --accent-soft: #eef0ff;
  --green: #059669;
  --green-soft: #e7f7ef;
  --red: #dc2626;
  --red-soft: #fdecec;
  --amber: #b45309;
  --amber-soft: #fff4e5;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 30px 70px -30px rgba(30, 27, 75, 0.35);
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0; }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.16s, border-color 0.16s, transform 0.16s, box-shadow 0.16s;
}
.btn:hover { background: #f8f9fd; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(79, 70, 229, 0.7);
}
/* 必须重新声明 background：.btn:hover 的特异性 (0,2,0) 高于 .btn-primary (0,1,0)，
   否则 hover 时背景会被刷成 #f8f9fd，而文字仍是白色 —— 白底白字，按钮看起来消失了。 */
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  filter: brightness(1.07);
  box-shadow: 0 10px 24px -9px rgba(79, 70, 229, 0.78);
}
.btn-primary:active { filter: brightness(0.98); }

.btn-outline { border-color: var(--line-strong); background: var(--panel); }
.btn-outline:hover { border-color: #c3c9da; background: var(--panel); }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f1f3fa; color: var(--ink-2); }

.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #fbdcdc; }

.btn-sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 11px; }
.btn-block { width: 100%; }

.btn svg { width: 15px; height: 15px; }

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

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 550; color: var(--ink-3); }
.field .hint { font-size: 11.5px; color: var(--faint); line-height: 1.6; }

.input, .textarea, .select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.textarea { height: auto; padding: 10px 12px; line-height: 1.65; resize: vertical; }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.input::placeholder, .textarea::placeholder { color: #a8b0c0; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%); background-position: calc(100% - 15px) 17px, calc(100% - 10px) 17px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }

/* ---------- 卡片 / 标签 ---------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 23px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f1f3fa;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.pill.is-green { background: var(--green-soft); color: var(--green); }
.pill.is-green .pill-dot { background: var(--green); }
.pill.is-amber { background: var(--amber-soft); color: var(--amber); }
.pill.is-amber .pill-dot { background: #f59e0b; }
.pill.is-blue { background: var(--accent-soft); color: var(--accent); }
.pill.is-blue .pill-dot { background: var(--accent); }
.pill.is-red { background: var(--red-soft); color: var(--red); }
.pill.is-red .pill-dot { background: var(--red); }

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

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.16s ease both;
}
.modal {
  width: min(460px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.modal h3 { font-size: 16.5px; margin-bottom: 4px; }
.modal .modal-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; line-height: 1.6; }
.modal-body { display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------- 提示 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 120;
  transform: translate(-50%, 12px);
  max-width: min(460px, calc(100vw - 40px));
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: rgba(185, 28, 28, 0.95); }

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

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--faint);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fbfcff; }
.table .num { font-variant-numeric: tabular-nums; }
.table .muted { color: var(--muted); }
.table .empty-row td { padding: 40px; text-align: center; color: var(--faint); }

/* ---------- 空状态 ---------- */

.empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state h3 { font-size: 15px; color: var(--ink-2); }
.empty-state p { font-size: 13px; line-height: 1.7; max-width: 460px; }
.empty-art { display: block; line-height: 0; }
.empty-art svg { display: block; width: 184px; height: auto; max-width: 100%; }

/* ---------- 通用布局 ---------- */

.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px); }
}
