﻿/* ============================================================
 * style.css —— 魂缚角色卡网站样式（暗色奇幻主题）
 * ============================================================ */

:root {
  --bg: #12141c;
  --bg2: #171a26;
  --panel: #1e2230;
  --panel2: #262b3d;
  --line: #343b52;
  --line2: #464f6e;
  --text: #e8e4d8;
  --text-dim: #9aa2bd;
  --gold: #c9a45c;
  --gold-soft: #e0c98a;
  --blue: #5c8bd6;
  --red: #c45b5b;
  --green: #6fae7a;
  --radius: 10px;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

/* 隐藏数字输入框的上下箭头（统一用自定义按钮调整） */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 14px;
}

/* ---------- 整体布局 ---------- */
#app {
  display: flex;
  min-height: 100vh;
}

#sidebar {
  width: 230px;
  flex: 0 0 230px;
  background: linear-gradient(180deg, #171a26 0%, #10131d 100%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: flex-basis 0.28s ease, width 0.28s ease, padding 0.28s ease;
  overflow: hidden;
}

/* 导航栏缩回/展开 */
.nav-toggle {
  position: fixed;
  left: 230px;
  top: 14px;
  z-index: 100;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--gold-soft);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  transition: left 0.28s ease, transform 0.28s ease, background 0.2s;
}

.nav-toggle:hover {
  border-color: var(--gold);
  background: rgba(201, 164, 92, 0.15);
}

/* 角色切换栏（KP端 / PL端 / 访客端） */
.role-bar {
  display: flex;
  gap: 6px;
  padding: 10px 12px 0;
}

.role-btn {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 6px 2px;
  cursor: pointer;
  font-size: 12px;
  text-align: center;
}

.role-btn:hover {
  border-color: var(--gold);
  color: var(--text);
}

.role-btn.active {
  border-color: var(--gold);
  color: var(--gold-soft);
  background: rgba(201, 164, 92, 0.12);
}

.role-status {
  font-size: 11px;
  color: var(--text-dim);
  padding: 4px 12px 8px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

body.access-guest .role-status {
  color: #d9b36a;
}

/* 访客端只读：输入与修改按钮弱化提示 */
body.access-guest .btn-danger,
body.access-guest .add-card,
body.access-guest .roster-add {
  opacity: 0.55;
}

body.nav-collapsed #sidebar {
  flex-basis: 0;
  width: 0;
  padding: 0;
  border-right: none;
}

body.nav-collapsed #sidebar .sidebar-brand,
body.nav-collapsed #sidebar #nav,
body.nav-collapsed #sidebar .sidebar-footer {
  opacity: 0;
  pointer-events: none;
}

body.nav-collapsed .nav-toggle {
  left: 4px;
  transform: rotate(180deg);
}

.sidebar-brand {
  padding: 22px 18px 16px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.brand-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 8px;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(201, 164, 92, 0.35);
}

.brand-sub {
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
}

#nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.nav-item:hover {
  background: var(--panel);
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(201, 164, 92, 0.16), rgba(201, 164, 92, 0.03));
  border-color: rgba(201, 164, 92, 0.45);
  color: var(--gold-soft);
}

.nav-item.placeholder .nav-icon {
  opacity: 0.45;
}

.nav-icon {
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--text-dim);
}

#save-status.flash {
  color: var(--green);
  transition: color 0.2s;
}

#main {
  flex: 1;
  min-width: 0;
  padding: 24px 30px 60px;
  background:
    radial-gradient(1100px 500px at 80% -10%, rgba(92, 139, 214, 0.10), transparent 60%),
    radial-gradient(900px 460px at -10% 110%, rgba(201, 164, 92, 0.07), transparent 60%),
    var(--bg);
}

#page-header h1 {
  margin: 0 0 4px;
  font-size: 26px;
  letter-spacing: 2px;
  color: var(--gold-soft);
}

#page-header .sub {
  margin: 0 0 20px;
  color: var(--text-dim);
  font-size: 13px;
}

.sheet {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- 顶部名册导航栏 ---------- */
.roster-bar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

/* ---------- NPC 角色卡：右侧分类栏 ---------- */
.npc-sheet {
  max-width: 1400px;
}

.npc-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.npc-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.npc-side {
  flex: none;
  width: 176px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 12px;
}

.npc-side-head {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.npc-group-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.npc-group-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.npc-group-chip {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--text-dim);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.npc-group-chip:hover {
  border-color: var(--line2);
  color: var(--text);
}

.npc-group-chip.active {
  background: var(--panel2);
  border-color: var(--gold);
  color: var(--gold-soft);
}

.npc-group-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.npc-group-chip small {
  color: var(--text-dim);
  font-size: 11px;
}

.npc-group-btn {
  padding: 2px 6px;
}

.npc-group-add {
  width: 100%;
}

/* 窄屏：分类栏移到卡片上方，避免挤压 */
@media (max-width: 900px) {
  .npc-layout {
    flex-direction: column;
  }
  .npc-side {
    width: 100%;
    position: static;
  }
}

/* ---------- 怪物卡表单：攻击 / 专长 / 魔法 / 奇迹 / 自定义技能列表 ---------- */
.mon-form-groups {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mon-form-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: var(--panel2);
}

.mon-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.mon-form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-top: 1px solid var(--line);
}

.mon-form-name {
  flex: none;
}

.mon-form-fx {
  flex: 1;
  min-width: 0;
  color: var(--text-dim);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.roster-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-radius: 20px;
  padding: 6px 10px 6px 14px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
  user-select: none;
}

.roster-tab:hover {
  border-color: var(--gold);
  color: var(--text);
}

.roster-tab.active {
  background: linear-gradient(90deg, rgba(201, 164, 92, 0.22), rgba(201, 164, 92, 0.06));
  border-color: var(--gold);
  color: var(--gold-soft);
}

.roster-del {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 50%;
}

.roster-del:hover {
  color: var(--red);
}

.roster-add {
  margin-left: 4px;
}

/* 名册分组（无主角色卡 / 各PL账号的角色卡） */
.roster-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}

.roster-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--text-dim);
  border-radius: 14px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 13px;
}

.roster-group small {
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(140, 145, 170, 0.15);
  border-radius: 8px;
  padding: 0 6px;
}

.roster-group.active {
  border-color: var(--gold);
  color: var(--gold-soft);
  background: rgba(201, 164, 92, 0.1);
}

/* PL账号管理（KP登录后显示在角色栏下方） */
.pl-accounts-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.pl-accounts-label {
  color: var(--gold-soft);
  font-weight: 700;
}

.pl-account-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 3px 6px 3px 10px;
  color: var(--text);
  font-size: 12px;
}

.pl-account-del {
  background: #7a2b2b;
  border-color: #b04a4a;
  color: #ffd9d9;
  font-size: 13px;
  width: 20px;
  height: 20px;
  padding: 0;
  font-weight: 800;
}

/* PL查看他人角色卡：只读弱化提示 */
.sheet-readonly input,
.sheet-readonly textarea,
.sheet-readonly select {
  opacity: 0.7;
}

.sheet-readonly .btn[data-action] {
  opacity: 0.55;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--gold);
  letter-spacing: 1px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.card h3 {
  margin: 18px 0 10px;
  font-size: 15px;
  color: var(--gold-soft);
}

.card .hint {
  margin: -4px 0 12px;
  font-size: 12px;
  color: var(--text-dim);
}

.empty-tip {
  color: var(--text-dim);
  font-size: 13px;
  margin: 8px 0;
}

/* ---------- 顶部角色卡 ---------- */
.header-card {
  display: flex;
  gap: 22px;
}

.portrait-area {
  flex: 0 0 190px;
}

.img-frame {
  width: 100%;
  height: 210px;
  border: 1px dashed var(--line2);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-uploader.round .img-frame {
  border-radius: 50%;
  height: 150px;
}

.img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-uploader .img-empty {
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  line-height: 1.6;
}

.img-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  justify-content: center;
}

.meta-area {
  flex: 1;
  min-width: 0;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-dim);
}

.field.wide {
  grid-column: 1 / -1;
}

.field input,
.field select,
.field textarea {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 7px 9px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold);
}

.field textarea {
  resize: vertical;
  line-height: 1.5;
}

/* ---------- 属性 ---------- */
.attrs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.attr-block {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.attr-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--gold-soft);
}

.attr-name span {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 2px;
}

.attr-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 12px 0 8px;
}

.attr-value {
  font-size: 34px;
  font-weight: 800;
  min-width: 54px;
  color: var(--text);
}

.attr-btn {
  width: 30px;
  height: 30px;
  font-size: 17px;
  line-height: 1;
}

.attr-desc {
  font-size: 11px;
  color: var(--text-dim);
}

.attr-note {
  margin-top: 6px;
  font-size: 11px;
  color: var(--blue);
}

/* ---------- 战斗能力 ---------- */
.combat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.stat-box {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-dim);
}

.stat-value {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-soft);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.stat-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-dim);
}

/* 主动性 / 斗志 / 天生察觉 的手动调整值输入 */
.stat-mod {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 0;
  margin-top: 2px;
  vertical-align: middle;
}

