/* ============================================================
   《幻卡次元》全局样式 · 东方古风（三国杀式：墨黑+暗红+鎏金）
   ============================================================ */
:root {
  --ink0: #100d08; /* 玄墨 */
  --ink1: #1a1610; /* 深墨 */
  --ink2: #241e14; /* 墨褐 */
  --ink3: #322a1b; /* 暗木 */
  --gold: #d8b45a; /* 鎏金 */
  --gold-dim: #8a7332; /* 暗金 */
  --gold-bright: #f3d888;
  --red: #a12a2a; /* 蜀红 */
  --red-bright: #d0392e;
  --paper: #e8dcc0; /* 米纸 */
  --paper-dim: #a89877;
  --jade: #4a9e6e; /* 玉 */
  --blue: #4a7fb5; /* 青 */
  --cN: #9aa5b5;
  --cR: #42a5f5;
  --cSR: #b06fd8;
  --cSSR: #f0a818;
  --line: #4a3d22;
  --font-title: "STKaiti", "KaiTi", "楷体", "Noto Serif SC", serif;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  height: 100%;
}
body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--paper);
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.008) 0 1px,
      transparent 1px 90px
    ),
    radial-gradient(1100px 560px at 72% -8%, #2c2413 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 105%, #241a0e 0%, transparent 55%),
    var(--ink0);
  background-attachment: fixed;
  overflow-x: hidden;
}
button {
  font-family: inherit;
  cursor: pointer;
}
input {
  font-family: inherit;
}
h1,
h2,
h3,
.panel-title,
.tb-logo {
  font-family: var(--font-title);
  letter-spacing: 1px;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: var(--ink3);
  border-radius: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* Material Symbols */
.msr {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  font-size: 18px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
  vertical-align: -3.5px;
  user-select: none;
  font-variation-settings:
    "FILL" 1,
    "wght" 500;
}

/* ============ 通用按钮（描边古风） ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, #2e2718, #211b10);
  color: var(--paper);
  border: 1.6px solid var(--gold-dim);
  outline: 1px solid rgba(0, 0, 0, 0.65);
  outline-offset: -4px;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 15px;
  transition: all 0.16s;
  box-shadow:
    inset 0 1px 0 rgba(216, 180, 90, 0.18),
    0 3px 10px rgba(0, 0, 0, 0.5);
}
.btn:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: linear-gradient(180deg, #3b3220, #292112);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn-primary {
  background: linear-gradient(180deg, #8c1f28, #6d151d);
  border-color: #c8724a;
  color: #ffe9c8;
  font-weight: bold;
}
.btn-primary:hover {
  background: linear-gradient(180deg, #a52a33, #7d1a22);
  border-color: var(--gold);
  color: #fff;
}
.btn-gold {
  background: linear-gradient(180deg, #b98f34, #8f6b21);
  border-color: var(--gold-bright);
  color: #241b06;
  font-weight: bold;
}
.btn-gold:hover {
  background: linear-gradient(180deg, #d4a944, #a37d29);
  color: #1a1304;
}
.btn-danger {
  background: linear-gradient(180deg, #7d1a1a, #5a1010);
  border-color: #c85a4a;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.btn-mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(180deg, #2e2718, #1f1a0f);
  color: var(--paper-dim);
  border: 1px solid var(--gold-dim);
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 13px;
  transition: 0.15s;
}
.btn-mini:hover {
  color: var(--gold-bright);
  border-color: var(--gold);
}
.btn-mini.danger {
  color: #e89a8a;
  border-color: #8a4438;
}
.btn-mini.on {
  color: var(--gold-bright);
  border-color: var(--gold);
  background: linear-gradient(180deg, #4a3d1c, #332a12);
}
.badge {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  padding: 0 4px;
  background: var(--red-bright);
  color: #fff;
  font-size: 11px;
  border-radius: 8px;
  vertical-align: top;
  margin-left: 3px;
  font-family: sans-serif;
}
.badge:empty {
  display: none;
}

/* ============ 场景 ============ */
.scene {
  min-height: 100vh;
}

/* ============ 登录 ============ */
#scene-login {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.ink-deco {
  position: absolute;
  right: -4%;
  bottom: -14%;
  font-family: var(--font-title);
  font-size: min(46vw, 460px);
  color: rgba(216, 180, 90, 0.05);
  pointer-events: none;
  user-select: none;
}
.login-box {
  width: min(400px, 92vw);
  position: relative;
  background: linear-gradient(170deg, #241e12, #17120a);
  border: 1.6px solid var(--gold-dim);
  border-radius: 10px;
  outline: 1px solid rgba(0, 0, 0, 0.7);
  outline-offset: -5px;
  padding: 36px 32px;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(216, 180, 90, 0.15);
}
.login-box::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(216, 180, 90, 0.22);
  border-radius: 6px;
  pointer-events: none;
}
.login-logo {
  text-align: center;
  margin-bottom: 8px;
}
.logo-seal {
  width: 74px;
  height: 74px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 44px;
  color: #ffdf9e;
  background: linear-gradient(160deg, #8c1f28, #5c1218);
  border: 2.5px solid var(--gold);
  border-radius: 12px;
  box-shadow:
    0 6px 20px rgba(161, 42, 42, 0.5),
    inset 0 0 14px rgba(0, 0, 0, 0.5);
}
.login-logo h1 {
  font-size: 30px;
  letter-spacing: 10px;
  color: var(--gold-bright);
  text-shadow: 0 2px 8px rgba(216, 180, 90, 0.3);
}
.login-logo p {
  color: var(--paper-dim);
  font-size: 13px;
  margin: 8px 0 22px;
  letter-spacing: 3px;
}
.field {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.4px solid var(--line);
  border-radius: 7px;
  background: rgba(10, 8, 5, 0.8);
  margin-bottom: 12px;
  padding: 0 12px;
  transition: 0.15s;
}
.field:focus-within {
  border-color: var(--gold);
}
.field .msr {
  color: var(--gold-dim);
  font-size: 20px;
}
.field input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--paper);
  font-size: 15px;
  padding: 12px 0;
  outline: none;
}
.login-btns {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.login-btns .btn {
  flex: 1;
}
.login-tip {
  color: var(--paper-dim);
  font-size: 12px;
  margin-top: 18px;
  line-height: 1.9;
  text-align: center;
}
.login-err {
  color: var(--red-bright);
  font-size: 13px;
  margin-top: 8px;
  min-height: 18px;
  text-align: center;
}

/* ============ 顶栏 ============ */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: linear-gradient(180deg, #201a10, #161209);
  border-bottom: 1.6px solid var(--gold-dim);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-wrap: wrap;
}
.tb-logo {
  font-size: 20px;
  font-weight: bold;
  color: var(--gold-bright);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-mini {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #ffdf9e;
  background: linear-gradient(160deg, #8c1f28, #5c1218);
  border: 1.6px solid var(--gold);
  border-radius: 6px;
}
.tb-nav {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}
.tb-nav button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  color: var(--paper-dim);
  border: 1.6px solid transparent;
  padding: 7px 13px;
  border-radius: 6px;
  font-size: 14.5px;
  transition: 0.15s;
  font-family: var(--font-title);
}
.tb-nav button .msr {
  font-size: 19px;
}
.tb-nav button:hover {
  color: var(--paper);
  border-color: var(--line);
  background: rgba(216, 180, 90, 0.06);
}
.tb-nav button.active {
  color: var(--gold-bright);
  border-color: var(--gold-dim);
  background: linear-gradient(
    180deg,
    rgba(161, 42, 42, 0.35),
    rgba(161, 42, 42, 0.12)
  );
}
.tb-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.res {
  font-size: 14px;
  color: var(--paper-dim);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.res .msr {
  font-size: 17px;
}
.res b {
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 15px;
}
.gold-ico {
  color: #e8b84a;
}
.gem-ico {
  color: #6ec2e8;
}
.star-ico {
  color: #e8c96a;
}
.tb-user {
  font-size: 13px;
  color: var(--paper-dim);
  font-family: var(--font-title);
}

/* ============ 面板通用 ============ */
.panel-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 16px 100px;
}
.panel-title {
  font-size: 23px;
  margin: 6px 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gold-bright);
}
.panel-title::before {
  content: "◈";
  color: var(--red-bright);
  font-size: 18px;
}
.panel-title small {
  color: var(--paper-dim);
  font-size: 13px;
  font-weight: normal;
  letter-spacing: 0;
}
.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.empty-tip {
  color: var(--paper-dim);
  text-align: center;
  padding: 40px 0;
  line-height: 2;
}
.hr {
  border: none;
  border-top: 1px dashed var(--line);
  margin: 16px 0;
}

/* ============ 卡牌（古风卷轴卡） ============ */
.gcard {
  width: 116px;
  height: 166px;
  border-radius: 8px;
  position: relative;
  background:
    radial-gradient(
      120% 60% at 50% 0%,
      rgba(216, 180, 90, 0.08),
      transparent 60%
    ),
    linear-gradient(165deg, #2b2416, #171208);
  border: 2px solid var(--cN);
  outline: 1px solid rgba(0, 0, 0, 0.7);
  outline-offset: -5px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition:
    transform 0.18s,
    box-shadow 0.18s;
  user-select: none;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  flex-shrink: 0;
}
.gcard:hover {
  transform: translateY(-6px) scale(1.03);
  z-index: 5;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.6);
}
.gcard.r-R {
  border-color: var(--cR);
}
.gcard.r-SR {
  border-color: var(--cSR);
  box-shadow:
    0 0 10px rgba(176, 111, 216, 0.28),
    0 5px 16px rgba(0, 0, 0, 0.55);
}
.gcard.r-SSR {
  border-color: var(--cSSR);
  background:
    radial-gradient(
      130% 70% at 50% 0%,
      rgba(240, 168, 24, 0.12),
      transparent 60%
    ),
    linear-gradient(165deg, #3a2d10, #1c1508);
  box-shadow:
    0 0 12px rgba(240, 168, 24, 0.45),
    0 6px 20px rgba(0, 0, 0, 0.6);
}
.gcard.r-SSR::after {
  content: "";
  position: absolute;
  inset: -60%;
  background: linear-gradient(
    115deg,
    transparent 42%,
    rgba(255, 220, 120, 0.16) 50%,
    transparent 58%
  );
  animation: shine 3.2s linear infinite;
  pointer-events: none;
}
@keyframes shine {
  from {
    transform: translateX(-60%);
  }
  to {
    transform: translateX(60%);
  }
}
.gcard .g-cost {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 27px;
  height: 27px;
  background: radial-gradient(circle at 35% 30%, #7cc4ff, #15507a);
  border: 1.6px solid #9fd4ff;
  transform: rotate(45deg);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
}
.gcard .g-cost i {
  transform: rotate(-45deg);
  font-style: normal;
  font-weight: bold;
  font-size: 14px;
  color: #fff;
}
.gcard .g-rar {
  position: absolute;
  top: 7px;
  right: 7px;
  font-size: 10px;
  font-weight: bold;
  color: var(--cN);
  z-index: 3;
  font-family: var(--font-title);
}
.gcard.r-R .g-rar {
  color: var(--cR);
}
.gcard.r-SR .g-rar {
  color: var(--cSR);
}
.gcard.r-SSR .g-rar {
  color: var(--cSSR);
}
.gcard .g-art {
  font-size: 46px;
  text-align: center;
  margin-top: 30px;
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));
}
.gcard .g-name {
  text-align: center;
  font-size: 13px;
  font-weight: bold;
  margin-top: 7px;
  padding: 0 4px;
  font-family: var(--font-title);
  color: var(--gold-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gcard .g-desc {
  font-size: 10px;
  color: var(--paper-dim);
  text-align: center;
  padding: 3px 7px;
  line-height: 1.45;
  flex: 1;
  overflow: hidden;
}
.gcard .g-atk,
.gcard .g-hp {
  position: absolute;
  bottom: 3px;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 13px;
  z-index: 3;
  clip-path: polygon(50% 0, 100% 28%, 100% 72%, 50% 100%, 0 72%, 0 28%);
}
.gcard .g-atk {
  left: 3px;
  background: linear-gradient(180deg, #d8892a, #8a4d0e);
  color: #fff;
}
.gcard .g-hp {
  right: 3px;
  background: linear-gradient(180deg, #c23a30, #7a1512);
  color: #fff;
}
.gcard.spell .g-atk,
.gcard.spell .g-hp {
  display: none;
}
.gcard .g-owned {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--paper-dim);
  z-index: 3;
  white-space: nowrap;
}
.gcard.dim {
  opacity: 0.45;
  filter: grayscale(0.6);
}
.gcard.selected {
  outline: 3px solid var(--gold);
  transform: translateY(-10px) scale(1.05);
}
.gcard.targetable {
  outline: 3px dashed var(--red-bright);
  animation: pulse 1s infinite;
}
.gcard.canuse {
  box-shadow:
    0 0 12px rgba(122, 200, 140, 0.7),
    0 5px 14px rgba(0, 0, 0, 0.55);
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 4px rgba(208, 57, 46, 0.6);
  }
  50% {
    box-shadow: 0 0 18px rgba(208, 57, 46, 0.95);
  }
}

/* ============ 大厅 ============ */
.home-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
}
.hcard {
  background: linear-gradient(170deg, #221c11, #181309);
  border: 1.4px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  outline: 1px solid rgba(0, 0, 0, 0.6);
  outline-offset: -4px;
}
.hcard h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  gap: 7px;
}
.hcard h3 .msr {
  font-size: 20px;
  color: var(--red-bright);
}
.stat-rows {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.stat-rows .row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  border-bottom: 1px dashed rgba(74, 61, 34, 0.6);
  padding-bottom: 6px;
}
.stat-rows .row span {
  color: var(--paper-dim);
}
.stat-rows .row b {
  color: var(--gold);
  font-family: var(--font-title);
}
.tier-badge {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 4px;
  font-weight: bold;
  background: rgba(216, 180, 90, 0.14);
  border: 1px solid var(--gold-dim);
  font-family: var(--font-title);
}
.quick-entries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 10px;
}
.qe {
  background: linear-gradient(165deg, #2a2314, #1c160c);
  border: 1.4px solid var(--line);
  border-radius: 8px;
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  transition: 0.16s;
}
.qe:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  background: linear-gradient(165deg, #352c17, #221b0e);
}
.qe .qe-ico {
  font-size: 30px;
}
.qe .qe-t {
  margin-top: 8px;
  font-size: 14px;
  font-family: var(--font-title);
  color: var(--paper);
}
.event-banner {
  background: linear-gradient(
    90deg,
    rgba(161, 42, 42, 0.16),
    rgba(161, 42, 42, 0.03)
  );
  border: 1px solid rgba(216, 180, 90, 0.4);
  border-radius: 7px;
  padding: 11px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
}
.event-banner:hover {
  border-color: var(--gold);
}

/* ============ 卡组编辑 ============ */
.deck-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
}
.deck-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.deck-filters button {
  background: #1f1a0f;
  border: 1.4px solid var(--line);
  color: var(--paper-dim);
  border-radius: 5px;
  padding: 5px 13px;
  font-size: 13px;
  font-family: var(--font-title);
}
.deck-filters button.active {
  color: var(--gold-bright);
  background: rgba(161, 42, 42, 0.28);
  border-color: var(--gold-dim);
}
.deck-side {
  background: linear-gradient(170deg, #221c11, #181309);
  border: 1.4px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  position: sticky;
  top: 70px;
  max-height: calc(100vh - 90px);
  display: flex;
  flex-direction: column;
}
.deck-list {
  flex: 1;
  overflow-y: auto;
  margin: 10px 0;
}
.deck-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 13px;
  cursor: pointer;
}
.deck-item:hover {
  background: rgba(216, 180, 90, 0.08);
}
.deck-item .dc {
  color: var(--blue);
  width: 18px;
  text-align: center;
  font-weight: bold;
}
.deck-item .dn {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-title);
}
.deck-item .dx {
  color: var(--paper-dim);
}
.deck-item.r-R .dn {
  color: var(--cR);
}
.deck-item.r-SR .dn {
  color: var(--cSR);
}
.deck-item.r-SSR .dn {
  color: var(--cSSR);
}
.deck-count {
  text-align: center;
  font-size: 15px;
  padding: 6px;
  border-radius: 5px;
  background: rgba(10, 8, 5, 0.7);
  border: 1px solid var(--line);
  font-family: var(--font-title);
}
.deck-count.ok {
  color: var(--jade);
  border-color: var(--jade);
}
.synth-bar {
  font-size: 11px;
  color: var(--gold);
  margin-top: 2px;
}
.synth-bar:hover {
  color: var(--gold-bright);
}

