/* 智海冲浪：仅新入口与独立训练页使用，不覆盖既有组件。 */
.qzy-surf-entry {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  padding: 18px 16px;
  border: 1px solid #cfdef4;
  border-radius: 16px;
  color: var(--deep, #0c2550);
  text-decoration: none;
  background: linear-gradient(110deg, #e6f1ff, #fffaf0);
}

.qzy-surf-entry-icon {
  display: grid;
  flex: 0 0 46px;
  height: 46px;
  place-items: center;
  border-radius: 12px;
  color: #2863c4;
  background: #fff;
}

.qzy-surf-entry-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.qzy-surf-entry-copy {
  flex: 1;
  min-width: 0;
}

.qzy-surf-entry-copy strong {
  display: block;
  font-size: 19px;
}

.qzy-surf-entry-copy small {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.6;
  color: #61738e;
}

.qzy-surf-entry-arrow {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  fill: #2d67d1;
}

body.qzy-surf {
  color: #263e50;
  background: #f6f3eb;
}

.qzy-surf .surf-shell {
  width: 100%;
  max-width: 430px;
  padding: 14px 16px 110px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  padding-right: calc(16px + env(safe-area-inset-right, 0px));
  padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  padding-left: calc(16px + env(safe-area-inset-left, 0px));
  background: linear-gradient(155deg, #f3f5ef, #fbf8f0 55%, #eef3f5);
}

.qzy-surf .surf-shell::before {
  display: none;
}

.qzy-surf [hidden] {
  display: none !important;
}

.qzy-surf a {
  color: inherit;
  text-decoration: none;
}

.qzy-surf svg {
  fill: currentColor;
}

.qzy-surf button, .qzy-surf select, .qzy-surf a {
  touch-action: manipulation;
}

.qzy-surf button:focus-visible, .qzy-surf a:focus-visible, .qzy-surf select:focus-visible {
  outline: 3px solid #c48716;
  outline-offset: 3px;
}

.qzy-surf .surf-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  margin-bottom: 20px;
}

.qzy-surf .surf-header h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
}

.qzy-surf .surf-header img {
  width: 85px;
  height: auto;
}

.qzy-surf .surf-back {
  display: grid;
  flex: 0 0 38px;
  height: 40px;
  place-items: center;
  border: 1px solid #dbe6f4;
  border-radius: 4px;
  background: #fff;
}

.qzy-surf .surf-back svg {
  width: 18px;
  height: 18px;
}

.qzy-surf .surf-text-link {
  font-size: 12px;
  color: #365f75;
  white-space: nowrap;
}

.qzy-surf .surf-eyebrow {
  display: block;
  color: #7e704a;
  font-size: 12px;
  letter-spacing: 1px;
}

.qzy-surf .surf-intro {
  margin: 8px 0 24px;
  padding: 14px 0 14px 16px;
  border-left: 3px solid #b59451;
}

.qzy-surf .surf-intro h2 {
  margin: 9px 0;
  font-size: 25px;
  line-height: 1.5;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  letter-spacing: 1px;
}

.qzy-surf .surf-intro p, .qzy-surf .surf-schulte-intro p {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
  color: #63768e;
}

.qzy-surf .surf-module-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.qzy-surf .surf-module {
  grid-column: span 3;
  min-width: 0;
  padding: 14px 12px;
  border-top: 1px solid #d7cfb9;
  border-radius: 3px;
  background: #fffdf7;
}

.qzy-surf .surf-module.is-available {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 10px 5px;
  border-top: 1px solid #b6c9cc;
  border-left: 3px solid #476b80;
  background: linear-gradient(100deg, #eff4f2, #fffdf7);
}

.qzy-surf .surf-module-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 10px;
}

.qzy-surf .is-available .surf-module-top {
  flex-direction: row;
  gap: 4px;
  margin: 0 0 5px;
}

.qzy-surf .surf-module-copy { min-width: 0; }

.qzy-surf .is-available .surf-module-copy { flex: 1; }
.qzy-surf .is-available h2 { font-size: clamp(14px, 4.1vw, 17px); letter-spacing: .3px; white-space: nowrap; }
.qzy-surf .surf-module.is-available .surf-module-description { margin: 0; font-size: clamp(10px, 2.8vw, 11px); line-height: 1.6; white-space: nowrap; }
.qzy-surf .is-available .surf-module-icon { width: 26px; height: 26px; }
.qzy-surf .surf-module-forward { width: 11px; height: 11px; color: #365f75; }
.qzy-surf .surf-module-cultural { fill: none; }

.qzy-surf .surf-module-icon {
  width: 29px;
  height: 29px;
  color: #476b80;
}

.qzy-surf .surf-module-code {
  font-size: 10px;
  color: #8594a9;
}

.qzy-surf .surf-module h2 {
  margin: 3px 0 7px;
  font-size: 19px;
  line-height: 1.4;
  letter-spacing: 1px;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
}

.qzy-surf .surf-module p {
  margin: 0;
  color: #657672;
  font-size: 11px;
  line-height: 1.7;
}

.qzy-surf .surf-module .surf-module-skill { color: #8c713e; font-size: 10px; }
.qzy-surf .surf-module .surf-module-description { font-size: 11px; }
.qzy-surf .is-coming h2 { font-size: 17px; }
.qzy-surf .is-coming .surf-module-description { margin-bottom: 10px; }

.qzy-surf .surf-module-soon {
  font-size: 11px;
  color: #8793a5;
}

.qzy-surf .is-coming .surf-module-icon {
  color: #8098b6;
}

.qzy-surf .surf-schulte-intro {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  margin: -10px 0 8px;
  border-top: 1px solid #c5b78e;
  border-bottom: 1px solid #ded8c8;
}

.qzy-surf .surf-schulte-intro div {
  flex: 1;
}

.qzy-surf .surf-schulte-intro h2 {
  margin: 8px 0 10px;
  font-size: 22px;
  line-height: 1.4;
}

.qzy-surf .surf-schulte-intro > svg {
  flex: 0 0 62px;
  width: 62px;
  height: 62px;
  color: #476b80;
}

.qzy-surf .surf-level-group {
  --level-color: #365f75;
  --level-soft: #edf1e9;
  margin: 24px 0;
}

.qzy-surf .surf-library .surf-level-group {
  margin: 18px 0;
}

.qzy-surf .tone-violet {
  --level-color: #6b6f58;
  --level-soft: #eeece5;
}

.qzy-surf .tone-gold {
  --level-color: #93743b;
  --level-soft: #f4eedc;
}

.qzy-surf .tone-green {
  --level-color: #416d68;
  --level-soft: #e5eeea;
}

.qzy-surf .surf-level-group h2 {
  margin: 0 0 7px;
  font-size: 18px;
}

.qzy-surf .surf-level-group header p {
  margin: 0 0 13px;
  color: #6b7b91;
  font-size: 12px;
  line-height: 1.6;
}

.qzy-surf .surf-level-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

/* Three-item groups keep one row on normal phone widths; four-item groups
   keep the existing two columns. The item count comes from the template. */
@media (min-width: 320px) {
  .qzy-surf .surf-level-grid[data-mode-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .qzy-surf .surf-level-grid[data-mode-count="3"] .surf-level { padding: 12px 8px; }
  .qzy-surf .surf-level-grid[data-mode-count="3"] strong { font-size: clamp(14px, 4vw, 17px); letter-spacing: .3px; white-space: nowrap; }
}

.qzy-surf .surf-level {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  min-height: 98px;
  padding: 13px;
  border-left: 2px solid var(--level-color);
  border-radius: 3px;
  background: var(--level-soft);
}

.qzy-surf .surf-level strong {
  color: var(--level-color);
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: 1px;
}

.qzy-surf .surf-level span {
  font-size: 11px;
  color: #65768f;
}

/* 数字表以阶数区分入口，训练名称作为辅助说明。 */
.qzy-surf .surf-level-grid .surf-level.surf-level-numbers {
  min-height: 72px;
  padding: 10px;
  gap: 4px;
}

.qzy-surf .surf-level.surf-level-numbers strong {
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.qzy-surf .surf-level svg {
  margin-top: auto;
  width: 13px;
  height: 13px;
  color: var(--level-color);
}

.qzy-surf .surf-level .surf-level-theme {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 24px;
  height: 24px;
  fill: none;
}

.qzy-surf .surf-level-numbers .surf-level-theme {
  width: 20px;
  height: 20px;
}

.qzy-surf .surf-training-intro {
  margin: -5px 0 16px;
  font-size: 13px;
  line-height: 1.8;
  color: #647690;
}

.qzy-surf .surf-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
}

.qzy-surf .surf-options label {
  display: flex;
  flex: 1 1 140px;
  flex-direction: column;
  gap: 7px;
  color: #687a92;
  font-size: 12px;
}

.qzy-surf .surf-options select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 9px;
  border: 1px solid #ccdcef;
  border-radius: 4px;
  color: #263e50;
  background: #fff;
  font: inherit;
  font-size: 14px;
}

.qzy-surf .surf-motion-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: -4px 0 14px;
  font-size: 12px;
  color: #647690;
}

.qzy-surf .surf-motion-control label {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  gap: 6px;
  color: #365f75;
}

.qzy-surf .surf-motion-control input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #365f75;
}

.qzy-surf .surf-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 15px 0;
  border-top: 1px solid #d8dccf;
  border-bottom: 1px solid #d8dccf;
}