.stat-mod-input {
  width: 46px;
  padding: 2px 4px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.resource-input {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.resource-input input {
  width: 68px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  padding: 3px 6px;
  text-align: center;
}

.resource-sep {
  color: var(--text-dim);
}

.resource-max {
  color: var(--text-dim);
  font-size: 15px;
}

.combat-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}

.combat-ladder,
.combat-wounds {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.combat-ladder h3,
.combat-wounds h3 {
  margin-top: 0;
}

.ladder-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  flex-wrap: wrap;
}

.ladder-name {
  width: 82px;
  font-size: 13px;
}

.ladder-num {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ladder-value {
  min-width: 34px;
  text-align: center;
  font-weight: 700;
  font-size: 22px;
  color: var(--gold-soft);
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: 8px;
  padding: 2px 6px;
}

.ladder-btn {
  padding: 2px 8px;
}

.ladder-info {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--text-dim);
}

.def-bonus {
  margin-top: 8px;
  font-size: 12px;
  color: var(--green);
}

.wound-track {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.wound-box {
  width: 34px;
  height: 26px;
  border: 1px solid var(--line2);
  border-radius: 4px;
  background: var(--bg2);
  cursor: pointer;
  transition: all 0.15s;
}

.wound-box:hover {
  border-color: var(--gold);
}

.wound-box.filled {
  background: linear-gradient(180deg, #7d2f2f, #a84a3c);
  border-color: #c46a55;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.4);
}

.wound-info {
  font-size: 12px;
  color: var(--text-dim);
}

.dying-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--red);
}

/* ---------- 状态栏 ---------- */
.status-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.status-col {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}

.status-col h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 30px;
  margin-bottom: 10px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 16px;
  padding: 4px 8px 4px 12px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.12s;
}

.status-chip:hover {
  filter: brightness(1.15);
}

.status-chip.buff {
  background: rgba(111, 174, 122, 0.14);
  border-color: rgba(111, 174, 122, 0.55);
  color: #a8d6b0;
}

.status-chip.debuff {
  background: rgba(196, 91, 91, 0.14);
  border-color: rgba(196, 91, 91, 0.55);
  color: #e5a6a6;
}

.chip-effect {
  color: var(--text-dim);
}

.chip-duration {
  font-size: 11px;
  color: var(--text-dim);
  border-left: 1px solid var(--line2);
  padding-left: 6px;
}

.chip-del {
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

.chip-del:hover {
  opacity: 1;
}

.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.diff-table th,
.diff-table td {
  border: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
}

.diff-table th {
  background: var(--panel2);
  color: var(--gold-soft);
}

.diff-num {
  text-align: center;
  font-weight: 700;
  color: var(--gold);
}

/* ---------- 技能 ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: 2.2fr 0.9fr 0.9fr;
  gap: 2px 8px;
  align-items: center;
}

.skill-head {
  font-size: 12px;
  color: var(--gold-soft);
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
}

.skill-row {
  display: contents;
}

.skill-row > div {
  padding: 5px 4px;
  border-bottom: 1px dashed var(--line);
}

.skill-name {
  font-size: 13px;
}

.skill-attr {
  margin-left: 6px;
  font-size: 11px;
  color: var(--blue);
  border: 1px solid rgba(92, 139, 214, 0.4);
  border-radius: 10px;
  padding: 1px 7px;
}

.skill-note {
  font-size: 11px;
  color: var(--text-dim);
}

.skill-dots {
  display: flex;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  user-select: none;
}

.skill-dots .circle {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--line2);
  background: transparent;
  display: inline-block;
  cursor: pointer;
  transition: all 0.12s;
}

.skill-dots .circle.on {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(201, 164, 92, 0.55);
}

.skill-dots .circle:hover {
  border-color: var(--gold);
}

.skill-dots .star {
  font-size: 16px;
  line-height: 1;
  color: var(--line2);
  cursor: pointer;
  transition: all 0.12s;
}

.skill-dots .star.on {
  color: var(--gold);
  text-shadow: 0 0 8px rgba(201, 164, 92, 0.6);
}

.skill-dots .star:hover {
  color: var(--gold);
}

.skill-dots .dot-level {
  margin-left: 5px;
  font-size: 11px;
  color: var(--text-dim);
  min-width: 14px;
}

/* 技能卡内的两行熟练度/专注值 */
.skill-levels {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 5px;
}

.level-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.level-label {
  flex: 0 0 34px;
  font-size: 11px;
  color: var(--text-dim);
}

.level-row .skill-dots .circle {
  width: 13px;
  height: 13px;
}

.level-row .skill-dots .star {
  font-size: 14px;
}

/* ---------- 卡片网格 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.card-mini {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  transition: border-color 0.15s, transform 0.12s;
  cursor: pointer;
}

.card-mini:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.mini-icon {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.mini-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.icon-fallback {
  line-height: 1;
}

.mini-body {
  flex: 1;
  min-width: 0;
}

.mini-title {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---------- 稀有度配色（低饱和，可区分但不刺眼） ---------- */
.rarity-common { color: #dbd5c6; }
.rarity-rare { color: #7cb3f0; }
.rarity-precious { color: #cb8fec; }
.rarity-special { color: #cb8fec; }

.card-mini.rarity-common, .ency-card.rarity-common { border-left: 5px solid #b8b2a4; }
.card-mini.rarity-rare, .ency-card.rarity-rare { border-left: 5px solid #5b93d8; }
.card-mini.rarity-precious, .ency-card.rarity-precious { border-left: 5px solid #a86fd0; }
.card-mini.rarity-special, .ency-card.rarity-special { border-left: 5px solid #a86fd0; }

.card-mini.rarity-common, .ency-card.rarity-common { background-image: linear-gradient(90deg, rgba(184, 178, 164, 0.10), transparent 45%); }
.card-mini.rarity-rare, .ency-card.rarity-rare { background-image: linear-gradient(90deg, rgba(91, 147, 216, 0.14), transparent 45%); }
.card-mini.rarity-precious, .ency-card.rarity-precious { background-image: linear-gradient(90deg, rgba(168, 111, 208, 0.16), transparent 45%); }
.card-mini.rarity-special, .ency-card.rarity-special { background-image: linear-gradient(90deg, rgba(168, 111, 208, 0.16), transparent 45%); }

.tag {
  font-size: 10px;
  font-weight: 400;
  color: var(--blue);
  border: 1px solid rgba(92, 139, 214, 0.4);
  border-radius: 8px;
  padding: 0 6px;
}

.mini-sub {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
}

.mini-edit,
.mini-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
}

.add-card {
  border: 1px dashed var(--line2);
  background: transparent;
  color: var(--text-dim);
  min-height: 70px;
  font-size: 14px;
  border-radius: 8px;
}

.add-card:hover {
  border-color: var(--gold);
  color: var(--gold-soft);
}

/* ---------- 装备 ---------- */
.equip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.equip-slot {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.equip-slot-label {
  font-size: 12px;
  color: var(--gold-soft);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  margin-bottom: 8px;
  font-weight: 700;
}

.equip-slot-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.equip-empty {
  color: var(--text-dim);
  font-size: 12px;
  padding: 4px 0;
}

.btn-add-slot {
  align-self: flex-start;
}

/* ---------- 货币 ---------- */
.currency-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.currency-row .field {
  width: 120px;
}

.currency-total {
  font-size: 13px;
  color: var(--gold-soft);
  padding-bottom: 6px;
}

/* ---------- 按钮 ---------- */
.btn {
  background: var(--panel2);
  border: 1px solid var(--line2);
  color: var(--text);
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn:hover {
  border-color: var(--gold);
  color: var(--gold-soft);
}

.btn-mini {
  padding: 3px 8px;
  font-size: 11px;
}

.btn-primary {
  background: linear-gradient(180deg, rgba(201, 164, 92, 0.25), rgba(201, 164, 92, 0.12));
  border-color: var(--gold);
  color: var(--gold-soft);
}

.btn-danger {
  border-color: rgba(196, 91, 91, 0.7);
  color: #e0a0a0;
}

.btn-danger:hover {
  background: rgba(196, 91, 91, 0.15);
  border-color: var(--red);
  color: #f0c0c0;
}

/* ---------- 工具区 ---------- */
.tool-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.tool-hint {
  font-size: 11px;
  color: var(--text-dim);
}

/* ---------- 成长花费参考 ---------- */
.xp-ref summary {
  cursor: pointer;
}

.xp-ref summary h2 {
  display: inline;
  border: none;
  padding: 0;
}

.xp-ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.xp-ref table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.xp-ref th,
.xp-ref td {
  border: 1px solid var(--line);
  padding: 5px 8px;
  text-align: center;
}

.xp-ref th {
  background: var(--panel2);
  color: var(--gold-soft);
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 14, 0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-mask.closing {
  opacity: 0;
  transition: opacity 0.15s;
}

.modal-box {
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 12px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.55);
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

/* 视野共享卡片：更小、不模糊背景 */
.modal-mask.share-modal {
  background: rgba(8, 9, 14, 0.45);
  backdrop-filter: none;
}
.modal-mask.share-modal .modal-box {
  max-width: 360px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
  font-size: 17px;
  color: var(--gold-soft);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}

/* 详情弹窗 */
.detail-icon {
  width: 90px;
  min-height: 90px;
  margin: 0 auto 14px;
}

.detail-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-icon .img-uploader .img-frame {
  height: 90px;
  border-radius: 10px;
  font-size: 32px;
}

.detail-icon .img-actions {
  margin-top: 6px;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 12px;
}

.detail-table th,
.detail-table td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  vertical-align: top;
  text-align: left;
}

.detail-table th {
  background: var(--panel2);
  color: var(--gold-soft);
  width: 90px;
  white-space: nowrap;
}

.detail-desc {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.detail-desc h4 {
  margin: 0 0 6px;
  color: var(--gold-soft);
}

.detail-desc p {
  margin: 0;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* 详情弹窗中的效果数据分区 */
.detail-effects {
  margin-top: 12px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.detail-effects h4 {
  margin: 0 0 10px;
  color: var(--gold-soft);
}

.fx-block {
  display: flex;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
}

.fx-block:last-child {
  border-bottom: none;
}

.fx-label {
  flex: 0 0 72px;
  font-size: 12px;
  color: var(--text-dim);
}

.fx-content {
  flex: 1;
  font-size: 13px;
}

.fx-list {
  margin: 0;
  padding-left: 18px;
}

.fx-empty {
  color: var(--line2);
}

.detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  justify-content: flex-end;
}

.confirm-text {
  line-height: 1.7;
}

/* 表单弹窗 */
.form-grid {
  display: flex;
  gap: 16px;
}

.form-icon-col {
  flex: 0 0 130px;
}

.form-fields {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-fields .field.wide {
  grid-column: 1 / -1;
}

.check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  grid-column: 1 / -1;
  color: var(--text);
}

/* 效果编辑器（表单内） */
.fx-editor {
  grid-column: 1 / -1;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.fx-editor h4 {
  margin: 0 0 10px;
  color: var(--gold-soft);
}

.fx-group {
  margin-bottom: 12px;
}

.fx-group h5 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}

.fx-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fx-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.fx-row input,
.fx-row select {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  flex: 1;
  min-width: 90px;
}

.fx-row input:focus,
.fx-row select:focus {
  border-color: var(--gold);
}

.fx-row .fx-stat {
  flex: 0 0 110px;
}

.fx-row .fx-value {
  flex: 0 0 110px;
}

.fx-percent {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: var(--text-dim);
  flex: 0 0 auto;
}

.fx-del {
  flex: 0 0 auto;
}

/* ---------- 提示 ---------- */
#toast-root {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-left: 3px solid var(--green);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateX(16px);
  transition: all 0.22s;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.error {
  border-left-color: var(--red);
}

/* ---------- 预留页 ---------- */
.placeholder-page {
  text-align: center;
  padding: 90px 20px;
  color: var(--text-dim);
}

.placeholder-icon {
  font-size: 60px;
  color: var(--line2);
  margin-bottom: 18px;
}

.placeholder-page h2 {
  color: var(--text);
  margin-bottom: 10px;
}

.placeholder-page code {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--gold-soft);
}

/* ============================================================
 * 地图与战斗系统
 * ============================================================ */
.map-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  max-width: 1500px;
  margin: 0 auto;
}

.map-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

.map-check,
.map-field {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-dim);
}

.map-field input,
.map-field select {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 4px 6px;
  font-size: 12px;
  font-family: inherit;
  max-width: 90px;
}

.map-sep {
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 4px;
}

.map-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow);
  overflow: auto;
  max-height: calc(100vh - 250px);
}

.map-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  cursor: crosshair;
  border-radius: 6px;
  background: #10131d;
}

/* 世界/冒险地图：范围更大、方格更细密，允许横向滚动查看 */
.map-canvas.full {
  max-width: none;
}

/* 手动放大后解除自适应宽度限制（否则 CSS 会把画布压回容器宽度） */
.map-canvas.zoomed {
  max-width: none;
}

.map-status {
  min-height: 22px;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
}

.map-confirm {
  display: flex;
  gap: 8px;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 8px;
}

/* 地图多开：顶部标签页 + 回合控制 */
.map-layout {
  flex-direction: column;
  max-width: 1700px;
}

.map-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  width: 100%;
}

.map-tabs-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  box-shadow: var(--shadow);
}

.map-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.map-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg2);
  user-select: none;
}

.map-tab.active {
  border-color: var(--gold);
  color: var(--gold-soft);
  background: rgba(198, 167, 92, 0.08);
}

.map-tab-close {
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

.map-tab-close:hover {
  color: #e06666;
}

.map-tabs-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.map-turn-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.map-turn-label {
  font-size: 13px;
  color: var(--gold-soft);
  font-weight: 700;
}

.new-map-kinds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.new-map-kind {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
}

.new-map-kind small {
  color: var(--text-dim);
  font-size: 11px;
}

#chat-input {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 5px 8px;
  font-size: 12px;
  width: 220px;
}

/* 聊天泡泡：角色头顶弹出，标明说话者，带动态特效 */
.map-wrap {
  position: relative;
}

.chat-bubble {
  position: absolute;
  z-index: 30;
  width: 160px;
  background: rgba(24, 28, 42, 0.96);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 6px 8px;
  opacity: 0;
  transform: translateY(8px) scale(0.85);
  transform-origin: bottom center;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.chat-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chat-bubble.hide {
  opacity: 0;
  transform: translateY(-6px) scale(0.92);
}

.chat-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--gold);
}

.chat-bubble-speaker {
  font-size: 11px;
  color: var(--gold-soft);
  font-weight: 700;
  margin-bottom: 2px;
}

.chat-bubble-text {
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
}

.chat-bubble-who {
  color: var(--gold-soft);
  font-weight: 700;
}

/* 标记到文本框的连接线 */
.chat-bubble-line {
  position: absolute;
  z-index: 29;
  width: 2px;
  background: linear-gradient(to bottom, rgba(198, 167, 92, 0.15), rgba(198, 167, 92, 0.85));
  pointer-events: none;
}

/* ============================================================
 * 侧栏：行动次序 / 当前行动者 / 居中头像 / 弹出卡片
 * ============================================================ */
.side-order {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
  background: var(--bg2);
}

.current-actor {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(198, 167, 92, 0.18), rgba(198, 167, 92, 0.05));
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.current-actor.empty {
  color: var(--text-dim);
  font-size: 12px;
  border-color: var(--line);
  background: var(--bg2);
}

.current-actor-avatar,
.order-chip-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  background: #39405a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #e8e4d8;
  font-weight: 700;
}

