/* ============================================================
   陌上传媒 — 未来科技暗色主题 (tech)
   深空背景 · 极光光晕 · 科技网格 · 玻璃拟态 · 蓝紫渐变
   类名与组件结构保持不变，仅重做视觉表达
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Surface / Background (deep space) */
  --bg: #070b16;
  --bg-2: #0a0f20;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --surface-solid: #0e1426;

  /* Border / Hairline (tech blue tint) */
  --border: rgba(130, 170, 255, 0.16);
  --border-strong: rgba(130, 170, 255, 0.34);
  --hairline: rgba(130, 170, 255, 0.14);
  --divider-soft: rgba(130, 170, 255, 0.08);

  /* Text */
  --text: #e9edff;
  --text-muted: #8b94b6;
  --text-dim: #5d6680;
  --on-dark: #ffffff;

  /* Accent — 蓝紫渐变体系 */
  --primary: #2997ff;       /* electric blue */
  --primary-2: #7c5cff;     /* violet */
  --accent: #21d4fd;        /* cyan */
  --primary-on-dark: #7cc4ff;
  --grad: linear-gradient(135deg, #21d4fd 0%, #2997ff 45%, #7c5cff 100%);
  --grad-soft: linear-gradient(135deg, rgba(33,212,253,0.16), rgba(124,92,255,0.16));

  /* Semantic */
  --warn: #ffb020;
  --danger: #ff5d6c;
  --success: #2fd39a;

  /* Glow */
  --glow: 0 0 0 1px rgba(41,151,255,0.18), 0 10px 36px -10px rgba(41,151,255,0.5);
  --glow-sm: 0 6px 22px -8px rgba(41,151,255,0.65);

  /* Typography */
  --font-display: "SF Pro Display", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-text: "SF Pro Text", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Spacing */
  --space-xxs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 17px;
  --space-lg: 24px; --space-xl: 32px; --space-xxl: 48px; --space-section: 80px;

  /* Radius */
  --r-none: 0px; --r-xs: 5px; --r-sm: 8px; --r-md: 11px; --r-lg: 18px; --r-pill: 9999px;

  /* Layout */
  --nav-h: 44px; --sidebar-w: 256px; --topbar-h: 56px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-text); font-size: 17px; font-weight: 400; line-height: 1.47;
  letter-spacing: -0.374px; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; min-height: 100vh;
  position: relative; overflow-x: hidden;
}
/* Aurora orbs */
body::before {
  content: ""; position: fixed; inset: -10% -10% auto -10%; height: 120%; width: 120%; z-index: -2;
  background:
    radial-gradient(48% 42% at 14% 8%, rgba(41,151,255,0.22), transparent 60%),
    radial-gradient(42% 42% at 88% 16%, rgba(124,92,255,0.20), transparent 60%),
    radial-gradient(55% 55% at 50% 108%, rgba(33,212,253,0.12), transparent 60%);
  animation: drift 18s ease-in-out infinite alternate;
}
/* Tech grid */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; opacity: 0.5;
  background-image:
    linear-gradient(rgba(130,170,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(130,170,255,0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(circle at 50% 28%, #000 0%, transparent 82%);
          mask-image: radial-gradient(circle at 50% 28%, #000 0%, transparent 82%);
}
/* Particle starfield canvas — sits above grid, below content */
.starfield {
  position: fixed; inset: 0; z-index: 0; display: block;
  pointer-events: none; width: 100%; height: 100%;
}
@keyframes drift { from { transform: translate3d(-1.5%, -1%, 0) scale(1); } to { transform: translate3d(2%, 1.5%, 0) scale(1.05); } }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.374px; color: var(--text); margin: 0; }
::selection { background: rgba(41,151,255,0.30); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---------- Typography Helpers ---------- */
.t-hero { font-family: var(--font-display); font-size: 40px; font-weight: 600; line-height: 1.10; letter-spacing: 0; }
.t-title { font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1.14; letter-spacing: -0.28px; }
.t-section { font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1.19; letter-spacing: -0.12px; }
.t-body-strong { font-weight: 600; }
.t-caption { font-size: 14px; line-height: 1.43; letter-spacing: -0.224px; }
.t-fine { font-size: 12px; line-height: 1.0; letter-spacing: -0.12px; color: var(--text-muted); }
.t-muted { color: var(--text-muted); }
.t-onyx { color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  font-family: var(--font-text); font-size: 17px; font-weight: 500; line-height: 1.0; letter-spacing: -0.12px;
  border: none; cursor: pointer; user-select: none; color: var(--text);
  transition: transform 150ms var(--ease), background-color 150ms var(--ease), box-shadow 150ms var(--ease), filter 150ms var(--ease);
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: scale(0.95); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.btn-primary { background: var(--grad); color: #fff; border-radius: var(--r-pill); padding: 11px 22px; box-shadow: var(--glow-sm); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 10px 30px -8px rgba(41,151,255,0.8); }

.btn-secondary-pill { background: transparent; color: var(--primary); border: 1px solid var(--primary); border-radius: var(--r-pill); padding: 11px 22px; }
.btn-secondary-pill:hover:not(:disabled) { background: rgba(41,151,255,0.10); }

.btn-dark-utility { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 15px; font-size: 14px; letter-spacing: -0.224px; }
.btn-dark-utility:hover:not(:disabled) { border-color: var(--border-strong); background: rgba(255,255,255,0.1); }

.btn-pearl { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-md); padding: 8px 14px; font-size: 14px; }
.btn-pearl:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-2); }

.btn-sm { font-size: 14px; padding: 8px 16px; }
.btn-lg { font-size: 18px; padding: 14px 28px; }
.btn-block { width: 100%; }

.btn-icon { width: 44px; height: 44px; padding: 0; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text); font-size: 18px; border: 1px solid var(--border); }
.btn-icon:hover:not(:disabled) { border-color: var(--border-strong); background: rgba(255,255,255,0.1); }

/* ---------- Cards (glass) ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--space-lg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform 200ms var(--ease), border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.card:hover { border-color: var(--border-strong); box-shadow: 0 14px 44px -18px rgba(41,151,255,0.45); transform: translateY(-2px); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: var(--space-xs); margin-bottom: var(--space-lg); }
.label { font-size: 14px; font-weight: 600; letter-spacing: -0.224px; color: var(--text); }
.label .req { color: var(--accent); }
.input, .select, .textarea {
  width: 100%; font-family: var(--font-text); font-size: 17px; color: var(--text);
  background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 11px 16px; transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease), background 150ms var(--ease);
}
.select option { background: var(--surface-solid); color: var(--text); }
.textarea { resize: vertical; min-height: 92px; line-height: 1.47; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(41,151,255,0.18); background: rgba(255,255,255,0.06); }
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input.has-error, .select.has-error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255,93,108,0.16); }
.field-error { font-size: 12px; color: var(--danger); letter-spacing: -0.12px; }

.search { position: relative; display: flex; align-items: center; }
.search .input { border-radius: var(--r-pill); height: 44px; padding-left: 44px; }
.search .search-icon { position: absolute; left: 16px; color: var(--text-muted); pointer-events: none; display: inline-flex; }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 8px 16px; font-size: 14px; cursor: pointer; transition: all 150ms var(--ease);
}
.chip:hover { border-color: var(--primary); color: var(--text); }
.chip.is-active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--glow-sm); }
.chip.is-active:hover { filter: brightness(1.08); }

/* ---------- Table ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table thead th {
  text-align: left; font-weight: 600; font-size: 13px; letter-spacing: -0.12px; color: var(--text-muted);
  padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table tbody td { padding: 16px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.table tbody tr { transition: background-color 120ms var(--ease); }
.table tbody tr:hover { background: var(--surface); }
.table tbody tr:last-child td { border-bottom: none; }
.cell-strong { font-weight: 600; color: var(--text); }
.cell-mono { font-variant-numeric: tabular-nums; }

/* ---------- Badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; letter-spacing: -0.12px;
  padding: 4px 12px; border-radius: var(--r-pill); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--active { color: var(--accent); border-color: rgba(33,212,253,0.4); background: rgba(33,212,253,0.10); }
.badge--paused { color: var(--text-muted); }
.badge--warn { color: var(--warn); border-color: rgba(255,176,32,0.4); background: rgba(255,176,32,0.10); }
.badge--soft { color: var(--text-muted); border-color: var(--border); background: var(--surface); }
.badge--gold { color: #ffcf6b; border-color: rgba(255,200,90,0.4); background: rgba(255,200,90,0.12); }

/* ---------- Avatar ---------- */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff; font-size: 14px; font-weight: 600; flex-shrink: 0;
  box-shadow: 0 4px 14px -6px rgba(41,151,255,0.7);
}

/* ---------- Modal (glass) ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(3,6,14,0.62); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; padding: var(--space-lg); z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity 200ms var(--ease);
}
.modal-backdrop.is-open { opacity: 1; pointer-events: auto; }
.modal {
  background: rgba(12,18,36,0.92); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border-strong); border-radius: var(--r-lg); width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto; transform: translateY(8px) scale(0.98); transition: transform 220ms var(--ease);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.8);
}
.modal-backdrop.is-open .modal { transform: translateY(0) scale(1); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-lg) var(--space-lg) var(--space-sm); }
.modal-body { padding: 0 var(--space-lg); }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--space-sm); padding: var(--space-lg); border-top: 1px solid var(--hairline); margin-top: var(--space-lg); }

/* ---------- Toast ---------- */
.toast-stack { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(14,20,40,0.96); color: var(--text); border: 1px solid var(--border-strong);
  padding: 12px 20px; border-radius: var(--r-pill); font-size: 14px; letter-spacing: -0.224px;
  opacity: 0; transform: translateY(8px); transition: all 220ms var(--ease); box-shadow: var(--glow-sm);
}
.toast.is-show { opacity: 1; transform: translateY(0); }
.toast--ok { border-color: rgba(33,212,253,0.4); }
.toast--err { border-color: rgba(255,93,108,0.5); }

/* ---------- Charts ---------- */
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: var(--space-md); }
.chart-legend .item { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.chart-legend .dot { width: 10px; height: 10px; border-radius: 3px; }

/* ---------- Utility ---------- */
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); } .gap-sm { gap: var(--space-sm); } .gap-md { gap: var(--space-md); } .gap-lg { gap: var(--space-lg); }
.wrap { flex-wrap: wrap; }
.mt-sm { margin-top: var(--space-sm); } .mt-md { margin-top: var(--space-md); } .mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); } .mb-lg { margin-bottom: var(--space-lg); }
.text-right { text-align: right; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
