    html,
    body {
      width: 100%;
      height: 100%;
      margin: 0;
      overflow: hidden;
      background: #000;
    }

    html.mirror-fullscreen .topic-nav {
      display: none !important;
    }

    #viewer {
      width: 100%;
      height: 100%;
      touch-action: none;
    }

    .dual-role-overlay {
      position: fixed;
      inset: 0;
      z-index: 220;
      display: none;
      align-items: center;
      justify-content: center;
      background:
        radial-gradient(180% 120% at 50% -10%, rgba(255, 226, 156, 0.12) 0%, rgba(255, 226, 156, 0) 58%),
        linear-gradient(180deg, rgba(9, 9, 12, 0.92), rgba(0, 0, 0, 0.94));
      backdrop-filter: blur(3px);
      -webkit-backdrop-filter: blur(3px);
    }

    .dual-role-overlay.show {
      display: flex;
    }

    .dual-role-shell {
      width: min(980px, 94vw);
      max-width: 980px;
      padding: 26px 18px;
      display: grid;
      gap: 16px;
      justify-items: center;
      border-radius: 20px;
      border: 1px solid rgba(242, 205, 124, 0.42);
      background: rgba(26, 14, 9, 0.62);
      box-shadow: 0 26px 48px rgba(0, 0, 0, 0.5);
    }

    .dual-role-title {
      margin: 0;
      font-size: clamp(28px, 4.4vw, 52px);
      letter-spacing: 4px;
      color: #f2d499;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      text-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
    }

    .dual-role-subtitle {
      margin: 0;
      font-size: clamp(15px, 1.8vw, 20px);
      color: rgba(251, 230, 180, 0.9);
    }

    .dual-role-actions {
      width: 100%;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
    }

    .dual-user-actions {
      width: 100%;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
    }

    .dual-role-btn {
      height: clamp(130px, 24vh, 240px);
      border: 1.5px solid rgba(247, 214, 140, 0.9);
      border-radius: 18px;
      font-size: clamp(72px, 11vw, 146px);
      font-weight: 700;
      color: #f6dfb1;
      background:
        radial-gradient(110% 160% at 50% -24%, rgba(255, 238, 196, 0.3) 0%, rgba(255, 238, 196, 0) 62%),
        linear-gradient(180deg, rgba(74, 39, 24, 0.95), rgba(38, 20, 13, 0.95));
      text-shadow: 0 4px 8px rgba(0, 0, 0, 0.58);
      box-shadow: inset 0 0 0 1px rgba(110, 69, 45, 0.8), 0 12px 28px rgba(0, 0, 0, 0.4);
      cursor: pointer;
      transition: transform 0.15s ease, filter 0.15s ease;
    }

    .dual-role-btn:hover {
      transform: translateY(-2px);
      filter: brightness(1.08);
    }

    .dual-role-btn:active {
      transform: translateY(0);
      filter: brightness(0.96);
    }

    .dual-role-btn.is-selected {
      box-shadow: inset 0 0 0 2px rgba(255, 234, 186, 0.96), 0 12px 28px rgba(0, 0, 0, 0.4);
      filter: brightness(1.08);
    }

    .dual-role-btn:disabled {
      opacity: 0.52;
      cursor: not-allowed;
      transform: none;
      filter: none;
    }

    @media (max-width: 960px) {
      .dual-role-actions {
        grid-template-columns: 1fr;
      }

      .dual-user-actions {
        grid-template-columns: 1fr;
      }

      .dual-role-btn {
        height: clamp(90px, 18vh, 152px);
        font-size: clamp(54px, 14vw, 92px);
      }
    }

    canvas {
      display: block;
    }

    .scene-switch {
      position: fixed;
      top: 50%;
      right: calc(78px + env(safe-area-inset-right, 0px));
      transform: translateY(-50%);
      z-index: 95;
      display: flex;
      flex-direction: column;
      gap: 8px;
      align-items: flex-end;
    }

    .scene-switch.hidden {
      display: none !important;
    }

    .scene-switch.panel-hidden {
      display: none !important;
    }

    .scene-switch-btn {
      position: relative;
      min-width: 168px;
      height: 44px;
      padding: 0 22px;
      border: 1.5px solid rgba(244, 209, 126, 0.96);
      border-radius: 12px;
      clip-path: polygon(0 50%, 5% 16%, 11% 0, 89% 0, 95% 16%, 100% 50%, 95% 84%, 89% 100%, 11% 100%, 5% 84%);
      font-size: 22px;
      font-weight: 700;
      letter-spacing: 1px;
      line-height: 1;
      color: #f6da96;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      text-shadow: 0 1px 0 rgba(70, 42, 25, 0.9), 0 0 14px rgba(246, 206, 120, 0.34);
      background:
        radial-gradient(140% 120% at 50% -30%, rgba(255, 236, 182, 0.24) 0%, rgba(255, 236, 182, 0) 60%),
        linear-gradient(180deg, rgba(83, 46, 31, 0.84), rgba(48, 26, 18, 0.9));
      box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(108, 64, 39, 0.72);
      cursor: pointer;
      backdrop-filter: blur(2px);
      -webkit-backdrop-filter: blur(2px);
      transition: transform 0.15s ease, filter 0.15s ease;
    }

    .scene-switch-btn::before {
      content: "";
      position: absolute;
      inset: 4px 10px;
      border: 1px solid rgba(247, 219, 152, 0.72);
      border-radius: 8px;
      clip-path: polygon(0 50%, 4% 20%, 9% 0, 91% 0, 96% 20%, 100% 50%, 96% 80%, 91% 100%, 9% 100%, 4% 80%);
      pointer-events: none;
    }

    .scene-switch-btn:hover {
      transform: translateY(-1px);
      filter: brightness(1.05);
    }

    .scene-switch-btn:active {
      transform: translateY(0);
      filter: brightness(0.96);
    }

    .scene-switch-btn:focus-visible {
      outline: 2px solid rgba(252, 232, 176, 0.92);
      outline-offset: 2px;
    }

    .scene-switch-btn:disabled {
      opacity: 0.52;
      cursor: not-allowed;
      transform: none;
      filter: none;
    }

    /* 隐藏非场景切换按钮，仅保留“主场景/主洞窟/工坊1/工坊2/退出登录” */
    #toggleCaveGalleryBtn,
    #toggleRotateBtn {
      display: none !important;
    }

    @media (max-width: 768px) {
      .scene-switch {
        right: calc(64px + env(safe-area-inset-right, 0px));
        gap: 6px;
      }

      .scene-switch-btn {
        min-width: 140px;
        height: 36px;
        font-size: 18px;
        padding: 0 16px;
      }

      .scene-switch-btn::before {
        inset: 3px 7px;
      }
    }

    .side-tools {
      position: fixed;
      top: 50%;
      right: calc(10px + env(safe-area-inset-right, 0px));
      transform: translateY(-50%);
      z-index: 96;
      display: flex;
      flex-direction: column;
      gap: 10px;
      pointer-events: auto;
    }

    .side-tool-btn {
      width: 56px;
      height: 56px;
      padding: 0;
      border: 0;
      border-radius: 999px;
      background: transparent;
      cursor: pointer;
      box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
      transition: transform 0.14s ease, filter 0.14s ease;
    }

    .side-tool-btn img {
      width: 100%;
      height: 100%;
      display: block;
      pointer-events: none;
      user-select: none;
      -webkit-user-drag: none;
    }

    .side-tool-btn:hover {
      transform: translateY(-1px) scale(1.02);
      filter: brightness(1.05);
    }

    .side-tool-btn:active {
      transform: translateY(0) scale(0.99);
      filter: brightness(0.96);
    }

    .side-tool-btn:focus-visible {
      outline: 2px solid rgba(19, 159, 241, 0.76);
      outline-offset: 2px;
    }

    .side-tool-btn[aria-pressed="true"] {
      filter: brightness(1.06);
    }

    .side-tool-text-btn {
      border: 1.5px solid rgba(244, 209, 126, 0.95);
      background:
        radial-gradient(120% 120% at 50% -20%, rgba(255, 240, 203, 0.32), rgba(255, 240, 203, 0) 66%),
        linear-gradient(180deg, rgba(83, 46, 31, 0.92), rgba(48, 26, 18, 0.92));
      color: #f6da96;
      font-size: 21px;
      font-weight: 700;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      line-height: 1;
      text-shadow: 0 1px 0 rgba(70, 42, 25, 0.9), 0 0 12px rgba(246, 206, 120, 0.34);
    }

    .side-tools.hidden {
      display: none !important;
    }

    .left-fullscreen-btn {
      position: fixed;
      left: calc(10px + env(safe-area-inset-left, 0px));
      bottom: calc(10px + env(safe-area-inset-bottom, 0px));
      z-index: 99;
    }

    .left-fullscreen-btn.hidden {
      display: none !important;
    }

    .side-tool-btn.is-muted {
      filter: grayscale(0.18) brightness(0.97);
    }

    .topic-nav {
      position: fixed;
      right: calc(10px + env(safe-area-inset-right, 0px));
      bottom: calc(10px + env(safe-area-inset-bottom, 0px));
      z-index: 98;
      display: flex;
      align-items: center;
      gap: 8px;
      pointer-events: auto;
    }

    .topic-nav.hidden {
      display: none !important;
    }

    .main-cave-overview-nav {
      position: fixed;
      right: calc(10px + env(safe-area-inset-right, 0px));
      bottom: calc(10px + env(safe-area-inset-bottom, 0px));
      z-index: 98;
      display: flex;
      align-items: center;
      pointer-events: auto;
    }

    .main-cave-overview-nav.hidden {
      display: none !important;
    }

    .main-cave-overview-btn {
      min-width: 108px;
      height: 44px;
      padding: 0 18px;
      border: 1.5px solid rgba(244, 209, 126, 0.95);
      border-radius: 999px;
      background:
        radial-gradient(120% 120% at 50% -20%, rgba(255, 240, 203, 0.32), rgba(255, 240, 203, 0) 66%),
        linear-gradient(180deg, rgba(83, 46, 31, 0.92), rgba(48, 26, 18, 0.92));
      color: #f6da96;
      font-size: 22px;
      font-weight: 700;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      line-height: 1;
      letter-spacing: 1px;
      text-shadow: 0 1px 0 rgba(70, 42, 25, 0.9), 0 0 10px rgba(246, 206, 120, 0.3);
      box-shadow: 0 8px 18px rgba(0, 0, 0, 0.36);
      cursor: pointer;
      transition: transform 0.14s ease, filter 0.14s ease;
    }

    .main-cave-overview-btn:hover {
      transform: translateY(-1px) scale(1.01);
      filter: brightness(1.05);
    }

    .main-cave-overview-btn:active {
      transform: translateY(0) scale(0.99);
      filter: brightness(0.96);
    }

    .main-cave-overview-btn:focus-visible {
      outline: 2px solid rgba(252, 232, 176, 0.92);
      outline-offset: 2px;
    }

    .main-cave-overview-btn[aria-pressed="true"] {
      filter: brightness(1.06);
    }

    .workshop-timer-nav {
      position: fixed;
      right: calc(10px + env(safe-area-inset-right, 0px));
      bottom: calc(10px + env(safe-area-inset-bottom, 0px));
      z-index: 98;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 8px;
      pointer-events: auto;
    }

    .workshop-timer-nav.hidden {
      display: none !important;
    }

    .workshop-timer-btn {
      min-width: 132px;
      height: 44px;
      padding: 0 18px;
      border: 1.5px solid rgba(244, 209, 126, 0.95);
      border-radius: 999px;
      background:
        radial-gradient(120% 120% at 50% -20%, rgba(255, 240, 203, 0.32), rgba(255, 240, 203, 0) 66%),
        linear-gradient(180deg, rgba(83, 46, 31, 0.92), rgba(48, 26, 18, 0.92));
      color: #f6da96;
      font-size: 22px;
      font-weight: 700;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      line-height: 1;
      letter-spacing: 1px;
      text-shadow: 0 1px 0 rgba(70, 42, 25, 0.9), 0 0 10px rgba(246, 206, 120, 0.3);
      box-shadow: 0 8px 18px rgba(0, 0, 0, 0.36);
      cursor: pointer;
      transition: transform 0.14s ease, filter 0.14s ease;
    }

    .workshop-timer-btn:hover {
      transform: translateY(-1px) scale(1.01);
      filter: brightness(1.05);
    }

    .workshop-timer-btn:active {
      transform: translateY(0) scale(0.99);
      filter: brightness(0.96);
    }

    .workshop-timer-btn:focus-visible {
      outline: 2px solid rgba(252, 232, 176, 0.92);
      outline-offset: 2px;
    }

    .workshop-timer-btn[aria-pressed="true"] {
      filter: brightness(1.06);
    }

    .workshop-step-btn {
      min-width: 116px;
      height: 44px;
      padding: 0 16px;
      border: 1.5px solid rgba(244, 209, 126, 0.95);
      border-radius: 999px;
      background:
        radial-gradient(120% 120% at 50% -20%, rgba(255, 240, 203, 0.32), rgba(255, 240, 203, 0) 66%),
        linear-gradient(180deg, rgba(83, 46, 31, 0.92), rgba(48, 26, 18, 0.92));
      color: #f6da96;
      font-size: 22px;
      font-weight: 700;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      line-height: 1;
      letter-spacing: 1px;
      text-shadow: 0 1px 0 rgba(70, 42, 25, 0.9), 0 0 10px rgba(246, 206, 120, 0.3);
      box-shadow: 0 8px 18px rgba(0, 0, 0, 0.36);
      cursor: pointer;
      transition: transform 0.14s ease, filter 0.14s ease;
    }

    .workshop-step-btn:hover {
      transform: translateY(-1px) scale(1.01);
      filter: brightness(1.05);
    }

    .workshop-step-btn:active {
      transform: translateY(0) scale(0.99);
      filter: brightness(0.96);
    }

    .workshop-step-btn:focus-visible {
      outline: 2px solid rgba(252, 232, 176, 0.92);
      outline-offset: 2px;
    }

    .workshop-video-btn {
      min-width: 156px;
      height: 44px;
      padding: 0 16px;
      border: 1.5px solid rgba(244, 209, 126, 0.95);
      border-radius: 999px;
      background:
        radial-gradient(120% 120% at 50% -20%, rgba(255, 240, 203, 0.32), rgba(255, 240, 203, 0) 66%),
        linear-gradient(180deg, rgba(83, 46, 31, 0.92), rgba(48, 26, 18, 0.92));
      color: #f6da96;
      font-size: 22px;
      font-weight: 700;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      line-height: 1;
      letter-spacing: 1px;
      text-shadow: 0 1px 0 rgba(70, 42, 25, 0.9), 0 0 10px rgba(246, 206, 120, 0.3);
      box-shadow: 0 8px 18px rgba(0, 0, 0, 0.36);
      cursor: pointer;
      transition: transform 0.14s ease, filter 0.14s ease;
    }

    .workshop-video-btn:hover {
      transform: translateY(-1px) scale(1.01);
      filter: brightness(1.05);
    }

    .workshop-video-btn:active {
      transform: translateY(0) scale(0.99);
      filter: brightness(0.96);
    }

    .workshop-video-btn:focus-visible {
      outline: 2px solid rgba(252, 232, 176, 0.92);
      outline-offset: 2px;
    }

    .workshop-timer-overlay {
      position: fixed;
      inset: 0;
      z-index: 101;
      display: flex;
      align-items: center;
      justify-content: center;
      pointer-events: none;
    }

    .workshop-timer-overlay.hidden {
      display: none !important;
    }

    .workshop-timer-panel {
      position: relative;
      min-width: min(420px, calc(100vw - 24px));
      padding: 20px 28px 18px;
      border-radius: 24px;
      border: 1.8px solid rgba(244, 209, 126, 0.95);
      background:
        radial-gradient(120% 120% at 50% -20%, rgba(255, 240, 203, 0.34), rgba(255, 240, 203, 0) 66%),
        linear-gradient(180deg, rgba(83, 46, 31, 0.94), rgba(48, 26, 18, 0.95));
      box-shadow: 0 18px 34px rgba(0, 0, 0, 0.42);
      text-align: center;
      pointer-events: auto;
    }

    .workshop-timer-close {
      position: absolute;
      top: 10px;
      right: 10px;
      width: 34px;
      height: 34px;
      border-radius: 999px;
      border: 1.2px solid rgba(245, 211, 133, 0.94);
      background: rgba(52, 29, 19, 0.92);
      color: rgba(246, 218, 150, 0.96);
      font-size: 24px;
      line-height: 1;
      cursor: pointer;
    }

    .workshop-timer-title {
      font-size: 22px;
      color: rgba(246, 218, 150, 0.9);
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      letter-spacing: 1px;
    }

    .workshop-timer-value {
      margin-top: 6px;
      font-size: clamp(56px, 5.4vw, 88px);
      line-height: 1;
      letter-spacing: 3px;
      color: #fff0c9;
      font-weight: 700;
      text-shadow: 0 2px 0 rgba(80, 45, 27, 0.9), 0 0 18px rgba(255, 216, 135, 0.26);
      font-family: "DIN Alternate", "Avenir Next Condensed", "STHeiti", "PingFang SC", sans-serif;
      font-variant-numeric: tabular-nums;
    }

    .workshop-timer-config {
      margin-top: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    .workshop-timer-field {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      color: rgba(246, 218, 150, 0.92);
      font-size: 18px;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
    }

    .workshop-timer-field input {
      width: 58px;
      height: 36px;
      border-radius: 10px;
      border: 1px solid rgba(244, 209, 126, 0.82);
      background: rgba(44, 24, 16, 0.72);
      color: #fff0c9;
      text-align: center;
      font-size: 20px;
      font-variant-numeric: tabular-nums;
      outline: none;
    }

    .workshop-timer-field input:focus {
      border-color: rgba(252, 232, 176, 0.92);
      box-shadow: 0 0 0 2px rgba(244, 209, 126, 0.22);
    }

    .workshop-timer-apply-btn {
      height: 36px;
      padding: 0 14px;
      border-radius: 999px;
      border: 1.2px solid rgba(244, 209, 126, 0.92);
      background: rgba(52, 29, 19, 0.92);
      color: rgba(246, 218, 150, 0.98);
      font-size: 18px;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      cursor: pointer;
      transition: filter 0.14s ease, transform 0.14s ease;
    }

    .workshop-timer-apply-btn:hover {
      filter: brightness(1.08);
      transform: translateY(-1px);
    }

    .workshop-step-game-overlay {
      position: fixed;
      inset: 0;
      z-index: 102;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 12px;
      background: rgba(7, 5, 4, 0.62);
      backdrop-filter: blur(2.4px);
      -webkit-backdrop-filter: blur(2.4px);
    }

    .workshop-step-game-overlay.hidden {
      display: none !important;
    }

    .workshop-step-game-panel {
      position: relative;
      width: min(1240px, 96vw);
      max-height: min(760px, 92vh);
      overflow: auto;
      border-radius: 22px;
      border: 1.6px solid rgba(244, 209, 126, 0.86);
      background:
        radial-gradient(96% 78% at 50% 0%, rgba(244, 232, 204, 0.2), rgba(244, 232, 204, 0) 66%),
        linear-gradient(180deg, rgba(38, 24, 17, 0.92), rgba(22, 14, 10, 0.95));
      box-shadow: 0 22px 42px rgba(0, 0, 0, 0.44);
      padding: 16px 16px 14px;
    }

    .workshop-step-game-close {
      position: absolute;
      top: 10px;
      right: 10px;
      width: 34px;
      height: 34px;
      border-radius: 999px;
      border: 1.2px solid rgba(245, 211, 133, 0.94);
      background: rgba(52, 29, 19, 0.92);
      color: rgba(246, 218, 150, 0.96);
      font-size: 24px;
      line-height: 1;
      cursor: pointer;
    }

    .workshop-step-game-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding-right: 42px;
    }

    .workshop-step-game-title {
      margin: 0;
      font-size: 30px;
      line-height: 1.1;
      color: #f6da96;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      letter-spacing: 2px;
      text-shadow: 0 1px 0 rgba(70, 42, 25, 0.92), 0 0 12px rgba(246, 206, 120, 0.24);
    }

    .workshop-step-game-reset {
      height: 36px;
      padding: 0 16px;
      border-radius: 999px;
      border: 1.2px solid rgba(244, 209, 126, 0.92);
      background: rgba(52, 29, 19, 0.92);
      color: rgba(246, 218, 150, 0.98);
      font-size: 18px;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      cursor: pointer;
      transition: filter 0.14s ease, transform 0.14s ease;
    }

    .workshop-step-game-reset:hover {
      filter: brightness(1.08);
      transform: translateY(-1px);
    }

    .workshop-step-game-status {
      margin-top: 8px;
      min-height: 28px;
      padding: 6px 10px;
      border-radius: 10px;
      border: 1px solid rgba(244, 209, 126, 0.4);
      background: rgba(15, 9, 7, 0.4);
      color: rgba(246, 218, 150, 0.94);
      font-size: 17px;
      line-height: 1.5;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      letter-spacing: 0.5px;
    }

    .workshop-step-game-status.is-success {
      color: #d9ffb1;
      border-color: rgba(169, 232, 113, 0.62);
      background: rgba(14, 32, 12, 0.44);
    }

    .workshop-step-game-status.is-error {
      color: #ffd9c6;
      border-color: rgba(240, 128, 96, 0.58);
      background: rgba(42, 20, 16, 0.46);
    }

    .workshop-step-game-body {
      margin-top: 10px;
      display: grid;
      grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
      gap: 12px;
      align-items: start;
    }

    .workshop-step-game-col {
      border-radius: 14px;
      border: 1.2px solid rgba(244, 209, 126, 0.54);
      background: rgba(24, 15, 11, 0.45);
      padding: 10px;
    }

    .workshop-step-game-col-title {
      color: rgba(246, 218, 150, 0.92);
      font-size: 18px;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      margin-bottom: 8px;
      letter-spacing: 1px;
    }

    .workshop-step-game-tray {
      min-height: 120px;
      max-height: min(62vh, 640px);
      display: flex;
      flex-direction: column;
      gap: 10px;
      align-items: stretch;
      overflow-y: auto;
      padding-right: 2px;
    }

    .workshop-step-game-tray-hint {
      margin: 0;
      padding: 8px 10px;
      border-radius: 10px;
      border: 1px dashed rgba(244, 209, 126, 0.45);
      background: rgba(12, 8, 6, 0.35);
      color: rgba(246, 218, 150, 0.92);
      font-size: 16px;
      line-height: 1.55;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      letter-spacing: 0.4px;
    }

    .workshop-step-game-col--board {
      min-width: 0;
    }

    .workshop-step-piece {
      position: relative;
      border-radius: 12px;
      border: 1.2px solid rgba(244, 209, 126, 0.6);
      background: rgba(10, 6, 5, 0.34);
      min-height: 132px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 8px;
      cursor: grab;
      user-select: none;
      touch-action: none;
      transition: transform 0.14s ease, border-color 0.14s ease, filter 0.14s ease;
    }

    .workshop-step-piece:hover {
      transform: translateY(-1px);
      border-color: rgba(252, 232, 176, 0.88);
      filter: brightness(1.03);
    }

    .workshop-step-piece.is-selected {
      border-color: rgba(152, 211, 255, 0.96);
      box-shadow: 0 0 0 2px rgba(106, 183, 255, 0.26) inset;
    }

    .workshop-step-piece.is-placed {
      opacity: 0.35;
      pointer-events: none;
      cursor: default;
      filter: grayscale(0.2);
    }

    .workshop-step-piece--floating {
      position: absolute;
      z-index: 5;
      min-height: 0;
      width: auto;
      max-width: 38%;
      min-width: 72px;
      padding: 6px 8px;
      border: 3px solid rgba(255, 255, 255, 0.92);
      box-shadow:
        0 5px 14px rgba(0, 0, 0, 0.38),
        0 2px 4px rgba(0, 0, 0, 0.22);
      background: rgba(42, 26, 16, 0.62);
      border-radius: 11px;
    }

    .workshop-step-piece--floating .workshop-step-piece-label {
      font-size: 13px;
      opacity: 0.95;
    }

    .workshop-step-piece--floating.is-dragging {
      z-index: 25;
      cursor: grabbing;
      opacity: 0.95;
      transition: none;
      box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.45),
        0 0 0 2px rgba(152, 211, 255, 0.55);
    }

    .workshop-step-piece--floating img {
      max-height: min(28vh, 200px);
    }

    .workshop-step-piece img {
      width: var(--piece-scale-w, 72%);
      max-width: min(100%, 640px);
      height: auto;
      max-height: min(42vh, 320px);
      object-fit: contain;
      pointer-events: none;
      -webkit-user-drag: none;
      user-select: none;
    }

    .workshop-step-piece-label {
      color: rgba(246, 218, 150, 0.95);
      font-size: 16px;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      line-height: 1;
      pointer-events: none;
    }

    .workshop-step-game-board {
      position: relative;
      width: min(100%, 700px);
      margin: 0 auto;
      aspect-ratio: 1 / 1;
      border-radius: 16px;
      border: 1.4px solid rgba(244, 209, 126, 0.68);
      background:
        repeating-linear-gradient(
          90deg,
          rgba(72, 48, 30, 0.07) 0px,
          rgba(72, 48, 30, 0.07) 2px,
          transparent 2px,
          transparent 16px
        ),
        repeating-linear-gradient(
          0deg,
          rgba(48, 32, 20, 0.06) 0px,
          rgba(48, 32, 20, 0.06) 2px,
          transparent 2px,
          transparent 12px
        ),
        linear-gradient(185deg, #6b4a32 0%, #4a3020 42%, #2e1c12 100%);
      overflow: hidden;
      touch-action: none;
      box-shadow:
        inset 0 0 0 1px rgba(247, 216, 143, 0.14),
        0 10px 28px rgba(0, 0, 0, 0.35);
    }

    .workshop-step-game-board-bg {
      position: absolute;
      inset: 0;
      z-index: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      opacity: 0.5;
      filter: grayscale(0.35) contrast(1.02) brightness(0.98);
      pointer-events: none;
      -webkit-user-drag: none;
      user-select: none;
    }

    .workshop-step-game-silhouette-tint {
      position: absolute;
      inset: 0;
      z-index: 1;
      pointer-events: none;
      background: linear-gradient(
        168deg,
        rgba(130, 210, 255, 0.38) 0%,
        rgba(90, 175, 235, 0.26) 45%,
        rgba(70, 150, 210, 0.2) 100%
      );
      mix-blend-mode: soft-light;
    }

    .workshop-step-game-complete-preview {
      position: absolute;
      inset: 0;
      z-index: 3;
      width: 100%;
      height: 100%;
      object-fit: cover;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.28s ease;
      -webkit-user-drag: none;
      user-select: none;
    }

    .workshop-step-game-complete-preview.is-visible {
      opacity: 0.9;
      z-index: 20;
    }

    .workshop-step-zone {
      position: absolute;
      z-index: 2;
      border: none;
      border-radius: 12px;
      background: transparent;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: transform 0.14s ease;
      overflow: hidden;
      cursor: default;
      touch-action: none;
    }

    .workshop-step-zone.is-hover {
      transform: none;
      box-shadow:
        0 0 0 2px rgba(162, 222, 255, 0.96),
        inset 0 0 0 1px rgba(208, 239, 255, 0.7);
      background: rgba(78, 160, 214, 0.2);
    }

    .workshop-step-zone.is-correct {
      border: none;
      background: transparent;
      cursor: default;
      box-shadow: none;
    }

    .workshop-step-zone.is-wrong {
      border: none;
      background: transparent;
    }

    .workshop-step-zone-label {
      display: none;
    }

    .workshop-step-zone.is-correct .workshop-step-zone-label {
      display: none;
    }

    .workshop-step-zone-image {
      width: 100%;
      height: 100%;
      object-fit: contain;
      pointer-events: none;
      -webkit-user-drag: none;
      user-select: none;
    }

    .workshop-step-zone-ghost {
      display: none;
    }

    .workshop-step-zone.is-correct .workshop-step-zone-ghost {
      display: none;
    }

    .workshop-step-game-board.is-touch-dragging .workshop-step-zone:not(.is-correct) {
      box-shadow: inset 0 0 0 1px rgba(162, 222, 255, 0.35);
      background: rgba(78, 160, 214, 0.08);
    }

    @media (pointer: coarse) {
      .workshop-step-piece--floating {
        min-width: 96px;
        max-width: 46%;
        padding: 8px 10px;
      }

      .workshop-step-piece--floating img {
        max-height: min(34vh, 236px);
      }
    }

    .topic-nav-btn {
      min-width: 54px;
      height: 44px;
      border: 1.5px solid rgba(244, 209, 126, 0.95);
      border-radius: 12px;
      background:
        radial-gradient(120% 120% at 50% -20%, rgba(255, 240, 203, 0.32), rgba(255, 240, 203, 0) 66%),
        linear-gradient(180deg, rgba(83, 46, 31, 0.92), rgba(48, 26, 18, 0.92));
      color: #f6da96;
      font-size: 28px;
      font-weight: 700;
      line-height: 1;
      cursor: pointer;
      text-shadow: 0 1px 0 rgba(70, 42, 25, 0.9), 0 0 10px rgba(246, 206, 120, 0.3);
      box-shadow: 0 8px 18px rgba(0, 0, 0, 0.36);
    }

    .topic-nav-btn:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }

    .topic-nav-status {
      min-width: 84px;
      height: 36px;
      padding: 0 10px;
      border-radius: 999px;
      border: 1px solid rgba(245, 211, 133, 0.72);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      color: rgba(246, 218, 150, 0.94);
      background: rgba(26, 14, 9, 0.8);
    }

    @media (max-width: 768px) {
      .side-tools {
        right: calc(8px + env(safe-area-inset-right, 0px));
        gap: 8px;
      }

      .side-tool-btn {
        width: 48px;
        height: 48px;
      }

      .topic-nav {
        right: calc(8px + env(safe-area-inset-right, 0px));
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
      }

      .main-cave-overview-nav {
        right: calc(8px + env(safe-area-inset-right, 0px));
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
      }

      .workshop-timer-nav {
        right: calc(8px + env(safe-area-inset-right, 0px));
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
      }

      .main-cave-overview-btn {
        min-width: 94px;
        height: 40px;
        font-size: 20px;
        padding: 0 14px;
      }

      .workshop-timer-btn {
        min-width: 112px;
        height: 40px;
        font-size: 19px;
        padding: 0 12px;
      }

      .workshop-step-btn {
        min-width: 96px;
        height: 40px;
        font-size: 18px;
        padding: 0 12px;
      }

      .workshop-timer-panel {
        min-width: min(320px, calc(100vw - 18px));
        padding: 14px 18px 12px;
        border-radius: 18px;
      }

      .workshop-timer-close {
        width: 30px;
        height: 30px;
        font-size: 20px;
      }

      .workshop-timer-title {
        font-size: 18px;
      }

      .workshop-timer-value {
        margin-top: 4px;
        font-size: clamp(42px, 12vw, 64px);
      }

      .workshop-timer-field {
        font-size: 16px;
      }

      .workshop-timer-field input {
        width: 52px;
        height: 32px;
        font-size: 18px;
      }

      .workshop-timer-apply-btn {
        height: 32px;
        font-size: 16px;
        padding: 0 10px;
      }

      .workshop-step-game-panel {
        width: min(100%, 98vw);
        max-height: 94vh;
        border-radius: 16px;
        padding: 12px 10px 10px;
      }

      .workshop-step-game-title {
        font-size: 24px;
      }

      .workshop-step-game-reset {
        height: 32px;
        font-size: 16px;
        padding: 0 12px;
      }

      .workshop-step-game-body {
        grid-template-columns: 1fr;
      }

      .workshop-step-game-tray {
        min-height: auto;
        max-height: none;
      }

      .workshop-step-piece {
        min-height: 102px;
      }

      .workshop-step-zone-label {
        font-size: 14px;
      }

      .topic-nav-btn {
        min-width: 48px;
        height: 38px;
        font-size: 24px;
      }

      .topic-nav-status {
        min-width: 72px;
        height: 32px;
        font-size: 13px;
      }
    }

    .cave-gallery-overlay {
      position: fixed;
      inset: 0;
      z-index: 26;
      display: flex;
      align-items: center;
      justify-content: center;
      pointer-events: auto;
      padding: 14px;
    }

    .cave-gallery-overlay.hidden {
      display: none !important;
    }

    .cave-gallery-mask {
      position: absolute;
      inset: 0;
      background: rgba(7, 5, 4, 0.46);
      backdrop-filter: blur(1.2px);
      -webkit-backdrop-filter: blur(1.2px);
      pointer-events: none;
    }

    .cave-gallery-panel {
      position: relative;
      width: min(1360px, 96vw);
      border-radius: 18px;
      border: 1.5px solid rgba(244, 209, 126, 0.82);
      background:
        radial-gradient(95% 70% at 50% 8%, rgba(244, 232, 204, 0.18), rgba(244, 232, 204, 0) 70%),
        linear-gradient(180deg, rgba(38, 24, 17, 0.82), rgba(22, 14, 10, 0.84));
      box-shadow: 0 18px 34px rgba(0, 0, 0, 0.42);
      padding: 14px;
      pointer-events: auto;
    }

    .cave-gallery-close {
      position: absolute;
      top: 8px;
      right: 8px;
      width: 32px;
      height: 32px;
      border: 1px solid rgba(245, 211, 133, 0.9);
      border-radius: 999px;
      background: linear-gradient(180deg, rgba(83, 46, 31, 0.9), rgba(46, 24, 16, 0.92));
      color: #f7da98;
      font-size: 18px;
      line-height: 1;
      cursor: pointer;
      z-index: 2;
      box-shadow: 0 6px 14px rgba(0, 0, 0, 0.32);
    }

    .cave-gallery-title {
      margin: 0 0 10px;
      text-align: center;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      color: #f3d89a;
      font-size: clamp(24px, 2.2vw, 36px);
      letter-spacing: 2px;
      text-shadow: 0 1px 0 rgba(70, 42, 25, 0.95), 0 0 14px rgba(246, 206, 120, 0.28);
    }

    .cave-gallery-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
    }

    .cave-gallery-item {
      all: unset;
      display: block;
      position: relative;
      aspect-ratio: 4 / 3;
      border: 2px solid rgba(244, 209, 126, 0.8);
      border-radius: 12px;
      overflow: hidden;
      cursor: pointer;
      box-shadow: 0 10px 20px rgba(0, 0, 0, 0.34);
      transition: transform 0.14s ease, filter 0.14s ease;
      background: #120d09;
    }

    .cave-gallery-item:hover {
      transform: translateY(-1px);
      filter: brightness(1.04);
    }

    .cave-gallery-item:active {
      transform: translateY(0);
      filter: brightness(0.98);
    }

    .cave-gallery-item:focus-visible {
      outline: 2px solid rgba(252, 232, 176, 0.94);
      outline-offset: 2px;
    }

    .cave-gallery-item img {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
      background: #000;
    }

    @media (max-width: 900px) {
      .cave-gallery-panel {
        width: min(960px, 96vw);
        padding: 10px;
      }

      .cave-gallery-grid {
        gap: 8px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }

      .cave-gallery-item {
        aspect-ratio: 1 / 1;
      }
    }

    .stone-wall-overlay {
      position: fixed;
      inset: 0;
      z-index: 34;
      display: flex;
      align-items: center;
      justify-content: center;
      pointer-events: auto;
      padding: 6px;
    }

    .stone-wall-overlay.hidden {
      display: none !important;
    }

    .stone-wall-mask {
      position: absolute;
      inset: 0;
      background: rgba(8, 6, 4, 0.3);
      backdrop-filter: blur(1px);
      -webkit-backdrop-filter: blur(1.4px);
      pointer-events: none;
    }

    .stone-wall-panel {
      position: relative;
      width: min(1440px, 98vw);
      max-height: 94vh;
      overflow: auto;
      border-radius: 18px;
      border: 1.5px solid rgba(244, 209, 126, 0.82);
      background:
        radial-gradient(95% 70% at 50% 8%, rgba(244, 232, 204, 0.2), rgba(244, 232, 204, 0) 70%),
        linear-gradient(180deg, rgba(38, 24, 17, 0.86), rgba(22, 14, 10, 0.88));
      box-shadow: 0 18px 34px rgba(0, 0, 0, 0.42);
      padding: 12px;
      pointer-events: auto;
    }

    .stone-wall-title {
      margin: 0 0 8px;
      text-align: center;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      color: #f3d89a;
      font-size: clamp(20px, 1.8vw, 28px);
      letter-spacing: 2px;
      text-shadow: 0 1px 0 rgba(70, 42, 25, 0.95), 0 0 14px rgba(246, 206, 120, 0.28);
    }

    .stone-wall-tools {
      margin: -2px 0 8px;
      display: flex;
      justify-content: flex-end;
    }

    .stone-wall-clear-btn {
      all: unset;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      height: 30px;
      min-width: 90px;
      padding: 0 12px;
      border-radius: 999px;
      border: 1px solid rgba(244, 209, 126, 0.72);
      background: rgba(58, 31, 19, 0.78);
      color: #f8e4b3;
      font-size: 13px;
      line-height: 1;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      cursor: pointer;
      transition: filter 0.12s ease, transform 0.12s ease;
    }

    .stone-wall-clear-btn:hover {
      filter: brightness(1.07);
      transform: translateY(-1px);
    }

    .stone-wall-clear-btn:disabled {
      opacity: 0.55;
      cursor: not-allowed;
      transform: none;
      filter: none;
    }

    .stone-wall-quick-pick {
      display: grid;
      grid-template-columns: repeat(8, minmax(0, 1fr));
      gap: 6px;
      margin: 0 0 8px;
    }

    .stone-wall-quick-pick.hidden {
      display: none !important;
    }

    .stone-quick-btn {
      all: unset;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      padding: 4px 0;
      font-size: 12px;
      line-height: 1;
      color: #f8e7bf;
      border: 1px solid rgba(244, 209, 126, 0.56);
      background: rgba(39, 26, 17, 0.7);
      cursor: pointer;
      transition: filter 0.12s ease, transform 0.12s ease;
    }

    .stone-quick-btn:hover {
      filter: brightness(1.08);
      transform: translateY(-1px);
    }

    .stone-quick-btn:disabled {
      cursor: default;
      opacity: 0.5;
      transform: none;
      filter: none;
    }

    .stone-quick-btn.has-work {
      background: rgba(88, 52, 27, 0.74);
      border-color: rgba(248, 215, 133, 0.82);
    }

    .stone-wall-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 8px;
    }

    .stone-slot {
      all: unset;
      display: block;
      position: relative;
      border-radius: 12px;
      border: 1.6px solid rgba(238, 203, 124, 0.78);
      overflow: hidden;
      aspect-ratio: 16 / 10;
      box-shadow: 0 10px 18px rgba(0, 0, 0, 0.32);
      cursor: pointer;
      background: rgba(26, 18, 12, 0.66);
      transition: transform 0.14s ease, filter 0.14s ease;
    }

    .stone-slot:hover {
      transform: translateY(-1px);
      filter: brightness(1.04);
    }

    .stone-slot-bg {
      position: absolute;
      inset: 0;
      background-position: center;
      background-size: cover;
      opacity: 0.5;
      filter: saturate(0.68) brightness(0.92);
    }

    .stone-slot-image {
      position: absolute;
      left: 50%;
      top: 50%;
      width: 94%;
      height: 94%;
      object-fit: contain;
      object-position: center center;
      border-radius: 10px;
      box-shadow: 0 8px 16px rgba(0, 0, 0, 0.28);
      border: none;
      background: transparent;
      transform: translate(-50%, -50%);
    }

    .stone-slot-image.hidden {
      display: none;
    }

    .stone-slot-label {
      position: absolute;
      top: 6px;
      left: 8px;
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 13px;
      color: #f6deab;
      background: rgba(38, 25, 16, 0.66);
      border: 1px solid rgba(244, 209, 126, 0.54);
      letter-spacing: 0.5px;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      z-index: 2;
    }

    .stone-slot-tip {
      position: absolute;
      right: 8px;
      bottom: 7px;
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 12px;
      color: #f9e8be;
      background: rgba(41, 25, 16, 0.7);
      border: 1px solid rgba(244, 209, 126, 0.52);
      z-index: 2;
      font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    }

    .stone-slot.has-work {
      background: transparent;
    }

    .stone-slot.has-work .stone-slot-bg {
      opacity: 0.46;
      filter: none;
    }

    .stone-slot.has-work .stone-slot-image {
      transform: translate(-50%, -50%) scale(var(--stone-work-scale, 1.35));
    }

    .stone-slot.empty {
      cursor: default;
    }

    @media (max-width: 1000px) {
      .stone-wall-panel {
        width: min(1220px, 98vw);
      }
      .stone-wall-quick-pick {
        grid-template-columns: repeat(4, minmax(0, 1fr));
      }
      .stone-wall-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
      }
    }

    .video-overlay {
      position: fixed;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      background:
        radial-gradient(120% 118% at 50% 0%, rgba(254, 220, 146, 0.16), rgba(254, 220, 146, 0) 56%),
        linear-gradient(180deg, rgba(20, 12, 8, 0.84), rgba(8, 5, 3, 0.9));
      backdrop-filter: blur(2px);
      -webkit-backdrop-filter: blur(2px);
      z-index: 40;
      padding: 12px;
    }

    .video-overlay.show {
      display: flex;
    }

    .video-modal,
    .cover-modal {
      position: relative;
      width: auto;
      height: auto;
      max-width: min(96vw, 1680px);
      max-height: 94vh;
      border-radius: 18px;
      border: 1.8px solid rgba(244, 209, 126, 0.9);
      background:
        radial-gradient(95% 72% at 50% 6%, rgba(255, 238, 190, 0.2), rgba(255, 238, 190, 0) 70%),
        linear-gradient(180deg, rgba(56, 34, 24, 0.9), rgba(28, 17, 12, 0.92));
      box-shadow: 0 20px 44px rgba(0, 0, 0, 0.46);
      padding: 14px;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .video-modal::before,
    .cover-modal::before {
      content: "";
      position: absolute;
      inset: 7px;
      border: 1px solid rgba(247, 219, 152, 0.74);
      border-radius: 12px;
      pointer-events: none;
    }

    .video-modal video,
    .cover-modal img {
      position: relative;
      z-index: 1;
      width: auto;
      height: auto;
      max-width: calc(96vw - 40px);
      max-height: calc(94vh - 40px);
      display: block;
      border-radius: 10px;
      object-fit: contain;
      background: transparent;
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
    }

    .cover-backdrop {
      position: absolute;
      left: 14px;
      right: 14px;
      top: 14px;
      bottom: 14px;
      border-radius: 10px;
      background-position: center;
      background-size: cover;
      background-repeat: no-repeat;
      opacity: 0.68;
      filter: saturate(0.84) brightness(0.96);
      z-index: 0;
      pointer-events: none;
    }

    .cover-backdrop.hidden {
      display: none;
    }

    @media (max-width: 768px) {
      .video-overlay {
        padding: 8px;
      }

      .video-modal,
      .cover-modal {
        border-radius: 14px;
        padding: 10px;
      }

      .video-modal::before,
      .cover-modal::before {
        inset: 5px;
        border-radius: 10px;
      }

      .video-modal video,
      .cover-modal img {
        max-width: calc(96vw - 24px);
        max-height: calc(94vh - 24px);
        border-radius: 8px;
      }
    }

    .video-close {
      position: absolute;
      top: 10px;
      right: 10px;
      width: 30px;
      height: 30px;
      border: 1px solid rgba(245, 211, 133, 0.9);
      border-radius: 999px;
      background: linear-gradient(180deg, rgba(83, 46, 31, 0.9), rgba(46, 24, 16, 0.92));
      color: #f7da98;
      font-size: 18px;
      line-height: 1;
      cursor: pointer;
      z-index: 2;
      box-shadow: 0 6px 14px rgba(0, 0, 0, 0.32);
    }

    .cover-delete {
      left: 10px;
      right: auto;
      width: auto;
      min-width: 58px;
      padding: 0 12px;
      border-radius: 999px;
      display: none;
      font-size: 15px;
      letter-spacing: 1px;
    }

    .login-overlay {
      position: fixed;
      inset: 0;
      z-index: 90;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 16px;
      background:
        linear-gradient(0deg, rgba(56, 34, 21, 0.62), rgba(56, 34, 21, 0.62)),
        url("./assets/scene.jpg") center / cover no-repeat;
    }

    .login-overlay.hidden {
      display: none;
    }

    .login-shell {
      --paper: #f6f0e4;
      --paper-soft: #faf5ec;
      --line: #d8bfa0;
      --line-deep: #c59d78;
      --title: #8f6349;
      --sub: #4d6d96;
      position: relative;
      width: min(1040px, 74vw);
      max-height: 80vh;
      overflow: auto;
      border-radius: 36px;
      border: 2px solid rgba(246, 222, 173, 0.84);
      background:
        radial-gradient(95% 70% at 50% 8%, rgba(244, 232, 204, 0.56), rgba(244, 232, 204, 0) 70%),
        linear-gradient(180deg, var(--paper-soft), var(--paper));
      box-shadow: 0 20px 44px rgba(26, 14, 9, 0.34);
      padding: 18px 24px 18px;
      color: var(--title);
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
    }

    .login-shell::before {
      content: "";
      position: absolute;
      inset: 10px;
      border-radius: 20px;
      border: 1.5px solid rgba(216, 191, 160, 0.72);
      pointer-events: none;
    }

    .login-title {
      margin: 0;
      text-align: center;
      font-size: clamp(36px, 3.2vw, 56px);
      color: var(--title);
      letter-spacing: 2px;
      font-weight: 700;
      line-height: 1.1;
    }

    .login-subtitle {
      margin: 14px 0 0;
      text-align: center;
      font-size: clamp(18px, 1.7vw, 30px);
      line-height: 1.45;
      color: var(--sub);
      font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
      font-weight: 500;
    }

    .login-section-title {
      margin: 14px 0 10px;
      text-align: center;
      font-size: clamp(20px, 1.7vw, 28px);
      line-height: 1.15;
      color: var(--title);
      font-weight: 700;
      letter-spacing: 2px;
    }

    .login-grid-wrap {
      border-radius: 26px;
      border: 2px solid rgba(216, 191, 160, 0.92);
      background: rgba(248, 242, 231, 0.9);
      padding: 10px;
      max-height: min(30vh, 238px);
      overflow: auto;
    }

    .student-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 8px;
    }

    .student-id-btn {
      height: 42px;
      border-radius: 14px;
      border: 2px solid var(--line-deep);
      background: rgba(255, 255, 255, 0.44);
      color: #795846;
      font-size: clamp(18px, 1.3vw, 24px);
      line-height: 1;
      font-weight: 700;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      cursor: pointer;
      transition: background-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
    }

    .student-id-btn:hover {
      transform: translateY(-1px);
      background: rgba(255, 252, 245, 0.88);
    }

    .student-id-btn.is-selected {
      background: linear-gradient(180deg, #d9a57d, #c78d63);
      color: #fff7e9;
      border-color: #bc8761;
      box-shadow: 0 8px 14px rgba(120, 78, 52, 0.18);
    }

    .student-id-btn:focus-visible,
    .login-submit-btn:focus-visible {
      outline: 2px solid rgba(214, 167, 112, 0.95);
      outline-offset: 2px;
    }

    .login-footer {
      margin-top: 10px;
      border-radius: 18px;
      border: 2px solid rgba(216, 191, 160, 0.92);
      background: rgba(246, 239, 227, 0.94);
      padding: 10px 10px 12px;
      text-align: center;
    }

    .login-hint {
      font-size: clamp(16px, 1.2vw, 22px);
      color: var(--sub);
      margin-bottom: 8px;
      font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
      font-weight: 600;
      line-height: 1.35;
    }

    .login-submit-btn {
      min-width: 132px;
      height: 40px;
      border: none;
      border-radius: 14px;
      font-size: clamp(22px, 1.6vw, 30px);
      line-height: 1;
      letter-spacing: 2px;
      color: #fff2dd;
      font-weight: 700;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      cursor: pointer;
      background: linear-gradient(180deg, #d39a72, #c48760);
      box-shadow: 0 10px 18px rgba(116, 73, 48, 0.2);
      transition: transform 0.12s ease, filter 0.15s ease;
    }

    .login-submit-btn:hover {
      transform: translateY(-1px);
      filter: brightness(1.04);
    }

    .login-submit-btn:active {
      transform: translateY(0);
      filter: brightness(0.97);
    }

    .student-panel {
      position: fixed;
      inset: 0;
      z-index: 80;
      display: flex;
      align-items: center;
      justify-content: center;
      padding:
        calc(14px + env(safe-area-inset-top, 0px))
        calc(14px + env(safe-area-inset-right, 0px))
        calc(14px + env(safe-area-inset-bottom, 0px))
        calc(14px + env(safe-area-inset-left, 0px));
      box-sizing: border-box;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      background:
        linear-gradient(0deg, rgba(50, 30, 18, 0.74), rgba(50, 30, 18, 0.74)),
        url("./images/洞窟工坊.jpg") center / cover no-repeat;
    }

    .student-panel.hidden {
      display: none;
    }

    .student-shell {
      width: min(920px, 92vw);
      max-height: calc(100vh - 28px);
      max-height: calc(100dvh - 28px);
      border-radius: 22px;
      border: 1.5px solid rgba(246, 222, 173, 0.84);
      background:
        radial-gradient(95% 70% at 50% 8%, rgba(244, 232, 204, 0.52), rgba(244, 232, 204, 0) 70%),
        linear-gradient(180deg, #faf5ec, #f6f0e4);
      box-shadow: 0 16px 34px rgba(26, 14, 9, 0.32);
      padding: 16px;
      box-sizing: border-box;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      color: #8f6349;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
    }

    .student-title {
      margin: 0;
      text-align: center;
      font-size: clamp(28px, 2.3vw, 40px);
      line-height: 1.15;
      letter-spacing: 2px;
      color: #8f6349;
    }

    .student-badge {
      margin-top: 8px;
      text-align: center;
      font-size: clamp(14px, 1.1vw, 18px);
      color: #4d6d96;
      font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
      font-weight: 600;
    }

    .student-preview-wrap {
      margin: 10px auto 0;
      width: min(100%, 600px);
      border-radius: 14px;
      border: 2px solid rgba(216, 191, 160, 0.92);
      background:
        linear-gradient(45deg, #dbd3c4 25%, transparent 25%),
        linear-gradient(-45deg, #dbd3c4 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #dbd3c4 75%),
        linear-gradient(-45deg, transparent 75%, #dbd3c4 75%),
        #f2ecde;
      background-size: 24px 24px;
      background-position: 0 0, 0 12px, 12px -12px, -12px 0;
      overflow: hidden;
      aspect-ratio: 5 / 4;
      max-height: min(46vh, 460px);
      position: relative;
    }

    .student-preview-wrap video,
    .student-preview-wrap img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      background: #000;
      position: absolute;
      inset: 0;
    }

    /* 生成预览图按容器自适应，避免主体视觉上“超出窗口” */
    .student-preview-wrap #studentPreview {
      width: 96%;
      height: 96%;
      inset: 2%;
      object-fit: contain;
      object-position: center center;
      background: transparent;
    }

    .student-preview-wrap video.hidden {
      display: none;
    }

    .student-preview-wrap img.hidden {
      display: none;
    }

    .student-prompt-wrap {
      margin-top: 10px;
    }

    .student-prompt-input {
      width: 100%;
      min-height: 60px;
      max-height: 110px;
      resize: vertical;
      box-sizing: border-box;
      border-radius: 12px;
      border: 1.5px solid rgba(205, 172, 138, 0.95);
      background: rgba(255, 252, 246, 0.96);
      padding: 10px 12px;
      font-size: 18px;
      line-height: 1.45;
      color: #5a4435;
      font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
      outline: none;
    }

    .student-prompt-input:focus {
      border-color: rgba(184, 140, 99, 0.95);
      box-shadow: 0 0 0 2px rgba(222, 190, 150, 0.3);
    }

    .student-prompt-tools {
      margin-top: 8px;
      display: flex;
      justify-content: flex-end;
      gap: 8px;
    }

    .student-actions {
      margin-top: 12px;
      display: flex;
      justify-content: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    .student-btn {
      min-width: 126px;
      height: 38px;
      border: 1.5px solid rgba(244, 209, 126, 0.96);
      border-radius: 12px;
      color: #f6da96;
      font-size: 19px;
      line-height: 1;
      letter-spacing: 1px;
      font-weight: 700;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      text-shadow: 0 1px 0 rgba(70, 42, 25, 0.9), 0 0 12px rgba(246, 206, 120, 0.24);
      background:
        radial-gradient(140% 120% at 50% -30%, rgba(255, 236, 182, 0.22) 0%, rgba(255, 236, 182, 0) 60%),
        linear-gradient(180deg, rgba(83, 46, 31, 0.84), rgba(48, 26, 18, 0.9));
      box-shadow: 0 8px 16px rgba(0, 0, 0, 0.32), inset 0 0 0 1px rgba(108, 64, 39, 0.65);
      cursor: pointer;
      transition: transform 0.15s ease, filter 0.15s ease;
    }

    .student-btn:hover {
      transform: translateY(-1px);
      filter: brightness(1.05);
    }

    .student-btn:active {
      transform: translateY(0);
      filter: brightness(0.97);
    }

    .student-btn:disabled {
      opacity: 0.55;
      cursor: not-allowed;
      transform: none;
      filter: none;
    }

    .student-btn.listening {
      border-color: #cf5e50;
      color: #ffe9e0;
      background: linear-gradient(180deg, rgba(171, 69, 56, 0.9), rgba(132, 50, 40, 0.92));
    }

    .student-logout-btn {
      min-width: 104px;
    }

    .student-status {
      margin: 10px 0 0;
      text-align: center;
      min-height: 1.5em;
      font-size: clamp(14px, 1.1vw, 18px);
      line-height: 1.35;
      color: #4d6d96;
      font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
      font-weight: 600;
    }

    .student-status.is-error {
      color: #b2402b;
    }

    .cave-chat-overlay-mask {
      position: fixed;
      inset: 0;
      z-index: 27;
      background:
        radial-gradient(140% 120% at 10% 8%, rgba(255, 210, 130, 0.26), rgba(255, 210, 130, 0) 54%),
        radial-gradient(160% 130% at 100% 100%, rgba(193, 116, 65, 0.25), rgba(193, 116, 65, 0) 60%),
        linear-gradient(180deg, rgba(9, 6, 4, 0.76), rgba(7, 4, 3, 0.82));
      backdrop-filter: blur(5px);
      -webkit-backdrop-filter: blur(5px);
    }

    .cave-chat-overlay-mask.hidden {
      display: none !important;
    }

    .cave-chat-panel {
      --chat-gold: #e7c37d;
      --chat-gold-soft: rgba(231, 195, 125, 0.46);
      --chat-ink: #563b2a;
      --chat-surface: rgba(246, 238, 224, 0.96);
      --chat-surface-soft: rgba(255, 249, 238, 0.84);
      --chat-deep: #4f2f20;
      position: fixed;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      transform-origin: center center;
      width: min(1240px, calc(100vw - 24px));
      max-height: calc(100vh - 26px);
      max-height: calc(100dvh - 26px);
      z-index: 28;
      display: grid;
      grid-template-columns: minmax(0, 1fr) clamp(240px, 23vw, 332px);
      align-items: stretch;
      gap: 14px;
      pointer-events: auto;
      padding: 12px;
      border-radius: 26px;
      border: 1.5px solid var(--chat-gold-soft);
      background:
        radial-gradient(120% 100% at 50% -12%, rgba(255, 228, 169, 0.16), rgba(255, 228, 169, 0) 56%),
        linear-gradient(180deg, rgba(41, 25, 18, 0.68), rgba(28, 17, 12, 0.74));
      box-shadow: 0 26px 56px rgba(8, 5, 4, 0.56);
      backdrop-filter: blur(1.5px);
      -webkit-backdrop-filter: blur(1.5px);
      box-sizing: border-box;
      overflow: hidden;
    }

    .cave-chat-panel.hidden {
      display: none;
    }

    .cave-chat-box {
      position: relative;
      min-width: 0;
      border-radius: 20px;
      border: 1.4px solid rgba(224, 186, 117, 0.86);
      background:
        radial-gradient(132% 92% at 50% -18%, rgba(255, 226, 167, 0.46), rgba(255, 226, 167, 0) 58%),
        linear-gradient(180deg, var(--chat-surface), rgba(239, 226, 204, 0.98));
      box-shadow:
        0 14px 30px rgba(14, 9, 7, 0.32),
        inset 0 1px 0 rgba(255, 248, 232, 0.92);
      padding: 18px 16px 14px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      overflow: hidden;
    }

    .cave-chat-box::before {
      content: "";
      position: absolute;
      inset: 8px 8px 10px;
      border-radius: 14px;
      border: 1px solid rgba(208, 164, 107, 0.42);
      pointer-events: none;
    }

    .cave-chat-close {
      position: absolute;
      top: 10px;
      right: 10px;
      width: 34px;
      height: 34px;
      border: 1px solid rgba(235, 195, 119, 0.9);
      border-radius: 999px;
      background: linear-gradient(180deg, rgba(102, 61, 41, 0.94), rgba(67, 40, 28, 0.95));
      color: #f2cf8a;
      font-size: 20px;
      line-height: 1;
      cursor: pointer;
      z-index: 4;
      box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    }

    .cave-chat-title {
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      color: var(--chat-ink);
      font-size: clamp(30px, 2.2vw, 40px);
      font-weight: 700;
      line-height: 1;
      letter-spacing: 2.5px;
      text-shadow: 0 1px 0 rgba(255, 244, 215, 0.84);
      margin-top: 6px;
      margin-bottom: 6px;
    }

    .cave-chat-log {
      display: none;
    }

    .cave-chat-bubble {
      max-width: 92%;
      border-radius: 15px;
      padding: 10px 14px;
      line-height: 1.5;
      font-size: clamp(18px, 1.38vw, 24px);
      font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
      white-space: pre-wrap;
      word-break: break-word;
      box-shadow: 0 8px 14px rgba(0, 0, 0, 0.08);
    }

    .cave-chat-bubble.user {
      align-self: flex-end;
      background: linear-gradient(180deg, #d88f64, #c56d45);
      border: 1px solid rgba(170, 96, 61, 0.82);
      color: #fff7eb;
    }

    .cave-chat-bubble.assistant {
      align-self: flex-start;
      background: linear-gradient(180deg, rgba(255, 250, 239, 0.96), rgba(253, 245, 230, 0.96));
      border: 1px solid rgba(206, 170, 126, 0.88);
      color: #4f3b2f;
    }

    .cave-chat-compose {
      display: grid;
      grid-template-columns: minmax(0, 1fr) clamp(150px, 15vw, 196px) clamp(132px, 13vw, 170px);
      gap: 12px;
      align-items: center;
    }

    .cave-chat-input {
      width: 100%;
      min-height: 94px;
      max-height: 130px;
      resize: none;
      border-radius: 16px;
      border: 1.5px solid rgba(199, 156, 104, 0.7);
      background:
        linear-gradient(180deg, rgba(255, 252, 244, 0.96), rgba(250, 243, 230, 0.94)),
        radial-gradient(110% 80% at 78% -8%, rgba(255, 228, 176, 0.22), rgba(255, 228, 176, 0) 62%);
      padding: 14px 15px;
      font-size: clamp(20px, 1.35vw, 25px);
      line-height: 1.38;
      color: #5f4635;
      font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
      outline: none;
      box-sizing: border-box;
      box-shadow: inset 0 2px 10px rgba(93, 62, 36, 0.08);
    }

    .cave-chat-input:focus {
      border-color: rgba(188, 141, 96, 0.96);
      box-shadow:
        inset 0 2px 10px rgba(93, 62, 36, 0.08),
        0 0 0 2px rgba(222, 190, 150, 0.32);
    }

    .cave-chat-btn {
      width: 100%;
      min-width: 0;
      height: 64px;
      padding: 0 14px;
      border: 1.2px solid rgba(233, 189, 114, 0.96);
      border-radius: 14px;
      color: #f6d99a;
      font-size: clamp(30px, 2vw, 38px);
      line-height: 1;
      letter-spacing: 2px;
      font-weight: 700;
      font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
      text-shadow: 0 1px 0 rgba(70, 42, 25, 0.9);
      background:
        radial-gradient(140% 120% at 50% -30%, rgba(255, 226, 164, 0.24) 0%, rgba(255, 226, 164, 0) 60%),
        linear-gradient(180deg, rgba(94, 57, 39, 0.92), rgba(63, 37, 26, 0.95));
      box-shadow:
        0 10px 18px rgba(0, 0, 0, 0.26),
        inset 0 0 0 1px rgba(124, 75, 48, 0.62);
      cursor: pointer;
      transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.15s ease;
    }

    #caveChatMicBtn {
      grid-area: auto;
    }

    #caveChatSendBtn {
      grid-area: auto;
    }

    .cave-chat-btn:hover {
      transform: translateY(-1px);
      filter: brightness(1.06);
      box-shadow:
        0 12px 20px rgba(0, 0, 0, 0.28),
        inset 0 0 0 1px rgba(130, 80, 52, 0.66);
    }

    .cave-chat-btn:active {
      transform: translateY(0);
      filter: brightness(0.96);
    }

    .cave-chat-btn:disabled {
      opacity: 0.58;
      cursor: not-allowed;
      transform: none;
      filter: none;
    }

    .cave-chat-btn.listening {
      border-color: #cf5e50;
      color: #ffe9e0;
      background: linear-gradient(180deg, rgba(171, 69, 56, 0.9), rgba(132, 50, 40, 0.92));
    }

    .cave-chat-status {
      min-height: 60px;
      border-radius: 14px;
      border: 1px solid rgba(212, 175, 120, 0.5);
      background:
        linear-gradient(180deg, var(--chat-surface-soft), rgba(245, 234, 215, 0.88)),
        radial-gradient(120% 80% at 92% 0%, rgba(255, 225, 171, 0.2), rgba(255, 225, 171, 0) 65%);
      padding: 14px 14px;
      font-size: clamp(21px, 1.25vw, 25px);
      line-height: 1.32;
      color: #3e5f89;
      font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
      font-weight: 600;
      letter-spacing: 0.3px;
      box-sizing: border-box;
    }

    .cave-chat-status.is-error {
      color: #b2402b;
    }

    .cave-chat-avatar-wrap {
      position: relative;
      width: 100%;
      min-height: 420px;
      border-radius: 22px;
      border: 1.4px solid rgba(236, 192, 118, 0.84);
      background:
        radial-gradient(120% 90% at 50% 0%, rgba(255, 225, 167, 0.28), rgba(255, 225, 167, 0) 62%),
        linear-gradient(180deg, rgba(92, 58, 42, 0.9), rgba(54, 34, 24, 0.94));
      box-shadow: 0 16px 28px rgba(9, 6, 4, 0.34);
      overflow: hidden;
      pointer-events: none;
      user-select: none;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 12px 10px;
      box-sizing: border-box;
    }

    .cave-chat-avatar-wrap::before {
      content: "";
      position: absolute;
      inset: 8px;
      border-radius: 14px;
      border: 1px solid rgba(247, 219, 152, 0.58);
      pointer-events: none;
    }

    .cave-chat-avatar-wrap img {
      width: 100%;
      max-width: 264px;
      max-height: min(56vh, 600px);
      height: auto;
      display: block;
      object-fit: contain;
      object-position: center bottom;
      filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.36));
    }

    /* 纯语音模式：只保留阿布图片和话筒按钮 */
    .cave-chat-panel {
      width: min(440px, calc(100vw - 30px));
      max-height: none;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0;
      gap: 0;
      grid-template-columns: none;
      border: none;
      background: none;
      box-shadow: none;
      overflow: visible;
    }

    .cave-chat-voice-shell {
      width: 100%;
      border-radius: 26px;
      border: 1.6px solid rgba(246, 210, 132, 0.92);
      background:
        radial-gradient(120% 85% at 50% -8%, rgba(255, 232, 186, 0.38), rgba(255, 232, 186, 0) 58%),
        linear-gradient(180deg, rgba(75, 45, 31, 0.92), rgba(47, 28, 19, 0.95));
      box-shadow:
        0 30px 48px rgba(13, 9, 7, 0.44),
        inset 0 1px 0 rgba(255, 239, 198, 0.54);
      padding: 20px 18px 22px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 16px;
      position: relative;
      box-sizing: border-box;
    }

    .cave-chat-hidden-io,
    .cave-chat-close {
      display: none !important;
    }

    .cave-chat-avatar-wrap {
      width: 100%;
      min-height: 350px;
      border-radius: 20px;
      border: 1.4px solid rgba(247, 213, 141, 0.8);
      background:
        radial-gradient(120% 82% at 50% 0%, rgba(255, 233, 188, 0.28), rgba(255, 233, 188, 0) 62%),
        linear-gradient(180deg, rgba(88, 56, 41, 0.8), rgba(56, 35, 25, 0.88));
      box-shadow: inset 0 1px 0 rgba(255, 236, 196, 0.45);
      padding: 12px 12px 8px;
    }

    .cave-chat-avatar-wrap::before {
      inset: 10px;
      border-radius: 12px;
      border-color: rgba(247, 219, 152, 0.45);
    }

    .cave-chat-avatar-wrap img {
      max-width: 248px;
      max-height: min(45vh, 460px);
      filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.34));
    }

    .cave-chat-btn {
      min-width: 0;
      width: 100%;
      height: 66px;
      border-radius: 18px;
      font-size: clamp(30px, 2.4vw, 40px);
      letter-spacing: 1.2px;
    }

    .cave-chat-mic-only-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      position: relative;
      overflow: hidden;
    }

    @media (max-width: 1100px) {
      .login-shell {
        padding: 16px 16px 16px;
        border-radius: 18px;
        width: min(980px, 88vw);
      }

      .login-shell::before {
        inset: 8px;
        border-radius: 12px;
      }

      .student-grid {
        gap: 12px;
      }
    }

    @media (max-width: 900px) {
      .login-overlay {
        padding: 14px;
      }

      .login-title {
        font-size: clamp(36px, 9vw, 52px);
      }

      .login-subtitle {
        font-size: clamp(16px, 4.2vw, 24px);
      }

      .login-section-title {
        margin: 18px 0 10px;
        font-size: clamp(28px, 7vw, 42px);
      }

      .login-grid-wrap {
        padding: 12px;
        border-radius: 16px;
        max-height: min(42vh, 340px);
      }

      .student-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
      }

      .student-id-btn {
        height: 48px;
        border-radius: 12px;
        border-width: 2px;
        font-size: clamp(20px, 5.4vw, 30px);
      }

      .login-footer {
        margin-top: 14px;
        padding: 14px 10px 16px;
        border-radius: 16px;
      }

      .login-hint {
        font-size: clamp(16px, 4.2vw, 23px);
      }

      .login-submit-btn {
        min-width: 150px;
        height: 46px;
        border-radius: 14px;
        font-size: clamp(28px, 7vw, 40px);
      }

      .student-shell {
        width: min(980px, 94vw);
        padding: 12px;
      }

      .student-preview-wrap {
        max-height: min(38vh, 360px);
      }

      .student-btn {
        min-width: 118px;
        height: 36px;
        font-size: 17px;
      }

      .cave-chat-panel {
        width: min(390px, calc(100vw - 18px));
      }

      .cave-chat-voice-shell {
        border-radius: 20px;
        padding: 14px 12px 14px;
        gap: 12px;
      }

      .cave-chat-avatar-wrap {
        min-height: 248px;
      }

      .cave-chat-avatar-wrap img {
        max-width: 206px;
      }

      .cave-chat-btn {
        height: 56px;
        border-radius: 14px;
        font-size: clamp(24px, 6vw, 32px);
      }
    }

    @media (max-height: 820px) {
      .student-panel {
        align-items: flex-start;
      }

      .student-shell {
        width: min(940px, 95vw);
        max-height: calc(100vh - 18px);
        max-height: calc(100dvh - 18px);
        padding: 10px;
      }

      .student-title {
        font-size: clamp(22px, 4.2vw, 30px);
      }

      .student-badge {
        margin-top: 6px;
        font-size: clamp(13px, 2.2vw, 16px);
      }

      .student-preview-wrap {
        margin-top: 8px;
        width: min(100%, 500px);
        aspect-ratio: 5 / 4;
        max-height: min(38vh, 340px);
      }

      .student-prompt-wrap {
        margin-top: 8px;
      }

      .student-prompt-input {
        min-height: 52px;
        max-height: 88px;
        font-size: 16px;
      }

      .student-prompt-tools {
        margin-top: 6px;
      }

      .student-actions {
        margin-top: 8px;
        gap: 8px;
      }

      .student-btn {
        min-width: 102px;
        height: 34px;
        font-size: 16px;
      }

      .student-status {
        margin-top: 8px;
        font-size: clamp(13px, 2.4vw, 16px);
      }
    }
  