/* ============ 对战大厅 ============ */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 14px;
}
.mode-card {
  background: linear-gradient(165deg, #292213, #1a150b);
  border: 1.6px solid var(--line);
  border-radius: 9px;
  padding: 17px;
  cursor: pointer;
  transition: 0.18s;
  position: relative;
  outline: 1px solid rgba(0, 0, 0, 0.6);
  outline-offset: -5px;
}
.mode-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 10px 28px rgba(216, 180, 90, 0.12);
}
.mode-card .mc-ico {
  font-size: 33px;
}
.mode-card .mc-t {
  font-size: 18px;
  font-weight: bold;
  margin: 9px 0 5px;
  font-family: var(--font-title);
  color: var(--gold-bright);
}
.mode-card .mc-d {
  font-size: 12px;
  color: var(--paper-dim);
  line-height: 1.7;
}
.mode-card.rank-mode {
  border-color: rgba(216, 180, 90, 0.45);
}
.mode-card.rank-mode .mc-ico {
  filter: drop-shadow(0 0 8px rgba(216, 180, 90, 0.45));
}
.mode-card .mc-tag {
  position: absolute;
  top: 11px;
  right: 11px;
  font-size: 11px;
  color: var(--gold-bright);
  border: 1px solid var(--gold-dim);
  padding: 1px 9px;
  border-radius: 4px;
  font-family: var(--font-title);
  background: rgba(161, 42, 42, 0.25);
}
.queue-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 6, 3, 0.9);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
}
.queue-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 5px solid var(--ink3);
  border-top-color: var(--gold);
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.room-seat {
  background: rgba(10, 8, 5, 0.7);
  border: 1.4px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.room-seat.team1 {
  border-color: rgba(208, 57, 46, 0.6);
}
.room-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 640px;
}
.code-chip {
  font-size: 26px;
  letter-spacing: 8px;
  font-weight: bold;
  color: var(--gold-bright);
  background: rgba(10, 8, 5, 0.8);
  padding: 8px 18px;
  border-radius: 6px;
  border: 1.4px dashed var(--gold);
  display: inline-block;
  font-family: var(--font-title);
}

