/* 疯狂水世界 · Web GM 控制台（白色 / 蓝色宝塔风格） */

:root {
  --bg: #f0f2f7;
  --bg-soft: #f5f6fa;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --line: #e8eaef;
  --line-strong: #d6dae3;
  --text: #262a33;
  --muted: #7a8599;
  --accent: #2658f5;
  --accent-dark: #1d47d8;
  --accent-soft: #eef3ff;
  --accent-2: #2f7bff;
  --violet: #7c5cff;
  --danger: #e04848;
  --warn: #f08c1a;
  --ok: #18a058;
  --shadow: 0 2px 12px rgba(31, 45, 61, 0.07);
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: "Cascadia Mono", Consolas, "Courier New", monospace; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt8 { margin-top: 8px; }
.mt14 { margin-top: 14px; }
.mt18 { margin-top: 18px; }
.mb0 { margin-bottom: 0 !important; }

/* ---------- 登录 ---------- */
.login-wrap {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(38, 88, 245, 0.07), transparent 60%),
    radial-gradient(800px 500px at 90% 110%, rgba(47, 123, 255, 0.06), transparent 55%),
    var(--bg);
}
.login-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5; animation: float 12s ease-in-out infinite; }
.orb-a { width: 420px; height: 420px; background: rgba(38, 88, 245, 0.10); top: 8%; left: 12%; }
.orb-b { width: 480px; height: 480px; background: rgba(47, 123, 255, 0.08); bottom: 4%; right: 10%; animation-delay: -6s; }
@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(20px, -24px, 0) scale(1.06); }
}

.login-card {
  position: relative;
  width: 400px;
  max-width: calc(100vw - 40px);
  padding: 38px 36px 30px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(31, 45, 61, 0.10);
}
.brand-mark {
  width: 54px; height: 54px; border-radius: 14px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px rgba(38, 88, 245, 0.25);
}
.brand-mark svg { width: 30px; height: 30px; fill: currentColor; }
.brand-mark.small { width: 40px; height: 40px; border-radius: 10px; box-shadow: none; }
.brand-mark.small svg { width: 22px; height: 22px; }

