/* ============================================================
 * 源享网络 - 全局样式
 * 深色基调 + 渐变光效 + 毛玻璃 + 精致排版
 * ============================================================ */

/* ---------- 页面加载动画 ---------- */

/* 文档加载 spinner（openDoc 时局部显示）*/
.doc-loader {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 80px 0; color: var(--text-3);
}
.doc-loader .spinner {
  width: 36px; height: 36px;
  border: 2.5px solid var(--border);
  border-top-color: var(--brand-1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.doc-loader .text { font-size: 13px; letter-spacing: 0.5px; }

:root {
  /* 深色基调 */
  --bg-0: #05060a;
  --bg-1: #0a0d16;
  --bg-2: #111626;
  --bg-3: #1a2138;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* 文字 */
  --text-0: #f4f6fb;
  --text-1: #c9d1e0;
  --text-2: #8a93a8;
  --text-3: #5a6175;

  /* 品牌色 - 青蓝渐变 */
  --brand-1: #5eead4;
  --brand-2: #38bdf8;
  --brand-3: #818cf8;
  --accent: #c084fc;

  /* 状态色 */
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;

  /* 渐变 */
  --grad-brand: linear-gradient(135deg, #5eead4 0%, #38bdf8 50%, #818cf8 100%);
  --grad-glow: radial-gradient(circle at 30% 20%, rgba(94, 234, 212, 0.18) 0%, transparent 45%),
               radial-gradient(circle at 75% 80%, rgba(129, 140, 248, 0.16) 0%, transparent 50%),
               radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.08) 0%, transparent 60%);

  /* 排版 */
  --font-sans: 'Inter', 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', Consolas, monospace;

  /* 间距 */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;

  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 32px rgba(56, 189, 248, 0.18);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-0);
  color: var(--text-0);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

body { position: relative; }

/* 全局光效背景层 */
.bg-aura {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--bg-0);
}
.bg-aura::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-glow);
  opacity: 0.9;
  animation: aura-drift 18s ease-in-out infinite alternate;
}
.bg-aura::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
}
@keyframes aura-drift {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1.05); }
  100% { transform: translate3d(2%, 1%, 0) scale(1.1); }
}

/* Three.js 粒子画布 */
#three-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.65;
}

a { color: var(--brand-2); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--brand-1); }

/* ---------- 通用控件 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-0);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}
.btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--grad-brand);
  color: #05060a;
  border: none;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(56, 189, 248, 0.5);
  transform: translateY(-2px);
}
.btn-danger { color: var(--err); border-color: rgba(248, 113, 113, 0.3); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.5); }

.card {
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
}

.input, .select, .textarea {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-0);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s var(--ease);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
  background: rgba(0, 0, 0, 0.4);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.badge-active   { background: rgba(52, 211, 153, 0.15); color: var(--ok);   border: 1px solid rgba(52, 211, 153, 0.35); }
.badge-unused   { background: rgba(52, 211, 153, 0.18); color: var(--ok);   border: 1px solid rgba(52, 211, 153, 0.40); font-weight: 700; }
.badge-disabled { background: rgba(248, 113, 113, 0.15); color: var(--err);  border: 1px solid rgba(248, 113, 113, 0.3); }
.badge-expired  { background: rgba(251, 191, 36, 0.15); color: var(--warn); border: 1px solid rgba(251, 191, 36, 0.3); }

.gradient-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* 响应式容器 */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* 进入动画 */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.6s var(--ease) both; }

/* Toast */
#toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast-item {
  padding: 12px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-soft);
  animation: fadeUp 0.3s var(--ease) both;
  max-width: 360px;
}
.toast-item.ok { border-left: 3px solid var(--ok); }
.toast-item.err { border-left: 3px solid var(--err); }
.toast-item.info { border-left: 3px solid var(--brand-2); }

/* ============================================================
 * 站点固定深色模式（2026-08-27 起不再支持浅色模式）
 * ============================================================ */
:root { color-scheme: dark; }