/* ============ 战斗界面 ============ */
#scene-battle {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.battle-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: linear-gradient(180deg, #201a10, #14100a);
  border-bottom: 1.4px solid var(--gold-dim);
  flex-wrap: wrap;
  gap: 6px;
}
.bt-info {
  font-size: 14px;
  color: var(--paper-dim);
  font-family: var(--font-title);
}
.bt-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.battle-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 6px 12px;
  gap: 4px;
  overflow: auto;
  position: relative;
}
.bz {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}
.bz-label {
  font-size: 11px;
  color: var(--gold-dim);
  text-align: center;
  margin: 2px 0;
  letter-spacing: 8px;
  font-family: var(--font-title);
}
.players-row {
  display: flex;
  justify-content: center;
  gap: 34px;
  flex-wrap: wrap;
}
.player-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.mini-row {
  display: flex;
  gap: 6px;
  min-height: 64px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px;
  border-radius: 30px;
  background: linear-gradient(170deg, #292213, #1a150b);
  border: 2px solid var(--line);
  outline: 1px solid rgba(0, 0, 0, 0.6);
  outline-offset: -5px;
  position: relative;
  transition: 0.15s;
}
.hero-box.my-turn {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(216, 180, 90, 0.5);
}
.hero-box.dead {
  opacity: 0.35;
  filter: grayscale(1);
}
.hero-face {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 27px;
  background: radial-gradient(circle at 40% 30%, #3a2f18, #1c160b);
  border: 1.6px solid var(--gold-dim);
  border-radius: 50%;
}
.hero-meta {
  display: flex;
  flex-direction: column;
  font-size: 12px;
}
.hero-name {
  font-weight: bold;
  font-family: var(--font-title);
  color: var(--gold-bright);
}
.hero-sub {
  color: var(--paper-dim);
}
.hp-orb,
.en-orb {
  min-width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  font-family: var(--font-title);
  position: relative;
}
.hp-orb {
  background: radial-gradient(circle at 35% 30%, #d0392e, #6d1010);
  border: 2px solid #e8756a;
  color: #fff;
}
.en-orb {
  min-width: 30px;
  height: 30px;
  background: radial-gradient(circle at 35% 30%, #3a7ab5, #15304d);
  border: 2px solid #7ab5e8;
  color: #fff;
  font-size: 12px;
}
.hero-box.targetable {
  outline: 3px dashed var(--red-bright);
  animation: pulse 1s infinite;
  cursor: pointer;
}
.board-minion {
  width: 62px;
  height: 76px;
  border-radius: 7px;
  position: relative;
  background:
    radial-gradient(
      120% 70% at 50% 0%,
      rgba(216, 180, 90, 0.09),
      transparent 55%
    ),
    linear-gradient(165deg, #2e2616, #191309);
  border: 2px solid var(--line);
  outline: 1px solid rgba(0, 0, 0, 0.65);
  outline-offset: -4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: transform 0.13s;
  user-select: none;
}
.board-minion .bm-art {
  font-size: 25px;
  line-height: 1;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6));
}
.board-minion .bm-name {
  font-size: 9px;
  color: var(--paper-dim);
  max-width: 56px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-title);
}
.board-minion .bm-atk,
.board-minion .bm-hp {
  position: absolute;
  bottom: 2px;
  width: 20px;
  height: 20px;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(50% 0, 100% 28%, 100% 72%, 50% 100%, 0 72%, 0 28%);
}
.board-minion .bm-atk {
  left: 2px;
  background: linear-gradient(180deg, #d8892a, #8a4d0e);
  color: #fff;
}
.board-minion .bm-hp {
  right: 2px;
  background: linear-gradient(180deg, #c23a30, #7a1512);
  color: #fff;
}
.board-minion.taunt {
  border-color: var(--gold);
  box-shadow: inset 0 0 12px rgba(216, 180, 90, 0.22);
}
.board-minion.taunt::before {
  content: "🛡";
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 10px;
}
.board-minion.ready {
  box-shadow: 0 0 10px rgba(122, 200, 140, 0.75);
  cursor: pointer;
}
.board-minion.attacker-selected {
  outline: 3px solid var(--gold);
  transform: scale(1.08);
}
.board-minion.targetable {
  outline: 3px dashed var(--red-bright);
  animation: pulse 1s infinite;
  cursor: pointer;
}
.board-minion.just-played {
  animation: summon 0.4s ease-out;
}
.board-minion.just-attacked {
  animation: lunge 0.35s ease-out;
}
@keyframes summon {
  from {
    transform: scale(0.3) translateY(24px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}
@keyframes lunge {
  0%,
  100% {
    transform: translate(0, 0);
  }
  45% {
    transform: translate(var(--lx, 0), var(--ly, -26px)) scale(1.12);
  }
}
.hand-row {
  display: flex;
  justify-content: center;
  min-height: 128px;
  align-items: flex-end;
  padding: 0 8px;
}
.hand-row .gcard {
  margin: 0 -17px;
}
.hand-row .gcard:hover {
  z-index: 10;
}
.battle-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 4px 0 8px;
}
.endturn-btn {
  padding: 10px 30px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 7px;
  font-family: var(--font-title);
  background: linear-gradient(180deg, #3f7a4e, #23502f);
  border: 2px solid #7aba8a;
  color: #eafff0;
  letter-spacing: 4px;
  outline: 1px solid rgba(0, 0, 0, 0.6);
  outline-offset: -5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.endturn-btn:disabled {
  filter: grayscale(0.85);
  opacity: 0.6;
}
.endturn-btn.active {
  animation: glow 1.4s infinite;
}
@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 6px rgba(122, 200, 140, 0.55);
  }
  50% {
    box-shadow: 0 0 24px rgba(122, 200, 140, 1);
  }
}

/* 战斗横幅 / 飘字 */
.battle-banner {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 260;
}
.battle-banner .bb-text {
  font-family: var(--font-title);
  font-size: clamp(34px, 7vw, 62px);
  letter-spacing: 16px;
  color: var(--gold-bright);
  text-shadow:
    0 0 30px rgba(216, 180, 90, 0.8),
    0 4px 10px rgba(0, 0, 0, 0.9);
  animation: bannerIn 1.5s forwards;
}
.battle-banner .bb-text.enemy {
  color: #e8756a;
  text-shadow:
    0 0 30px rgba(208, 57, 46, 0.8),
    0 4px 10px rgba(0, 0, 0, 0.9);
}
@keyframes bannerIn {
  0% {
    opacity: 0;
    transform: scale(1.6);
  }
  18% {
    opacity: 1;
    transform: scale(1);
  }
  78% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(0.94);
  }
}
.fly-num {
  position: fixed;
  z-index: 265;
  pointer-events: none;
  font-weight: bold;
  font-family: var(--font-title);
  font-size: 24px;
  animation: flyUp 1.1s forwards;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}
.fly-num.dmg {
  color: #ff6a5a;
}
.fly-num.heal {
  color: #7be89a;
}
.fly-num.buff {
  color: #ffd76a;
}
@keyframes flyUp {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.7);
  }
  15% {
    opacity: 1;
    transform: translateY(0) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateY(-52px) scale(1);
  }
}
.battle-log {
  position: fixed;
  right: 10px;
  top: 48px;
  bottom: 12px;
  width: 294px;
  z-index: 90;
  background: rgba(16, 13, 8, 0.96);
  border: 1.4px solid var(--gold-dim);
  border-radius: 8px;
  padding: 12px;
  overflow-y: auto;
  font-size: 12.5px;
  line-height: 2;
  color: var(--paper-dim);
}
.battle-log div {
  border-bottom: 1px dashed rgba(74, 61, 34, 0.5);
}
.battle-log div.latest {
  color: var(--gold-bright);
}
.battle-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 6, 3, 0.9);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bo-card {
  text-align: center;
  background: linear-gradient(170deg, #241e12, #17120a);
  border: 1.6px solid var(--gold-dim);
  border-radius: 12px;
  padding: 34px 46px;
  outline: 1px solid rgba(0, 0, 0, 0.7);
  outline-offset: -6px;
  animation: boIn 0.4s ease-out;
}
@keyframes boIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
}
.bo-title {
  font-size: 38px;
  font-weight: bold;
  margin-bottom: 12px;
  font-family: var(--font-title);
  letter-spacing: 10px;
}
.bo-title.win {
  color: var(--gold-bright);
  text-shadow: 0 0 30px rgba(216, 180, 90, 0.7);
}
.bo-title.lose {
  color: var(--paper-dim);
}
.bo-rewards {
  text-align: left;
  margin: 14px 0 20px;
  font-size: 14px;
  line-height: 2.1;
  color: var(--paper-dim);
}
.bo-rewards b {
  color: var(--gold);
}

/* ============ 抽奖 ============ */
.pool-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.pool-card {
  background: linear-gradient(170deg, #221c11, #181309);
  border: 1.4px solid var(--line);
  border-radius: 9px;
  padding: 22px;
  text-align: center;
}
.pool-card h3 {
  font-family: var(--font-title);
  color: var(--gold-bright);
}
.pool-card .rates {
  color: var(--paper-dim);
  font-size: 12px;
  margin: 10px 0 16px;
  line-height: 1.9;
}
.pity-bar {
  height: 9px;
  background: rgba(10, 8, 5, 0.8);
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  margin: 8px 0;
}
.pity-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold));
  transition: width 0.4s;
}
.gacha-result-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 10px;
}
.gacha-result-grid .gcard {
  animation: flipIn 0.5s backwards;
}
.gacha-result-grid .gcard:nth-child(2) {
  animation-delay: 0.12s;
}
.gacha-result-grid .gcard:nth-child(3) {
  animation-delay: 0.24s;
}
.gacha-result-grid .gcard:nth-child(4) {
  animation-delay: 0.36s;
}
.gacha-result-grid .gcard:nth-child(5) {
  animation-delay: 0.48s;
}
.gacha-result-grid .gcard:nth-child(n + 6) {
  animation-delay: 0.6s;
}
@keyframes flipIn {
  from {
    transform: rotateY(90deg) scale(0.6);
    opacity: 0;
  }
  to {
    transform: rotateY(0) scale(1);
    opacity: 1;
  }
}