.current-actor-avatar {
  width: 44px;
  height: 44px;
  border: 2px solid var(--gold);
}

.current-actor-avatar img,
.order-chip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.current-actor-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.current-actor-info b {
  font-size: 14px;
  color: var(--gold-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.current-actor-info span {
  font-size: 11px;
  color: var(--text-dim);
}

.order-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.order-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg2);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-dim);
}

.order-chip:hover {
  border-color: var(--gold);
}

.order-chip.active {
  border-color: var(--gold);
  color: var(--gold-soft);
  background: rgba(198, 167, 92, 0.12);
}

.order-chip.selected {
  box-shadow: 0 0 0 2px rgba(255, 215, 130, 0.35);
}

.order-chip-name {
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-chip-init {
  font-size: 10px;
  color: var(--text-dim);
}

/* 未展开条目：中央头像（可操作） */
.side-entry-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 10px;
}

.side-entry:not(.expanded) .side-entry-head {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 12px 8px;
  gap: 6px;
}

.side-entry-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: #39405a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #e8e4d8;
  font-weight: 700;
  border: 2px solid transparent;
  cursor: pointer;
}

.side-entry:not(.expanded) .side-entry-avatar {
  width: 56px;
  height: 56px;
  font-size: 20px;
}

.side-entry-avatar:hover {
  border-color: var(--gold);
}

.side-entry-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.side-entry.selected:not(.expanded) .side-entry-head {
  background: rgba(198, 167, 92, 0.1);
  border: 1px solid rgba(198, 167, 92, 0.5);
}

/* 条目内聊天 */
.side-chat {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.side-chat input {
  flex: 1;
  min-width: 0;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 5px 8px;
  font-size: 12px;
}

/* 侧栏弹出卡片 */
.side-popover {
  position: absolute;
  left: 8px;
  right: 8px;
  z-index: 60;
  background: #20243a;
  border: 1px solid var(--gold);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  padding: 10px;
}

.battle-sidebar {
  position: relative;
}

.side-pop-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.side-pop-tab.active {
  border-color: var(--gold);
  color: var(--gold-soft);
}

.side-pop-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.pop-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: left;
}

.pop-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.side-pop-title {
  font-weight: 700;
  color: var(--gold-soft);
  margin-bottom: 4px;
}

.side-pop-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
  max-height: 80px;
  overflow-y: auto;
}

.side-pop-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 百科次级导航（统一风格） */
.ency-group-nav {
  align-items: center;
}

.ency-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--text-dim);
  border-radius: 14px;
  cursor: pointer;
  font-size: 13px;
}

.ency-group-chip.active {
  border-color: var(--gold);
  color: var(--gold-soft);
  background: rgba(198, 167, 92, 0.1);
}

.ency-group-chip small {
  font-size: 11px;
  color: var(--text-dim);
}

.group-chip-actions {
  display: inline-flex;
  gap: 2px;
  margin-left: 2px;
}

.group-chip-actions .btn-mini {
  padding: 1px 5px;
  font-size: 11px;
}

.ency-card-tag {
  font-size: 11px;
  color: var(--gold-soft);
  background: rgba(198, 167, 92, 0.1);
  border-radius: 6px;
  padding: 1px 6px;
  align-self: flex-start;
}

.ency-toolbar {
  margin: 10px 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 地图标签拖动中 */
.map-tab.dragging {
  opacity: 0.45;
  border-style: dashed;
}

/* 工具按钮激活高亮：选择某工具（如放置浓雾）时边框亮起 */
.map-toolbar .btn.active {
  border-color: var(--gold);
  color: var(--gold-soft);
  background: rgba(201, 164, 92, 0.14);
  box-shadow: 0 0 0 1px var(--gold);
}

/* ---------- 素材库 ---------- */
.asset-folder-bar {
  flex-wrap: wrap;
}
.asset-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.asset-toolbar h2 {
  margin: 0;
  flex: 1;
}
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.asset-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg2);
  cursor: pointer;
}
.asset-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

