/* ============================================================
   老王发卡 · 设计系统（毛玻璃 / 极光 / 动效）
   ============================================================ */
:root {
  --bg: #060a14;
  --bg-2: #0a1120;
  --surface: rgba(255, 255, 255, .055);
  --surface-2: rgba(255, 255, 255, .09);
  --surface-3: rgba(255, 255, 255, .13);
  --border: rgba(255, 255, 255, .10);
  --border-2: rgba(255, 255, 255, .18);
  --text: #e9f0fb;
  --text-2: #a7b4cd;
  --text-3: #67748f;
  --sky: #38bdf8;
  --cyan: #22d3ee;
  --teal: #2dd4bf;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --grad: linear-gradient(135deg, #38bdf8 0%, #22d3ee 55%, #2dd4bf 100%);
  --grad-soft: linear-gradient(135deg, rgba(56, 189, 248, .18), rgba(34, 211, 238, .12));
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -24px rgba(1, 10, 30, .8);
  --glow: 0 0 0 1px rgba(56, 189, 248, .28), 0 20px 60px -18px rgba(34, 211, 238, .5);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
  --ease: cubic-bezier(.22, .9, .32, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
img { display: block; max-width: 100%; }
::selection { background: rgba(56, 189, 248, .35); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.13); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255,255,255,.24); }