.qzy-surf .surf-stats > div {
  text-align: center;
}

.qzy-surf .surf-stats > div + div {
  border-left: 1px solid #d8dccf;
}

.qzy-surf .surf-stats > div > span {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  color: #70829a;
}

.qzy-surf .surf-stats strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.qzy-surf .surf-stats small {
  font-size: 11px;
  font-weight: 400;
}

.qzy-surf .surf-target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 13px 0;
}

.qzy-surf .surf-target span {
  flex-shrink: 0;
  font-size: 12px;
  color: #637a98;
}

.qzy-surf .surf-target strong {
  font-size: 16px;
  color: #365f75;
  text-align: right;
}

.qzy-surf .surf-board-wrap {
  position: relative;
}

.qzy-surf .surf-board {
  display: grid;
  grid-template-columns: repeat(var(--surf-columns), minmax(0, 1fr));
  gap: 5px;
  width: 100%;
  padding: 1px;
}

.qzy-surf .surf-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  aspect-ratio: 1;
  border: 1px solid #c8d0bd;
  border-radius: 3px;
  color: #263e50;
  background: #eff2e9;
  font-size: 24px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  user-select: none;
  -webkit-user-select: none;
}

.qzy-surf .surf-cell.shade-1 {
  background: #e7eee6;
  border-color: #c9e2d8;
}

