:root {
  --bg-dark: #090d16;
  --card-bg: rgba(18, 24, 38, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-sub: #6b7280;
  
  --accent-primary: #6366f1;
  --accent-secondary: #ec4899;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-cyan: #06b6d4;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* Background Dynamic Glows */
.bg-glow-1 {
  position: fixed;
  top: -10%;
  left: 20%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.bg-glow-2 {
  position: fixed;
  bottom: 10%;
  right: 15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(9, 13, 22, 0.85);
  border-bottom: 1px solid var(--border-color);
  padding: 0.8rem 1.5rem;
}

.header-container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-badge {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* Layout */
.main-container {
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem 1.2rem;
  position: relative;
  z-index: 1;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem 1rem;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 1rem;
}

.hero-gradient-text {
  background: linear-gradient(135deg, #a5b4fc 0%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 0.94rem;
  color: var(--text-muted);
  max-width: 860px;
  margin: 0 auto 1.8rem auto;
  line-height: 1.5;
}

/* Buttons - 原版高光紫粉渐变 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(90deg, #6366f1 0%, #818cf8 40%, #f472b6 100%);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(244, 114, 182, 0.26);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(244, 114, 182, 0.38);
  opacity: 0.96;
}

.btn-reward {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.25) 100%);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 0.65rem 1.4rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.btn-reward:hover {
  background: rgba(245, 158, 11, 0.3);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
  transform: translateY(-1px);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Catalog Grid */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-top: 1.5rem;
}

.test-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  backdrop-filter: blur(12px);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.test-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.test-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.test-icon {
  font-size: 1.8rem;
}

.test-tag {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.test-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: #fff;
}

.test-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.2rem;
}

.test-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-sub);
  margin-bottom: 0.8rem;
}

/* Test Flow Container */
.test-flow-container {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(16px);
  max-width: 680px;
  margin: 0 auto;
}

.test-flow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.flow-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.progress-text {
  font-size: 0.85rem;
  color: #818cf8;
  font-weight: 600;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1 0%, #ec4899 100%);
  transition: width 0.3s ease;
}

.question-card {
  margin-bottom: 2rem;
}

.question-number {
  font-size: 0.8rem;
  color: #818cf8;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.question-text {
  font-size: 1.18rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.45;
  margin-bottom: 1.4rem;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.option-btn {
  width: 100%;
  text-align: left;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.option-btn:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateX(3px);
}

.option-btn.selected {
  background: rgba(99, 102, 241, 0.22);
  border-color: #6366f1;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.option-indicator {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.option-btn.selected .option-indicator {
  border-color: #818cf8;
  background: #6366f1;
}

.flow-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border-color);
}

/* Result Container */
.result-container {
  max-width: 760px;
  margin: 0 auto;
}

.result-header-card {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.8) 0%, rgba(18, 24, 38, 0.85) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  text-align: center;
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  margin-bottom: 1.5rem;
}

.result-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.3);
  margin-bottom: 1rem;
}

.result-main-title {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.result-subtitle {
  font-size: 1.15rem;
  color: #c084fc;
  font-weight: 600;
  margin-bottom: 1rem;
}

.result-summary {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.result-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}

.detail-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  backdrop-filter: blur(12px);
}

.detail-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Dimensions & Bars */
.dimension-row {
  margin-bottom: 1rem;
}

.dimension-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.dimension-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
}

.dimension-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1 0%, #ec4899 100%);
  border-radius: 10px;
}

/* Ad Reward Banner - Clean High-Impact Layout */
.ad-reward-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(30, 27, 75, 0.45) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 1.5rem;
  backdrop-filter: blur(12px);
}

