/**
 * Lessons3D Visual Enhancements
 * Version: 2.0
 *
 * 这个文件包含所有视觉增强样式，基于 VISUAL_ENHANCEMENT_SPEC.md
 * 渐进增强策略：在不影响现有功能的前提下提升视觉体验
 */

/* ============================================
   增强色彩系统
   ============================================ */

:root {
  /* 视觉增强色彩 */
  --brand-primary-light: #4a7bc8;
  --brand-primary-dark: #1e3a73;
  --brand-primary-glow: rgba(54, 94, 171, 0.25);
  --brand-primary-glow-hover: rgba(54, 94, 171, 0.4);

  --brand-accent: #5eb3ff;
  --brand-accent-soft: #e3f2ff;

  --brand-highlight: #ffd166;
  --brand-highlight-soft: #fff8e7;

  /* 深度阴影系统 */
  --shadow-sm: 0 2px 8px rgba(36, 50, 74, 0.06);
  --shadow-md: 0 4px 16px rgba(36, 50, 74, 0.08);
  --shadow-lg: 0 8px 32px rgba(36, 50, 74, 0.12);
  --shadow-xl: 0 16px 48px rgba(36, 50, 74, 0.16);
  --shadow-2xl: 0 24px 64px rgba(36, 50, 74, 0.2);

  /* 光效系统 */
  --glow-primary: 0 0 24px rgba(54, 94, 171, 0.3);
  --glow-success: 0 0 20px rgba(44, 113, 87, 0.25);
  --glow-accent: 0 0 28px rgba(94, 179, 255, 0.35);

  /* 渐变系统 */
  --gradient-primary: linear-gradient(135deg, #365eab 0%, #284b91 100%);
  --gradient-primary-hover: linear-gradient(135deg, #4a7bc8 0%, #365eab 100%);
  --gradient-soft: linear-gradient(135deg, #eaf0fb 0%, #fff 100%);
  --gradient-glow: radial-gradient(circle at 50% 50%, rgba(54, 94, 171, 0.15) 0%, transparent 70%);

  /* 动画系统 */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-gentle: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --duration-fast: 200ms;
  --duration-normal: 350ms;
  --duration-slow: 600ms;

  /* 交互状态 */
  --state-hover: rgba(54, 94, 171, 0.08);
  --state-active: rgba(54, 94, 171, 0.12);
  --state-focus: rgba(54, 94, 171, 0.15);
}

/* ============================================
   1. 主CTA按钮增强
   ============================================ */

.edu-button--primary {
  position: relative !important;
  min-height: 52px !important;
  padding: 14px 28px !important;
  border: none !important;
  border-radius: 10px !important;
  color: #fff !important;
  background: var(--gradient-primary) !important;
  overflow: hidden !important;
  transition: all var(--duration-normal) var(--ease-smooth) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 4px 14px var(--brand-primary-glow),
    0 2px 4px rgba(36, 50, 74, 0.1) !important;
}

.edu-button--primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  transition: left 0.6s var(--ease-smooth);
}

.edu-button--primary:hover {
  transform: translateY(-2px) !important;
  background: var(--gradient-primary-hover) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 8px 24px var(--brand-primary-glow-hover),
    0 4px 8px rgba(36, 50, 74, 0.15) !important;
}

.edu-button--primary:active {
  transform: translateY(0) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 2px 8px var(--brand-primary-glow) !important;
}

.edu-button--primary .button-icon {
  display: inline-block;
  transition: transform var(--duration-normal) var(--ease-bounce);
}

.edu-button--primary:hover .button-icon {
  transform: scale(1.1) rotate(5deg);
}

.edu-button--quiet {
  min-height: 52px !important;
  padding: 14px 24px !important;
  border: 1.5px solid var(--brand-line) !important;
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(8px) !important;
  color: var(--brand-ink) !important;
  transition: all var(--duration-normal) var(--ease-smooth) !important;
}

.edu-button--quiet:hover {
  border-color: var(--brand-primary) !important;
  background: rgba(255, 255, 255, 0.98) !important;
  color: var(--brand-primary) !important;
  box-shadow: var(--shadow-md) !important;
}

/* ============================================
   2. Hero标题增强
   ============================================ */

.edu-hero h1 {
  text-shadow: 0 2px 4px rgba(36, 50, 74, 0.04);
}

.edu-hero h1 em {
  position: relative;
  display: inline-block;
  font-style: normal;
  animation: highlight-pulse 3s ease-in-out infinite;
}

/* 下划线已移除 - 保持简洁 */

@keyframes highlight-pulse {
  0%, 100% {
    color: var(--edu-teal, var(--brand-primary));
  }
  50% {
    color: var(--brand-primary-light);
  }
}

/* ============================================
   3. 时间对比模块增强
   ============================================ */

.edu-time-comparison {
  margin: 36px 0 0;
  padding: 28px 24px;
  border: 1.5px solid var(--brand-line);
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(234, 240, 251, 0.6) 100%
  );
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
}

.time-old {
  padding: 20px 16px;
  border-radius: 10px;
  background: rgba(83, 98, 121, 0.08);
  text-align: center;
  opacity: 0.75;
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

.time-old:hover {
  opacity: 1;
}

.time-old .time-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #536279;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(220, 38, 38, 0.5);
}

.time-arrow {
  font-size: 2rem;
  color: var(--brand-primary);
  animation: arrow-pulse 2s ease-in-out infinite;
}

@keyframes arrow-pulse {
  0%, 100% {
    transform: translateX(0);
    opacity: 0.6;
  }
  50% {
    transform: translateX(8px);
    opacity: 1;
  }
}

.time-new {
  padding: 24px 20px;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(44, 113, 87, 0.12) 0%,
    rgba(234, 244, 237, 0.8) 100%
  );
  border: 2px solid rgba(44, 113, 87, 0.25);
  text-align: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.time-new::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(44, 113, 87, 0.15) 0%,
    transparent 70%
  );
  animation: glow-rotate 4s linear infinite;
}

