/* 公会 / 家园社交 / 家园玩法 —— web/js/ui/panels/guild.js、homevisit.js、web/js/game/guild.js、home.js */

/* ---------- 通用 ---------- */
.g-body, .hm-body { display: flex; flex-direction: column; gap: 10px; }
.g-body > *, .hm-body > * { flex-shrink: 0; }
.g-body > .card, .hm-body > .card { margin: 0; }
.g-em-pick img { width: 24px; height: 24px; }
.g-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.g-split > .card { margin: 0; min-width: 0; }
.g-lab { display: block; margin: 10px 0 4px; font-size: 12px; color: var(--muted); }
.g-ta { width: 100%; box-sizing: border-box; resize: vertical; min-height: 64px; font-family: var(--px); }
.g-note { padding: 8px 12px; font-size: 13px; background: rgba(255,216,74,.08); box-shadow: inset 0 0 0 1px rgba(255,216,74,.35); clip-path: var(--notch); }
.g-note.warn { color: var(--gold); }
.g-tip, .hm-tip { font-size: 12px; margin-top: 6px; line-height: 1.6; }
.g-row { cursor: default; }
.g-row .avatar, .g-mem .avatar, .hv-msg .avatar, .hm-home .avatar { width: 36px; height: 36px; image-rendering: pixelated; }
.g-lv { display: inline-block; margin-left: 6px; padding: 0 6px; font-size: 11px; line-height: 18px; color: var(--ink); background: var(--gold); clip-path: var(--notch); vertical-align: 2px; }

/* 徽记 */
.g-emblem { --gc: #b48cff; position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--gc) 45%, #1a1430), #120c24 75%);
  box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 3px var(--gc), 0 0 12px color-mix(in srgb, var(--gc) 35%, transparent); clip-path: var(--notch4); }
.g-emblem img { image-rendering: pixelated; filter: drop-shadow(0 2px 0 var(--ink)); }
.g-emblem.big { box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 4px var(--gc), 0 0 24px color-mix(in srgb, var(--gc) 50%, transparent); }

