* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f1115; --panel: #171a21; --panel2: #1e222b; --line: #2a2f3a;
  --txt: #e6e9ef; --dim: #8b93a1; --gold: #d8b25c; --green: #4fb477;
  --red: #d9534f; --blue: #5b8def; --purple: #9b7bd4;
}
body { background: var(--bg); color: var(--txt); font: 14px/1.6 "Microsoft YaHei", system-ui, sans-serif; }
a { color: var(--gold); text-decoration: none; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 20px; }
.auth { max-width: 380px; margin: 10vh auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 28px; }
.auth-wechat { margin-top: 5vh; margin-bottom: 5vh; }
.auth h1 { font-size: 22px; margin-bottom: 6px; letter-spacing: 2px; }
.auth p.sub { color: var(--dim); margin-bottom: 20px; font-size: 12px; }
.auth input { width: 100%; padding: 10px 12px; margin-bottom: 10px; background: #0c0e12; border: 1px solid var(--line); color: var(--txt); border-radius: 6px; }
.auth button { width: 100%; padding: 11px; background: var(--gold); color: #17130a; border: 0; border-radius: 6px; font-weight: 700; cursor: pointer; }
.auth .err { color: var(--red); font-size: 12px; margin-bottom: 10px; min-height: 18px; }
.auth .switch { text-align: center; margin-top: 14px; font-size: 12px; color: var(--dim); }
.gender-label { color: var(--dim); font-size: 12px; margin: 2px 0 7px; }
.gender-pick { display: flex; gap: 8px; margin-bottom: 12px; }
.gender-option { flex: 1; cursor: pointer; }
.auth .gender-option input { display: none; }
.gender-option span { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: #0c0e12; color: #aeb8c4; transition: border-color .15s, background .15s, color .15s; }
.gender-option span b { color: #d9e2ec; font-size: 14px; }
.gender-option span small { font-size: 10px; color: #778494; }
.auth .gender-option input:checked + span { border-color: #c9a24a; background: #241f12; color: #e8cb84; }
.auth .gender-option input:checked + span b { color: #f0d58c; }
.auth .gender-option input:checked + span small { color: #bfae7f; }

.topbar { display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: #121419; position: sticky; top: 0; z-index: 20; }
.topbar .logo { font-size: 18px; letter-spacing: 3px; color: var(--gold); font-weight: 700; }
.topbar .who { color: var(--dim); font-size: 12px; }
.topbar .clock { margin-left: auto; text-align: right; font-size: 12px; color: var(--dim); }
.topbar .clock b { color: var(--txt); font-size: 14px; }
.topbar .cash { color: var(--gold); font-weight: 700; }
.topbar .top-admin-link { margin-left: 4px; padding: 4px 9px; border: 1px solid #6a5728; border-radius: 5px; background: #241e10; color: #e9c76e; font-size: 11px; text-decoration: none; }
.topbar .top-admin-link:hover { background: #382c14; border-color: #a78a3b; }

/* 左上角角色 HUD：头像、生命、健康、疲劳 */
.player-hud { position: fixed; z-index: 15; top: 126px; left: 16px; display: flex; align-items: center; gap: 10px; width: 244px; padding: 9px 10px; border: 1px solid #49515d; border-radius: 10px; background: linear-gradient(145deg, #111924f2, #080d14f2); box-shadow: 0 8px 24px #0008; backdrop-filter: blur(8px); pointer-events: none; }
.hud-avatar { --skin: #d7ad86; --body: #48647f; --hair: #2b211d; position: relative; flex: 0 0 56px; width: 56px; height: 56px; border: 2px solid #c4a355; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 28%, #243142, #0b1017 72%); box-shadow: inset 0 0 10px #0008, 0 0 0 1px #000; }
.hud-hair { position: absolute; z-index: 1; left: 50%; top: 4px; width: 34px; height: 27px; transform: translateX(-50%); border-radius: 18px 18px 9px 9px; background: var(--hair); }
.hud-face { position: absolute; z-index: 2; left: 50%; top: 11px; width: 23px; height: 27px; transform: translateX(-50%); border-radius: 50% 50% 45% 45%; background: var(--skin); box-shadow: inset 0 -2px 0 #0002; }
.hud-shoulders { position: absolute; z-index: 3; left: 50%; bottom: -7px; width: 46px; height: 25px; transform: translateX(-50%); border-radius: 50% 50% 0 0; background: var(--body); box-shadow: inset 0 2px 0 #fff1; }
.hud-avatar.female .hud-hair { top: 3px; width: 39px; height: 44px; border-radius: 20px 20px 17px 17px; }
.hud-avatar.female .hud-shoulders { width: 41px; }
.hud-vitals { min-width: 0; flex: 1 1 auto; }
.hud-name { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 3px; line-height: 1.1; }
.hud-name b { overflow: hidden; color: #f1d996; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.hud-name span { flex: 0 0 auto; color: #788496; font-size: 8px; letter-spacing: 1px; }
.hud-vital { display: grid; grid-template-columns: 28px 22px minmax(0, 1fr); align-items: center; gap: 4px; height: 16px; font-size: 9px; }
.hud-vital > span { color: #9eabbc; }
.hud-vital > b { color: #e8edf4; font-size: 10px; font-weight: 600; text-align: right; }
.hud-vital > i { display: block; height: 5px; overflow: hidden; border: 1px solid #303b49; border-radius: 4px; background: #05090e; }
.hud-vital > i > em { display: block; width: 0; height: 100%; border-radius: 3px; transition: width .35s ease; }
.hud-vital.hp > i > em { background: linear-gradient(90deg, #8e332f, #e06f61); }
.hud-vital.health > i > em { background: linear-gradient(90deg, #39704c, #7bc58e); }
.hud-vital.fatigue > i > em { background: linear-gradient(90deg, #7d5a20, #d5a64d); }

@media (max-width: 720px) {
  .player-hud { top: 118px; left: 10px; width: 224px; transform: scale(.92); transform-origin: top left; }
}
.app-drawer-open .player-hud { visibility: hidden; opacity: 0; }
body:has(.town-page.temple-mode) .player-hud,
body:has(.town-page.admin-mode) .player-hud { visibility: hidden; opacity: 0; }

.tabs { display: flex; gap: 4px; padding: 10px 20px 0; border-bottom: 1px solid var(--line); background: #121419; position: sticky; top: 57px; z-index: 19; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.tabs button { flex: 0 0 auto; }

.tabs button { background: none; border: 0; color: var(--dim); padding: 8px 14px; cursor: pointer; border-bottom: 2px solid transparent; font-size: 13px; }
.tabs button.on { color: var(--gold); border-bottom-color: var(--gold); }
.tabs .admin-map-link { flex: 0 0 auto; margin-left: auto; color: #e9c76e; text-decoration: none; font-size: 12px; border: 1px solid #6a5728; background: #241e10; border-radius: 5px; padding: 5px 10px; align-self: center; }
.tabs .admin-map-link:hover { background: #382c14; border-color: #a78a3b; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.card h3 { font-size: 14px; margin-bottom: 12px; color: var(--gold); letter-spacing: 1px; }
.card h4 { font-size: 13px; margin: 10px 0 6px; color: var(--dim); }
.stat { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; border-bottom: 1px dashed #23262f; }
.stat:last-child { border: 0; }
.stat span { color: var(--dim); }

.bar { height: 8px; background: #0c0e12; border-radius: 4px; overflow: hidden; margin: 3px 0 10px; }
.bar i { display: block; height: 100%; }
.bar .h { background: var(--green); } .bar .f { background: var(--gold); }
.bar .n { background: var(--red); } .bar .w { background: var(--blue); }

table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #23262f; }
th { color: var(--dim); font-weight: 400; }
tr:hover td { background: #1b1f27; }

.btn { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); padding: 6px 12px; border-radius: 5px; cursor: pointer; font-size: 12px; }
.btn:hover { border-color: var(--gold); color: var(--gold); }
.btn.gold { background: var(--gold); color: #17130a; border-color: var(--gold); font-weight: 700; }
.btn.small { padding: 3px 8px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
input[type=number], select, input[type=text] { background: #0c0e12; border: 1px solid var(--line); color: var(--txt); padding: 5px 8px; border-radius: 4px; font-size: 12px; }

.map { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; margin: 10px auto; max-width: 760px; }
.cell { height: 24px; border-radius: 3px; font-size: 9px; display: flex; align-items: center; justify-content: center; color: #0b0d10; cursor: pointer; border: 1px solid transparent; overflow: hidden; }
.cell.shop { background: #d8b25c; } .cell.house { background: #5b8def; }
.cell.industry { background: #9b7bd4; } .cell.farm { background: #4fb477; }
.cell.public { background: #6b7280; color: #fff; }
.cell.none { background: #25333f; color: #6f8494; }
.map.land40 { max-width: 100%; gap: 1px; }
.map.land40 .cell { height: 13px; border-radius: 2px; font-size: 8px; }
.land-scroll { max-height: 72vh; overflow: auto; background: #0d1721; border: 1px solid #31465c; border-radius: 4px; }
.land-canvas { display: block; width: 2000px; height: 2000px; max-width: none; background: #0d1721; cursor: pointer; }
.cell.mine { outline: 2px solid #fff; }
.cell.owned { filter: brightness(.65); }
.cell:hover { border-color: #fff; }
.legend span { display: inline-block; margin-right: 12px; font-size: 11px; color: var(--dim); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); background: #232833; border: 1px solid var(--gold); color: var(--txt); padding: 10px 18px; border-radius: 6px; z-index: 99; display: none; max-width: 80vw; }
.toast.err { border-color: var(--red); }
.notice { font-size: 12px; color: var(--dim); padding: 5px 0; border-bottom: 1px dashed #23262f; }
.notice b { color: var(--gold); }

.action-box { background: #0f1218; border: 1px dashed var(--line); border-radius: 6px; padding: 12px; margin-bottom: 10px; }
.kv { display: inline-block; margin-right: 14px; font-size: 12px; color: var(--dim); }
.kv b { color: var(--txt); }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 3px; background: #232833; color: var(--dim); margin-left: 6px; }
.tag.gold { background: #3a2f14; color: var(--gold); }
.tag.red { background: #3a1d1d; color: var(--red); }
.tag.green { background: #17301f; color: var(--green); }
.hint { font-size: 11px; color: var(--dim); margin-top: 6px; line-height: 1.7; }

/* ---------- 60 格背包 / 装备 / 家具 ---------- */
.gear-card { background: linear-gradient(180deg, #171b23, #12151c); }
.eq-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.eq-slot { border: 1px solid #2b313d; border-radius: 8px; background: #0e1117; padding: 8px 6px 10px; text-align: center; cursor: pointer; min-height: 104px; transition: .15s; }
.eq-slot.filled:hover { border-color: var(--gold); transform: translateY(-2px); }
.eq-label { font-size: 11px; color: var(--dim); }
.eq-icon { font-size: 28px; line-height: 42px; filter: drop-shadow(0 3px 4px #000); }
.eq-name { font-size: 12px; color: var(--txt); min-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dim { color: var(--dim); }
.inv-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.inv-slot { position: relative; aspect-ratio: 1/1; border: 1px solid #2a303b; border-radius: 7px; background: radial-gradient(circle at 50% 35%, #1c222d, #0d1016); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; transition: .12s; }
.inv-slot:hover { border-color: #6d7484; }
.inv-slot.sel { border-color: var(--gold); box-shadow: 0 0 0 2px #3a2f14 inset, 0 0 12px #c9a24a55; }
.inv-slot.empty { opacity: .55; cursor: default; }
.slot-no { position: absolute; left: 4px; top: 2px; font-size: 9px; color: #5c6370; }
.inv-icon { font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 2px #000); }
.inv-name { font-size: 10px; color: #c8ccd4; max-width: 92%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.inv-qty { position: absolute; right: 3px; bottom: 2px; font-size: 10px; background: #0009; border-radius: 3px; padding: 0 4px; color: var(--gold); }
.inv-detail { margin-top: 14px; border: 1px solid #2a303b; background: #0e1117; border-radius: 8px; padding: 12px; display: flex; gap: 14px; align-items: center; }
.detail-icon { font-size: 44px; width: 70px; text-align: center; filter: drop-shadow(0 4px 5px #000); }
.detail-main { flex: 1; }
.detail-main h4 { font-size: 15px !important; color: var(--txt) !important; margin: 0 0 4px !important; }
.empty-detail { opacity: .85; }
.inv-slot.can-use { border-color: #7a6132; background: radial-gradient(circle at 50% 35%, #332615, #171006 72%); box-shadow: inset 0 0 0 1px #e0a84a22; }
.inv-slot.can-use:hover { border-color: #e0b45d; box-shadow: inset 0 0 0 1px #e0a84a44, 0 0 10px #b47a2533; }
.inv-slot.can-use.sel { border-color: var(--gold); box-shadow: 0 0 0 2px #5c4315 inset, 0 0 14px #d8a85466; }
.inv-flag { position: absolute; right: 3px; top: 2px; min-width: 14px; padding: 0 3px; border: 1px solid #8e6a2e; border-radius: 3px; background: #3a2a10; color: #f1c66c; font-size: 9px; line-height: 14px; text-align: center; }
.inv-tip { margin-top: 10px; padding: 8px 10px; border: 1px solid #3b3322; border-radius: 6px; background: #17130b; color: #b8aa8b; font-size: 11px; }
.inv-tip b { color: #f0d18a; }
.inv-tip-orange { color: #e1b361; font-weight: 600; }
.inv-modal-mask { position: fixed; inset: 0; z-index: 60; padding: 24px; display: flex; align-items: center; justify-content: center; background: #02050bd0; backdrop-filter: blur(4px); }
.inv-modal { position: relative; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; padding: 22px; border: 1px solid #8a6d35; border-radius: 12px; background: linear-gradient(180deg, #202936, #0c1118 70%); box-shadow: 0 24px 80px #000, inset 0 0 0 1px #e7c06b14; }
.inv-modal-close { position: absolute; right: 10px; top: 10px; width: 32px; height: 32px; border: 1px solid #4a5565; border-radius: 6px; background: #0b1118; color: #cfd7e3; font-size: 18px; line-height: 1; cursor: pointer; }
.inv-modal-close:hover { border-color: #d8b45c; color: #f4d992; }
.inv-modal-kicker { color: #b69252; font-size: 10px; letter-spacing: 3px; }
.inv-modal-head { display: flex; align-items: flex-start; gap: 16px; margin-top: 12px; }
.inv-modal-icon { flex: 0 0 70px; height: 70px; display: flex; align-items: center; justify-content: center; border: 1px solid #6c572c; border-radius: 9px; background: radial-gradient(circle at 50% 35%, #352817, #171006); font-size: 40px; filter: drop-shadow(0 3px 5px #000); }
.inv-modal-info { flex: 1 1 auto; min-width: 0; }
.inv-modal-info h4 { margin: 2px 0 4px !important; color: #f4e2b1 !important; font-size: 20px !important; letter-spacing: 1px; }
.inv-modal-meta { color: #8e9aaa; font-size: 11px; }
.inv-modal-tag { display: inline-block; margin: 7px 5px 0 0; padding: 2px 7px; border: 1px solid #715c31; border-radius: 4px; background: #2b2110; color: #e5c06b; font-size: 10px; }
.inv-modal-desc { margin: 16px 0 0; padding: 15px 0 0; border-top: 1px solid #303a48; color: #b7c1cf; font-size: 12px; line-height: 1.8; }
.inv-modal-effect { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 9px 12px; border: 1px solid #4f4226; border-radius: 7px; background: #1d180e; }
.inv-modal-effect span { color: #a9946b; font-size: 11px; }
.inv-modal-effect b { color: #f0c96f; font-size: 12px; text-align: right; }
.inv-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.inv-modal-actions .btn { min-width: 90px; }
.inv-modal-note { margin-top: 12px; color: #737f8e; font-size: 10px; line-height: 1.6; }
.furn-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.house-block { border: 1px solid #232833; border-radius: 8px; padding: 10px; margin-bottom: 10px; background: #0f1218; }
.house-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; }
.furn-slot { border: 1px dashed #333a47; border-radius: 6px; min-height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10px; color: var(--dim); cursor: pointer; padding: 4px; text-align: center; }
.furn-slot:not(.empty):hover { border-color: var(--gold); color: var(--gold); }
.furn-slot.empty.ready { border-color: var(--gold); color: var(--gold); background: #241f10; }
.furn-icon { font-size: 20px; }

/* ---------- 3D 城镇 ---------- */
.town-page { display: none; position: relative; height: calc(100vh - 57px); min-height: 520px; background: #0b1017; overflow: hidden; }
.game-body { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.game-body .topbar { flex: 0 0 auto; }
.game-body .town-page { flex: 1 1 auto; height: auto; min-height: 0; }
.town-shell { position: relative; width: 100%; height: 100%; overflow: hidden; }
#townCanvas { position: absolute; inset: 0; }
#townCanvas canvas { display: block; width: 100%; height: 100%; }
.town-top { position: absolute; left: 0; right: 0; top: 0; padding: 14px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; background: linear-gradient(180deg, #05080ee6, #05080e00); pointer-events: none; }
.town-brand b { font-size: 16px; letter-spacing: 3px; color: #f2dfac; text-shadow: 0 2px 8px #000; display: block; }
.town-brand span { font-size: 11px; color: #a7b0c0; }
.town-dist { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; pointer-events: auto; }
.town-dist button { background: #0d1219cc; border: 1px solid #3a4350; color: #cbd2de; border-radius: 5px; padding: 5px 10px; font-size: 12px; cursor: pointer; backdrop-filter: blur(4px); }
.town-dist button.on { border-color: #d8b45c; color: #f2dfac; background: #2b2413cc; }
.town-info { position: absolute; left: 16px; bottom: 46px; width: 320px; min-height: 80px; max-height: calc(100% - 74px); overflow-y: auto; background: #080c12e6; border: 1px solid #39424f; border-radius: 9px; padding: 12px 14px; color: #d9dfe9; font-size: 12px; line-height: 1.7; backdrop-filter: blur(6px); pointer-events: auto; box-shadow: 0 8px 24px #0008; z-index: 18; }
.town-info h4 { font-size: 14px; color: #f0d68d; margin-bottom: 4px; }
.town-info .row { display: flex; justify-content: space-between; gap: 8px; }
.town-info .row b { color: #fff; font-weight: 500; }
.town-info .btn { margin-top: 8px; }
.town-build h4 { margin-bottom: 2px; }
.tb-sub { color: #8f9aa8; font-size: 11px; margin-bottom: 8px; }
.tb-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 11px 0 6px; padding-top: 8px; border-top: 1px solid #27303d; }
.tb-head b { color: #e8d293; font-size: 12px; }
.tb-head span { color: #8f9aa8; font-size: 10px; text-align: right; }
.tb-head span.ok { color: #7fd39b; }
.tb-head span.miss { color: #e08a7a; }
.tb-mats { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.tb-mat { display: grid; grid-template-columns: 20px 1fr auto; grid-template-rows: auto auto; align-items: center; gap: 0 5px; padding: 5px 7px; border: 1px solid #3a4552; border-radius: 5px; background: #0d141d; }
.tb-mat.ok { border-color: #355746; background: #0d1a14; }
.tb-mat.miss { border-color: #5d3d39; background: #1a100f; }
.tb-ico { grid-row: 1 / 3; font-size: 15px; }
.tb-mat b { color: #e3e8ef; font-size: 11px; font-weight: 500; }
.tb-mat em { color: #9aa6b5; font-size: 10px; font-style: normal; }
.tb-mat i { grid-column: 2 / 4; color: #7fd39b; font-size: 9px; font-style: normal; }
.tb-mat.miss i { color: #e08a7a; }
.tb-line { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.tb-line b { color: #fff; font-weight: 500; }
.tb-job { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px dashed #28313d; }
.tb-job span { color: #b6c0cc; }
.tb-job b { color: #e8d293; font-weight: 500; text-align: right; }
.tb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0 6px; }
.tb-grid label { display: flex; flex-direction: column; gap: 3px; color: #8f9aa8; font-size: 9px; }
.tb-grid input { width: 100%; padding: 4px 5px; border: 1px solid #475362; border-radius: 4px; background: #0a1119; color: #f3f6fb; font-size: 12px; }
.tb-note { color: #8f9aa8; font-size: 10px; line-height: 1.55; margin: 5px 0; }
.tb-note.ok { color: #7fd39b; }
.tb-note.miss { color: #e08a7a; }
.tb-alert { margin: 6px 0; padding: 6px 8px; border: 1px solid #70413a; border-radius: 5px; background: #241311; color: #f0a394; font-size: 10px; }
.town-build .btn { width: 100%; margin-top: 7px; }
.town-build .btn.small { width: auto; margin-right: 5px; }
.town-legend { position: absolute; left: 18px; bottom: 12px; display: flex; gap: 12px; font-size: 10px; color: #b7c0ce; background: #080c12aa; padding: 5px 9px; border-radius: 5px; }
.town-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.town-actions { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 6px; pointer-events: auto; }
.town-actions .btn { background: #0d1219cc; backdrop-filter: blur(4px); }

/* ---------- 城镇聊天：世界 / 附近 / 私聊 ---------- */
.town-chat { position: absolute; left: 50%; top: auto; bottom: 42px; transform: translateX(-50%); width: min(520px, calc(100vw - 32px)); max-height: min(58vh, 420px); z-index: 10; display: flex; flex-direction: column; border: 1px solid #495464; border-radius: 9px; background: linear-gradient(180deg, #111923ed, #090e15ee); box-shadow: 0 12px 34px #000a; backdrop-filter: blur(8px); overflow: hidden; pointer-events: auto; }
.town-page.hub-open .town-chat { opacity: .25; pointer-events: none; }
.town-page.admin-mode .town-chat, .town-page.home-mode .town-chat, .town-page.temple-mode .town-chat, .app-drawer-open .town-chat { display: none; }
.town-chat-head { order: 0; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px 8px; border-bottom: 1px solid #2b3542; background: #121b26; }
.town-chat-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.town-chat-title b { color: #f0d794; font-size: 13px; letter-spacing: 2px; }
.town-chat-title span { color: #7f8d9f; font-size: 10px; white-space: nowrap; }
.town-chat-tools { display: flex; gap: 5px; }
.town-chat-tools button { border: 1px solid #405064; border-radius: 5px; background: #0b121a; color: #c2ccda; font-size: 10px; padding: 4px 8px; cursor: pointer; }
.town-chat-tools button:hover { border-color: #d8b45c; color: #f2da9d; }
.town-chat-list { order: 2; flex: 0 1 auto; height: auto; min-height: 72px; max-height: min(34vh, 240px); overflow-y: auto; padding: 8px 10px; scrollbar-width: thin; }
.town-chat.folded .town-chat-list, .town-chat.folded .town-chat-form, .town-chat.folded .chat-tip { display: none; }
.chat-empty { padding: 26px 8px; text-align: center; color: #758294; font-size: 11px; }
.chat-empty.err { color: #e99a88; }
.chat-msg { padding: 5px 0 6px; border-bottom: 1px dashed #242d39; }
.chat-msg:last-child { border-bottom: 0; }
.chat-meta { display: flex; align-items: baseline; gap: 6px; font-size: 10px; color: #7f8c9e; }
.chat-meta b { color: #d9e5f4; font-size: 11px; font-weight: 500; }
.chat-meta span { padding: 1px 5px; border: 1px solid #3b4b5f; border-radius: 3px; color: #8fb8d6; font-size: 9px; }
.chat-meta time { margin-left: auto; color: #657181; }
.chat-msg.world .chat-meta span { color: #efcd7e; border-color: #66542e; }
.chat-msg.private .chat-meta span { color: #d9a8ef; border-color: #5e4268; }
.chat-msg.mine .chat-text { color: #f4e6bd; }
.chat-text { margin-top: 3px; color: #cfd9e6; font-size: 12px; line-height: 1.55; word-break: break-word; white-space: pre-wrap; }
.town-chat-form { order: 3; flex: 0 0 auto; display: flex; gap: 5px; padding: 8px 9px 6px; border-top: 1px solid #2b3542; background: #0d141d; }
.town-chat-form select { flex: 0 0 auto; width: 68px; min-width: 0; border: 1px solid #3a4758; border-radius: 5px; background: #111a24; color: #c9d4e2; font-size: 11px; padding: 5px 3px; outline: none; }
.town-chat-form select#chatTarget { width: 88px; }
.town-chat-form select[hidden] { display: none; }
.town-chat-form input { flex: 1 1 auto; min-width: 0; border: 1px solid #3a4758; border-radius: 5px; background: #111a24; color: #eef3fa; font-size: 12px; padding: 6px 8px; outline: none; }
.town-chat-form input:focus { border-color: #b9974c; box-shadow: 0 0 0 1px #b9974c44; }
.town-chat-form .btn { flex: 0 0 auto; padding: 6px 10px; font-size: 11px; }
.chat-tip { order: 1; flex: 0 0 auto; padding: 5px 10px 6px; color: #6e7c8d; font-size: 9px; background: #0f1722; border-bottom: 1px solid #202a37; }
.chat-tip.err { color: #e99a88; }
.chat-modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 24px; }
.chat-modal[hidden] { display: none; }
.chat-modal-mask { position: absolute; inset: 0; background: #02050bd6; backdrop-filter: blur(4px); }
.chat-modal-card { position: relative; width: min(660px, calc(100vw - 28px)); max-height: min(640px, calc(100vh - 44px)); display: flex; flex-direction: column; border: 1px solid #8a6d35; border-radius: 12px; background: linear-gradient(180deg, #202936, #0c1118 70%); box-shadow: 0 24px 80px #000, inset 0 0 0 1px #e7c06b14; overflow: hidden; }
.chat-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid #303a48; }
.chat-modal-head b { display: block; color: #f4e2b1; font-size: 18px; letter-spacing: 2px; }
.chat-modal-head span { display: block; color: #8e9aaa; font-size: 10px; margin-top: 3px; }
.chat-modal-x { width: 32px; height: 32px; border: 1px solid #4a5565; border-radius: 6px; background: #0b1118; color: #cfd7e3; font-size: 18px; line-height: 1; cursor: pointer; }
.chat-modal-x:hover { border-color: #d8b45c; color: #f4d992; }
.chat-modal-tabs { display: flex; gap: 5px; padding: 10px 16px; border-bottom: 1px solid #2a3341; background: #101720; flex-wrap: wrap; }
.chat-modal-tabs button { border: 1px solid #3e4a5a; border-radius: 5px; background: #0b121a; color: #aab6c6; font-size: 11px; padding: 5px 10px; cursor: pointer; }
.chat-modal-tabs button.on { border-color: #d8b45c; background: #2b2413; color: #f2dfac; }
.chat-modal-body { min-height: 160px; overflow-y: auto; padding: 10px 18px 18px; }
.chat-modal-body .chat-msg { padding: 8px 0; }
.chat-modal-body .chat-text { font-size: 13px; }
.town-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #cfd6e3; background: #0b1017; font-size: 13px; letter-spacing: 2px; }

/* ---------- 3D 功能入口：角色 / 背包 / 资产 / 资金 / 任务 ---------- */
.town-hub { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 7px; z-index: 9; pointer-events: auto; }
.town-hub-btn { width: 58px; padding: 6px 0 5px; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid #46505e; border-radius: 7px; background: linear-gradient(180deg, #151b25e8, #090d13e8); color: #c8d0dc; cursor: pointer; box-shadow: 0 5px 16px #0007; backdrop-filter: blur(5px); transition: border-color .15s, color .15s, transform .15s; }
.town-hub-btn i { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: 1px solid #6b5a35; border-radius: 50%; color: #efd68f; background: radial-gradient(circle at 35% 30%, #3b3320, #17130b); font-style: normal; font-size: 15px; font-weight: 700; letter-spacing: 0; }
.town-hub-btn span { font-size: 11px; letter-spacing: 1px; }
.town-hub-btn:hover, .town-hub-btn.on { border-color: #d8b45c; color: #f7e3aa; transform: translateX(-2px); }
.town-hub-btn.on i { color: #1a1509; background: linear-gradient(180deg, #f2d891, #b98e39); border-color: #f2d891; }
.town-hub-btn:disabled { opacity: .4; cursor: default; }
.town-page.hub-open .town-info, .town-page.hub-open .town-actions, .town-page.hub-open .town-legend { opacity: .2; pointer-events: none; }

/* ---------- 3D 工作台抽屉：不再切换到独立 2D 页面 ---------- */
.app-drawer { position: fixed; inset: 57px 0 0; z-index: 32; }
.app-drawer[hidden] { display: none; }
.app-drawer-mask { position: absolute; inset: 0; background: #03060bcc; backdrop-filter: blur(2px); }
.app-drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(1080px, 94vw); display: flex; flex-direction: column; background: #0d1118; border-left: 1px solid #4b5361; box-shadow: -24px 0 80px #000e; animation: drawerIn .18s ease-out; }
@keyframes drawerIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }
.app-drawer-head { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid #2a3341; background: linear-gradient(180deg, #1a2230, #101720); }
.app-drawer-head b { display: block; color: #f1d68e; font-size: 16px; letter-spacing: 1.5px; }
.app-drawer-head span { display: block; margin-top: 2px; color: #8e9aab; font-size: 11px; }
.app-drawer-close { flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid #485364; border-radius: 6px; background: #0c121b; color: #c6cfdb; font-size: 20px; line-height: 1; cursor: pointer; }
.app-drawer-close:hover { border-color: #d8b45c; color: #f1d68e; }
.app-drawer-panel #app { flex: 1 1 auto; min-height: 0; max-width: none; width: 100%; margin: 0; padding: 16px; overflow-y: auto; }
body.app-drawer-open { overflow: hidden; }
@media (max-width: 720px) {
  .app-drawer-panel { width: 100vw; }
  .app-drawer-head { padding: 10px 12px; }
}

/* ---------- 功能总台菜单 ---------- */
.desk-lead { padding: 12px 14px; border: 1px solid #4d452f; border-radius: 8px; background: linear-gradient(135deg, #201b10, #12161c); margin-bottom: 16px; }
.desk-lead b { display: block; color: #f0d68d; font-size: 13px; margin-bottom: 3px; }
.desk-lead span { color: #939eae; font-size: 11px; }
.desk-title { margin: 14px 0 8px; color: #d8c184; font-size: 12px; letter-spacing: 1px; border-bottom: 1px solid #2a3341; padding-bottom: 6px; }
.desk-title:first-of-type { margin-top: 0; }
.desk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.desk-item { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 52px; padding: 7px 9px; text-align: left; border: 1px solid #3b4553; border-radius: 7px; background: #111823; color: #d8dfe9; cursor: pointer; transition: border-color .15s, background .15s; }
.desk-item:hover { border-color: #c5a04c; background: #1c2230; }
.desk-item i { flex: 0 0 auto; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: 1px solid #6b5a35; border-radius: 50%; color: #efd68f; background: radial-gradient(circle at 35% 30%, #3b3320, #17130b); font-style: normal; font-size: 14px; font-weight: 700; }
.desk-item span { flex: 1 1 auto; min-width: 0; }
.desk-item b { display: block; color: #edf1f7; font-size: 12px; font-weight: 600; }
.desk-item em { display: block; margin-top: 2px; color: #8d99a9; font-size: 10px; font-style: normal; line-height: 1.4; }
.desk-item small { color: #a88d4a; font-size: 14px; }
.desk-admin { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding: 9px 12px; border: 1px dashed #5b4b2a; border-radius: 7px; color: #d8bd74; font-size: 12px; text-decoration: none; }
.desk-admin span { color: #8e8061; font-size: 10px; }
.desk-admin:hover { background: #1e1a10; }
.desk-logout { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 52px; padding: 7px 9px; text-align: left; border: 1px solid #5c3b36; border-radius: 7px; background: linear-gradient(135deg, #241311, #14171d); color: #e8d5d2; cursor: pointer; transition: border-color .15s, background .15s; }
.desk-logout:hover { border-color: #b06c5f; background: linear-gradient(135deg, #321916, #1a1d24); }
.desk-logout:disabled { opacity: .6; cursor: wait; }
.desk-logout i { flex: 0 0 auto; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: 1px solid #7d5148; border-radius: 50%; color: #ffb7a9; background: radial-gradient(circle at 35% 30%, #452420, #1b0f0d); font-style: normal; font-size: 14px; font-weight: 700; }
.desk-logout span { flex: 1 1 auto; min-width: 0; }
.desk-logout b { display: block; color: #ffd8d1; font-size: 12px; font-weight: 600; }
.desk-logout em { display: block; margin-top: 2px; color: #b39894; font-size: 10px; font-style: normal; }
.desk-logout small { color: #9d6d64; font-size: 14px; }
.desk-back { width: 100%; margin-top: 14px; }

.town-sheet { position: absolute; inset: 0; z-index: 30; display: flex; align-items: stretch; justify-content: flex-end; padding: 16px 84px 16px 24px; }
.town-sheet[hidden] { display: none; }
.town-sheet-mask { position: absolute; inset: 0; background: #03060bbb; backdrop-filter: blur(3px); }
.town-sheet-card { position: relative; width: min(780px, 100%); max-height: 100%; display: flex; flex-direction: column; overflow: hidden; border: 1px solid #5a523d; border-radius: 11px; background: linear-gradient(180deg, #111823fa, #080d14fa); box-shadow: 0 24px 80px #000e; animation: hubIn .18s ease-out; }
@keyframes hubIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }
.town-sheet-head { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 14px 18px 12px; border-bottom: 1px solid #2a3341; background: linear-gradient(180deg, #1b2230, #101720); }
.town-sheet-head b { display: block; color: #f1d68e; font-size: 17px; letter-spacing: 2px; }
.town-sheet-head span { display: block; margin-top: 3px; color: #909bab; font-size: 11px; }
.town-sheet-x { flex: 0 0 auto; width: 30px; height: 30px; border: 1px solid #485364; border-radius: 6px; background: #0c121b; color: #b9c3d1; font-size: 18px; line-height: 1; cursor: pointer; }
.town-sheet-x:hover { border-color: #d8b45c; color: #f1d68e; }
.town-sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px 18px 22px; color: #d8dfe9; font-size: 12px; line-height: 1.6; scrollbar-color: #46505e #10161f; }
.town-sheet-body::-webkit-scrollbar { width: 8px; }
.town-sheet-body::-webkit-scrollbar-thumb { background: #46505e; border-radius: 5px; }
.town-sheet-body::-webkit-scrollbar-track { background: #10161f; }

.hub-sec { margin-top: 18px; }
.hub-sec:first-child { margin-top: 0; }
.hub-sec-title { display: flex; align-items: baseline; gap: 8px; margin-bottom: 9px; padding-bottom: 7px; border-bottom: 1px solid #2a3341; }
.hub-sec-title b { color: #f0d68d; font-size: 13px; letter-spacing: 1px; }
.hub-sec-title span { color: #8994a4; font-size: 11px; }
.hub-sec-title .text-btn { margin-left: auto; }
.text-btn { border: 0; background: transparent; color: #e0bd6a; font-size: 11px; cursor: pointer; padding: 0; }
.text-btn:hover { color: #ffe9b0; text-decoration: underline; }

.hub-empty { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: #96a1b0; }
.hub-empty b { color: #e3e9f2; font-size: 14px; }
.hub-empty.small { min-height: 90px; padding: 12px; border: 1px dashed #344050; border-radius: 8px; background: #0b1118; }
.hub-loading { min-height: 220px; display: flex; align-items: center; justify-content: center; gap: 10px; color: #9aa5b5; }
.hub-loading i { width: 18px; height: 18px; border: 2px solid #3d4857; border-top-color: #e4c26f; border-radius: 50%; animation: hubSpin .7s linear infinite; }
@keyframes hubSpin { to { transform: rotate(360deg); } }

/* 角色 */
.role-hero { display: flex; align-items: center; gap: 18px; padding: 16px; border: 1px solid #3b4555; border-radius: 9px; background: radial-gradient(circle at 12% 12%, #2a2d2c, #0e141d 65%); }
.rp-avatar { position: relative; flex: 0 0 92px; width: 92px; height: 92px; overflow: hidden; border: 2px solid #c7a454; border-radius: 50%; background: radial-gradient(circle at 50% 32%, #3a4658, #151c27); box-shadow: 0 4px 14px #0007, inset 0 0 18px #0007; }
.rp-avatar .rp-head { position: absolute; left: 31px; top: 18px; width: 30px; height: 32px; border-radius: 50% 50% 44% 44%; background: var(--skin); box-shadow: inset -4px -3px 7px #0003; }
.rp-avatar .rp-torso { position: absolute; left: 17px; bottom: -12px; width: 58px; height: 49px; border-radius: 40% 40% 10% 10%; background: linear-gradient(180deg, var(--body), var(--pants)); box-shadow: inset -7px -3px 10px #0003; }
.rp-avatar > i { display: none; }
.role-id { flex: 1 1 auto; min-width: 0; }
.role-name { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 19px; letter-spacing: 1px; }
.role-tag { padding: 1px 7px; border: 1px solid #78683f; border-radius: 999px; color: #e8cd83; font-size: 10px; font-weight: 400; letter-spacing: 0; }
.role-meta { margin-top: 3px; color: #98a3b2; font-size: 11px; }
.role-money { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 9px; color: #96a1b1; font-size: 11px; }
.role-money b { color: #f2d891; font-weight: 600; }

.avatar-picker { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.avatar-swatch { padding: 7px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 5px; border: 1px solid #384251; border-radius: 8px; background: #0b1118; color: #aab4c2; cursor: pointer; }
.avatar-swatch i { width: 31px; height: 31px; border: 1px solid #bbc4cf; border-radius: 50%; background: linear-gradient(145deg, var(--body) 0 52%, var(--pants) 52%); box-shadow: inset 0 -4px 6px #0003; }
.avatar-swatch span { font-size: 10px; white-space: nowrap; }
.avatar-swatch:hover, .avatar-swatch.on { border-color: #e0bc6b; color: #f3dba0; background: #17160f; }
.avatar-swatch.on i { border-color: #f7dfa0; box-shadow: 0 0 0 2px #c39a43, inset 0 -4px 6px #0003; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stat-grid > div { position: relative; overflow: hidden; padding: 9px 10px 13px; border: 1px solid #333d4b; border-radius: 7px; background: #0c121a; }
.stat-grid span { display: block; color: #8e99a8; font-size: 10px; }
.stat-grid b { display: block; margin-top: 2px; color: #e9eef6; font-size: 17px; }
.stat-grid em { position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: #28313e; }
.stat-grid em::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--v); background: linear-gradient(90deg, #9c7a36, #e3c173); }
.skill-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.skill-row > div { padding: 8px 9px 11px; border: 1px solid #303947; border-radius: 7px; background: #0b1118; }
.skill-row span { display: block; color: #8d98a7; font-size: 10px; }
.skill-row b { display: block; margin-top: 1px; color: #e7ecf4; font-size: 13px; }
.skill-row i { display: block; height: 2px; margin-top: 7px; background: #252e3a; position: relative; }
.skill-row i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--v); background: var(--c); }

.qual-card { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid #35404f; border-radius: 8px; background: #0b1119; }
.qual-card.on { border-color: #7f6938; background: linear-gradient(90deg, #201c11, #0b1119 60%); }
.qual-seal { flex: 0 0 38px; height: 38px; display: flex; align-items: center; justify-content: center; border: 1px solid #6e6040; border-radius: 7px; color: #e5ca84; background: #221d12; font-size: 16px; font-weight: 700; }
.qual-card.on .qual-seal { border-color: #d6b25d; color: #1c1608; background: linear-gradient(180deg, #f0d58b, #aa8435); }
.qual-card > div { flex: 1 1 auto; min-width: 0; }
.qual-card b { display: block; color: #e9eef5; font-size: 13px; }
.qual-card span { display: block; color: #8f9aa9; font-size: 10px; }
.qual-card em { flex: 0 0 auto; color: #d9bc72; font-size: 10px; font-style: normal; }
.qual-note { margin-top: 6px; color: #b5a16e; font-size: 11px; }

.job-card { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid #35404f; border-radius: 8px; background: #0b1119; }
.job-card.on { border-color: #475a6d; background: linear-gradient(90deg, #101923, #0b1119 70%); }
.job-mark { flex: 0 0 38px; height: 38px; display: flex; align-items: center; justify-content: center; border: 1px solid #56657a; border-radius: 50%; color: #d8e0eb; background: #17202c; font-size: 14px; }
.job-card > div:nth-child(2) { flex: 1 1 auto; min-width: 0; }
.job-card b { display: block; color: #e9eef5; font-size: 13px; }
.job-card span { display: block; color: #8f9aa9; font-size: 10px; }
.job-live { margin-bottom: 8px; padding: 11px 12px; border: 1px solid #4c6041; border-radius: 9px; background: linear-gradient(100deg, #1a2417, #0b1119 72%); }
.job-live-top { display: flex; align-items: center; gap: 8px; }
.job-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #8fd477; box-shadow: 0 0 0 4px rgba(143,212,119,.12); animation: jobPulse 1.8s infinite; }
@keyframes jobPulse { 0%,100% { opacity: .7; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.08); } }
.job-live-top b { flex: 1 1 auto; min-width: 0; color: #e9f4de; font-size: 13px; }
.job-live-top em { color: #b7dc9f; font-size: 12px; font-style: normal; }
.job-live-bar { height: 5px; margin: 8px 0; border-radius: 99px; background: #263225; overflow: hidden; }
.job-live-bar i { display: block; width: var(--v); height: 100%; border-radius: 99px; background: linear-gradient(90deg, #88c56a, #d2b260); }
.job-live-meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; color: #91a088; font-size: 10px; }
.job-live-meta b { display: inline; color: #dcebd2; font-size: 10px; }
.job-idle { margin-bottom: 8px; padding: 10px 12px; border: 1px dashed #35404f; border-radius: 9px; background: #0b1118; }
.job-idle b { display: block; color: #bcc7d4; font-size: 12px; }
.job-idle span { display: block; margin-top: 3px; color: #8b97a6; font-size: 10px; }
.job-list { display: grid; gap: 6px; }
.job-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #303947; border-radius: 8px; background: #0b1118; }
.job-row.on { border-color: #4e6543; background: linear-gradient(90deg, #131d16, #0b1118 75%); }
.job-row-mark { flex: 0 0 30px; height: 30px; display: flex; align-items: center; justify-content: center; border: 1px solid #4c5a6b; border-radius: 50%; color: #c9d3df; background: #151e29; font-size: 12px; }
.job-row.on .job-row-mark { border-color: #668455; color: #dcf1d0; background: #22331e; }
.job-row-main { flex: 1 1 auto; min-width: 0; }
.job-row-main b { display: block; color: #e6ecf5; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-row-main span { display: block; margin-top: 2px; color: #8d99a8; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-row-side { flex: 0 0 auto; text-align: right; }
.job-row-side em { display: block; font-size: 10px; font-style: normal; }
.job-row-side em.working { color: #a8dd90; }
.job-row-side em.ready { color: #b9a879; }
.job-row-side b { display: block; margin-top: 2px; color: #e9eef5; font-size: 11px; }
.job-empty { padding: 12px 10px; border: 1px dashed #35404f; border-radius: 8px; color: #8b97a6; font-size: 11px; text-align: center; }
.job-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.job-foot span { flex: 1 1 auto; min-width: 0; color: #8f9aa9; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-bars { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 8px; margin-top: 8px; }
.work-bars > div { position: relative; overflow: hidden; padding: 8px 9px 12px; border: 1px solid #303947; border-radius: 7px; background: #0b1118; }
.work-bars span { display: block; color: #8d98a7; font-size: 10px; }
.work-bars b { display: block; margin-top: 2px; color: #e8edf5; font-size: 12px; }
.work-bars i { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #252e3a; }
.work-bars i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--v); background: #ab8b45; }

/* 背包 */
.equip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.equip-slot { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 8px 10px; border: 1px solid #333d4b; border-radius: 7px; background: #0b1119; color: #a5afbd; text-align: left; cursor: default; }
.equip-slot.on { border-color: #695a36; background: linear-gradient(90deg, #1b1810, #0b1119); cursor: pointer; }
.equip-slot.on:hover { border-color: #d8b45c; }
.equip-icon { flex: 0 0 31px; height: 31px; display: flex; align-items: center; justify-content: center; border: 1px solid #3f4a59; border-radius: 5px; background: #141c26; color: #d9c184; font-size: 16px; }
.equip-meta { flex: 1 1 auto; min-width: 0; }
.equip-meta b { display: block; color: #e1e8f1; font-size: 12px; }
.equip-meta em { display: block; color: #7e8998; font-size: 9px; font-style: normal; }
.equip-slot.on .equip-icon { border-color: #8b7442; }

.bag-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; }
.bag-cell { position: relative; aspect-ratio: 1 / 1.16; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3px 2px; border: 1px solid #2e3845; border-radius: 5px; background: #0a1017; color: #93a0b0; }
.bag-cell[data-item] { cursor: pointer; }
.bag-cell[data-item]:hover { border-color: #8d7950; }
.bag-cell.empty { background: #080d13; border-color: #222b36; }
.bag-cell.empty span { color: #333d4a; font-size: 8px; }
.bag-cell.can-equip { border-color: #6c5a34; background: #15130c; cursor: pointer; }
.bag-cell.can-equip:hover { border-color: #e3c06a; transform: translateY(-1px); }
.bag-icon { max-width: 100%; overflow: hidden; color: #dfc483; font-size: 19px; line-height: 1; }
.bag-cell b { max-width: 100%; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d5dee9; font-size: 9px; font-weight: 500; }
.bag-cell em { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #7f8b9b; font-size: 8px; font-style: normal; }
.bag-cell i { position: absolute; top: 1px; left: 2px; color: #465161; font-size: 7px; font-style: normal; }

/* 资产 */
.asset-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.asset-summary > div { padding: 10px; border: 1px solid #343e4d; border-radius: 7px; background: #0b1119; text-align: center; }
.asset-summary span { display: block; color: #8e99a7; font-size: 10px; }
.asset-summary b { display: block; margin-top: 2px; color: #eed58f; font-size: 19px; }
.asset-summary .wide b { color: #dbe3ee; font-size: 15px; }
.asset-list { display: flex; flex-direction: column; gap: 7px; }
.asset-card { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border: 1px solid #333d4c; border-left: 3px solid #6c7484; border-radius: 7px; background: #0b1119; cursor: pointer; }
.asset-card:hover { border-color: #d2af5f; background: #12171e; }
.asset-card.tone-gold { border-left-color: #c7a352; }
.asset-card.tone-green { border-left-color: #699658; }
.asset-card.tone-orange { border-left-color: #b97b4b; }
.asset-card.tone-blue { border-left-color: #5d86ad; }
.asset-icon { flex: 0 0 37px; height: 37px; display: flex; align-items: center; justify-content: center; border: 1px solid #414c5b; border-radius: 6px; background: #151d27; color: #e2cb8b; font-size: 15px; }
.asset-main { flex: 1 1 auto; min-width: 0; }
.asset-title { display: flex; align-items: baseline; gap: 8px; }
.asset-title b { color: #e8eef7; font-size: 13px; }
.asset-title span { color: #8994a3; font-size: 10px; }
.asset-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; color: #8c97a6; font-size: 10px; }

/* 资金 */
.wallet-hero { display: grid; grid-template-columns: 1.35fr 1fr; gap: 10px; }
.wallet-main { padding: 15px 16px; border: 1px solid #776338; border-radius: 9px; background: radial-gradient(circle at 18% 20%, #2d2a1b, #10151c 70%); }
.wallet-main span { display: block; color: #b4a77e; font-size: 11px; }
.wallet-main b { display: block; margin-top: 3px; color: #ffdf8d; font-size: 27px; letter-spacing: 1px; text-shadow: 0 2px 12px #0008; }
.wallet-main em { display: block; margin-top: 2px; color: #8d97a5; font-size: 10px; font-style: normal; }
.wallet-side { display: flex; flex-direction: column; gap: 6px; }
.wallet-side > div { flex: 1 1 0; padding: 8px 10px; border: 1px solid #333d4c; border-radius: 7px; background: #0b1119; }
.wallet-side span { float: left; color: #8e99a7; font-size: 10px; }
.wallet-side b { float: right; color: #e6ecf5; font-size: 13px; }
.wallet-side b.neg { color: #e08b7a; }
.flow-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.flow-summary > div { padding: 10px 11px; border: 1px solid #333d4c; border-radius: 7px; background: #0b1119; }
.flow-summary span { display: block; color: #8e99a7; font-size: 10px; }
.flow-summary b { display: block; margin-top: 2px; font-size: 16px; }
.flow-summary .in b { color: #9ecb86; }
.flow-summary .out b { color: #dd9a84; }
.flow-summary .net b { color: #e6cd84; }
.flow-summary .net.neg b { color: #e08b7a; }
.flow-bar { position: relative; height: 5px; margin-top: 8px; overflow: hidden; border-radius: 3px; background: #b3664f; }
.flow-bar i { position: absolute; inset: 0 auto 0 0; width: var(--in); background: #6f9d5c; }
.flow-bar::after { content: ''; position: absolute; left: var(--in); top: 0; bottom: 0; width: 1px; background: #e8d8ad; opacity: .4; }
.loan-list { display: flex; flex-direction: column; gap: 6px; }
.loan-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 1px solid #333d4c; border-radius: 7px; background: #0b1119; }
.loan-row > div:last-child { text-align: right; }
.loan-row b { display: block; color: #e4ebf4; font-size: 12px; }
.loan-row span { display: block; color: #84909f; font-size: 10px; }
.ledger { display: flex; flex-direction: column; gap: 1px; border: 1px solid #2c3542; border-radius: 8px; overflow: hidden; background: #0a0f16; }
.ledger-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #0c121a; }
.ledger-row:nth-child(even) { background: #0a1017; }
.ledger-dir { flex: 0 0 26px; height: 26px; display: flex; align-items: center; justify-content: center; border: 1px solid #3b4655; border-radius: 50%; font-size: 10px; }
.ledger-dir.in { color: #b9dc9d; border-color: #567148; background: #132013; }
.ledger-dir.out { color: #efad97; border-color: #7a4e42; background: #23120f; }
.ledger-main { flex: 1 1 auto; min-width: 0; }
.ledger-main b { display: block; color: #e1e8f1; font-size: 12px; font-weight: 500; }
.ledger-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #7f8a99; font-size: 9px; }
.ledger-amt { flex: 0 0 auto; font-size: 13px; font-variant-numeric: tabular-nums; }
.ledger-amt.in { color: #a6d38b; }
.ledger-amt.out { color: #e59e88; }

/* 任务 */
.task-summary { display: flex; align-items: center; gap: 15px; padding: 13px 15px; border: 1px solid #3d4552; border-radius: 9px; background: linear-gradient(90deg, #151b24, #0b1119); }
.task-ring { --v: 0%; flex: 0 0 78px; height: 78px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; background: conic-gradient(#d8b45c var(--v), #29313d 0); box-shadow: inset 0 0 0 8px #10161e; }
.task-ring b { color: #f5dda2; font-size: 15px; line-height: 1.15; }
.task-ring span { margin-top: 1px; color: #8e99a7; font-size: 9px; line-height: 1.1; }
.task-summary > div:nth-child(2) b { display: block; color: #eef2f8; font-size: 15px; }
.task-summary > div:nth-child(2) span { display: block; margin-top: 2px; color: #98a3b2; font-size: 10px; }
.task-summary > div:nth-child(2) em { display: block; margin-top: 3px; color: #837a5e; font-size: 10px; font-style: normal; }
.task-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.task-card { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid #35404f; border-radius: 8px; background: #0b1119; }
.task-card.done { opacity: .72; border-color: #3b4a3a; background: #0b120d; }
.task-check { flex: 0 0 26px; height: 26px; display: flex; align-items: center; justify-content: center; border: 1px solid #5b6574; border-radius: 50%; color: #9cc783; background: #111923; font-size: 13px; }
.task-card.done .task-check { border-color: #66845b; background: #152015; }
.task-main { flex: 1 1 auto; min-width: 0; }
.task-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; }
.task-title span { padding: 0 5px; border: 1px solid #4c5563; border-radius: 3px; color: #aab4c2; font-size: 9px; }
.task-title b { color: #e6edf6; font-size: 13px; }
.task-title em { margin-left: auto; color: #c9ad67; font-size: 9px; font-style: normal; }
.task-desc { margin-top: 2px; color: #8d98a8; font-size: 10px; }
.task-progress { height: 3px; margin-top: 6px; overflow: hidden; background: #27303c; border-radius: 2px; }
.task-progress i { display: block; height: 100%; width: var(--v); background: linear-gradient(90deg, #8f7135, #e1c274); }
.task-card.done .task-progress i { background: #5f7d55; }

@media (max-width: 900px) {
  .town-hub { right: 6px; gap: 5px; }
  .town-hub-btn { width: 44px; padding: 4px 0; }
  .town-hub-btn i { width: 24px; height: 24px; font-size: 13px; }
  .town-hub-btn span { font-size: 9px; letter-spacing: 0; }
  .town-sheet { padding: 8px; }
  .town-sheet-card { width: 100%; max-height: 100%; border-radius: 8px; }
  .town-sheet-head { padding: 12px 14px 10px; }
  .town-sheet-body { padding: 12px 12px 18px; }
  .role-hero { gap: 12px; padding: 12px; }
  .rp-avatar { flex-basis: 72px; width: 72px; height: 72px; }
  .rp-avatar .rp-head { left: 24px; top: 13px; width: 24px; height: 26px; }
  .rp-avatar .rp-torso { left: 13px; bottom: -9px; width: 46px; height: 39px; }
  .role-name { font-size: 16px; }
  .avatar-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-grid, .skill-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-bars { grid-template-columns: 1fr; }
  .bag-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .equip-grid { grid-template-columns: 1fr; }
  .asset-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wallet-hero { grid-template-columns: 1fr; }
  .flow-summary { grid-template-columns: 1fr; }
  .task-card { align-items: flex-start; flex-wrap: wrap; }
  .task-card > .btn { margin-left: 37px; }
}

/* ---------- 行政服务中心 / 室内场景 ---------- */
.town-page.admin-mode .town-top,
.town-page.admin-mode .town-info,
.town-page.admin-mode .town-legend,
.town-page.admin-mode .town-actions,
.town-page.admin-mode .town-hub { display: none; }
.admin-ui { position: absolute; inset: 0; display: none; pointer-events: none; z-index: 8; }
.town-page.admin-mode .admin-ui { display: block; }
.admin-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: flex-start; gap: 14px; padding: 14px 18px 22px; background: linear-gradient(180deg, #05080ef2, #05080e00); pointer-events: auto; }
.admin-top .btn { background: #0d1219cc; border-color: #4a5564; backdrop-filter: blur(5px); flex: 0 0 auto; }
.admin-title { flex: 1; min-width: 0; }
.admin-title b { display: block; font-size: 17px; color: #f4dfa8; letter-spacing: 3px; text-shadow: 0 2px 8px #000; }
.admin-title span { display: block; font-size: 11px; color: #aab4c4; margin-top: 2px; }
.admin-cash { flex: 0 0 auto; color: #f0cf83; font-size: 12px; background: #080c12cc; border: 1px solid #3b4452; border-radius: 6px; padding: 5px 10px; }
.admin-bottom { position: absolute; left: 18px; bottom: 14px; right: 18px; color: #b8c2d1; font-size: 11px; background: #080c12c9; border: 1px solid #303a48; border-radius: 6px; padding: 6px 10px; pointer-events: none; }
.admin-panel { position: absolute; right: 18px; top: 76px; bottom: 48px; width: 396px; background: #0b1017f2; border: 1px solid #4a5364; border-radius: 10px; box-shadow: 0 20px 60px #000c; pointer-events: auto; display: flex; flex-direction: column; overflow: hidden; backdrop-filter: blur(8px); }
.admin-panel[hidden] { display: none; }
.admin-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 16px 11px; border-bottom: 1px solid #2b3442; background: linear-gradient(180deg, #1a202b, #121720); }
.admin-panel-head b { display: block; color: #f0d58d; font-size: 15px; letter-spacing: 1px; }
.admin-panel-head span { display: block; color: #8e99a9; font-size: 11px; margin-top: 2px; }
.admin-x { background: none; border: 0; color: #9aa5b5; font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px; }
.admin-x:hover { color: #f0d58d; }
.admin-panel-body { padding: 14px 16px 18px; overflow-y: auto; font-size: 12px; color: #d9dfe9; }
.admin-panel-body h4 { color: #e8cb84; font-size: 12px; margin: 12px 0 6px; letter-spacing: 1px; }
.admin-panel-body h4:first-child { margin-top: 0; }
.admin-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.admin-kv div { border: 1px solid #28313e; background: #10151d; border-radius: 6px; padding: 7px 9px; }
.admin-kv span { display: block; color: #8692a3; font-size: 10px; }
.admin-kv b { display: block; color: #f0f4fa; font-size: 13px; margin-top: 1px; }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px dashed #26303d; }
.admin-row:last-child { border-bottom: 0; }
.admin-row .main { min-width: 0; flex: 1; }
.admin-row .main b { display: block; color: #e6ebf3; font-size: 12px; }
.admin-row .main span { display: block; color: #8c98a8; font-size: 10px; margin-top: 1px; }
.admin-row .side { flex: 0 0 auto; text-align: right; }
.admin-row .side em { display: block; color: #e8cb84; font-style: normal; font-size: 12px; }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.admin-actions .btn { flex: 0 0 auto; }
.admin-note { margin-top: 10px; padding: 8px 10px; background: #141a23; border-left: 2px solid #c9a24a; color: #98a4b4; font-size: 10px; line-height: 1.7; }
.admin-tag { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 3px; background: #26303d; color: #aeb8c7; margin-left: 4px; }
.admin-tag.gold { background: #3a2f14; color: #e8cb84; }
.admin-tag.green { background: #17301f; color: #6fcf97; }
.admin-tag.red { background: #3a1d1d; color: #eb7b76; }
.admin-empty { color: #8b97a7; padding: 10px 0; }
.admin-buyqty { width: 48px; }

@media (max-width: 820px) {
  .admin-panel { left: 10px; right: 10px; width: auto; top: 72px; bottom: 42px; }
  .admin-title b { font-size: 14px; letter-spacing: 1px; }
  .admin-cash { display: none; }
  .admin-bottom { font-size: 10px; }
}

@media (max-width: 820px) {
  .eq-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .inv-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .furn-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .town-info { width: 220px; }
  .town-chat { top: auto; bottom: 10px; left: 50%; width: calc(100vw - 24px); max-height: 64vh; }
  .town-chat-list { min-height: 64px; max-height: 28vh; height: auto; }
  .town-chat-form { flex-wrap: wrap; }
  .town-chat-form input { flex-basis: 100%; order: 3; }
  .chat-modal { padding: 10px; }
  .chat-modal-card { max-height: calc(100vh - 20px); }
}

/* ---------- 加工与工厂 ---------- */
.ind-guide { margin-bottom: 14px; }
.ind-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.ind-metrics > div { background: #141a23; border: 1px solid #273140; border-radius: 6px; padding: 9px 10px; }
.ind-metrics b { display: block; color: #e8cb84; font-size: 20px; }
.ind-metrics span { color: #8d99aa; font-size: 10px; }
.ind-section-title { margin: 18px 0 8px; color: #e8cb84; font-weight: 700; letter-spacing: 1px; border-left: 3px solid #c9a24a; padding-left: 8px; }
.ind-section-title .hint { font-weight: 400; letter-spacing: 0; margin-left: 8px; }
.ind-card { align-self: start; }
.ind-card h3 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ind-sect { margin-top: 12px; padding-top: 10px; border-top: 1px solid #242e3b; }
.ind-sect h4 { color: #c8b07a; margin-bottom: 7px; }
.ind-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 5px 0; border-bottom: 1px dashed #222b37; }
.ind-row > span:first-child { min-width: 120px; flex: 1 1 140px; }
.ind-row input, .ind-row select { max-width: 220px; }
.ind-stock { display: flex; gap: 5px; flex-wrap: wrap; margin: 5px 0; }
.ind-order { background: #121820; border: 1px solid #2a3441; border-radius: 6px; padding: 9px 10px; margin: 8px 0; }
.ind-stop { color: #e38a7f; background: #251718; border: 1px solid #482727; border-radius: 6px; padding: 8px 10px; margin: 7px 0; font-size: 11px; }
.ind-alert { color: #ffb3a7; background: #2b1717; border: 1px solid #5a2b2b; border-radius: 6px; padding: 8px 10px; margin: 8px 0; }
.ind-item-img { border-radius: 6px; background: #efe1c2; object-fit: cover; vertical-align: middle; flex: 0 0 auto; }
.ind-item-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ind-stock-tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px 4px 4px; }
.ind-shop-head { display: flex; align-items: center; gap: 10px; padding: 8px 0 10px; }
.ind-shop-head img { border-radius: 10px; background: #151c25; border: 1px solid #344052; }
.ind-shop-head b { display: block; color: #e8cb84; margin-bottom: 3px; }
.ind-prod { background: #10161f; border: 1px solid #2a3441; border-radius: 8px; padding: 10px; margin: 8px 0; }
.ind-prod-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ind-prod-head b { font-size: 14px; color: #e8cb84; }
.ind-prod-head span { display: block; margin-top: 2px; }
.ind-mats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.ind-mat { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 2px 7px; background: #151c26; border: 1px solid #283443; border-radius: 7px; padding: 5px 7px; min-width: 190px; max-width: 100%; }
.ind-mat b { font-size: 11px; color: #d9ccb0; }
.ind-mat em { grid-column: 1 / -1; font-style: normal; font-size: 10px; line-height: 1.4; color: #8794a6; }
.ind-cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: start; }
.ind-cat { background: #10161f; border: 1px solid #2b3543; border-radius: 8px; padding: 0 9px 9px; min-width: 0; }
.ind-cat summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 9px 0; cursor: pointer; }
.ind-cat summary::-webkit-details-marker { display: none; }
.ind-cat summary span { min-width: 0; }
.ind-cat summary b { display: block; color: #e8cb84; font-size: 13px; }
.ind-cat summary em { display: block; font-style: normal; color: #8794a6; font-size: 10px; line-height: 1.4; margin-top: 2px; }
.ind-cat[open] summary { border-bottom: 1px dashed #2a3441; margin-bottom: 6px; }
.ind-cat-cert { color: #ffb3a7; background: #2b1717; border: 1px solid #5a2b2b; border-radius: 5px; padding: 4px 6px; font-size: 10px; margin: 4px 0; }
.ind-cat-prod { border-top: 1px dashed #222b37; padding: 7px 0 5px; }
.ind-cat-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ind-cat-title b { color: #dfcca6; font-size: 11px; }
.ind-cat-title span { color: #8d99aa; font-size: 10px; line-height: 1.4; }
.ind-cat-ing { display: flex; align-items: flex-start; gap: 5px; margin-top: 4px; }
.ind-cat-ing b { flex: 0 0 auto; color: #c6b795; font-size: 10px; }
.ind-cat-ing span { color: #758192; font-size: 9px; line-height: 1.45; }
@media (max-width: 820px) {
  .ind-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ind-row > span:first-child { flex: 1 1 100%; }
  .ind-prod-head { align-items: flex-start; }
  .ind-cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .ind-cat-grid { grid-template-columns: 1fr; }
}

/* V2.0.0.0 好友、玩家互动与住宅房间 */
.social-modal { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; }
.social-modal[hidden] { display: none; }
.social-modal-mask { position: absolute; inset: 0; background: #02050acc; backdrop-filter: blur(4px); }
.social-modal-card { position: relative; width: min(640px, calc(100vw - 28px)); max-height: min(86vh, 820px); display: flex; flex-direction: column; border: 1px solid #5a6577; border-radius: 12px; background: linear-gradient(180deg, #141d29, #0a1018); box-shadow: 0 24px 70px #000c; overflow: hidden; }
.social-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px 12px; border-bottom: 1px solid #2b3543; background: #101823; }
.social-modal-head b { display: block; color: #f3d99c; font-size: 17px; letter-spacing: 1px; }
.social-modal-head span { display: block; margin-top: 4px; color: #91a0b3; font-size: 11px; }
.social-modal-x { border: 1px solid #455365; border-radius: 6px; background: #0b1119; color: #c9d5e4; width: 32px; height: 32px; font-size: 18px; cursor: pointer; }
.social-modal-x:hover { border-color: #d8b45c; color: #ffe5a6; }
.social-modal-body { padding: 14px 16px 18px; overflow-y: auto; scrollbar-width: thin; }
.social-modal-tip { min-height: 18px; padding: 0 16px 12px; color: #f0cf8a; font-size: 12px; }
.social-modal-tip.err { color: #ff9a8a; }
.social-empty { padding: 18px 12px; color: #8391a4; font-size: 12px; text-align: center; border: 1px dashed #334052; border-radius: 8px; background: #0c131c; }
.social-section-title { margin: 16px 0 8px; color: #d9e4f2; font-size: 12px; letter-spacing: 1px; border-left: 3px solid #d8b45c; padding-left: 8px; }
.social-player-top { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #2e3b4c; border-radius: 9px; background: #0d1620; }
.social-player-avatar { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid #d8b45c; background: radial-gradient(circle, #3a3020, #151b23); color: #ffe3a0; font-size: 20px; }
.social-player-top b { color: #f2e6c8; font-size: 15px; }
.social-player-top small { display: block; margin-top: 3px; color: #8e9db0; font-size: 11px; }
.social-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 8px; }
.social-actions .btn { padding: 7px 10px; font-size: 11px; }
.social-actions .btn[disabled], .social-friend-row .btn[disabled] { opacity: .45; cursor: not-allowed; }
.social-home-line { margin: 8px 0; color: #a9b7c9; font-size: 12px; }
.social-equipment { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 7px; }
.social-eq { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid #2c3848; border-radius: 7px; background: #0b121a; }
.social-eq.on { border-color: #5a5236; background: #15160f; }
.social-eq.empty { border-color: #273241; background: #0a1017; }
.social-eq > span { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border: 1px solid #3d4b5d; border-radius: 5px; font-size: 15px; }
.social-eq.empty > span { border-style: dashed; border-color: #34404e; background: #080d13; }
.social-eq.empty small { color: #687689; }
.social-eq b { display: block; color: #d7e1ee; font-size: 11px; }
.social-eq small { display: block; margin-top: 2px; color: #8d9aac; font-size: 10px; }
.social-form { display: grid; grid-template-columns: 1fr 110px 120px; gap: 8px; padding: 10px; border: 1px solid #2e3b4c; border-radius: 8px; background: #0c141e; }
.social-form label { display: flex; flex-direction: column; gap: 4px; color: #a9b6c8; font-size: 11px; }
.social-form input, .social-form select { width: 100%; border: 1px solid #3b495b; border-radius: 5px; background: #101a24; color: #e9f0f8; font-size: 12px; padding: 6px 7px; outline: none; }
.social-form-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.social-hint { color: #8493a6; font-size: 11px; line-height: 1.5; }
.social-friend-list, .social-invite-list { display: flex; flex-direction: column; gap: 6px; }
.social-friend-row, .social-invite-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 1px solid #2b3747; border-radius: 7px; background: #0c131c; }
.social-friend-row b, .social-invite-row b { color: #dfe8f4; font-size: 12px; }
.social-friend-row small, .social-invite-row small { display: block; margin-top: 3px; color: #8e9caf; font-size: 10px; }
.social-invite-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.social-invite-actions .btn { padding: 5px 8px; font-size: 10px; }
.social-small-list { margin-top: 8px; padding: 8px 10px; border: 1px solid #2a3544; border-radius: 7px; background: #0a1118; color: #8e9caf; font-size: 11px; line-height: 1.8; }
.room-bed-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 10px; }
.room-bed-slot { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid #334153; border-radius: 9px; background: #0c141d; }
.room-bed-slot.occupied { border-color: #5a4b35; background: #15130f; }
.room-bed-slot span { color: #8d9cae; font-size: 11px; }
.room-bed-slot b { color: #e3ecf7; font-size: 13px; }
.room-bed-slot .btn { margin-top: 4px; }
.room-sleep-live { margin: 10px 0 14px; padding: 16px; border: 1px solid #5c5037; border-radius: 9px; background: radial-gradient(circle at 20% 10%, #2b2517, #0d141b); color: #cbd6e4; font-size: 13px; line-height: 1.8; }
.room-sleep-live b { color: #ffe2a3; font-size: 16px; }
.tv-shell { display: flex; flex-direction: column; gap: 10px; }
.tv-screen-wrap { position: relative; border: 8px solid #191f26; border-radius: 10px; background: #05080c; box-shadow: inset 0 0 40px #000, 0 8px 26px #000a; overflow: hidden; }
.tv-screen-wrap canvas { display: block; width: 100%; height: auto; }
.tv-now { position: absolute; left: 10px; bottom: 8px; padding: 3px 8px; border-radius: 4px; background: #000a; color: #d7e6ef; font-size: 11px; }
.tv-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.tv-controls select { flex: 1 1 180px; min-width: 0; border: 1px solid #3b495b; border-radius: 5px; background: #101a24; color: #e9f0f8; font-size: 12px; padding: 7px; outline: none; }

.town-page.home-mode:not(.home-arrange) .town-info { display: none !important; }
.home-ui-title #homeHud { display: block; margin-top: 3px; color: #d4b998; font-size: 11px; letter-spacing: 0; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#homeDarkOverlay { position: absolute; inset: 0; z-index: 13; pointer-events: none; background: radial-gradient(circle at 50% 55%, #00000088, #000000e8); opacity: 0; transition: opacity .25s ease; }

/* ---------- 找到活路 · 微信授权登录与角色注册 ---------- */
.auth-wechat { max-width: 420px; text-align: center; padding: 34px 32px 30px; }
.auth-logo { display: block; width: 112px; height: 112px; margin: 0 auto 14px; object-fit: contain; }
.auth-wechat h1 { font-size: 26px; letter-spacing: 5px; margin-bottom: 6px; }
.auth-wechat p.sub { margin-bottom: 22px; }
.wx-login-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 13px 16px; border-radius: 8px; background: #22b573; color: #fff; font-size: 16px; font-weight: 700; box-shadow: 0 5px 18px rgba(34,181,115,.22); }
.wx-login-btn:hover { background: #1fa768; }
.wx-qr-card { width: 300px; margin: 2px auto 0; padding: 10px 0 12px; background: #fff; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.22); }
.wx-qr-card iframe { display: block; width: 300px; height: 400px; border: 0; margin: 0 auto; }
.wx-qr-img { display: block; width: 260px; height: 260px; margin: 0 auto; border-radius: 8px; }
.wx-qr-card p { color: #4a5563; font-size: 12px; line-height: 1.6; margin: 6px 16px 0; text-align: center; }
.wx-qr-card .wx-qr-service { color: #7b8794; font-size: 10px; margin-top: 4px; }
.wx-qr-fallback { display: inline-block; color: #1a7f55; font-size: 11px; margin-top: 8px; }
.wx-qr-empty { background: #10161d; border: 1px dashed rgba(200,168,91,.45); padding: 22px 18px; }
.wx-qr-empty-title { color: #d8b25c; font-size: 14px; font-weight: 700; margin: 0 0 8px; }
.wx-qr-empty p { color: #9aa8b8; margin: 0; }
.auth-tabs { display: flex; gap: 3px; margin-top: 14px; padding: 3px; border: 1px solid #2c3948; border-radius: 9px; background: #0d131b; }
.auth .auth-tab { flex: 1; width: auto; border: 0; border-radius: 6px; background: transparent; color: #8799ad; font-size: 13px; font-weight: 400; padding: 8px 10px; cursor: pointer; transition: color .18s; }
.auth .auth-tab:hover { color: #d8b25c; }
.auth .auth-tab.active { background: var(--gold); color: #17130a; box-shadow: none; font-weight: 700; }
.auth-pane { margin-top: 14px; }
.auth-pane[hidden] { display: none !important; }
.account-head { color: #edf3fb; font-size: 16px; font-weight: 700; text-align: left; }
.account-sub { color: #75879a; font-size: 11px; line-height: 1.6; margin: 7px 0 0; text-align: left; }
.account-box { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 14px; }
.account-toggle { background: none; border: 0; color: #9fb3c9; font-size: 12px; cursor: pointer; padding: 6px 8px; }
.account-toggle:hover { color: var(--gold); }
.account-form { display: block; text-align: left; margin-top: 12px; }
.account-form label { display: block; color: #8799ad; font-size: 11px; margin: 8px 0 5px; }
.account-form input { width: 100%; box-sizing: border-box; border: 1px solid #334252; border-radius: 7px; background: #0d131b; color: #edf3fb; font-size: 14px; padding: 11px 12px; outline: none; }
.account-form input:focus { border-color: rgba(216,178,92,.75); box-shadow: 0 0 0 2px rgba(216,178,92,.12); }
.account-remember { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.account-form .account-remember label { display: inline-flex; align-items: center; gap: 7px; margin: 0; color: #b8c5d4; font-size: 12px; cursor: pointer; }
.account-form .account-remember input[type=checkbox] { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; padding: 0; accent-color: #d6b25d; box-shadow: none; }
.account-remember p { margin: 0; color: #718396; font-size: 10px; text-align: right; line-height: 1.4; }
.gender-pick { display: flex; gap: 8px; margin: 2px 0 6px; }
.auth .gender-btn { flex: 1; width: auto; border: 1px solid #334252; border-radius: 7px; background: #0d131b; color: #8799ad; font-size: 12px; font-weight: 400; padding: 9px 8px; cursor: pointer; }
.auth .gender-btn:hover { border-color: rgba(216,178,92,.5); color: #d8b25c; }
.auth .gender-btn.active { border-color: rgba(216,178,92,.75); background: rgba(216,178,92,.14); color: #f3e3bd; font-weight: 700; }
.account-error { color: #e06c68; font-size: 11px; min-height: 16px; margin-top: 7px; }
.account-submit { width: 100%; border: 1px solid rgba(216,178,92,.65); border-radius: 7px; background: rgba(216,178,92,.16); color: #f3e3bd; font-size: 14px; font-weight: 700; padding: 11px; cursor: pointer; }
.account-submit:disabled { opacity: .55; cursor: wait; }
.account-hint { color: #75879a; font-size: 10px; line-height: 1.6; margin: 9px 0 0; text-align: center; }
@media (max-width: 520px) { .wx-qr-card { width: min(300px, 100%); } }
.wx-mark { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.18); font-size: 12px; }
.auth-note { color: var(--dim); font-size: 12px; line-height: 1.7; margin-top: 18px; }
.mock-note { color: #c8a85b; font-size: 11px; line-height: 1.6; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.auth-register { max-width: 460px; text-align: left; }
.auth-brandline { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.auth-brandline img { width: 40px; height: 40px; object-fit: contain; }
.auth-brandline b { display: block; letter-spacing: 2px; font-size: 14px; }
.auth-brandline span { display: block; color: var(--dim); font-size: 11px; }
.auth-register h1 { font-size: 20px; letter-spacing: 1px; }
.auth-register p.sub { margin-bottom: 16px; }
.wx-profile { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 18px; background: #0c0e12; border: 1px solid var(--line); border-radius: 8px; }
.wx-avatar { position: relative; width: 54px; height: 54px; flex: 0 0 54px; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg,#28533d,#1b3027); display: flex; align-items: center; justify-content: center; color: #d8b25c; font-size: 22px; font-weight: 700; border: 1px solid rgba(216,178,92,.45); }
.wx-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wx-meta b { display: block; font-size: 14px; }
.wx-meta span { color: var(--dim); font-size: 11px; }
.hidden { display: none !important; }
.field-label { display: block; color: var(--dim); font-size: 12px; margin: 2px 0 7px; }
.auth-register .gender-pick { display: flex; gap: 10px; margin: 0 0 12px; }
.gender-card { flex: 1; min-height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: #0c0e12 !important; color: #aeb8c4 !important; border: 1px solid var(--line) !important; border-radius: 8px; padding: 10px 8px; cursor: pointer; transition: border-color .15s, background .15s; }
.gender-card b { color: #d9e2ec; font-size: 14px; }
.gender-card span { color: var(--dim); font-size: 10px; }
.gender-card.on { border-color: var(--gold) !important; background: #221d11 !important; box-shadow: 0 0 0 1px rgba(216,178,92,.25) inset; }
.gender-card.on b { color: var(--gold); }
.gender-icon { position: relative; display: block; width: 26px; height: 30px; margin-bottom: 3px; }
.gender-icon::before { content: ''; position: absolute; left: 7px; top: 0; width: 12px; height: 12px; border-radius: 50%; background: #b8c2cf; }
.gender-icon::after { content: ''; position: absolute; left: 3px; top: 14px; width: 20px; height: 15px; border-radius: 10px 10px 4px 4px; background: #8794a5; }
.female-icon::after { width: 22px; height: 18px; left: 2px; border-radius: 12px 12px 3px 3px; background: #9d7bb5; }
.auth-submit { margin-top: 6px; }
.brand-mini { width: 27px; height: 27px; object-fit: contain; vertical-align: -7px; margin-right: 6px; }

.hud-avatar.wechat { background-size: cover !important; background-position: center !important; }
.hud-avatar.wechat .hud-hair, .hud-avatar.wechat .hud-face, .hud-avatar.wechat .hud-shoulders { display: none; }