/* 内置图标库 */
.mp-tabs {
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.mp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  max-height: 58vh;
  overflow-y: auto;
  padding-right: 4px;
}
.mp-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.mp-card:hover { border-color: var(--gold); }
.mp-card.picked {
  border-color: var(--gold);
  background: rgba(201, 164, 92, 0.12);
}
.mp-card-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.mp-card-icon img { width: 100%; height: 100%; object-fit: cover; }
.mp-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mp-card-body b { font-size: 13px; }
.mp-card-sub { font-size: 11px; color: var(--text-dim); }
.mp-card-tag { font-size: 11px; color: var(--blue); }
.mp-card-mark { font-size: 16px; color: var(--gold); width: 16px; text-align: center; }
/* 技能分组：体魄 / 心智 / 灵魂，淡色区分 */
.skill-group {
  border-radius: 10px;
  padding: 8px 10px 12px;
  margin-bottom: 12px;
}
.skill-group-brawn {
  background: rgba(196, 91, 91, 0.05);
  border-left: 3px solid rgba(196, 91, 91, 0.32);
}
.skill-group-mind {
  background: rgba(92, 139, 214, 0.05);
  border-left: 3px solid rgba(92, 139, 214, 0.32);
}
.skill-group-soul {
  background: rgba(201, 164, 92, 0.05);
  border-left: 3px solid rgba(201, 164, 92, 0.32);
}
.skill-group-title {
  margin: 4px 0 10px;
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 600;
}
.picker-tabs {
  margin-bottom: 10px;
}
.picker-cats {
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.picker-group {
  margin-bottom: 16px;
}
.picker-list {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}
.picker-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.picker-group h4 {
  margin: 6px 0 8px;
  font-size: 13px;
  color: var(--text-dim);
}
.modal-box .asset-pick-grid {
  max-height: 52vh;
  overflow-y: auto;
}
.icon-lib-panel {
  margin-bottom: 18px;
}
.icon-lib-panel .ency-tabs-bar {
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.icon-lib-item img {
  background: #eae8e1;
  object-fit: contain;
  padding: 12px;
}
.icon-lib-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--text-dim);
  font-size: 13px;
}
.icon-lib-pager .btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.asset-item-name {
  padding: 5px 8px;
  font-size: 12px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-item .asset-del {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 0 6px;
  line-height: 18px;
  min-height: 0;
}
.asset-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
}
.asset-pick-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  cursor: pointer;
  text-align: center;
  background: var(--bg2);
}
.asset-pick-item:hover {
  border-color: var(--gold);
}
.asset-pick-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}
.asset-pick-item span {
  display: block;
  font-size: 11px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 留档馆管理模式：拖动排序 */
.archive-card.manage {
  cursor: grab;
}
.archive-card.manage.dragging {
  opacity: 0.55;
  border-color: var(--gold, #c6a75c);
  cursor: grabbing;
}
.drag-handle {
  display: inline-block;
  margin-right: 8px;
  color: var(--text-dim, #9aa);
  cursor: grab;
  user-select: none;
}

/* 地图左侧聊天记录面板 */
.map-chat-panel {
  flex: 0 0 240px;
  max-width: 240px;
  min-height: 220px;              /* 常驻展开：无人说话也显示黑框 */
  max-height: calc(100vh - 180px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  position: sticky;
  top: 14px;
  background: #171a26;
  border-color: #2a2e3d;
}

.chat-history-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.chat-history-msg {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
}

.chat-history-msg b {
  color: var(--gold-soft);
  font-size: 12px;
}

.chat-history-time {
  float: right;
  color: var(--text-dim);
  font-size: 10px;
}

.chat-history-msg p {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 12px;
  word-break: break-word;
}

.chat-history-msg img {
  max-width: 100%;
  border-radius: 6px;
  margin-top: 4px;
}

/* 地图聊天面板底部发言框（KP=安德 / PL=主卡名称） */
.map-chat-footer {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.map-chat-footer-who {
  font-size: 12px;
  color: var(--gold-soft);
  font-weight: 700;
}

.map-chat-footer input {
  width: 100%;
  box-sizing: border-box;
  font-size: 12px;
}

.map-chat-footer .btn {
  align-self: flex-end;
}

/* QQ 骰子机器人面板 */
.bot-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 4px;
}
.bot-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: #222;
}
.bot-name {
  font-weight: 600;
}
.bot-qq {
  color: var(--text-dim, #999);
  font-size: 0.85em;
}
.bot-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  font-weight: 700;
}

.bot-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #555;
  display: inline-block;
}

.bot-dot.on {
  background: #57c26b;
  box-shadow: 0 0 8px rgba(87, 194, 107, 0.7);
}

.bot-group-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0;
}

.bot-group-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.bot-group-name {
  flex: 1;
  font-weight: 700;
  word-break: break-all;
}

.bot-toggle.on {
  border-color: #57c26b;
  color: #57c26b;
}

.bot-add-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.bot-add-row input {
  flex: 1;
  box-sizing: border-box;
}

.bot-help {
  margin-top: 16px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
}

.bot-help ol {
  padding-left: 20px;
  margin: 8px 0;
  line-height: 1.8;
}

.bot-help code {
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 5px;
  border-radius: 4px;
}

/* 可操作角色：侧箭头 + 便签 */
.side-entry {
  position: relative;
}

.side-minion-btn {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--gold-soft);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.side-minion-btn:hover {
  border-color: var(--gold);
  background: rgba(201, 164, 92, 0.15);
}

.side-entry:not(.expanded) .side-minion-btn {
  top: 8px;
  right: 8px;
}

.minion-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.minion-row .minion-jump {
  flex: 1;
  justify-content: space-between;
}

.minion-del {
  background: #7a2b2b;
  border-color: #b04a4a;
  color: #ffd9d9;
  font-size: 15px;
  width: 26px;
  height: 26px;
  padding: 0;
  flex-shrink: 0;
}

.minion-add {
  background: #1f4a2c;
  border-color: #3f8a55;
  color: #d9ffe2;
  font-size: 14px;
}

.minion-del,
.minion-add {
  font-weight: 800;
}

/* ============================================================
 * 滚动条：纤细、不显眼
 * ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background: rgba(140, 145, 170, 0.25);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(140, 145, 170, 0.45);
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ============================================================
 * 行动次序条（顶部，与地图选择栏平行）
 * ============================================================ */
.map-order-zone {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px 12px;
  width: 100%;
}

.order-strip-head {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.order-strip-head small {
  color: var(--text-dim);
  opacity: 0.8;
}

.order-strip {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 0;
  scroll-behavior: smooth;
  min-height: 74px;
}

.order-cell {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 14px;
  border-left: 1px solid rgba(140, 145, 170, 0.22); /* 竖线分割每个行动 */
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3), opacity 0.3s;
  opacity: 0.65;
  min-width: 92px;
}

.order-cell:first-child {
  border-left: none;
}

.order-cell:hover {
  opacity: 1;
}

.order-cell.selected {
  box-shadow: inset 0 0 0 1px rgba(255, 215, 130, 0.5);
  border-radius: 10px;
}

.order-cell.current {
  opacity: 1;
  transform: scale(1.22);
  z-index: 2;
}

.order-cell-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: #39405a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #e8e4d8;
  font-weight: 700;
  border: 2px solid var(--line);
}

.order-cell.current .order-cell-avatar {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(201, 164, 92, 0.55);
}

.order-cell-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-cell-name {
  font-size: 12px;
  color: var(--text);
  max-width: 96px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-cell-meta {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ============================================================
 * 侧栏列表标签（地图单位 / 可操作单位）
 * ============================================================ */
.side-list-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--panel, #141824);
  padding: 6px 0;
}

.side-list-tab {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 13px;
}

.side-list-tab.active {
  border-color: var(--gold);
  color: var(--gold-soft);
  background: rgba(198, 167, 92, 0.1);
}

/* ============================================================
 * 展开条目的内部导航与标签页
 * ============================================================ */
/* 需求：四个页签按 左上/右上/左下/右下 排成 2×2 网格 */
.side-entry-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.side-entry-tab {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 5px 4px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-entry-tab.active {
  border-color: var(--gold);
  color: var(--gold-soft);
  background: rgba(198, 167, 92, 0.12);
}

.side-tab-pane {
  animation: sideFade 0.22s ease;
}

@keyframes sideFade {
  from { opacity: 0.2; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 技能行：主按钮 + 效果小箭头 */
.action-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-row .side-btn {
  flex: 1;
  min-width: 0;
}

.effect-arrow {
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

/* 临时调用 */
.temp-calls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.temp-cat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
}

.temp-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.temp-cat-head h5 {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
}

.temp-add {
  background: #1f4a2c;
  border-color: #3f8a55;
  color: #d9ffe2;
  font-size: 11px;
}

.temp-call-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.temp-call-row .temp-call-btn {
  flex: 1;
  min-width: 0;
}

.temp-del {
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 14px;
  flex-shrink: 0;
  background: #7a2b2b;
  border-color: #b04a4a;
  color: #ffd9d9;
  font-weight: 800;
}

.temp-pick-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}

/* 收起条目上的简洁聊天输入 */
.side-chat.slim {
  margin-top: 2px;
  padding: 0 8px 8px;
}

.side-chat.slim input {
  padding: 3px 6px;
  font-size: 11px;
}

/* 收起的地图单位：基础属性行 */
.side-mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 0 10px 8px;
  font-size: 11px;
  color: var(--text-dim);
}

.side-mini-stats span {
  background: rgba(140, 145, 170, 0.12);
  border-radius: 6px;
  padding: 2px 6px;
}

/* 视野开关（KP地图单位 / 可操作单位） */
.vision-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.vision-toggle input {
  accent-color: var(--gold);
}

/* 可操作单位栏 */
.operable-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.op-account {
  padding: 10px;
}

.op-account-head {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 700;
  color: var(--gold-soft);
  font-size: 13px;
}

.op-account-head small {
  font-weight: 400;
  color: var(--text-dim);
  font-size: 11px;
}

.op-account-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.op-unit {
  padding: 10px;
  position: relative;
}

.op-unit-head {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.op-unit-head:hover .op-unit-main b {
  color: var(--gold);
}

.op-unit-toggle {
  color: var(--text-dim);
  font-size: 12px;
  flex-shrink: 0;
}

.op-unit.open {
  border-color: rgba(201, 164, 92, 0.5);
}

.op-unit-detail-wrap {
  margin-top: 10px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

.op-unit-detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.op-unit-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  background: #39405a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #e8e4d8;
  font-weight: 700;
}

.op-unit-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.op-unit-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.op-unit-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.op-unit-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.op-add,
.op-share {
  width: 100%;
  margin-top: 6px;
}

.op-share {
  background: rgba(92, 139, 214, 0.14);
  border-color: rgba(92, 139, 214, 0.6);
  color: #bcd3f7;
}

.unit-del {
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 14px;
  font-weight: 800;
  background: #7a2b2b;
  border-color: #b04a4a;
  color: #ffd9d9;
  flex-shrink: 0;
}

/* PL登录账号列表 */
.pl-login-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
}

/* 视野共享开关 */
.share-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: #2a2e3d;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  display: inline-block;
  transition: background 0.2s;
}

.switch i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c7ccdd;
  transition: left 0.2s;
}