/* ============ 商城 / 交易 ============ */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tabs button {
  background: #1f1a0f;
  border: 1.4px solid var(--line);
  color: var(--paper-dim);
  border-radius: 5px;
  padding: 7px 18px;
  font-size: 14px;
  font-family: var(--font-title);
}
.tabs button.active {
  color: var(--gold-bright);
  background: rgba(161, 42, 42, 0.28);
  border-color: var(--gold-dim);
}
.shop-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #1d180d;
  border: 1.4px solid var(--line);
  border-radius: 7px;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.shop-item .si-info {
  flex: 1;
}
.shop-item .si-name {
  font-weight: bold;
  font-family: var(--font-title);
  color: var(--gold-bright);
}
.shop-item .si-desc {
  font-size: 12px;
  color: var(--paper-dim);
  margin-top: 2px;
}
.trade-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.inline-input {
  padding: 8px 10px;
  border-radius: 5px;
  border: 1.4px solid var(--line);
  background: rgba(10, 8, 5, 0.8);
  color: var(--paper);
  outline: none;
}
.inline-input:focus {
  border-color: var(--gold);
}

/* ============ 邮箱 ============ */
.mail-item {
  background: #1d180d;
  border: 1.4px solid var(--line);
  border-radius: 7px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.mail-item .m-title {
  font-weight: bold;
  margin-bottom: 4px;
  font-family: var(--font-title);
  color: var(--gold-bright);
}
.mail-item .m-body {
  font-size: 13px;
  color: var(--paper-dim);
  line-height: 1.7;
}
.mail-item .m-attach {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.attach-chip {
  background: rgba(216, 180, 90, 0.1);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 4px;
}
.mail-item .m-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}
.mail-item .m-time {
  font-size: 11px;
  color: var(--paper-dim);
}

/* ============ 排行榜 ============ */
.rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.rank-table th {
  text-align: left;
  color: var(--paper-dim);
  font-weight: normal;
  padding: 8px 10px;
  border-bottom: 1.4px solid var(--line);
  font-size: 13px;
}
.rank-table td {
  padding: 9px 10px;
  border-bottom: 1px dashed rgba(74, 61, 34, 0.5);
}
.rank-table tr.me td {
  background: rgba(216, 180, 90, 0.09);
}
.rank-table .online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5a6a8a;
  margin-right: 6px;
}
.rank-table .online-dot.on {
  background: var(--jade);
  box-shadow: 0 0 6px rgba(74, 158, 110, 0.8);
}