.qzy-surf .surf-cell.shade-2 {
  background: #f2ecd9;
  border-color: #ebdcb9;
}

.qzy-surf .surf-cell.shade-3 {
  background: #e9e8df;
  border-color: #d9d2ef;
}

.qzy-surf .surf-cell.shade-4 {
  background: #e4eeeb;
  border-color: #c4e0e8;
}

.qzy-surf .surf-cell:disabled {
  cursor: default;
}

.qzy-surf .surf-cell.is-done {
  color: #547397;
  background: #edf3f9;
  border-color: #e3eaf2;
  opacity: 0.3;
}

.qzy-surf .surf-cell.is-selected {
  outline: 3px solid #ad7416;
  outline-offset: -3px;
  background: #ffe6ae;
}

.qzy-surf .surf-cell small {
  font-size: 10px;
  font-weight: 400;
  color: #5d718c;
}

.qzy-surf .surf-board[data-density="6"] .surf-cell {
  font-size: 19px;
}

.qzy-surf .surf-board[data-density="7"] .surf-cell {
  font-size: 17px;
}

.qzy-surf .surf-board[data-density="8"] .surf-cell, .qzy-surf .surf-board[data-density="9"] .surf-cell {
  font-size: 15px;
  border-radius: 5px;
}

.qzy-surf .surf-board.is-idioms .surf-cell {
  font-size: 19px;
}

.qzy-surf .surf-board.is-idioms[data-density="6"] .surf-cell {
  font-size: 16px;
}

.qzy-surf .surf-board.is-idioms[data-density="6"] .surf-cell small {
  font-size: 8px;
}