.switch.on {
  background: rgba(92, 183, 120, 0.4);
  border-color: #5cb778;
}

.switch.on i {
  left: 22px;
  background: #7fe09c;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* 展开动画：头像从收起位置移动到展开位置 */
.side-entry-avatar {
  transition: width 0.3s ease, height 0.3s ease, font-size 0.3s ease, border-width 0.3s ease;
}

.side-entry.expanded .side-entry-body {
  animation: sideBodyIn 0.28s ease;
}

@keyframes sideBodyIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 收起/展开时头像的“轨迹”感 */
.side-entry-head .side-entry-avatar {
  transition: width 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2),
    height 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2),
    font-size 0.3s ease, transform 0.3s ease;
}

.side-entry:not(.expanded) .side-entry-avatar {
  transform: translateY(0);
}

.side-entry.expanded .side-entry-avatar {
  transform: translateX(0);
}

/* ============================================================
 * 百科页（敌人 / 专长与奇迹 / 魔法 / 装备 / buff与debuff）
 * ============================================================ */
.ency-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 1400px;
  margin: 0 auto;
}

.ency-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
}

.ency-tab {
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
}

.ency-tab.active {
  border-color: var(--gold);
  color: var(--gold-soft);
  background: rgba(198, 167, 92, 0.08);
}

.ency-main {
  padding: 18px;
}

.ency-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
/* 非敌人分类卡片：头像左上、名称右侧、按钮右侧上下、描述在下方 */
.ency-generic-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.ency-card:hover {
  border-color: var(--gold);
}

.ency-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 22px;
}

.ency-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ency-card-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ency-card-sub {
  font-size: 12px;
  color: var(--text-dim);
}

.ency-card-actions {
  display: flex;
  gap: 6px;
}

/* 敌人卡片：头像左上、名称在头像右侧、描述左下、编辑/删除上下排 */
.enemy-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.enemy-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.enemy-desc {
  text-align: left;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  max-height: 56px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.ency-card-actions.stacked {
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
}

.ency-card-actions.stacked .btn {
  white-space: nowrap;
}

/* ============================================================
 * 留档馆
 * ============================================================ */
.archive-sub-nav {
  border: none;
  box-shadow: none;
  padding: 0 0 8px 0;
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.archive-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
}

.archive-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.archive-orig {
  font-size: 12px;
  color: var(--text-dim);
}

.archive-time {
  font-size: 12px;
  color: var(--text-dim);
  margin-left: auto;
}

.archive-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-log-messages {
  border-top: 1px dashed var(--line);
  padding-top: 8px;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-log-msg {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.chat-log-msg b {
  color: var(--gold-soft);
}

.chat-log-time,
.chat-log-map {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: 8px;
}

.chat-log-msg p {
  margin: 4px 0 0;
  font-size: 13px;
}

.chat-log-msg img {
  max-width: 180px;
  border-radius: 6px;
  margin-top: 6px;
}

/* 侧边栏：百科调用分组 / 怪物详细数据 */
.ency-calls {
  margin-top: 10px;
}

.ency-group {
  margin-top: 8px;
}

.ency-group h5 {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0 0 4px;
}

.side-type {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.side-entry-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: auto;
}

@media (max-width: 760px) {
  .map-body {
    flex-direction: column;
  }

  .map-chat-panel {
    flex: none;
    max-width: none;
    max-height: 220px;
    position: static;
  }

  .map-tabs-right {
    justify-content: flex-start;
  }

  .new-map-kinds {
    grid-template-columns: 1fr;
  }
}

/* 战斗侧边栏 */
.battle-sidebar {
  flex: 0 0 300px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.side-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.side-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg2);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--gold-soft);
  flex: 0 0 46px;
}

.side-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.side-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-soft);
}

.side-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.side-stat {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
  padding: 3px 0;
  border-bottom: 1px dashed var(--line);
}

.side-stat b {
  color: var(--text);
}

.side-edits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.side-edit {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: var(--text-dim);
}

.side-edit input {
  width: 72px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 4px 6px;
  font-size: 12px;
}

.side-actions h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--gold-soft);
}

.side-btn-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}

.side-btn {
  text-align: left;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.side-btn:hover {
  border-color: var(--gold);
}

.side-btn-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.side-btn-sub {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.side-hint {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
}

@media (max-width: 1100px) {
  /* 窄屏下地图主体改为纵向排列，避免侧栏 100% 宽把地图主区挤成 0 */
  .map-body {
    flex-direction: column;
  }
  .map-main {
    width: 100%;
  }
  .map-chat-panel {
    flex: none;
    width: 100%;
    max-width: none;
  }
  .battle-sidebar {
    flex: none;
    width: 100%;
    position: static;
    max-height: none;
  }
}

/* 战斗侧边栏：所有标记条目 */
.side-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-soft);
  margin-bottom: 10px;
}

.side-entry-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-entry {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel2);
  overflow: hidden;
}

.side-entry.selected {
  border-color: var(--gold);
}

.side-entry-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
}

.side-entry-head:hover {
  background: rgba(255, 255, 255, 0.04);
}

.side-entry-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--line2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex: 0 0 30px;
}

.side-entry-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.side-entry-name {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.side-entry-toggle {
  color: var(--text-dim);
  font-size: 12px;
}

.side-entry-body {
  border-top: 1px dashed var(--line);
  padding: 10px;
}

.side-temp {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-end;
  margin: 8px 0;
  padding: 8px;
  background: var(--bg2);
  border-radius: 6px;
}

.side-temp h5 {
  flex-basis: 100%;
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--gold-soft);
}

.side-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}

.side-desc {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 6px 0;
}

/* 临时属性（角色卡页） */
.temp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.temp-mods {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.temp-mod {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}

.temp-mod b {
  min-width: 22px;
  text-align: center;
  color: var(--gold-soft);
  font-size: 16px;
}

@media (max-width: 900px) {
  .temp-grid {
    grid-template-columns: 1fr;
  }
}

/* 怪物卡页面 */
.monsters-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  max-width: 1180px;
  margin: 0 auto;
}

.monster-folders {
  flex: 0 0 280px;
}

.folder-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.monster-folder {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.monster-folder:hover {
  border-color: var(--line2);
}

.monster-folder.active {
  border-color: var(--gold);
  background: linear-gradient(90deg, rgba(201, 164, 92, 0.16), rgba(201, 164, 92, 0.03));
}

.folder-name {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.folder-count {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg2);
  border-radius: 10px;
  padding: 1px 7px;
}

.folder-actions {
  display: flex;
  gap: 4px;
}

.monster-main {
  flex: 1;
  min-width: 0;
}

.monster-pick-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.monster-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  cursor: pointer;
}

.monster-pick:hover {
  border-color: var(--gold);
}

/* 图片截取与缩放编辑器 */
.crop-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.crop-view {
  position: relative;
  width: 520px;
  height: 400px;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10131d;
  touch-action: none;
}

.crop-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.crop-box {
  position: absolute;
  border: 2px dashed rgba(255, 215, 130, 0.9);
  background: rgba(255, 255, 255, 0.05);
  cursor: move;
  box-sizing: border-box;
}

.crop-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #fff;
  cursor: nwse-resize;
}

.crop-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crop-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.crop-controls input[type="range"] {
  flex: 1;
}

.crop-tip {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
}

@media (max-width: 600px) {
  .crop-view {
    height: 260px;
  }
}