/* ============ 活动 ============ */
.event-card {
  background: linear-gradient(165deg, #292213, #1a150b);
  border: 1.4px solid var(--line);
  border-radius: 8px;
  padding: 17px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.event-card .ev-t {
  font-weight: bold;
  font-size: 16px;
  font-family: var(--font-title);
  color: var(--gold-bright);
}
.event-card .ev-d {
  font-size: 13px;
  color: var(--paper-dim);
  margin-top: 4px;
}
.event-countdown {
  font-size: 13px;
  color: var(--gold);
  white-space: nowrap;
}
.signin-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.signin-cell {
  background: #1f1a0f;
  border: 1.4px solid var(--line);
  border-radius: 6px;
  padding: 12px 4px;
  text-align: center;
  font-size: 12px;
  position: relative;
}
.signin-cell.done {
  border-color: var(--jade);
  background: rgba(74, 158, 110, 0.09);
}
.signin-cell.today {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(216, 180, 90, 0.35);
}
.signin-cell .sd {
  color: var(--paper-dim);
  font-size: 11px;
}
.signin-cell .sr {
  margin-top: 4px;
}
.signin-cell .sgot {
  position: absolute;
  top: 3px;
  right: 5px;
  color: var(--jade);
}

/* ============ 聊天坞 ============ */
.chat-dock {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 150;
}
.chat-fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 22px;
  background: linear-gradient(160deg, #8c1f28, #5c1218);
  color: var(--gold-bright);
  border: 2px solid var(--gold);
  outline: 1px solid rgba(0, 0, 0, 0.7);
  outline-offset: -5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}
.chat-fab .msr {
  font-size: 24px;
}
.chat-fab:hover {
  box-shadow: 0 8px 28px rgba(216, 180, 90, 0.3);
}
.chat-panel {
  position: absolute;
  left: 0;
  bottom: 62px;
  width: 330px;
  height: 430px;
  background: rgba(20, 16, 9, 0.98);
  border: 1.4px solid var(--gold-dim);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.6);
}
.chat-dock.minimized .chat-panel {
  display: none;
}
.chat-head {
  display: flex;
  align-items: center;
  border-bottom: 1.4px solid var(--gold-dim);
}
.chat-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--paper-dim);
  padding: 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-bottom: 2px solid transparent;
  font-family: var(--font-title);
}
.chat-tab.active {
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
}
.chat-min {
  background: transparent;
  border: none;
  color: var(--paper-dim);
  padding: 0 12px;
}
.chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  font-size: 13px;
}
.chat-msg {
  margin-bottom: 8px;
  line-height: 1.55;
  word-break: break-all;
}
.chat-msg .cn {
  color: var(--gold);
  font-weight: bold;
  margin-right: 6px;
  cursor: pointer;
}
.chat-msg.self .cn {
  color: var(--jade);
}
.chat-msg .ct {
  color: var(--paper-dim);
  font-size: 10px;
  margin-left: 6px;
}
.chat-input {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--line);
}
.chat-input input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 5px;
  border: 1.4px solid var(--line);
  background: rgba(10, 8, 5, 0.8);
  color: var(--paper);
  outline: none;
  font-size: 13px;
}
.chat-input input:focus {
  border-color: var(--gold);
}
.send-btn {
  color: var(--gold-bright);
}
.friend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px dashed rgba(74, 61, 34, 0.5);
  font-size: 13px;
  cursor: pointer;
}
.friend-row:hover {
  background: rgba(216, 180, 90, 0.07);
}
.friend-row .online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5a6a8a;
  flex-shrink: 0;
}
.friend-row .online-dot.on {
  background: var(--jade);
}
.friend-row .fr-name {
  flex: 1;
}
.friend-sec {
  padding: 8px 12px 2px;
  font-size: 11px;
  color: var(--paper-dim);
}
.priv-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

