/* ============================================
   Physics Lab - Global Styles
   Dark Tech Theme
   ============================================ */

:root {
  --bg: #0a0e27;
  --bg2: #12163a;
  --bg3: #1a1f4b;
  --ink: #e8eaf6;
  --muted: #7986cb;
  --rule: rgba(255, 255, 255, .12);
  --accent: #00d4ff;
  --accent2: #ffd700;
  --danger: #ef4444;
  --success: #22c55e;
  --font-sans: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, .4);
  --shadow-glow: 0 0 20px rgba(0, 212, 255, .3);
}

html[data-theme="light"] {
  --bg: #f6f8ff;
  --bg2: #ffffff;
  --bg3: #eef3ff;
  --ink: #16213a;
  --muted: #60708f;
  --rule: rgba(30, 41, 59, .14);
  --accent: #2563eb;
  --accent2: #f59e0b;
  --shadow: 0 8px 28px rgba(15, 23, 42, .12);
  --shadow-glow: 0 0 18px rgba(37, 99, 235, .18);
}

html[data-theme="warm"] {
  --bg: #fff7ed;
  --bg2: #fffbeb;
  --bg3: #fdecc8;
  --ink: #3b2a16;
  --muted: #8a6b3e;
  --rule: rgba(120, 80, 30, .18);
  --accent: #d97706;
  --accent2: #16a34a;
  --shadow: 0 8px 28px rgba(120, 53, 15, .13);
  --shadow-glow: 0 0 18px rgba(217, 119, 6, .16);
}

html[data-theme="blackboard"] {
  --bg: #0b1f18;
  --bg2: #12352a;
  --bg3: #1c4a3c;
  --ink: #f0fdf4;
  --muted: #a7c8b7;
  --rule: rgba(220, 252, 231, .16);
  --accent: #86efac;
  --accent2: #fde68a;
  --shadow: 0 8px 32px rgba(0, 0, 0, .38);
  --shadow-glow: 0 0 18px rgba(134, 239, 172, .22);
}

html[data-theme="light"] body,
html[data-theme="warm"] body {
  background:
    radial-gradient(circle at 20% 15%, rgba(37, 99, 235, .08), transparent 28%),
    radial-gradient(circle at 78% 10%, rgba(245, 158, 11, .10), transparent 24%),
    var(--bg);
}

html[data-theme="light"] #starfield,
html[data-theme="warm"] #starfield {
  opacity: .18;
}

html[data-theme="light"] .navbar,
html[data-theme="warm"] .navbar {
  background: rgba(255, 255, 255, .76);
}

html[data-theme="light"] .navbar.scrolled,
html[data-theme="warm"] .navbar.scrolled {
  background: rgba(255, 255, 255, .94);
}

.nav-icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: transform .18s, border-color .18s, background .18s;
}

.nav-icon-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: rgba(0, 212, 255, .12);
}

.nav-icon-dot {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 2px var(--bg2);
}

.theme-popover,
.notice-popover {
  position: fixed;
  top: 62px;
  right: 18px;
  z-index: 2200;
  width: min(360px, calc(100vw - 24px));
  display: none;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: rgba(18, 22, 58, .96);
  color: var(--ink);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

html[data-theme="light"] .theme-popover,
html[data-theme="light"] .notice-popover,
html[data-theme="warm"] .theme-popover,
html[data-theme="warm"] .notice-popover {
  background: rgba(255, 255, 255, .96);
}

.theme-popover.open,
.notice-popover.open {
  display: block;
}

.popover-head {
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--rule);
  font-weight: 800;
}

.theme-options {
  display: grid;
  gap: .55rem;
  padding: .9rem;
}

.theme-option {
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: .75rem;
  background: rgba(255,255,255,.06);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.theme-option.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.theme-option b { display: block; margin-bottom: .15rem; }
.theme-option span { color: var(--muted); font-size: .82rem; }

.notice-list {
  max-height: min(520px, calc(100vh - 140px));
  overflow: auto;
  padding: .65rem;
}

.notice-item {
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: .8rem;
  margin-bottom: .55rem;
  background: rgba(255,255,255,.06);
}

.notice-item.unread { border-color: color-mix(in srgb, var(--accent) 58%, var(--rule)); }
.notice-title { display: flex; gap: .5rem; justify-content: space-between; font-weight: 800; margin-bottom: .35rem; }
.notice-meta { color: var(--muted); font-size: .74rem; margin-bottom: .4rem; }
.notice-body { color: var(--ink); font-size: .88rem; white-space: pre-wrap; }
.notice-empty { padding: 1.4rem; color: var(--muted); text-align: center; }

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .2s;
}

a:hover {
  color: var(--accent2);
}

