* { margin: 0; padding: 0; box-sizing: border-box; }
  body {
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh; overflow: hidden;
  }
  .screen { display: none; height: 100vh; padding: 20px; }
  .screen.active { display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .nav-controls {
    position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%);
    display: none; gap: 10px; z-index: 80;
    background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.45);
    border-radius: 999px; padding: 8px; backdrop-filter: blur(10px);
  }
  .nav-controls.show { display: flex; }
  .nav-btn {
    min-width: 92px; padding: 9px 16px; border: none; border-radius: 999px;
    background: rgba(255,255,255,0.92); color: #4b5fd5;
    font-weight: bold; font-size: 0.98em; cursor: pointer; font-family: inherit;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  }
  .nav-btn:hover { transform: translateY(-1px); }
  .student-bar {
    position: fixed; top: 12px; right: 16px; z-index: 90;
    display: none; align-items: center; gap: 8px;
    padding: 8px 10px 8px 14px; border-radius: 999px;
    background: rgba(255,255,255,0.9); color: #4b5fd5;
    box-shadow: 0 5px 18px rgba(0,0,0,0.18); font-weight: bold;
  }
  .student-bar.show { display: flex; }
  .student-info { font-size: 0.95em; white-space: nowrap; }
  .switch-btn {
    border: none; border-radius: 999px; padding: 6px 12px;
    background: #667eea; color: white; font-family: inherit;
    font-weight: bold; cursor: pointer;
  }

  /* Login */
  #login { color: white; text-align: center; }
  #login h1 { font-size: 2.6em; margin-bottom: 22px; text-shadow: 3px 3px 6px rgba(0,0,0,0.25); }
  .login-panel {
    width: 100%; max-width: 560px; padding: 24px;
    background: rgba(255,255,255,0.94); color: #333;
    border-radius: 18px; box-shadow: 0 10px 30px rgba(0,0,0,0.24);
  }
  .login-panel h2 { color: #4b5fd5; margin-bottom: 14px; }
  .saved-players {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px; margin-bottom: 16px;
  }
  .player-card {
    min-height: 72px; border: 2px solid #cbd5ff; border-radius: 12px;
    background: #f6f8ff; color: #4b5fd5; font-family: inherit;
    font-weight: bold; cursor: pointer; font-size: 1.05em;
  }
  .player-card small { display: block; margin-top: 4px; color: #777; font-size: 0.78em; }
  .empty-players { color: #666; font-weight: bold; margin-bottom: 14px; }
  .login-input-row { display: flex; gap: 10px; justify-content: center; }
  .login-input-row input {
    width: min(260px, 60vw); padding: 14px 16px; border: 3px solid #667eea;
    border-radius: 14px; font-size: 1.15em; font-family: inherit; outline: none;
  }
  .login-input-row button {
    border: none; border-radius: 14px; padding: 0 22px;
    background: linear-gradient(135deg, #667eea, #764ba2); color: white;
    font-family: inherit; font-size: 1.1em; font-weight: bold; cursor: pointer;
  }
  .login-error { min-height: 24px; margin-top: 10px; color: #c62828; font-weight: bold; }
  .version-tag { margin-top: 12px; font-size: 0.75em; color: #aaa; }

  /* Home */
  #home { color: white; text-align: center; overflow-y: auto; }
  #home h1 { font-size: 2.6em; margin-bottom: 10px; text-shadow: 3px 3px 6px rgba(0,0,0,0.25); }
  .home-subtitle { font-size: 1.15em; opacity: 0.9; margin-bottom: 24px; }
  .topic-grid {
    width: 100%; max-width: 780px; display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px;
  }
  .topic-card {
    min-height: 210px; padding: 20px 16px; border: 2px solid rgba(255,255,255,0.55);
    border-radius: 16px; background: rgba(255,255,255,0.92); color: #333;
    cursor: pointer; font-family: inherit; text-align: center;
    box-shadow: 0 8px 26px rgba(0,0,0,0.22); transition: all 0.25s;
  }
  .topic-card:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 12px 32px rgba(0,0,0,0.3); }
  .topic-card.locked { cursor: default; opacity: 0.72; filter: grayscale(0.25); }
  .topic-card.locked:hover { transform: none; }
  .topic-icon { font-size: 3.4em; line-height: 1; margin-bottom: 14px; }
  .topic-name { font-size: 1.45em; font-weight: bold; color: #4b5fd5; margin-bottom: 8px; }
  .topic-desc { font-size: 0.95em; line-height: 1.6; color: #555; }
  .topic-status {
    display: inline-block; margin-top: 14px; padding: 5px 12px; border-radius: 999px;
    background: #e8f5e9; color: #2e7d32; font-size: 0.9em; font-weight: bold;
  }
  .topic-card.locked .topic-status { background: #f0f0f0; color: #777; }
  .topic-toast {
    min-height: 28px; margin-top: 18px; padding: 6px 14px;
    color: rgba(255,255,255,0.95); font-weight: bold;
  }


    .ten-card-num { font-size: 1.5em; }
    .ten-card-dots { font-size: 0.38em; }
    .ten-board { padding: 8px; gap: 6px; flex: 0 0 auto; }
    .ten-target-bar { padding: 8px 12px; }
    .ten-game-area { gap: 6px; }
    .shape-icons { font-size: 3em; gap: 20px; }
    .area-stage { padding: 10px 12px; }
    .area-answer { padding: 12px 14px; }
    .area-story { font-size: 0.9em; }
    .formula-slot { font-size: 1.1em; min-width: 38px; min-height: 38px; padding: 5px 8px; }
    .tool-chip { min-height: 40px; font-size: 1em; }
    .choice-grid { grid-template-columns: 1fr; }
    .shape-svg { width: 220px; }
    #rdWelcome h1 { font-size: 2em; }
    .rd-scene { font-size: 2.6em; }
    .rd-qtext { font-size: 1.1em; }
    .rd-houses { gap: 8px; }
    .rd-house { padding: 10px 4px; }
    .rd-house-roof { font-size: 1.5em; }
    .rd-level-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 320px; }
    #welcome h1 { font-size: 2em; }
    .story-text { font-size: 0.88em; padding: 8px 10px; }
    .road-container { padding: 10px 14px; }
    .steps-container { padding: 12px 14px; }
    .mission-board { grid-template-columns: 1fr; }
    .mission-visual { min-height: 104px; }
    .chip-grid { grid-template-columns: 1fr; }
    .mission-chip { min-height: 52px; }
    .info-cards { gap: 4px; } .info-card { font-size: 0.75em; padding: 4px 8px; }
    .formula-row input[type="number"] { width: 65px; font-size: 1em; padding: 6px 2px; }
    .op-btn { width: 36px; height: 36px; font-size: 1.1em; }
    .student-bar { top: 8px; right: 8px; padding: 6px 8px 6px 10px; }
    .student-info { font-size: 0.82em; }
    .switch-btn { padding: 5px 9px; font-size: 0.82em; }
    .login-panel { padding: 18px; }
    .login-input-row { flex-direction: column; }
    .login-input-row input, .login-input-row button { width: 100%; min-height: 52px; }
  }
  @media (max-width: 380px) {
    .ten-card-num { font-size: 1.3em; }
    .ten-board { gap: 5px; padding: 6px; }
    .ten-target { font-size: 1em; }
    .ten-hud { font-size: 0.82em; padding: 4px 8px; }
    .ten-fill-box { padding: 20px 16px; min-width: 220px; }
    .ten-fill-input { width: 100px; font-size: 1.3em; padding: 10px 12px; }
  }
  @media (min-width: 768px) {
    .ten-game-area { max-width: 680px; }
    .ten-card-num { font-size: 2.2em; }
    .ten-board { gap: 12px; padding: 18px; align-content: start; }
    .ten-target-bar { padding: 14px 20px; }
    .ten-hud { padding: 8px 18px; font-size: 1em; }
  }
  @media (max-height: 700px) {
    .ten-board { padding: 8px; gap: 5px; }
    .ten-target-bar { padding: 6px 10px; }
    .ten-hud { padding: 4px 10px; font-size: 0.85em; }
    .road { height: 65px; }
    .story-text { font-size: 0.85em; line-height: 1.5; padding: 8px 10px; margin-bottom: 6px; }
    .road-container { padding: 10px 14px; margin-bottom: 6px; }
    .info-card { font-size: 0.75em; padding: 3px 8px; }
  }
  @media (max-height: 420px) and (orientation: landscape) {
    .top-bar { margin-bottom: 4px; }
    .ten-target-bar { padding: 4px 10px; }
    .ten-board { padding: 6px; gap: 4px; }
    .ten-hud { padding: 3px 8px; font-size: 0.8em; }
    .ten-feedback { min-height: 20px; font-size: 0.9em; padding: 2px 10px; }
    .ten-game-area { gap: 3px; }
  }
