/* ===== 设计令牌 & 共享组件 ===== */
:root {
  --ink: #0e1726;
  --ink-2: #24314a;
  --muted: #6b7789;
  --muted-2: #93a0b4;
  --line: #e7ebf3;
  --line-2: #f0f3f9;
  --bg: #f5f7fb;
  --card: #ffffff;
  --blue: #2f6bff;
  --blue-dark: #1f4fd0;
  --violet: #7c5cff;
  --gold: #c8963e;
  --gold-soft: #fdf6e8;
  --green: #0f9f6e;
  --green-soft: #e8f8f1;
  --red: #e0443f;
  --red-soft: #fdeceb;
  --amber: #b8791a;
  --amber-soft: #fdf3e2;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 30, 54, 0.06);
  --shadow-md: 0 8px 24px -12px rgba(16, 30, 54, 0.18);
  --shadow-lg: 0 24px 60px -28px rgba(16, 30, 54, 0.35);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.01em;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--blue);
  text-decoration: none;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease,
    box-shadow 0.16s ease, color 0.16s ease;
}

.btn:hover {
  border-color: #d3dae8;
  background: #fbfcfe;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(180deg, #3a74ff, #2b63f0);
  border-color: #2b63f0;
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(47, 107, 255, 0.9);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #4a80ff, #2f6bff);
  border-color: #2f6bff;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

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

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

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

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-block {
  width: 100%;
}

/* ===== 表单 ===== */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.field > label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.input,
.select {
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
  width: 100%;
}

.input::placeholder {
  color: var(--muted-2);
}

.input:focus,
.select:focus {
  outline: none;
  border-color: #a9c0ff;
  box-shadow: 0 0 0 3.5px rgba(47, 107, 255, 0.12);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%236b7789' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

/* ===== 标签 ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.tag-green {
  background: var(--green-soft);
  color: var(--green);
}

.tag-amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag-blue {
  background: #eaf0ff;
  color: var(--blue);
}

.tag-red {
  background: var(--red-soft);
  color: var(--red);
}

.tag-gray {
  background: #f1f4f9;
  color: var(--muted);
}

.tag-gold {
  background: var(--gold-soft);
  color: var(--gold);
}

/* ===== 卡片 / 面板 ===== */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
}

.panel-title {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.panel-body {
  padding: 0 18px 18px;
}

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(13, 22, 38, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 90;
  animation: fadeIn 0.16s ease;
}

.modal {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  animation: pop 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 6px;
}

.modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.modal-body {
  padding: 14px 20px 4px;
  overflow: auto;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px 20px;
}

.x-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.x-btn:hover {
  background: #f2f5fa;
  color: var(--ink);
}

/* ===== 轻提示 ===== */
.toast-wrap {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(16, 26, 43, 0.94);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 12px 30px -12px rgba(16, 26, 43, 0.7);
  animation: dropIn 0.22s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.ok::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
}

.toast.err::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff6b6b;
}

/* ===== 加载 ===== */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner.dark {
  border-color: rgba(47, 107, 255, 0.2);
  border-top-color: var(--blue);
}

.skeleton {
  background: linear-gradient(90deg, #eef1f7 25%, #f6f8fc 37%, #eef1f7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease infinite;
  border-radius: 8px;
}

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

@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

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

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #d9e0ec;
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #c3ccdd;
  background-clip: content-box;
}