@keyframes glow-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.time-new .time-value--highlight {
  position: relative !important;
  font-size: 2.2rem !important;
  font-weight: 800 !important;
  color: #1e5a45 !important;
  z-index: 1 !important;
  line-height: 1.2 !important;
  word-break: keep-all !important;
  white-space: nowrap !important;
  animation: number-count 1.5s var(--ease-smooth) forwards !important;
}

@keyframes number-count {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.time-label {
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: #24324a !important;
  margin-bottom: 8px !important;
}

.time-desc {
  font-size: 0.85rem !important;
  color: #536279 !important;
  line-height: 1.5 !important;
  margin-top: 8px !important;
}

/* ============================================
   4. 信任元素增强
   ============================================ */

.edu-hero-trust {
  margin-top: 40px;
  padding: 24px 28px;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(234, 240, 251, 0.8) 100%
  );
  border: 1px solid rgba(214, 222, 234, 0.8);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  animation: trust-fade-in 0.8s var(--ease-smooth) 0.5s backwards;
}

@keyframes trust-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.trust-avatar {
  transition: all var(--duration-fast) var(--ease-smooth);
  box-shadow:
    0 2px 8px rgba(36, 50, 74, 0.15),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.trust-avatar:hover {
  transform: translateY(-2px) scale(1.05);
  z-index: 10;
  box-shadow:
    0 4px 12px rgba(36, 50, 74, 0.2),
    inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

.trust-count {
  box-shadow:
    0 2px 8px rgba(54, 94, 171, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.trust-text {
  color: #24324a;
}

.trust-text strong {
  color: #284b91;
  font-weight: 760;
}

/* ============================================
   5. 3D场景容器增强
   ============================================ */

.edu-lab {
  position: relative;
  box-shadow:
    0 40px 110px rgba(28, 68, 72, 0.26),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.edu-lab::before {
  content: '';
  position: absolute;
  inset: -40px;
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(54, 94, 171, 0.2) 0%,
    rgba(94, 179, 255, 0.1) 30%,
    transparent 70%
  );
  filter: blur(30px);
  z-index: -1;
  opacity: 0.8;
  animation: ambient-pulse 6s ease-in-out infinite;
  pointer-events: none;
}

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

/* 确保3D舞台不被遮挡 */
.edu-stage,
#heroStage {
  position: absolute;
  z-index: 1;
  pointer-events: auto;
}

.edu-stage-shell {
  position: relative;
  z-index: 1;
}

.edu-scene-switcher {
  position: relative;
  z-index: 10;
}

.edu-scene-switcher button {
  position: relative;
  transition: all var(--duration-normal) var(--ease-smooth);
  z-index: 10;
  pointer-events: auto;
  cursor: pointer;
}

.edu-scene-switcher button::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--brand-highlight, var(--edu-yellow));
  transform: scaleX(0);
  transition: transform var(--duration-normal) var(--ease-smooth);
}

.edu-scene-switcher button.is-active::before {
  transform: scaleX(1);
}

.edu-scene-switcher button:not(.is-active):hover {
  background: rgba(35, 152, 137, 0.12);
}

.edu-stage-controls {
  z-index: 2;
}

.edu-stage-controls button {
  backdrop-filter: blur(12px);
  transition: all var(--duration-fast) var(--ease-smooth);
}

.edu-stage-controls button:hover {
  background: rgba(83, 190, 170, 0.24);
  transform: scale(1.05);
}

.edu-stage-controls button[aria-pressed="true"] {
  background: rgba(83, 190, 170, 0.3);
  box-shadow: 0 0 12px rgba(83, 190, 170, 0.4);
}

/* ============================================
   6. 学习路径增强
   ============================================ */

.edu-path-grid {
  position: relative;
}

.edu-path-grid::before {
  content: '';
  position: absolute;
  top: 0;
  left: 36px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    180deg,
    var(--brand-primary) 0%,
    var(--brand-accent) 50%,
    var(--brand-success) 100%
  );
  opacity: 0.3;
  pointer-events: none;
}

