﻿* {
  box-sizing: border-box;
}
body {
  background:
    linear-gradient(180deg, #7f98a2 0%, #93a9aa 30%, #8fa595 62%, #667f69 100%);
}

#v3d-container::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 14%, rgba(238, 209, 122, 0.22) 0 54px, rgba(238, 209, 122, 0) 72px),
    radial-gradient(ellipse at 50% -8%, rgba(224, 237, 229, 0.26), rgba(224, 237, 229, 0) 46%),
    linear-gradient(180deg, rgba(15, 36, 47, 0.2), rgba(12, 31, 28, 0.04) 42%, rgba(12, 29, 21, 0.18) 100%),
    repeating-linear-gradient(0deg, rgba(232, 242, 234, 0.055) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(232, 242, 234, 0.045) 0 1px, transparent 1px 48px);
}

#v3d-container::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 110%, rgba(35, 71, 45, 0.42), rgba(35, 71, 45, 0) 48%),
    linear-gradient(90deg, rgba(18, 34, 32, 0.24), rgba(18, 34, 32, 0) 22%, rgba(18, 34, 32, 0) 78%, rgba(18, 34, 32, 0.24)),
    linear-gradient(180deg, rgba(9, 23, 30, 0.08), rgba(9, 23, 30, 0) 34%, rgba(9, 22, 19, 0.22));
}

.v3d-canvas,
#v3d-container canvas {
  position: relative;
  z-index: 1;
}

body.ui-hidden #lesson-overlay {
  display: none;
}

#v3d-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

#lesson-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: #183221;
  z-index: 2;
}

.lesson-panel {
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: min(980px, calc(100% - 32px));
  transform: translateX(-50%);
  border: 1px solid rgba(22, 53, 31, 0.12);
  border-radius: 20px;
  background: rgba(247, 251, 248, 0.86);
  box-shadow: 0 18px 44px rgba(18, 38, 30, 0.16);
  backdrop-filter: blur(14px);
  pointer-events: auto;
  overflow: hidden;
}

.panel-handle {
  width: 100%;
  height: 46px;
  border: 0;
  border-bottom: 1px solid rgba(22, 53, 31, 0.08);
  background: rgba(214, 226, 235, 0.68);
  color: #173656;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.panel-body {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.lesson-panel.is-collapsed .panel-body {
  display: none;
}

.panel-tip {
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 16px;
  padding: 8px 12px 8px 18px;
  border: 1px solid rgba(22, 53, 31, 0.1);
  border-radius: 999px;
  background: rgba(229, 242, 235, 0.7);
  color: #274334;
}

.tip-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 900;
}

.mode-row,
.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button,
input {
  font: inherit;
}

.mode-button,
.action-row button {
  min-height: 44px;
  border: 1px solid rgba(22, 53, 31, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: #233b2b;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.mode-button {
  flex: 1 1 128px;
  padding: 0 14px;
}

.mode-line {
  display: grid;
  grid-template-columns: 176px 1fr;
  gap: 10px;
  align-items: stretch;
}

.range-select-wrap {
  display: block;
}

.range-select-wrap select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(22, 53, 31, 0.14);
  border-radius: 14px;
  padding: 0 38px 0 14px;
  background: rgba(247, 251, 248, 0.86);
  color: #233b2b;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.mode-button.is-active {
  border-color: rgba(55, 145, 90, 0.35);
  background: rgba(55, 190, 120, 0.18);
  color: #145b32;
}
.control-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.interval-control,
.answer-control {
  min-height: 68px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(22, 53, 31, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.interval-control {
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
}

.interval-control span,
.answer-control span {
  font-size: 16px;
  font-weight: 900;
  color: #38523f;
}

.interval-control input[type="range"] {
  width: 100%;
  min-height: 44px;
  accent-color: #37a967;
}

.interval-control output {
  min-width: 36px;
  text-align: center;
  font-size: 24px;
  font-weight: 900;
}

.answer-control input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(22, 53, 31, 0.16);
  border-radius: 14px;
  padding: 0 12px;
  background: white;
  font-size: 20px;
  font-weight: 900;
}


.action-row button {
  flex: 1 1 120px;
  padding: 0 16px;
}

.toggle-action.is-active {
  border-color: rgba(241, 201, 90, 0.45) !important;
  background: rgba(255, 236, 170, 0.32) !important;
  color: #68490d !important;
}

.primary-action {
  border-color: rgba(77, 135, 255, 0.3) !important;
  background: rgba(77, 135, 255, 0.18) !important;
  color: #1f4a8d !important;
}

.result-backdrop {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(22, 42, 28, 0.18);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.result-backdrop[hidden] {
  display: none;
}

.result-modal {
  position: relative;
  width: min(520px, 100%);
  padding: 22px;
  border: 1px solid rgba(22, 53, 31, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  color: #1d3524;
}

.result-modal h2 {
  margin: 0 44px 12px 0;
  font-size: 24px;
  line-height: 1.25;
}

#result-body {
  font-size: 18px;
  line-height: 1.65;
}

#result-body strong {
  color: #145b32;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(22, 53, 31, 0.12);
  border-radius: 14px;
  background: white;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

#next-example {
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 640px) {
  .lesson-panel {
    width: calc(100% - 20px);
    bottom: 10px;
  }

  .panel-tip {
    grid-template-columns: 1fr;
    border-radius: 18px;
    padding: 10px 12px;
  }

  .tip-text {
    white-space: normal;
    text-align: center;
  }.mode-line,
  .control-row {
    grid-template-columns: 1fr;
  }












