    :root {
      color-scheme: only light;
      forced-color-adjust: none;
      --cream: #FBF4E8;
      --cream-soft: #FFFDF8;
      --oat: #F2E3C9;
      --oat-border: #D6BA8A;
      --oat-muted: #E6D5B8;
      --cocoa: #4A3525;
      --cocoa-deep: #362417;
      --cocoa-light: #6B4E38;
      --brown: #4A3525;
      --chestnut: #7A5C43;
      --nav-border: #A6835E;
      --gold-border: #E8B968;
      --gold-bright: #FFD98A;
      --caramel: #E89642;
      --caramel-dark: #C26E1F;
      --olive: #7D944B;
      --olive-dark: #5C6F34;
      --red: #D95B43;
      --red-dark: #9E3825;
      --shadow-hard: 0 3px 0 #4A3525;
      --shadow-soft: 0 10px 26px rgba(54, 36, 23, 0.28);
      --radius-lg: 18px;
      --radius-md: 13px;
      --radius-pill: 999px;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-tap-highlight-color: transparent;
      user-select: none;
      -webkit-user-select: none;
    }

    html, body {
      width: 100%;
      height: 100%;
      overflow: hidden;
      font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Nunito", -apple-system, BlinkMacSystemFont, sans-serif;
      color: var(--cocoa);
      background: radial-gradient(circle at 30% 20%, #F5E6CE 0%, #DFC6A4 55%, #C8A984 100%);
      display: flex;
      align-items: center;
      justify-content: center;
    }

    /* 桌面端 410x820 手机微缩框，移动端全屏 */
    #phone-frame {
      position: relative;
      width: 410px;
      height: 820px;
      max-height: 96vh;
      border-radius: 34px;
      overflow: hidden;
      background: #E9BE82;
      border: 6px solid #3B281B;
      box-shadow:
        0 24px 60px rgba(59, 40, 27, 0.38),
        0 0 0 2px #7B5A40 inset;
      touch-action: none;
    }

    /* 首屏静态预幕布：在 JS 加载完封面之前 0ms 遮住游戏 HUD，杜绝先闪主界面 */
    #boot-curtain {
      position: absolute;
      inset: 0;
      z-index: 119;
      background: radial-gradient(circle at 50% 38%, #FFFDF9 0%, #FAF1E2 56%, #F2E4CE 100%);
      display: flex;
      align-items: center;
      justify-content: center;
      pointer-events: auto;
    }
    html.theme-dark #boot-curtain,
    body.theme-dark #boot-curtain {
      background: radial-gradient(circle at 50% 38%, #3A2A1F 0%, #2A1E16 56%, #1D140E 100%);
    }
    .boot-curtain-tip {
      font-size: 13px;
      font-weight: 800;
      letter-spacing: 0.14em;
      color: #7A5C43;
      opacity: 0.85;
    }
    html.theme-dark .boot-curtain-tip,
    body.theme-dark .boot-curtain-tip {
      color: #C8AE90;
    }

    /* 移动端与 iPad / 平板全屏自适应铺满（保留桌面鼠标端 410x820 微缩展示框） */
    @media (max-width: 520px), (pointer: coarse), (hover: none) and (max-width: 1366px) {
      body {
        background: #E9BE82;
      }
      body.theme-dark {
        background: #231A26;
      }
      #phone-frame {
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
        box-shadow: none;
      }
      #top-hud {
        top: calc(10px + env(safe-area-inset-top, 0px));
        left: calc(10px + env(safe-area-inset-left, 0px));
        right: calc(10px + env(safe-area-inset-right, 0px));
      }
      #bottom-nav {
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
      }
      #btn-immersive-exit {
        top: calc(14px + env(safe-area-inset-top, 0px));
        right: calc(14px + env(safe-area-inset-right, 0px));
      }
    }

    /* iPadOS 桌面模式 / 外接键鼠兜底全屏（由 JS 识别并挂上 device-tablet 类） */
    body.device-tablet {
      background: #E9BE82;
    }
    body.device-tablet.theme-dark {
      background: #231A26;
    }
    body.device-tablet #phone-frame {
      width: 100vw;
      height: 100dvh;
      max-height: 100dvh;
      border-radius: 0;
      border: none;
      box-shadow: none;
    }

    /* iPad / 平板宽屏 HUD 居中与 3 列建造网格优化（画布全屏铺满，悬浮栏不拉扁） */
    @media (min-width: 600px) and (pointer: coarse), (min-width: 600px) and (hover: none) and (max-width: 1366px) {
      #top-hud {
        top: calc(14px + env(safe-area-inset-top, 0px));
        left: calc(18px + env(safe-area-inset-left, 0px));
        right: calc(18px + env(safe-area-inset-right, 0px));
      }
      #happy-warning {
        width: 100%;
        max-width: 460px;
        align-self: center;
      }
      #build-banner {
        left: 0;
        right: 0;
        margin: 0 auto;
        width: min(500px, calc(100% - 36px));
      }
      #bottom-nav {
        left: 0;
        right: 0;
        margin: 0 auto;
        width: min(460px, calc(100% - 32px));
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
      }
      #edit-bar {
        left: 0;
        right: 0;
        margin: 0 auto;
        width: min(460px, calc(100% - 32px));
        bottom: calc(92px + env(safe-area-inset-bottom, 0px));
      }
      #drawer-panel {
        left: 0;
        right: 0;
        margin: 0 auto;
        width: min(560px, calc(100% - 32px));
        max-height: 58%;
        bottom: calc(92px + env(safe-area-inset-bottom, 0px));
      }
      #drawer-panel .card-grid {
        grid-template-columns: repeat(3, 1fr);
      }
      #drawer-panel .item-card.landmark-card {
        grid-column: span 3;
      }
    }
    body.device-tablet #top-hud {
      top: calc(14px + env(safe-area-inset-top, 0px));
      left: calc(18px + env(safe-area-inset-left, 0px));
      right: calc(18px + env(safe-area-inset-right, 0px));
    }
    body.device-tablet #happy-warning {
      width: 100%;
      max-width: 460px;
      align-self: center;
    }
    body.device-tablet #build-banner {
      left: 0;
      right: 0;
      margin: 0 auto;
      width: min(500px, calc(100% - 36px));
    }
    body.device-tablet #bottom-nav {
      left: 0;
      right: 0;
      margin: 0 auto;
      width: min(460px, calc(100% - 32px));
      bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }
    body.device-tablet #edit-bar {
      left: 0;
      right: 0;
      margin: 0 auto;
      width: min(460px, calc(100% - 32px));
      bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    }
    body.device-tablet #drawer-panel {
      left: 0;
      right: 0;
      margin: 0 auto;
      width: min(560px, calc(100% - 32px));
      max-height: 58%;
      bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    }
    body.device-tablet #drawer-panel .card-grid {
      grid-template-columns: repeat(3, 1fr);
    }
    body.device-tablet #drawer-panel .item-card.landmark-card {
      grid-column: span 3;
    }

    /* 合成自动入仓 / 旧版规格修复提示弹窗 */
    .mw-card {
      max-width: 316px;
      text-align: center;
      padding: 20px 18px 16px;
    }
    .mw-icon-tray {
      width: 60px;
      height: 60px;
      margin: 0 auto 10px;
      border-radius: 18px;
      background: var(--oat);
      border: 1.5px solid var(--oat-border);
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .mw-title {
      font-size: 16.5px;
      font-weight: 900;
      color: var(--cocoa);
      margin-bottom: 4px;
    }
    .mw-sub {
      font-size: 11.5px;
      font-weight: 800;
      color: var(--caramel-dark);
      margin-bottom: 10px;
    }
    .mw-list {
      display: flex;
      flex-direction: column;
      gap: 6px;
      max-height: 150px;
      overflow-y: auto;
      margin-bottom: 10px;
      text-align: left;
    }
    .mw-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 7px 9px;
      border-radius: 12px;
      background: var(--oat);
      border: 1.5px solid var(--oat-border);
    }
    .mw-item-name {
      flex: 1;
      min-width: 0;
      font-size: 12.5px;
      font-weight: 900;
      color: var(--cocoa);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .mw-desc {
      font-size: 12.5px;
      line-height: 1.58;
      font-weight: 700;
      color: var(--chestnut);
      text-align: left;
      background: var(--oat);
      border: 1.5px solid var(--oat-border);
      border-radius: 13px;
      padding: 10px 12px;
      margin-bottom: 14px;
    }
    .mw-actions {
      display: grid;
      grid-template-columns: 1fr 1.35fr;
      gap: 8px;
    }
    .mw-actions .warm-btn {
      padding: 10px 10px;
      font-size: 13px;
      border-radius: 13px;
    }

    /* 暖阳存档口令导出 / 导入弹窗 */
    .stf-card {
      max-width: 344px;
      padding: 16px;
    }
    .stf-tip {
      font-size: 12px;
      line-height: 1.55;
      font-weight: 700;
      color: var(--chestnut);
      background: var(--oat);
      border: 1.5px solid var(--oat-border);
      border-radius: 13px;
      padding: 9px 11px;
      margin-bottom: 10px;
    }
    .stf-textarea {
      width: 100%;
      min-height: 108px;
      max-height: 180px;
      resize: none;
      padding: 10px 11px;
      border-radius: 13px;
      border: 2px solid var(--oat-border);
      background: var(--cream-soft);
      color: var(--cocoa);
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-size: 11.5px;
      line-height: 1.48;
      font-weight: 700;
      word-break: break-all;
      outline: none;
      user-select: text !important;
      -webkit-user-select: text !important;
      touch-action: auto;
    }
    .stf-textarea:focus {
      border-color: var(--caramel);
    }
    .stf-meta-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin: 6px 2px 12px;
      font-size: 11px;
      font-weight: 800;
      color: var(--chestnut);
    }
    .stf-error {
      display: none;
      margin: 8px 0 10px;
      padding: 8px 10px;
      border-radius: 11px;
      background: #FDECE6;
      border: 1.5px solid #E39582;
      color: #A63A24;
      font-size: 11.5px;
      font-weight: 800;
      line-height: 1.45;
    }
    .stf-error.show {
      display: block;
    }
    body.theme-dark .stf-error {
      background: #462620;
      border-color: #A35545;
      color: #FFB4A2;
    }
    .stf-preview {
      display: none;
      margin: 10px 0 12px;
      padding: 10px 11px;
      border-radius: 14px;
      background: var(--oat);
      border: 1.5px solid var(--caramel);
    }
    .stf-preview.show {
      display: block;
      animation: popIn 0.2s ease;
    }
    .stf-preview-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 8px;
      font-size: 13px;
      font-weight: 900;
      color: var(--cocoa);
    }
    .stf-btn-row {
      display: grid;
      grid-template-columns: 1fr 1.35fr;
      gap: 8px;
    }
    .stf-btn-row .warm-btn {
      padding: 10px 12px;
      font-size: 13px;
      border-radius: 13px;
    }

    /* Three.js 画布与屏幕空间气泡层 */
    #canvas-container {
      position: absolute;
      inset: 0;
      z-index: 1;
      cursor: grab;
    }
    #canvas-container:active {
      cursor: grabbing;
    }
    #canvas-container canvas {
      display: block;
      width: 100% !important;
      height: 100% !important;
      filter: saturate(1.16) contrast(1.02) sepia(0.08) brightness(0.95);
      transition: filter 0.35s ease;
    }
    body.theme-dark #canvas-container canvas {
      filter: saturate(1.12) contrast(1.06) brightness(0.92);
    }
    /* iOS / 移动端禁用 WebGL 画布 CSS 离屏滤镜，彻底避免双指缩放触发 GPU 崩溃 */
    @media (pointer: coarse) {
      #canvas-container canvas,
      body.theme-dark #canvas-container canvas {
        filter: none !important;
        transition: none !important;
      }
    }

    #bubble-layer {
      position: absolute;
      inset: 0;
      z-index: 8;
      pointer-events: none;
      overflow: hidden;
      transform: translateZ(0);
      -webkit-transform: translateZ(0);
      transition: opacity 0.32s ease;
    }

    /* 商铺收币气泡与市民聊天气泡（由 JS 统一驱动 translate3d 坐标与浮动，杜绝 CSS 动画层切换闪动） */
    .world-bubble {
      position: absolute;
      left: 0;
      top: 0;
      pointer-events: auto;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 5px 10px;
      border-radius: var(--radius-pill);
      background-color: var(--cream);
      border: 2px solid var(--cocoa);
      box-shadow: 0 3px 0 var(--cocoa), 0 6px 12px rgba(74, 53, 37, 0.25);
      font-size: 12px;
      font-weight: 800;
      color: var(--cocoa);
      white-space: nowrap;
      forced-color-adjust: none;
      isolation: isolate;
      backface-visibility: hidden;
      -webkit-backface-visibility: hidden;
      will-change: transform;
    }
    .world-bubble::after {
      content: "";
      position: absolute;
      left: 50%;
      bottom: -7px;
      transform: translateX(-50%);
      border-left: 6px solid transparent;
      border-right: 6px solid transparent;
      border-top: 7px solid var(--cocoa);
    }
    .world-bubble:active {
      transform: translate3d(calc(var(--bx) - 50%), calc(var(--by) - 95%), 0) scale(0.9);
    }
    .world-bubble.coin-bubble {
      background-color: #F0AC42;
      background-image: linear-gradient(180deg, #F8C456 0%, #E89638 100%);
      color: #3B2414;
      border-color: #4A3525;
    }
    .world-bubble.chat-bubble {
      background-color: #F4E4C8;
      background-image: linear-gradient(180deg, #FBF2E1 0%, #EED9B7 100%);
      padding: 6px 11px;
      font-size: 14px;
    }

    /* 飘字奖励与市民情绪反馈 */
    .float-text {
      position: absolute;
      transform: translate(-50%, -50%);
      pointer-events: none;
      font-size: 13px;
      font-weight: 900;
      color: #FFFDF8;
      text-shadow:
        -1.5px -1.5px 0 var(--cocoa),
         1.5px -1.5px 0 var(--cocoa),
        -1.5px  1.5px 0 var(--cocoa),
         1.5px  1.5px 0 var(--cocoa),
         0 3px 4px rgba(54, 36, 23, 0.38);
      white-space: nowrap;
      animation: floatUpFade 1.25s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
      z-index: 12;
    }

    /* 顶部 HUD 区域（深烘焙可可棕 + 暖金边框） */
    #top-hud {
      position: absolute;
      top: 10px;
      left: 10px;
      right: 10px;
      z-index: 20;
      display: flex;
      flex-direction: column;
      gap: 7px;
      pointer-events: none;
      transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.30s ease;
    }

    .hud-row {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 6px;
    }

    /* 左上角城镇头像与等级经验卡 */
    #town-card {
      pointer-events: auto;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 5px 8px 5px 6px;
      background: rgba(74, 53, 37, 0.96);
      border: 2px solid var(--gold-border);
      border-radius: 16px;
      box-shadow: 0 3px 0 var(--cocoa-deep), var(--shadow-soft);
      transition: transform 0.12s ease;
      width: 152px;
      min-width: 146px;
      flex-shrink: 0;
    }
    #town-card:active {
      transform: translateY(2px) scale(0.97);
      box-shadow: 0 1px 0 var(--cocoa-deep);
    }

    .voxel-avatar {
      width: 38px;
      height: 38px;
      border-radius: 11px;
      background: linear-gradient(145deg, #FFD692 0%, #E89642 100%);
      border: 2px solid var(--gold-bright);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      position: relative;
      overflow: hidden;
    }
    .voxel-face {
      width: 22px;
      height: 22px;
      background: #FFE0B8;
      border: 2px solid var(--cocoa);
      border-radius: 5px;
      position: relative;
    }
    .voxel-face::before {
      content: "";
      position: absolute;
      top: -4px;
      left: -2px;
      right: -2px;
      height: 8px;
      background: #6B442A;
      border-bottom: 2px solid var(--cocoa);
    }
    .voxel-eyes {
      position: absolute;
      top: 8px;
      left: 3px;
      right: 3px;
      display: flex;
      justify-content: space-between;
    }
    .voxel-eyes i {
      width: 3px;
      height: 3px;
      border-radius: 50%;
      background: var(--cocoa);
      display: block;
    }
    .voxel-smile {
      position: absolute;
      bottom: 3px;
      left: 50%;
      transform: translateX(-50%);
      width: 6px;
      height: 3px;
      border-bottom: 2px solid #B5543A;
      border-radius: 0 0 4px 4px;
    }

    .town-meta {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }
    .town-top-line {
      display: flex;
      align-items: center;
      gap: 4px;
      min-width: 0;
    }
    .lvl-badge {
      background: linear-gradient(180deg, #F6AE58 0%, #E89642 100%);
      color: #FFFDF8;
      font-size: 10px;
      font-weight: 900;
      padding: 1px 5px;
      border-radius: 6px;
      border: 1.5px solid var(--gold-bright);
      flex-shrink: 0;
      text-shadow: 0 1px 0 rgba(54, 36, 23, 0.45);
    }
    #hud-title {
      font-size: 11px;
      font-weight: 800;
      color: var(--cream);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .xp-track {
      width: 100%;
      height: 8px;
      background: var(--cocoa-deep);
      border: 1.5px solid var(--gold-border);
      border-radius: 99px;
      overflow: hidden;
    }
    #hud-xp-bar {
      width: 20%;
      height: 100%;
      background: linear-gradient(90deg, #FFD36B, #E89642);
      transition: width 0.35s ease;
    }
    #town-card.can-promote {
      border-color: #FFE28A;
      box-shadow: 0 3px 0 var(--cocoa-deep), 0 0 0 2px rgba(255, 217, 138, 0.35), var(--shadow-soft);
    }
    .fame-mini {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 1px;
      font-size: 9.5px;
      line-height: 1.2;
      font-weight: 800;
      color: #F2DFC1;
      min-width: 0;
    }
    #hud-xp-text {
      white-space: nowrap;
      overflow: visible;
      color: #FFF6E3;
      letter-spacing: 0.1px;
    }
    #hud-fame {
      flex-shrink: 0;
      color: var(--gold-bright);
      white-space: nowrap;
    }

    /* 右上角金币与建材胶囊栏（深烘焙可可棕 + 暖金边框） */
    .res-stack {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 5px;
      pointer-events: auto;
      flex-shrink: 0;
    }
    .list-row:not([style*="#FBF4E8"]) .vui-badge {
      background: var(--cream);
      border-color: var(--oat-border);
      box-shadow: 0 1px 0 #C7A876;
    }
    .res-group {
      display: flex;
      align-items: center;
      gap: 5px;
    }
    .res-pill {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 4px 8px;
      background: rgba(74, 53, 37, 0.96);
      border: 2px solid var(--gold-border);
      border-radius: var(--radius-pill);
      box-shadow: 0 2px 0 var(--cocoa-deep), 0 4px 10px rgba(54, 36, 23, 0.24);
      font-size: 12px;
      font-weight: 900;
      color: var(--cream);
      line-height: 1;
      white-space: nowrap;
    }
    .res-pill.ore-pill {
      padding: 3px 7px;
      gap: 6px;
      font-size: 11px;
    }
    .ore-item {
      display: inline-flex;
      align-items: center;
      gap: 2px;
      color: #F6E6CC;
    }
    .ore-dot {
      width: 9px;
      height: 9px;
      border-radius: 3px;
      border: 1.5px solid var(--cream);
      display: inline-block;
    }
    .ore-red { background: #E35D4B; }
    .ore-blue { background: #5B9BD5; }
    .ore-green { background: #6AB85B; }
    .ore-yellow { background: #F5C242; }
    .hud-icon-slot {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .hud-icon-slot .vui-svg {
      vertical-align: middle;
    }

    /* 第二排：人口、产速与幸福指数胶囊 */
    .status-strip {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      pointer-events: auto;
    }
    .stat-pill {
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 4px 9px;
      background: rgba(74, 53, 37, 0.95);
      border: 2px solid var(--gold-border);
      border-radius: var(--radius-pill);
      box-shadow: 0 2px 0 var(--cocoa-deep);
      font-size: 11px;
      font-weight: 800;
      color: var(--cream);
      transition: transform 0.12s ease, background 0.2s ease;
      white-space: nowrap;
    }
    .stat-pill:active {
      transform: translateY(1px) scale(0.97);
    }
    .rate-tag {
      background: rgba(255, 217, 138, 0.18);
      color: var(--gold-bright);
      padding: 1px 6px;
      border-radius: 6px;
      font-size: 10px;
      font-weight: 900;
    }
    .stat-pill.happy-high {
      background: rgba(79, 98, 47, 0.96);
      border-color: #C7D98C;
    }
    .stat-pill.happy-low {
      background: rgba(132, 48, 32, 0.96);
      border-color: #FFB299;
      animation: warnPulse 1.5s ease-in-out infinite;
    }
    .happy-tag {
      font-size: 10px;
      font-weight: 900;
      padding: 1px 6px;
      border-radius: 6px;
      background: rgba(255, 244, 224, 0.16);
      color: var(--gold-bright);
    }
    .stat-pill.happy-high .happy-tag {
      background: var(--olive);
      color: #FFFDF8;
    }
    .stat-pill.happy-low .happy-tag {
      background: var(--red);
      color: #FFFDF8;
    }

    /* 低幸福度暖色柔和轻语条（Lv.3 起启用，可一键收起） */
    #happy-warning {
      display: none;
      pointer-events: auto;
      cursor: pointer;
      padding: 7px 9px;
      background: linear-gradient(180deg, #FFFDF8 0%, #F4E6CE 100%);
      border: 2px solid #C9975B;
      border-radius: 15px;
      box-shadow: 0 3px 0 #B38147, 0 6px 14px rgba(74, 53, 37, 0.16);
      color: var(--cocoa);
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    #happy-warning.show {
      display: flex;
      animation: popIn 0.25s ease;
    }
    .hw-icon-tray {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      background: #FBF4E8;
      border: 1.5px solid #DFC397;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .hw-main {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .hw-top {
      display: flex;
      align-items: center;
      gap: 5px;
      flex-wrap: wrap;
    }
    .hw-title {
      font-size: 12px;
      font-weight: 900;
      color: var(--cocoa);
      line-height: 1.2;
    }
    .hw-rate-pill {
      display: inline-flex;
      align-items: center;
      gap: 2px;
      padding: 1px 6px;
      border-radius: 99px;
      background: #E89642;
      color: #FFFDF8;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-size: 10px;
      font-weight: 900;
      line-height: 1.25;
      white-space: nowrap;
    }
    .hw-sub {
      font-size: 10.5px;
      font-weight: 700;
      color: var(--chestnut);
      line-height: 1.25;
    }
    .hw-actions {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      flex-shrink: 0;
    }
    .hw-cta {
      white-space: nowrap;
      padding: 5px 9px;
      border-radius: 99px;
      background: linear-gradient(180deg, #F4AE5A 0%, #E89642 100%);
      border: 1.5px solid var(--cocoa);
      box-shadow: 0 2px 0 var(--cocoa);
      color: #FFFDF8;
      font-size: 11px;
      font-weight: 900;
      line-height: 1;
    }
    .hw-close {
      width: 22px;
      height: 22px;
      border-radius: 50%;
      border: 1.5px solid #C9A97C;
      background: #FBF4E8;
      color: var(--chestnut);
      font-size: 11px;
      font-weight: 900;
      line-height: 1;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      transition: background 0.15s ease, transform 0.1s ease;
    }
    .hw-close:active {
      transform: scale(0.9);
      background: #EAD8BC;
    }

    /* 建造预览顶部提示条（奶油米白面板 + 深可可棕粗描边） */
    #build-banner {
      display: none;
      position: absolute;
      top: 116px;
      left: 12px;
      right: 12px;
      z-index: 24;
      background: var(--cream);
      border: 3px solid var(--cocoa);
      border-radius: 16px;
      box-shadow: var(--shadow-hard), var(--shadow-soft);
      padding: 9px 11px;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    #build-banner.show {
      display: flex;
      animation: popIn 0.2s ease;
    }
    .bb-info {
      min-width: 0;
      flex: 1;
    }
    #build-banner-name {
      font-size: 13px;
      font-weight: 900;
      color: var(--cocoa);
    }
    #build-banner-hint {
      font-size: 11px;
      font-weight: 700;
      color: var(--chestnut);
      margin-top: 2px;
    }
    #build-banner-hint.error {
      color: var(--red-dark);
    }
    .bb-actions {
      display: flex;
      align-items: center;
      gap: 5px;
      flex-shrink: 0;
    }

    /* 通用暖色按钮（实色兜底 + 禁用 iOS 原生外观，彻底根治 Safari 暗黑模式按钮偶发变白） */
    .warm-btn {
      -webkit-appearance: none;
      appearance: none;
      forced-color-adjust: none;
      cursor: pointer;
      border: 2px solid var(--cocoa);
      border-radius: 11px;
      padding: 6px 10px;
      font-size: 12px;
      font-weight: 900;
      color: var(--cocoa);
      background-color: var(--oat);
      box-shadow: 0 2px 0 var(--cocoa);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.15s ease;
      white-space: nowrap;
    }
    .warm-btn:active {
      transform: translateY(2px);
      box-shadow: 0 0 0 var(--cocoa);
    }
    .warm-btn.primary {
      background-color: #E89642;
      background-image: linear-gradient(180deg, #F4A950 0%, #E89642 100%);
      color: #FFFDF8;
      border-color: var(--cocoa);
      text-shadow: 0 1px 0 rgba(74, 53, 37, 0.35);
    }
    .warm-btn.success,
    .warm-btn.olive {
      background-color: #7D944B;
      background-image: linear-gradient(180deg, #91A85B 0%, #7D944B 100%);
      color: #FFFDF8;
      border-color: var(--cocoa);
      text-shadow: 0 1px 0 rgba(54, 66, 26, 0.35);
    }
    .warm-btn.danger {
      background-color: #D95B43;
      background-image: linear-gradient(180deg, #E6715B 0%, #D95B43 100%);
      color: #FFFDF8;
      border-color: var(--cocoa);
    }
    .warm-btn.claimed,
    .warm-btn.pending,
    .warm-btn:disabled {
      background: var(--oat-muted);
      border-color: var(--oat-border);
      color: var(--chestnut);
      box-shadow: none;
      cursor: not-allowed;
      transform: none;
      opacity: 1;
    }

    /* 中央轻提示 Toast（自适应换行防左右溢出 + 游戏化奖励横幅卡片） */
    #toast-box {
      position: absolute;
      top: 162px;
      left: 50%;
      transform: translateX(-50%) translateY(-8px) scale(0.94);
      z-index: 40;
      pointer-events: none;
      opacity: 0;
      max-width: calc(100% - 28px);
      width: max-content;
      padding: 8px 15px;
      border-radius: 18px;
      background: rgba(74, 53, 37, 0.96);
      border: 2px solid var(--gold-border);
      color: #FFFDF8;
      font-size: 12px;
      font-weight: 800;
      line-height: 1.42;
      text-align: center;
      white-space: normal;
      word-break: break-word;
      box-shadow: 0 4px 0 var(--cocoa-deep), 0 10px 24px rgba(54, 36, 23, 0.36);
      transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22, 1.25, 0.36, 1);
    }
    #toast-box.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0) scale(1);
    }
    #toast-box.reward-toast {
      min-width: 220px;
      max-width: calc(100% - 26px);
      padding: 10px 14px 11px;
      border-radius: 18px;
      background: linear-gradient(180deg, rgba(84, 59, 40, 0.98) 0%, rgba(62, 42, 28, 0.98) 100%);
      border: 2.5px solid #F2BE63;
    }
    .tr-head {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      font-size: 13px;
      font-weight: 900;
      color: #FFE49E;
      line-height: 1.3;
    }
    .tr-sub {
      margin-top: 3px;
      font-size: 11px;
      font-weight: 800;
      color: #F6E6CE;
      line-height: 1.35;
    }
    .tr-pills {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
      gap: 6px;
      margin-top: 8px;
    }
    .tr-pill {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px 9px 3px 6px;
      border-radius: 999px;
      background: rgba(251, 244, 232, 0.14);
      border: 1.5px solid rgba(255, 217, 138, 0.65);
      color: #FFFDF8;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-size: 12px;
      font-weight: 900;
      line-height: 1.1;
      box-shadow: 0 2px 0 rgba(36, 22, 13, 0.45);
    }

    /* 通用 Toast 防孤字换行 + 市民/游客轻对话卡片样式 */
    #toast-box {
      text-wrap: balance;
    }
    #toast-box.dialogue-toast {
      width: min(332px, calc(100% - 28px));
      max-width: calc(100% - 28px);
      padding: 9px 12px;
      border-radius: 18px;
      background: linear-gradient(180deg, var(--cream-soft) 0%, var(--cream) 100%);
      border: 2.5px solid var(--cocoa);
      color: var(--cocoa);
      text-align: left;
      box-shadow: 0 4px 0 var(--cocoa), 0 10px 24px rgba(54, 36, 23, 0.28);
    }
    body.theme-dark #toast-box.dialogue-toast {
      border-color: var(--gold-border);
      box-shadow: 0 4px 0 #140D09, 0 12px 26px rgba(0, 0, 0, 0.52);
    }
    .dt-wrap {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .dt-avatar {
      width: 38px;
      height: 38px;
      border-radius: 12px;
      background: var(--oat);
      border: 1.5px solid var(--oat-border);
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .dt-body {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }
    .dt-name-row {
      display: flex;
      align-items: center;
      gap: 5px;
    }
    .dt-tag {
      font-size: 9.5px;
      font-weight: 900;
      padding: 1px 6px;
      border-radius: 999px;
      background: var(--caramel);
      color: #FFFDF8;
      line-height: 1.3;
      flex-shrink: 0;
    }
    .dt-name {
      font-size: 11.5px;
      font-weight: 900;
      color: var(--chestnut);
      line-height: 1.2;
    }
    .dt-quote {
      font-size: 12.5px;
      font-weight: 800;
      line-height: 1.42;
      color: var(--cocoa);
      text-wrap: balance;
    }

    /* 史诗级资源飞入右上角动效 + 目标卡片微放大 + 数字放大回弹 */
    .fly-res-orb {
      position: fixed;
      left: 0;
      top: 0;
      z-index: 10005;
      pointer-events: none;
      width: 28px;
      height: 28px;
      margin-left: -14px;
      margin-top: -14px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(255, 238, 178, 0.96) 0%, rgba(232, 150, 66, 0.45) 68%, rgba(232, 150, 66, 0) 100%);
      display: flex;
      align-items: center;
      justify-content: center;
      filter: drop-shadow(0 3px 5px rgba(54, 36, 23, 0.42));
      will-change: transform, opacity;
    }
    .res-pill {
      transform-origin: center center;
      will-change: transform;
    }
    .res-pill.hud-pill-bump {
      animation: hudPillBump 0.30s cubic-bezier(0.22, 1.35, 0.36, 1);
    }
    @keyframes hudPillBump {
      0%   { transform: scale(1); }
      42%  { transform: scale(1.09); }
      100% { transform: scale(1); }
    }

    /* 建筑信息卡与底部编辑悬浮条（奶油米白 #FBF4E8 + 深可可棕粗描边 #4A3525 + 浅燕麦信息卡 #F2E3C9） */
    #edit-bar {
      display: none;
      position: absolute;
      left: 10px;
      right: 10px;
      bottom: 86px;
      z-index: 28;
      background: var(--cream);
      border: 3px solid var(--cocoa);
      border-radius: 18px;
      box-shadow: 0 4px 0 var(--cocoa), var(--shadow-soft);
      padding: 11px 12px;
      flex-direction: column;
      gap: 9px;
      color: var(--cocoa);
    }
    #edit-bar.show {
      display: flex;
      animation: slideUp 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.1);
    }
    .edit-bar-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 8px 10px;
      background: var(--oat);
      border: 1.5px solid var(--oat-border);
      border-radius: 12px;
    }
    #edit-bar-title {
      font-size: 13px;
      font-weight: 900;
      color: var(--cocoa);
    }
    #edit-bar-sub {
      font-size: 11px;
      font-weight: 700;
      color: var(--chestnut);
      margin-top: 2px;
    }
    .edit-bar-btns {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr auto;
      gap: 6px;
    }
    .edit-bar-btns .warm-btn {
      padding: 7px 6px;
      font-size: 11.5px;
    }

    /* 底部二级弹窗抽屉（奶油米白 #FBF4E8 + 深可可棕粗描边 #4A3525 + 柔和投影） */
    #drawer-panel {
      display: none;
      position: absolute;
      left: 10px;
      right: 10px;
      bottom: 84px;
      max-height: 56%;
      z-index: 25;
      background: var(--cream);
      border: 3px solid var(--cocoa);
      border-radius: 20px;
      box-shadow: 0 4px 0 var(--cocoa), var(--shadow-soft);
      flex-direction: column;
      overflow: hidden;
      color: var(--cocoa);
    }
    #drawer-panel.show {
      display: flex;
      animation: slideUp 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.1);
    }
    .drawer-header {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 11px 13px 10px;
      background: var(--cream);
      border-bottom: 1.5px solid var(--oat-border);
    }
    #drawer-title {
      font-size: 14.5px;
      font-weight: 900;
      color: var(--cocoa);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    /* 统一右上角 × 关闭按钮：深可可棕底 #4A3525 配奶油白叉号 #FBF4E8（锁定外观防系统反色变白） */
    .close-circle {
      -webkit-appearance: none;
      appearance: none;
      forced-color-adjust: none;
      width: 28px;
      height: 28px;
      border-radius: 50%;
      border: 2px solid #362417;
      background-color: #4A3525;
      background-image: linear-gradient(180deg, #5A412E 0%, #422F20 100%);
      color: #FBF4E8;
      font-size: 14px;
      font-weight: 900;
      line-height: 1;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 0 #362417;
      flex-shrink: 0;
      transition: transform 0.1s ease, background 0.15s ease;
    }
    .close-circle:active {
      transform: translateY(1px) scale(0.94);
      box-shadow: none;
    }

    /* 抽屉分类标签栏（flex-shrink: 0 锁定高度，永不被列表挤压） */
    #drawer-tabs {
      display: none;
      flex-shrink: 0;
      min-height: 42px;
      padding: 7px 10px 7px;
      gap: 6px;
      overflow-x: auto;
      scrollbar-width: none;
      border-bottom: 1.5px solid var(--oat-border);
      background: var(--cream);
    }
    #drawer-tabs::-webkit-scrollbar { display: none; }
    #drawer-tabs.show {
      display: flex;
      align-items: center;
    }
    .cat-tab {
      flex-shrink: 0;
      cursor: pointer;
      padding: 5px 10px;
      border-radius: 10px;
      border: 1.5px solid var(--oat-border);
      background: var(--oat);
      color: var(--cocoa);
      font-size: 11.5px;
      font-weight: 800;
      white-space: nowrap;
      transition: all 0.15s ease;
    }
    .cat-tab.active {
      background: var(--caramel);
      color: #FFFDF8;
      border-color: var(--cocoa);
      box-shadow: 0 2px 0 var(--cocoa);
    }

    #drawer-content {
      padding: 10px;
      overflow-y: auto;
      flex: 1;
      min-height: 0;
      background: var(--cream);
      scrollbar-width: thin;
      scrollbar-color: var(--oat-border) transparent;
    }

    /* 建造卡片网格（浅燕麦暖色 #F2E3C9 + 暖焦糖细边框 #D6BA8A + 深咖啡棕/暖栗棕文字） */
    .card-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
    }
    .item-card {
      position: relative;
      cursor: pointer;
      background: var(--oat);
      border: 1.5px solid var(--oat-border);
      border-radius: 14px;
      padding: 9px;
      box-shadow: 0 2px 0 #C7A876;
      display: flex;
      flex-direction: column;
      gap: 5px;
      color: var(--cocoa);
      transition: transform 0.12s ease, background 0.15s ease;
    }
    .item-card:active {
      transform: translateY(2px);
      box-shadow: none;
    }
    .item-card.selected {
      background: #FCE5BD;
      border-color: var(--caramel);
      box-shadow: 0 2px 0 var(--caramel-dark);
    }
    .item-card.locked {
      background: #E9DEC9;
      border-color: #CEBA9A;
      box-shadow: none;
      opacity: 0.80;
      cursor: not-allowed;
    }
    .item-card.landmark-card {
      grid-column: span 2;
      flex-direction: row;
      align-items: center;
      gap: 10px;
      background: var(--oat);
      border: 1.5px solid var(--oat-border);
    }
    .item-card.landmark-card.locked {
      background: #E8DCC7;
    }
    .card-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 4px;
    }
    .card-icon {
      width: 34px;
      height: 34px;
      border-radius: 10px;
      background: var(--cream);
      border: 1.5px solid var(--oat-border);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      flex-shrink: 0;
    }
    .landmark-card .card-icon {
      width: 48px;
      height: 48px;
      font-size: 25px;
      background: linear-gradient(145deg, #FFE4A8, #E89642);
      border-color: var(--cocoa);
    }
    .landmark-card.locked .card-icon {
      background: #DBCBB2;
      border-color: #B8A283;
      filter: grayscale(0.7);
    }
    .count-chip {
      font-size: 10px;
      font-weight: 900;
      padding: 2px 6px;
      border-radius: 99px;
      background: var(--cream);
      border: 1.5px solid var(--oat-border);
      color: var(--cocoa);
      white-space: nowrap;
    }
    .count-chip.full {
      background: #FADBD4;
      border-color: var(--red-dark);
      color: var(--red-dark);
    }
    .lock-chip {
      font-size: 10px;
      font-weight: 900;
      padding: 2px 6px;
      border-radius: 99px;
      background: #DECBB0;
      color: #5C4632;
      border: 1.5px solid #B59A76;
      white-space: nowrap;
    }
    .card-name {
      font-size: 12.5px;
      font-weight: 900;
      color: var(--cocoa);
      line-height: 1.25;
    }
    .card-desc {
      font-size: 10.5px;
      font-weight: 700;
      color: var(--chestnut);
      line-height: 1.38;
    }
    .card-cost {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 5px;
      margin-top: auto;
      font-size: 11px;
      font-weight: 900;
      color: var(--caramel-dark);
    }

    /* 列表卡片（仓库与城市概况、商店、任务、地图：浅燕麦暖色 #F2E3C9 + 暖焦糖细边框 #D6BA8A） */
    .list-stack {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .list-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 10px 11px;
      background: var(--oat);
      border: 1.5px solid var(--oat-border);
      border-radius: 14px;
      box-shadow: 0 2px 0 #C7A876;
      color: var(--cocoa);
    }
    .list-row-info {
      flex: 1;
      min-width: 0;
    }
    .list-row-title {
      font-size: 12.5px;
      font-weight: 900;
      color: var(--cocoa);
    }
    .list-row-sub {
      font-size: 11px;
      font-weight: 700;
      color: var(--chestnut);
      margin-top: 2px;
      line-height: 1.38;
    }
    .warehouse-empty-box {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 22px 16px;
      border-radius: 16px;
      background: var(--oat);
      border: 1.5px dashed var(--oat-border);
      text-align: center;
    }
    .warehouse-empty-ico {
      width: 46px;
      height: 46px;
      border-radius: 14px;
      background: var(--cream);
      border: 1.5px solid var(--oat-border);
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0.78;
    }
    .warehouse-empty-label {
      font-size: 13px;
      font-weight: 900;
      letter-spacing: 0.16em;
      padding-left: 0.16em;
      color: var(--chestnut);
    }

    /* 底部 5 键悬浮导航栏（深烘焙可可棕底座 + 暖烘焙浅咖按钮 #6B4E38 + 选中焦糖琥珀橙 #E89642） */
    #bottom-nav {
      position: absolute;
      left: 10px;
      right: 10px;
      bottom: 10px;
      z-index: 30;
      height: 66px;
      background: rgba(74, 53, 37, 0.96);
      border: 2.5px solid var(--gold-border);
      border-radius: 22px;
      box-shadow: 0 4px 0 var(--cocoa-deep), 0 10px 24px rgba(54, 36, 23, 0.36);
      padding: 6px;
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 5px;
      transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.30s ease;
    }

    .nav-btn {
      -webkit-appearance: none;
      appearance: none;
      forced-color-adjust: none;
      position: relative;
      cursor: pointer;
      border: 2px solid var(--nav-border);
      border-radius: 15px;
      background-color: #6B4E38;
      background-image: linear-gradient(180deg, #75563E 0%, #5E432F 100%);
      box-shadow: 0 2px 0 var(--cocoa-deep);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 2px;
      color: #FBF4E8;
      font-size: 10.5px;
      font-weight: 900;
      transition: transform 0.12s cubic-bezier(0.2, 0.9, 0.3, 1.3), background 0.15s ease, border-color 0.15s ease;
    }
    .nav-btn:active {
      transform: translateY(2px) scale(0.94);
      box-shadow: none;
    }
    .nav-btn.build-main {
      background: var(--cocoa-light);
      border-color: var(--gold-border);
      color: var(--cream);
    }
    .nav-btn.active {
      background: var(--caramel);
      color: #FFFDF8;
      border-color: var(--gold-bright);
      transform: translateY(-3px);
      box-shadow: 0 4px 0 var(--cocoa-deep);
    }
    .nav-btn svg {
      width: 21px;
      height: 21px;
      stroke: var(--cream);
      stroke-width: 2.2;
      fill: none;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
    .nav-btn.active svg {
      stroke: #FFFDF8;
    }
    .nav-badge {
      display: none;
      position: absolute;
      top: -5px;
      right: -3px;
      min-width: 17px;
      height: 17px;
      padding: 0 4px;
      border-radius: 99px;
      background: var(--red);
      border: 1.5px solid var(--cream);
      color: #FFFDF8;
      font-size: 10px;
      font-weight: 900;
      align-items: center;
      justify-content: center;
    }
    .nav-badge.show {
      display: flex;
    }

    /* 通用二级模态弹窗（详细档案、市民对话卡、城镇升级庆祝：奶油米白 #FBF4E8 + 深可可棕粗描边 #4A3525） */
    .modal-backdrop {
      display: none;
      position: absolute;
      inset: 0;
      z-index: 45;
      background: rgba(54, 36, 23, 0.58);
      backdrop-filter: blur(3px);
      align-items: center;
      justify-content: center;
      padding: 18px;
    }
    .modal-backdrop.show {
      display: flex;
      animation: fadeIn 0.2s ease;
    }

    .modal-card {
      width: 100%;
      max-width: 356px;
      max-height: 86%;
      overflow-y: auto;
      background: var(--cream);
      border: 3px solid var(--cocoa);
      border-radius: 22px;
      box-shadow: 0 6px 0 var(--cocoa), 0 18px 40px rgba(45, 29, 17, 0.42);
      padding: 16px;
      color: var(--cocoa);
      animation: popIn 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.15);
    }
    .modal-header-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding-bottom: 10px;
      margin-bottom: 12px;
      border-bottom: 1.5px solid var(--oat-border);
    }
    .modal-title {
      font-size: 15px;
      font-weight: 900;
      color: var(--cocoa);
    }

    /* 市民抽象对话弹层 */
    .citizen-head {
      display: flex;
      align-items: center;
      gap: 11px;
      margin-bottom: 12px;
    }
    .citizen-portrait {
      width: 48px;
      height: 48px;
      border-radius: 14px;
      border: 1.5px solid var(--oat-border);
      background: var(--oat);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 26px;
      flex-shrink: 0;
    }
    .citizen-quote-box {
      background: var(--oat);
      border: 1.5px solid var(--oat-border);
      border-radius: 15px;
      padding: 13px;
      font-size: 13.5px;
      font-weight: 700;
      line-height: 1.6;
      color: var(--cocoa);
      margin-bottom: 14px;
    }
    .choice-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-bottom: 14px;
    }
    .choice-item {
      cursor: pointer;
      text-align: left;
      padding: 10px 12px;
      background: var(--oat);
      border: 1.5px solid var(--oat-border);
      border-radius: 13px;
      box-shadow: 0 2px 0 #C7A876;
      font-size: 12.5px;
      font-weight: 700;
      line-height: 1.45;
      color: var(--cocoa);
      transition: all 0.12s ease;
    }
    .choice-item.selected {
      background: #FCE3B6;
      border-color: var(--caramel);
      box-shadow: 0 2px 0 var(--caramel-dark);
    }
    .modal-footer {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
    }

    /* 详细档案 / 幸福度 / 闻名度信息卡（浅燕麦暖色 #F2E3C9 + 暖焦糖细边框 #D6BA8A） */
    .status-section {
      background: var(--oat);
      border: 1.5px solid var(--oat-border);
      border-radius: 14px;
      padding: 10px 12px;
      margin-bottom: 10px;
      color: var(--cocoa);
    }
    .status-sec-title {
      font-size: 12.5px;
      font-weight: 900;
      color: var(--cocoa);
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .status-line {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 11.5px;
      font-weight: 700;
      color: var(--chestnut);
      padding: 3px 0;
    }
    .status-line strong {
      color: var(--cocoa);
    }
    .status-note {
      font-size: 11px;
      font-weight: 700;
      color: var(--chestnut);
      margin-top: 6px;
      line-height: 1.45;
    }

    /* 全屏城镇升级庆祝弹层 */
    #levelup-modal {
      z-index: 60;
      background: rgba(54, 34, 18, 0.72);
    }
    .lu-card {
      position: relative;
      text-align: center;
      overflow: hidden;
      background: var(--cream);
    }
    .lu-rays {
      position: absolute;
      top: -90px;
      left: 50%;
      width: 340px;
      height: 340px;
      margin-left: -170px;
      background: repeating-conic-gradient(
        from 0deg,
        rgba(232, 150, 66, 0.18) 0deg 15deg,
        transparent 15deg 30deg
      );
      border-radius: 50%;
      animation: sunSpin 14s linear infinite;
      pointer-events: none;
    }
    .lu-inner {
      position: relative;
      z-index: 2;
    }
    .lu-crown {
      font-size: 46px;
      line-height: 1;
      margin-bottom: 6px;
      animation: crownBob 1.8s ease-in-out infinite;
    }
    .lu-badge {
      display: inline-block;
      padding: 4px 14px;
      border-radius: 99px;
      background: var(--caramel);
      border: 2px solid var(--cocoa);
      color: #FFFDF8;
      font-size: 15px;
      font-weight: 900;
      margin-bottom: 8px;
      box-shadow: 0 3px 0 var(--cocoa);
    }
    .lu-box {
      text-align: left;
      background: var(--oat);
      border: 1.5px solid var(--oat-border);
      border-radius: 16px;
      padding: 11px;
      margin: 10px 0 14px;
      color: var(--cocoa);
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .lu-perks {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
    }
    .lu-perk-chip {
      background: var(--cream);
      border: 1.5px solid var(--oat-border);
      border-radius: 11px;
      padding: 6px 8px;
      text-align: center;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .lu-perk-label {
      font-size: 10px;
      font-weight: 800;
      color: var(--chestnut);
    }
    .lu-perk-val {
      font-size: 12.5px;
      font-weight: 900;
      color: var(--cocoa);
    }
    .lu-sec-title {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      font-size: 11px;
      font-weight: 900;
      color: var(--chestnut);
      margin-bottom: 6px;
    }
    .lu-sec-title::before,
    .lu-sec-title::after {
      content: "";
      flex: 1;
      height: 1px;
      background: var(--oat-border);
    }
    .lu-reward-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 6px;
    }
    .lu-reward-grid .vui-badge {
      width: 100%;
      padding: 5px 6px;
      background: var(--cream);
      border-color: var(--oat-border);
      box-shadow: 0 1.5px 0 #C7A876;
      font-size: 12px;
    }
    .lu-unlock-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 6px;
    }
    .lu-unlock-card {
      background: var(--cream);
      border: 1.5px solid #E5B26B;
      border-radius: 11px;
      padding: 7px 8px;
      box-shadow: 0 1.5px 0 #D19A4E;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 3px;
      min-width: 0;
    }
    .lu-unlock-card:last-child:nth-child(odd) {
      grid-column: span 2;
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
    }
    .lu-unlock-name {
      font-size: 11.5px;
      font-weight: 900;
      color: var(--cocoa);
      line-height: 1.25;
      word-break: break-all;
    }
    .lu-unlock-cat {
      font-size: 9.5px;
      font-weight: 800;
      padding: 1px 6px;
      border-radius: 99px;
      background: #FCE5BD;
      color: var(--caramel-dark);
      border: 1px solid #E8B968;
      white-space: nowrap;
    }

    /* 全局对称关闭过渡：底部抽屉下滑收起 + 弹窗/悬浮条淡出 */
    #drawer-panel.closing {
      display: flex;
      pointer-events: none;
      transform: translateY(100%);
      opacity: 0;
      transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease;
    }
    #edit-bar.closing {
      display: flex;
      pointer-events: none;
      transform: translateY(16px) scale(0.96);
      opacity: 0;
      transition: transform 0.22s ease, opacity 0.22s ease;
    }
    #build-banner.closing,
    #happy-warning.closing {
      display: flex;
      pointer-events: none;
      transform: translateY(-8px) scale(0.96);
      opacity: 0;
      transition: transform 0.22s ease, opacity 0.22s ease;
    }
    .modal-backdrop.closing {
      display: flex;
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.22s ease;
    }
    .modal-backdrop.closing .modal-card {
      opacity: 0;
      transform: scale(0.94);
      transition: opacity 0.22s ease, transform 0.22s ease;
    }

    /* 任务卡片退场动画与按钮周围白色像素星屑粒子 */
    .quest-card-exit {
      pointer-events: none;
      transform: scale(0.94) translateX(18px) !important;
      opacity: 0 !important;
      transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.24s ease !important;
    }
    .quest-sparkle-px {
      position: fixed;
      width: 6px;
      height: 6px;
      border-radius: 1.5px;
      background: #FFFFFF;
      box-shadow: 0 0 0 1px rgba(74, 53, 37, 0.28);
      pointer-events: none;
      z-index: 99999;
      opacity: 1;
      transition: transform 0.42s cubic-bezier(0.16, 0.84, 0.34, 1), opacity 0.42s ease-out;
    }

    @keyframes floatBob {
      0%, 100% { transform: translate3d(calc(var(--bx) - 50%), calc(var(--by) - 100%), 0); }
      50% { transform: translate3d(calc(var(--bx) - 50%), calc(var(--by) - 100% - 5px), 0); }
    }
    @keyframes crownBob {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-6px); }
    }
    @keyframes floatUpFade {
      0% { opacity: 0; transform: translate(-50%, -30%) scale(0.85); }
      18% { opacity: 1; transform: translate(-50%, -65%) scale(1.06); }
      100% { opacity: 0; transform: translate(-50%, -195%) scale(0.95); }
    }
    @keyframes popIn {
      0% { opacity: 0; transform: scale(0.92); }
      100% { opacity: 1; transform: scale(1); }
    }
    @keyframes slideUp {
      0% { opacity: 0; transform: translateY(16px); }
      100% { opacity: 1; transform: translateY(0); }
    }
    @keyframes fadeIn {
      0% { opacity: 0; }
      100% { opacity: 1; }
    }
    @keyframes sunSpin {
      from { transform: rotate(0deg); }
      to { transform: rotate(360deg); }
    }
    @keyframes warnPulse {
      0%, 100% { box-shadow: 0 2px 0 var(--red-dark), 0 0 0 0 rgba(217, 91, 67, 0.35); }
      50% { box-shadow: 0 2px 0 var(--red-dark), 0 0 0 5px rgba(217, 91, 67, 0); }
    }

    /* 建筑上方轻巧悬浮暖金「可合成」小星标（首次合成前显示） */
    .world-bubble.merge-hint-bubble {
      background: linear-gradient(180deg, #FFF7DA 0%, #FFD67A 100%);
      border: 2px solid #9E5614;
      box-shadow: 0 2px 0 #7D410D, 0 0 10px rgba(255, 206, 92, 0.55);
      color: #4A3525;
      padding: 3px 8px;
      font-size: 10.5px;
      font-weight: 900;
      gap: 3px;
      z-index: 10;
    }
    .world-bubble.merge-hint-bubble::after {
      border-top-color: #9E5614;
      bottom: -6px;
      border-left-width: 5px;
      border-right-width: 5px;
      border-top-width: 6px;
    }

    /* 编辑详情面板内的「三合一进化」按钮与首次暖金呼吸脉冲边框 */
    #btn-edit-merge {
      width: 100%;
      padding: 9px 12px;
      font-size: 13px;
      font-weight: 900;
      border-radius: 13px;
    }
    #btn-edit-merge.merge-pulse {
      border-color: #FFE18C;
      box-shadow: 0 3px 0 #9E5212, 0 0 0 0 rgba(246, 186, 72, 0.78);
      animation: mergeGoldPulse 1.35s ease-in-out infinite;
    }

    /* 城镇晋升条件弹窗 */
    .promo-card {
      max-width: 332px;
      padding: 18px 16px 16px;
    }
    .promo-head-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 12px;
      border-radius: 999px;
      background: var(--oat);
      border: 1.5px solid var(--oat-border);
      font-size: 12px;
      font-weight: 900;
      color: var(--caramel-dark);
      margin-bottom: 10px;
    }
    .promo-cond-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-bottom: 12px;
    }
    .promo-cond-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 10px 12px;
      background: var(--oat);
      border: 1.5px solid var(--oat-border);
      border-radius: 14px;
    }
    .promo-cond-left {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }
    .promo-cond-icon {
      width: 32px;
      height: 32px;
      border-radius: 10px;
      background: var(--cream);
      border: 1.5px solid var(--oat-border);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .promo-cond-label {
      font-size: 12.5px;
      font-weight: 900;
      color: var(--cocoa);
    }
    .promo-cond-val {
      font-size: 11px;
      font-weight: 800;
      color: var(--chestnut);
      margin-top: 2px;
    }
    .promo-status-ok {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 4px 9px;
      border-radius: 999px;
      background: #E2F1D5;
      border: 1.5px solid #6E9E46;
      color: #3E6620;
      font-size: 11px;
      font-weight: 900;
      white-space: nowrap;
      flex-shrink: 0;
    }
    .promo-status-lack {
      display: inline-flex;
      align-items: center;
      padding: 4px 9px;
      border-radius: 999px;
      background: #FCE6D8;
      border: 1.5px solid #D9895B;
      color: #9E431A;
      font-size: 11px;
      font-weight: 900;
      white-space: nowrap;
      flex-shrink: 0;
    }
    .promo-preview-box {
      background: var(--oat);
      border: 1.5px solid var(--oat-border);
      border-radius: 13px;
      padding: 9px 11px;
      margin-bottom: 14px;
      font-size: 11.5px;
      font-weight: 800;
      color: var(--chestnut);
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .promo-actions {
      display: flex;
      flex-direction: column;
      gap: 7px;
    }
    .promo-actions .warm-btn {
      width: 100%;
      padding: 10px 14px;
      font-size: 13.5px;
      border-radius: 13px;
    }

    /* 首次三合一可视化引导卡片 */
    .merge-guide-card {
      max-width: 318px;
      text-align: center;
      padding: 20px 18px 18px;
    }
    .mg-title {
      font-size: 16.5px;
      font-weight: 900;
      color: var(--cocoa);
      margin-bottom: 4px;
    }
    .mg-sub {
      font-size: 11.5px;
      font-weight: 800;
      color: var(--caramel-dark);
      margin-bottom: 12px;
    }
    .mg-diagram {
      background: var(--oat);
      border: 1.5px solid var(--oat-border);
      border-radius: 16px;
      padding: 12px 8px 10px;
      margin-bottom: 12px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
    }
    .mg-caption-row {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 12px;
      font-size: 10.5px;
      font-weight: 900;
      color: var(--chestnut);
    }
    .mg-desc {
      font-size: 12.5px;
      line-height: 1.62;
      font-weight: 700;
      color: #5C4330;
      text-align: left;
      background: var(--oat);
      border: 1.5px solid var(--oat-border);
      border-radius: 13px;
      padding: 10px 12px;
      margin-bottom: 14px;
    }
    .mg-ok-btn {
      width: 100%;
      padding: 11px 16px;
      border: 2px solid #4A3525;
      border-radius: 14px;
      background: #E89642;
      color: #FFFDF8;
      font-size: 15px;
      font-weight: 900;
      letter-spacing: 0.4px;
      cursor: pointer;
      box-shadow: 0 3px 0 #B86820;
      transition: transform 0.08s ease, box-shadow 0.08s ease;
    }
    .mg-ok-btn:active {
      transform: translateY(2px);
      box-shadow: 0 1px 0 #B86820;
    }

    /* 游戏化属性胶囊组（替代大段说明书文字） */
    .ui-pill-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 4px;
      margin-top: 2px;
    }
    .ui-stat-pill {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      padding: 2px 7px;
      border-radius: 999px;
      font-size: 10px;
      font-weight: 900;
      line-height: 1.25;
      white-space: nowrap;
      background: var(--cream);
      border: 1.2px solid var(--oat-border);
      color: var(--cocoa);
    }
    .ui-stat-pill.gold {
      background: #FFF2C6;
      border-color: #E3B34C;
      color: #8A530B;
    }
    .ui-stat-pill.olive {
      background: #E6F2D9;
      border-color: #88AE5C;
      color: #426121;
    }
    .ui-stat-pill.caramel {
      background: #FCE3BD;
      border-color: #E59B46;
      color: #9A4D12;
    }
    .ui-stat-pill.muted {
      background: #EDE0C8;
      border-color: #D2BA92;
      color: var(--chestnut);
    }
    .item-card .card-cost {
      padding-top: 6px;
      margin-top: 4px;
      border-top: 1px dashed #D8C098;
    }
    .promo-mini-track {
      width: 100%;
      height: 6px;
      margin-top: 5px;
      border-radius: 99px;
      background: #E2D1B3;
      border: 1px solid #CFAF7D;
      overflow: hidden;
    }
    .promo-mini-fill {
      height: 100%;
      border-radius: 99px;
      background: linear-gradient(90deg, #F4B950, #E89642);
      transition: width 0.3s ease;
    }
    .promo-mini-fill.ok {
      background: linear-gradient(90deg, #8EB558, #6D943B);
    }

    /* 全局极细柔和滚动条（彻底消除默认灰色系统滚动条） */
    .modal-card,
    #drawer-content,
    #unlock-guide-modal .ugm-list {
      scrollbar-width: thin;
      scrollbar-color: rgba(74, 53, 37, 0.25) transparent;
    }
    .modal-card::-webkit-scrollbar,
    #drawer-content::-webkit-scrollbar,
    #unlock-guide-modal .ugm-list::-webkit-scrollbar {
      width: 4px;
      height: 4px;
    }
    .modal-card::-webkit-scrollbar-track,
    #drawer-content::-webkit-scrollbar-track,
    #unlock-guide-modal .ugm-list::-webkit-scrollbar-track {
      background: transparent;
    }
    .modal-card::-webkit-scrollbar-thumb,
    #drawer-content::-webkit-scrollbar-thumb,
    #unlock-guide-modal .ugm-list::-webkit-scrollbar-thumb {
      background: rgba(74, 53, 37, 0.25);
      border-radius: 999px;
    }

    /* 城镇档案与状态：可视化看板组件 */
    .status-area-tag {
      display: inline-flex;
      align-items: center;
      padding: 2px 8px;
      border-radius: 999px;
      background: var(--cream);
      border: 1.5px solid var(--oat-border);
      color: var(--chestnut);
      font-size: 10.5px;
      font-weight: 900;
      white-space: nowrap;
    }
    .st-goal-list {
      display: flex;
      flex-direction: column;
      gap: 7px;
      margin-top: 6px;
    }
    .st-goal-row {
      display: flex;
      align-items: center;
      gap: 8px;
      background: var(--cream);
      border: 1.5px solid var(--oat-border);
      border-radius: 12px;
      padding: 7px 9px;
    }
    .st-goal-ico {
      width: 28px;
      height: 28px;
      border-radius: 9px;
      background: var(--oat);
      border: 1.2px solid var(--oat-border);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .st-goal-mid {
      flex: 1;
      min-width: 0;
    }
    .st-goal-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      font-size: 11px;
      font-weight: 900;
      color: var(--cocoa);
    }
    .st-goal-num {
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      color: var(--chestnut);
      font-size: 11px;
    }
    .st-bar-track {
      width: 100%;
      height: 7px;
      margin-top: 4px;
      border-radius: 999px;
      background: #E5D4B7;
      border: 1px solid #CFAF7D;
      overflow: hidden;
    }
    .st-bar-fill {
      height: 100%;
      border-radius: 999px;
      background: linear-gradient(90deg, #F4B950, #E89642);
      transition: width 0.3s ease;
    }
    .st-bar-fill.ok {
      background: linear-gradient(90deg, #8FB65A, #6D943B);
    }
    .st-seg-bar {
      width: 100%;
      height: 10px;
      border-radius: 999px;
      background: #E5D4B7;
      border: 1.5px solid #CFAF7D;
      overflow: hidden;
      display: flex;
      margin: 6px 0 9px;
    }
    .st-seg-slice {
      height: 100%;
      min-width: 3px;
    }
    .st-grid-2 {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 6px;
    }
    .st-mini-card {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      padding: 6px 8px;
      border-radius: 10px;
      background: var(--cream);
      border: 1.2px solid var(--oat-border);
      min-width: 0;
    }
    .st-mini-left {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      min-width: 0;
      font-size: 10.5px;
      font-weight: 800;
      color: var(--chestnut);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .st-dot {
      width: 8px;
      height: 8px;
      border-radius: 3px;
      border: 1px solid rgba(74, 53, 37, 0.45);
      flex-shrink: 0;
    }
    .st-mini-val {
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-size: 11px;
      font-weight: 900;
      color: var(--cocoa);
      white-space: nowrap;
      flex-shrink: 0;
    }
    .st-mini-card.pos {
      background: #EFF7E6;
      border-color: #9CC072;
    }
    .st-mini-card.pos .st-mini-val {
      color: #466B22;
    }
    .st-mini-card.neg {
      background: #FDECE6;
      border-color: #E39582;
    }
    .st-mini-card.neg .st-mini-val {
      color: #A63A24;
    }
    .st-happy-hero {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 10px;
      background: var(--cream);
      border: 1.5px solid var(--oat-border);
      border-radius: 12px;
      margin-bottom: 8px;
    }
    .st-happy-face {
      width: 44px;
      height: 44px;
      border-radius: 13px;
      background: var(--oat);
      border: 1.5px solid var(--oat-border);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .st-happy-main {
      flex: 1;
      min-width: 0;
    }
    .st-happy-top {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 6px;
      margin-bottom: 5px;
    }
    .st-happy-pct {
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-size: 20px;
      font-weight: 900;
      color: var(--cocoa);
      line-height: 1;
    }
    .st-happy-scale {
      position: relative;
      width: 100%;
      height: 8px;
      border-radius: 999px;
      background: linear-gradient(90deg, #E8826B 0% 45%, #F2C96B 45% 80%, #86B856 80% 100%);
      border: 1.2px solid var(--cocoa);
    }
    .st-happy-marker {
      position: absolute;
      top: 50%;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: #FFFDF8;
      border: 2.2px solid var(--cocoa);
      transform: translate(-50%, -50%);
      box-shadow: 0 1px 3px rgba(54, 36, 23, 0.35);
    }

    @keyframes mergeHintBob {
      0%, 100% { transform: translate3d(calc(var(--bx) - 50%), calc(var(--by) - 100%), 0) scale(1); }
      50% { transform: translate3d(calc(var(--bx) - 50%), calc(var(--by) - 100% - 4px), 0) scale(1.04); }
    }
    @keyframes mergeGoldPulse {
      0%, 100% { box-shadow: 0 3px 0 #9E5212, 0 0 0 0 rgba(246, 186, 72, 0.75); }
      50% { box-shadow: 0 3px 0 #9E5212, 0 0 0 7px rgba(246, 186, 72, 0); }
    }

    /* 顶部第一排城镇卡右侧：日夜切换 + 全屏沉浸观赏竖排圆钮 */
    .hud-mini-tools {
      display: flex;
      flex-direction: column;
      gap: 5px;
      margin-right: auto;
      margin-top: 1px;
      flex-shrink: 0;
    }
    .hud-right-wrap {
      display: flex;
      align-items: center;
      gap: 6px;
      pointer-events: auto;
      flex-shrink: 0;
    }
    #btn-theme-toggle,
    #btn-immersive-toggle,
    #btn-shop-shortcut {
      -webkit-appearance: none;
      appearance: none;
      forced-color-adjust: none;
      pointer-events: auto;
      cursor: pointer;
      width: 30px;
      height: 30px;
      border-radius: 50%;
      border: 2px solid var(--gold-border);
      background-color: #4A3525;
      background-image: linear-gradient(180deg, #563E2C 0%, #3E2B1E 100%);
      box-shadow: 0 2px 0 var(--cocoa-deep);
      color: #FFD98A;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      transition: transform 0.14s ease, background 0.2s ease, border-color 0.2s ease;
    }
    #btn-shop-shortcut {
      width: 32px;
      height: 32px;
    }
    #btn-shop-shortcut.active {
      background-color: #E89642;
      background-image: linear-gradient(180deg, #F4A950 0%, #E89642 100%);
      border-color: var(--gold-bright);
    }
    #btn-shop-shortcut.active svg {
      stroke: #FFFDF8;
    }
    #btn-theme-toggle:active,
    #btn-immersive-toggle:active,
    #btn-shop-shortcut:active {
      transform: translateY(1px) scale(0.92);
    }

    /* 沉浸观赏模式：顶部上滑隐藏、底部下滑隐藏、气泡柔和隐身且彻底屏蔽点击 */
    body.immersive-mode #top-hud {
      transform: translateY(-135%);
      opacity: 0;
      pointer-events: none !important;
    }
    body.immersive-mode #bottom-nav {
      transform: translateY(145%);
      opacity: 0;
      pointer-events: none !important;
    }
    body.immersive-mode #bubble-layer {
      opacity: 0;
    }
    body.immersive-mode #bubble-layer,
    body.immersive-mode #bubble-layer * {
      pointer-events: none !important;
    }

    /* 沉浸模式右上角轻量退出胶囊 */
    #btn-immersive-exit {
      position: absolute;
      top: 14px;
      right: 14px;
      z-index: 35;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 6px 12px;
      border-radius: var(--radius-pill);
      border: 2px solid rgba(232, 185, 104, 0.85);
      background: rgba(74, 53, 37, 0.78);
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
      color: #FFFDF8;
      font-size: 11.5px;
      font-weight: 900;
      box-shadow: 0 3px 0 rgba(54, 36, 23, 0.65), 0 6px 16px rgba(54, 36, 23, 0.28);
      opacity: 0;
      transform: translateY(-18px) scale(0.92);
      pointer-events: none;
      transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.26s ease;
    }
    #btn-immersive-exit:active {
      transform: translateY(1px) scale(0.95);
    }
    body.immersive-mode #btn-immersive-exit {
      opacity: 1;
      transform: translateY(0) scale(1);
      pointer-events: auto;
    }

    /* 长按建筑触发移动模式时的轻巧暖金脉冲环 */
    #longpress-ring {
      position: fixed;
      left: 0;
      top: 0;
      width: 48px;
      height: 48px;
      margin-left: -24px;
      margin-top: -24px;
      border-radius: 50%;
      border: 3px solid #FFD98A;
      background: rgba(232, 150, 66, 0.22);
      box-shadow: 0 0 0 2px rgba(74, 53, 37, 0.45);
      pointer-events: none;
      z-index: 9998;
      opacity: 0;
      transform: scale(0.35);
    }
    #longpress-ring.active {
      animation: lpRingFill 0.32s ease-out forwards;
    }
    @keyframes lpRingFill {
      0%   { opacity: 0.4; transform: scale(0.35); }
      75%  { opacity: 0.95; transform: scale(1.08); }
      100% { opacity: 1; transform: scale(1); }
    }

    /* ==================== 全局暖可可暗黑模式（零青蓝反色，全界面统一） ==================== */
    html.theme-dark {
      color-scheme: only dark;
      forced-color-adjust: none;
    }
    body.theme-dark {
      color-scheme: only dark;
      forced-color-adjust: none;
      --cream: #2B1F17;
      --cream-soft: #35271E;
      --oat: #3B2B21;
      --oat-border: #694E3A;
      --oat-muted: #32241B;
      --cocoa: #F5E6D0;
      --cocoa-deep: #18100B;
      --cocoa-light: #4D382A;
      --brown: #F5E6D0;
      --chestnut: #C8AE90;
      --nav-border: #7D5D44;
      --gold-border: #D9A14E;
      --gold-bright: #FFD98A;
      --caramel: #E58C35;
      --caramel-dark: #F3B364;
      --shadow-hard: 0 3px 0 #140D09;
      background: radial-gradient(circle at 30% 20%, #2B2019 0%, #1C1410 55%, #120C09 100%);
    }
    body.theme-dark #phone-frame {
      background: #231A26;
      border-color: #1A110C;
      box-shadow: 0 24px 60px rgba(0, 0, 0, 0.62), 0 0 0 2px #5A402E inset;
    }
    body.theme-dark #town-card,
    body.theme-dark .res-pill,
    body.theme-dark .stat-pill {
      background: rgba(38, 27, 20, 0.96);
      border-color: #C79246;
      color: #F5E6D0;
    }
    body.theme-dark #btn-theme-toggle,
    body.theme-dark #btn-immersive-toggle,
    body.theme-dark #btn-shop-shortcut {
      background-color: #2B1F17;
      background-image: linear-gradient(180deg, #3A291F 0%, #241912 100%);
      border-color: #C79246;
      color: #FFD98A;
    }
    body.theme-dark #btn-shop-shortcut.active {
      background-color: #E58C35;
      background-image: linear-gradient(180deg, #F09C44 0%, #D97E28 100%);
      border-color: #FFD98A;
    }
    body.theme-dark .nav-btn {
      background-color: #4D382A;
      background-image: linear-gradient(180deg, #594131 0%, #423023 100%);
      color: #FFF5E4;
    }
    body.theme-dark .nav-btn.active {
      background-color: #E58C35;
      background-image: linear-gradient(180deg, #F09C44 0%, #D97E28 100%);
    }
    body.theme-dark .close-circle {
      background-color: #4A3525;
      background-image: linear-gradient(180deg, #5A412E 0%, #3E2C1E 100%);
      border-color: #D9A14E;
      color: #FFF4E0;
    }
    body.theme-dark #honor-notice-modal .hnm-card {
      background: #2B1F17;
      border-color: #D9A14E;
      color: #F5E6D0;
    }
    body.theme-dark #honor-notice-modal .hnm-tray,
    body.theme-dark #honor-notice-modal .hnm-tip,
    body.theme-dark .honor-card {
      background: #3B2B21;
      border-color: #694E3A;
      color: #F5E6D0;
      box-shadow: 0 2px 0 #1A110B;
    }
    body.theme-dark .honor-card.locked {
      background: #2E221A;
      border-color: #4D392B;
      box-shadow: none;
    }
    body.theme-dark .honor-tray {
      background: #2B1F17;
      border-color: #694E3A;
    }
    body.theme-dark #honor-notice-modal .hnm-title {
      color: #F5E6D0;
    }
    body.theme-dark #honor-notice-modal .hnm-sub,
    body.theme-dark #honor-notice-modal .hnm-tip {
      color: #C8AE90;
    }
    body.theme-dark #hud-title {
      color: #FFF5E4;
    }
    body.theme-dark .voxel-face {
      border-color: #4A3525;
    }
    body.theme-dark .voxel-face::before {
      border-bottom-color: #4A3525;
    }
    body.theme-dark .voxel-eyes i {
      background: #4A3525;
    }
    body.theme-dark .nav-btn {
      color: #FFF5E4;
    }
    body.theme-dark .nav-btn svg {
      stroke: #FFF5E4;
    }
    body.theme-dark .nav-badge {
      border-color: #FFF5E4;
    }
    body.theme-dark #drawer-panel,
    body.theme-dark #edit-bar,
    body.theme-dark #build-banner,
    body.theme-dark .modal-card {
      border-color: #6B4F3A;
      box-shadow: 0 4px 0 #140D09, 0 14px 32px rgba(0, 0, 0, 0.55);
    }
    body.theme-dark .item-card,
    body.theme-dark .list-row,
    body.theme-dark .choice-item,
    body.theme-dark .promo-cond-row {
      box-shadow: 0 2px 0 #1A110B;
    }
    body.theme-dark .item-card.locked {
      background: #2E221A;
      border-color: #4D392B;
    }
    body.theme-dark .item-card.selected,
    body.theme-dark .choice-item.selected {
      background: #4E3622;
      border-color: #E58C35;
    }
    body.theme-dark .close-circle {
      background: #4A3525;
      border-color: #D9A14E;
      color: #FFF4E0;
    }
    body.theme-dark .warm-btn {
      border-color: #7D5D44;
      box-shadow: 0 2px 0 #140D09;
    }
    body.theme-dark .warm-btn.primary {
      background: linear-gradient(180deg, #E89A42 0%, #CC7724 100%);
      border-color: #FFD98A;
      color: #FFFDF8;
    }
    body.theme-dark .world-bubble {
      background: #33241B;
      border-color: #E5A94C;
      color: #FFF2DC;
      box-shadow: 0 3px 0 #140D09, 0 6px 14px rgba(0, 0, 0, 0.45);
    }
    body.theme-dark .world-bubble::after {
      border-top-color: #E5A94C;
    }
    body.theme-dark .world-bubble.coin-bubble {
      background-color: #49301A;
      background-image: linear-gradient(180deg, #54371F 0%, #3E2716 100%);
      border-color: #F5BE4F;
      color: #FFE5A0;
    }
    body.theme-dark .world-bubble.chat-bubble {
      background-color: #39281D;
      background-image: linear-gradient(180deg, #422F23 0%, #312219 100%);
    }
    body.theme-dark .world-bubble.merge-hint-bubble {
      background: linear-gradient(180deg, #5C3D1E 0%, #442C15 100%);
      border-color: #FFD470;
      color: #FFF2D0;
    }
    body.theme-dark #happy-warning {
      background: linear-gradient(180deg, #3D2B20 0%, #2F2118 100%);
      border-color: #C9975B;
      box-shadow: 0 3px 0 #18100B, 0 6px 14px rgba(0, 0, 0, 0.36);
      color: #F5E6D0;
    }
    body.theme-dark .hw-icon-tray,
    body.theme-dark .hw-close {
      background: #2B1F17;
      border-color: #7D5D44;
      color: #E5CFAF;
    }
    body.theme-dark .ui-stat-pill.gold {
      background: #4A381D;
      border-color: #B38332;
      color: #FFE094;
    }
    body.theme-dark .ui-stat-pill.olive {
      background: #2B3B24;
      border-color: #638748;
      color: #CBE8AE;
    }
    body.theme-dark .ui-stat-pill.caramel {
      background: #4B321F;
      border-color: #B57336;
      color: #FFD19A;
    }
    body.theme-dark .ui-stat-pill.muted {
      background: #33251C;
      border-color: #5C4433;
      color: #C8AE90;
    }
    body.theme-dark .vui-badge {
      background: #3B2B21;
      border-color: #694E3A;
      color: #F5E6D0;
    }
    body.theme-dark .promo-status-ok {
      background: #283B22;
      border-color: #6E9E46;
      color: #C8EAA8;
    }
    body.theme-dark .promo-status-lack {
      background: #4A2B20;
      border-color: #B86B43;
      color: #FFC6A3;
    }
    body.theme-dark .st-mini-card.pos {
      background: #283822;
      border-color: #5E8342;
    }
    body.theme-dark .st-mini-card.pos .st-mini-val {
      color: #BCE69A;
    }
    body.theme-dark .st-mini-card.neg {
      background: #462620;
      border-color: #A35545;
    }
    body.theme-dark .st-mini-card.neg .st-mini-val {
      color: #FFB4A2;
    }
    body.theme-dark .mg-desc {
      color: #E6D3BA;
    }
    body.theme-dark #wild-clear-modal .wcm-card,
    body.theme-dark #unlock-guide-modal .ugm-card {
      background: #2B1F17;
      border-color: #D9A14E;
      color: #F5E6D0;
    }
    body.theme-dark #wild-clear-modal .wcm-badge-circle,
    body.theme-dark #wild-clear-modal .wcm-reward-pill,
    body.theme-dark #unlock-guide-modal .ugm-tray,
    body.theme-dark #unlock-guide-modal .ugm-item {
      background: #3B2B21;
      border-color: #694E3A;
      color: #F5E6D0;
    }
    body.theme-dark #wild-clear-modal .wcm-title,
    body.theme-dark #wild-clear-modal .wcm-reward-num,
    body.theme-dark #unlock-guide-modal .ugm-title,
    body.theme-dark #unlock-guide-modal .ugm-item-name {
      color: #F5E6D0;
    }
    body.theme-dark #wild-clear-modal .wcm-desc,
    body.theme-dark #unlock-guide-modal .ugm-sub,
    body.theme-dark #unlock-guide-modal .ugm-tip {
      color: #C8AE90;
    }