.login-card h1 { margin: 20px 0 4px; font-size: 25px; letter-spacing: 1px; }
.login-sub { margin: 0 0 26px; color: var(--muted); font-size: 13px; letter-spacing: 2px; }
.login-options { display: flex; align-items: center; gap: 16px; margin: 2px 0 18px; }
.chk { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; cursor: pointer; }
.chk input { accent-color: var(--accent); width: 14px; height: 14px; }
.login-foot { margin-top: 20px; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.7; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > span { font-size: 12px; color: var(--muted); letter-spacing: 0.5px; }
.field.compact { margin-bottom: 10px; }
.field-inline { display: flex; align-items: center; gap: 10px; }
.field-inline > span { font-size: 12px; color: var(--muted); min-width: 64px; }

.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.input:hover, .select:hover, .textarea:hover { border-color: #b9c1d1; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(38, 88, 245, 0.12);
}
.input::placeholder, .textarea::placeholder { color: #a8b1c2; }
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; min-width: 0; }
.form-error { min-height: 18px; margin-top: 10px; color: var(--danger); font-size: 12px; }
.form-tip { color: var(--muted); font-size: 12px; line-height: 1.7; }

.alert {
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.7;
  background: #fff7ec;
  border: 1px solid rgba(240, 140, 26, 0.35);
  color: #9a5a08;
}
.alert.blue { background: var(--accent-soft); border-color: rgba(38, 88, 245, 0.25); color: #1d47d8; }

.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #374151;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:hover { color: var(--accent); border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { border: none; background: var(--accent); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(38, 88, 245, 0.25); }
.btn.primary:hover { background: var(--accent-dark); color: #fff; }
.btn.ghost { background: transparent; }
.btn.tiny { padding: 4px 10px; font-size: 12px; border-radius: 5px; }
.btn.danger { color: var(--danger); border-color: rgba(224, 72, 72, 0.45); background: #fff; }
.btn.danger:hover { background: #fdeeee; border-color: var(--danger); color: var(--danger); }
.btn.block { width: 100%; padding: 10px 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.link-btn { border: none; background: none; color: var(--accent); font-size: 12px; cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 主布局 ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; align-self: flex-start;
  width: 220px; height: 100vh;
  display: flex; flex-direction: column;
  padding: 18px 12px 20px;
  border-right: 1px solid var(--line);
  background: #fff;
  overflow-y: auto;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 14px; }
.side-title { font-size: 15px; font-weight: 700; letter-spacing: 0.5px; }
.side-desc { font-size: 10px; color: var(--muted); letter-spacing: 2.4px; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-group-label {
  margin: 10px 10px 2px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 12px; border-radius: 6px; border: none;
  background: transparent; color: #4b5563;
  font-size: 13.5px; font-family: inherit; text-align: left; cursor: pointer;
  transition: background 0.16s, color 0.16s;
}
.nav-item svg { width: 17px; height: 17px; fill: currentColor; opacity: 0.9; }
.nav-item:hover { background: var(--bg-soft); color: var(--text); }
.nav-item.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }

.side-foot { display: flex; flex-direction: column; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--line); }
.side-user { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; color: var(--muted);
  border: 1px solid var(--line); background: var(--bg-soft);
  width: fit-content;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill.online { color: var(--ok); border-color: rgba(24, 160, 88, 0.35); background: #eefaf3; }
.pill.online::before { background: var(--ok); }
.pill.offline { color: var(--danger); border-color: rgba(224, 72, 72, 0.3); background: #fdefef; }
.pill.offline::before { background: var(--danger); }
.pill.warn { color: var(--warn); border-color: rgba(240, 140, 26, 0.35); background: #fff7ec; }
.pill.warn::before { background: var(--warn); }

.main { flex: 1; min-width: 0; padding: 22px 26px 40px; }

.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.topbar h2 { margin: 0; font-size: 21px; letter-spacing: 0.4px; }
.topbar p { margin: 4px 0 0; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.search-input { width: 220px; }
.player-context {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.code-box {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #0f172a;
  color: #d7e3ff;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.table input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }

.page { animation: fadeUp 0.28s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { margin: 0; font-size: 15px; letter-spacing: 0.3px; padding-left: 10px; position: relative; }
.card-head h3::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 14px; border-radius: 2px; background: var(--accent);
}
.card-head .head-actions { display: flex; align-items: center; gap: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card {
  position: relative; overflow: hidden;
  padding: 18px 18px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}
.stat-card::after {
  content: ""; position: absolute; inset: auto -30% -60% auto;
  width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(38, 88, 245, 0.07), transparent 70%);
}
.stat-card.accent { border-color: rgba(38, 88, 245, 0.35); }
.stat-label { color: var(--muted); font-size: 12px; letter-spacing: 0.5px; }
.stat-value { margin-top: 8px; font-size: 28px; font-weight: 700; letter-spacing: 0.5px; }
.stat-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.stat-foot { margin-top: 6px; font-size: 12px; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  text-align: left; padding: 10px 12px; background: var(--panel-2);
  color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: 0.4px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafbfe; }
.table .empty { padding: 36px 12px; text-align: center; color: var(--muted); }
.config-table th, .config-table td {
  white-space: nowrap;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.config-table td .mono { white-space: nowrap; }

.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; line-height: 1.6;
  background: var(--bg-soft); color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.blue { background: var(--accent-soft); color: var(--accent); border-color: rgba(38, 88, 245, 0.25); }
.badge.green { background: #eefaf3; color: var(--ok); border-color: rgba(24, 160, 88, 0.25); }
.badge.red { background: #fdefef; color: var(--danger); border-color: rgba(224, 72, 72, 0.25); }
.badge.orange { background: #fff7ec; color: var(--warn); border-color: rgba(240, 140, 26, 0.28); }
.badge.purple { background: #f5f1ff; color: #7c5cff; border-color: rgba(124, 92, 255, 0.25); }

/* ---------- 装备自定义属性 ---------- */
.equip-attr-pool { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.equip-attr-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff;
  font-size: 12.5px; cursor: pointer; user-select: none;
}
.equip-attr-chip:hover { border-color: var(--accent); }
.equip-attr-chip.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.equip-attr-chip input { margin: 0; }
.equip-attr-chip em { font-style: normal; color: var(--muted); font-size: 11px; }
.equip-attr-chip.selected em { color: var(--accent); }
.equip-attr-rows { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.equip-attr-row {
  display: grid; grid-template-columns: minmax(0, 1.4fr) 140px 18px 90px 28px;
  align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2);
}
.equip-attr-row-name { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.equip-attr-suffix { color: var(--muted); font-size: 12px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.pager-info { color: var(--muted); font-size: 12px; }
.pager-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- 服务状态 ---------- */
.svc-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.svc-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel-2);
}
.svc-name { font-size: 13px; }
.svc-meta { color: var(--muted); font-size: 11px; margin-top: 2px; }

/* ---------- 日志 ---------- */
.log-list { display: flex; flex-direction: column; }
.log-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  padding: 10px 2px;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.log-item:last-child { border-bottom: none; }
.log-time { color: var(--muted); font-size: 11.5px; font-family: "Cascadia Mono", Consolas, monospace; }
.log-action { color: var(--accent); font-weight: 600; font-size: 12.5px; text-align: right; white-space: nowrap; }
.log-detail { grid-column: 1 / -1; min-width: 0; word-break: break-word; }
.log-result { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 6px; font-size: 12px; }
.log-result.ok { color: var(--ok); }
.log-result.bad { color: var(--danger); }
.log-result .small { color: var(--muted); }

/* ---------- 配置表 ---------- */
.config-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.config-side { max-height: calc(100vh - 180px); overflow: auto; }
.config-list { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.config-groups { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.config-groups .btn { padding: 3px 8px; font-size: 11.5px; }
.config-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border-radius: 6px; border: none; background: transparent;
  color: #4b5563; font-size: 12.5px; font-family: inherit; text-align: left; cursor: pointer;
}
.config-item:hover { background: var(--bg-soft); }
.config-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.config-item .cfg-size { color: var(--muted); font-size: 11px; }

.preview-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }

/* ---------- 模态 / 抽屉 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(24, 32, 48, 0.42);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 560px; max-width: 100%; max-height: calc(100vh - 60px);
  display: flex; flex-direction: column;
  background: #fff; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(20, 28, 44, 0.24);
  animation: popIn 0.2s ease;
}
.modal.wide { width: 900px; }
.modal.player-modal { width: 1040px; }
@keyframes popIn { from { transform: translateY(10px) scale(0.985); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }

/* ---------- 英雄详情（分栏 + 页签） ---------- */
.modal.hero-modal { width: 1120px; max-width: calc(100vw - 48px); height: calc(100vh - 48px); }
.modal.hero-modal .modal-body { flex: 1; min-height: 0; padding: 0; overflow: hidden; }
.hero-detail { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: 100%; min-height: 0; }
.hero-side { padding: 16px; overflow: auto; background: var(--panel-2); border-right: 1px solid var(--line); }
.hero-side-poster { width: 100%; height: 300px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: zoom-in; }
.hero-side-poster-fallback { height: 300px; display: grid; place-items: center; color: var(--muted); font-size: 12px; background: #fff; border: 1px dashed var(--line); border-radius: 10px; }
.hero-side-name { margin-top: 12px; font-size: 18px; font-weight: 700; }
.hero-side-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.hero-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.hero-stat { padding: 8px 10px; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.hero-stat .k { color: var(--muted); font-size: 11px; }
.hero-stat .v { font-size: 14px; font-weight: 700; margin-top: 2px; }
.hero-side-desc { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.7; max-height: 140px; overflow: auto; }
.hero-main { display: flex; flex-direction: column; min-height: 0; }
.hero-main-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.hero-tabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.hero-tab { border: none; background: none; padding: 11px 14px; font-size: 13px; font-family: inherit; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.hero-tab:hover { color: var(--text); }
.hero-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.hero-tab-body { flex: 1; overflow: auto; padding: 16px 18px 22px; }
.hero-tab-panel.hidden { display: none; }
.hero-section-title { font-size: 12px; font-weight: 700; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; }
.hero-section-title:first-child { margin-top: 0; }
.hero-save-bar { display: flex; align-items: center; gap: 10px; width: 100%; }

/* ---------- 通用双栏检查器（玩家 / 徽章 / 海兽等） ---------- */
.inspector { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.inspector-side { padding: 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.inspector-avatar {
  width: 100%; height: 150px; border-radius: 10px; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-soft), #fff);
  color: var(--accent); font-size: 40px; font-weight: 700;
}
.inspector-avatar img { width: 100%; height: 100%; object-fit: contain; }
.inspector-name { margin-top: 12px; font-size: 16px; font-weight: 700; word-break: break-all; }
.inspector-sub { color: var(--muted); font-size: 11.5px; margin-top: 4px; word-break: break-all; }
.metric-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.metric { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 8px; background: #fff; border: 1px solid var(--line); font-size: 12px; }
.metric .k { color: var(--muted); flex: none; }
.metric .v { font-weight: 700; text-align: right; word-break: break-all; }
.inspector-main { min-width: 0; }
.thumb[data-image-src] { cursor: zoom-in; }
.level-bar { height: 6px; border-radius: 999px; background: rgba(90, 170, 255, .14); overflow: hidden; margin-top: 6px; }
.level-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #5aaaff, #7a6cff); }
.building-level-cell { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }

.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 220px; max-width: 380px;
  padding: 11px 14px; border-radius: 8px;
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(20, 28, 44, 0.14);
  font-size: 13px; display: flex; gap: 10px; align-items: flex-start;
  animation: toastIn 0.22s ease;
}
@keyframes toastIn { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--accent); }
.toast.ok .dot { background: var(--ok); }
.toast.err .dot { background: var(--danger); }

/* ---------- 玩家 ---------- */
.player-cell { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.player-avatar { position: relative; width: 36px; height: 36px; flex: none; }
.player-avatar .head {
  width: 100%; height: 100%; border-radius: 10px;
  object-fit: cover; background: #fff; border: 1px solid var(--line);
  cursor: zoom-in;
}
.player-avatar .frame {
  position: absolute; inset: -5px; width: calc(100% + 10px); height: calc(100% + 10px);
  object-fit: contain; pointer-events: none;
}
.player-avatar.lg { width: 56px; height: 56px; }
.player-avatar.lg .head { border-radius: 14px; }
.hero-head-avatar {
  width: 42px; height: 42px; flex: none; border-radius: 10px;
  object-fit: cover; background: #fff; border: 1px solid var(--line);
  cursor: zoom-in;
}
.hero-head-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 10px; }
.hero-head-item { text-align: center; font-size: 11px; color: var(--muted); }
.hero-head-item img {
  width: 56px; height: 56px; display: block; margin: 0 auto 4px;
  object-fit: contain; border-radius: 10px; background: #fff; border: 1px solid var(--line);
  cursor: zoom-in;
}
.hero-head-item .thumb-fallback { width: 56px; height: 56px; margin: 0 auto 4px; }
.hero-inline { display: inline-flex; align-items: center; gap: 6px; }
.hero-inline img {
  width: 26px; height: 26px; flex: none; border-radius: 7px;
  object-fit: cover; background: #fff; border: 1px solid var(--line);
  cursor: zoom-in;
}
.bot-hero-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px; max-height: 320px; overflow: auto; padding: 6px;
  border: 1px solid var(--line); border-radius: 8px; margin-top: 8px;
}
.bot-hero-item { padding: 6px 8px; border-radius: 8px; background: var(--panel-2); }
.player-name { font-weight: 600; }
.player-sub { color: var(--muted); font-size: 11.5px; }

.detail-head { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.detail-head .avatar { width: 48px; height: 48px; border-radius: 12px; font-size: 16px; }

.kv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; }
.kv-item { padding: 9px 12px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); }
.kv-label { color: var(--muted); font-size: 11.5px; }
.kv-value { margin-top: 2px; font-size: 13.5px; font-weight: 600; word-break: break-all; }

.res-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.res-item { padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; text-align: center; }
.res-item .res-name { color: var(--muted); font-size: 11.5px; }
.res-item .res-val { font-size: 16px; font-weight: 700; margin-top: 3px; }

.item-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow: auto; }
.item-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 6px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 12px;
}
.item-chip b { font-weight: 700; }
.item-chip .q-ORANGE { color: #e8842c; }
.item-chip .q-PURPLE { color: #8a4fd0; }
.item-chip .q-BLUE { color: #1878d8; }
.item-chip .q-GREEN { color: #18a058; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tab {
  border: none; background: none; padding: 9px 14px; font-size: 13px; font-family: inherit;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ---------- 选择器 ---------- */
.picker-list { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; }
.picker-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px;
}
.picker-row:last-child { border-bottom: none; }
.picker-row:hover { background: var(--bg-soft); }
.picker-row.selected { background: var(--accent-soft); }
.picker-id { color: var(--muted); font-size: 11.5px; font-family: "Cascadia Mono", Consolas, monospace; }

.attach-list { display: flex; flex-direction: column; gap: 8px; }
.attach-row { display: flex; align-items: center; gap: 8px; }
.attach-row .input { flex: 1; min-width: 0; }
.attach-row .attach-count { flex: 0 0 110px; width: 110px; }
.attach-row .icon-btn { flex: none; }
.attach-thumb {
  width: 38px; height: 38px; flex: none; border-radius: 8px; overflow: hidden;
  display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--muted); font-size: 11px;
}
.attach-thumb img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.picker-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.picker-main .thumb, .picker-main .thumb-fallback { width: 34px; height: 34px; flex: none; }
.item-preview { display: flex; align-items: center; gap: 8px; margin-top: 6px; min-height: 38px; font-size: 12px; color: var(--muted); }
.item-preview img { width: 34px; height: 34px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

.empty-state { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--text); font-size: 14px; margin-bottom: 6px; }

.preset-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.preset-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}
.preset-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-meta { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 4px; }

.inv-edit-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; margin-top: 10px; }
.inv-edit-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 110px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}
.inv-edit-row .input { padding: 6px 9px; }
.inv-edit-row .thumb, .inv-edit-row .thumb-fallback { width: 36px; height: 36px; }

/* ---------- 资源缩略图 ---------- */
.thumb {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  background: rgba(8, 18, 28, .55);
  border: 1px solid var(--line);
  object-fit: contain;
  display: block;
}
.thumb.sm { width: 30px; height: 30px; border-radius: 7px; }
.thumb-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.thumb-fallback {
  width: 44px; height: 44px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 18, 28, .55); border: 1px solid var(--line); color: var(--muted); font-size: 11px;
}
.thumb-fallback.sm { width: 30px; height: 30px; border-radius: 7px; }

/* ---------- 活动与系统配置 ---------- */
.ops-tabs { margin-bottom: 4px; }
.ops-sub { display: flex; flex-direction: column; gap: 10px; }
.ops-time { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.ops-rewards { display: flex; flex-wrap: wrap; gap: 4px; max-width: 260px; }
.ops-reward-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 2px 6px; border-radius: 999px;
  background: rgba(90, 170, 255, .12); border: 1px solid rgba(90, 170, 255, .25); color: #b9d8ff;
}
.ops-reward-chip .thumb, .ops-reward-chip .thumb-fallback { width: 20px; height: 20px; border-radius: 5px; font-size: 9px; }
.reward-cell { display: inline-flex; align-items: center; gap: 6px; }
.reward-cell .thumb, .reward-cell .thumb-fallback { width: 28px; height: 28px; border-radius: 7px; }
.status-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.status-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status-dot.online::before { background: #42d392; box-shadow: 0 0 8px rgba(66, 211, 146, .6); }
.status-dot.offline::before { background: #8b98a8; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-section-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--muted); margin: 14px 0 8px; text-transform: uppercase; }
.pager-jump { display: flex; align-items: center; gap: 6px; }
.pager-jump .input { width: 64px; padding: 5px 8px; text-align: center; }
.pager-size { padding: 5px 8px; }
.inv-pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.inv-pager .pager-info { margin: 0; }

/* ---------- 视图切换 / 方格视图 ---------- */
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-2);
}
.view-toggle button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}
.view-toggle button.active { background: rgba(90, 170, 255, .18); color: #cfe6ff; }

.table.grid-view { display: block; border: 0; min-width: 0; }
.table.grid-view thead { display: none; }
.table.grid-view tbody {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 0;
}
.table.grid-view tr {
  display: flex;
  flex-direction: column;
  width: calc(33.333% - 10px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  padding: 10px 12px;
  gap: 4px;
}
.table.grid-view td {
  display: block;
  border: 0;
  padding: 2px 0;
  white-space: normal;
  word-break: break-word;
}
.table.grid-view td:first-child { font-weight: 600; }
.table.grid-view td.right { text-align: left; }
.table.grid-view td.empty { width: 100%; }

/* ---------- 英雄方格 ---------- */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.hero-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(20, 38, 56, .9), rgba(12, 22, 34, .95));
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}
.hero-card:hover { transform: translateY(-2px); border-color: rgba(90, 170, 255, .5); }
.hero-poster {
  width: 100%;
  height: 190px;
  object-fit: contain;
  background: radial-gradient(circle at 50% 30%, rgba(90, 170, 255, .18), transparent 70%);
  display: block;
}
.hero-poster-fallback {
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: rgba(8, 18, 28, .55);
  font-size: 12px;
}
.hero-card-body { padding: 10px 12px 12px; }
.hero-card-name { font-weight: 700; font-size: 14px; }
.hero-card-meta { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.hero-card-skills { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.hero-card-skills img { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line); }
.hero-card-actions { display: flex; gap: 6px; margin-top: 10px; }

/* ---------- 筛选面板 / 配置说明 / 图片选择 ---------- */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 0 4px;
  border-top: 1px solid var(--line);
  margin-top: 10px;
}
.filter-grid .field { margin: 0; }
.filter-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
.field-desc-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
  max-height: 260px;
  overflow: auto;
  font-size: 12px;
}
.field-desc-item { display: flex; gap: 8px; padding: 4px 6px; border-bottom: 1px dashed rgba(255,255,255,.06); }
.field-desc-key { color: #9fc8ff; font-family: monospace; min-width: 110px; }
.field-desc-text { color: var(--muted); }
.image-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}
.image-pick-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  background: var(--panel-2);
  cursor: pointer;
  text-align: center;
}
.image-pick-item.selected { border-color: #5aaaff; box-shadow: 0 0 0 1px #5aaaff inset; }
.image-pick-item img { width: 100%; height: 80px; object-fit: contain; display: block; }
.image-pick-item span { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-preview { display: flex; align-items: center; justify-content: center; min-height: 320px; background: rgba(8,18,28,.5); border-radius: 12px; }
.image-preview img { max-width: 100%; max-height: 70vh; object-fit: contain; }

@media (max-width: 1100px) {
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table.grid-view tr { width: calc(50% - 10px); }
}
@media (max-width: 720px) {
  .filter-grid, .field-desc-list { grid-template-columns: minmax(0, 1fr); }
  .table.grid-view tr { width: 100%; }
}

@media (max-width: 960px) {
  .form-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1280px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .svc-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .grid-2, .config-layout { grid-template-columns: minmax(0, 1fr); }
  .config-side { max-height: 320px; }
}
@media (max-width: 820px) {
  .sidebar { width: 72px; padding: 14px 8px; }
  .side-brand > div:last-child, .nav-item span, .side-user span { display: none; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .main { padding: 16px 14px 30px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .res-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { flex-direction: column; align-items: flex-start; }
}
