:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --bg: #f8f9fc;
  --white: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --transition: all 0.3s ease;
  --wechat-green: #07c160;
  --alipay-blue: #1677ff;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header .container { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 22px; font-weight: 800; color: var(--primary); text-decoration: none; }
.logo span { color: var(--text-primary); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 36px; border: none; border-radius: var(--radius);
  font-size: 16px; font-weight: 600; cursor: pointer;
  transition: var(--transition); text-decoration: none; line-height: 1;
}
.btn-primary {
  background: var(--primary); color: var(--white);
  box-shadow: 0 4px 14px rgba(26,115,232,0.4);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(26,115,232,0.5); }
.btn-lg { padding: 18px 48px; font-size: 18px; border-radius: var(--radius-lg); }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Cards */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  padding: 24px;
}
.card-lg { padding: 40px; }

/* Hero section */
.hero {
  text-align: center; padding: 80px 0 60px;
}
.hero h1 {
  font-size: 42px; font-weight: 800; line-height: 1.2;
  margin-bottom: 20px; color: var(--text-primary);
}
.hero h1 .highlight { color: var(--primary); }
.hero p {
  font-size: 18px; color: var(--text-secondary);
  max-width: 600px; margin: 0 auto 40px;
}

/* Trust badges */
.trust-badges {
  display: flex; justify-content: center; gap: 32px; flex-wrap: wrap;
  margin-top: 48px;
}
.trust-badge {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-secondary); font-size: 14px;
}
.trust-badge .icon {
  width: 24px; height: 24px; background: var(--primary-light);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 14px; font-weight: 700;
}

/* Features */
.features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  padding: 40px 0 80px;
}
.feature {
  text-align: center; padding: 32px 24px;
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  transition: var(--transition);
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature .icon { font-size: 36px; margin-bottom: 16px; }
.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { font-size: 14px; color: var(--text-secondary); }

/* Test page */
.test-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.progress-bar {
  flex: 1; margin: 0 24px; height: 8px; background: var(--border);
  border-radius: 4px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--primary); border-radius: 4px;
  transition: width 0.3s ease;
}
.timer { font-size: 14px; color: var(--text-secondary); white-space: nowrap; }
.question-counter { font-size: 14px; color: var(--text-secondary); white-space: nowrap; }

/* Question area */
.question-area {
  min-height: 400px; padding: 32px 0;
}
.question-text {
  font-size: 18px; text-align: center; margin-bottom: 32px; color: var(--text-primary);
}
.matrix-container {
  display: flex; justify-content: center; margin-bottom: 40px;
}
.matrix-grid {
  display: grid; grid-template-columns: repeat(3, 100px); gap: 8px;
  padding: 24px; background: var(--bg); border-radius: var(--radius);
}
.matrix-cell {
  width: 100px; height: 100px; background: var(--white);
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}
.matrix-cell.missing {
  border: 3px dashed var(--primary); background: var(--primary-light);
  color: var(--primary); font-size: 40px;
}

/* Options grid */
.options-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  max-width: 600px; margin: 0 auto;
}
.option-btn {
  padding: 24px 16px; border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--white); cursor: pointer; transition: var(--transition);
  text-align: center; font-size: 28px; min-height: 80px;
  display: flex; align-items: center; justify-content: center;
}
.option-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.option-btn.selected {
  border-color: var(--primary); background: var(--primary);
  color: var(--white); box-shadow: 0 4px 14px rgba(26,115,232,0.3);
}
.option-label {
  font-size: 12px; color: var(--text-light); margin-top: 4px;
}
.option-btn.selected .option-label { color: rgba(255,255,255,0.8); }

/* Navigation */
.test-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 0;
}
.nav-dots {
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: center;
  margin-bottom: 24px;
}
.nav-dot {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; cursor: pointer; transition: var(--transition);
  color: var(--text-secondary);
}
.nav-dot.answered { background: var(--primary); border-color: var(--primary); color: var(--white); }
.nav-dot.current { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

/* Payment page */
.payment-container {
  max-width: 480px; margin: 60px auto; text-align: center;
}
.payment-amount {
  font-size: 48px; font-weight: 800; color: var(--primary);
  margin: 24px 0;
}
.payment-amount .currency { font-size: 24px; }
.payment-tabs {
  display: flex; gap: 12px; margin-bottom: 24px;
}
.payment-tab {
  flex: 1; padding: 16px; border: 2px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: var(--transition); text-align: center;
  font-weight: 600;
}
.payment-tab:hover { border-color: var(--primary); }
.payment-tab.active { border-color: var(--primary); background: var(--primary-light); }
.payment-tab.wechat.active { border-color: var(--wechat-green); background: #e8faf0; }
.payment-tab.alipay.active { border-color: var(--alipay-blue); background: #e8f4ff; }
.qr-container {
  width: 240px; height: 240px; margin: 24px auto;
  border: 2px solid var(--border); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  background: var(--white);
}
.countdown {
  font-size: 18px; color: var(--warning); font-weight: 600;
  margin-top: 16px;
}

/* Result page */
.result-container {
  max-width: 560px; margin: 60px auto; text-align: center;
}
.iq-score {
  font-size: 96px; font-weight: 800; color: var(--primary);
  margin: 24px 0 8px;
}
.iq-category {
  font-size: 24px; font-weight: 600; margin-bottom: 32px;
}
.bell-curve {
  width: 100%; height: 200px; margin: 32px 0;
}
.percentile {
  font-size: 18px; color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Admin */
.admin-container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px;
}
.stat-card {
  background: var(--white); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.stat-card .label { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-card .value { font-size: 32px; font-weight: 800; color: var(--text-primary); }
.stat-card .value.revenue { color: var(--success); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: 13px; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
td { font-size: 14px; }

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 16px; }
  .features { grid-template-columns: 1fr; }
  .options-grid { grid-template-columns: repeat(2, 1fr); }
  .matrix-grid { grid-template-columns: repeat(3, 80px); }
  .matrix-cell { width: 80px; height: 80px; }
  .trust-badges { flex-direction: column; align-items: center; gap: 12px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .iq-score { font-size: 72px; }
  .payment-container { margin: 32px auto; }
}

/* Footer */
.footer {
  text-align: center; padding: 40px 0; color: var(--text-light); font-size: 13px;
  border-top: 1px solid var(--border);
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.fade-in { animation: fadeIn 0.5s ease; }
.slide-up { animation: slideUp 0.6s ease; }

/* Loading */
.loading {
  display: flex; align-items: center; justify-content: center;
  min-height: 200px; color: var(--text-secondary);
}
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin-right: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