/* ---------- 浏览 / 创建 ---------- */
.g-search { gap: 8px; } .g-search .input { flex: 1; }
.g-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.g-card { --gc: #b48cff; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: linear-gradient(160deg, color-mix(in srgb, var(--gc) 16%, #1a1430), #120c24 70%);
  box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 2px color-mix(in srgb, var(--gc) 45%, #3a2d63); clip-path: var(--notch4); }
.g-card-top { display: flex; gap: 10px; align-items: center; }
.g-card-name { font-size: 17px; color: #fff; text-shadow: 0 2px 0 var(--ink); }
.g-card-notice { font-size: 12px; color: var(--muted); line-height: 1.5; min-height: 36px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.g-card-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.g-create { display: flex; flex-direction: column; }
.g-preview { display: flex; align-items: center; gap: 14px; padding: 10px; margin-bottom: 4px; background: rgba(0,0,0,.25); clip-path: var(--notch); }
.g-emblems { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; }
.g-em-pick { display: flex; align-items: center; justify-content: center; height: 38px; padding: 0; border: 0; cursor: pointer; background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); clip-path: var(--notch); }
.g-em-pick img { image-rendering: pixelated; }
.g-em-pick:hover { background: rgba(255,255,255,.1); }
.g-em-pick.on { background: rgba(255,216,74,.18); box-shadow: inset 0 0 0 2px var(--gold); }
.g-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.g-col { width: 30px; height: 30px; border: 0; cursor: pointer; box-shadow: inset 0 0 0 2px var(--ink); clip-path: var(--notch); }
.g-col.on { box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 4px #fff; transform: scale(1.08); }
.g-create-foot { align-items: center; gap: 8px; margin-top: 14px; }
.g-modal { width: min(560px, 92vw); }

/* ---------- 概览 ---------- */
.g-hero { --gc: #b48cff; display: flex; gap: 16px; align-items: center; padding: 14px 16px; flex-wrap: wrap;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--gc) 30%, transparent), transparent 60%), linear-gradient(180deg, #221a3e, #120c24);
  box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 2px color-mix(in srgb, var(--gc) 55%, #3a2d63); clip-path: var(--notch4); }
.g-hero-main { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.g-hero-name { font-size: 24px; color: #fff; text-shadow: 0 2px 0 var(--ink), 0 0 14px color-mix(in srgb, var(--gc) 60%, transparent); }
.g-expbar { height: 14px; }
.g-hero-chips { gap: 6px; }
.g-hero-me { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.g-notice-t { white-space: pre-wrap; line-height: 1.7; color: #e8e0ff; }
.g-daily { display: flex; flex-direction: column; gap: 8px; }
.g-act { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); clip-path: var(--notch); }
.g-act img { image-rendering: pixelated; }
.g-act.done { opacity: .62; }
.g-tasks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.g-task { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); clip-path: var(--notch); margin-bottom: 6px; }
.g-task .bar { height: 10px; margin-top: 4px; }
.g-task.ready { box-shadow: inset 0 0 0 1px var(--gold); background: rgba(255,216,74,.07); }
.g-task.claimed { opacity: .55; }
.g-task-r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.g-task-r small { color: var(--muted); font-size: 11px; }
.g-perks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.g-perk { display: flex; gap: 8px; font-size: 12px; color: var(--dim); }
.g-perk.on { color: #e8e0ff; }
.g-perk-lv { flex: none; width: 40px; color: var(--muted); }
.g-perk.on .g-perk-lv { color: var(--gold); }
.g-chat-log { height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 6px; background: rgba(0,0,0,.25); margin-bottom: 8px; }
.g-chat-m { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; line-height: 1.5; }
.g-chat-m .avatar { width: 24px; height: 24px; flex: none; image-rendering: pixelated; }
.g-chat-who { color: #c890ff; }
.g-chat .row .input { flex: 1; }
.g-log { height: 236px; overflow-y: auto; font-size: 12px; line-height: 1.8; }
.g-log-e { border-bottom: 1px dashed rgba(255,255,255,.06); }
.g-foot { justify-content: flex-end; gap: 8px; }

/* ---------- 成员 ---------- */
.g-invite { gap: 8px; } .g-invite .input { flex: 1; min-width: 140px; }
.g-members { display: flex; flex-direction: column; gap: 6px; }
.g-mem { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(255,255,255,.025); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); clip-path: var(--notch); flex-wrap: wrap; }
.g-mem:not(.online) .avatar { opacity: .5; filter: grayscale(.6); }
.g-mem-main { min-width: 180px; }
.g-mem-sub { font-size: 11px; margin-top: 2px; }
.g-mem-acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- 商店 ---------- */
.g-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.g-ware { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px; text-align: center; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,.2));
  box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 2px #3a2d63; clip-path: var(--notch4); }
.g-ware.staple { box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 2px #5a7a4a; }
.g-ware.locked { opacity: .5; filter: grayscale(.7); }
.g-ware-ic img { image-rendering: pixelated; filter: drop-shadow(0 2px 0 var(--ink)); }
.g-ware-n { font-size: 13px; color: #fff; }
.g-ware-t { font-size: 11px; }
.g-ware-c { display: inline-flex; align-items: center; gap: 3px; color: var(--gold); }

/* ---------- 首领 ---------- */
.g-boss { --bc: #ff5a6a; display: flex; gap: 16px; padding: 14px; flex-wrap: wrap; align-items: center;
  background: radial-gradient(100% 120% at 0% 50%, color-mix(in srgb, var(--bc) 30%, transparent), transparent 60%), linear-gradient(180deg, #221a3e, #120c24);
  box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 2px color-mix(in srgb, var(--bc) 55%, #3a2d63); clip-path: var(--notch4); }
.g-boss-art { position: relative; flex: none; width: 150px; display: flex; align-items: flex-end; justify-content: center; }
.g-boss-art img { width: 140px; image-rendering: pixelated; filter: drop-shadow(0 4px 0 var(--ink)); animation: gbFloat 3s ease-in-out infinite; }
@keyframes gbFloat { 50% { transform: translateY(-5px); } }
.g-boss-stage { position: absolute; left: 0; top: 0; padding: 2px 8px; font-size: 12px; color: var(--ink); background: var(--gold); clip-path: var(--notch); }
.g-boss-main { flex: 1 1 280px; display: flex; flex-direction: column; gap: 6px; }
.g-boss-name { font-size: 20px; color: #fff; text-shadow: 0 2px 0 var(--ink); }
.g-boss-hp { height: 18px; } .g-boss-hp i { background: linear-gradient(180deg, #ff7a8a, #c82a3a) !important; }
.g-rewards { display: flex; flex-direction: column; gap: 6px; }
.g-rw { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 6px 8px; font-size: 13px; background: rgba(255,255,255,.03); clip-path: var(--notch); }
.g-rw b { min-width: 76px; color: var(--gold); }
.g-rw span { display: inline-flex; align-items: center; gap: 3px; }
.g-rw img { image-rendering: pixelated; }
.gb-timer { position: fixed; bottom: calc(var(--safe-b) + 92px); left: 50%; transform: translateX(-50%); z-index: 40; display: flex; align-items: baseline; gap: 10px; padding: 6px 16px;
  background: rgba(16,11,32,.88); box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 2px #ff5a6a; clip-path: var(--notch4); pointer-events: none; }
.gb-timer b { color: #ff9aa8; font-size: 13px; } .gb-timer span { font-size: 24px; color: #fff; min-width: 46px; text-align: center; } .gb-timer small { color: var(--muted); }
.gb-timer.low span { color: #ff5a6a; animation: gbBlink .5s steps(2) infinite; }
@keyframes gbBlink { 50% { opacity: .4; } }
.gb-result { text-align: center; }
.gb-res-dmg { margin: 10px 0; } .gb-res-dmg small { display: block; color: var(--muted); } .gb-res-dmg b { font-size: 34px; color: var(--gold); text-shadow: 0 3px 0 var(--ink); }
.gb-res-row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed rgba(255,255,255,.08); }

/* ---------- 领地战 ---------- */
.g-war-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; font-size: 13px; }
.g-war-st { padding: 3px 10px; background: rgba(255,255,255,.06); clip-path: var(--notch); }
.g-war-st.on { color: var(--ink); background: #ff5a6a; animation: gbPulse 1.6s infinite; }
.g-war-st.wait { color: var(--gold); }
@keyframes gbPulse { 50% { filter: brightness(1.25); } }
.g-war-map { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.g-terr { --tc: #b48cff; position: relative; display: flex; flex-direction: column; gap: 6px; padding: 10px; cursor: pointer; min-height: 112px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 22%, #1a1430), #100a20 80%);
  box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 2px color-mix(in srgb, var(--tc) 40%, #2c2152); clip-path: var(--notch4); transition: transform .12s; }
.g-terr:hover { transform: translateY(-2px); }
.g-terr.mine { box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 3px var(--gold), 0 0 14px rgba(255,216,74,.3); }
.g-terr.target::after { content: '⚔'; position: absolute; right: 8px; bottom: 6px; font-size: 18px; color: #ff7a8a; text-shadow: 0 2px 0 var(--ink); }
.g-terr-h { display: flex; align-items: center; gap: 6px; }
.g-terr-h b { color: #fff; text-shadow: 0 2px 0 var(--ink); }
.g-terr-idx { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: var(--ink); background: var(--tc); clip-path: var(--notch); }
.g-terr-main, .g-terr-tg { margin-left: auto; padding: 0 6px; font-size: 11px; color: var(--ink); background: #ff7a8a; clip-path: var(--notch); }
.g-terr-tg { background: #ffb84a; }
.g-terr-own { display: flex; align-items: center; gap: 6px; font-size: 13px; min-height: 26px; }
.g-terr-bar { position: relative; height: 16px; background: rgba(0,0,0,.4); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.g-terr-bar i { position: absolute; left: 0; top: 0; bottom: 0; opacity: .75; }
.g-terr-bar small { position: relative; display: block; padding: 0 6px; font-size: 11px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-terr-bar.none { background: rgba(0,0,0,.2); }
.g-terr-bar.none small { color: var(--dim); }
.g-terr-my { font-size: 11px; color: var(--gold); }
.g-rules { display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.6; }
.g-app-t { font-size: 13px; color: #ffd8f0; margin: 2px 0; }

/* ---------- 家园 ---------- */
.hm-hero { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px 16px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(125,255,138,.18), transparent 60%), linear-gradient(180deg, #221a3e, #120c24);
  box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 2px #3a6a4a; clip-path: var(--notch4); }
.hm-hero-ic img { image-rendering: pixelated; filter: drop-shadow(0 3px 0 var(--ink)); }
.hm-hero > .grow { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hm-hero-t { font-size: 22px; color: #fff; text-shadow: 0 2px 0 var(--ink); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hm-season { --sc: #7dff8a; font-size: 12px; padding: 1px 8px; color: var(--ink); background: var(--sc); clip-path: var(--notch); }
.hm-next { font-size: 12px; }
.hm-hero-r { display: flex; flex-wrap: wrap; gap: 8px; }
.hm-actions { gap: 8px; }
.hm-buffs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.hm-buff { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; text-align: center; background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); clip-path: var(--notch); opacity: .55; }
.hm-buff.on { opacity: 1; background: rgba(255,122,182,.1); box-shadow: inset 0 0 0 1px var(--pink); }
.hm-buff small { color: var(--muted); font-size: 11px; } .hm-buff span { font-size: 12px; color: var(--green); }
.hm-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.hm-theme { --tc: #9a90c0; display: flex; flex-direction: column; gap: 4px; padding: 8px; background: color-mix(in srgb, var(--tc) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 45%, transparent); clip-path: var(--notch); }
.hm-theme b { color: var(--tc); }
.hm-theme .bar i { background: var(--tc) !important; }
.hm-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.hm-seg button { --sc: #b48cff; display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; font-family: var(--px); font-size: 12px; color: #e8e0ff; cursor: pointer; border: 0;
  background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); clip-path: var(--notch); }
.hm-seg button.on { color: var(--ink); background: var(--sc); box-shadow: none; }
.hm-seg button.locked { opacity: .45; cursor: not-allowed; }
.hm-seg button small { font-size: 10px; color: var(--muted); }
.hm-sets { margin-bottom: 4px; }
.hm-crops { display: flex; flex-wrap: wrap; gap: 4px; }
.hm-daily .g-task { margin-bottom: 6px; }
.hm-all { align-items: center; gap: 8px; margin-top: 4px; }
.hm-homes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.hm-home { --tc: #9a90c0; display: flex; align-items: center; gap: 10px; padding: 10px; background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 14%, #1a1430), #120c24);
  box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 2px color-mix(in srgb, var(--tc) 40%, #2c2152); clip-path: var(--notch4); }
.hm-home .grow { min-width: 0; } .hm-home .dim { font-size: 12px; }
.hm-show { --tc: #ffd84a; position: relative; display: flex; align-items: center; gap: 14px; padding: 18px 16px 14px; overflow: hidden;
  background: radial-gradient(120% 160% at 100% 0%, color-mix(in srgb, var(--tc) 35%, transparent), transparent 60%), linear-gradient(180deg, #2a1f4a, #120c24);
  box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 3px #ffd84a, 0 0 22px rgba(255,216,74,.22); clip-path: var(--notch4); }
.hm-show.empty { justify-content: center; padding: 26px 16px 18px; }
.hm-show-badge { position: absolute; left: 0; top: 0; padding: 2px 10px; font-size: 12px; color: var(--ink); background: linear-gradient(90deg, #ffd84a, #ffb84a); clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.hm-show .avatar.big { width: 64px; height: 64px; image-rendering: pixelated; box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px #ffd84a; }
.hm-show-name { font-size: 22px; color: #fff; text-shadow: 0 2px 0 var(--ink); }
.hm-cat, .hm-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.hm-fur, .hm-pick-i { --tc: #9a90c0; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; text-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 12%, transparent), rgba(0,0,0,.2)); box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 2px color-mix(in srgb, var(--tc) 35%, #2c2152); clip-path: var(--notch4); }
.hm-fur img, .hm-pick-i img { width: 40px; height: 40px; image-rendering: pixelated; filter: drop-shadow(0 2px 0 var(--ink)); }
.hm-fur b, .hm-pick-i b { font-size: 12px; color: #fff; } .hm-fur small, .hm-pick-i small { font-size: 10px; line-height: 1.4; }
.hm-fur:not(.own) { opacity: .6; }
.hm-fur-n { font-size: 10px; color: var(--gold); }
.hm-pick-i { cursor: pointer; transition: transform .1s; } .hm-pick-i:hover { transform: translateY(-2px); }
.hm-pick-i.locked { opacity: .5; }
.hm-lock { position: absolute; top: 4px; right: 4px; font-size: 10px; padding: 0 4px; color: var(--ink); background: var(--gold); }
.hm-tools { gap: 6px; margin-bottom: 8px; }
.hm-seeds { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.hm-seed { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; cursor: pointer; text-align: center; background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); clip-path: var(--notch); }
.hm-seed img { image-rendering: pixelated; } .hm-seed b { font-size: 12px; } .hm-seed small { font-size: 10px; color: var(--muted); }
.hm-seed span { font-size: 10px; color: var(--dim); } .hm-seed.ok span { color: var(--green); } .hm-seed.ok { box-shadow: inset 0 0 0 1px rgba(125,255,138,.5); }
.hm-shelf { width: min(560px, 92vw); }
.hm-cores { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 10px 0; }
.hm-core { --cc: #9a90c0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; background: rgba(0,0,0,.3); clip-path: var(--notch); }
.hm-core img { image-rendering: pixelated; } .hm-core small { font-size: 9px; color: var(--dim); text-align: center; }
.hm-core.on { background: color-mix(in srgb, var(--cc) 16%, #120c24); box-shadow: inset 0 0 0 1px var(--cc); } .hm-core.on small { color: var(--cc); }
.hm-core.on img { filter: drop-shadow(0 0 6px var(--cc)); }

/* 布置模式底栏 */
.hm-bbar { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 14px); transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center;
  max-width: calc(100vw - 20px); padding: 8px 12px; background: rgba(16,11,32,.94); box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 2px #ffd84a, 0 8px 30px rgba(0,0,0,.5); clip-path: var(--notch4); }
.hm-bbar img { width: 32px; height: 32px; image-rendering: pixelated; }
.hm-bbar-t { display: flex; flex-direction: column; min-width: 110px; margin-right: 4px; }
.hm-bbar-t small { color: var(--muted); font-size: 11px; }
.hm-bbar .btn.on { outline: 2px solid #fff; outline-offset: -2px; }
.hm-dps { position: fixed; bottom: calc(var(--safe-b) + 92px); left: 50%; transform: translateX(-50%); z-index: 40; display: flex; align-items: baseline; gap: 10px; padding: 6px 16px; pointer-events: none;
  background: rgba(16,11,32,.88); box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 2px #ffb84a; clip-path: var(--notch4); }
.hm-dps b { color: #ffb84a; font-size: 13px; } .hm-dps span { font-size: 22px; color: #fff; } .hm-dps small { color: var(--muted); }

/* 拜访栏 / 留言板 */
.hv-bar { position: fixed; top: calc(var(--safe-t) + 8px); left: 50%; transform: translateX(-50%); z-index: 45; display: flex; align-items: center; gap: 8px; padding: 6px 10px; max-width: calc(100vw - 16px);
  background: rgba(16,11,32,.92); box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 2px #ff9ad8, 0 6px 24px rgba(0,0,0,.45); clip-path: var(--notch4); }
.hv-bar .avatar { width: 34px; height: 34px; image-rendering: pixelated; }
.hv-bar-t { display: flex; flex-direction: column; min-width: 0; } .hv-bar-t small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.hv-book { width: min(560px, 94vw); }
.hv-book-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.hv-book-head .avatar.big { width: 56px; height: 56px; image-rendering: pixelated; }
.hv-book-head h3 { margin: 0 0 4px; }
.hv-msgs { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; margin-bottom: 8px; padding: 6px; background: rgba(0,0,0,.22); }
.hv-msg { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.5; padding: 6px; background: rgba(255,154,216,.05); clip-path: var(--notch); }
.hv-book .row .input { flex: 1; }

/* ---------- 手机 ---------- */
@media (max-width: 760px), (pointer: coarse) {
  .g-split { grid-template-columns: 1fr; }
  .g-tasks, .g-perks { grid-template-columns: 1fr; }
  .g-war-map { grid-template-columns: repeat(2, 1fr); }
  .g-cards, .hm-homes { grid-template-columns: 1fr; }
  .hm-buffs { grid-template-columns: repeat(2, 1fr); }
  .g-hero, .hm-hero { padding: 10px; gap: 10px; }
  .g-hero-name, .hm-hero-t { font-size: 19px; }
  .g-boss-art { width: 110px; } .g-boss-art img { width: 104px; }
  .hm-cores { grid-template-columns: repeat(4, 1fr); }
  .g-mem-acts .btn { padding-left: 8px; padding-right: 8px; }
  .g-act { flex-wrap: wrap; } .g-act .grow { min-width: 55%; } .g-act > .btn { margin-left: auto; }
  .g-task { flex-wrap: wrap; } .g-task-r { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
  .hv-bar .hv-bar-t small { max-width: 30vw; }
  .hm-bbar { bottom: calc(var(--safe-b) + 6px); gap: 4px; padding: 6px 8px; }
  .hm-bbar-t { min-width: 0; flex: 1 1 100%; flex-direction: row; gap: 8px; align-items: baseline; }
  .gb-timer, .hm-dps { bottom: auto; top: calc(var(--safe-t) + 118px); }
}
@media (orientation: landscape) and (max-height: 500px) {
  .g-war-map { grid-template-columns: repeat(4, 1fr); }
  .g-terr { min-height: 92px; padding: 6px; }
  .hv-bar { top: calc(var(--safe-t) + 4px); padding: 4px 8px; }
  .g-chat-log { height: 140px; } .g-log { height: 176px; }
}
.hm-bulk { margin-top: 8px; gap: 6px; }