@media (max-width: 900px) {
  .monsters-layout {
    flex-direction: column;
  }

  .monster-folders {
    flex: none;
    width: 100%;
  }
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  #app {
    flex-direction: column;
  }

  #sidebar {
    width: 100%;
    height: auto;
    position: static;
    overflow: visible;
  }

  .nav-toggle {
    display: none;
  }

  #nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .nav-item {
    width: auto;
    margin-bottom: 0;
  }

  .header-card {
    flex-direction: column;
  }

  .portrait-area {
    flex: none;
  }

  .attrs-grid {
    grid-template-columns: 1fr;
  }

  .combat-row {
    grid-template-columns: 1fr;
  }

  .status-columns {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1.8fr 0.8fr 0.8fr;
    font-size: 12px;
  }

  .form-grid {
    flex-direction: column;
  }

  .form-fields {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
 * 阶段一：行动次序选中框 / 取消按钮 / 地图单位数值条 / 专长要求 / 技能被动
 * ============================================================ */
/* 行动次序条：选中用 outline（不越过分隔线），当前行动者时也清晰可见 */
.order-cell.selected {
  box-shadow: none;
  outline: 2px solid rgba(255, 215, 130, 0.85);
  outline-offset: -2px;
  border-radius: 10px;
  background: rgba(255, 215, 130, 0.08);
}
.order-cell.selected.current {
  outline-color: #ffd782;
  outline-width: 3px;
  background: rgba(255, 215, 130, 0.12);
}

/* 取消当前选择按钮：危险色 + 按下闪烁 */
.map-toolbar [data-map="cancel"] {
  border-color: #d96c4f;
  color: #f0a28c;
}
.map-toolbar [data-map="cancel"]:hover {
  background: rgba(217, 108, 79, 0.15);
}
.map-toolbar [data-map="cancel"].flash {
  animation: cancel-flash 0.7s ease;
}
@keyframes cancel-flash {
  0% { background: rgba(217, 108, 79, 0.95); color: #fff; transform: scale(1.12); }
  50% { background: rgba(217, 108, 79, 0.45); }
  100% { background: transparent; transform: scale(1); }
}

/* 地图单位收起卡片：数值条 */
.side-mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 4px 2px;
  font-size: 11px;
  color: var(--text-dim);
}
.mini-vitals {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px 2px;
  font-size: 11px;
  color: var(--text-dim);
}
.mini-hp {
  position: relative;
  height: 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 200, 90, 0.35);
  border-radius: 8px;
  overflow: hidden;
  min-width: 100px;
}
.mini-hp-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(180deg, #f5c95c, #d9a73a);
  transition: width 0.4s ease;
}
.mini-hp span {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
  line-height: 15px;
  font-size: 10px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.mini-armour b {
  font-size: 16px;
  color: var(--text);
  margin-left: 2px;
}
.mini-resolve {
  display: flex;
  align-items: center;
  gap: 4px;
}
.mini-resolve-dots {
  display: inline-flex;
  gap: 3px;
}
.resolve-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3a3f55;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 0.3s;
}
.resolve-dot.on {
  background: #d9534f;
  border-color: #f0a0a0;
  box-shadow: 0 0 4px rgba(217, 83, 79, 0.5);
}
.mini-wound-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.mini-wounds {
  display: inline-flex;
  gap: 3px;
}
.mini-wound {
  width: 10px;
  height: 14px;
  border: 1px solid rgba(217, 83, 79, 0.45);
  border-radius: 2px;
  background: transparent;
  transition: background 0.3s;
}
.mini-wound.filled {
  background: #d9534f;
  border-color: #f0a0a0;
}
.mini-none {
  color: var(--text-dim);
}

/* 百科非敌人条目：文字正常换行、不竖排；按钮水平靠右 */
.ency-card-main b {
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}
.enemy-head .ency-card-actions {
  flex-shrink: 0;
  align-items: center;
}
.enemy-head .ency-card-actions .btn {
  white-space: nowrap;
}

/* 专长前提要求：满足绿色、未满足红色 */
.talent-req {
  margin-top: 4px;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.talent-req.ok {
  color: #8fd08a;
  background: rgba(80, 160, 90, 0.12);
}
.talent-req.bad {
  color: #f0a28c;
  background: rgba(217, 108, 79, 0.14);
}

/* 技能被动值 */
.skill-passive {
  font-size: 11px;
  color: var(--gold-soft, #c6a75c);
  margin-top: 2px;
}

/* ============================================================
 * UI 优化（统一对齐 / 长文本截断 / 图片兜底）
 * ============================================================ */
/* 卡片标题与条目名：长文本截断，避免撑破布局 */
.mini-title,
.side-entry-name,
.order-cell-name,
.op-unit-main b,
.archive-main b,
.asset-item-name,
.temp-call-row .side-btn-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-title {
  display: block;
}
.mini-body {
  min-width: 0;
}
.card-mini {
  align-items: flex-start;
}
.card-mini .mini-body {
  padding-top: 2px;
}

/* 通用图片：任何 img 不超出其容器（防止移位/溢出） */
img {
  max-width: 100%;
}
.img-frame img,
.mini-icon img,
.asset-item img,
.asset-pick-item img,
.chat-history-msg img,
.chat-log-msg img {
  object-fit: cover;
  display: block;
}

/* 侧边栏条目头像与文本垂直对齐 */
.side-entry-head {
  align-items: center;
}
.side-entry-avatar img,
.order-cell-avatar img,
.op-unit-icon img {
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* 名册标签：名称省略号，标签长度自适应 */
.roster-tab {
  min-width: 0;
}
.roster-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

/* 表单字段标签与输入框对齐 */
.form-fields .field {
  min-width: 0;
}
.field label {
  display: block;
  margin-bottom: 4px;
}

/* 素材库/留档馆工具条按钮垂直居中 */
.asset-toolbar,
.archive-actions {
  align-items: center;
}

/* 行动次序条卡片头像尺寸统一 */
.order-cell-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
}
.order-cell-avatar img {
  width: 100%;
  height: 100%;
}
/* ============================================================
 * 第二阶段：战斗行动 / 双持 / 优势劣势 / 距离提示
 * ============================================================ */
.side-action-bar {
  margin-bottom: 10px;
  display: flex;
  gap: 6px;
}
.side-action-bar .btn {
  flex: 1;
  border-color: var(--gold, #c6a75c);
  color: var(--gold-soft, #e0c884);
}
.side-action-bar .btn:hover {
  background: rgba(198, 167, 92, 0.14);
}

/* 行动面板 */
.action-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
}
.action-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg2);
  color: var(--text);
  cursor: pointer;
}
.action-item:hover {
  border-color: var(--gold);
  background: rgba(198, 167, 92, 0.1);
}
.action-item b {
  color: var(--gold-soft);
}
.action-desc {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
  white-space: normal;
}

/* 检定卡片：优势/劣势选项 */
.adv-opts {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.adv-label {
  font-size: 12px;
  color: var(--text-dim);
  width: 100%;
}
.check-opt.adv {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
}
.check-opt.adv:has(input:checked) {
  border-color: var(--gold);
  background: rgba(198, 167, 92, 0.12);
}
/* ============================================================
 * 第三轮：按钮高亮 / 魂火火焰 / 行动按钮（PL）
 * ============================================================ */
/* 技能/法术/行动按钮按下高亮 */
.side-btn.active {
  border-color: var(--gold, #c6a75c) !important;
  background: rgba(198, 167, 92, 0.18) !important;
  color: var(--gold-soft, #e8d9a8) !important;
  box-shadow: 0 0 8px rgba(198, 167, 92, 0.35);
}

/* 魂火火焰标志 */
.soulfire-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.soulfire-icon {
  font-size: 18px;
  display: inline-block;
  animation: soulfire-flicker 1.4s ease-in-out infinite;
}
@keyframes soulfire-flicker {
  0%, 100% { transform: scale(1) rotate(-2deg); filter: brightness(1); }
  25% { transform: scale(1.12) rotate(2deg); filter: brightness(1.25); }
  50% { transform: scale(0.95) rotate(-1deg); filter: brightness(0.9); }
  75% { transform: scale(1.08) rotate(1deg); filter: brightness(1.15); }
}
.soulfire-box {
  background: rgba(217, 83, 79, 0.14);
  border: 1px solid rgba(217, 83, 79, 0.4);
  border-radius: 12px;
  padding: 1px 10px;
  font-size: 12px;
  color: #f0a0a0;
  white-space: nowrap;
}
/* 云端同步面板 */
.cloud-row {
  align-items: center;
  flex-wrap: wrap;
}
.cloud-status {
  font-size: 13px;
  color: var(--text-dim);
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg2);
}
.cloud-status.on {
  color: #8fd08a;
  border-color: rgba(120, 190, 120, 0.4);
  background: rgba(80, 160, 90, 0.1);
}
/* 魂火 +/- 按钮 */
.soulfire-btn {
  min-width: 26px;
  padding: 0 6px;
  line-height: 18px;
}

/* ---------- 阶段三：死亡检定 / 誓死一战 / 末日 ---------- */
/* 死亡检定弹窗 */
.death-check {
  text-align: center;
}
.death-name {
  font-size: 21px;
  font-weight: 700;
  color: #e05a5a;
  margin: 0 0 12px;
}
.death-bar {
  height: 18px;
  background: #232838;
  border: 1px solid #4a5162;
  border-radius: 10px;
  overflow: hidden;
  margin: 0 auto 6px;
  max-width: 420px;
}
.death-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #701212, #d33);
  transition: width 0.35s;
}
.death-progress {
  font-size: 14px;
  color: #f0b0b0;
  margin-bottom: 10px;
}
.death-check .hint {
  font-size: 12px;
  color: var(--text-dim);
}
/* 誓死一战按钮：红体加粗 */
.dc-fight,
button#dc-fight {
  font-weight: 900;
  color: #fff !important;
  background: #a00;
  border-color: #f55;
  text-shadow: 0 0 8px rgba(255, 80, 80, 0.8);
}
.dc-fight:hover,
button#dc-fight:hover {
  background: #d00;
}

/* 已死亡标记：斜体手写体、带边框、覆盖在角色卡所有数据之上 */
.dead-overlay {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 30;
  font-family: 'Segoe Print', 'Comic Sans MS', '楷体', 'KaiTi', cursive;
  font-style: italic;
  font-weight: 900;
  font-size: 20px;
  color: #fff;
  background: rgba(130, 0, 0, 0.88);
  border: 3px solid #ff5a5a;
  border-radius: 8px;
  padding: 2px 14px;
  transform: rotate(-8deg);
  box-shadow: 0 0 14px rgba(255, 60, 60, 0.75);
  letter-spacing: 2px;
  pointer-events: none;
}

/* 末日字段（地图工具栏，魂火旁） */
.doom-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.doom-icon {
  font-size: 17px;
}
.doom-box {
  background: rgba(120, 90, 40, 0.16);
  border-color: rgba(200, 160, 70, 0.45);
  color: #e8c070;
}