img {
  max-width: 100%;
  display: block;
}

/* ============================================
   Canvas Background
   ============================================ */
#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: .75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 14, 39, .7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--rule);
  transition: background .3s, box-shadow .3s;
}

.navbar.scrolled {
  background: rgba(10, 14, 39, .95);
  box-shadow: var(--shadow);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.navbar-brand span {
  color: var(--accent2);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.navbar-nav a {
  color: var(--ink);
  font-size: .95rem;
  font-weight: 500;
  position: relative;
}

.navbar-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width .3s;
}

.navbar-nav a:hover::after,
.navbar-nav a.active::after {
  width: 100%;
}

.navbar-nav a:hover {
  color: var(--accent);
}

.navbar-nav a.active {
  color: var(--accent);
}

.navbar-nav a.nav-highlight {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: white;
  padding: .4rem .8rem;
  border-radius: 8px;
  font-weight: 600;
}

.navbar-nav a.nav-highlight::after {
  display: none;
}

.navbar-nav a.nav-highlight:hover {
  background: linear-gradient(135deg, #fbbf24, #fb923c);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249,115,22,.3);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: .78rem;
}

.nav-vip-info {
  display: none;
  align-items: center;
  padding: .22rem;
  border: 1px solid rgba(255, 215, 0, .35);
  border-radius: 999px;
  background: rgba(255, 215, 0, .08);
  color: var(--accent2);
  white-space: nowrap;
  margin-right: -.36rem;
}

.nav-vip-info.is-renew-warning {
  border-color: rgba(251, 146, 60, .55);
  background: rgba(251, 146, 60, .12);
  color: #ffb86c;
}

.nav-vip-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: .12rem .45rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd700, #ff9f1c);
  color: #1a1200;
  font-weight: 800;
  letter-spacing: .04em;
}

.nav-logout-btn {
  white-space: nowrap;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: .5rem;
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  transition: .3s;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .65rem 1.5rem;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #0099cc);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 212, 255, .3);
}

.btn-primary:hover {
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-secondary:hover {
  background: rgba(0, 212, 255, .1);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #cc0000);
  color: #fff;
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #16a34a);
  color: #fff;
}

.btn-gold {
  background: linear-gradient(135deg, var(--accent2), #ffaa00);
  color: #1a1a1a;
  box-shadow: 0 4px 15px rgba(255, 215, 0, .3);
}

.btn-gold:hover {
  box-shadow: 0 0 20px rgba(255, 215, 0, .4);
}

.btn-sm {
  padding: .4rem 1rem;
  font-size: .85rem;
}

.btn-lg {
  padding: .9rem 2.5rem;
  font-size: 1.1rem;
}

/* ============================================
   Cards
   ============================================ */
.card {
  background: rgba(26, 31, 75, .6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform .3s, box-shadow .3s, border-color .3s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(0, 212, 255, .3);
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: .5rem;
  color: var(--ink);
}

.card-text {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.card-badge {
  display: inline-block;
  padding: .25rem .75rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  margin-bottom: .75rem;
}

.badge-free {
  background: rgba(34, 197, 94, .2);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, .3);
}

.badge-vip {
  background: rgba(255, 215, 0, .2);
  color: var(--accent2);
  border: 1px solid rgba(255, 215, 0, .3);
}

.badge-category {
  background: rgba(0, 212, 255, .15);
  color: var(--accent);
  border: 1px solid rgba(0, 212, 255, .25);
}

/* ============================================
   Forms
   ============================================ */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  margin-bottom: .5rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
}

.form-input {
  width: 100%;
  padding: .75rem 1rem;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: inherit;
  font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, .15);
}

.form-input::placeholder {
  color: rgba(121, 134, 203, .6);
}

.form-hint {
  font-size: .8rem;
  color: var(--muted);
  margin-top: .25rem;
}

.form-error {
  font-size: .85rem;
  color: var(--danger);
  margin-top: .25rem;
}

/* ============================================
   Layout Utilities
   ============================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

.section {
  padding: 5rem 0;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--ink), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 3rem;
  font-size: 1.05rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.gap-2 {
  gap: 2rem;
}

.text-center {
  text-align: center;
}

.mt-2 {
  margin-top: 2rem;
}

.mb-2 {
  margin-bottom: 2rem;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  position: relative;
}

.hero-content {
  max-width: 800px;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--ink), var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--rule);
  padding: 3rem 0 2rem;
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: .75rem;
}

.footer-desc {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6;
}

.footer-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--ink);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: .5rem;
}

.footer-links a {
  color: var(--muted);
  font-size: .9rem;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
  padding: 8rem 0 4rem;
  text-align: center;
  position: relative;
}

.page-title {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: .75rem;
  background: linear-gradient(135deg, var(--ink), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-desc {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   Tabs
   ============================================ */
.tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.tab {
  padding: .6rem 1.25rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--rule);
  color: var(--muted);
  cursor: pointer;
  transition: .2s;
  font-size: .9rem;
  font-weight: 500;
}

.tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tab.active {
  background: rgba(0, 212, 255, .15);
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(0, 212, 255, .3); }
  50% { box-shadow: 0 0 20px rgba(0, 212, 255, .6); }
}

