      :root {
        --ink: #1c1a16;
        --muted: #5c554b;
        --paper: #f7f0e6;
        --card: rgba(255, 255, 255, 0.78);
        --accent: #e86f3a;
        --accent-2: #2f7d74;
        --shadow: 0 20px 40px rgba(36, 28, 14, 0.18);
        --glow: rgba(232, 111, 58, 0.2);
      }

      * {
        box-sizing: border-box;
      }

      body {
        margin: 0;
        min-height: 100vh;
        min-height: 100svh;
        font-family: "Space Grotesk", "PingFang SC", "Microsoft YaHei", sans-serif;
        color: var(--ink);
        background: radial-gradient(circle at top, #f7d9c4 0%, #f6efe5 45%, #e7f0e8 100%);
        display: flex;
        justify-content: center;
        align-items: stretch;
      }

      body::before,
      body::after {
        content: "";
        position: fixed;
        z-index: 0;
        border-radius: 50%;
        filter: blur(0px);
        opacity: 0.5;
        pointer-events: none;
      }

      body::before {
        width: 340px;
        height: 340px;
        top: -120px;
        right: -80px;
        background: radial-gradient(circle, #f4b77a 0%, rgba(244, 183, 122, 0) 70%);
        animation: drift 16s ease-in-out infinite;
      }

      body::after {
        width: 280px;
        height: 280px;
        bottom: -120px;
        left: -60px;
        background: radial-gradient(circle, #89c2b5 0%, rgba(137, 194, 181, 0) 70%);
        animation: drift 20s ease-in-out infinite reverse;
      }

      @keyframes drift {
        0% {
          transform: translateY(0) translateX(0);
        }
        50% {
          transform: translateY(12px) translateX(10px);
        }
        100% {
          transform: translateY(0) translateX(0);
        }
      }

      .app {
        position: relative;
        z-index: 1;
        width: min(980px, 100%);
        padding: 28px 28px 32px;
        display: flex;
        flex-direction: column;
        gap: 20px;
        min-height: 100vh;
        min-height: 100svh;
      }

      .topbar {
        display: flex;
        flex-wrap: wrap;
        gap: 16px;
        align-items: center;
        justify-content: space-between;
      }

      .brand {
        display: flex;
        flex-direction: column;
        gap: 4px;
      }

      .title-row {
        display: flex;
        align-items: center;
        gap: 10px;
      }

      .brand .title {
        font-family: "Fraunces", "PingFang SC", serif;
        font-size: 28px;
        letter-spacing: 0.6px;
      }

      .brand .subtitle {
        font-size: 14px;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 2px;
      }

      .day-info {
        display: flex;
        align-items: center;
        gap: 16px;
        background: rgba(255, 255, 255, 0.6);
        padding: 10px 16px;
        border-radius: 999px;
        box-shadow: 0 8px 20px rgba(32, 24, 12, 0.12);
      }

      .day-label {
        font-size: 16px;
        font-weight: 600;
      }

      .progress {
        width: 160px;
        height: 10px;
        border-radius: 999px;
        background: rgba(31, 29, 24, 0.08);
        overflow: hidden;
      }

      .progress-fill {
        height: 100%;
        width: 0%;
        background: linear-gradient(90deg, var(--accent) 0%, #f1b259 100%);
        transition: width 0.3s ease;
      }

      .stars {
        display: inline-flex;
        gap: 6px;
        font-size: 18px;
      }

      .star {
        color: #f2b933;
        text-shadow: 0 6px 14px rgba(242, 185, 51, 0.35);
      }

      .star.dim {
        color: #c9c3b8;
        text-shadow: none;
      }

      .coin-block {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 12px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.6);
        box-shadow: 0 8px 18px rgba(32, 24, 12, 0.12);
        font-size: 14px;
        font-weight: 600;
      }

      .coin-icon {
        width: 16px;
        height: 16px;
        background: url("assets/td/coin.svg") center/contain no-repeat;
        display: inline-block;
      }

      .score {
        font-size: 14px;
        font-weight: 600;
        padding: 6px 12px;
        border-radius: 999px;
        background: rgba(47, 125, 116, 0.12);
        color: var(--accent-2);
        min-width: 84px;
        text-align: center;
      }

      .audio-btn {
        border: none;
        background: #fff;
        width: 44px;
        height: 44px;
        border-radius: 14px;
        font-size: 18px;
        box-shadow: 0 10px 20px rgba(23, 18, 9, 0.12);
        opacity: 0.45;
      }

      .update-btn {
        border: none;
        background: #fff;
        padding: 10px 14px;
        border-radius: 14px;
        font-size: 14px;
        font-weight: 600;
        color: var(--ink);
        box-shadow: 0 10px 20px rgba(23, 18, 9, 0.12);
        cursor: pointer;
      }

      .back-btn {
        padding: 6px 12px;
        font-size: 12px;
        border-radius: 12px;
      }

      .stage {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 18px;
      }

      .card {
        padding: 28px;
        border-radius: 28px;
        background: var(--card);
        box-shadow: var(--shadow);
        display: flex;
        flex-direction: column;
        gap: 16px;
        animation: rise 0.7s ease;
      }

      @keyframes rise {
        from {
          transform: translateY(18px);
          opacity: 0;
        }
        to {
          transform: translateY(0);
          opacity: 1;
        }
      }

      .stage-label {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 2px;
      }

      .prompt {
        font-size: clamp(26px, 4vw, 38px);
        font-weight: 600;
      }

      .prompt.prompt-split {
        display: flex;
        flex-direction: column;
        gap: 8px;
      }

      .prompt-zh {
        font-size: clamp(24px, 3.6vw, 34px);
      }

      .prompt-en {
        font-size: clamp(20px, 3.2vw, 28px);
        letter-spacing: 1px;
      }

      .phrase-gap {
        display: inline-block;
        width: 18px;
      }

      .phrase-slash {
        display: inline-block;
        padding: 0 4px;
        color: var(--muted);
        font-weight: 600;
      }

      .hint {
        color: var(--muted);
        font-size: 16px;
      }

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

      .options.builder-mode {
        display: flex;
        flex-direction: column;
      }

      .option {
        border: none;
        border-radius: 18px;
        padding: 18px 16px;
        font-size: 18px;
        font-weight: 500;
        background: #fff;
        box-shadow: 0 12px 24px rgba(30, 23, 12, 0.12);
        transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
        cursor: pointer;
        position: relative;
        overflow: hidden;
      }

      .option:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 30px rgba(30, 23, 12, 0.18);
      }

      .option:disabled {
        cursor: default;
        opacity: 0.7;
      }

      .option.correct {
        border: 2px solid #2f7d74;
        box-shadow: 0 10px 28px rgba(47, 125, 116, 0.3);
      }

      .option.wrong {
        border: 2px solid #c6483c;
        box-shadow: 0 10px 28px rgba(198, 72, 60, 0.3);
      }

      .builder {
        display: flex;
        flex-direction: column;
        gap: 16px;
      }

      .slots {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        min-height: 56px;
        padding: 12px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.7);
        border: 1px dashed rgba(52, 41, 28, 0.2);
      }

      .slot {
        border: none;
        border-radius: 14px;
        padding: 10px 14px;
        font-size: 17px;
        font-weight: 600;
        background: #fff;
        color: var(--ink);
        box-shadow: 0 8px 16px rgba(30, 23, 12, 0.12);
      }

      .slot.empty {
        background: transparent;
        color: rgba(28, 26, 22, 0.4);
        box-shadow: none;
        border: 1px dashed rgba(52, 41, 28, 0.18);
      }

      .slot.wrong {
        border: 2px solid #c6483c;
        color: #c6483c;
        background: #fff4f2;
      }

      .spell-wrong-char {
        color: #c6483c;
        font-weight: 700;
      }

      .slot-gap {
        width: 24px;
        height: 32px;
      }

      .slot-sep {
        display: inline-flex;
        align-items: center;
        padding: 0 6px;
        color: var(--muted);
        font-weight: 700;
      }

      .tiles {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
      }

      .tile {
        border: none;
        border-radius: 14px;
        padding: 12px 16px;
        font-size: 17px;
        font-weight: 600;
        background: #fff;
        color: var(--ink);
        cursor: pointer;
        box-shadow: 0 10px 18px rgba(23, 17, 9, 0.12);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
      }

      .tile:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 24px rgba(23, 17, 9, 0.18);
      }

      .tile.used {
        opacity: 0.4;
        cursor: default;
        transform: none;
        box-shadow: none;
      }

      .fix-panel {
        display: flex;
        flex-direction: column;
        gap: 12px;
      }

      .fix-word {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        padding: 12px;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.7);
        border: 1px dashed rgba(52, 41, 28, 0.2);
      }

      .fix-letter {
        border: none;
        padding: 10px 12px;
        border-radius: 12px;
        font-size: 16px;
        font-weight: 600;
        background: #fff;
        box-shadow: 0 8px 16px rgba(30, 23, 12, 0.12);
        cursor: pointer;
      }

      .fix-letter.selected {
        border: 2px solid #c6483c;
      }

      .fix-letter.ghost {
        background: transparent;
        box-shadow: none;
        cursor: default;
      }

      .fix-options {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        justify-content: center;
      }

      .missing-display {
        letter-spacing: 6px;
        font-weight: 700;
      }

      .prompt.prompt-split.missing-display .prompt-zh {
        letter-spacing: normal;
      }

      .prompt.prompt-split.missing-display .prompt-en {
        letter-spacing: 6px;
      }

      .footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        color: var(--muted);
        margin-top: auto;
        padding-bottom: calc(env(safe-area-inset-bottom) + 8px);
      }

      .debug-toggle {
        position: fixed;
        left: 16px;
        bottom: 16px;
        z-index: 6;
        border: none;
        border-radius: 999px;
        padding: 6px 12px;
        font-size: 12px;
        background: rgba(28, 26, 22, 0.85);
        color: #fff;
        cursor: pointer;
      }

      .debug-panel {
        position: fixed;
        left: 16px;
        bottom: 56px;
        width: min(360px, 90vw);
        max-height: 40vh;
        padding: 10px;
        border-radius: 12px;
        background: rgba(18, 16, 14, 0.88);
        color: #fff;
        font-size: 12px;
        line-height: 1.4;
        box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28);
        display: none;
        overflow: hidden;
        z-index: 6;
      }

      .debug-panel.open {
        display: block;
      }

      .debug-body {
        margin: 0;
        white-space: pre-wrap;
        word-break: break-word;
        max-height: 34vh;
        overflow: auto;
      }

      .audio-gate {
        position: fixed;
        top: 14px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 7;
        background: rgba(28, 26, 22, 0.92);
        color: #fff;
        padding: 10px 14px;
        border-radius: 14px;
        display: flex;
        align-items: center;
        gap: 10px;
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
      }

      .audio-gate.hidden {
        display: none;
      }

      .audio-gate button {
        border: none;
        padding: 6px 10px;
        border-radius: 10px;
        background: #f0a44b;
        color: #1c1a16;
        font-weight: 600;
        font-size: 12px;
        cursor: pointer;
      }

      .audio-gate .ghost {
        background: transparent;
        color: #fff;
        border: 1px solid rgba(255, 255, 255, 0.4);
      }

      .status {
        font-size: 15px;
      }

      .primary {
        border: none;
        padding: 12px 22px;
        border-radius: 14px;
        background: linear-gradient(135deg, var(--accent) 0%, #f0a44b 100%);
        color: white;
        font-weight: 600;
        font-size: 15px;
        box-shadow: 0 12px 26px var(--glow);
        cursor: pointer;
      }

      .overlay {
        position: fixed;
        inset: 0;
        background: rgba(22, 20, 16, 0.38);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 24px;
        z-index: 10;
      }

      .overlay.hidden {
        display: none;
      }

      .panel {
        width: min(520px, 100%);
        background: rgba(255, 255, 255, 0.95);
        border-radius: 26px;
        padding: 28px;
        box-shadow: var(--shadow);
        display: flex;
        flex-direction: column;
        gap: 18px;
      }

      .panel-title {
        font-family: "Fraunces", "PingFang SC", serif;
        font-size: 26px;
      }

      .panel-body {
        color: var(--muted);
        line-height: 1.6;
      }

      .panel-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        align-items: center;
      }

      .panel-actions select {
        padding: 10px 12px;
        border-radius: 10px;
        border: 1px solid rgba(40, 30, 20, 0.2);
        font-size: 15px;
      }

      .ghost {
        background: transparent;
        border: 1px solid rgba(40, 30, 20, 0.2);
        color: var(--ink);
      }

      .day-grid {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 10px;
        width: 100%;
      }

      .day-button {
        border: none;
        border-radius: 12px;
        padding: 10px 0;
        font-size: 15px;
        font-weight: 600;
        background: #fff;
        box-shadow: 0 8px 16px rgba(30, 23, 12, 0.12);
        cursor: pointer;
      }

      @media (max-width: 720px) {
        .app {
          padding: 20px 18px 24px;
        }

        .topbar {
          flex-direction: column;
          align-items: flex-start;
        }

        .day-info {
          width: 100%;
          justify-content: space-between;
        }

        .options {
          grid-template-columns: 1fr;
        }

        .footer {
          flex-direction: column;
          align-items: flex-start;
        }
      }

      @media (max-width: 640px) and (orientation: portrait) {
        .app {
          padding: 16px 14px 18px;
          gap: 14px;
        }

        .topbar {
          gap: 12px;
        }

        .brand .title {
          font-size: 22px;
        }

        .brand .subtitle {
          font-size: 12px;
          letter-spacing: 1px;
        }

        .day-info {
          flex-wrap: wrap;
          gap: 8px;
        }

        .progress {
          width: 120px;
        }

        .stars {
          font-size: 16px;
        }

        .coin-block,
        .score {
          font-size: 13px;
        }

        .audio-btn {
          width: 40px;
          height: 40px;
        }

        .card {
          padding: 16px;
          border-radius: 20px;
        }

        .prompt {
          font-size: clamp(22px, 7vw, 30px);
        }

        .prompt-zh {
          font-size: clamp(20px, 6vw, 28px);
        }

        .prompt-en {
          font-size: clamp(18px, 5.6vw, 24px);
        }

        .options {
          gap: 10px;
        }

        .option {
          padding: 14px 12px;
          font-size: 16px;
        }

        .tiles {
          gap: 8px;
        }

        .tile {
          padding: 10px 12px;
          font-size: 15px;
        }

        .panel {
          padding: 20px;
          border-radius: 20px;
        }

        .panel-title {
          font-size: 22px;
        }

        .day-grid {
          grid-template-columns: repeat(5, minmax(0, 1fr));
        }
      }
