/* ========================================
   掉宝助手 - Cyberpunk Neon Theme
   Responsive Design System
   ======================================== */

/* Typography - Orbitron for display, Rajdhani for body */
@import url('fonts/fonts.css');

/* ========================================
   Design Tokens
   ======================================== */
:root {
  /* Color Palette - Neon Cyberpunk */
  --cyan: #00fff7;
  --purple: #bf00ff;
  --pink: #ff00aa;
  --blue: #00aaff;
  --green: #00ff88;
  --orange: #ff8800;
  --red: #ff4466;
  --yellow: #ffaa00;

  /* Backgrounds */
  --bg-deep: #333333;
  --bg-card: rgba(12, 12, 20, 0.95);
  --bg-elevated: rgba(20, 20, 32, 0.9);
  --bg-input: rgba(0, 0, 0, 0.4);
  --bg-hover: rgba(0, 255, 247, 0.05);

  /* Borders */
  --border-dim: rgba(0, 255, 247, 0.12);
  --border-default: rgba(0, 255, 247, 0.25);
  --border-active: rgba(0, 255, 247, 0.5);

  /* Text */
  --text-primary: #f0f0f8;
  --text-secondary: #b8b8c8;
  --text-muted: #8888a0;

  /* Typography Scale - 5 levels only */
  --text-2xl: 1.25rem;    /* 20px - Page titles */
  --text-xl: 1.125rem;    /* 18px - Section headers */
  --text-base: 0.9375rem; /* 15px - Body text */
  --text-sm: 0.8125rem;   /* 13px - Secondary text */
  --text-xs: 0.6875rem;   /* 11px - Badges, tiny labels */

  /* Font Families */
  --font-display: 'Orbitron', 'Microsoft YaHei', sans-serif;
  --font-body: 'Microsoft YaHei', 'Rajdhani', sans-serif;
  --font-mono: 'JetBrains Mono', monospace, 'Microsoft YaHei';

  /* Spacing Scale - Based on 4px */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-normal: 200ms ease-out;

  /* Shadows & Glows */
  --glow-cyan: 0 0 16px rgba(0, 255, 247, 0.4);
  --glow-purple: 0 0 16px rgba(191, 0, 255, 0.4);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-base);
  line-height: 1.5;
  background-color: var(--bg-deep);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cdefs%3E%3CradialGradient id='g1' cx='15%25' cy='15%25' r='50%25'%3E%3Cstop offset='0%25' stop-color='%23bf00ff' stop-opacity='0.12'/%3E%3Cstop offset='100%25' stop-color='%23bf00ff' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='g2' cx='85%25' cy='85%25' r='50%25'%3E%3Cstop offset='0%25' stop-color='%2300fff7' stop-opacity='0.08'/%3E%3Cstop offset='100%25' stop-color='%2300fff7' stop-opacity='0'/%3E%3C/radialGradient%3E%3Cpattern id='scanlines' width='4' height='4' patternUnits='userSpaceOnUse'%3E%3Crect width='4' height='2' fill='transparent'/%3E%3Crect y='2' width='4' height='2' fill='rgba(0,0,0,0.02)'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23g1)'/%3E%3Crect width='100%25' height='100%25' fill='url(%23g2)'/%3E%3Crect width='100%25' height='100%25' fill='url(%23scanlines)'/%3E%3C/svg%3E");
  background-size: cover;
  background-attachment: fixed;
  color: var(--text-primary);
  width: 100%;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* App Wrapper - Centered Container */
.app-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateZ(0);
  -webkit-transform: translate(-50%, -50%) translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  width: 853px;
  height: 485px;
}

/* ========================================
   Layout Container - Absolute Positioning
   ======================================== */
.container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: var(--space-3);
}

/* ========================================
   Header - Absolute Positioning
   ======================================== */
.header {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  height: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  box-sizing: border-box;
}

/* Top gradient line */
.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan) 30%, var(--purple) 70%, transparent);
  opacity: 0.7;
}

.header-left {
  position: absolute;
  top: 4px;
  left: 12px;
  right: 80px;
  height: 40px;
}

.header-left .logo-icon {
  position: absolute;
  top: 4px;
  left: 0;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  border-radius: var(--radius-sm);
  text-align: center;
  line-height: 32px;
}

.header-left .logo-icon svg {
  display: inline-block;
  vertical-align: middle;
  width: 18px;
  height: 18px;
  margin-top: -2px;
}

.header-left .user-info {
  position: absolute;
  top: 0;
  left: 42px;
  right: 0;
  height: 40px;
  line-height: 40px;
  white-space: nowrap;
  overflow: hidden;
}

.header-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  height: 24px;
  line-height: 24px;
}

.header-actions > * {
  margin-left: var(--space-1);
}

.header-actions > *:first-child {
  margin-left: 0;
}

.header-btn {
  display: inline-block;
  vertical-align: middle;
  width: 24px;
  height: 24px;
  background: transparent;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  text-align: center;
  line-height: 22px;
}

.header-btn svg {
  display: inline-block;
  vertical-align: middle;
  margin-top: -2px;
}

.header-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--bg-hover);
}

.header-btn.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0, 255, 247, 0.1);
}

.header-btn-bind:hover {
  border-color: var(--green);
  color: var(--green);
  background: rgba(0, 255, 136, 0.1);
}

.header-btn-close:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(255, 68, 102, 0.1);
}

