/* =============================================
   拾伍 - Premium Modern Design System
   高级现代设计系统 - 深色主题 + 玻璃拟态
   ============================================= */

:root {
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-orange: #f97316;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --bg-primary: #0f0f1a;
  --bg-secondary: #16162a;
  --bg-tertiary: #1e1e3a;
  --bg-card: rgba(30, 30, 58, 0.8);
  --bg-glass: rgba(30, 30, 58, 0.6);
  --bg-hover: rgba(99, 102, 241, 0.1);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-subtle: rgba(99, 102, 241, 0.15);
  --border-default: rgba(99, 102, 241, 0.25);
  --border-focus: rgba(99, 102, 241, 0.5);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
  --shadow-glow-sm: 0 0 20px rgba(99, 102, 241, 0.2);
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

header {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 72px;
}

.logo {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, #818cf8, var(--accent-purple), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-links a.active {
  color: var(--text-primary);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.1));
  box-shadow: inset 0 0 0 1px var(--border-default);
}

main {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.hero {
  text-align: center;
  padding: 80px 0 60px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.1;
}

.hero h1 span {
  background: linear-gradient(135deg, #818cf8, var(--accent-purple), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: white;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-focus);
  transform: translateY(-2px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: translateY(-2px);
}

.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-full { width: 100%; }

.features { padding: 48px 0; }

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.feature-grid-games {
  max-width: 900px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-500), var(--accent-purple), var(--accent-pink));
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.feature-card:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-glow-sm);
  transform: translateY(-2px);
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  font-weight: 700;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: linear-gradient(135deg, var(--primary-600), var(--accent-purple));
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.home-interaction {
  max-width: 900px;
  margin: 0 auto 48px;
  padding: 0 16px;
}

.home-interaction-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.home-interaction-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.home-interaction-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-interaction-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.home-interaction-card:hover {
  border-color: var(--border-default);
  background: var(--bg-hover);
  transform: translateX(4px);
}

.home-interaction-card strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
}

.home-interaction-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 8px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-interaction-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 12px;
}

.auth-section {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 72px - 80px);
  padding: 40px 0;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 32px;
  font-size: 1.75rem;
  font-weight: 700;
}

.auth-switch {
  text-align: center;
  margin-top: 24px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.auth-switch a {
  color: #818cf8;
  text-decoration: none;
  font-weight: 600;
}

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.15s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group small {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.form-group-check {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-group-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-500);
}

.form-group-check label {
  margin-bottom: 0;
  color: var(--text-secondary);
}

.form-error, .form-success {
  font-size: 0.9rem;
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  display: none;
}

.form-error.show, .form-success.show { display: block; }

.form-error {
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.form-success {
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.dashboard-section { padding: 40px 0; }

.dashboard-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.dashboard-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.dashboard-header p { color: var(--text-secondary); }

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: all 0.15s ease;
}

.dash-card:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-glow-sm);
}

.dash-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-600), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.dash-card-info { flex: 1; min-width: 0; }

.dash-card-info h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  font-weight: 600;
}

.dash-card-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.dash-card-meta {
  font-size: 0.8rem !important;
  color: var(--text-muted) !important;
  word-break: break-all;
}

.dash-card-clickable { cursor: pointer; }
.dash-card-clickable:hover { transform: translateY(-2px); }

.dashboard-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-badge {
  display: inline-flex;
  padding: 2px 10px;
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  margin-left: 8px;
  vertical-align: middle;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  backdrop-filter: blur(8px);
  padding: 16px;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-glow);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-card h2 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.modal-actions .btn { flex: 1; }

.modal-notif { max-width: 520px; }

.modal-notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-notif-header h2 {
  margin: 0;
  text-align: left;
  font-size: 1.25rem;
}

.notif-list {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notif-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  cursor: pointer;
}

.notif-item:hover {
  border-color: var(--border-default);
  background: var(--bg-hover);
}

.notif-item.unread {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

.notif-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-500), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.notif-body { flex: 1; min-width: 0; }

.notif-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 4px;
}

.notif-text strong { color: var(--text-primary); }

.notif-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent-red);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

footer {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
  background: var(--bg-secondary);
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

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

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  color: white;
  font-weight: 600;
  z-index: 9999;
  animation: slideIn 0.3s ease;
  max-width: 360px;
  backdrop-filter: blur(10px);
}

.toast-success {
  background: rgba(16, 185, 129, 0.9);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.toast-error {
  background: rgba(239, 68, 68, 0.9);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

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

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track { background: var(--bg-secondary); }

::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: var(--radius-full);
}

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

::selection {
  background: rgba(99, 102, 241, 0.3);
  color: var(--text-primary);
}

@media (max-width: 768px) {
  nav { padding: 0 16px; height: 64px; }
  .nav-links { gap: 4px; }
  .nav-links a { padding: 8px 12px; font-size: 0.85rem; }
  main { padding: 0 16px; }
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 2rem; }
  .auth-card { padding: 28px 20px; }
  .feature-grid { grid-template-columns: 1fr; }
  .dashboard-cards { grid-template-columns: 1fr; }
}