.ad-content-left {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

.ad-icon-badge {
  width: 78px;
  height: 98px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(245, 158, 11, 0.5);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 14px rgba(245, 158, 11, 0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ad-icon-badge:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 20px rgba(245, 158, 11, 0.4);
}

.ad-icon-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-text-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ad-text-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fbbf24;
  line-height: 1.3;
}

.ad-text-info p {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.ad-miniprogram-tag {
  display: inline-block;
  align-self: flex-start;
  margin-top: 0.35rem;
  padding: 3px 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(245, 158, 11, 0.45);
  border-radius: 5px;
  font-family: monospace;
  font-size: 0.76rem;
  color: #fcd34d;
}

/* Toast */
.toast-msg {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid #6366f1;
  color: #fff;
  padding: 0.8rem 1.6rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 100;
  pointer-events: none;
  opacity: 0;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* 💳 Paywall & Share Modal System - Premium Academic Design */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(14px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.paywall-card {
  background: linear-gradient(135deg, rgba(22, 27, 46, 0.97) 0%, rgba(12, 16, 28, 0.98) 100%);
  border: 1px solid rgba(129, 140, 248, 0.35);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 2.2rem 1.8rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.88), 0 0 35px rgba(99, 102, 241, 0.25);
  position: relative;
  text-align: center;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.show .paywall-card {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close-btn:hover {
  color: #fff;
}

.paywall-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
  margin-bottom: 0.9rem;
}

.paywall-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.35;
  margin-bottom: 0.8rem;
}

.paywall-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.2rem;
}

.paywall-price-box {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  padding: 0.6rem 1rem;
}

.paywall-price {
  font-size: 2.3rem;
  font-weight: 900;
  color: #fbbf24;
}

.paywall-original-price {
  font-size: 0.92rem;
  color: var(--text-sub);
  text-decoration: line-through;
}

.paywall-features {
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.4rem;
  font-size: 0.86rem;
  color: var(--text-main);
}

.paywall-feature-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.paywall-feature-item:last-child {
  margin-bottom: 0;
}

.paywall-feature-item span {
  color: #10b981;
  font-weight: 700;
}

.pay-btn-wechat {
  width: 100%;
  padding: 0.88rem;
  border-radius: 9999px;
  background: linear-gradient(90deg, #07c160 0%, #10b981 100%);
  color: #fff;
  font-size: 1.02rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(7, 193, 96, 0.38);
  transition: all 0.25s ease;
  margin-bottom: 0.8rem;
}

.pay-btn-wechat:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(7, 193, 96, 0.5);
  opacity: 0.96;
}

.code-unlock-toggle {
  font-size: 0.82rem;
  color: #818cf8;
  cursor: pointer;
  text-decoration: underline;
}

.code-input-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.code-input-group input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  color: #fff;
  font-size: 0.9rem;
}

.code-input-group button {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: #6366f1;
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

/* 🌌 Test Matrix Vertical Scroll Container (上下滑动探索限制容器) */
.matrix-recommend-section {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.6) 0%, rgba(18, 24, 38, 0.8) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.4rem;
  margin-top: 2rem;
  backdrop-filter: blur(14px);
  position: relative;
}

.matrix-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  padding: 0 0.2rem;
}

.matrix-title-group {
  text-align: left;
}

.matrix-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.matrix-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.matrix-swipe-hint {
  font-size: 0.78rem;
  color: #818cf8;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(99, 102, 241, 0.12);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  white-space: nowrap;
}

/* 核心上下滑动限高网格容器 */
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
  max-height: 380px;
  overflow-y: auto;
  padding: 0.2rem 0.6rem 0.4rem 0.2rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.45) rgba(255, 255, 255, 0.04);
}

.matrix-grid::-webkit-scrollbar {
  width: 6px;
}

.matrix-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}

.matrix-grid::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.45);
  border-radius: 10px;
}

.matrix-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.7);
}

.matrix-mini-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.matrix-mini-card:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

.matrix-card-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.matrix-card-icon {
  font-size: 1.5rem;
}

.matrix-card-name {
  font-size: 0.94rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.matrix-card-desc {
  font-size: 0.78rem;
  color: var(--text-sub);
  line-height: 1.45;
  margin-bottom: 1rem;
}

/* 矩阵内部小卡片按钮渐变 */
.matrix-card-btn {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border-radius: 9999px;
  background: linear-gradient(90deg, #4f46e5 0%, #6366f1 50%, #3b82f6 100%);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.25);
}

.matrix-card-btn:hover {
  opacity: 0.94;
  transform: scale(1.02);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

/* Responsive */
@media (max-width: 640px) {
  .hero-title { font-size: 1.7rem; }
  .hero-subtitle { font-size: 0.88rem; }
  .ad-reward-banner { flex-direction: column; text-align: center; }
  .ad-content-left { flex-direction: column; gap: 1rem; }
  .ad-miniprogram-tag { align-self: center; }
  .result-main-title { font-size: 2.2rem; }
  .matrix-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .matrix-grid { grid-template-columns: 1fr; max-height: 360px; }
}