/* ---------- 极光背景 ---------- */
.bg { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: radial-gradient(1100px 700px at 78% -8%, #0b1b36 0%, transparent 62%), var(--bg); }
.bg-blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; will-change: transform; }
.b1 { width: 540px; height: 540px; background: radial-gradient(circle at 32% 32%, #22d3ee, transparent 70%); top: -150px; left: -130px; animation: drift1 26s ease-in-out infinite alternate; }
.b2 { width: 640px; height: 640px; background: radial-gradient(circle at 55% 45%, #2563eb, transparent 70%); top: 18%; right: -200px; animation: drift2 33s ease-in-out infinite alternate; }
.b3 { width: 500px; height: 500px; background: radial-gradient(circle at 50% 50%, #0ea5e9, transparent 70%); bottom: -170px; left: 28%; animation: drift3 40s ease-in-out infinite alternate; }
.bg-grid { position: absolute; inset: 0; background-image:
  linear-gradient(rgba(148,163,184,.045) 1px, transparent 1px),
  linear-gradient(90deg, rgba(148,163,184,.045) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(ellipse 90% 72% at 50% 18%, #000 18%, transparent 76%);
  mask-image: radial-gradient(ellipse 90% 72% at 50% 18%, #000 18%, transparent 76%);
}
@keyframes drift1 { to { transform: translate(130px, 90px) scale(1.18); } }
@keyframes drift2 { to { transform: translate(-110px, 70px) scale(.88); } }
@keyframes drift3 { to { transform: translate(90px, -100px) scale(1.12); } }

/* ---------- 毛玻璃 ---------- */
.glass {
  background: linear-gradient(165deg, rgba(255,255,255,.075), rgba(255,255,255,.028));
  border: 1px solid var(--border);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.glass-strong {
  background: linear-gradient(165deg, rgba(20,32,58,.82), rgba(9,16,32,.86));
  border: 1px solid var(--border-2);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- 按钮 ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: 13px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .02em;
  overflow: hidden;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), background .28s, border-color .28s, color .28s;
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: scale(.965); }
.btn-primary {
  background: var(--grad);
  color: #052433;
  box-shadow: 0 10px 30px -12px rgba(34, 211, 238, .65), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(34, 211, 238, .8), inset 0 1px 0 rgba(255,255,255,.4); }
.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,.5) 50%, transparent 68%);
  transform: translateX(-130%);
  transition: transform .8s var(--ease);
  pointer-events: none;
}
.btn-primary:hover::after { transform: translateX(130%); }
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--border-2); color: var(--text); background: var(--surface-2); box-shadow: 0 12px 34px -16px rgba(2,12,34,.9); }
.btn-danger { background: linear-gradient(135deg, rgba(248,113,113,.16), rgba(248,113,113,.08)); border: 1px solid rgba(248,113,113,.3); color: #fda4af; }
.btn-danger:hover { transform: translateY(-2px); background: linear-gradient(135deg, rgba(248,113,113,.26), rgba(248,113,113,.14)); box-shadow: 0 12px 34px -16px rgba(248,113,113,.4); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13px; border-radius: 10px; }
.btn-lg { height: 52px; padding: 0 30px; font-size: 16px; border-radius: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn .ic { flex: none; }
.ripple {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.5), rgba(255,255,255,.12));
  transform: scale(0); animation: ripple 620ms var(--ease) forwards;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-2); letter-spacing: .02em; }
.input, .textarea, .select {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14.5px;
  color: var(--text);
  outline: none;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: rgba(56,189,248,.55);
  box-shadow: 0 0 0 4px rgba(56,189,248,.14), inset 0 1px 0 rgba(255,255,255,.08);
  background: rgba(255,255,255,.07);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.6; font-family: var(--mono); font-size: 13.5px; }
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a7b4cd' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
}
.select option { background: #0d1526; color: var(--text); }

/* ---------- 徽章 / 胶囊 ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  transition: all .25s var(--ease);
}
.pill.active { background: var(--grad); color: #052433; border-color: transparent; box-shadow: 0 8px 24px -10px rgba(34,211,238,.7); }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 600;
}
.tag-green { background: rgba(52,211,153,.13); color: #6ee7b7; border: 1px solid rgba(52,211,153,.3); }
.tag-amber { background: rgba(251,191,36,.12); color: #fcd34d; border: 1px solid rgba(251,191,36,.3); }
.tag-red { background: rgba(248,113,113,.12); color: #fca5a5; border: 1px solid rgba(248,113,113,.3); }
.tag-gray { background: rgba(148,163,184,.12); color: #94a3b8; border: 1px solid rgba(148,163,184,.25); }
.tag-cyan { background: rgba(34,211,238,.12); color: #67e8f9; border: 1px solid rgba(34,211,238,.3); }

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(3, 7, 16, .66);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .28s var(--ease);
}
.modal-overlay.in { opacity: 1; }
.modal-card {
  position: relative;
  width: 100%;
  background: linear-gradient(170deg, rgba(24,38,68,.92), rgba(8,14,30,.95));
  border: 1px solid var(--border-2);
  border-radius: 20px;
  padding: 26px;
  box-shadow: var(--shadow), 0 0 80px -30px rgba(34,211,238,.35);
  transform: translateY(22px) scale(.96);
  opacity: 0;
  transition: transform .34s var(--ease), opacity .3s var(--ease);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}
.modal-overlay.in .modal-card { transform: translateY(0) scale(1); opacity: 1; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); background: var(--surface);
  border: 1px solid var(--border);
  transition: all .25s var(--ease);
}
.modal-close:hover { color: var(--text); background: var(--surface-2); transform: rotate(90deg); }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; letter-spacing: .01em; }
.modal-sub { font-size: 13px; color: var(--text-3); margin-bottom: 20px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 22px; left: 50%; z-index: 300;
  display: flex; align-items: center; gap: 9px;
  padding: 12px 20px; border-radius: 13px;
  font-size: 14px; font-weight: 600;
  background: rgba(15, 25, 48, .92);
  border: 1px solid var(--border-2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  transform: translate(-50%, -24px); opacity: 0;
  transition: transform .34s var(--ease), opacity .3s var(--ease);
  pointer-events: none;
  max-width: min(86vw, 460px);
}
.toast.in { transform: translate(-50%, 0); opacity: 1; }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.toast-ok .toast-dot { background: var(--green); box-shadow: 0 0 12px var(--green); }
.toast-err .toast-dot { background: var(--red); box-shadow: 0 0 12px var(--red); }
.toast-warn .toast-dot { background: var(--amber); box-shadow: 0 0 12px var(--amber); }

/* ---------- 滚动浮现 ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 空态 ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 56px 20px; color: var(--text-3); }
.empty-icon { width: 74px; height: 74px; border-radius: 22px; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--border); color: var(--text-3); }

/* ---------- 骨架屏 ---------- */
.skeleton { position: relative; overflow: hidden; background: rgba(255,255,255,.05); border-radius: 10px; }
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.07) 50%, transparent 70%);
  animation: shimmer 1.6s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------- 图标 ---------- */
.ic { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ic svg { width: 100%; height: 100%; }

/* ---------- 通用工具 ---------- */
.w100 { width: 100%; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.divider { height: 1px; background: var(--border); margin: 18px 0; }
