/* ═══════════════════════════════════════════
   TSS Portal — Base Styles
   Reset, typography, background effects
   ═══════════════════════════════════════════ */

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

body {
  font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

/* ═══ Fixed background ═══ */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}
.bg-canvas::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg);
}

/* ─── Gradient orbs — 静态，不做动画，性能友好 ─── */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  /* 移除 will-change 和 animation，静态展示即可 */
}
.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,0.35), transparent 70%);
  top: -10%; left: -5%;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(168,85,247,0.3), transparent 70%);
  top: 40%; right: -10%;
}
.orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(34,211,238,0.18), transparent 70%);
  bottom: -5%; left: 30%;
}
.orb-4 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(244,63,94,0.12), transparent 70%);
  top: 20%; left: 50%;
}

:root.light .orb { opacity: 0.25; }
:root.light .orb-1 { background: radial-gradient(circle, rgba(99,102,241,0.22), transparent 70%); }
:root.light .orb-2 { background: radial-gradient(circle, rgba(168,85,247,0.18), transparent 70%); }
:root.light .orb-3 { background: radial-gradient(circle, rgba(34,211,238,0.12), transparent 70%); }

/* ─── Grid pattern ─── */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}
:root.light .bg-grid {
  background-image:
    linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
}

/* ─── Noise overlay ─── */
.bg-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.03;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px;
}

/* ─── Particles — 已移除，对性能影响极大 ─── */
.particles { display: none; }
.particle  { display: none; }

/* ═══ Header — Glassmorphism ═══ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  background: rgba(10,10,18,0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}
/* 去掉流光线动画，保留静态渐变线 */
.header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--accent-purple), transparent);
  opacity: 0.4;
}
:root.light .header {
  background: rgba(240,242,248,0.8);
  border-bottom-color: rgba(0,0,0,0.06);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-logo {
  width: 40px; height: 40px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(250, 204, 21, 0.3);
}
.header-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.header-logo svg { color: #fff; width: 22px; height: 22px; }

.header-title {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}
:root.light .header-title {
  background: linear-gradient(135deg, #1a1a2e 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.header-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(99,102,241,0.12);
  color: var(--primary-light);
  border: 1px solid rgba(99,102,241,0.25);
  letter-spacing: 0.03em;
}

.header-actions { display: flex; align-items: center; gap: 12px; }

/* ═══ Footer ═══ */
.footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
  background: rgba(10,10,18,0.4);
}
:root.light .footer { background: rgba(240,242,248,0.5); }

/* ═══ Loading spinner ═══ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px;
}
.spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ Responsive base ═══ */
@media (max-width: 768px) {
  .header { padding: 0 16px; height: 60px; }
  .header-subtitle { display: none; }
}
