/* =========================================================
 * MSNF Remake - style.css
 * 末世复古终端风 UI
 * ========================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #14161c; --panel: #1e222b; --panel2: #262b36; --line: #3a4150;
  --text: #d8dce4; --dim: #8a92a2; --gold: #ffd84a; --red: #e85a5a;
  --accent: #5ac8ff; --ok: #6ad88a;
}
body { background: var(--bg); color: var(--text); font-family: "Microsoft YaHei", "PingFang SC", sans-serif; font-size: 14px; }
button { font-family: inherit; background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 13px; }
button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: 0.4; cursor: default; }
button.primary { background: #2a5a3a; border-color: #3a7a4a; }
button.ghost { background: transparent; }
button.mini { padding: 2px 8px; font-size: 12px; }
button.big { display: block; width: 260px; margin: 10px auto; padding: 12px; font-size: 16px; }
button.on { border-color: var(--gold); color: var(--gold); }
button.locked { opacity: 0.35; }
input, select, textarea { background: #12141a; color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; font-family: inherit; font-size: 13px; }
textarea { width: 100%; }
h3 { font-size: 14px; margin-bottom: 8px; color: var(--gold); }
.dim { color: var(--dim); font-size: 12px; }

#screen { max-width: 1180px; margin: 0 auto; padding: 8px; }

/* 顶栏 */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.brand { font-weight: bold; color: var(--gold); cursor: pointer; letter-spacing: 2px; }
.status { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.status .gold { color: var(--gold); }
.speed button { padding: 2px 7px; margin-left: 2px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line); position: relative; }
.nav button { padding: 5px 10px; }
.nav .badge { background: var(--red); color: #fff; border-radius: 8px; font-size: 11px; padding: 0 5px; margin-left: 4px; font-style: normal; }
.screen-body { padding: 12px 0; }

/* 布局 */
.cols { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.col { flex: 1; min-width: 320px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }
.btn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px dashed #2a2f3a; flex-wrap: wrap; }
.row .sl { width: 56px; color: var(--dim); font-size: 12px; }
table.kv { width: 100%; border-collapse: collapse; }
table.kv td { padding: 3px 6px; border-bottom: 1px dashed #2a2f3a; }
table.kv td:first-child { color: var(--dim); width: 90px; }

/* 成员/小条 */
.member-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 3px 10px; font-size: 12px; display: inline-flex; align-items: center; gap: 5px; cursor: default; }
.chip a { cursor: pointer; color: var(--red); text-decoration: none; padding: 0 2px; }
.chip.ghost2 { border-style: dashed; color: var(--dim); cursor: pointer; }
.chip.tank { border-color: #6a5a2a; }
.chip.dead { opacity: 0.45; text-decoration: line-through; }
.dead-tag { color: var(--red); font-size: 12px; }
.stat-grid { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text); margin: 6px 0; }
.member-card .mc-head { display: flex; gap: 10px; align-items: center; }
canvas.mug { background: var(--panel2); border-radius: 6px; }
.expbar, .bar { height: 8px; background: #12141a; border-radius: 4px; overflow: hidden; margin: 4px 0; width: 100%; }
.expbar i, .bar i { display: block; height: 100%; background: linear-gradient(90deg, #5ac8ff, #6ad88a); }

/* 地图 */
.map-wrap { display: flex; gap: 12px; flex-wrap: wrap; }
.map-left { flex: 0 0 auto; }
.map-right { flex: 1; min-width: 260px; }
#region-tabs, .region-tabs { display: flex; gap: 4px; margin-bottom: 6px; flex-wrap: wrap; }
#mapCanvas { border: 2px solid var(--line); image-rendering: pixelated; cursor: crosshair; display: block; }
#mapInfo { padding: 6px 2px; min-height: 20px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
.sq-line { padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; margin-bottom: 6px; cursor: pointer; }
.sq-line.on { border-color: var(--gold); }
.sq-line b { display: block; }

/* 战报 */
.rep-list { max-height: 560px; overflow-y: auto; }
.rep-line { padding: 5px 6px; border-bottom: 1px dashed #2a2f3a; cursor: pointer; font-size: 13px; }
.rep-line:hover { background: var(--panel2); }
.rep-line.unread { color: var(--gold); }
.rep-line.on { border-left: 3px solid var(--gold); background: var(--panel2); }
.report-detail .log { background: #12141a; padding: 10px; border-radius: 4px; font-size: 12px; line-height: 1.7; white-space: pre-wrap; font-family: Consolas, monospace; max-height: 320px; overflow-y: auto; }
.snap-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.snap-box canvas { width: 240px; height: 180px; border: 1px solid var(--line); border-radius: 4px; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }

/* 任务/配方/赏金 */
.quest.done { opacity: 0.65; }
.quest.done span:first-child { color: var(--ok); }
.bounty-card h3 { color: var(--text); }
.recipe { font-size: 13px; }
.recipe > span:nth-child(2) { flex: 1; min-width: 200px; }
.tabs { display: flex; gap: 6px; margin-bottom: 8px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: var(--panel); border: 2px solid var(--gold); border-radius: 8px; padding: 16px 20px; max-width: 520px; width: 92%; max-height: 84vh; overflow-y: auto; }
.modal.wide { max-width: 640px; }
.modal h3 { margin-bottom: 10px; }
.modal .btn-grid { margin: 10px 0; }
.hire-row { display: flex; gap: 6px; margin: 6px 0; align-items: center; }

/* 吐司 */
#toasts { position: fixed; top: 12px; right: 12px; z-index: 99; display: flex; flex-direction: column; gap: 6px; }
.toast { background: rgba(20,22,28,0.95); border: 1px solid var(--gold); color: var(--text); padding: 8px 14px; border-radius: 6px; font-size: 13px; max-width: 380px; animation: slidein 0.2s; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }

/* 标题画面 */
.title-screen { text-align: center; padding: 60px 0; }
.title-logo { font-size: 44px; font-weight: bold; color: var(--gold); letter-spacing: 6px; text-shadow: 0 0 24px rgba(255,216,74,0.35); }
.title-logo span { font-size: 26px; color: var(--text); }
.title-sub { color: var(--dim); margin: 10px 0 34px; letter-spacing: 3px; }
.title-menu button.big { background: var(--panel); border: 1px solid var(--line); }
.title-menu button.primary { border-color: var(--gold); color: var(--gold); }
.title-note { margin-top: 30px; color: var(--dim); font-size: 12px; line-height: 1.8; }

/* ============ ONLINE 版新增 ============ */
.login-box { max-width: 360px; margin: 0 auto; text-align: left; }
.chat-box { height: 320px; overflow-y: auto; background: #12141a; border-radius: 6px; padding: 8px; margin-bottom: 8px; }
.chat-line { padding: 3px 0; border-bottom: 1px dashed #2a2f3a; font-size: 13px; }
.chat-line.sys { color: var(--gold); }
.chat-line b { color: var(--accent); margin-right: 4px; }
.badge { font-style: normal; }
.map-scroll { overflow: auto; max-width: 100%; border: 2px solid var(--line); background: #10131a; }
.map-scroll canvas { image-rendering: pixelated; display: block; }

/* 招募候选人卡片 */
.hire-card { display: flex; gap: 10px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; margin: 6px 0; }
.hire-card canvas { background: #12141a; border-radius: 4px; }

/* 成员技能可点击 */
.chip.clickable { cursor: pointer; }
.chip.clickable:hover { border-color: var(--accent); color: var(--accent); }

/* 抽奖走马灯 */
.lottery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.lottery-cell { border: 1px solid var(--line); border-radius: 6px; padding: 8px 4px; text-align: center; font-size: 12px; background: var(--panel2); min-height: 40px; display: flex; align-items: center; justify-content: center; }
.lottery-cell.hot { border-color: var(--gold); color: var(--gold); background: #2a2416; box-shadow: 0 0 14px rgba(255,216,74,0.45); }
.lot-result { text-align: center; font-size: 16px; min-height: 24px; margin: 8px 0; }
.lot-result.gold { color: var(--gold); }
.chip-x { cursor: pointer; color: var(--red); font-size: 11px; padding: 2px 4px; border: 1px dashed var(--line); border-radius: 8px; }
.chip-x:hover { border-color: var(--red); }
.item-link { cursor: pointer; color: var(--accent); }
.item-link:hover { text-decoration: underline; }
.login-error { color: var(--red); font-weight: bold; font-size: 13px; }
.shake { animation: shake 0.4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-8px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(5px)} }
.schedule-halted { background: rgba(232,90,90,0.08); }
.stat-tip { cursor: help; border-bottom: 1px dotted var(--dim); }

/* 即时悬浮说明卡片 */
.tip-wrap { position: relative; display: inline-block; cursor: help; border-bottom: 1px dotted var(--dim); }
.tip-wrap .tip-box { visibility: hidden; opacity: 0; transition: opacity .12s;
  position: absolute; top: 135%; left: 0; transform: none;
  background: #0d0f14; color: var(--text); border: 1px solid var(--gold); border-radius: 6px;
  padding: 10px 12px; width: 340px; font-size: 12px; line-height: 1.7; z-index: 200;
  box-shadow: 0 4px 18px rgba(0,0,0,0.55); pointer-events: none; white-space: normal; text-align: left; }
.tip-wrap:hover .tip-box { visibility: visible; opacity: 1; }
.tip-wrap .tip-box::before { content: ""; position: absolute; bottom: 100%; left: 24px;
  border: 6px solid transparent; border-bottom-color: var(--gold); }
.tip-wrap:hover { color: var(--gold); }