/* ============ 弹窗 / Toast ============ */
#toast-root {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  background: rgba(32, 26, 16, 0.97);
  border: 1.4px solid var(--gold-dim);
  color: var(--paper);
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
  animation: toastIn 0.25s;
  font-family: var(--font-title);
}
.toast.err {
  border-color: var(--red-bright);
  color: #ffb4a8;
}
.toast.ok {
  border-color: var(--jade);
}
@keyframes toastIn {
  from {
    transform: translateY(-12px);
    opacity: 0;
  }
}
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(8, 6, 3, 0.78);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background: linear-gradient(170deg, #241e12, #17120a);
  border: 1.6px solid var(--gold-dim);
  border-radius: 10px;
  padding: 22px;
  outline: 1px solid rgba(0, 0, 0, 0.7);
  outline-offset: -6px;
  max-width: 92vw;
  max-height: 86vh;
  overflow-y: auto;
  min-width: 320px;
}
.modal-box h3 {
  margin-bottom: 14px;
  font-family: var(--font-title);
  color: var(--gold-bright);
}
.modal-close {
  float: right;
  background: none;
  border: none;
  color: var(--paper-dim);
  font-size: 18px;
}
.modal-close:hover {
  color: var(--gold-bright);
}

/* ============================================================
   手机端适配
   ============================================================ */