/* ---------- 阶段四五：地图要素下拉 / 武器特性 ---------- */
.map-elem-wrap {
  position: relative;
  display: inline-flex;
}
.map-elem-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 60;
  background: #20242f;
  border: 1px solid #3a4152;
  border-radius: 8px;
  padding: 6px;
  min-width: 158px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  flex-direction: column;
  gap: 2px;
}
.map-elem-menu.open {
  display: flex;
}
.map-elem-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: #e8e4d8;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.map-elem-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
.map-elem-item.active {
  background: rgba(198, 167, 92, 0.18);
  color: #e8d9a8;
  box-shadow: inset 0 0 0 1px rgba(198, 167, 92, 0.5);
}
.map-elem-remove {
  color: #f08080;
}

/* 当前画笔指示 */
.map-brush {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg2);
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
}

/* 危险地形数字调整 */
.map-elem-hazard {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hazard-num {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 90, 90, 0.12);
  border: 1px solid rgba(255, 90, 90, 0.35);
  border-radius: 8px;
  padding: 2px 6px;
}
.hazard-num b {
  min-width: 18px;
  text-align: center;
  color: #ffcaca;
  font-size: 14px;
}
.hazard-num-btn {
  min-width: 22px;
  padding: 0 5px;
  line-height: 18px;
}

/* 休息弹窗 */
.rest-chars {
  margin-top: 8px;
}
.rest-chars h5 {
  margin: 0 0 6px;
}
.rest-char {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 13px;
}