/* ========================================
   Card Component
   ======================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0.25;
}

.card h2 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-dim);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-block;
  vertical-align: middle;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: filter var(--transition-fast), background var(--transition-fast);
  white-space: nowrap;
  text-align: center;
}

.btn svg {
  display: inline-block;
  vertical-align: middle;
  margin-right: var(--space-1);
  margin-top: -2px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-small {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
}

.btn-large {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-base);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: var(--bg-deep);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.15);
}

.btn-secondary {
  background: rgba(0, 255, 247, 0.1);
  border: 1px solid var(--border-default);
  color: var(--cyan);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(0, 255, 247, 0.15);
}

.btn-success {
  background: linear-gradient(135deg, var(--green), #00cc66);
  color: var(--bg-deep);
}

.btn-success:hover:not(:disabled) {
  filter: brightness(1.15);
}

.btn-danger {
  background: linear-gradient(135deg, var(--red), #cc0033);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  filter: brightness(1.15);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-primary);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--bg-hover);
}

.btn-group {
  position: relative;
}

.btn-group .btn {
  display: inline-block;
  vertical-align: middle;
  margin-right: var(--space-2);
  margin-bottom: var(--space-2);
}

/* ========================================
   Form Controls
   ======================================== */
input[type="text"]:not(.login-input),
input[type="password"]:not(.login-input),
input[type="search"],
select {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input::placeholder {
  color: var(--text-muted);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 255, 247, 0.15);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300fff7' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-6);
}

/* ========================================
   Loading State - Absolute Positioning
   ======================================== */
.loading {
  position: relative;
  text-align: center;
  padding-top: 44px;
  color: var(--text-muted);
  font-size: var(--text-base);
}

.loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: -16px;
  width: 32px;
  height: 32px;
  border: 2px solid var(--border-dim);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-sizing: border-box;
}

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

/* ========================================
   Badge
   ======================================== */
.badge {
  display: inline-block;
  vertical-align: middle;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-success {
  background: rgba(0, 255, 136, 0.12);
  color: var(--green);
  border: 1px solid rgba(0, 255, 136, 0.25);
}

.badge-warning {
  background: rgba(255, 170, 0, 0.12);
  color: var(--yellow);
  border: 1px solid rgba(255, 170, 0, 0.25);
}

.badge-danger {
  background: rgba(255, 68, 102, 0.12);
  color: var(--red);
  border: 1px solid rgba(255, 68, 102, 0.25);
}

.badge-info {
  background: rgba(0, 170, 255, 0.12);
  color: var(--blue);
  border: 1px solid rgba(0, 170, 255, 0.25);
}

/* VIP Badge */
.vip-badge {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ========================================
   Progress Bar
   ======================================== */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border-dim);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--pink));
  background-size: 200% 100%;
  border-radius: 3px;
  transition: width var(--transition-normal);
  box-shadow: 0 0 8px rgba(0, 255, 247, 0.4);
}

.progress-fill.animated {
  animation: progressGlow 2s ease infinite;
}

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

/* ========================================
   Avatar
   ======================================== */
.avatar {
  display: inline-block;
  vertical-align: middle;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: var(--bg-deep);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  text-align: center;
  line-height: 36px;
  box-shadow: var(--glow-cyan);
}

/* ========================================
   Notification Toast - Absolute Positioning
   ======================================== */
#notification-container {
  position: fixed;
  top: 50%;
  left: 50%;
  margin-top: -230px;
  margin-left: -150px;
  width: 300px;
  z-index: 2000;
  pointer-events: none;
}

#notification-container .notification {
  position: relative;
  top: auto;
  left: auto;
  margin-left: 0;
  margin-bottom: var(--space-2);
}

.notification {
  position: absolute;
  top: 12px;
  left: 50%;
  margin-left: -150px;
  width: 300px;
  background: rgba(10, 10, 15, 0.95);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-dim);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
  pointer-events: auto;
  z-index: 3000;
  box-sizing: border-box;
}

.notification.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes notifyIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.notification.success {
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 4px 20px rgba(0, 255, 136, 0.15);
}

.notification.error {
  border-color: var(--red);
  color: var(--red);
  box-shadow: 0 4px 20px rgba(255, 68, 102, 0.15);
}

.notification.info {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 4px 20px rgba(0, 255, 247, 0.15);
}

.notification.warning {
  border-color: var(--yellow);
  color: var(--yellow);
  box-shadow: 0 4px 20px rgba(255, 170, 0, 0.15);
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--cyan), var(--purple));
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--cyan);
}

/* ========================================
   Utility Classes
   ======================================== */
.text-cyan { color: var(--cyan); }
.text-purple { color: var(--purple); }
.text-green { color: var(--green); }
.text-muted { color: var(--text-muted); }

.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }

.w-full { width: 100%; }

.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mb-2 { margin-bottom: var(--space-2); }

/* ========================================
   Animations
   ======================================== */
.fade-in {
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-up {
  animation: slideUp 0.4s ease-out;
}

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

.glow-pulse {
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(0, 255, 247, 0.3); }
  50% { box-shadow: 0 0 24px rgba(0, 255, 247, 0.5); }
}

/* ========================================
   统一页头 - 单行布局样式
   ======================================== */
.header-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.header-item {
  display: inline-block;
  vertical-align: middle;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.header-sep {
  display: inline-block;
  vertical-align: middle;
  width: 1px;
  height: 12px;
  background: var(--border-dim);
  margin: 0 var(--space-2);
}

.user-vk-tag {
  display: inline-block;
  vertical-align: middle;
  background: linear-gradient(135deg, #00c8d4, #00a8e8);
  color: var(--bg-deep);
  padding: 1px 4px;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-right: 4px;
}

/* 退出按钮样式 */
.status-action-logout {
  color: var(--text-muted);
}

.status-action-logout:hover {
  color: var(--red);
}

/* 非会员标识 */
.badge-no-vip {
  display: inline-block;
  vertical-align: middle;
  background: rgba(136, 136, 160, 0.12);
  color: var(--text-muted);
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  border: 1px solid rgba(136, 136, 160, 0.2);
}