@media (max-width: 768px) {
  .topbar {
    padding: 6px 10px;
    gap: 8px;
  }
  .tb-logo {
    font-size: 17px;
  }
  .logo-mini {
    width: 26px;
    height: 26px;
    font-size: 15px;
  }
  .tb-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .tb-nav::-webkit-scrollbar {
    display: none;
  }
  .tb-nav button {
    padding: 6px 10px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .tb-nav button .msr {
    font-size: 17px;
  }
  .tb-right {
    gap: 6px;
  }
  .tb-user {
    display: none;
  }
  .res {
    font-size: 12.5px;
  }
  .panel-wrap {
    padding: 12px 10px 110px;
  }
  .panel-title {
    font-size: 19px;
    margin-bottom: 12px;
  }
  .home-grid,
  .deck-layout,
  .pool-cards {
    grid-template-columns: 1fr;
  }
  .deck-side {
    position: static;
    max-height: none;
  }
  .signin-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .quick-entries {
    grid-template-columns: repeat(3, 1fr);
  }
  /* 卡牌缩小 */
  .gcard {
    width: 92px;
    height: 134px;
    border-radius: 7px;
  }
  .gcard .g-art {
    font-size: 36px;
    margin-top: 24px;
  }
  .gcard .g-name {
    font-size: 11.5px;
  }
  .gcard .g-cost {
    width: 22px;
    height: 22px;
  }
  .gcard .g-atk,
  .gcard .g-hp {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }
  .card-grid {
    gap: 8px;
  }
  /* 战斗界面 */
  #scene-battle {
    height: 100dvh;
  }
  .battle-top {
    padding: 4px 8px;
  }
  .bt-info {
    font-size: 12px;
    max-width: 46vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .battle-wrap {
    padding: 4px 4px;
    gap: 2px;
  }
  .players-row {
    gap: 10px;
  }
  .hero-box {
    padding: 4px 8px;
    gap: 6px;
  }
  .hero-face {
    width: 34px;
    height: 34px;
    font-size: 20px;
  }
  .hero-meta {
    font-size: 10px;
  }
  .hp-orb {
    min-width: 28px;
    height: 28px;
    font-size: 12px;
  }
  .board-minion {
    width: 50px;
    height: 62px;
  }
  .board-minion .bm-art {
    font-size: 20px;
  }
  .board-minion .bm-name {
    display: none;
  }
  .mini-row {
    min-height: 52px;
    gap: 4px;
  }
  .hand-row {
    min-height: 106px;
    overflow-x: auto;
    justify-content: flex-start;
  }
  .hand-row .gcard {
    margin: 0 -12px;
    flex-shrink: 0;
  }
  .endturn-btn {
    padding: 8px 20px;
    font-size: 14px;
    letter-spacing: 2px;
  }
  .battle-log {
    right: 4px;
    left: 4px;
    width: auto;
    top: auto;
    bottom: 70px;
    height: 32vh;
    z-index: 95;
  }
  .fly-num {
    font-size: 19px;
  }
  .chat-panel {
    width: calc(100vw - 20px);
    height: 62vh;
  }
  .bo-card {
    padding: 24px 22px;
  }
  .bo-title {
    font-size: 28px;
    letter-spacing: 6px;
  }
  .mode-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .login-box {
    padding: 28px 20px;
  }
  .login-logo h1 {
    font-size: 26px;
    letter-spacing: 7px;
  }
  .code-chip {
    font-size: 20px;
    letter-spacing: 5px;
  }
}

/* ============================================================
   管理后台（admin.html）· 复用全局古风变量
   ============================================================ */
.stat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  flex: 1;
  min-width: 148px;
  background: linear-gradient(170deg, #241e12, #17120a);
  border: 1.4px solid var(--gold-dim);
  border-radius: 8px;
  outline: 1px solid rgba(0, 0, 0, 0.6);
  outline-offset: -4px;
  padding: 14px 18px;
}
.stat-card b {
  display: block;
  font-size: 27px;
  color: var(--gold-bright);
  font-family: var(--font-title);
  line-height: 1.3;
}
.stat-card span {
  color: var(--paper-dim);
  font-size: 13px;
}
.stat-card.warn b {
  color: #e89a8a;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: linear-gradient(170deg, #1d1810, #15110a);
  border: 1.4px solid var(--gold-dim);
  border-radius: 8px;
  overflow: hidden;
}
.tbl th {
  background: linear-gradient(180deg, #2b2312, #1f190e);
  color: var(--gold);
  font-weight: normal;
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1.4px solid var(--gold-dim);
  white-space: nowrap;
}
.tbl td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(74, 61, 34, 0.45);
  white-space: nowrap;
  color: var(--paper);
}
.tbl tr:last-child td {
  border-bottom: none;
}
.tbl tr:hover td {
  background: rgba(216, 180, 90, 0.05);
}
.tbl .ops {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 12px;
  border: 1px solid var(--line);
  color: var(--paper-dim);
}
.tag.ok {
  color: #8fd6a8;
  border-color: #3a6b4a;
  background: rgba(74, 158, 110, 0.1);
}
.tag.ban {
  color: #e89a8a;
  border-color: #8a4438;
  background: rgba(161, 42, 42, 0.12);
}
.tag.adm {
  color: #f0c86a;
  border-color: var(--gold-dim);
  background: rgba(216, 180, 90, 0.1);
}
.tag.off {
  color: var(--paper-dim);
}

.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar input,
.filter-bar select {
  background: rgba(10, 8, 5, 0.8);
  border: 1.4px solid var(--line);
  border-radius: 6px;
  color: var(--paper);
  padding: 7px 10px;
  font-size: 14px;
  outline: none;
}
.filter-bar input:focus,
.filter-bar select:focus {
  border-color: var(--gold);
}
.pager {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  color: var(--paper-dim);
  font-size: 13px;
}

.frm label {
  display: block;
  color: var(--paper-dim);
  font-size: 13px;
  margin: 12px 0 4px;
}
.frm input,
.frm select,
.frm textarea {
  width: 100%;
  background: rgba(10, 8, 5, 0.8);
  border: 1.4px solid var(--line);
  border-radius: 6px;
  color: var(--paper);
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
  transition: 0.15s;
}
.frm input:focus,
.frm select:focus,
.frm textarea:focus {
  border-color: var(--gold);
}
.frm .frm-row {
  display: flex;
  gap: 10px;
}
.frm .frm-row > div {
  flex: 1;
}
.attach-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}
.attach-row select,
.attach-row input {
  width: auto;
  flex: 1;
  min-width: 0;
}
.no-perm {
  text-align: center;
  padding: 80px 20px;
  color: var(--paper-dim);
}
.no-perm h2 {
  color: var(--gold-bright);
  margin-bottom: 14px;
}