/* 武器特性勾选 */
.trait-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 4px;
}
.trait-pick {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ============================================================
 * 行动次序条：坚韧值简易条
 * 黄色为当前坚韧；单位带伤势表时，已失去的坚韧段以红色填充
 * ============================================================ */
.order-cell-hp {
  position: relative;
  display: block;
  width: 76px;
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 200, 90, 0.35);
}
.order-cell-hp-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 1;
  background: linear-gradient(180deg, #f5c95c, #d9a73a);
  transition: width 0.35s ease;
}
.order-cell-hp-hurt {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 0;
  background: linear-gradient(180deg, #d9534f, #8f2b28);
  transition: width 0.35s ease;
}
.order-cell-hp-text {
  position: relative;
  z-index: 2;
  display: block;
  text-align: center;
  font-size: 9px;
  line-height: 9px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}
.order-cell-hp-empty {
  border-color: rgba(140, 145, 170, 0.35);
}
.order-cell-hp-empty .order-cell-hp-text {
  color: var(--text-dim);
  text-shadow: none;
}
/* 伤势满（濒死）：红条轻微搏动 + 黑字“濒死” */
@keyframes hunfu-dying-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(217, 83, 79, 0); }
  50% { box-shadow: 0 0 9px rgba(217, 83, 79, 0.8); }
}
.order-cell-hp.dying {
  animation: hunfu-dying-pulse 1.8s ease-in-out infinite;
}
.order-cell-hp.dying .order-cell-hp-hurt {
  background: linear-gradient(180deg, #e05a55, #8f2b28);
}
.order-cell-hp.dying .order-cell-hp-text {
  color: #1a0e0e;
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: none;
  background: rgba(255, 240, 240, 0.62);
  border-radius: 4px;
}

/* ============================================================
 * 检定卡片：选项改为每项一行，并显示状态修正说明
 * ============================================================ */
.check-opts {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin-top: 8px;
}
.check-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  white-space: normal;
}
.check-opt.disabled {
  opacity: 0.5;
}
.check-opts.adv-opts {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.adv-label {
  width: auto;
}
.check-opt.adv {
  display: flex;
  width: 100%;
  border-radius: 8px;
  padding: 6px 10px;
}
.check-note {
  margin: 4px 0;
  padding: 6px 10px;
  border-left: 3px solid #d9a73a;
  background: rgba(217, 167, 58, 0.12);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: #f0dfae;
  white-space: normal;
}

/* 检定卡片：骰子数量微调（小箭头上下增减） */
.pool-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pool-adjust {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pool-adjust input[type="number"] {
  width: 54px;
  padding: 3px 4px;
  text-align: center;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.pool-adjust input[type="number"]::-webkit-outer-spin-button,
.pool-adjust input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.pool-arrows {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}
.pool-arrow {
  width: 22px;
  height: 14px;
  padding: 0;
  font-size: 9px;
  line-height: 12px;
  background: #2b3042;
  color: #cfd6e6;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}
.pool-arrow:hover {
  background: #38405a;
  color: #fff;
}
.pool-base {
  font-size: 12px;
  color: var(--text-dim);
}

/* ============================================================
 * 角色卡专长：按百科分类分组，卡片与百科同款
 * ============================================================ */
.talent-group {
  margin-bottom: 10px;
}
.talent-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 8px;
  padding-bottom: 4px;
  font-size: 13px;
  color: var(--gold-soft, #e8d9a8);
  border-bottom: 1px dashed var(--line);
}
.talent-group-title small {
  padding: 0 6px;
  border-radius: 8px;
  font-size: 11px;
  background: rgba(198, 167, 92, 0.16);
  color: var(--text-dim);
}
.talent-count {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
}
.talent-card {
  /* 与百科卡片一致：整体纵向排布（图标+名称一行，描述在下方），
   * 否则 .ency-card 的横向 flex 会把文字挤成竖排 */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  cursor: pointer;
}

/* ============================================================
 * 队伍光标（世界 / 冒险地图）
 * ============================================================ */
.side-entry.squad .side-entry-head {
  background: linear-gradient(90deg, rgba(255, 214, 102, 0.14), rgba(255, 214, 102, 0.02));
}
.squad-avatar {
  background: radial-gradient(circle at 35% 30%, #fff7d8, #ffc440);
  color: #3a2705;
  font-weight: 800;
}
.squad-mini {
  padding: 2px 10px 8px;
  font-size: 11px;
  color: var(--text-dim);
}
.squad-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.squad-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}
.squad-member {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.squad-member-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.squad-member-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.squad-member-name {
  flex: 1;
  font-size: 12px;
  color: var(--text);
}
.squad-member-type {
  font-size: 10px;
  color: var(--text-dim);
  background: var(--bg2);
  border-radius: 8px;
  padding: 1px 6px;
  white-space: nowrap;
}
.squad-member-del {
  width: 24px;
  height: 24px;
  padding: 0;
  font-weight: 800;
  background: #7a2b2b;
  border-color: #b04a4a;
  color: #ffd9d9;
  flex-shrink: 0;
}
.squad-pick-icon {
  width: 22px;
  height: 22px;
  margin-right: 6px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
}

/* ============================================================
 * 规则帷幕（KP / PC 快速查询）：五种颜色的信息框
 * ============================================================ */
.rs-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rs-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rs-tab {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.rs-tab:hover {
  color: var(--text);
  border-color: var(--line2);
}
.rs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  align-items: start;
}
.rs-card {
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.rs-card h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: 0.5px;
}
.rs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.rs-table th,
.rs-table td {
  padding: 5px 8px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.rs-table th {
  color: var(--text-dim);
  font-weight: 600;
}
.rs-table tr:last-child td {
  border-bottom: none;
}
.rs-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.75;
}
.rs-list li + li {
  margin-top: 3px;
}
.rs-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
}
/* 蓝=检定 红=战斗 紫=状态 绿=成长 橙=KP 专用 */
.rs-blue {
  border-left-color: #5c8bd6;
  background: linear-gradient(180deg, rgba(92, 139, 214, 0.12), rgba(92, 139, 214, 0.03));
}
.rs-blue h3 { color: #9dc0f0; }
.rs-red {
  border-left-color: #d9534f;
  background: linear-gradient(180deg, rgba(217, 83, 79, 0.12), rgba(217, 83, 79, 0.03));
}
.rs-red h3 { color: #f0a09b; }
.rs-purple {
  border-left-color: #9b6fd0;
  background: linear-gradient(180deg, rgba(155, 111, 208, 0.12), rgba(155, 111, 208, 0.03));
}
.rs-purple h3 { color: #c7aaf0; }
.rs-green {
  border-left-color: #6fae7a;
  background: linear-gradient(180deg, rgba(111, 174, 122, 0.12), rgba(111, 174, 122, 0.03));
}
.rs-green h3 { color: #a8ddb0; }
.rs-orange {
  border-left-color: #d9a73a;
  background: linear-gradient(180deg, rgba(217, 167, 58, 0.14), rgba(217, 167, 58, 0.03));
}
.rs-orange h3 { color: #f0d79a; }
.rs-tab.rs-blue.active { border-color: #5c8bd6; background: rgba(92, 139, 214, 0.22); color: #cfe1ff; }
.rs-tab.rs-red.active { border-color: #d9534f; background: rgba(217, 83, 79, 0.22); color: #ffd6d3; }
.rs-tab.rs-purple.active { border-color: #9b6fd0; background: rgba(155, 111, 208, 0.22); color: #e6d6ff; }
.rs-tab.rs-green.active { border-color: #6fae7a; background: rgba(111, 174, 122, 0.22); color: #d6f5db; }
.rs-tab.rs-orange.active { border-color: #d9a73a; background: rgba(217, 167, 58, 0.22); color: #ffeec4; }

@media (max-width: 700px) {
  .rs-grid {
    grid-template-columns: 1fr;
  }
}

/* 「调整效果」弹窗里的用途说明 */
.adjust-tip {
  margin: 0 0 10px;
  padding: 7px 10px;
  border-left: 3px solid var(--gold);
  background: rgba(201, 164, 92, 0.12);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--gold-soft);
  white-space: normal;
}

/* ============================================================
 * 心能 与 角色专属特殊规则
 * ============================================================ */
.mind-energy {
  margin-top: 10px;
}
.mind-energy h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--gold);
}
.mind-energy .wound-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.mind-energy-cap {
  font-size: 12px;
  color: var(--text-dim);
}
.special-rule {
  margin-top: 10px;
  padding: 8px 10px;
  border-left: 3px solid #9b6fd0;
  background: rgba(155, 111, 208, 0.12);
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #c7aaf0;
}
.mini-mind {
  font-size: 11px;
  color: #c7aaf0;
}

/* ============================================================
 * KP 工具箱 与 历史版本
 * ============================================================ */
.kp-archive-card {
  border-left: 4px solid var(--gold);
}
.kp-sync-row {
  margin-top: 8px;
}
.hist-head {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
}
.hist-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 60vh;
  overflow-y: auto;
}
.hist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel2);
  font-size: 12.5px;
}
.hist-row.current {
  border-color: var(--gold);
  background: rgba(201, 164, 92, 0.12);
}
.hist-tag {
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 11px;
  white-space: nowrap;
  background: rgba(92, 139, 214, 0.22);
  color: #cfe1ff;
}
.hist-tag.local {
  background: rgba(111, 174, 122, 0.22);
  color: #d6f5db;
}
.hist-time {
  white-space: nowrap;
  color: var(--text-dim);
}
.hist-cards {
  white-space: nowrap;
  color: var(--text);
}
.hist-names {
  flex: 1;
  min-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
}
.hist-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

/* ============================================================
 * 同步状态徽章（右下角）
 * 让玩家随时知道改动是否已保存到云端；点击可立即重试同步。
 * ============================================================ */
#hunfu-sync-badge {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 9000;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .28);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(6px);
  transition: opacity .2s, background .2s;
  opacity: .92;
}
#hunfu-sync-badge:hover { opacity: 1; }
#hunfu-sync-badge.hsb-ok   { background: rgba(32, 92, 58, .92); color: #c9f5d9; }
#hunfu-sync-badge.hsb-busy { background: rgba(40, 78, 128, .92); color: #cfe3ff; }
#hunfu-sync-badge.hsb-warn { background: rgba(112, 84, 20, .92); color: #ffe6ae; }
#hunfu-sync-badge.hsb-bad  { background: rgba(128, 36, 36, .92); color: #ffd5d5; }
#hunfu-sync-badge.hsb-off  { background: rgba(70, 70, 78, .92); color: #d6d6dc; }

/* 百科条目选择器里的描述摘要（加入前就能看清是什么） */
.pop-desc {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-dim);
  text-align: left;
  white-space: normal;
  opacity: .85;
}

/* 额外坚韧（如阿尔把心能上限并入后多出来的那部分）单独显示在条下方 */
.mini-hp-extra {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-dim);
  opacity: .85;
  margin: -2px 0 4px;
}

/* 怪物数值左右箭头（加了怪就能直接在右侧调） */
.mon-step-row .mon-step-v { display: inline-flex; align-items: center; gap: 6px; }
.mon-step { padding: 0 5px !important; line-height: 1.5; opacity: .8; }
.mon-step:hover { opacity: 1; }

/* ---------- 队伍栏位 ---------- */
.team-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.team-tab small { margin-left: 4px; opacity: .7; }
.team-detail { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.team-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.team-name { flex: 1; font-size: 18px; font-weight: 600; background: transparent; border: 1px solid transparent; color: var(--text); padding: 4px 6px; border-radius: 6px; }
.team-name:hover, .team-name:focus { border-color: var(--line); background: var(--bg); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.team-field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-dim); }
.team-field input, .team-field select { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 5px 7px; font-size: 13px; }
.team-detail h4 { margin: 14px 0 6px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.team-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 7px; background: var(--bg); margin-bottom: 4px; font-size: 13px; }
.team-sub { font-size: 11px; color: var(--text-dim); }
.team-tag { font-size: 10px; padding: 1px 6px; border-radius: 999px; background: rgba(198,167,92,.18); color: var(--gold-soft); }
.team-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.team-chip { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.team-chip i { margin-left: 6px; cursor: pointer; opacity: .6; }
.team-chip i:hover { opacity: 1; color: var(--danger); }
.team-transfer { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.team-transfer select, .team-transfer input { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 4px 6px; }
.team-picker input { width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 6px 8px; margin-bottom: 8px; }
.team-pick-list { max-height: 340px; overflow: auto; display: flex; flex-direction: column; gap: 3px; }

/* 队伍页排版 */
.team-card { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.team-metrics { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 4px; }
.team-metric { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); }
.team-metric.bad span:first-child { color: var(--danger); }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper input { width: 62px; text-align: center; font-size: 15px; font-weight: 600; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 4px 2px; }
.stepper input:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 2px rgba(198,167,92,.15); }
.team-field input:hover, .team-field select:hover { border-color: var(--gold); }

/* 队伍成员头像 */
.team-face { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; background: var(--bg2); }
.team-face-none { background: rgba(74,144,217,.55); }
.team-pick-row { display: flex; align-items: center; gap: 8px; justify-content: flex-start; }
.team-tag.npc { background: rgba(120,160,120,.2); color: #9dc79d; }

/* 队伍物品栏：百科式格子 */
.team-item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.team-item-card { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 9px; display: flex; flex-direction: column; gap: 3px; min-height: 82px; }
.team-item-card:hover { border-color: var(--gold); }
.tic-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tic-qty { font-size: 11px; color: var(--gold-soft); }
.tic-desc { font-size: 11px; line-height: 1.4; color: var(--text-dim); flex: 1; overflow: hidden; }
.tic-ops { display: flex; gap: 4px; margin-top: 2px; }

/* 队伍成员：拖动与跳转 */
.team-member { cursor: default; }
.team-member.dragging { opacity: .45; }
.team-member.drag-over { border-top: 2px solid var(--gold); }
.drag-handle { cursor: grab; color: var(--text-dim); font-size: 14px; padding: 0 2px; user-select: none; }
.drag-handle:active { cursor: grabbing; }
.team-member-open { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border-radius: 6px; padding: 2px 4px; }
.team-member-open:hover { background: var(--bg2); }
.team-member-open:hover b { color: var(--gold-soft); }

/* 左侧导航：拖动排序 */
.nav-grip { font-size: 10px; color: var(--text-dim); opacity: .35; margin-right: 2px; letter-spacing: -2px; cursor: grab; }
.nav-item:hover .nav-grip { opacity: .9; }
.nav-item.nav-dragging { opacity: .45; }
.nav-item.nav-over { box-shadow: inset 0 2px 0 var(--gold); }

/* 物品详情弹窗 */
.item-editor .ie-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 15px; }
.item-editor .ie-enc { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; font-size: 12px; line-height: 1.6; }
.item-editor textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px; font-size: 13px; font-family: inherit; resize: vertical; }
.tic-open { cursor: pointer; display: block; }
.tic-open:hover .tic-name { color: var(--gold-soft); }
.tic-own { color: var(--gold-soft); }
.tic-hint { font-size: 10px; color: var(--text-dim); opacity: 0; margin-top: 2px; }
.team-item-card:hover .tic-hint { opacity: .8; }

/* 队伍状态：一条一行 */
.team-status-list { display: flex; flex-direction: column; gap: 4px; }
.team-status-row { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.team-status-row .tsr-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex: 0 0 6px; }
.team-status-row .tsr-text { flex: 1; }

/* 队伍补给槽（黄色） */
.supply-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.supply-box { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line); background: var(--bg); display: inline-block; }
.supply-box.on { background: #e8c04a; border-color: #f0d676; box-shadow: 0 0 6px rgba(232,192,74,.45); }
.supply-ops { display: inline-flex; gap: 4px; margin-left: 8px; }

/* 添加冒险者：两级选择（角色卡 / NPC→分类→格子） */
.pick-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.pick-tab { flex: 1; padding: 7px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text-dim); font-size: 13px; cursor: pointer; }
.pick-tab.active { border-color: var(--gold); color: var(--gold-soft); background: rgba(198,167,92,.12); }
.pick-list { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow: auto; }
.pick-groups { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pick-group { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text-dim); font-size: 12px; cursor: pointer; }
.pick-group small { margin-left: 5px; opacity: .7; }
.pick-group.active { border-color: var(--gold); color: var(--gold-soft); background: rgba(198,167,92,.12); }
.pick-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; max-height: 360px; overflow: auto; }
.pick-tile { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 9px 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.pick-tile:hover { border-color: var(--gold); background: var(--bg2); }
.pick-tile .team-face { width: 42px; height: 42px; flex: 0 0 42px; font-size: 16px; }
.pt-name { font-size: 12px; color: var(--text); text-align: center; line-height: 1.3; }
.pt-sub { font-size: 10px; color: var(--text-dim); text-align: center; }


/* 放置单位：数量输入行 */
.mp-qty-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.mp-qty-row > span:first-child { font-size: 13px; color: var(--text); }
.mp-qty-row input { width: 72px; background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 4px 8px; font-size: 14px; text-align: center; }
.mp-qty-row .hint { font-size: 11px; color: var(--text-dim); }


/* 侧边栏：临时属性面板（属性/战斗能力/技能） */
.side-temp h6 { margin: 8px 0 4px; font-size: 12px; color: var(--text-dim); font-weight: 600; }
.side-temp .temp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 4px; }
.side-temp .temp-grid label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--text-dim); }
.side-temp .temp-grid input { width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 3px 5px; font-size: 13px; text-align: center; }
.side-temp .temp-skill { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 6px; align-items: end; }
.side-temp .temp-skill select { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 4px 6px; font-size: 12px; }
.side-temp .temp-skill label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--text-dim); }
.side-temp .temp-skill input { width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 3px 5px; font-size: 13px; text-align: center; }
.temp-badge { font-size: 10px; color: #1a1a1a; background: var(--gold); border-radius: 999px; padding: 1px 6px; margin-left: 4px; }
