/* ============================================================
 * 灵音托管引擎自动化工作台 - 基础样式重置 (base-reset.css)
 * 抽取自原 index.html，保持原有赛博朋克风格
 * ============================================================ */

/* ===== CSS 变量定义（暗色默认） ===== */
:root {
  /* 深蓝色科技简约风格 */
  --bg-primary: #0a1628;
  --bg-secondary: #0f1d3a;
  --bg-card: #152244;
  --bg-hover: #1a2d52;
  --bg-active: #1e3461;
  --border-color: #1e3a5f;
  --text-primary: #e0e8f5;
  --text-secondary: #8ba4c7;
  --text-muted: #5a7a9e;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-green: #22c55e;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;

  /* 科幻主题 CSS 变量 (运行时切换) */
  --theme-bg-1: var(--bg-primary);
  --theme-bg-2: #0d1a30;
  --theme-accent-h: 210;
  --theme-accent-s: 70%;
  --theme-accent-l: 55%;
  --theme-particle-color-1: rgba(59, 130, 246, 0.5);
  --theme-particle-color-2: rgba(6, 182, 212, 0.3);
  --theme-nebula-hue-1: 210;
  --theme-nebula-hue-2: 170;
  --theme-nebula-alpha: 0.03;
  --theme-overlay: none;
  --theme-overlay-blend: normal;

  /* 布局变量 */
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 64px;
  --header-height: 56px;

  /* 通用变量 */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 22px;
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.3);
  /* 柔和阴影层级（参考 haha.lk888.ai 设计体系） */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.18), 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.22), 0 4px 8px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 12px rgba(6, 182, 212, 0.35), 0 0 4px rgba(6, 182, 212, 0.2);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== 亮色模式 CSS 变量覆盖 ===== */
:root[data-theme-mode="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f7fa;
  --bg-card: #ffffff;
  --bg-hover: #f0f0f0;
  --bg-active: #e8e8e8;
  --border-color: #e2e8f0;
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #9ca3af;
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* 亮色模式下 body 背景 */
:root[data-theme-mode="light"] body {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

/* 亮色模式下登录页面 */
:root[data-theme-mode="light"] .login-page {
  background: linear-gradient(135deg, #ffffff 0%, #f5f7fa 50%, #e6f3ff 100%) !important;
}
:root[data-theme-mode="light"] .login-card {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08) !important;
}

/* 亮色模式下背景层 */
:root[data-theme-mode="light"] #bgLayer {
  background: var(--bg-primary) !important;
}
:root[data-theme-mode="light"] #bgMask {
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.15) 0%, rgba(245, 247, 250, 0.6) 100%) !important;
}

/* ===== 全局重置 ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== 基础字体定义 ===== */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-primary) !important;
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  line-height: 1.5;
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
  background: transparent;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 217, 255, 0.15);
  border-radius: 4px;
  border: 1px solid rgba(0, 217, 255, 0.05);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 217, 255, 0.3);
  box-shadow: 0 0 8px rgba(0, 217, 255, 0.2);
}
::-webkit-scrollbar-corner {
  background: transparent;
}

/* Firefox 滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(6, 182, 212, 0.2) transparent;
}

/* ===== 全局动画定义 ===== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes scanlineMove {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -30px); }
}

@keyframes hudPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes hudScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes dataFlicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes dotRingPulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0; }
}

@keyframes micWave {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1); }
}

@keyframes pulseText {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes slideRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes breathePulse {
  0%, 100% { box-shadow: 0 4px 24px rgba(59, 130, 246, 0.4); }
  50% { box-shadow: 0 4px 36px rgba(59, 130, 246, 0.7), 0 0 60px rgba(59, 130, 246, 0.15); }
}

@keyframes neonBorderSpin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes gradientBorderShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes cardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes dataFlowPulse {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2.5); opacity: 0; }
}

@keyframes dataFlowFill {
  0% { width: 0; margin-left: 0; }
  50% { width: 60%; margin-left: 20%; }
  100% { width: 0; margin-left: 100%; }
}

@keyframes glowPulse {
  0%, 100% { text-shadow: 0 0 8px rgba(34, 197, 94, 0.3); }
  50% { text-shadow: 0 0 20px rgba(34, 197, 94, 0.6), 0 0 40px rgba(34, 197, 94, 0.2); }
}

@keyframes avatarPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(6, 182, 212, 0.4); }
  50% { box-shadow: 0 0 28px rgba(6, 182, 212, 0.7); }
}

@keyframes avatarRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes cursorBlinkCyan {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes typeChar {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.8); opacity: 0.4; }
}

@keyframes cyberBreathe {
  0%, 100% { box-shadow: 0 0 8px rgba(6, 182, 212, 0.3); }
  50% { box-shadow: 0 0 20px rgba(6, 182, 212, 0.6); }
}

@keyframes feedbackBreathe {
  0%, 100% { box-shadow: 0 0 12px rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 0 24px rgba(245, 158, 11, 0.6); }
}

@keyframes jarvisListeningPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(6, 182, 212, 0.6); }
  50% { box-shadow: 0 0 60px rgba(6, 182, 212, 0.9), 0 0 100px rgba(6, 182, 212, 0.3); }
}

@keyframes speakPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 60px rgba(34, 197, 94, 0.7); }
}

@keyframes ringSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes blinkCursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes cyberAvatarGlow {
  0%, 100% { box-shadow: 0 0 16px rgba(255, 0, 180, 0.4); }
  50% { box-shadow: 0 0 32px rgba(255, 0, 180, 0.7), 0 0 48px rgba(255, 0, 180, 0.2); }
}

@keyframes exportGlow {
  0%, 100% { box-shadow: 0 0 6px rgba(34, 197, 94, 0.12); }
  50% { box-shadow: 0 0 14px rgba(34, 197, 94, 0.28); }
}

/* ===== 背景画布 ===== */
#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  will-change: opacity;
}

/* ===== 背景层 ===== */
#bgLayer {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg-primary);
  transition: background 0.8s ease;
}
#bgMedia {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  transition: opacity 1s ease;
}
#bgVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}
#bgMask {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, var(--bg-primary) 0%, var(--bg-primary) 100%);
  pointer-events: none;
  transition: background 0.6s ease;
}

/* ===== 登录页面 ===== */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #0d1a30 50%, var(--bg-secondary) 100%);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  animation: floatGlow 8s ease-in-out infinite;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.06) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
  animation: floatGlow 10s ease-in-out infinite reverse;
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 400px;
  max-width: 92vw;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo .icon {
  font-size: 48px;
  color: var(--accent-cyan);
}
.login-logo h1 {
  font-size: 22px;
  margin-top: 12px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-logo p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}
.login-btn {
  width: 100%;
  margin-top: 8px;
  height: 44px;
  font-size: 15px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
}
.login-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.feishu-login-btn {
  width: 100%;
  margin-top: 12px;
  height: 44px;
  font-size: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.feishu-login-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.auth-tab {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  background: var(--bg-secondary);
  transition: all 0.25s ease;
  border: none;
}
.auth-tab:hover {
  color: var(--text-secondary);
}
.auth-tab.active {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  color: var(--text-primary);
}