.animate-fadeIn {
  animation: fadeIn .6s ease forwards;
}

.animate-slideUp {
  animation: slideUp .6s ease forwards;
}

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

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

/* Stagger children */
.stagger > * {
  opacity: 0;
  animation: slideUp .5s ease forwards;
}

.stagger > *:nth-child(1) { animation-delay: .1s; }
.stagger > *:nth-child(2) { animation-delay: .2s; }
.stagger > *:nth-child(3) { animation-delay: .3s; }
.stagger > *:nth-child(4) { animation-delay: .4s; }
.stagger > *:nth-child(5) { animation-delay: .5s; }
.stagger > *:nth-child(6) { animation-delay: .6s; }

/* ============================================
   Auth Pages
   ============================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.5rem 2rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(18, 22, 58, .8);
  backdrop-filter: blur(20px);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 2.5rem;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: .5rem;
}

.auth-header p {
  color: var(--muted);
  font-size: .95rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: .9rem;
}

/* ============================================
   VIP Page
   ============================================ */
.pricing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.pricing-card {
  background: rgba(26, 31, 75, .6);
  backdrop-filter: blur(16px);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  transition: transform .3s, box-shadow .3s;
}

.pricing-card:hover {
  transform: translateY(-4px);
}

.pricing-card.featured {
  border-color: var(--accent2);
  box-shadow: 0 0 30px rgba(255, 215, 0, .15);
  position: relative;
}

.pricing-card.featured::before {
  content: '推荐';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent2);
  color: #1a1a1a;
  padding: .25rem 1rem;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 700;
}

.pricing-name {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: .5rem;
}

.pricing-price {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: .25rem;
}

.pricing-price span {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 400;
}

.pricing-period {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 1.5rem;
}

.pricing-features {
  list-style: none;
  text-align: left;
  margin-bottom: 2rem;
}

.pricing-features li {
  padding: .5rem 0;
  color: var(--muted);
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.pricing-features li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
}

/* ============================================
   Profile Page
   ============================================ */
.profile-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 3rem;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--bg);
}

.profile-info h2 {
  font-size: 1.8rem;
  margin-bottom: .5rem;
}

.profile-meta {
  display: flex;
  gap: 1.5rem;
  color: var(--muted);
  font-size: .9rem;
}

.profile-section {
  margin-bottom: 2rem;
}

.profile-section h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--rule);
}

/* ============================================
   Experiment Detail
   ============================================ */
.experiment-page-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 1.25rem;
}

.experiment-back-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .55rem 1rem;
  border: 1px solid rgba(0, 212, 255, .35);
  border-radius: 999px;
  background: rgba(0, 212, 255, .1);
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s, background .2s, border-color .2s;
}

.experiment-back-btn:hover {
  transform: translateY(-1px);
  background: rgba(0, 212, 255, .16);
  border-color: var(--accent);
}

.experiment-frame {
  position: relative;
  width: 100%;
  height: min(76vh, 820px);
  min-height: 660px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg2);
  overflow: hidden;
}

.experiment-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.experiment-frame:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border: none;
  border-radius: 0;
  background: #050816;
}

.experiment-frame:fullscreen iframe {
  width: 100vw;
  height: 100vh;
}

