/* 跑团 · 白色主题 */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --line: #e8eaed;
  --line2: #d9dde3;
  --txt: #1a1a1a;
  --sub: #6b7280;
  --dim: #9ca3af;
  --pri: #2563eb;
  --pri-d: #1d4ed8;
  --ok: #059669;
  --bad: #dc2626;
  --warn: #b45309;
}

body {
  background: var(--bg);
  color: var(--txt);
  font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  /* 全站 emoji 字体降级：常见 Unicode 符号（★/♂/♥/♦ 等）在不同 OS 字体下可能被画成彩色
     emoji，加上 text 让浏览器退回到普通字符字形（避免彩色 logo 抢视觉）。
     不影响我们主动用 js/icons.js 渲染的 SVG 图标。 */
  font-variant-emoji: text;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 20px;
  border: 1px solid transparent; border-radius: 9px;
  font: inherit; font-weight: 600; cursor: pointer;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.btn-pri { background: var(--pri); color: #fff; }
.btn-pri:hover { background: var(--pri-d); }
.btn-sec { background: #fff; color: #374151; border-color: var(--line2); }
.btn-sec:hover { background: #f3f4f6; }
.btn-ghost { background: transparent; color: var(--sub); border-color: var(--line); }
.btn-ghost:hover { background: #f3f4f6; }
.btn-danger { background: #fff; color: var(--bad); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-danger-soft { background: #fef2f2; color: #dc2626; border-color: #fca5a5; }
.btn-danger-soft:hover { background: #fee2e2; }
.btn.sm { height: 30px; padding: 0 13px; font-size: 13px; border-radius: 7px; }
.btn.lg { height: 44px; padding: 0 32px; font-size: 15px; }

/* ---------- 登录 ---------- */
.login-bar { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-box { text-align: center; }
.logo { font-size: 40px; font-weight: 700; letter-spacing: 3px; margin-bottom: 28px; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; gap: 32px;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 0 28px; height: 58px;
  position: sticky; top: 0; z-index: 20;
}
.brand { font-size: 19px; font-weight: 700; cursor: pointer; letter-spacing: 1px; }

.nav { display: flex; gap: 4px; flex: 1; }
.nav-item {
  padding: 7px 16px; border-radius: 8px;
  color: var(--sub); cursor: pointer; font-size: 14px;
}
.nav-item:hover { background: #f3f4f6; }
.nav-item.on { background: #eff6ff; color: var(--pri); font-weight: 600; }

.who { display: flex; align-items: center; gap: 12px; color: var(--sub); font-size: 13px; }

/* ---------- 布局 ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 26px 24px 40px; }

.bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.bar h1 { font-size: 22px; font-weight: 700; }
.bar .acts { display: flex; gap: 10px; }

/* ---------- 列表项 ---------- */
.item {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 15px 18px; margin-bottom: 10px;
  cursor: pointer; transition: border-color .12s, box-shadow .12s;
}
.item:hover { border-color: #c7d2fe; box-shadow: 0 2px 10px rgba(16,24,40,.05); }

.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: #eef2ff; color: #4f46e5;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; flex-shrink: 0;
}
.avatar.lg { width: 64px; height: 64px; font-size: 24px; }
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }

.item-body { flex: 1; min-width: 0; }
.item-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.item-sub { font-size: 12.5px; color: var(--dim); margin-top: 3px; }
.item-arrow { color: #d1d5db; font-size: 20px; }

.tag {
  display: inline-block; font-size: 11px; padding: 1px 8px;
  border-radius: 99px; font-weight: 500;
}
.tag.dnd { background: #eff6ff; color: #2563eb; }
.tag.coc { background: #fef3c7; color: #b45309; }
.tag.dm { background: #fee2e2; color: #dc2626; }
.tag.player { background: #ecfdf5; color: #059669; }

.badge-dm { display: inline-block; font-size: 10.5px; padding: 2px 7px; border-radius: 99px; font-weight: 600; background: #fee2e2; color: #b91c1c; }
.badge-player { display: inline-block; font-size: 10.5px; padding: 2px 7px; border-radius: 99px; font-weight: 600; background: #dbeafe; color: #1d4ed8; }

/* ---------- 房间方块卡片网格（4 列） ---------- */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 768px) { .rooms-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 480px) { .rooms-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.room-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 12px 14px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: border-color .18s, box-shadow .22s ease, transform .22s ease;
  text-align: center;
  min-width: 0;
  box-shadow: 0 1px 3px rgba(16,24,40,.04), 0 1px 2px rgba(16,24,40,.06);
}
.room-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 8px 24px rgba(99,102,241,.18), 0 2px 8px rgba(16,24,40,.08);
  transform: translateY(-3px);
}
.room-card:active { transform: translateY(-1px); }
.room-card-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #818cf8, #c084fc);
  color: #fff; font-size: 22px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(129,140,248,.3);
  flex-shrink: 0;
}
.room-card-name {
  font-size: 14px; font-weight: 600; color: #1f2937;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.room-card-tags {
  display: flex; gap: 4px; justify-content: center; flex-wrap: wrap;
  min-height: 22px; align-items: center;
}
.room-card-footer {
  font-size: 12px; color: var(--dim);
  display: flex; align-items: center; gap: 6px;
  font-variant-numeric: tabular-nums;
}
.room-card-footer .dot { color: #d1d5db; }
.room-card-footer b { color: #4b5563; font-weight: 600; }

.dim { color: var(--dim); font-size: 12.5px; }
.pad { padding: 12px 0; }

.empty { text-align: center; padding: 70px 20px; color: var(--dim); }
.empty-title { font-size: 16px; color: var(--sub); margin-bottom: 6px; }

/* ---------- 房间 ---------- */
.view#view-room { display: flex; flex-direction: column; height: calc(100vh - 58px - 66px); position: relative; }

/* 进入房间加载遮罩（全透明背景） */
.room-loading {
  position: absolute; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: transparent;
  transition: opacity .25s ease;
}
.view-room-blur .room-head,
.view-room-blur .card-strip,
.view-room-blur .chat-wrap {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
  transition: filter .25s ease;
}
.loading-gif {
  width: 150px; height: 150px;
  margin-bottom: 18px;
  object-fit: contain;
  background: transparent;
  image-rendering: auto;
}
.loading-text {
  font-size: 15px; font-weight: 600; color: var(--txt);
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}
.loading-bar {
  width: 180px; height: 6px; margin: 16px 0 8px;
  background: rgba(0,0,0,0.08); border-radius: 3px; overflow: hidden;
}
.loading-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #60a5fa, var(--pri));
  border-radius: 3px;
  transition: width .18s linear;
}
.loading-percent {
  font-size: 13px; font-weight: 700; color: var(--pri);
  font-variant-numeric: tabular-nums;
}

.room-head {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 12px;
}
.rh-main { flex: 1; min-width: 0; }
.rh-name { font-size: 17px; font-weight: 600; }
.rh-meta { font-size: 12.5px; color: var(--dim); margin-top: 2px; cursor: pointer; }
.rh-meta:hover { color: var(--pri); }
.rh-meta b { color: var(--pri); font-weight: 700; letter-spacing: 1px; }
.rh-acts { display: flex; gap: 7px; align-items: center; }

.card-strip {
  display: flex; gap: 10px; overflow-x: auto;
  padding-bottom: 8px; margin-bottom: 10px;
}
.card-strip:empty { display: none; }
.card-chip {
  display: flex; align-items: center; gap: 9px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 13px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.card-chip:hover { border-color: #c7d2fe; }
.card-chip-avatar {
  width: 30px; height: 30px; border-radius: 8px;
  background: #eef2ff; color: #4f46e5;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.card-chip-name { font-size: 13px; font-weight: 600; }
.card-chip-stat { font-size: 11px; color: var(--dim); }

/* ---------- 聊天 ---------- */
.chat-wrap {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden;
}
.occ-credit-hint { font-size: 12px; color: var(--dim); margin-top: 4px; }
.ss-sub { display: block; font-size: 11px; font-weight: 400; color: var(--dim); margin-top: 2px; }
.ss-row2 { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--dim); }
.ss-row2 b { color: var(--fg); font-weight: 600; }

/* 可搜索下拉（需求3） */
.ss { position: relative; }
.ss-in { cursor: pointer; background: #fff; }
.ss-panel { position: absolute; z-index: 60; top: 100%; left: 0; right: 0; margin-top: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(15,23,42,.12); padding: 8px; }
.ss-filter { width: 100%; margin-bottom: 6px; }
.ss-list { max-height: 220px; overflow-y: auto; }
.ss-opt { padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.ss-opt:hover { background: var(--bg-soft, #f1f5f9); }
.ss-opt.on { background: rgba(99,102,241,.12); color: var(--accent, #6366f1); font-weight: 600; }

/* 时代冲突红字（需求5） */
.occ-era-err { color: #dd2233; font-size: 12px; margin-top: 4px; font-weight: 600; }

/* 随身物品多行（需求8） */
.item-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.item-row { display: flex; gap: 6px; align-items: center; }
.item-row .item-input { flex: 1; }
.item-del { border: none; background: none; color: var(--dim); cursor: pointer; font-size: 15px; padding: 2px 6px; border-radius: 6px; }
.item-del:hover { color: #dd2233; background: rgba(221,34,51,.08); }

/* 随身武器多选+详情（需求9） */
.w-filter { width: 100%; margin-bottom: 6px; }
.w-pick { max-height: 180px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 10px; }
.w-opt { font-size: 12.5px; padding: 2px 0; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-detail { margin-top: 8px; overflow-x: auto; }
.w-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.w-table th, .w-table td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; white-space: nowrap; }
.w-table th { background: var(--bg-soft, #f8fafc); font-weight: 600; }
.msg-list { flex: 1; overflow-y: auto; padding: 18px 20px; }

.msg-system { text-align: center; color: var(--dim); font-size: 12px; padding: 7px 0; }

.msg-roll { display: flex; flex-direction: column; align-items: center; margin-bottom: 14px; }
.msg-roll .roll-head { color: var(--accent, #6366f1); font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.actor-name { color: #2f6fed; font-weight: 600; }
.msg-roll .roll-narrative { color: var(--text); font-size: 13px; margin: 2px 0 6px; text-align: center; }
.msg-roll .dice-card { width: auto; max-width: 520px; margin: 0 auto; }
.msg-roll.gm .roll-head { color: var(--warn, #b8860b); }

.msg-row { display: flex; gap: 10px; margin-bottom: 16px; align-items: flex-start; }
.msg-row.mine { flex-direction: row-reverse; }
.msg-main { max-width: 72%; min-width: 0; }
.msg-name { font-size: 11.5px; color: #2f6fed; font-weight: 600; margin-bottom: 4px; }
.msg-row.mine .msg-name { text-align: right; }

.bubble {
  background: #fff; border: 1px solid var(--line);
  border-radius: 3px 13px 13px 13px;
  padding: 9px 14px; word-break: break-word;
}
.msg-row.mine .bubble {
  background: #fff; border-color: var(--line); color: var(--txt);
  border-radius: 13px 3px 13px 13px;
}
.msg-time { font-size: 10.5px; color: #d1d5db; margin-top: 3px; }
.msg-row.mine .msg-time { text-align: right; }
.msg-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.msg-row.mine .msg-meta { justify-content: flex-end; }
.msg-row:not(.mine) .msg-meta { justify-content: flex-start; }
.msg-recall {
  font-size: 10.5px;
  color: var(--pri, #2f6fed);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease;
}
.msg-row:hover .msg-recall { opacity: 1; }
.msg-recall:hover { text-decoration: underline; }

/* ---------- 表情面板 ---------- */
.emoji-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.emoji-btn:hover { background: #f3f4f6; }
.emoji-btn.on { background: #eff6ff; border-color: var(--pri); }
.emoji-panel {
  position: absolute;
  bottom: 70px; left: 52px;
  width: 320px; max-height: 340px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  z-index: 60;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.emoji-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.emoji-tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 13px; font-weight: 600;
  color: var(--dim);
  cursor: pointer;
}
.emoji-tab.on { color: var(--pri); border-bottom: 2px solid var(--pri); }
.emoji-body { padding: 10px; overflow: hidden; }
.emoji-page.default {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));  /* minmax(0,1fr) 防止亚像素横向溢出 */
  gap: 6px;
  max-height: 240px;        /* 固定高度：约可展示 6 行默认表情，超出纵向滚动 */
  overflow-y: auto;
  overflow-x: hidden;       /* 仅纵向滚动：显式禁用横向，避免 overflow-y:auto 隐式放开横向 */
}
.emoji-item {
  width: 100%; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  border-radius: 8px;
  cursor: pointer;
  background: #f9fafb;
}
.emoji-item img { width: 28px; height: 28px; object-fit: contain; }
.emoji-item:hover { background: #eef2ff; }
.emoji-btn-img { width: 22px; height: 22px; object-fit: contain; border-radius: 50%; }
.add-img-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-size: 22px; font-weight: 700; color: var(--pri);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.add-img-btn:hover { background: #eff6ff; }
.chat-img { max-width: 220px; max-height: 260px; border-radius: 10px; display: block; cursor: zoom-in; }
.msg-recalled {
  text-align: center; color: var(--dim);
  font-size: 12px; padding: 6px 0;
}
.msg-recalled .recalled-by { color: #2f6fed; font-weight: 600; }
.emoji-page.custom {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 240px; overflow-y: auto; overflow-x: hidden;
}
.custom-empty {
  font-size: 12px; color: var(--dim);
  text-align: center; padding: 12px 0;
}
.custom-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.custom-emoji {
  position: relative;
  width: 56px; height: 56px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9fafb;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  overflow: hidden;
}
.custom-emoji img {
  width: 86%; height: 86%;
  object-fit: contain;
}
.custom-emoji .del {
  position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(0,0,0,.5); color: #fff;
  font-size: 11px; line-height: 16px;
  text-align: center;
  cursor: pointer; opacity: 0; transition: opacity .15s;
}
.custom-emoji:hover .del { opacity: 1; }
#btn-add-custom-emoji { align-self: center; }
.bubble .emoji-img { max-width: 120px; max-height: 120px; border-radius: 8px; display: block; }

/* ---------- 回复 ---------- */
.reply-bar {
  display: flex; align-items: center; gap: 10px;
  margin: 0 12px 8px; padding: 8px 12px;
  background: #f3f4f6; border-radius: 10px;
  border: 1px solid var(--line);
}
.reply-line {
  width: 3px; height: 28px;
  background: var(--pri); border-radius: 2px; flex-shrink: 0;
}
.reply-body { flex: 1; min-width: 0; }
.reply-label {
  font-size: 11px; color: var(--pri); font-weight: 600;
}
.reply-preview {
  font-size: 12px; color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reply-clear {
  width: 22px; height: 22px;
  border: none; border-radius: 50%;
  background: #d1d5db; color: #fff; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.reply-clear:hover { background: #9ca3af; }
.msg-reply {
  font-size: 10.5px;
  color: var(--pri, #2f6fed);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease;
}
.msg-row:hover .msg-reply { opacity: 1; }
.msg-reply:hover { text-decoration: underline; }
.reply-ref {
  font-size: 12px; color: var(--dim);
  background: #f3f4f6;
  padding: 4px 10px; border-radius: 6px;
  margin-bottom: 6px;
  border-left: 3px solid var(--pri);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- 骰子 ---------- */
.dice-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 3px 13px 13px 13px;
  padding: 11px 14px; min-width: 190px;
}
.dice-expr { font-size: 14px; color: var(--sub); }
.dice-expr .tot { font-size: 22px; font-weight: 700; color: var(--pri); margin-left: 4px; }

.dice-breaks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.die {
  font-size: 11.5px; background: #eff6ff; color: #2563eb;
  padding: 2px 8px; border-radius: 5px; min-width: 26px; text-align: center;
}
.die-drop {
  background: #f3f4f6; color: #d1d5db; text-decoration: line-through;
}

.dice-tags { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.dtag { font-size: 10.5px; color: var(--warn); background: #fef3c7; padding: 2px 7px; border-radius: 4px; }
.dtag-exp { color: #7c3aed; background: #f3e8ff; }

.dice-extra { font-size: 12px; color: var(--sub); margin-top: 6px; }
.dice-extra b { color: var(--pri); }

.verdict { font-size: 13.5px; font-weight: 600; margin-top: 8px; }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--bad); }
.v-s { font-size: 11.5px; color: var(--dim); font-weight: 400; margin-left: 5px; }

.dice-who { font-size: 11px; color: var(--dim); margin-top: 7px; }

/* ---------- 输入区 ---------- */
.composer { border-top: 1px solid var(--line); flex-shrink: 0; }

.builder-box {
  display: none; padding: 14px 18px;
  border-bottom: 1px solid var(--line); background: #fafbfc;
  max-height: 44vh; overflow-y: auto;
}
.builder-box.open { display: block; }

.b-row { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.b-label { font-size: 12px; color: var(--dim); width: 62px; flex-shrink: 0; }
.b-d { color: var(--dim); }
.b-num {
  width: 78px; height: 32px;
  background: #fff; border: 1px solid var(--line2); border-radius: 8px;
  text-align: center; font: inherit; font-size: 13px; color: var(--txt);
}
.b-num:focus { outline: none; border-color: var(--pri); }

.dchips { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.dchip {
  padding: 5px 11px; border-radius: 7px;
  background: #fff; border: 1px solid var(--line); color: #374151;
  font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.dchip:hover { border-color: var(--pri); color: var(--pri); }
.dchip.on { background: #eff6ff; border-color: var(--pri); color: var(--pri); font-weight: 600; }
.dchip.mine { background: #eff6ff; border-color: #bfdbfe; color: var(--pri); }
.dchips .dim { align-self: center; }

.b-result {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0 4px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line2);
}
.b-expr { font-size: 20px; font-weight: 700; color: var(--pri); }
.b-acts { display: flex; gap: 8px; }

.mine-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 9px; }

.comp-row { display: flex; align-items: center; gap: 10px; padding: 12px 18px; }
.dice-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: #f3f4f6; border: none; cursor: pointer;
  flex-shrink: 0; padding: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.dice-btn:hover { background: #eff6ff; }
.dice-btn img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* 欣姐 2026-10-19：隐藏输入行骰子构建器按钮——代码与 onclick 绑定保留，仅隐藏 UI */
#btn-dice-toggle { display: none !important; }
#in-draft {
  flex: 1; height: 38px;
  background: #f9fafb; border: 1px solid var(--line); border-radius: 99px;
  padding: 0 18px; font: inherit; color: var(--txt);
}
#in-draft:focus { outline: none; border-color: var(--pri); background: #fff; }
.roll-hint {
  padding: 7px 18px; font-size: 12px; color: var(--pri);
  background: #eff6ff; border-top: 1px solid #dbeafe;
}

/* 房间笔记 */
.note-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #f3f4f6; border: none; cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
  padding: 0;
  overflow: hidden;
}
.note-btn:hover { background: #eff6ff; }
.note-btn.on { background: #eff6ff; box-shadow: 0 0 0 2px #bfdbfe inset; }
.note-img {
  width: 26px; height: 26px;
  object-fit: contain;
}
.note-box {
  border-top: 1px solid var(--line);
  background: #fafbfc;
  padding: 12px 18px 16px;
}
.note-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--dim); margin-bottom: 8px;
}
.note-saved { font-size: 12px; color: #047857; }
.note-area {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  font: inherit; font-size: 13.5px; color: var(--txt);
  line-height: 1.6;
  box-sizing: border-box;
}
.note-area:focus { outline: none; border-color: var(--pri); }

/* ---------- 我的 ---------- */
.me-card {
  display: flex; align-items: center; gap: 18px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 24px; margin-bottom: 14px;
}
.me-info { display: flex; flex-direction: column; gap: 9px; align-items: flex-start; }
.me-nick { font-size: 19px; font-weight: 600; }

.me-list {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.me-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px; border-bottom: 1px solid #f3f4f6; font-size: 14px;
}
.me-item:last-child { border-bottom: none; }

/* ---------- 弹层 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.4);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.mask.show { display: flex; }

.sheet {
  background: #ffffff; border-radius: 16px; padding: 24px;
  width: 720px;
  max-width: calc(100vw - 32px);
  max-height: 92vh; overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0,0,0,.22);
  box-sizing: border-box;
  display: flex; flex-direction: column;
}
.sheet.sm { max-width: 400px; }
.sheet-title { font-size: 18px; font-weight: 600; margin-bottom: 20px; text-align: center; }
.sheet-title.sm { font-size: 15px; margin: 22px 0 12px; text-align: left; }
.sheet-btns { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.sheet-btns .btn { flex: 1; }

.f { margin-bottom: 16px; }
.f label { display: block; font-size: 12.5px; color: var(--sub); margin-bottom: 6px; }
.f input, .f textarea {
  width: 100%; padding: 9px 12px;
  background: #fff; border: 1px solid var(--line2); border-radius: 9px;
  font: inherit; color: var(--txt);
}
.f input { height: 38px; }
.f textarea { min-height: 76px; resize: vertical; }
.f input:focus, .f textarea:focus { outline: none; border-color: var(--pri); }

.sys-row { display: flex; gap: 10px; }
.sys-opt {
  flex: 1; height: 38px; line-height: 38px; text-align: center;
  border: 1px solid var(--line2); border-radius: 9px;
  cursor: pointer; font-size: 13.5px; color: #374151;
}
.sys-opt.on { border-color: var(--pri); background: #eff6ff; color: var(--pri); font-weight: 600; }

/* ── 成员弹窗 ──────────────────────────────────────────────── */
.mp-section {
  font-size: 14px; font-weight: 700; color: #374151;
  margin: 18px 0 10px; padding-bottom: 6px;
  border-bottom: 2px solid #e5e7eb;
}
.mp-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; margin-bottom: 8px;
  background: #f7f8fa; border: 1px solid #e5e7eb; border-radius: 10px;
}
.mp-row:last-child { margin-bottom: 0; }
.mp-row.mp-card { cursor: pointer; }
.mp-row.mp-card:hover { background: #eef2f7; border-color: #dde3ec; }
.mp-av { width: 42px; height: 42px; flex-shrink: 0; }
.mp-info { flex: 1; min-width: 0; }
.mp-name { font-size: 15px; font-weight: 600; color: #1a1a1a; line-height: 1.4; word-break: break-all; }
.mp-sub  { font-size: 12.5px; color: #6b7280; margin-top: 3px; }
.mp-badge {
  display: inline-block; font-size: 11px; padding: 2px 8px;
  border-radius: 99px; font-weight: 500; margin-left: 6px;
  vertical-align: middle;
}
.mp-badge.dm     { background: #fee2e2; color: #dc2626; }
.mp-badge.creator{ background: #ede9fe; color: #6d28d9; }
.mp-badge.player { background: #ecfdf5; color: #059669; }
.mp-badge.me     { background: #dbeafe; color: #2563eb; }
.mp-setdm { flex-shrink: 0; }
.mp-empty {
  color: #6b7280; font-size: 13px;
  padding: 14px; text-align: center;
  background: #f9fafb; border-radius: 10px;
}
.mp-hint {
  color: #6b7280; font-size: 12.5px; line-height: 1.6;
  padding: 10px 12px; margin-bottom: 10px;
  background: #eef2ff; border-left: 3px solid #818cf8;
  border-radius: 0 8px 8px 0;
}

/* 角色卡字段 */
#card-fields { max-height: calc(100vh - 220px); overflow-y: auto; padding-right: 4px; }
#card-fields .f { margin-bottom: 13px; }
#card-fields .f label { font-size: 12px; }

/* 角色卡：派生面板与技能列表 */
.derived-title { font-size: 13px; font-weight: 700; color: #1f2937; margin: 18px 0 10px; padding-left: 8px; border-left: 3px solid var(--pri); }

/* 角色卡：分段块 */
.card-section {
  background: #fff; border: 1px solid var(--line);
  border-radius: 11px; margin-bottom: 14px; overflow: hidden;
}
.card-section-h {
  background: #f4f6fa; color: var(--pri);
  font-size: 13px; font-weight: 700;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center;
}
.card-section-h::before {
  content: ''; display: inline-block;
  width: 3px; height: 14px; background: var(--pri);
  margin-right: 8px; border-radius: 2px;
}
.card-section-b { padding: 14px; }
.card-section-b .f { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed #eef0f3; }
.card-section-b .f:last-child { border-bottom: none; }
.card-section-b .f label { font-size: 12.5px; color: var(--txt); flex-shrink: 0; min-width: 92px; }
.card-section-b .f input,
.card-section-b .f select,
.card-section-b .f textarea {
  flex: 1; min-width: 0; height: 30px; padding: 4px 9px;
  border: 1px solid var(--line2); border-radius: 7px;
  font: inherit; background: #fff; text-align: right;
}
.card-section-b .f textarea { height: auto; min-height: 60px; text-align: left; }
.card-section-b .attr-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px 14px;
}
.card-section-b .attr-grid .f { display: flex; flex-direction: column; align-items: stretch; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.card-section-b .attr-grid .f label { font-size: 11px; color: var(--dim); min-width: 0; }
.card-section-b .attr-grid .f input { width: 100%; text-align: center; }

.skill-list { background: #f9fafb; border: 1px solid var(--line); border-radius: 9px; padding: 4px 12px; max-height: 36vh; overflow-y: auto; }
.skill-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid #eef0f3; }
.skill-row:last-child { border-bottom: none; }
.skill-k { flex: 1; min-width: 0; font-size: 12.5px; color: var(--txt); }
.skill-k input[type=checkbox] { margin-right: 6px; }
.skill-v { width: 64px; height: 28px; padding: 0 6px; border: 1px solid var(--line2); border-radius: 6px; font: inherit; text-align: right; }
.skill-d { font-size: 11.5px; color: var(--sub); min-width: 78px; text-align: right; }

.dm-banner {
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 9px; padding: 10px 14px;
  font-size: 12.5px; color: var(--bad); margin-bottom: 16px;
}

.stats {
  display: flex; background: #f9fafb; border: 1px solid var(--line);
  border-radius: 11px; padding: 14px 0;
}
.stat { flex: 1; text-align: center; border-right: 1px solid var(--line); }
.stat:last-child { border-right: none; }
.s-k { font-size: 11.5px; color: var(--dim); }
.s-v { font-size: 18px; font-weight: 600; margin-top: 3px; }

.dfields { padding: 6px 4px; }
.df { padding: 9px 0; border-bottom: 1px solid #f3f4f6; }
.df:last-child { border-bottom: none; }
.df-k { display: block; font-size: 11.5px; color: var(--dim); margin-bottom: 3px; }
.df-v { font-size: 13.5px; white-space: pre-wrap; }

.help-g {
  font-size: 12px; color: var(--dim);
  padding-bottom: 6px; margin: 18px 0 8px; border-bottom: 1px solid var(--line);
}
.help-g:first-of-type { margin-top: 0; }
.help-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; border-bottom: 1px solid #f8f8f8; cursor: pointer;
}
.help-row:hover { background: #f9fafb; }
.help-t { font-size: 13.5px; color: var(--pri); font-weight: 600; flex-shrink: 0; }
.help-d { font-size: 12.5px; color: var(--sub); flex: 1; text-align: right; margin-left: 16px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: #1f2430; color: #fff; padding: 11px 22px; border-radius: 10px;
  font-size: 13.5px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 200; max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- ? 圆圈问号 + 气泡 ---------- */
.qmark {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--pri); color: #fff;
  border: none; cursor: help; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 12px/1 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  transition: background .12s, transform .12s;
  flex-shrink: 0; margin-left: 4px;
  -webkit-tap-highlight-color: transparent;
}
.qmark:hover, .qmark.show { background: var(--pri-d); transform: scale(1.08); }

.tip-bubble {
  position: fixed; z-index: 250;
  display: none; max-width: 280px;
  background: #1f2430; color: #fff;
  font-size: 12.5px; line-height: 1.55;
  padding: 10px 13px; border-radius: 9px;
  white-space: pre-wrap; word-break: break-word;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  pointer-events: auto;
}
.tip-bubble.show { display: block; }
.toast.err { background: var(--bad); }

@media (max-width: 720px) {
  .topbar { gap: 14px; padding: 0 16px; }
  .wrap { padding: 18px 14px 30px; }
  .msg-main { max-width: 82%; }
  .sheet { padding: 22px 18px; }
}
/* ── 骰子指令说明页 ──────────────────────────────── */
.help-intro {
  font-size: 13px;
  color: #6b7280;
  background: #f6f8fc;
  border: 1px solid #e6ebf5;
  border-radius: 10px;
  padding: 10px 13px;
  margin-bottom: 16px;
  line-height: 1.6;
}
.doc-group { margin-bottom: 22px; }
.doc-h {
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 10px;
  padding-left: 9px;
  border-left: 3px solid #2563eb;
}
.doc-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #f0f1f3;
}
.doc-row:last-child { border-bottom: none; }
.doc-cmd {
  flex: 0 0 132px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: #b91c1c;
  background: #fff5f5;
  border: 1px solid #fde2e2;
  border-radius: 6px;
  padding: 3px 7px;
  white-space: nowrap;
  overflow-x: auto;
}
.doc-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.doc-eg {
  font-size: 12px;
  color: #2563eb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.doc-desc { font-size: 13px; color: #4b5563; line-height: 1.5; }

/* ── 新骰子结果元素 ──────────────────────────────── */
.dice-terms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tchip {
  font-size: 12px;
  background: #f3f4f6;
  border-radius: 6px;
  padding: 2px 7px;
  color: #374151;
}
.tchip b { color: #b91c1c; }
.dice-reps { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.rep { font-size: 12.5px; color: #4b5563; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ── 工具指令结果卡片 ──────────────────────────────── */
.cmd-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  max-width: 560px;
}
.cmd-title { font-size: 13px; font-weight: 600; color: #1e293b; margin-bottom: 6px; }
.cmd-rule { border-top: 1px dashed #e2e8f0; padding: 6px 0; }
.cmd-rule:first-of-type { border-top: none; }
.cmd-tag { display: inline-block; font-size: 11px; color: #fff; background: #6366f1; border-radius: 4px; padding: 1px 6px; margin-bottom: 3px; }
.cmd-rt { font-size: 13.5px; font-weight: 600; color: #0f172a; margin-bottom: 2px; }
.cmd-rc { font-size: 12.5px; color: #475569; line-height: 1.55; }
.cmd-names { display: flex; flex-wrap: wrap; gap: 8px; }
.cmd-name { font-size: 14px; background: #eef2ff; color: #3730a3; border-radius: 6px; padding: 3px 10px; }
.cmd-deck { font-size: 13px; color: #334155; line-height: 1.6; white-space: pre-wrap; }
.cmd-jrrp { font-size: 28px; font-weight: 800; color: #b91c1c; }
.cmd-time { font-size: 14px; color: #334155; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cmd-help { font-size: 12.5px; color: #475569; line-height: 1.6; white-space: pre-wrap; }
.cmd-err { font-size: 12.5px; color: #b91c1c; }
.cmd-raw { font-size: 12px; color: var(--dim); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cmd-raw-sep { border-bottom: 1px solid var(--line); margin: 6px 0 8px; }

/* 指令结果中的判定染色：失败类红、成功类绿（欣姐 2026-10-14 定） */
.cmd-help .v-ok { color: var(--ok); font-weight: 600; }
.cmd-help .v-bad { color: var(--bad); font-weight: 600; }

/* ── 头像（图片 / svg 图标）─────────────────────────────── */
.avatar { overflow: hidden; }
.avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; background: #fff; }
.avatar-svg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center; line-height: 0;
  background: #fff; border-radius: 50%;
}
.avatar-svg img { width: 86%; height: 86%; object-fit: contain; display: block; }
.avatar-emoji { font-size: 1em; line-height: 1; display: flex; align-items: center; justify-content: center; }
.avatar.lg .avatar-emoji { font-size: 30px; }
.avatar-sm .avatar-emoji { font-size: 15px; }

/* 角色标签补充：房主 / 我 */
.tag.creator { background: #ede9fe; color: #6d28d9; }
.tag.me { background: #ecfdf5; color: #059669; }

/* 成员弹窗里的「设为 DM」按钮 */
.set-dm { flex-shrink: 0; }

/* ── 头像编辑弹层 ──────────────────────────────── */
.avatar-preview { display: flex; justify-content: center; margin-bottom: 18px; }
.emoji-row { display: flex; flex-wrap: wrap; gap: 8px; }
.emoji-opt {
  width: 40px; height: 40px; border-radius: 10px;
  background: #f3f4f6; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 6px;
  transition: border-color .12s, background .12s;
}
.emoji-opt img { width: 100%; height: 100%; object-fit: contain; display: block; }
.emoji-opt:hover { border-color: var(--pri); background: #eff6ff; }
.emoji-opt.on { border-color: var(--pri); background: #eff6ff; }
.emoji-opt:hover { border-color: var(--pri); background: #eff6ff; }
#in-avatar-file { font-size: 13px; }

/* ── 角色卡库网格（TRPG Engine 风格）────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; padding: 4px; }
.card-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; }
.card-card:hover { box-shadow: 0 6px 18px rgba(37,99,235,.12); border-color: #c7d7fb; transform: translateY(-2px); }
.cc-top { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.cc-avatar { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg,#eef3ff,#dde9ff); color: #2f6fed; font-weight: 700; font-size: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cc-head { min-width: 0; }
.cc-name { font-weight: 700; font-size: 15px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; margin-top: 3px; }
.cc-tag.coc { background: #fef3c7; color: #b45309; }
.cc-tag.dnd { background: #eff6ff; color: #2563eb; }
.cc-desc { font-size: 12.5px; color: var(--sub); height: 18px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 10px; }
.cc-foot { font-size: 11.5px; color: var(--dim); }

/* ── 骰子随机属性：悬浮创建角色 ───────────────────── */
.gen-blocks { display: flex; flex-direction: column; gap: 10px; }
.gen-block { position: relative; border: 2px solid transparent; border-radius: 10px; padding: 10px 12px; cursor: pointer; background: #fafbff; transition: border-color .12s; }
.gen-block:hover { border-color: #2f6fed; }
.gen-block-title { font-size: 12px; font-weight: 700; color: #2f6fed; margin-bottom: 5px; }
.gen-block-body { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.7; color: #2a2a2a; white-space: pre-wrap; }
.gen-create-hint { display: none; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: #2f6fed; }
.gen-block:hover .gen-create-hint { display: block; }

/* ── 角色卡详情：雷达图 / 状态标签 / 关联房间 ──────── */
.radar { display: block; margin: 4px auto 8px; }
.radar-axis { stroke: #e3e6ea; stroke-width: 1; }
.radar-poly { fill: rgba(47,111,237,.18); stroke: #2f6fed; stroke-width: 2; }
.radar-dot { fill: #2f6fed; }
.radar-label { font-size: 10px; fill: var(--sub); font-weight: 600; }
.status-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0 2px; }
.status-tag { padding: 3px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.status-tag.ok { background: #e7f7ee; color: #0a9d57; }
.status-tag.warn { background: #fff3e0; color: #c77700; }
.status-tag.bad { background: #fdeaea; color: #d23; }
.detail-room-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 14px; background: #f7f9fc; border-radius: 10px; margin-bottom: 8px; font-size: 13px; }
.detail-room-label { color: var(--sub); font-weight: 600; }
.room-pill { background: #eef3ff; color: #2f6fed; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.readonly-note { background: #eef4ff; color: #2f6fed; border: 1px solid #d6e4ff; border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 10px; }

/* ── COC 当前状态分数展示（HP/MP/SAN 当前/上限）──── */
.state-scores { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.state-scores > .ss { flex: 1 1 0; min-width: 84px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px; text-align: center; }
.ss span { display: block; font-size: 12px; font-weight: 700; color: var(--sub); margin-bottom: 3px; }
.ss b { font-size: 17px; font-weight: 800; color: var(--txt); font-variant-numeric: tabular-nums; }

/* ── COC 技能：职业点 / 兴趣点配额条 ─────────────── */
.skill-points { display: flex; gap: 10px; margin: 4px 0 12px; flex-wrap: wrap; }
.sp { background: #eef4ff; color: #2f6fed; border: 1px solid #d6e4ff; border-radius: 999px; padding: 4px 14px; font-size: 13px; font-weight: 600; }
.sp b { font-size: 14px; font-weight: 800; }

/* ── COC 技能四列网格（表头与每行共用同一 grid 对齐） */
.skill-cols, .skill-row.coc-skill-row { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 6px 8px; align-items: center; }
.skill-cols-head { font-size: 12px; font-weight: 700; color: var(--sub); padding: 0 12px 5px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.skill-cols-head span { text-align: center; }
.skill-cols-head span:first-child { text-align: left; }
.skill-list { display: flex; flex-direction: column; gap: 6px; }
.skill-row.coc-skill-row { padding: 4px 0; border-bottom: 1px solid #eef0f3; }
.skill-row.coc-skill-row:last-child { border-bottom: none; }
.skill-row.coc-skill-row .skill-k { font-size: 13px; color: var(--txt); font-weight: 600; }
.coc-skill-row input { width: 100%; box-sizing: border-box; text-align: center; }
.sk-exp, .sk-occ, .sk-int { padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; background: var(--card); color: var(--txt); }
.coc-skill-row input:disabled,
.sk-occ.sk-locked, .sk-int.sk-locked { background: #f1f3f6; color: var(--dim); cursor: not-allowed; }
.skill-breakdown { font-size: 11.5px; color: var(--sub); }

/* ── 需求6/7 资产块 + 防具/装备 chip 与列表（欣姐 2026-10-20）──── */
/* 含块级组件的 .f 自动换行，块级子元素占满整行（避免把 104 个武器 chip 挤在一行） */
.card-section-b .f { flex-wrap: wrap; }
.card-section-b .f > .item-rows,
.card-section-b .f > .eq-pick,
.card-section-b .f > .eq-list,
.card-section-b .f > .w-detail,
.card-section-b .f > .w-filter,
.card-section-b .f > .a-filter { flex: 1 1 100%; }

/* 资产 6 项（自动计算，对应 Excel 人物卡!R61-R62） */
.asset-block { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 4px; }
.ai { display: flex; flex-direction: column; gap: 2px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.ai-k { font-size: 11.5px; color: var(--dim); }
.ai-v { font-size: 14px; font-weight: 700; color: var(--txt); font-variant-numeric: tabular-nums; }

/* 武器 / 防具 多选 chip（替代丑陋的原生多选框） */
.a-filter { width: 100%; margin-bottom: 6px; }
.eq-pick { display: flex; flex-wrap: wrap; margin-top: 6px; max-height: 210px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.eq-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; margin: 3px 4px 3px 0; border: 1px solid var(--line); border-radius: 999px; background: #f7f9fc; color: var(--txt); font-size: 12.5px; cursor: pointer; transition: .15s; }
.eq-chip:hover { border-color: var(--pri, #6366f1); }
.eq-chip.on { background: var(--pri, #6366f1); border-color: var(--pri, #6366f1); color: #fff; font-weight: 600; }

/* 装备列表（武器/防具选中后自动追加，可删不可编） */
.eq-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.eq-item { display: inline-flex; align-items: center; gap: 4px; padding: 5px 6px 5px 10px; background: #eef4ff; border: 1px solid #d6e4ff; border-radius: 8px; font-size: 13px; color: #2f6fed; }
.eq-del { border: none; background: none; color: #6b7280; cursor: pointer; font-size: 14px; line-height: 1; padding: 2px 5px; border-radius: 6px; }
.eq-del:hover { color: #dd2233; background: rgba(221,34,51,.1); }
.eq-empty { color: var(--dim); font-size: 12.5px; padding: 8px 2px; }

/* ── 欣姐 2026-10-19 15:02 批次：编辑器双栏 / 信息两列网格 / 属性5列 / 装备选择弹窗 ── */
/* 右上角「展示/隐藏自动计算数值」按钮行（欣姐 2026-10-19 优化2） */
.card-top-row { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.card-top-row #btn-calc-toggle.on { background: var(--pri, #6366f1); border-color: var(--pri, #6366f1); color: #fff; }

/* 角色名/头像格（基本信息首行，与下方输入框等宽等高） */
.card-section-b .info-grid .f-name-cell { flex-direction: column; justify-content: center; }
.card-section-b .info-grid .f-avatar-cell { flex-direction: row; align-items: center; gap: 8px; padding: 6px 10px; }
.f-avatar-cell .card-avatar { width: 34px; height: 34px; font-size: 14px; flex-shrink: 0; }
.f-avatar-cell .card-avatar-btns { display: flex; gap: 6px; }
.f-avatar-cell .card-avatar-btns .btn { height: 28px; padding: 2px 8px; font-size: 12px; }
.card-avatar-btns input { display: none; }

/* 双栏：主表单 + 右侧自动计算面板（默认隐藏；打开时各占 50%，等宽） */
.card-body-cols { display: flex; gap: 12px; align-items: flex-start; }
.card-body-cols #card-fields { flex: 1 1 0; min-width: 0; }
.card-body-cols #card-calc-panel { display: none; flex: 1 1 0; min-width: 0; }
/* 欣姐优化2：展开自动计算时弹窗宽度 ×2（720→1440），原表单宽度不变 */
.sheet.calc-open { width: 1440px; max-width: 96vw; }
.sheet.calc-open .card-body-cols #card-calc-panel { display: block; }
.sheet.calc-open .card-body-cols #card-fields { flex: 0 0 50%; max-width: 50%; }

/* 基本信息：每行 2 个等宽等高输入框/下拉；textarea 独占一行 */
.card-section-b .info-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}
.card-section-b .info-grid .f {
  display: flex; flex-direction: column; align-items: stretch;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc;
  border-bottom: 1px solid var(--line);
}
.card-section-b .info-grid .f label { font-size: 11.5px; color: var(--dim); min-width: 0; margin-bottom: 4px; }
.card-section-b .info-grid .f input,
.card-section-b .info-grid .f select,
.card-section-b .info-grid .f textarea { width: 100%; height: 34px; box-sizing: border-box; text-align: left; }
.card-section-b .info-grid .f .ss { width: 100%; }
.card-section-b .info-grid .f .ss .ss-in { width: 100%; height: 34px; box-sizing: border-box; text-align: left; }
.card-section-b .info-grid .f textarea { height: auto; min-height: 76px; }
.card-section-b .info-grid .f-wide { grid-column: 1 / -1; }

/* 角色卡头像 */
.card-avatar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.card-avatar {
  width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  background: #f1f3f6; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: var(--dim);
}
.card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.card-avatar-btns { display: flex; gap: 8px; }

/* 武器与装备：选择按钮行 */
.equip-btn-row { display: flex; gap: 10px; margin-bottom: 8px; }

/* 装备/武器选择弹窗（表格多选） */
.sheet-wide { width: min(920px, 94vw); }
.ep-toolbar { padding: 0 16px 10px; }
.ep-toolbar input {
  width: 100%; height: 34px; padding: 4px 10px; border: 1px solid var(--line2);
  border-radius: 7px; font: inherit; background: #fff; box-sizing: border-box;
}
.ep-table-wrap { max-height: 56vh; overflow: auto; padding: 0 16px 6px; border-top: 1px solid var(--line); }
.ep-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ep-table th, .ep-table td { border-bottom: 1px solid #eef0f3; padding: 7px 8px; text-align: left; white-space: nowrap; }
.ep-table thead th { position: sticky; top: 0; background: #f4f6fa; color: var(--sub); font-weight: 700; z-index: 1; }
.ep-table .ep-checkcell { width: 34px; text-align: center; }
.ep-table .ep-check { width: 15px; height: 15px; cursor: pointer; }
.ep-table .ep-name { font-weight: 700; color: var(--txt); }
.ep-row.on td { background: #eef4ff; }
.ep-row { cursor: pointer; }

/* 自动计算面板内：随身武器与装备列表 */
#calc-equip-list .ce-row { display: flex; justify-content: space-between; gap: 8px; padding: 6px 2px; border-bottom: 1px dashed #eef0f3; font-size: 12.5px; }
#calc-equip-list .ce-row:last-child { border-bottom: none; }
#calc-equip-list .ce-name { font-weight: 700; color: var(--txt); }
#calc-equip-list .ce-attr { color: var(--sub); text-align: right; }

/* 聊天区：到达最顶/最底 按钮（右侧） */
.chat-wrap { position: relative; }
.chat-nav {
  position: absolute; right: 10px; top: 10px; z-index: 6;
  display: flex; flex-direction: column; gap: 6px;
}
.chat-nav-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: rgba(255,255,255,.92); color: var(--sub); font-size: 14px; font-weight: 700;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.chat-nav-btn:hover { color: var(--pri); border-color: var(--pri); }

/* 房间卡片创建时间 */
.room-card-created { font-size: 11.5px; color: var(--dim); padding: 0 12px 10px; margin-top: -4px; }
.cc-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ── 欣姐 2026-10-19：聊天文字选择修复 ──
   ① 轮询无变化不再移动 DOM（app.js renderMessages 提前 return）
   ② 时间戳/头像/昵称/操作钮不参与选择，拖选只带正文 */
.msg-list .msg-time, .msg-list .msg-name, .msg-list .msg-meta,
.msg-list .avatar, .msg-list .msg-recall, .msg-list .msg-reply,
.msg-list .dice-card, .msg-list .msg-system {
  user-select: none; -webkit-user-select: none;
}
.msg-list .msg-main, .msg-list .cmd-card, .msg-list .dice-card * { user-select: text; -webkit-user-select: text; }

/* ── 成员当前状态弹窗（欣姐 2026-10-19）── */
.mp-click { cursor: pointer; }
.mp-click:hover { background: #f7f9fc; }
.ms-card { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--txt); padding: 10px 14px; background: #f7f9fc; border-radius: 10px; margin: 0 14px 10px; }
.ms-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px dashed #eef0f3; font-size: 13.5px; }
.ms-row:last-of-type { border-bottom: none; }
.ms-k { width: 46px; font-weight: 700; color: var(--sub); }
.ms-v { font-size: 16px; font-weight: 800; color: var(--txt); font-variant-numeric: tabular-nums; }
.ms-off { font-size: 12px; color: #d23; font-style: normal; }
.ms-acts { margin-left: auto; display: flex; gap: 6px; }
.ms-btn { min-width: 34px; height: 26px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--txt); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.ms-btn:hover { border-color: var(--pri); color: var(--pri); }

/* 信用评级超出职业信誉区间标红（欣姐 2026-10-19 bug 修复） */
.coc-skill-row.sk-credit-bad input { border-color: #d23 !important; background: #fff5f5 !important; }
.coc-skill-row.sk-credit-bad .skill-k { color: #d23 !important; }
