* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
    color: #4A3423;
    background: linear-gradient(180deg, #A8DDF0 0%, #D7F3E8 70%, #BFE3B4 100%);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
.hidden { display: none !important; }

.game-mount { position: fixed; inset: 0; }
.game-mount canvas { display: block; width: 100%; height: 100%; }

/* ===== 顶栏 ===== */
.top-bar {
    position: fixed; top: 10px; left: 12px; right: 12px; z-index: 30;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(180deg, rgba(255,248,231,0.97), rgba(255,240,214,0.95));
    border: 2px solid #B9855A; border-radius: 18px;
    box-shadow: 0 6px 18px rgba(74,52,35,0.22);
    backdrop-filter: blur(4px);
}
.top-bar .return-btn {
    position: static; flex: 0 0 auto; z-index: auto;
    padding: 8px 13px; font-size: 13px;
}
.top-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-icon { font-size: 34px; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.18)); }
.brand-icon.large { font-size: 54px; }
.brand-copy h1 {
    font-size: clamp(18px, 2.4vw, 24px); font-weight: 800; letter-spacing: 1px;
    color: #6B4A2B; text-shadow: 0 1px 0 #FFF;
    white-space: nowrap;
}
.level-badge {
    display: inline-block; margin-top: 2px; padding: 1px 9px;
    background: linear-gradient(180deg, #FFD24A, #F5A623); color: #5A3A12;
    border-radius: 999px; font-size: 12px; font-weight: 800;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15);
}
.xp-track {
    width: 96px; height: 6px; margin-top: 4px;
    background: rgba(107,74,43,0.18); border-radius: 999px; overflow: hidden;
}
.xp-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8FD26A, #58B368); border-radius: 999px; transition: width 0.35s ease; }
.wallet-row { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; justify-content: flex-end; }
.chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 11px; border-radius: 999px; font-size: 14px; font-weight: 800;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.12), 0 2px 5px rgba(0,0,0,0.1);
    white-space: nowrap;
}
.chip b { font-variant-numeric: tabular-nums; }
.chip-gold { background: linear-gradient(180deg, #FFE08A, #FFC73C); color: #6B4A0A; }
.chip-silver { background: linear-gradient(180deg, #E9EEF5, #B9C4D2); color: #43505F; }
.chip-chest { background: linear-gradient(180deg, #F6C9A0, #D98A5A); color: #5B3112; }
.chip-wood { background: linear-gradient(180deg, #EBD9B8, #C9A878); color: #4E3318; }
.chip-stone { background: linear-gradient(180deg, #E4E8EC, #AEB6BF); color: #3D4650; }
.chip-energy { background: linear-gradient(180deg, #FFF1B8, #FFD966); color: #6B4A0A; }
.chip-lives { background: linear-gradient(180deg, #FFD9DE, #FF9AA6); color: #8A1E2B; }
.chip-lives-low { background: linear-gradient(180deg, #FFE3A8, #FFC24D); color: #7A4A0A; }
.chip-lives-dead { background: linear-gradient(180deg, #CFCFCF, #9A9A9A); color: #4A4A4A; }
.chip-task { background: linear-gradient(180deg, #DFF2C4, #A9D978); color: #3C5A1E; }
.chip-time { background: linear-gradient(180deg, #EAF2FB, #C6D9EC); color: #33506E; }

/* ===== 右侧快捷侧边栏 ===== */
.quick-sidebar {
    position: fixed; top: 92px; right: 12px; z-index: 40;
    display: flex; flex-direction: column; gap: 10px;
    padding: 10px;
    background: linear-gradient(180deg, rgba(255,248,231,0.92), rgba(255,240,214,0.9));
    border: 2px solid #B9855A; border-radius: 18px;
    box-shadow: 0 6px 18px rgba(74,52,35,0.22);
    backdrop-filter: blur(4px);
}
.quick-sidebar button {
    position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    width: 64px; padding: 8px 4px;
    border-radius: 14px; font-size: 12px; font-weight: 800; color: #5B3A15;
    background: linear-gradient(180deg, #FFFDF6, #F7EBD2);
    border: 1px solid rgba(185,133,90,0.55);
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.08), 0 2px 5px rgba(0,0,0,0.08);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.quick-sidebar button span { font-size: 24px; line-height: 1; }
.quick-sidebar button:hover {
    transform: translateX(-3px) scale(1.04);
    background: linear-gradient(180deg, #FFF9EA, #FFE7BC);
    box-shadow: 0 4px 12px rgba(185,133,90,0.35);
}
.quick-sidebar button:active { transform: translateX(-1px) scale(0.98); }
.quick-sidebar button.active-build {
    background: linear-gradient(180deg, #FFE9B0, #F7CE82);
    border-color: #D99A1F;
    box-shadow: 0 0 0 3px rgba(245,166,35,0.35), inset 0 -2px 0 rgba(0,0,0,0.12);
}
.quick-sidebar .quick-badge {
    position: absolute; top: 2px; right: 2px;
    min-width: 18px; height: 18px; padding: 0 4px;
    display: grid; place-items: center;
    background: linear-gradient(180deg, #FFD24A, #F5A623); color: #5A3A12;
    border-radius: 999px; font-size: 11px; font-style: normal; font-weight: 800;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
@media (max-width: 760px) {
    .quick-sidebar { top: 76px; right: 6px; gap: 7px; padding: 7px; }
    .quick-sidebar button { width: 52px; padding: 6px 2px; font-size: 10px; }
    .quick-sidebar button span { font-size: 20px; }
}

/* ===== 与飞机大战商城一致的货币硬币图标 ===== */
.currency-mini-icon {
    display: grid; place-items: center; flex: 0 0 auto;
    width: 20px; height: 20px; border-radius: 50%;
    border-width: 2px; border-style: solid;
    font-size: 10px; font-weight: 1000; font-style: normal; line-height: 1;
}
.bank-silver-icon {
    border-color: #f3fbff;
    background: linear-gradient(145deg, #eef7ff, #91a8c1 62%, #60758e);
    color: #35475e; text-shadow: 0 1px 0 #fff;
    box-shadow: 0 2px 0 #50657c, 0 4px 8px rgba(164, 204, 238, 0.18);
}
.bank-gold-icon {
    border-color: #fff1a4;
    background: linear-gradient(145deg, #ffe978, #f2aa09 62%, #bd6f00);
    color: #744200; text-shadow: 0 1px 0 #fff3a6;
    box-shadow: 0 2px 0 #955900, 0 4px 8px rgba(255, 190, 37, 0.2);
}
.price-tag .currency-mini-icon { width: 18px; height: 18px; font-size: 9px; }
.icon-btn {
    width: 38px; height: 38px; border-radius: 12px; font-size: 19px;
    background: linear-gradient(180deg, #FFF9EA, #F2E3C0);
    border: 1.5px solid #C9A878; box-shadow: 0 2px 5px rgba(0,0,0,0.12);
}
.icon-btn:active { transform: scale(0.94); }

/* ===== 右键浮动菜单（世界实体/背包/商店） ===== */
.item-menu {
    position: fixed; z-index: 60; min-width: 108px;
    display: flex; flex-direction: column; gap: 2px; padding: 4px;
    background: linear-gradient(180deg, rgba(255,248,231,0.98), rgba(255,240,214,0.97));
    border: 1.5px solid #B9855A; border-radius: 10px;
    box-shadow: 0 8px 20px rgba(40,28,16,0.28);
}
.item-menu-head {
    display: flex; align-items: center; gap: 5px;
    padding: 5px 8px 6px; margin-bottom: 1px; white-space: nowrap;
    font-size: 11px; font-weight: 900; color: #6B4A2B; max-width: 190px;
    background: linear-gradient(180deg, #FFF3D2, #FFE8B8);
    border: 1px solid #E7B45A; border-radius: 8px;
}
.item-menu-head span { font-size: 13px; line-height: 1; }
.item-menu-item {
    display: flex; align-items: center; gap: 6px; width: 100%;
    padding: 5px 8px; border-radius: 7px; white-space: nowrap;
    background: transparent; border: none; cursor: pointer;
    color: #5B3A15; text-align: left;
    font-size: 12px; font-weight: 700;
    transition: background 0.08s ease;
}
.item-menu-item span { font-size: 13px; line-height: 1; }
.item-menu-item:hover { background: #FFE9BE; }
.item-menu-item.accent { background: linear-gradient(180deg, #FFF3D2, #FFE3A0); border: 1px solid #E7B45A; }
.item-menu-item.disabled, .item-menu-item:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 一键收割 ===== */
.harvest-all-btn {
    position: fixed; right: 90px; bottom: 12px; z-index: 34;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 800;
    background: linear-gradient(180deg, #BDE89A, #8FD26A); color: #244017;
    border: 2px solid #5E9E3F; box-shadow: 0 4px 12px rgba(94,158,63,0.35);
}
.harvest-all-btn:active { transform: scale(0.95); }

.reset-view-btn {
    position: fixed; right: 12px; bottom: 64px; z-index: 34;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 9px 13px; border-radius: 999px; font-size: 13px; font-weight: 800;
    background: linear-gradient(180deg, #FFF9E8, #F2E3C0); color: #6B4A2B;
    border: 2px solid #D9BC8E; box-shadow: 0 3px 8px rgba(0,0,0,0.14);
}
.reset-view-btn:active { transform: scale(0.95); }

.equip-chip {
    position: fixed; left: 12px; bottom: 12px; z-index: 34;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 15px; border-radius: 999px; font-size: 13px; font-weight: 800;
    background: linear-gradient(180deg, #FFF9E8, #F2E3C0); color: #6B4A2B;
    border: 2px solid #D99A1F; box-shadow: 0 4px 12px rgba(185,133,90,0.35);
}
.equip-chip span { font-size: 18px; line-height: 1; }
.equip-chip:hover { transform: translateY(-2px); background: linear-gradient(180deg, #FFE9B0, #F7CE82); }
.equip-chip:active { transform: scale(0.96); }
.equip-chip .equip-remove {
    display: none; align-items: center; justify-content: center;
    width: 18px; height: 18px; margin-left: 2px; border-radius: 50%;
    background: rgba(215, 90, 74, 0.92); color: #fff;
    font-size: 11px; font-weight: 800; line-height: 1; flex: 0 0 auto;
}
.equip-chip .equip-remove:hover { background: #C0392B; transform: scale(1.08); }

.build-type-picker {
    position: fixed; bottom: 58px; left: 50%; transform: translateX(-50%);
    z-index: 36; display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,252,242,0.97), rgba(255,240,214,0.96));
    border: 2px solid #D99A1F; box-shadow: 0 5px 14px rgba(74,52,35,0.28);
}
.build-type-picker .build-type-label { font-size: 12px; font-weight: 800; color: #6B4A0A; white-space: nowrap; }
.build-type-picker .build-type-buttons { display: flex; gap: 6px; }
.build-type-picker .mini-btn { padding: 5px 13px; border-radius: 999px; font-size: 12px; font-weight: 800; }

/* ===== 区域提示条 ===== */
.zone-tip {
    position: fixed; bottom: 72px; left: 50%; transform: translateX(-50%);
    z-index: 29; padding: 7px 16px; border-radius: 999px;
    font-size: 13px; font-weight: 700; color: #4E6B2F;
    background: rgba(239, 249, 228, 0.94); border: 1.5px solid #9BC77A;
    box-shadow: 0 3px 10px rgba(50, 80, 30, 0.18); white-space: nowrap;
    pointer-events: none;
}

/* ===== 地块信息卡 ===== */
.plot-info {
    position: fixed; left: 12px; bottom: 96px; z-index: 32; width: min(300px, calc(100vw - 24px));
    background: linear-gradient(180deg, rgba(255,252,242,0.98), rgba(255,244,220,0.97));
    border: 2px solid #C9A878; border-radius: 16px; padding: 12px 14px;
    box-shadow: 0 6px 16px rgba(74,52,35,0.22);
}
.plot-info-close {
    position: absolute; top: 6px; right: 8px; width: 26px; height: 26px; border-radius: 50%;
    background: #F0DFC0; color: #7A5A33; font-size: 16px; line-height: 1;
}
.plot-info-title { font-size: 15px; font-weight: 800; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.req-desc { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.req-desc-row { display: flex; align-items: flex-start; gap: 7px; font-size: 12px; color: #9A7A50; line-height: 1.55; }
.req-desc-label {
    flex-shrink: 0; min-width: 36px; text-align: center; margin-top: 1px;
    padding: 1px 6px; border-radius: 7px; font-size: 11px; font-weight: 800;
    color: #6B4A0B; background: linear-gradient(180deg, #FFE9B0, #F7CE82);
}
.progress-track { height: 10px; border-radius: 999px; background: #E7D5B0; overflow: hidden; margin: 6px 0; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #A9D978, #58B368); transition: width 0.3s ease; }
.plot-info-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.mini-btn {
    padding: 7px 12px; border-radius: 12px; font-size: 13px; font-weight: 800;
    background: linear-gradient(180deg, #FFFDF4, #F4E7C8); border: 1.5px solid #D9BC8E; color: #6B4A2B;
    box-shadow: 0 2px 4px rgba(0,0,0,0.10);
}
.mini-btn:active { transform: scale(0.95); }
.mini-btn.primary { background: linear-gradient(180deg, #BDE89A, #8FD26A); border-color: #5E9E3F; color: #244017; }
.mini-btn.silver { background: linear-gradient(180deg, #E9EEF5, #B9C4D2); border-color: #8E9BAB; color: #3A4755; }
.mini-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ===== 弹窗 ===== */
.modal-root {
    position: fixed; inset: 0; z-index: 50;
    display: flex; align-items: center; justify-content: center;
    background: rgba(46,32,20,0.42); backdrop-filter: blur(2px);
}
.modal-card {
    width: min(460px, calc(100vw - 28px)); max-height: min(84vh, 640px);
    display: flex; flex-direction: column;
    background: linear-gradient(180deg, #FFFCF0, #FFF1D0);
    border: 3px solid #B9855A; border-radius: 22px;
    box-shadow: 0 14px 40px rgba(40,26,12,0.4);
    overflow: hidden;
}
.modal-card--wide {
    /* 固定宽高：不随内容伸缩，超出部分在 modal-body 内部滚动 */
    width: min(720px, calc(100vw - 28px));
    height: min(680px, 84vh);
}
.modal-head {
    display: flex; align-items: center; gap: 8px; padding: 13px 16px;
    background: linear-gradient(180deg, #FFE9B0, #F7CE82);
    border-bottom: 2px solid #D9B45F;
}
.modal-head h2 { font-size: 18px; font-weight: 800; color: #6B4A0A; flex: 1; }
.modal-close {
    width: 30px; height: 30px; border-radius: 50%; font-size: 17px;
    background: rgba(255,255,255,0.65); color: #7A5A33;
}
.modal-body { padding: 14px 16px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tab-btn {
    padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 800;
    background: #F3E3C2; color: #7A5A33;
}
.tab-btn.active { background: linear-gradient(180deg, #8FD26A, #6DBB4C); color: #FFF; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.item-card {
    padding: 10px; border-radius: 14px; background: #FFFDF4;
    border: 1.5px solid #E2C99B; text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}
.item-card .item-icon { font-size: 30px; line-height: 1.3; }
.item-card .tool-icon-img { width: 38px; height: 38px; object-fit: contain; vertical-align: middle; }
.item-card .shop-item-img {
    width: 88px; height: 88px; object-fit: cover; vertical-align: middle;
    border-radius: 12px; border: 1.5px solid #E8D3A8;
    box-shadow: 0 2px 6px rgba(90, 62, 28, 0.18);
    background: #FFFDF4;
}
.item-card .item-icon { display: flex; align-items: center; justify-content: center; min-height: 92px; }
.item-card .item-name { font-size: 13px; font-weight: 800; margin-top: 2px; }
.item-card .item-sub { font-size: 11px; color: #9A7A50; margin-top: 2px; min-height: 28px; }
.item-card .item-count { font-size: 11px; color: #6B8F3A; font-weight: 700; }

/* 商品详情弹窗 */
.shop-detail { display: flex; flex-direction: column; gap: 12px; min-width: 260px; }
.shop-detail .bag-detail-head { padding: 12px; background: #FFFDF4; border: 1.5px solid #E8D3A8; border-radius: 12px; }
.shop-detail-price {
    font-size: 16px; font-weight: 900; color: #A8792B; text-align: center;
    padding: 8px; background: #FFF6E0; border-radius: 10px; border: 1px solid #E7C98A;
}

/* ===== 背包装备槽 ===== */
.equip-slot-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.equip-slot {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 14px;
    background: linear-gradient(180deg, #FFFDF4, #F7EBD2);
    border: 2px dashed #C9A878; min-height: 58px;
}
.equip-slot-icon { font-size: 30px; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.16)); }
.equip-slot-copy { flex: 1; min-width: 0; }
.equip-slot-copy b { display: block; font-size: 14px; color: #5B3A15; }
.equip-slot-copy span { display: block; font-size: 11px; color: #9A7A50; margin-top: 2px; }
.bag-hint { font-size: 11px; color: #A0855C; line-height: 1.5; }
.equipped-tag {
    display: inline-block; margin-left: 4px; padding: 1px 8px;
    border-radius: 999px; font-size: 10px; font-weight: 800; color: #FFF;
    background: linear-gradient(90deg, #58B368, #3F9A53);
    vertical-align: middle;
}
.bag-item-card.equippable { cursor: grab; }
.bag-item-card.equippable:active { cursor: grabbing; }

/* ==== 背包：左右两栏布局 ==== */
.bag-layout { display: flex; gap: 14px; align-items: flex-start; }

/* 左侧格子区：撑满弹窗可用高度，超出部分由 modal-body 统一滚动 */
.bag-grid-wrap {
    flex: 1; min-width: 0;
    padding-right: 4px;
}

/* ===== 背包格子（放大展示，点击查看详情） ===== */
.bag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
    gap: 12px;
}
.bag-cell {
    position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    padding: 12px 8px; border-radius: 14px;
    background: #FFFDF4; color: #5B3A15;
    border: 2px solid #E2C99B; border-top: 4px solid #D9BC8E;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    cursor: pointer;
}
.bag-cell:hover { transform: translateY(-2px); background: #FFF7E6; border-color: #C9A878; }
.bag-cell.selected { outline: 3px solid #F5A623; outline-offset: 1px; }
.bag-cell .shop-item-img {
    width: 123px; height: 123px; object-fit: cover;
    border-radius: 12px; border: 1.5px solid #E8D3A8; background: #FFFDF4;
}
.bag-cell .item-icon {
    font-size: 50px; min-height: 68px;
    display: flex; align-items: center; justify-content: center;
}
.bag-cell .bag-cell-icon {
    width: 96px; height: 96px; object-fit: contain;
    border-radius: 12px; background: #FFFDF4;
}
.bag-cell-name { font-size: 14px; font-weight: 800; text-align: center; }
.bag-cell-badge {
    position: absolute; top: 6px; right: 6px;
    width: 22px; height: 22px; border-radius: 50%;
    display: grid; place-items: center;
    background: #58B368; color: #FFF; font-style: normal; font-size: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

/* 右侧详情面板（固定宽度，网游式） */
.bag-detail {
    width: 210px; flex: 0 0 210px;
    display: flex; flex-direction: column; gap: 12px;
    padding: 14px;
    background: linear-gradient(180deg, #FFFDF4, #F7EBD2);
    border: 1.5px solid #C9A878; border-radius: 14px;
    position: sticky; top: 0;
}
.bag-detail-empty { padding: 26px 8px; color: #A0855C; font-size: 12px; text-align: center; line-height: 1.6; }
/* 共享基础：头部（商店详情与背包共用） */
.bag-detail-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bag-detail-meta { min-width: 0; }
.bag-detail-name { font-size: 15px; font-weight: 800; color: #5B3A15; }
.bag-detail-desc { font-size: 12px; color: #7A5A33; margin-top: 3px; }
.bag-detail-count { font-size: 12px; color: #6B8F3A; font-weight: 700; margin-top: 3px; }
.bag-detail-actions { flex: 0 0 auto; }
/* 背包右侧详情面板覆盖：竖向排列（展示文本，不再展示大图） */
.bag-detail .bag-detail-head {
    display: flex; flex-direction: column; align-items: stretch; gap: 6px;
    min-width: 0; text-align: left;
}
.bag-detail .bag-detail-name { font-size: 16px; font-weight: 800; color: #5B3A15; }
.bag-detail .bag-detail-desc { font-size: 12px; color: #7A5A33; margin-top: 4px; line-height: 1.5; }
.bag-detail .bag-detail-count { font-size: 12px; color: #6B8F3A; font-weight: 700; margin-top: 4px; }

/* ===== 详情属性卡（网游式信息密集） ===== */
.item-detail-card {
    display: flex; flex-direction: column; gap: 10px;
    min-width: 0; width: 100%;
}
.item-detail-card-title { text-align: center; padding-bottom: 4px; }
.item-detail-name { font-size: 17px; font-weight: 900; color: #5B3A15; }
.item-detail-type {
    display: inline-block; margin-top: 6px; padding: 2px 12px;
    border: 1.5px solid #C9A878; border-radius: 999px;
    font-size: 11px; font-weight: 700; color: #7A5A33; background: #F7EBD2;
}
.item-detail-section { background: #FFFDF4; border: 1.5px solid #E8D3A8; border-radius: 10px; overflow: hidden; }
.item-detail-sec-title { padding: 6px 10px; background: #F7EBD2; border-bottom: 1px solid #E8D3A8; font-size: 11px; font-weight: 800; color: #7A5A33; letter-spacing: 1px; }
.item-detail-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 10px; font-size: 12px; }
.item-detail-row + .item-detail-row { border-top: 1px dashed #E8D3A8; }
.item-detail-row .k { color: #7A5A33; flex: 0 0 auto; }
.item-detail-row .v { color: #5B3A15; font-weight: 700; text-align: right; }
.item-detail-desc { font-size: 12px; color: #7A5A33; line-height: 1.6; padding: 0 2px; }
.item-detail-note { font-size: 11px; color: #A0855C; line-height: 1.6; padding: 0 2px; }
.item-detail-actions { margin-top: 2px; }
.item-detail-actions .primary-btn,
.item-detail-actions .ghost-btn { width: 100%; }
.bag-detail .bag-detail-actions { width: 100%; }
.bag-detail .bag-detail-actions .ghost-btn,
.bag-detail .bag-detail-actions .primary-btn { width: 100%; }

/* 格子下方小字（价格/拥有数） */
.bag-cell-sub { font-size: 11px; color: #A0855C; font-weight: 700; text-align: center; }

/* ===== 物品信息浮窗（跟随格子，半透明，只读展示） ===== */
.bag-grid-wrap { position: relative; }
.item-float-tooltip {
    position: fixed; z-index: 999;
    width: 236px; max-height: 72vh; overflow-y: auto;
    padding: 12px;
    background: rgba(255, 252, 240, 0.94);
    border: 2px solid rgba(201, 168, 120, 0.85);
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(40, 26, 12, 0.35);
    backdrop-filter: blur(3px);
    pointer-events: auto;
    animation: floatPop 0.12s ease-out;
}
.item-float-tooltip .item-detail-card { gap: 8px; }
.item-float-tooltip .item-detail-card-title { text-align: center; }
@keyframes floatPop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* 详情面板：价格块 */
.bag-detail-price { width: 100%; display: flex; justify-content: center; margin-top: 2px; }
.bag-detail-price .price-tag { margin: 0; }

/* 选种子：右侧品质按钮垂直列表 */
.bag-detail-actions.seed-quality-list { display: flex; flex-direction: column; gap: 8px; }
.bag-detail-actions.seed-quality-list .seed-quality-btn {
    width: 100%; justify-content: center;
}
.bag-detail-actions.seed-quality-list .seed-quality-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ===== 播种品质选择 ===== */
.seed-list { display: flex; flex-direction: column; gap: 10px; }
.seed-card {
    padding: 10px 12px; border-radius: 14px; background: #FFFDF4;
    border: 1.5px solid #E2C99B; box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}
.seed-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.seed-card-head .item-icon { font-size: 28px; }
.seed-quality-row { display: flex; gap: 8px; flex-wrap: wrap; }
.seed-quality-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 800;
    background: #F3E3C2; color: #7A5A33; border: 1.5px solid #D9BC8E;
    box-shadow: 0 2px 4px rgba(0,0,0,0.10);
}
.seed-quality-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.seed-quality-btn:active { transform: scale(0.95); }
.price-tag {
    display: inline-flex; align-items: center; gap: 3px; margin: 5px 0;
    padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 800;
}
.price-gold { background: #FFE08A; color: #6B4A0A; }
.price-silver { background: #E2E9F2; color: #43505F; }
.quality-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #FFF; }
.quality-normal { background: #58B368; }
.quality-commercial { background: #6FA8DC; }
.quality-premium { background: linear-gradient(90deg, #B48AE0, #8F6BC0); }
.empty-tip { text-align: center; color: #A0855C; padding: 26px 0; font-size: 14px; }

/* ===== 开箱/银行/任务 ===== */
.hero-block { text-align: center; padding: 8px 0 4px; }
.hero-icon { font-size: 64px; display: block; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.18)); }
.hero-copy { color: #7A5A33; margin: 8px 0 14px; font-size: 14px; }
.reward-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0; }
.reward-item {
    padding: 8px 12px; border-radius: 12px; background: #FFFDF4;
    border: 1.5px solid #E2C99B; font-size: 13px; font-weight: 800;
}
.primary-btn {
    padding: 11px 26px; border-radius: 999px; font-size: 15px; font-weight: 800;
    background: linear-gradient(180deg, #FFD24A, #F5A623); color: #5A3A12;
    border: 2px solid #D99A1F; box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.primary-btn:active { transform: scale(0.96); }
.ghost-btn {
    padding: 9px 18px; border-radius: 999px; font-size: 13px; font-weight: 800;
    background: #F3E3C2; color: #7A5A33; border: 1.5px solid #D9BC8E;
}
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-row {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    border-radius: 14px; background: #FFFDF4; border: 1.5px solid #E2C99B;
}
.task-row .task-copy { flex: 1; font-size: 13px; }
.task-row .task-progress { color: #9A7A50; font-size: 12px; margin-top: 2px; }

/* ===== 地块标签层 ===== */
.plot-labels { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.plot-chip {
    position: absolute; transform: translate3d(-50%, -50%, 0);
    will-change: transform;
    display: flex; align-items: center; gap: 3px;
    padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 800;
    background: rgba(255,252,240,0.92); border: 1px solid rgba(185,133,90,0.6);
    box-shadow: 0 1px 4px rgba(0,0,0,0.15); white-space: nowrap;
}
.plot-chip .chip-bar { width: 34px; height: 5px; border-radius: 99px; background: #E7D5B0; overflow: hidden; }
.plot-chip .chip-bar i { display: block; height: 100%; background: linear-gradient(90deg, #A9D978, #58B368); }
.plot-chip.locked { background: rgba(90,80,70,0.88); color: #FFE08A; border-color: #3D342C; }
.plot-chip.mature { background: linear-gradient(90deg, #FFF3B8, #FFD24A); color: #6B4A0A; border-color: #E7B45A; }
.plot-chip.tree { background: rgba(62, 118, 58, 0.92); color: #EAF7DE; border-color: #2F5E2E; }

/* ===== 悬停提示 ===== */
.hover-tip {
    position: absolute; transform: translate(-50%, -100%);
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 10px; border-radius: 12px;
    background: linear-gradient(180deg, #FFF9E8, #FFE9B8);
    border: 2px solid #D9A43F; color: #6B4A0A;
    font-size: 12px; font-weight: 700;
    box-shadow: 0 4px 12px rgba(74,52,35,0.28);
    pointer-events: none; z-index: 25;
    transition: opacity 0.12s ease;
    max-width: min(280px, calc(100vw - 20px));
}
.hover-tip.no { background: linear-gradient(180deg, #F3EDE4, #E3D6C3); border-color: #B9A888; color: #8A6F4E; }
.hover-tip .hover-icon { font-size: 18px; line-height: 1; }
.hover-tip .hover-body { display: flex; flex-direction: column; gap: 2px; }
.hover-tip .hover-line { display: flex; align-items: baseline; gap: 5px; }
.hint-label {
    flex-shrink: 0; font-size: 11px; font-weight: 800; line-height: 1.6;
    padding: 0 5px; border-radius: 6px;
    background: rgba(255,255,255,0.6); color: #B07A1E;
}
.hover-tip.no .hint-label { color: #8A6F4E; background: rgba(255,255,255,0.45); }
.hover-tip.showing { animation: tipIn 0.14s ease; }
@keyframes tipIn { from { opacity: 0; transform: translate(-50%, -90%); } to { opacity: 1; transform: translate(-50%, -100%); } }

/* ===== Toast ===== */
.toast-root {
    position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%); z-index: 70;
    display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toast {
    padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 800;
    background: rgba(52,42,30,0.92); color: #FFF8E7;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    animation: toastIn 0.25s ease;
}
.toast.success { background: rgba(72,139,58,0.94); }
.toast.error { background: rgba(180,64,52,0.94); }
.toast.warn { background: rgba(196,128,32,0.94); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== 时长锁屏 ===== */
.time-lock-overlay {
    position: fixed; inset: 0; z-index: 85;
    display: flex; align-items: center; justify-content: center;
    background: rgba(35,26,16,0.55); backdrop-filter: blur(3px);
}
.time-lock-card {
    width: min(400px, calc(100vw - 32px)); padding: 28px 24px;
    background: linear-gradient(180deg, #FFFCF0, #FFF1D0);
    border: 3px solid #B9855A; border-radius: 22px; text-align: center;
    box-shadow: 0 14px 40px rgba(30,20,10,0.45);
}
.time-lock-card h2 { color: #6B4A2B; margin: 6px 0 10px; }
.time-lock-card p { color: #7A5A33; font-size: 14px; line-height: 1.7; margin-bottom: 18px; }

/* ===== 新手引导 ===== */
.tutorial-overlay {
    position: fixed; inset: 0; z-index: 80;
    display: flex; align-items: center; justify-content: center;
    background: rgba(35,26,16,0.5); backdrop-filter: blur(2px);
}
.tutorial-card {
    width: min(420px, calc(100vw - 32px)); padding: 24px;
    background: linear-gradient(180deg, #FFFCF0, #FFF1D0);
    border: 3px solid #B9855A; border-radius: 22px; text-align: center;
    box-shadow: 0 14px 40px rgba(30,20,10,0.45);
}
.tutorial-card h2 { color: #6B4A2B; margin-bottom: 10px; }
.tutorial-card p { color: #7A5A33; font-size: 14px; line-height: 1.7; margin-bottom: 16px; }
.tutorial-actions { display: flex; justify-content: center; gap: 10px; }

/* ===== 返回按钮 ===== */
.return-btn {
    position: fixed; left: 12px; top: 12px; z-index: 40;
    display: flex; align-items: center; gap: 5px; padding: 10px 16px;
    border-radius: 999px; font-size: 14px; font-weight: 800;
    background: linear-gradient(180deg, #FFD24A, #F5A623); color: #5A3A12;
    border: 2px solid #D99A1F; box-shadow: 0 3px 8px rgba(0,0,0,0.18);
}

/* ===== 窄屏适配 ===== */
@media (max-width: 640px) {
    .top-bar { top: 8px; left: 8px; right: 8px; padding: 8px 10px; border-radius: 14px; gap: 6px; }
    .top-bar .return-btn { padding: 7px 10px; font-size: 12px; }
    .top-left { gap: 8px; }
    .brand-icon { font-size: 26px; }
    .brand-copy h1 { font-size: 16px; }
    .xp-track { width: 72px; }
    .chip { padding: 5px 9px; font-size: 12px; }
    .chip span:last-child { display: none; }
    .icon-btn { width: 32px; height: 32px; font-size: 16px; }
    .plot-info { left: 8px; right: 8px; bottom: 84px; width: auto; }
    .harvest-all-btn { right: 90px; bottom: 78px; padding: 8px 12px; font-size: 12px; }
}

/* ===== 顶部栏紧凑化 + 右上角小地图 ===== */
.top-bar {
    top: 4px; padding: 3px 8px; border-radius: 10px; gap: 5px;
    box-shadow: 0 2px 8px rgba(74,52,35,0.16);
}
.top-bar .return-btn { padding: 3px 8px; font-size: 15px; line-height: 1; }
.brand { gap: 5px; }
.brand-icon { font-size: 18px; }
.brand-copy h1 { font-size: 12px; letter-spacing: 0; }
.level-badge { font-size: 9px; padding: 0 5px; }
.xp-track { width: 44px; height: 3px; margin-top: 2px; }
.wallet-row { gap: 4px; }
.chip { padding: 2px 6px; font-size: 10px; gap: 3px; }
.currency-mini-icon { width: 14px; height: 14px; border-width: 1.5px; font-size: 7px; }
.icon-btn { width: 24px; height: 24px; font-size: 13px; border-radius: 8px; }
.quick-sidebar { top: 196px; }

.minimap-wrap { 
    position: fixed; top: 62px; right: 10px; z-index: 33;
    padding: 3px; background: rgba(255,248,231,0.82);
    border: 1.5px solid #B9855A; border-radius: 10px;
    box-shadow: 0 3px 10px rgba(74,52,35,0.18);
    pointer-events: none;
}
.minimap-wrap.collapsed { padding: 3px; border-radius: 50%; }
#minimapWrap.collapsed #minimap { display: none; }
#minimap { display: block; width: 140px; height: 108px; border-radius: 7px; background: #A7D78C; }
#minimapToggle {
    position: absolute; top: -6px; right: -6px; z-index: 1;
    width: 20px; height: 20px; border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(180deg, #FFE9B0, #F7CE82); color: #6B4A0A;
    border: 2px solid #D99A1F; font-size: 12px; font-weight: 800; line-height: 1;
    pointer-events: auto; box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.minimap-wrap.collapsed #minimapToggle { position: static; width: 26px; height: 26px; font-size: 14px; }

/* ===== 战争迷雾：人物周围一圈清晰，其余被雾覆盖，随人物移动 ===== */
#fogOfWar {
    position: fixed; inset: 0; z-index: 24;
    pointer-events: none;
    /* 多个错位圆叠加成不规则雾团：中心清晰、边缘参差并缓慢漂移，避免纯圆形 */
    background:
        radial-gradient(circle at calc(var(--fx, 50%) + var(--ox1, 0px)) calc(var(--fy, 50%) + var(--oy1, 0px)),
            rgba(201, 207, 212, 0) 0px,
            rgba(201, 207, 212, 0) var(--rc1, 440px),
            rgba(201, 207, 212, 0.5) calc(var(--rc1, 440px) + (var(--rf1, 660px) - var(--rc1, 440px)) * 0.5),
            rgba(201, 207, 212, 1) var(--rf1, 660px)),
        radial-gradient(circle at calc(var(--fx, 50%) + var(--ox2, 0px)) calc(var(--fy, 50%) + var(--oy2, 0px)),
            rgba(201, 207, 212, 0) 0px,
            rgba(201, 207, 212, 0) var(--rc2, 440px),
            rgba(201, 207, 212, 0.5) calc(var(--rc2, 440px) + (var(--rf2, 660px) - var(--rc2, 440px)) * 0.5),
            rgba(201, 207, 212, 1) var(--rf2, 660px)),
        radial-gradient(circle at calc(var(--fx, 50%) + var(--ox3, 0px)) calc(var(--fy, 50%) + var(--oy3, 0px)),
            rgba(201, 207, 212, 0) 0px,
            rgba(201, 207, 212, 0) var(--rc3, 440px),
            rgba(201, 207, 212, 0.5) calc(var(--rc3, 440px) + (var(--rf3, 660px) - var(--rc3, 440px)) * 0.5),
            rgba(201, 207, 212, 1) var(--rf3, 660px)),
        radial-gradient(circle at calc(var(--fx, 50%) + var(--ox4, 0px)) calc(var(--fy, 50%) + var(--oy4, 0px)),
            rgba(201, 207, 212, 0) 0px,
            rgba(201, 207, 212, 0) var(--rc4, 440px),
            rgba(201, 207, 212, 0.5) calc(var(--rc4, 440px) + (var(--rf4, 660px) - var(--rc4, 440px)) * 0.5),
            rgba(201, 207, 212, 1) var(--rf4, 660px)),
        radial-gradient(circle at calc(var(--fx, 50%) + var(--ox5, 0px)) calc(var(--fy, 50%) + var(--oy5, 0px)),
            rgba(201, 207, 212, 0) 0px,
            rgba(201, 207, 212, 0) var(--rc5, 440px),
            rgba(201, 207, 212, 0.5) calc(var(--rc5, 440px) + (var(--rf5, 660px) - var(--rc5, 440px)) * 0.5),
            rgba(201, 207, 212, 1) var(--rf5, 660px)),
        radial-gradient(circle at calc(var(--fx, 50%) + var(--ox6, 0px)) calc(var(--fy, 50%) + var(--oy6, 0px)),
            rgba(201, 207, 212, 0) 0px,
            rgba(201, 207, 212, 0) var(--rc6, 440px),
            rgba(201, 207, 212, 0.5) calc(var(--rc6, 440px) + (var(--rf6, 660px) - var(--rc6, 440px)) * 0.5),
            rgba(201, 207, 212, 1) var(--rf6, 660px));
}

/* 人物完全被迷雾遮住（在屏幕外）时的小提示，按空格可回到人物身边 */
.fog-hint {
    position: fixed; left: 50%; bottom: 140px; transform: translateX(-50%);
    z-index: 40; padding: 8px 16px; border-radius: 999px;
    background: rgba(40, 45, 50, 0.82); color: #fff; font-size: 14px;
    pointer-events: none; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}
.fog-hint.hidden { display: none; }

/* ===== 进场加载遮罩：页面打开立即可见，场景构建完成后移除 ===== */
.farm-loading {
    position: fixed; inset: 0; z-index: 90;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(180deg, #7EC850 0%, #5FA83D 100%);
}
.farm-loading-card {
    padding: 18px 30px; border-radius: 14px;
    background: rgba(30, 40, 25, 0.75); color: #fff;
    font-size: 16px; font-weight: 700; letter-spacing: 2px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
    animation: farm-loading-pulse 1.2s ease-in-out infinite;
}
@keyframes farm-loading-pulse {
    0%, 100% { transform: scale(1); opacity: 0.92; }
    50% { transform: scale(1.05); opacity: 1; }
}

/* ===== 益智题（美术 / 数独）弹窗 ===== */
.quiz-block { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.quiz-prompt { font-size: 15px; font-weight: 700; color: #4A3A22; text-align: center; }
.quiz-prompt b { color: #D97706; }
.quiz-options { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.quiz-choices { flex-direction: column; }
.quiz-option {
    display: flex; align-items: center; gap: 8px; min-width: 92px;
    padding: 10px 16px; border-radius: 12px; font-size: 15px; font-weight: 800;
    background: #FFFDF4; color: #5A3A12; border: 2px solid #E2C99B; cursor: pointer;
}
.quiz-option:hover { border-color: #D9A94A; background: #FFF6DF; }
.quiz-option.selected { border-color: #58B368; background: #EAF7E4; }
.quiz-emoji { font-size: 24px; }
.quiz-canvas-wrap {
    border: 2px dashed #C9B99A; border-radius: 14px; padding: 6px; background: #fff;
}
.quiz-canvas { display: block; border-radius: 10px; touch-action: none; cursor: crosshair; }
.quiz-canvas-tools, .quiz-sudoku-tools { display: flex; gap: 12px; }
.quiz-result { display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 800; text-align: center; }
.quiz-result.result-correct { color: #2E7D32; }
.quiz-result.result-wrong { color: #C62828; }
/* 答对庆祝：绚丽多彩礼花爆发 + 中心光球脉冲（动态动画） */
.confetti-burst {
    position: relative; width: 116px; height: 96px;
    margin: 4px auto 2px;
}
.confetti-burst .confetti-core {
    position: absolute; left: 50%; top: 50%;
    width: 30px; height: 30px; border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #FFF6D8, #FFD24A 55%, #F9A825);
    box-shadow: 0 0 18px 6px rgba(255, 210, 74, 0.55);
    transform: translate(-50%, -50%);
    animation: confettiCore 1.1s ease-in-out infinite;
}
.confetti-burst .confetti {
    position: absolute; left: 50%; top: 50%;
    width: 9px; height: 14px; border-radius: 2px;
    background: var(--c, #FFD24A);
    opacity: 0;
    animation: confettiFly 1.5s cubic-bezier(0.12, 0.55, 0.3, 1) infinite;
    animation-delay: var(--d, 0s);
}
@keyframes confettiFly {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2) rotate(0deg); }
    10% { opacity: 1; }
    65% { opacity: 1; }
    100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); }
}
@keyframes confettiCore {
    0%, 100% { transform: translate(-50%, -50%) scale(0.65); opacity: 0.75; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}
.sudoku-grid {
    display: grid; gap: 8px;
    border: 3px solid #B06A3B; border-radius: 12px; padding: 8px;
    background: rgba(226, 201, 155, 0.18);
}
.sudoku-box {
    display: grid; gap: 2px; padding: 5px; border: 3px solid #B06A3B; border-radius: 10px;
    background: rgba(226, 201, 155, 0.18);
}
.sudoku-cell {
    width: 42px; height: 42px; text-align: center; font-size: 18px; font-weight: 800;
    background: #FFFEF8; border: none; color: #4A3A22; border-radius: 4px; outline: none;
}
.sudoku-cell:focus { background: #FFF1CC; }
.sudoku-fixed { background: #FAF1DA; color: #7A5A33; }

/* ===== 益智题奖励横幅 ===== */
.quiz-reward-host { width: 100%; margin-top: 2px; }
.quiz-reward {
    display: flex; align-items: center; gap: 8px; justify-content: center;
    padding: 9px 12px; border-radius: 10px;
    background: linear-gradient(135deg, #FFF6DF, #FFEBC7);
    border: 1.5px solid #F0C779; font-size: 13px; color: #6B4E1E; font-weight: 800;
}
.quiz-reward-icon { font-size: 18px; }
.quiz-reward-sub { color: #9A7A44; font-weight: 700; font-size: 12px; }

/* ===== 倒地掉包弹层 ===== */
.death-overlay {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(20, 20, 25, 0.5);
    display: flex; align-items: center; justify-content: center;
}
.death-card {
    width: min(400px, 88vw); padding: 20px 22px; border-radius: 18px;
    background: #FFFDF4; border: 2px solid #D9A94A; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.death-card h2 { color: #C62828; }
.death-card .death-expire { color: #9A7A50; font-size: 13px; }
.death-card .death-actions { margin-top: 4px; }
.death-card .death-note { color: #7A5A33; font-size: 12px; }