.experiment-fullscreen-btn {
  position: absolute;
  right: .85rem;
  top: .85rem;
  z-index: 5;
  padding: .45rem .75rem;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  background: rgba(5, 8, 22, .72);
  color: #fff;
  font-size: .85rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

.experiment-fullscreen-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.experiment-info {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.experiment-sidebar .card {
  margin-bottom: 1rem;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
  position: fixed;
  top: 80px;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  background: var(--bg3);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: .9rem;
  box-shadow: var(--shadow);
  animation: slideUp .3s ease;
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 280px;
}

.toast-success {
  border-color: rgba(34, 197, 94, .4);
  background: rgba(34, 197, 94, .1);
}

.toast-error {
  border-color: rgba(239, 68, 68, .4);
  background: rgba(239, 68, 68, .1);
}

.toast-info {
  border-color: rgba(0, 212, 255, .4);
  background: rgba(0, 212, 255, .1);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 992px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-cards { grid-template-columns: 1fr; }
  .experiment-info { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .navbar-nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(10, 14, 39, .98);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--rule);
    transform: translateY(-150%);
    transition: transform .3s;
  }

  .navbar-nav.open {
    transform: translateY(0);
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .navbar-actions {
    display: none;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .profile-meta {
    justify-content: center;
  }

  .page-title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .auth-card {
    padding: 1.5rem;
  }

  .pricing-card {
    padding: 1.5rem;
  }
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--bg3);
  border-radius: 4px;
}

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

/* Selection */
::selection {
  background: rgba(0, 212, 255, .3);
  color: var(--ink);
}

/* ============================================
   Grade Tabs
   ============================================ */
.grade-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.grade-tab {
  padding: .8rem 2rem;
  border-radius: 30px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--rule);
  color: var(--muted);
  cursor: pointer;
  transition: .3s;
  font-size: 1rem;
  font-weight: 600;
}

.grade-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.grade-tab.active {
  background: linear-gradient(135deg, var(--accent), #0099cc);
  color: #fff;
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

/* ============================================
   Experiments Tree
   ============================================ */
.experiments-tree {
  max-width: 900px;
  margin: 0 auto;
}

.tree-chapter {
  margin-bottom: .5rem;
}

.tree-chapter-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.5rem;
  background: rgba(26, 31, 75, .8);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  cursor: pointer;
  transition: .3s;
}

.tree-chapter-header:hover {
  background: rgba(26, 31, 75, 1);
  border-color: rgba(0, 212, 255, .3);
}

.tree-chapter.expanded .tree-chapter-header {
  background: rgba(0, 212, 255, .1);
  border-color: rgba(0, 212, 255, .4);
}

.tree-arrow {
  font-size: .75rem;
  color: var(--accent);
  transition: transform .3s;
}

.tree-chapter-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.tree-chapter-content {
  padding-left: 1rem;
  margin-top: .5rem;
}

.tree-section {
  margin-bottom: .5rem;
}

.tree-section-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.25rem;
  background: rgba(18, 22, 58, .8);
  border: 1px solid var(--rule);
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  transition: .3s;
}

.tree-section-header:hover {
  background: rgba(18, 22, 58, 1);
  border-color: rgba(0, 212, 255, .2);
}

.tree-section.expanded .tree-section-header {
  background: rgba(0, 212, 255, .08);
}

.tree-section-title {
  font-size: .9rem;
  color: var(--muted);
}

.tree-section-content {
  padding-left: 1rem;
  margin-top: .75rem;
}

.experiment-grid {
  gap: 1rem;
}

.experiment-card {
  background: rgba(10, 14, 39, .6);
}

/* ============================================
   Admin Panel
   ============================================ */
.admin-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.5rem;
}

.admin-tab {
  padding: .6rem 1.5rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--rule);
  color: var(--muted);
  cursor: pointer;
  transition: .2s;
  font-size: .95rem;
  font-weight: 600;
}

.admin-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-tab.active {
  background: rgba(0, 212, 255, .15);
  border-color: var(--accent);
  color: var(--accent);
}

.admin-toolbar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.admin-search {
  flex: 1;
  min-width: 200px;
}

.admin-filter {
  width: auto;
  min-width: 140px;
  cursor: pointer;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(18, 22, 58, .8);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}

.admin-table th {
  background: rgba(0, 212, 255, .1);
  color: var(--accent);
  font-weight: 600;
  font-size: .9rem;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover {
  background: rgba(0, 212, 255, .05);
}

.admin-table .badge {
  padding: .25rem .75rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}

.profile-avatar-small {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  font-weight: 700;
  color: var(--bg);
}

/* ============================================
   Modal
   ============================================ */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .8);
  backdrop-filter: blur(8px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.modal-header h3 {
  font-size: 1.2rem;
  color: var(--ink);
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color .2s;
}

.modal-close:hover {
  color: var(--ink);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1.5rem;
  border-top: 1px solid var(--rule);
}

/* ============================================
   Responsive for Admin
   ============================================ */
@media (max-width: 768px) {
  .admin-toolbar {
    flex-direction: column;
  }
  
  .admin-search,
  .admin-filter {
    width: 100%;
    min-width: auto;
  }
  
  .admin-table {
    overflow-x: auto;
    display: block;
  }
  
  .admin-table th,
  .admin-table td {
    padding: .75rem .5rem;
    font-size: .85rem;
  }
  
  .grade-tab {
    padding: .6rem 1.25rem;
    font-size: .9rem;
  }
  
  .tree-chapter-header,
  .tree-section-header {
    padding: .75rem 1rem;
  }
}
