/* ============================================================
 * 挂机世界 — style.css  （浅色羊皮卷主题）
 * ============================================================ */
:root {
  --bg: #f3eee2;
  --bg2: #ebe3d2;
  --panel: #fffdf7;
  --panel2: #faf5e9;
  --line: #ded1b5;
  --line2: #ece1c9;
  --ink: #352c1e;
  --ink2: #574936;
  --muted: #85775f;
  --accent: #a9702a;
  --accent-soft: #f6e8cd;
  --green: #3b7850;
  --green-soft: #e6f1e5;
  --red: #b0493e;
  --red-soft: #f8e6e2;
  --blue: #3a6a9c;
  --shadow: 0 2px 12px rgba(90, 68, 32, .09);
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(circle at 12% 8%, #fffaf0 0, transparent 45%),
                    radial-gradient(circle at 88% 92%, #f0e6d0 0, transparent 45%);
  color: var(--ink);
  font: 14px/1.6 "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  min-height: 100vh;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0 0 .6em; font-weight: 700; }
h2 { font-size: 19px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.hidden { display: none !important; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- 布局 ---------- */
#app { max-width: 1280px; margin: 0 auto; padding: 0 16px 70px; }
#topbar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 14px 4px 12px; border-bottom: 2px solid var(--line); margin-bottom: 12px;
}
.brand { font-size: 22px; font-weight: 800; letter-spacing: 2px; color: var(--accent); white-space: nowrap; }
.brand small { display: block; font-size: 9px; letter-spacing: 3px; color: var(--muted); font-weight: 600; }
#headerChar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); border: 1px solid var(--accent); color: var(--accent); font-weight: 800;
}
.lvl { background: var(--ink); color: #fff; padding: 1px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.power { color: var(--accent); font-weight: 700; }
#headerMoney { font-weight: 700; font-size: 15px; white-space: nowrap; }
.cu { font-size: 11px; font-weight: 600; margin-left: 1px; }
.cu-g { color: #b8861f; } .cu-s { color: #7c8791; } .cu-c { color: #a2673c; }
.ess { color: var(--blue); font-size: 12px; margin-left: 8px; }
#headerSave { color: var(--muted); font-size: 12px; white-space: nowrap; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 5px; }
.hactions { margin-left: auto; display: flex; gap: 8px; }

#tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab {
  padding: 7px 15px; border: 1px solid var(--line); background: var(--panel);
  border-radius: 20px; font-size: 13px; color: var(--ink2); transition: .15s;
}
.tab:hover { border-color: var(--accent); color: var(--accent); }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }

#content { min-height: 420px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 14px; align-items: start; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.panel.tight { padding: 12px; }
.panel h2, .panel h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel h2::after { content: ''; flex: 1; height: 1px; background: var(--line2); }
.notice { background: var(--accent-soft); border: 1px solid #e6cf9f; border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.notice.warn { background: #fbf0dc; border-color: #e3c58a; }
.notice.bad { background: var(--red-soft); border-color: #e6b8b1; }
.notice.good { background: var(--green-soft); border-color: #bcd8bd; }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--line); background: var(--panel2); color: var(--ink2);
  padding: 6px 13px; border-radius: 7px; font-size: 13px; transition: .15s; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn.primary:hover:not(:disabled) { background: #8f5c20; color: #fff; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.red { background: var(--red-soft); border-color: #e3b6b0; color: var(--red); }
.btn.blue { background: #e8f0f8; border-color: #b9d0e6; color: var(--blue); }
.btn.sm { padding: 3px 9px; font-size: 12px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 进度条 ---------- */
.bar { height: 15px; border-radius: 8px; background: var(--bg2); overflow: hidden; border: 1px solid var(--line2); position: relative; }
.bar > i { display: block; height: 100%; border-radius: 7px 0 0 7px; transition: width .3s; }
.bar.hp > i { background: linear-gradient(90deg, #c0534a, #d97a63); }
.bar.exp > i { background: linear-gradient(90deg, #4d8a5c, #86b36a); }
.bar > span { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 14px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.55); font-weight: 600; }
.barline { margin-bottom: 10px; }
.barline .lbl { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px; color: var(--ink2); }

/* ---------- 冒险 ---------- */
.clickzone {
  border: 2px dashed #d3b884; background: linear-gradient(135deg, #fffaf0, #f7edd6);
  border-radius: 14px; padding: 30px 18px; text-align: center; cursor: pointer;
  user-select: none; transition: .12s; margin-bottom: 14px;
}
.clickzone:hover { border-color: var(--accent); background: linear-gradient(135deg, #fff6e3, #f5e5c5); }
.clickzone:active { transform: scale(.995); }
.clickzone .big { font-size: 30px; font-weight: 800; color: var(--accent); letter-spacing: 4px; }
.clickzone .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
/* ---------- 挂机暂停 ---------- */
.pause-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; border-left: 4px solid var(--accent); }
.pause-banner b { color: var(--accent); }
.pause-banner .btn { margin-left: auto; }
.clickzone.paused { cursor: default; opacity: .62; border-style: solid; background: #f2eee6; }
.clickzone.paused:hover { border-color: #d3b884; background: #f2eee6; }
.clickzone.paused:active { transform: none; }
.clickzone.paused .big { color: var(--muted); letter-spacing: 6px; }
.mapcard {
  border: 1px solid var(--line); background: var(--panel2); border-radius: 9px; padding: 11px;
  cursor: pointer; transition: .15s;
}
.mapcard:hover { border-color: var(--accent); }
.mapcard.active { border: 2px solid var(--accent); background: var(--accent-soft); }
.mapcard.locked { opacity: .5; cursor: not-allowed; }
.mapcard .mn { font-weight: 700; font-size: 14px; }
.mapcard .mm { font-size: 11px; color: var(--muted); margin-top: 3px; }
#logList { max-height: 260px; overflow-y: auto; font-size: 12.5px; border: 1px solid var(--line2); border-radius: 8px; background: #fdfbf4; padding: 8px 10px; }
.logline { padding: 3px 0; border-bottom: 1px dashed var(--line2); color: var(--ink2); }
.logline:last-child { border-bottom: 0; }
.logline .ts { color: #a6987d; margin-right: 6px; font-variant-numeric: tabular-nums; }
.log-win { color: var(--green); } .log-drop { color: var(--blue); }
.log-bad { color: var(--red); } .log-level { color: var(--accent); font-weight: 700; }
.log-warn { color: var(--warn, #a97a1e); } .log-sys { color: var(--muted); }
.log-equip { color: var(--blue); } .log-shop { color: #7a5c9a; }

/* ---------- 表格 ---------- */
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th, table.t td { border: 1px solid var(--line2); padding: 6px 9px; text-align: left; }
table.t th { background: var(--panel2); font-weight: 700; color: var(--ink2); }
table.t td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr:nth-child(even) td { background: #fdfbf4; }

/* ---------- 物品 ---------- */
.item-card { border: 1px solid var(--line); border-left: 4px solid var(--rc, #999); border-radius: 9px; background: var(--panel); padding: 11px; display: flex; flex-direction: column; gap: 6px; }
.item-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.rarity-badge { color: #fff; background: var(--rc, #999); border-radius: 4px; padding: 1px 7px; font-size: 11px; font-weight: 700; }
.starter-badge { color: #6b5326; background: #f3e3bb; border: 1px solid #d9bd80; border-radius: 4px; padding: 0 6px; font-size: 10.5px; font-weight: 700; }
.item-name { font-weight: 700; color: var(--ink); }
.enh { color: var(--accent); font-weight: 800; font-size: 12px; }
.item-meta { font-size: 11.5px; color: var(--muted); }
.item-stats { font-size: 12px; color: var(--ink2); line-height: 1.5; min-height: 34px; }
.item-stats .st { display: inline-block; background: var(--panel2); border: 1px solid var(--line2); border-radius: 4px; padding: 0 5px; margin: 2px 3px 0 0; }
.item-foot { font-size: 11.5px; color: var(--muted); border-top: 1px dashed var(--line2); padding-top: 5px; }
.item-actions { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
/* 装备耐久条 */
.durline { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink2); white-space: nowrap; }
.durline > span:first-child { flex: 0 0 auto; }
.durline > span:last-child { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.durtrack { flex: 1 1 auto; height: 6px; min-width: 24px; border-radius: 4px; background: var(--bg2); border: 1px solid var(--line2); overflow: hidden; }
.durtrack > i { display: block; height: 100%; border-radius: 3px 0 0 3px; transition: width .3s; }
.slot-cell .durline { margin: 6px 0 2px; }
.slot-cell { border: 1px solid var(--line); border-radius: 9px; background: var(--panel2); padding: 10px; min-height: 92px; }
.slot-cell .sl { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.slot-cell .empty { color: #b3a68c; font-size: 12px; padding: 12px 0; text-align: center; }
.set-row { border: 1px solid var(--line); border-radius: 9px; padding: 11px; background: var(--panel); }
.set-row .tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 8px; }
.tier { border: 1px solid var(--line2); border-radius: 6px; padding: 5px; font-size: 11px; background: var(--panel2); color: var(--muted); }
.tier.on { background: var(--green-soft); border-color: #a9cfaa; color: var(--green); font-weight: 600; }
.filters { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.filters .btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- 天赋 ---------- */
.talent-card { border: 1px solid var(--line); border-radius: 9px; padding: 11px; background: var(--panel); }
.talent-card.locked { opacity: .55; }
.talent-card .tn { font-weight: 700; }
.talent-card .td { font-size: 12px; color: var(--muted); margin: 4px 0 8px; }
.rankpip { display: inline-block; width: 15px; height: 8px; border-radius: 2px; background: var(--bg2); border: 1px solid var(--line); margin-right: 3px; }
.rankpip.on { background: var(--accent); border-color: var(--accent); }

/* ---------- 副本 ---------- */
.dg-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--panel); }
.dg-card.locked { opacity: .58; }
.dg-card .dgn { font-size: 16px; font-weight: 800; color: var(--accent); }
.badge { display: inline-block; border: 1px solid var(--line); border-radius: 20px; padding: 1px 9px; font-size: 11px; background: var(--panel2); color: var(--ink2); }
.badge.ok { background: var(--green-soft); border-color: #b4d5b5; color: var(--green); }
.badge.no { background: var(--red-soft); border-color: #e6bcb6; color: var(--red); }

/* ---------- 存档 ---------- */
textarea.code {
  width: 100%; height: 92px; resize: vertical; border: 1px solid var(--line); border-radius: 8px;
  background: #fdfbf4; padding: 9px; font: 11px/1.5 Consolas, "Courier New", monospace;
  word-break: break-all; color: var(--ink2);
}
.danger-zone { border: 1px dashed #d9a9a2; background: #fff8f6; border-radius: 9px; padding: 12px; }

/* ---------- 底栏 / 弹层 ---------- */
#statusbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: rgba(255, 253, 247, .96); border-top: 1px solid var(--line);
  padding: 7px 18px; display: flex; gap: 14px; align-items: center; font-size: 12px; color: var(--ink2);
  box-shadow: 0 -2px 10px rgba(90,68,32,.06);
}
#ticker { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#statusRight { white-space: nowrap; color: var(--muted); }

.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(60, 48, 30, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.create-box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 60px rgba(40,30,15,.3); width: min(1180px, 100%); max-height: 94vh; overflow-y: auto; padding: 24px; }
.create-box h1 { color: var(--accent); font-size: 26px; letter-spacing: 3px; }
.choice { border: 2px solid var(--line); border-radius: 10px; padding: 11px; cursor: pointer; background: var(--panel2); transition: .15s; }
.choice:hover { border-color: #d3b884; }
.choice.on { border-color: var(--accent); background: var(--accent-soft); }
.choice .cn { font-weight: 800; }
.choice .cd { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-top: 4px; }
.choice .cicon { float: right; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--accent); }
/* 创角：8 种族 + 8 职业用 4 列紧凑卡片，保证一屏内可见且按钮不被挤出 */
#raceChoices, #classChoices { gap: 7px; }
#raceChoices .choice, #classChoices .choice { padding: 8px; }
#raceChoices .cn, #classChoices .cn { font-size: 13px; }
#raceChoices .cd, #classChoices .cd { font-size: 10.5px; line-height: 1.4; }
#raceChoices .cicon, #classChoices .cicon { width: 20px; height: 20px; font-size: 11px; }
.inp { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

.modal-layer { position: fixed; inset: 0; z-index: 80; background: rgba(60,48,30,.5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(40,30,15,.28); width: min(620px, 100%); max-height: 88vh; overflow-y: auto; padding: 20px; }
.modal-title { font-size: 18px; font-weight: 800; color: var(--accent); margin-bottom: 12px; }
.modal-body { font-size: 13.5px; max-height: 62vh; overflow-y: auto; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

.toast-layer { position: fixed; top: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 9px 14px; box-shadow: var(--shadow); font-size: 13px; animation: toastIn .2s ease; max-width: 340px; }
.toast.good { border-left-color: var(--green); } .toast.bad { border-left-color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
#floatLayer { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.floatnum { position: fixed; font-weight: 800; font-size: 16px; color: var(--green); text-shadow: 0 1px 3px #fff, 0 0 8px #fff; animation: floatUp .9s ease-out forwards; }
.floatnum.crit { color: var(--accent); font-size: 20px; }
@keyframes floatUp { 0% { opacity: 1; transform: translateY(0) scale(.9); } 100% { opacity: 0; transform: translateY(-52px) scale(1.15); } }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .cols { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hactions { margin-left: 0; }
}
@media (max-width: 620px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .brand { font-size: 18px; }
  #topbar { gap: 10px; }
  .set-row .tiers { grid-template-columns: repeat(2, 1fr); }
  .mate-hero { flex-wrap: wrap; }
  .mate-toggle { width: 100%; }
}

/* ---------- 外出拾荒小伙伴 ---------- */
.mate-strip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 10px; padding: 8px 10px; border: 1px dashed var(--line);
  border-radius: 8px; background: var(--panel2);
}
.mate-strip.on { border-style: solid; border-color: var(--green); background: var(--green-soft); }
.mate-ico { font-size: 20px; line-height: 1; }
.mate-hero { display: flex; align-items: flex-start; gap: 14px; }
.mate-hero.on { border-color: var(--green); }
.mate-hero .grow { min-width: 0; }
.mate-portrait { margin-top: 2px; }
.mate-rules th:first-child, .mate-rules td:first-child { width: 96px; min-width: 96px; white-space: nowrap; }
.mate-gains th:first-child, .mate-gains td:first-child { width: 128px; min-width: 128px; }

/* ---------- 数值规则：地图品质窗口 / 稀有度解锁 / 种族派生修正 ---------- */
table.t.map-table th:first-child, table.t.map-table td:first-child { width: 104px; min-width: 104px; white-space: nowrap; }
table.t.map-table td:last-child, table.t.rar-table td:last-child { text-align: left; white-space: nowrap; }
table.t.rar-table th:first-child, table.t.rar-table td:first-child { width: 72px; min-width: 72px; white-space: nowrap; }
table.t.race-table th:first-child, table.t.race-table td:first-child { width: 92px; min-width: 92px; white-space: nowrap; }
table.t.race-table td.num { text-align: left; }
.mate-portrait {
  width: 62px; height: 62px; flex: 0 0 62px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: var(--accent-soft); border: 2px solid var(--line);
}
.mate-hero.on .mate-portrait { border-color: var(--green); background: var(--green-soft); }
.mate-toggle { white-space: nowrap; flex: 0 0 auto; }
.mate-mode {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); cursor: pointer;
}
.mate-mode:hover { border-color: var(--accent); }
.mate-mode.active { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.mm-ico {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 800;
}
.mate-mode.active .mm-ico { background: var(--green); color: #fff; }
.log-mate { color: var(--green); }