.qzy-surf .surf-board.is-dynamic {
  position: relative;
  display: block;
  min-height: 280px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #becfc9;
  border-radius: 4px;
  background: radial-gradient(ellipse at 12% 86%, #d4e3d4 0%, transparent 45%), linear-gradient(150deg, #f6f6e9, #dcebe5);
}

.qzy-surf .surf-board.is-dynamic .surf-cell {
  --ball-hue: 163;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  border: 2px solid hsla(var(--ball-hue), 24%, 47%, .65);
  background: radial-gradient(circle at 32% 24%, #fffef5, hsl(var(--ball-hue), 24%, 85%));
  color: #25493f;
  font-size: 24px;
  font-weight: 750;
  line-height: 1;
  box-shadow: inset 0 -3px 5px #7fa29622, 0 2px 4px #34584712;
}

.qzy-surf .surf-board.is-dynamic .surf-cell.shade-1 { --ball-hue: 156; }
.qzy-surf .surf-board.is-dynamic .surf-cell.shade-2 { --ball-hue: 39; }
.qzy-surf .surf-board.is-dynamic .surf-cell.shade-3 { --ball-hue: 260; }
.qzy-surf .surf-board.is-dynamic .surf-cell.shade-4 { --ball-hue: 188; }

.qzy-surf .surf-board[data-motion-type="floating"] {
  background: radial-gradient(ellipse at 78% 20%, #f9edc4, transparent 42%), linear-gradient(145deg, #dce6e4, #edf1e5);
}

.qzy-surf .surf-board[data-motion-type="floating"] .surf-cell {
  color: #3c482f;
  border-color: #ad9552;
  background: radial-gradient(circle at 32% 24%, #fffde3, #eee0a0 60%, #b2be86);
  box-shadow: 0 0 9px #d6bb4e55, inset 1px 2px 4px #fffdec;
  will-change: transform;
}

.qzy-surf .is-dynamic .surf-cell.is-done {
  visibility: hidden;
}

.qzy-surf .surf-pause-cover {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  border-radius: 4px;
  color: #234d86;
  background: rgba(242, 248, 255, .97);
}

.qzy-surf .surf-pause-cover svg {
  width: 30px;
  height: 30px;
}

.qzy-surf .surf-pause-cover span {
  font-size: 12px;
  color: #6a7d97;
}

.qzy-surf .surf-feedback {
  min-height: 34px;
  margin: 12px 0 8px;
  font-size: 12px;
  line-height: 1.7;
  color: #647c9b;
}

.qzy-surf .surf-feedback.is-error {
  color: #b24242;
}

.qzy-surf .surf-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.qzy-surf .surf-button {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 7px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
}

.qzy-surf .surf-button svg {
  width: 15px;
  height: 15px;
}

.qzy-surf .surf-button-primary {
  color: #fff;
  background: #365f75;
}

.qzy-surf .surf-button-primary:disabled {
  background: #8299bd;
}

.qzy-surf .surf-button-secondary {
  border: 1px solid #cbdcf2;
  color: #365f75;
  background: #fff;
}

.qzy-surf .surf-poem {
  margin-top: 15px;
  padding: 13px;
  border-left: 3px solid #d6aa4d;
  background: #fff9ed;
}

.qzy-surf .surf-poem h2 {
  margin: 0 0 6px;
  font-size: 14px;
}

.qzy-surf .surf-poem p {
  margin: 0;
  white-space: pre-line;
  color: #74684f;
  font-size: 13px;
  line-height: 1.9;
}

.qzy-surf .surf-result {
  margin-top: 20px;
  padding: 18px 0;
  border-top: 1px solid #cedfeb;
  text-align: center;
}

.qzy-surf .surf-result > svg {
  width: 28px;
  height: 28px;
  color: #2c8b79;
}

.qzy-surf .surf-result h2 {
  margin: 8px 0;
  font-size: 19px;
}

.qzy-surf .surf-result p {
  font-size: 13px;
  line-height: 1.8;
}

.qzy-surf .surf-result .surf-result-note {
  font-size: 12px;
  color: #6c7f96;
}

.qzy-surf .surf-footnote {
  margin: 22px 0 0;
  font-size: 11px;
  line-height: 1.8;
  color: #7c8da3;
}

.qzy-surf .surf-noscript {
  color: #a23f3f;
}

.qzy-surf .surf-training-shell .surf-header {
  margin-bottom: 14px;
}

.qzy-surf .surf-training-shell .surf-options {
  padding-bottom: 12px;
}

.qzy-surf .surf-training-shell .surf-controls {
  margin-bottom: 12px;
}

.qzy-surf .surf-training-shell .surf-stats {
  padding: 12px 0;
}

.qzy-surf .surf-training-shell .surf-target {
  min-height: 48px;
}

@media (max-width: 359px) {
  .qzy-surf .surf-shell {
    padding-right: 11px;
    padding-left: 11px;
    padding-right: calc(11px + env(safe-area-inset-right, 0px));
    padding-left: calc(11px + env(safe-area-inset-left, 0px));
  }

  .qzy-surf .surf-module-grid {
    gap: 7px;
  }

  .qzy-surf .surf-module {
    padding: 12px 8px;
  }

  .qzy-surf .surf-module h2 {
    font-size: 15px;
  }

  .qzy-surf .surf-intro h2 {
    font-size: 22px;
  }

  .qzy-surf .surf-level {
    padding: 12px 8px;
  }

  .qzy-surf .surf-level strong {
    font-size: 20px;
  }

  .qzy-surf .surf-board {
    gap: 3px;
  }

  .qzy-surf .surf-board[data-density="9"] .surf-cell {
    font-size: 13px;
  }

  .qzy-surf .surf-board.is-idioms[data-density="6"] .surf-cell {
    font-size: 14px;
  }

}

@media (max-width: 319px) {
  .qzy-surf .surf-module.is-available { grid-column: 1 / -1; }
  .qzy-surf .surf-level-grid { grid-template-columns: minmax(0, 1fr); }
}
