/* ==========================================================================
   智影灵动 SmartShadow · 设计系统
   对标浪子之心科技：蓝白科技风 / 圆角卡片 / 发光描边 / 高饱和渐变
   ========================================================================== */

:root {
  /* 品牌色 */
  --brand-900: #0a1f6b;
  --brand-800: #0d2c96;
  --brand-700: #1440d0;
  --brand-600: #1f5cff;
  --brand-500: #3b7bff;
  --brand-400: #6b9bff;
  --brand-300: #a3c2ff;
  --brand-200: #c9dbff;
  --brand-100: #e6efff;
  --brand-050: #f2f7ff;

  --cyan-500: #00c8f0;
  --cyan-400: #33dcff;
  --purple-600: #6a3cff;
  --purple-500: #8b5cff;
  --pink-500: #ff4d94;
  --green-500: #00c08b;
  --amber-500: #ff9500;
  --red-500: #ff4d4f;

  /* 中性色 */
  --ink-900: #0b1220;
  --ink-800: #16203a;
  --ink-700: #1e293b;
  --ink-600: #475569;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --ink-300: #cbd5e1;
  --ink-200: #e2e8f0;
  --ink-100: #f1f5f9;
  --ink-050: #f8fafc;
  --white: #ffffff;

  /* 语义 */
  --ok: var(--green-500);
  --warn: var(--amber-500);
  --err: var(--red-500);
  --info: var(--brand-600);

  /* 圆角 */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* 阴影 */
  --sh-xs: 0 1px 2px rgba(11, 18, 32, .06);
  --sh-sm: 0 2px 8px rgba(11, 18, 32, .08);
  --sh-md: 0 8px 24px rgba(11, 18, 32, .10);
  --sh-lg: 0 20px 48px rgba(11, 18, 32, .14);
  --sh-glow: 0 0 0 1px rgba(59, 123, 255, .18), 0 12px 32px rgba(31, 92, 255, .18);
  --sh-glow-strong: 0 0 0 1px rgba(59, 123, 255, .32), 0 18px 48px rgba(31, 92, 255, .30);

  /* 渐变 */
  --grad-brand: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-800) 100%);
  --grad-cyan: linear-gradient(135deg, var(--cyan-400) 0%, var(--brand-600) 100%);
  --grad-warm: linear-gradient(135deg, #ff7ab8 0%, var(--purple-600) 100%);
  --grad-sheen: linear-gradient(135deg, rgba(255,255,255,.28) 0%, rgba(255,255,255,0) 60%);

  /* 布局 */
  --nav-w: 76px;
  --panel-w: 340px;
  --header-h: 60px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur: .22s;

  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font);
  color: var(--ink-800);
  background: var(--ink-050);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }
a { color: var(--brand-600); text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-400); }

/* ====================== 通用组件 ====================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px;
  border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary { background: var(--grad-brand); color: var(--white); box-shadow: 0 4px 14px rgba(31,92,255,.28); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 22px rgba(31,92,255,.38); filter: brightness(1.06); }

.btn-ghost { background: var(--ink-100); color: var(--ink-700); }
.btn-ghost:hover:not(:disabled) { background: var(--ink-200); }

.btn-outline { background: transparent; color: var(--brand-600); box-shadow: inset 0 0 0 1.5px var(--brand-300); }
.btn-outline:hover:not(:disabled) { background: var(--brand-050); box-shadow: inset 0 0 0 1.5px var(--brand-500); }

.btn-danger { background: rgba(255,77,79,.10); color: var(--err); }
.btn-danger:hover:not(:disabled) { background: rgba(255,77,79,.18); }

.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: var(--r-xs); }
.btn-lg { height: 46px; padding: 0 24px; font-size: 15px; border-radius: var(--r-md); }
.btn-block { width: 100%; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px;
  border-radius: var(--r-full);
  font-size: 12px; font-weight: 500;
  background: var(--brand-100); color: var(--brand-700);
  white-space: nowrap;
}
.chip-ok { background: rgba(0,192,139,.12); color: #00805c; }
.chip-warn { background: rgba(255,149,0,.14); color: #b35f00; }
.chip-err { background: rgba(255,77,79,.12); color: #c92a2a; }
.chip-muted { background: var(--ink-100); color: var(--ink-500); }

.card {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  border: 1px solid var(--ink-200);
}
.card-pad { padding: 18px; }

.card-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--ink-200);
}
.card-hd h3 { font-size: 14px; font-weight: 600; color: var(--ink-800); letter-spacing: .01em; }
.card-hd .sub { font-size: 12px; color: var(--ink-500); font-weight: 400; }

.sec-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--ink-500);
  letter-spacing: .06em; text-transform: uppercase;
  margin-bottom: 10px;
}
.sec-title::after { content: ''; flex: 1; height: 1px; background: var(--ink-200); }

.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12px; font-weight: 500; color: var(--ink-600); margin-bottom: 5px; }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--ink-200);
  background: var(--white); color: var(--ink-800);
  font-size: 14px;
  transition: border-color var(--dur), box-shadow var(--dur);
  outline: none;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 76px; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(59,123,255,.14);
}
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--ink-300); border-radius: var(--r-full);
  transition: background var(--dur) var(--ease);
}
.switch .track::before {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: var(--sh-xs);
  transition: transform var(--dur) var(--ease);
}
.switch input:checked + .track { background: var(--brand-600); }
.switch input:checked + .track::before { transform: translateX(18px); }

.range { width: 100%; height: 4px; appearance: none; border-radius: var(--r-full); background: var(--ink-200); outline: none; }
.range::-webkit-slider-thumb {
  appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--brand-600); border: 2.5px solid #fff;
  box-shadow: 0 1px 5px rgba(31,92,255,.45); cursor: pointer;
}

/* ====================== 动画 ====================== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulseRing {
  0%   { box-shadow: 0 0 0 0 rgba(31,92,255,.42); }
  70%  { box-shadow: 0 0 0 18px rgba(31,92,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(31,92,255,0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -420px 0; } 100% { background-position: 420px 0; } }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes blinkDot { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.spinner {
  width: 15px; height: 15px; flex: none;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-dark { border-color: var(--ink-200); border-top-color: var(--brand-600); }

.skeleton {
  background: linear-gradient(90deg, var(--ink-100) 25%, var(--ink-200) 37%, var(--ink-100) 63%);
  background-size: 420px 100%;
  animation: shimmer 1.3s linear infinite;
  border-radius: var(--r-xs);
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none !important; }

/* 状态点 */
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--ink-400); }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(0,192,139,.16); }
.dot-warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(255,149,0,.16); }
.dot-err { background: var(--err); box-shadow: 0 0 0 3px rgba(255,77,79,.16); }
.dot-live { background: var(--pink-500); box-shadow: 0 0 0 3px rgba(255,77,94,.18); animation: blinkDot 1.3s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