.edu-path-grid li {
  transition: all var(--duration-normal) var(--ease-smooth);
  position: relative;
}

.edu-path-grid li:hover {
  padding-left: 12px;
  background: linear-gradient(
    90deg,
    rgba(234, 240, 251, 0.5) 0%,
    transparent 100%
  );
}

.edu-path-grid li > span {
  position: relative;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.edu-path-grid li:hover > span {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
  transform: scale(1.08);
  box-shadow: var(--shadow-md), var(--glow-primary);
}

.edu-path-grid li > span::after {
  content: '→';
  position: absolute;
  right: -28px;
  opacity: 0;
  transform: translateX(-10px);
  transition: all var(--duration-normal) var(--ease-smooth);
}

.edu-path-grid li:hover > span::after {
  opacity: 0.6;
  transform: translateX(0);
}

/* ============================================
   7. 课件板块增强
   ============================================ */

.edu-courseware-board {
  position: relative;
  box-shadow:
    0 28px 70px rgba(27, 66, 67, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  transition: transform var(--duration-normal) var(--ease-smooth);
}

.edu-courseware-board:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow:
    0 32px 80px rgba(27, 66, 67, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.edu-courseware-board::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(54, 94, 171, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(54, 94, 171, 0.02) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.edu-board-terms li {
  transition: all var(--duration-fast) var(--ease-smooth);
  box-shadow: var(--shadow-sm);
}

.edu-board-terms li:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============================================
   8. 教师反馈卡片增强
   ============================================ */

.teacher-story-card {
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
  transition: all var(--duration-normal) var(--ease-smooth);
  position: relative;
  padding: 32px;
}

.teacher-story-card:hover {
  transform: translateY(-6px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-2xl), var(--glow-primary);
}

.story-quote {
  position: relative !important;
  padding: 24px 28px !important;
  border-left: 4px solid var(--brand-primary) !important;
  background: rgba(234, 240, 251, 0.5) !important;
  border-radius: 0 12px 12px 0 !important;
}

.story-quote p {
  color: #24324a !important;
  line-height: 1.7 !important;
  font-size: 1.05rem !important;
}

.quote-icon {
  color: var(--brand-primary) !important;
  opacity: 0.3 !important;
}

.teacher-avatar {
  box-shadow:
    var(--shadow-md),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.teacher-info strong {
  color: #24324a;
}

.teacher-info span {
  color: #536279;
}

.story-stats {
  padding-top: 24px;
  margin-top: 24px;
}

.stat {
  padding: 16px 12px;
}

.stat strong {
  color: #1e5a45;
}

.stat span {
  color: #536279;
}

/* ============================================
   9. 对比模块增强
   ============================================ */

.comparison-container {
  padding: 36px 32px;
  border-radius: 18px;
  background: linear-gradient(
    135deg,
    rgba(234, 240, 251, 0.7) 0%,
    rgba(255, 255, 255, 0.9) 100%
  );
  box-shadow: var(--shadow-lg);
}

.comparison-slider {
  box-shadow:
    var(--shadow-xl),
    0 0 0 1px rgba(214, 222, 234, 0.5) inset;
}

.comparison-before {
  padding: 32px 28px;
}

.comparison-after {
  padding: 32px 28px;
}

.comparison-before .side-label {
  background: rgba(220, 38, 38, 0.1);
  color: #991b1b;
  padding: 10px 16px;
}

.comparison-after .side-label {
  background: #1e5a45;
  color: #fff;
  box-shadow: var(--glow-success);
  padding: 10px 16px;
}

.side-problems li,
.side-benefits li {
  padding: 4px 0;
}

.side-problems li {
  color: #536279;
}

.side-benefits li {
  color: #24324a;
  animation: benefit-fade-in 0.6s var(--ease-smooth) backwards;
}

.side-benefits li:nth-child(1) { animation-delay: 0.1s; }
.side-benefits li:nth-child(2) { animation-delay: 0.2s; }
.side-benefits li:nth-child(3) { animation-delay: 0.3s; }

@keyframes benefit-fade-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.comparison-divider {
  box-shadow: var(--shadow-lg), var(--glow-primary);
}

.divider-handle {
  padding: 12px 18px;
}

/* ============================================
   10. 页面加载动画
   ============================================ */

@keyframes page-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.edu-demo-shell {
  animation: page-fade-in 0.6s var(--ease-smooth);
}

.edu-nav {
  animation: slide-up 0.8s var(--ease-smooth) 0.1s backwards;
}

.edu-hero-copy {
  animation: slide-up 0.8s var(--ease-smooth) 0.2s backwards;
}

.edu-lab {
  animation: scale-in 1s var(--ease-smooth) 0.4s backwards;
}

/* ============================================
   11. 滚动动画支持
   ============================================ */

.scroll-fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s var(--ease-smooth);
}

.scroll-fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   12. 响应式适配
   ============================================ */

@media (max-width: 1100px) {
  .edu-button--primary {
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.2) inset,
      0 4px 12px var(--brand-primary-glow);
  }

  .edu-lab::before {
    display: none;
  }

  .edu-courseware-board {
    transform: rotate(0.6deg);
  }

  .edu-path-grid::before {
    left: 21px;
  }
}

@media (max-width: 680px) {
  .edu-button--primary {
    min-height: 48px;
    box-shadow: var(--shadow-md);
  }

  .edu-button--primary::before {
    display: none;
  }

  .edu-lab::before,
  .edu-path-grid::before,
  .comparison-divider {
    display: none;
  }

  .trust-avatar {
    width: 38px;
    height: 38px;
    margin-left: -8px;
    border-width: 2px;
  }

  .teacher-story-card {
    padding: 20px;
  }

  .time-new::before {
    display: none;
  }

  .edu-hero-trust {
    padding: 16px 18px;
  }
}

/* ============================================
   13. 可访问性优化
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .edu-lab::before,
  .time-new::before,
  .comparison-divider,
  .edu-path-grid::before {
    display: none;
  }
}

/* ============================================
   14. 性能优化
   ============================================ */

.edu-button--primary,
.edu-lab,
.teacher-story-card,
.comparison-slider,
.edu-courseware-board {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.edu-stage canvas {
  transform: translateZ(0);
}

/* ============================================
   15. 打印样式优化
   ============================================ */

@media print {
  .edu-button--primary::before,
  .edu-lab::before,
  .time-new::before,
  .edu-path-grid::before {
    display: none;
  }

  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================
   16. 导航组件对比度增强
   ============================================ */

.unified-site-select,
#uiLocale.unified-site-select,
select#uiLocale {
  color: #24324a !important;
  background-color: #fff !important;
  border: 1.5px solid rgba(54, 94, 171, 0.25) !important;
  font-weight: 700 !important;
  -webkit-text-fill-color: #24324a !important;
}

.unified-site-select option,
#uiLocale option,
select#uiLocale option {
  color: #24324a !important;
  background: #fff !important;
  -webkit-text-fill-color: #24324a !important;
}

.unified-site-nav .ghost-chip {
  color: #f4f8f5 !important;
  background: #101d17 !important;
  border: 1px solid rgba(226, 240, 233, 0.18) !important;
  -webkit-text-fill-color: #f4f8f5 !important;
}

.unified-site-nav .ghost-chip:hover {
  border-color: #00d992 !important;
  color: #04120d !important;
  background: #00d992 !important;
  -webkit-text-fill-color: #04120d !important;
}
