:root {
  color-scheme: dark;
  --bg: #0f1726;
  --panel: #202a3a;
  --panel-2: #253246;
  --line: rgba(147, 166, 197, 0.16);
  --text: #f7fbff;
  --muted: #9ea9bd;
  --blue: #3d9bff;
  --blue-2: #1673d7;
  --green: #43d179;
  --red: #ff5666;
  --purple: #9a6cff;
  --orange: #f18b1c;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background:
    radial-gradient(circle at 18% 0%, rgba(42, 121, 207, 0.18), transparent 26%),
    linear-gradient(180deg, #111827 0%, #0b1420 100%);
  color: var(--text);
}

button, input, select { font: inherit; }
button { border: 0; color: inherit; cursor: pointer; }

.app-shell {
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 14px max(108px, calc(94px + env(safe-area-inset-bottom)));
  background:
    linear-gradient(180deg, rgba(18, 27, 43, 0.96), rgba(11, 22, 35, 0.98)),
    var(--bg);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04), var(--shadow);
}

.topbar {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 72px 72px;
  gap: 10px;
  align-items: center;
  padding: 10px 0 14px;
}

.icon-button, .square-action {
  height: 52px;
  border-radius: 8px;
  background: rgba(42, 54, 76, 0.94);
  box-shadow: inset 0 1px rgba(255,255,255,0.05), 0 8px 18px rgba(0,0,0,0.2);
}

.icon-button { display: grid; place-content: center; gap: 7px; }
.icon-button span { display: block; width: 28px; height: 3px; border-radius: 8px; background: #eef6ff; }

.room-title { min-width: 0; }
.room-line { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 800; white-space: nowrap; }
.room-line strong { overflow: hidden; text-overflow: ellipsis; }
.copy-button {
  width: 22px;
  height: 26px;
  flex: 0 0 auto;
  background: transparent;
  border: 2px solid #b8c7da;
  border-radius: 4px;
  position: relative;
}
.copy-button::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 18px;
  border: 2px solid #b8c7da;
  border-radius: 3px;
  right: -7px;
  top: 5px;
  background: #111827;
}

.room-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}
.room-meta b { color: #dce7f7; font-weight: 700; }
.net-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #5d6576;
  box-shadow: 0 0 0 5px rgba(255,255,255,0.03);
  vertical-align: -1px;
}
.net-dot.online { background: var(--green); }

.square-action {
  display: grid;
  place-items: center;
  gap: 2px;
  color: #eef6ff;
  font-weight: 800;
}
.square-action small { font-size: 13px; color: #dce7f7; }
.share-icon, .gear-icon, .bolt-icon, .swirl-icon, .reset-icon { display: block; position: relative; }
.share-icon { width: 23px; height: 23px; border: 3px solid #fff; border-radius: 6px; }
.share-icon::before { content: ""; position: absolute; width: 9px; height: 9px; border: 3px solid #fff; border-radius: 50%; right: -8px; top: -8px; }
.gear-icon { width: 27px; height: 27px; border: 6px dotted #fff; border-radius: 50%; }
.gear-icon::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #fff; }

.tabs {
  display: flex;
  gap: 8px;
  padding: 7px;
  border-radius: 8px;
  background: rgba(31, 40, 58, 0.95);
  border: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tabs button {
  min-width: 106px;
  flex: 1 0 auto;
  height: 42px;
  border-radius: 8px;
  background: transparent;
  color: #d7dfec;
  font-weight: 800;
}
.tabs button.active {
  background: linear-gradient(180deg, #44a7ff, #1b75d7);
  box-shadow: inset 0 1px rgba(255,255,255,0.26), 0 8px 18px rgba(16, 94, 188, 0.28);
  color: #fff;
}

.list-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 92px 118px;
  padding: 16px 18px 8px;
  color: var(--muted);
  font-size: 14px;
}
.list-head span:nth-child(3), .list-head span:nth-child(4) { text-align: center; }

.member-list { display: grid; gap: 6px; }
.member-row {
  display: grid;
  grid-template-columns: 44px 58px minmax(0, 1fr) 96px 126px;
  align-items: center;
  min-height: 68px;
  padding: 8px 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(38, 52, 72, 0.96), rgba(34, 47, 66, 0.96));
  border: 1px solid rgba(132, 157, 190, 0.08);
}
.rank { font-size: 20px; font-weight: 900; text-align: center; }
.rank.host { color: #ffc335; }
.rank.host::before { content: "♛ "; color: #ffb624; }
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.35);
  background: linear-gradient(135deg, #4869d8, #d45f86);
  overflow: hidden;
}
.member-main { min-width: 0; }
.name { font-size: 19px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name.mine { color: #55df82; }
.skill { color: #eef3fa; font-size: 15px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skill-panels {
  grid-column: 4 / 6;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  min-width: 0;
}
.skill-panels.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.skill-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px 88px;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.skill-panel-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #d9e6f7;
  font-size: 13px;
  font-weight: 800;
}
.state-pill {
  justify-self: center;
  min-width: 72px;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid rgba(83, 214, 128, 0.28);
  color: var(--green);
  background: rgba(37, 92, 70, 0.18);
  text-align: center;
  font-weight: 800;
  font-size: 14px;
}
.state-pill.cooldown {
  color: var(--purple);
  border-color: rgba(154, 108, 255, 0.35);
  background: rgba(68, 54, 126, 0.22);
}
.cooldown-cell { display: grid; gap: 6px; color: var(--green); font-size: 19px; font-weight: 900; text-align: right; }
.cooldown-cell.active { color: var(--red); }
.bar { height: 7px; border-radius: 999px; background: rgba(151, 166, 185, 0.2); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--green); }
.cooldown-cell.active .bar > span { background: linear-gradient(90deg, #ff5063, #ff7c85); }
.group-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: #8c9bb1;
  font-weight: 800;
}
.group-separator::before, .group-separator::after { content: ""; height: 1px; flex: 1; border-top: 1px dashed rgba(142, 161, 188, 0.26); }
.empty-state {
  padding: 34px 18px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(150, 170, 200, 0.25);
  border-radius: 8px;
  background: rgba(35, 47, 66, 0.42);
}

.action-dock {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 5;
  width: min(100%, 520px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(var(--action-count, 2), minmax(0, 1fr));
  gap: 10px;
  padding: 14px 14px max(14px, env(safe-area-inset-bottom));
  background: rgba(26, 39, 57, 0.98);
  border-top: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 -12px 34px rgba(0,0,0,0.32);
}
.big-action {
  min-height: 78px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  gap: 3px;
  box-shadow: inset 0 1px rgba(255,255,255,0.25), 0 10px 20px rgba(0,0,0,0.2);
}
.big-action b { font-size: clamp(15px, 4.5vw, 22px); white-space: nowrap; }
.big-action:disabled { opacity: .45; cursor: not-allowed; }
.big-action.danger { background: linear-gradient(180deg, #ff6670, #cf2639); }
.big-action.primary { background: linear-gradient(180deg, #45acff, #176fd6); }
.big-action.warn { background: linear-gradient(180deg, #ffad35, #d16b00); }
.bolt-icon { width: 16px; height: 26px; clip-path: polygon(42% 0, 100% 0, 65% 42%, 100% 42%, 25% 100%, 42% 54%, 0 54%); background: #fff; }
.swirl-icon { width: 28px; height: 28px; border: 4px solid #fff; border-left-color: transparent; border-radius: 50%; }
.reset-icon { width: 28px; height: 28px; border: 4px solid #fff; border-right-color: transparent; border-radius: 50%; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: rgba(0,0,0,.48);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 10;
  width: min(420px, 92vw);
  height: 100dvh;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  background: #172235;
  box-shadow: -18px 0 40px rgba(0,0,0,0.38);
  transform: translateX(105%);
  transition: transform .22s ease;
  overflow: auto;
}
.drawer.show { transform: translateX(0); }
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.drawer-head strong { display: block; font-size: 22px; }
.drawer-head span { display: block; color: var(--muted); margin-top: 4px; }
.close-button { width: 40px; height: 40px; border-radius: 8px; background: #253247; font-size: 28px; line-height: 1; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: grid; gap: 6px; color: #cbd6e6; font-size: 13px; font-weight: 800; }
label.wide { grid-column: 1 / -1; }
input, select {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid rgba(154, 174, 204, 0.22);
  background: #101a2a;
  color: #fff;
  padding: 0 12px;
  outline: none;
}
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(61,155,255,0.18); }
.drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.drawer-actions button {
  min-height: 44px;
  border-radius: 8px;
  background: linear-gradient(180deg, #3a95ee, #176fd6);
  font-weight: 900;
}
.drawer-actions .ghost-danger { background: rgba(255,86,102,.14); color: #ff9da7; border: 1px solid rgba(255,86,102,.28); }
.message { min-height: 22px; color: #aebdd2; line-height: 1.5; }
.message.error { color: #ff99a4; }
.message.ok { color: #6fe39b; }

.voice-test-card {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(93, 150, 255, 0.24);
  background: rgba(32, 42, 58, 0.58);
}
.voice-test-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.voice-test-head strong {
  display: block;
  font-size: 17px;
}
.voice-test-head span,
.voice-test-peers {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.voice-test-mic {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.voice-test-mic input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--purple);
}
.voice-test-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.voice-test-actions button {
  min-height: 42px;
  border-radius: 8px;
  font-weight: 900;
  background: linear-gradient(180deg, #44a7ff, #1b75d7);
}
.voice-test-actions button:last-child {
  background: rgba(255, 86, 102, .12);
  color: #ff9da7;
  border: 1px solid rgba(255, 86, 102, .28);
}
.voice-test-actions button:disabled {
  opacity: .48;
  cursor: not-allowed;
}
.voice-test-peers {
  display: grid;
  gap: 8px;
  min-height: 22px;
}
.voice-test-peer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(15, 26, 42, .62);
  border: 1px solid rgba(148, 163, 184, .16);
}
.voice-test-peer.connected {
  border-color: rgba(67, 209, 121, .42);
  background: rgba(37, 92, 70, .15);
}
.voice-test-peer b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.voice-test-peer span {
  color: #dce7f7;
  font-size: 12px;
}
.voice-test-peer em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

@media (max-width: 430px) {
  .app-shell { padding-left: 10px; padding-right: 10px; }
  .topbar { grid-template-columns: 48px minmax(0, 1fr) 58px 58px; gap: 7px; }
  .icon-button, .square-action { height: 48px; }
  .square-action small { font-size: 12px; }
  .room-line { font-size: 21px; }
  .room-meta { gap: 10px; font-size: 12px; }
  .list-head { grid-template-columns: 34px minmax(0, 1fr) 74px 92px; padding-left: 10px; padding-right: 10px; font-size: 12px; }
  .member-row { grid-template-columns: 34px 46px minmax(0, 1fr) 74px 92px; padding: 8px 8px; }
  .avatar { width: 38px; height: 38px; }
  .name { font-size: 16px; }
  .skill { font-size: 13px; }
  .state-pill { min-width: 62px; padding: 5px 6px; font-size: 12px; }
  .cooldown-cell { font-size: 16px; }
  .skill-panels { gap: 6px; }
  .skill-panel { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .skill-panel-name { font-size: 11px; }
  .skill-panels.two .state-pill,
  .skill-panels.two .cooldown-cell { justify-self: stretch; text-align: center; }
  .form-grid { grid-template-columns: 1fr; }
  .action-dock { gap: 7px; padding-left: 10px; padding-right: 10px; }
  .big-action { min-height: 72px; }
  .big-action b { font-size: clamp(13px, 3.8vw, 16px); }
}

/* ================================
   移动端成员列表两行布局修复
   第一行：序号 + 头像 + 玩家信息 + 状态
   第二行：技能1/技能2冷却
================================ */

.member-row {
  display: grid !important;
  grid-template-columns: 34px 44px minmax(0, 1fr) 74px !important;
  grid-template-areas:
    "rank avatar main state"
    "rank avatar cooldown cooldown" !important;
  column-gap: 8px;
  row-gap: 6px;
  align-items: center;
  padding: 10px;
}

.member-row .rank {
  grid-area: rank;
  font-size: 14px;
  white-space: nowrap;
}

.member-row .avatar {
  grid-area: avatar;
}

.member-row .member-main {
  grid-area: main;
  min-width: 0;
}

.member-row .name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-row .skill {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-row > .state-pill {
  grid-area: state;
  justify-self: end;
  width: 72px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  font-size: 13px;
  white-space: nowrap;
}

.cooldown-panels {
  grid-area: cooldown;
  display: grid;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.cooldown-panels.one {
  grid-template-columns: 1fr;
}

.cooldown-panels.two {
  grid-template-columns: 1fr 1fr;
}

.cooldown-panel {
  min-width: 0;
  width: 100%;
}

.cooldown-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
  font-size: 12px;
  line-height: 14px;
}

.cooldown-skill-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #cbd5e1;
}

.cooldown-panel-head b {
  flex: 0 0 auto;
  color: #4ade80;
  font-size: 13px;
}

.cooldown-panel .bar {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
}

.cooldown-panel .bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #4ade80;
}

.cooldown-panel.active .bar span {
  background: #f59e0b;
}

/* 防止旧布局残留影响 */
.member-row .skill-panels {
  display: none !important;
}

/* 表头改成 3 列 */
.list-head {
  grid-template-columns: 34px minmax(0, 1fr) 74px !important;
}

.list-head span:nth-child(4) {
  display: none !important;
}

@media (max-width: 390px) {
  .member-row {
    grid-template-columns: 30px 40px minmax(0, 1fr) 68px !important;
    column-gap: 6px;
    padding: 9px 8px;
  }

  .member-row > .state-pill {
    width: 68px;
    font-size: 12px;
  }

  .cooldown-panels.two {
    gap: 5px;
  }

  .cooldown-panel-head {
    font-size: 11px;
  }

  .cooldown-panel-head b {
    font-size: 12px;
  }
}

/* ================================
   极限紧凑版成员卡片
   头像 + 玩家名 + 技能1状态倒计时
        + 双技能 + 技能2状态倒计时
================================ */

.member-row {
  display: grid !important;
  grid-template-columns: 42px 92px minmax(0, 1fr) !important;
  grid-template-areas:
    "avatar name skill1"
    "avatar desc skill2" !important;
  column-gap: 7px;
  row-gap: 4px;
  align-items: center;
  padding: 7px 9px !important;
  border-radius: 8px;
  min-height: 58px;
}

/* 清掉旧排名/皇冠 */
.member-row .rank {
  display: none !important;
}

/* 头像 */
.member-row .avatar {
  grid-area: avatar;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  font-size: 18px !important;
  align-self: center;
}

/* 第一行：玩家名 */
.member-name-line {
  grid-area: name;
  min-width: 0;
}

.member-name-line .name {
  font-size: 17px !important;
  line-height: 20px;
  font-weight: 800;
  color: #4ade80;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 第二行：双技能/单技能 */
.member-skill-line {
  grid-area: desc;
  min-width: 0;
}

.member-skill-line .skill {
  font-size: 12px !important;
  line-height: 16px;
  color: #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 技能1、技能2所在格子 */
.skill-line-one {
  grid-area: skill1;
  min-width: 0;
}

.skill-line-two {
  grid-area: skill2;
  min-width: 0;
}

/* 一行技能：状态框 + 倒计时条 */
.skill-inline {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  column-gap: 5px;
  align-items: center;
  min-width: 0;
}

/* 状态小框 */
.skill-state-box {
  height: 21px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  box-sizing: border-box;
}

.skill-inline.ready .skill-state-box {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.36);
}

.skill-inline.cooldown .skill-state-box {
  color: #a78bfa;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.45);
}

/* 倒计时条 */
.skill-time-box {
  min-width: 0;
  height: 21px;
  border-radius: 6px;
  padding: 2px 5px;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.16);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.skill-time-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  height: 10px;
  line-height: 10px;
  min-width: 0;
}

.skill-time-head span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #f8fafc;
  font-size: 10px;
  font-weight: 600;
}

.skill-time-head b {
  flex: 0 0 auto;
  font-size: 10px;
  color: #4ade80;
  white-space: nowrap;
}

.skill-inline.cooldown .skill-time-head b {
  color: #fbbf24;
}

/* 进度条 */
.skill-time-box .bar {
  width: 100%;
  height: 4px;
  margin-top: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.24);
}

.skill-time-box .bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #4ade80;
}

.skill-inline.cooldown .bar span {
  background: #f59e0b;
}

.skill-inline-placeholder {
  height: 21px;
}

/* 清掉旧布局，避免叠加 */
.member-row .member-main,
.member-row .skill-panels,
.member-row .cooldown-panels,
.member-row .cooldown-list,
.member-row .skill-status-list,
.member-row .skill-lines {
  display: none !important;
}

.member-row > .state-pill {
  display: none !important;
}

/* 表头改成 3 列 */
.list-head {
  grid-template-columns: 34px minmax(0, 1fr) 90px !important;
}

.list-head span:nth-child(4) {
  display: none !important;
}

/* 小屏压缩 */
@media (max-width: 390px) {
  .member-row {
    grid-template-columns: 38px 78px minmax(0, 1fr) !important;
    column-gap: 6px;
    row-gap: 3px;
    padding: 6px 8px !important;
    min-height: 54px;
  }

  .member-row .avatar {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    font-size: 16px !important;
  }

  .member-name-line .name {
    font-size: 15px !important;
    line-height: 18px;
  }

  .member-skill-line .skill {
    font-size: 11px !important;
    line-height: 14px;
  }

  .skill-inline {
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 4px;
  }

  .skill-state-box {
    height: 20px;
    font-size: 9px;
    padding: 0 3px;
  }

  .skill-time-box {
    height: 20px;
    padding: 2px 4px;
  }

  .skill-time-head span,
  .skill-time-head b {
    font-size: 9px;
  }

  .skill-time-box .bar {
    height: 4px;
    margin-top: 2px;
  }
}

/* ================================
   单技能自适应填充
   单技能：右侧技能条垂直居中，占满右侧
   双技能：保持两行布局
================================ */

.member-row.single-skill {
  grid-template-areas:
    "avatar name skill1"
    "avatar desc skill1" !important;
}

.member-row.single-skill .skill-line-one {
  align-self: center;
}

.member-row.single-skill .skill-line-two {
  display: none !important;
}

.member-row.single-skill .skill-inline {
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
}

.member-row.single-skill .skill-state-box {
  height: 26px;
}

.member-row.single-skill .skill-time-box {
  height: 26px;
}

.member-row.single-skill .skill-time-head {
  height: 12px;
  line-height: 12px;
}

.member-row.single-skill .skill-time-box .bar {
  margin-top: 4px;
}

/* 小屏单技能压缩 */
@media (max-width: 390px) {
  .member-row.single-skill .skill-inline {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .member-row.single-skill .skill-state-box {
    height: 24px;
  }

  .member-row.single-skill .skill-time-box {
    height: 24px;
  }
}
/* 底部操作按钮触摸优化 */
.action-dock {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.action-dock .big-action {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

/* 防止按钮内部 span/b 抢事件 */
.action-dock .big-action span,
.action-dock .big-action b {
  pointer-events: none;
}

/* 按下反馈，确认确实点到了 */
.action-dock .big-action:active {
  transform: scale(0.97);
  opacity: 0.88;
}
/* ================================
   iPad 游戏侧边栏模式
   目的：iPad 窗口本身无法再缩小时，只把可操作内容压到左侧窄条内。
   开启：点击顶部“边栏”，或访问 ?edge=1 / ?sidebar=1
================================ */
.topbar {
  grid-template-columns: 58px minmax(0, 1fr) 72px 72px 72px;
}

.edge-icon {
  width: 26px;
  height: 26px;
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 4px;
}
.edge-icon::before,
.edge-icon::after {
  content: "";
  display: block;
  border-radius: 4px;
  background: #fff;
}
.edge-icon::after {
  opacity: .48;
}

@media (max-width: 430px) {
  .topbar {
    grid-template-columns: 48px minmax(0, 1fr) 58px 58px 58px;
  }
}

body.edge-mode {
  --edge-width: 142px;
  background: transparent !important;
  overflow: hidden;
}

body.edge-mode .app-shell {
  width: var(--edge-width) !important;
  min-width: var(--edge-width) !important;
  max-width: var(--edge-width) !important;
  min-height: 100dvh;
  margin: 0 !important;
  padding: max(6px, env(safe-area-inset-top)) 6px max(176px, calc(166px + env(safe-area-inset-bottom))) !important;
  background: linear-gradient(180deg, rgba(12, 20, 35, 0.90), rgba(9, 16, 28, 0.92));
  border-right: 1px solid rgba(255,255,255,0.08);
  box-shadow: 8px 0 28px rgba(0,0,0,.24);
}

body.edge-mode .topbar {
  grid-template-columns: 34px minmax(0, 1fr) !important;
  gap: 6px !important;
  padding: 0 0 6px !important;
}

body.edge-mode .icon-button {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(63, 78, 107, .72);
  gap: 4px;
}
body.edge-mode .icon-button span {
  width: 18px;
  height: 2px;
}

body.edge-mode .room-title {
  align-self: stretch;
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 0 6px;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(58, 153, 255, .88), rgba(28, 108, 205, .90));
}
body.edge-mode .room-line {
  gap: 0;
  font-size: 14px !important;
  line-height: 16px;
  min-width: 0;
}
body.edge-mode .room-line span,
body.edge-mode .copy-button,
body.edge-mode .room-meta,
body.edge-mode .square-action {
  display: none !important;
}
body.edge-mode .room-line strong {
  display: block;
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.edge-mode .room-line strong::before {
  content: "房 ";
  opacity: .9;
}

body.edge-mode .tabs {
  padding: 4px;
  gap: 4px;
  border-radius: 9px;
  background: rgba(18, 29, 47, .72);
}
body.edge-mode .tabs button {
  min-width: 92px;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 13px;
}

body.edge-mode .list-head,
body.edge-mode .empty-state {
  display: none !important;
}

body.edge-mode .member-list {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  max-height: calc(100dvh - 236px);
  overflow-y: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
body.edge-mode .member-list::-webkit-scrollbar {
  display: none;
}

body.edge-mode .group-separator {
  margin: 2px 0;
  gap: 4px;
  font-size: 10px;
  opacity: .78;
}

.edge-member-row {
  min-width: 0;
  padding: 6px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(38, 52, 75, .88), rgba(26, 38, 58, .92));
  border: 1px solid rgba(148, 163, 184, .10);
}
.edge-member-top {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-width: 0;
}
.edge-member-row .avatar {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  font-size: 16px !important;
}
.edge-member-meta {
  min-width: 0;
}
.edge-member-name {
  font-size: 14px;
  line-height: 17px;
  font-weight: 900;
  color: #55df82;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.edge-member-skill {
  margin-top: 1px;
  font-size: 11px;
  line-height: 13px;
  color: rgba(226, 232, 240, .84);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.edge-skill-list {
  display: grid;
  gap: 4px;
  margin-top: 5px;
}
.edge-skill-chip {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 24px;
  border-radius: 8px;
  padding: 0 5px;
  background: rgba(15, 23, 42, .42);
  border: 1px solid rgba(148, 163, 184, .10);
}
.edge-skill-chip span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  background: rgba(61, 155, 255, .55);
}
.edge-skill-chip b {
  min-width: 0;
  text-align: right;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  color: #4ade80;
}
.edge-skill-chip.cooldown b {
  color: #fbbf24;
}
.edge-skill-chip.cooldown span {
  background: rgba(245, 158, 11, .68);
}

body.edge-mode .action-dock {
  left: 0 !important;
  right: auto !important;
  bottom: 0 !important;
  transform: none !important;
  width: var(--edge-width) !important;
  max-width: var(--edge-width) !important;
  grid-template-columns: 1fr !important;
  gap: 6px !important;
  padding: 7px 6px max(7px, env(safe-area-inset-bottom)) !important;
  background: rgba(13, 22, 37, .94) !important;
  border-top: 1px solid rgba(255,255,255,.08);
  border-right: 1px solid rgba(255,255,255,.08);
}
body.edge-mode .big-action {
  min-height: 48px !important;
  height: 48px;
  border-radius: 10px;
  grid-template-columns: 28px minmax(0, 1fr);
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 0 8px;
}
body.edge-mode .big-action b {
  justify-self: start;
  max-width: 82px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px !important;
  line-height: 16px;
}
body.edge-mode .bolt-icon,
body.edge-mode .swirl-icon,
body.edge-mode .reset-icon {
  transform: scale(.78);
}

body.edge-mode .drawer {
  left: 0;
  right: auto;
  width: min(360px, 96vw);
  transform: translateX(-105%);
}
body.edge-mode .drawer.show {
  transform: translateX(0);
}

body.edge-mode .drawer-backdrop.show {
  background: rgba(0,0,0,.18);
}

/* 边栏模式下保留一个小按钮用于退出边栏模式 */
body.edge-mode .topbar {
  grid-template-columns: 34px minmax(0, 1fr) 34px !important;
}
body.edge-mode .square-action.edge-mode-toggle {
  display: grid !important;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(63, 78, 107, .72);
  padding: 0;
}
body.edge-mode .edge-mode-toggle small {
  display: none !important;
}
body.edge-mode .edge-mode-toggle .edge-icon {
  width: 18px;
  height: 18px;
  grid-template-columns: 6px 1fr;
  gap: 3px;
}
body.edge-mode .room-line strong {
  max-width: 100% !important;
}

/* ================================
   iPad 边栏极简 iOS 风格优化（第三版）
   - 去头像
   - 表格式列表
   - 上报按钮更大、更快触发
   - 重置改成长按，降低误触
================================ */
button,
.icon-button,
.square-action,
.big-action,
.tabs button,
.copy-button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

body.edge-mode {
  background: transparent;
}

body.edge-mode .app-shell {
  width: min(100%, 154px);
  margin: 0;
  padding: max(10px, env(safe-area-inset-top)) 6px max(128px, calc(110px + env(safe-area-inset-bottom))) 6px;
  background: linear-gradient(180deg, rgba(17, 24, 39, .76), rgba(13, 19, 31, .84));
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  box-shadow: 0 10px 28px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.08);
  border-right: 1px solid rgba(255,255,255,.08);
}

body.edge-mode .topbar {
  grid-template-columns: 30px minmax(0, 1fr) 30px 30px 30px;
  gap: 4px;
  padding: 0 0 8px;
}
body.edge-mode .icon-button,
body.edge-mode .square-action {
  height: 30px;
  border-radius: 10px;
  background: rgba(71, 85, 105, .28);
  box-shadow: inset 0 1px rgba(255,255,255,.08);
}
body.edge-mode .icon-button span {
  width: 14px;
  height: 2px;
}
body.edge-mode .room-line strong {
  max-width: 58px;
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
}
body.edge-mode .tabs {
  margin-bottom: 6px;
  padding: 3px;
  background: rgba(51, 65, 85, .20);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
}
body.edge-mode .tabs button {
  min-width: 0;
  width: 100%;
  height: 30px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
}
body.edge-mode .tabs button.active {
  background: linear-gradient(180deg, #5ca8ff, #3182f6);
  box-shadow: inset 0 1px rgba(255,255,255,.24), 0 4px 12px rgba(49, 130, 246, .24);
}

body.edge-mode .member-list {
  gap: 4px;
  margin-top: 0;
  max-height: calc(100dvh - 218px);
  overflow-y: auto;
}

.edge-table-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 34px;
  align-items: center;
  gap: 4px;
  padding: 0 6px 4px;
  color: rgba(226, 232, 240, .62);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
}
.edge-table-head span:nth-child(2),
.edge-table-head span:nth-child(3) {
  text-align: center;
}

.edge-member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 34px;
  align-items: center;
  gap: 4px;
  padding: 6px 6px 5px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(30, 41, 59, .48), rgba(15, 23, 42, .58));
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.edge-member-row.mine {
  background: linear-gradient(180deg, rgba(21, 101, 192, .34), rgba(15, 23, 42, .62));
  border-color: rgba(96, 165, 250, .22);
}
.edge-member-row.host .edge-member-name::after {
  content: ' •房';
  color: #fbbf24;
  font-size: 10px;
  font-weight: 700;
}
.edge-name-col {
  min-width: 0;
}
.edge-member-name {
  font-size: 12px;
  line-height: 15px;
  font-weight: 800;
  color: #ecf4ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.edge-member-meta {
  margin-top: 1px;
  font-size: 10px;
  line-height: 12px;
  color: rgba(203, 213, 225, .70);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.edge-state-cell {
  height: 36px;
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: rgba(15, 23, 42, .34);
  border: 1px solid rgba(255,255,255,.05);
}
.edge-state-cell span {
  font-size: 9px;
  line-height: 10px;
  font-weight: 700;
  color: rgba(203, 213, 225, .72);
}
.edge-state-cell b {
  font-size: 10px;
  line-height: 12px;
  font-weight: 800;
}
.edge-state-cell.ready b {
  color: #4ade80;
}
.edge-state-cell.cooldown {
  background: rgba(124, 58, 237, .08);
  border-color: rgba(167, 139, 250, .18);
}
.edge-state-cell.cooldown b {
  color: #f59e0b;
}
.edge-state-cell.empty b {
  color: rgba(148, 163, 184, .62);
}

body.edge-mode .action-dock {
  left: 0;
  width: 154px;
  transform: none;
  grid-template-columns: 1fr;
  gap: 7px;
  padding: 8px 6px max(8px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(17, 24, 39, .28), rgba(17, 24, 39, .76));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,.06);
  box-shadow: none;
}
body.edge-mode .big-action.ios-action {
  min-height: 52px;
  height: 52px;
  border-radius: 14px;
  grid-template-columns: 20px 1fr;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  font-weight: 900;
  box-shadow: inset 0 1px rgba(255,255,255,.18), 0 5px 14px rgba(0,0,0,.20);
}
body.edge-mode .big-action.ios-action b {
  font-size: 15px;
  line-height: 1;
}
body.edge-mode .big-action.ios-action.primary {
  background: linear-gradient(180deg, #4ea4ff, #3182f6);
}
body.edge-mode .big-action.ios-action.danger {
  background: linear-gradient(180deg, #ff6b82, #ef476f);
}
body.edge-mode .big-action.ios-action.warn {
  background: linear-gradient(180deg, #f7b955, #e49d2d);
}
body.edge-mode .big-action.ios-action.reset-long {
  min-height: 36px;
  height: 36px;
  opacity: .88;
  border-radius: 12px;
}
body.edge-mode .big-action.ios-action.reset-long b {
  font-size: 12px;
}
body.edge-mode .big-action.ios-action:active {
  transform: scale(.985);
  filter: brightness(.96);
}
body.edge-mode .big-action.ios-action.holding {
  filter: brightness(1.08);
  box-shadow: inset 0 0 0 999px rgba(255,255,255,.10), 0 0 0 2px rgba(255,255,255,.18);
}
body.edge-mode .big-action.ios-action.holding::after {
  content: '';
  position: absolute;
  inset: auto 12px 6px 12px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  animation: resetHoldFill .6s linear forwards;
  transform-origin: left center;
}
@keyframes resetHoldFill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* 兼容旧边栏结构，直接隐藏 */
body.edge-mode .edge-member-top,
body.edge-mode .edge-skill-list {
  display: none !important;
}
body.edge-mode .big-action.ios-action { position: relative; overflow: hidden; }


/* v4: 重置按钮改回点击触发，不使用长按样式 */
body.edge-mode .big-action.ios-action.warn {
  min-height: 52px;
  height: 52px;
  opacity: 1;
  border-radius: 14px;
}
body.edge-mode .big-action.ios-action.warn b {
  font-size: 15px;
}
body.edge-mode .big-action.ios-action.holding::after {
  display: none !important;
}

/* 倒计时 <= 10 秒红色高亮 */
.skill-inline.cooldown.urgent .skill-state-box,
.skill-inline.cooldown.urgent .skill-time-head b {
  color: #ff3b30 !important;
}
.skill-inline.cooldown.urgent .skill-time-box {
  border-color: rgba(255, 59, 48, .42) !important;
  background: rgba(255, 59, 48, .10) !important;
}
.skill-inline.cooldown.urgent .bar span {
  background: #ff3b30 !important;
}

.edge-state-cell.cooldown.urgent {
  background: rgba(255, 59, 48, .12) !important;
  border-color: rgba(255, 59, 48, .36) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 0 10px rgba(255, 59, 48, .16);
}
.edge-state-cell.cooldown.urgent b {
  color: #ff3b30 !important;
  font-weight: 900;
}
.edge-state-cell.cooldown.urgent span {
  color: rgba(255, 205, 210, .92) !important;
}


/* ================================
   v6：边栏五套皮肤。只影响 edge-mode，宽度仍保持极窄。
   dark  = B 极简深色
   glass = C iOS 毛玻璃
   white = A 极简白色
   mini  = D 紧凑窄栏
   card  = E 卡片清爽
================================ */
body.edge-mode.edge-theme-dark .app-shell {
  background: linear-gradient(180deg, rgba(8, 12, 20, .88), rgba(12, 18, 28, .94));
  border-right-color: rgba(255,255,255,.07);
}
body.edge-mode.edge-theme-dark .edge-member-row {
  background: linear-gradient(180deg, rgba(31, 41, 55, .76), rgba(17, 24, 39, .82));
  border-color: rgba(255,255,255,.06);
}
body.edge-mode.edge-theme-dark .edge-member-row.mine {
  background: linear-gradient(180deg, rgba(30, 64, 175, .38), rgba(17, 24, 39, .84));
}
body.edge-mode.edge-theme-dark .action-dock {
  background: linear-gradient(180deg, rgba(8, 12, 20, .48), rgba(8, 12, 20, .88));
}

body.edge-mode.edge-theme-glass .app-shell {
  background: linear-gradient(180deg, rgba(50, 65, 92, .42), rgba(15, 23, 42, .58));
  backdrop-filter: blur(22px) saturate(1.18);
  -webkit-backdrop-filter: blur(22px) saturate(1.18);
  border-right-color: rgba(255,255,255,.12);
}
body.edge-mode.edge-theme-glass .edge-member-row {
  background: linear-gradient(180deg, rgba(148, 163, 184, .18), rgba(30, 41, 59, .32));
  border-color: rgba(255,255,255,.12);
}
body.edge-mode.edge-theme-glass .edge-member-row.mine {
  background: linear-gradient(180deg, rgba(59, 130, 246, .30), rgba(30, 41, 59, .38));
}

body.edge-mode.edge-theme-white .app-shell {
  background: linear-gradient(180deg, rgba(248, 250, 252, .92), rgba(241, 245, 249, .86));
  color: #0f172a;
  border-right-color: rgba(15, 23, 42, .10);
}
body.edge-mode.edge-theme-white .icon-button,
body.edge-mode.edge-theme-white .square-action,
body.edge-mode.edge-theme-white .tabs {
  background: rgba(226, 232, 240, .70);
  border-color: rgba(15, 23, 42, .08);
}
body.edge-mode.edge-theme-white .icon-button span { background: #334155; }
body.edge-mode.edge-theme-white .room-line strong,
body.edge-mode.edge-theme-white .edge-member-name,
body.edge-mode.edge-theme-white .edge-table-head,
body.edge-mode.edge-theme-white .tabs button { color: #0f172a; }
body.edge-mode.edge-theme-white .edge-member-meta { color: rgba(51, 65, 85, .72); }
body.edge-mode.edge-theme-white .edge-member-row {
  background: rgba(255, 255, 255, .78);
  border-color: rgba(15, 23, 42, .06);
  box-shadow: 0 4px 12px rgba(15, 23, 42, .06);
}
body.edge-mode.edge-theme-white .edge-member-row.mine {
  background: rgba(219, 234, 254, .92);
  border-color: rgba(59, 130, 246, .18);
}
body.edge-mode.edge-theme-white .edge-state-cell {
  background: rgba(241, 245, 249, .78);
  border-color: rgba(15, 23, 42, .06);
}
body.edge-mode.edge-theme-white .action-dock {
  background: rgba(248, 250, 252, .78);
}

body.edge-mode.edge-theme-mini {
  --edge-width: 128px;
}
body.edge-mode.edge-theme-mini .app-shell,
body.edge-mode.edge-theme-mini .action-dock {
  width: var(--edge-width) !important;
  min-width: var(--edge-width) !important;
  max-width: var(--edge-width) !important;
}
body.edge-mode.edge-theme-mini .topbar {
  grid-template-columns: 28px minmax(0,1fr) 28px 28px 28px;
  gap: 3px;
}
body.edge-mode.edge-theme-mini .tabs button { height: 28px; font-size: 11px; }
body.edge-mode.edge-theme-mini .edge-table-head,
body.edge-mode.edge-theme-mini .edge-member-row {
  grid-template-columns: minmax(0, 1fr) 28px 28px;
  gap: 3px;
}
body.edge-mode.edge-theme-mini .edge-member-row {
  padding: 5px 4px;
  border-radius: 10px;
}
body.edge-mode.edge-theme-mini .edge-member-name { font-size: 11px; line-height: 14px; }
body.edge-mode.edge-theme-mini .edge-member-meta { font-size: 9px; line-height: 11px; }
body.edge-mode.edge-theme-mini .edge-state-cell { height: 32px; border-radius: 9px; }
body.edge-mode.edge-theme-mini .edge-state-cell b { font-size: 9px; }
body.edge-mode.edge-theme-mini .big-action.ios-action { height: 42px; min-height: 42px; border-radius: 10px; }

body.edge-mode.edge-theme-card .app-shell {
  background: linear-gradient(180deg, rgba(248, 250, 252, .88), rgba(226, 232, 240, .78));
  color: #111827;
}
body.edge-mode.edge-theme-card .icon-button,
body.edge-mode.edge-theme-card .square-action {
  background: rgba(255,255,255,.72);
}
body.edge-mode.edge-theme-card .icon-button span { background: #334155; }
body.edge-mode.edge-theme-card .room-line strong,
body.edge-mode.edge-theme-card .edge-member-name,
body.edge-mode.edge-theme-card .edge-table-head,
body.edge-mode.edge-theme-card .tabs button { color: #111827; }
body.edge-mode.edge-theme-card .edge-member-row {
  background: rgba(255,255,255,.86);
  border-color: rgba(15,23,42,.05);
  box-shadow: 0 5px 14px rgba(15, 23, 42, .08);
}
body.edge-mode.edge-theme-card .edge-member-meta { color: #64748b; }
body.edge-mode.edge-theme-card .edge-state-cell { background: #f8fafc; }
body.edge-mode.edge-theme-card .action-dock { background: rgba(241,245,249,.78); }

/* 设置抽屉里的皮肤选择，压紧一点，不占空间 */
.drawer #edgeTheme {
  min-height: 42px;
}

/* ================================
   v7：极简进入流程 + 全局统一皮肤
================================ */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 22px;
  background: radial-gradient(circle at 30% 0%, rgba(59,130,246,.22), transparent 32%), rgba(2, 6, 23, .92);
}
.auth-gate.show { display: grid; }
.auth-card {
  width: min(340px, 100%);
  padding: 24px;
  border-radius: 22px;
  background: rgba(15, 23, 42, .86);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 22px 60px rgba(0,0,0,.42);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.auth-title {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
}
.auth-card p {
  margin: 8px 0 16px;
  color: #94a3b8;
}
.auth-card input {
  min-height: 52px;
  border-radius: 14px;
  font-size: 18px;
}
.auth-card button {
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #4ea4ff, #2878e6);
  color: #fff;
  font-weight: 900;
  box-shadow: inset 0 1px rgba(255,255,255,.18), 0 10px 24px rgba(40,120,230,.22);
}
.auth-message.error { color: #ff8d99; }
.auth-message.ok { color: #4ade80; }

.setup-mode-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.mode-card {
  min-height: 74px;
  padding: 12px;
  border-radius: 16px;
  text-align: left;
  background: rgba(30, 41, 59, .56);
  border: 1px solid rgba(148, 163, 184, .15);
}
.mode-card b {
  display: block;
  font-size: 16px;
  line-height: 20px;
}
.mode-card span {
  display: block;
  margin-top: 4px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 16px;
}
.mode-card.active {
  background: linear-gradient(180deg, rgba(59,130,246,.95), rgba(37,99,235,.95));
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 10px 24px rgba(37,99,235,.22);
}
.mode-card.active span { color: rgba(255,255,255,.82); }

.compact-form {
  gap: 12px;
}
.compact-form .theme-field {
  margin-bottom: 2px;
}
.advanced-box {
  margin-top: 2px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, .14);
  background: rgba(15, 23, 42, .22);
  overflow: hidden;
}
.advanced-box summary {
  list-style: none;
  cursor: pointer;
  padding: 12px;
  color: #cbd5e1;
  font-weight: 900;
}
.advanced-box summary::-webkit-details-marker { display: none; }
.advanced-box summary::after {
  content: '展开';
  float: right;
  color: #60a5fa;
  font-size: 12px;
}
.advanced-box[open] summary::after { content: '收起'; }
.advanced-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 0 12px 12px;
}
body.join-flow .create-only,
body.join-flow .create-action,
body.create-flow .join-only,
body.create-flow .join-action {
  display: none !important;
}
.simplified-actions {
  grid-template-columns: 1fr !important;
  gap: 10px;
}
.simplified-actions .mode-action {
  min-height: 52px;
  border-radius: 14px;
  font-size: 17px;
}
.simplified-actions .ghost-danger {
  min-height: 44px;
  border-radius: 14px;
}
.drawer-head strong {
  font-size: 24px;
}
.drawer-head span {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 全局主题统一：登录页、设置页、主边栏一起换 */
body.edge-theme-dark {
  --ui-bg: rgba(8, 12, 20, .94);
  --ui-card: rgba(17, 24, 39, .88);
  --ui-field: rgba(15, 23, 42, .92);
  --ui-text: #f8fafc;
  --ui-muted: #94a3b8;
  --ui-line: rgba(255,255,255,.08);
}
body.edge-theme-glass {
  --ui-bg: rgba(28, 38, 58, .70);
  --ui-card: rgba(51, 65, 85, .36);
  --ui-field: rgba(15, 23, 42, .52);
  --ui-text: #f8fafc;
  --ui-muted: #cbd5e1;
  --ui-line: rgba(255,255,255,.12);
}
body.edge-theme-white,
body.edge-theme-card {
  --ui-bg: rgba(248, 250, 252, .94);
  --ui-card: rgba(255, 255, 255, .82);
  --ui-field: rgba(241, 245, 249, .92);
  --ui-text: #0f172a;
  --ui-muted: #64748b;
  --ui-line: rgba(15,23,42,.10);
}
body.edge-theme-mini {
  --ui-bg: rgba(8, 12, 20, .96);
  --ui-card: rgba(17, 24, 39, .90);
  --ui-field: rgba(15, 23, 42, .96);
  --ui-text: #f8fafc;
  --ui-muted: #94a3b8;
  --ui-line: rgba(255,255,255,.07);
}

body.edge-theme-dark .drawer,
body.edge-theme-glass .drawer,
body.edge-theme-white .drawer,
body.edge-theme-card .drawer,
body.edge-theme-mini .drawer,
body.edge-theme-dark .auth-card,
body.edge-theme-glass .auth-card,
body.edge-theme-white .auth-card,
body.edge-theme-card .auth-card,
body.edge-theme-mini .auth-card {
  background: var(--ui-bg) !important;
  color: var(--ui-text) !important;
  border-color: var(--ui-line) !important;
  backdrop-filter: blur(22px) saturate(1.12);
  -webkit-backdrop-filter: blur(22px) saturate(1.12);
}
body.edge-theme-white .auth-gate,
body.edge-theme-card .auth-gate {
  background: radial-gradient(circle at 30% 0%, rgba(59,130,246,.18), transparent 32%), rgba(241, 245, 249, .86);
}
body.edge-theme-white .drawer-head span,
body.edge-theme-white .auth-card p,
body.edge-theme-white label,
body.edge-theme-card .drawer-head span,
body.edge-theme-card .auth-card p,
body.edge-theme-card label {
  color: #475569 !important;
}
body.edge-theme-white .drawer-head strong,
body.edge-theme-white .auth-title,
body.edge-theme-card .drawer-head strong,
body.edge-theme-card .auth-title {
  color: #0f172a !important;
}
body.edge-theme-dark input,
body.edge-theme-dark select,
body.edge-theme-glass input,
body.edge-theme-glass select,
body.edge-theme-mini input,
body.edge-theme-mini select,
body.edge-theme-white input,
body.edge-theme-white select,
body.edge-theme-card input,
body.edge-theme-card select {
  background: var(--ui-field) !important;
  color: var(--ui-text) !important;
  border-color: var(--ui-line) !important;
}
body.edge-theme-white input::placeholder,
body.edge-theme-white select,
body.edge-theme-card input::placeholder,
body.edge-theme-card select {
  color: #64748b;
}
body.edge-theme-white .mode-card,
body.edge-theme-card .mode-card,
body.edge-theme-white .advanced-box,
body.edge-theme-card .advanced-box {
  background: var(--ui-card);
  border-color: var(--ui-line);
  color: #0f172a;
}
body.edge-theme-white .mode-card span,
body.edge-theme-card .mode-card span {
  color: #64748b;
}
body.edge-theme-white .close-button,
body.edge-theme-card .close-button {
  background: rgba(226,232,240,.82);
  color: #0f172a;
}

@media (max-width: 430px) {
  .drawer {
    width: min(100vw, 380px);
  }
  .setup-mode-card {
    grid-template-columns: 1fr;
  }
}

/* ================================
   v8：双技能操作区紧凑化
   顺序：报1 / 置1 / 报2 / 置2
   适配 iPad 侧拉只露窄边场景
================================ */
body.edge-mode .app-shell {
  width: min(100%, 146px) !important;
  padding-left: 5px !important;
  padding-right: 5px !important;
}

body.edge-mode .topbar {
  grid-template-columns: 28px minmax(0, 1fr) 28px 28px 28px !important;
  gap: 3px !important;
}

body.edge-mode .room-line strong {
  max-width: 52px !important;
  font-size: 12px !important;
}

body.edge-mode .tabs button {
  height: 28px !important;
  font-size: 11px !important;
}

body.edge-mode .edge-table-head,
body.edge-mode .edge-member-row {
  grid-template-columns: minmax(0, 1fr) 30px 30px !important;
  gap: 3px !important;
}

body.edge-mode .edge-table-head {
  padding: 0 4px 3px !important;
  font-size: 9px !important;
}

body.edge-mode .edge-member-row {
  padding: 5px 4px !important;
  border-radius: 11px !important;
}

body.edge-mode .edge-member-name {
  font-size: 11px !important;
  line-height: 14px !important;
}

body.edge-mode .edge-member-meta {
  font-size: 9px !important;
  line-height: 11px !important;
}

body.edge-mode .edge-state-cell {
  height: 32px !important;
  border-radius: 9px !important;
}

body.edge-mode .edge-state-cell span {
  font-size: 8px !important;
  line-height: 9px !important;
}

body.edge-mode .edge-state-cell b {
  font-size: 9px !important;
  line-height: 11px !important;
}

body.edge-mode .action-dock {
  left: 0 !important;
  width: 146px !important;
  transform: none !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 5px !important;
  padding: 6px 5px max(6px, env(safe-area-inset-bottom)) !important;
}

body.edge-mode .big-action.ios-action.edge-mini-action {
  min-height: 42px !important;
  height: 42px !important;
  border-radius: 11px !important;
  grid-template-columns: 14px minmax(0, 1fr) !important;
  gap: 3px !important;
  padding: 0 6px !important;
}

body.edge-mode .big-action.ios-action.edge-mini-action b {
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: 0 !important;
}

body.edge-mode .big-action.ios-action.edge-mini-action .bolt-icon {
  width: 12px !important;
  height: 18px !important;
}

body.edge-mode .big-action.ios-action.edge-mini-action .swirl-icon,
body.edge-mode .big-action.ios-action.edge-mini-action .reset-icon {
  width: 16px !important;
  height: 16px !important;
  border-width: 3px !important;
}

body.edge-mode.edge-theme-mini .action-dock,
body.edge-mode.edge-theme-mini .app-shell {
  width: 138px !important;
}

body.edge-mode.edge-theme-mini .edge-table-head,
body.edge-mode.edge-theme-mini .edge-member-row {
  grid-template-columns: minmax(0, 1fr) 28px 28px !important;
}

body.edge-mode.edge-theme-mini .big-action.ios-action.edge-mini-action {
  min-height: 39px !important;
  height: 39px !important;
  font-size: 11px !important;
}


/* ================================
   v9：右侧设置按钮 + 四行大按钮
   解决 iPad 窗口左上角系统按钮遮挡、2列按钮太小的问题
================================ */
body.edge-mode .topbar {
  grid-template-columns: minmax(0, 1fr) 34px !important;
  gap: 5px !important;
  padding: 2px 0 7px !important;
}

/* 左上角 iPad 窗口控制会挡住，边栏模式下隐藏左侧菜单，把设置放右边 */
body.edge-mode #menuBtn {
  display: none !important;
}
body.edge-mode #shareBtn,
body.edge-mode #edgeModeBtn {
  display: none !important;
}
body.edge-mode #settingsBtn {
  display: grid !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
  padding: 0 !important;
  background: rgba(63, 78, 107, .78) !important;
  box-shadow: inset 0 1px rgba(255,255,255,.12), 0 4px 12px rgba(0,0,0,.16) !important;
}
body.edge-mode #settingsBtn small {
  display: none !important;
}
body.edge-mode #settingsBtn .gear-icon {
  width: 18px !important;
  height: 18px !important;
  border-width: 4px !important;
}
body.edge-mode #settingsBtn .gear-icon::after {
  inset: 5px !important;
}

body.edge-mode .room-title {
  min-width: 0 !important;
  padding-left: 8px !important;
  padding-right: 6px !important;
}
body.edge-mode .room-line strong {
  max-width: 88px !important;
  font-size: 12px !important;
}

/* 操作区恢复四行，不并列。按钮更大，方便侧边露出时点中 */
body.edge-mode .action-dock {
  left: 0 !important;
  width: 146px !important;
  max-width: 146px !important;
  transform: none !important;
  grid-template-columns: 1fr !important;
  gap: 6px !important;
  padding: 7px 6px max(7px, env(safe-area-inset-bottom)) !important;
}
body.edge-mode .big-action.ios-action.edge-mini-action {
  min-height: 48px !important;
  height: 48px !important;
  border-radius: 13px !important;
  grid-template-columns: 20px minmax(0, 1fr) !important;
  gap: 6px !important;
  padding: 0 12px !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
}
body.edge-mode .big-action.ios-action.edge-mini-action b {
  font-size: 15px !important;
  line-height: 16px !important;
  font-weight: 900 !important;
  text-align: left !important;
}
body.edge-mode .big-action.ios-action.edge-mini-action .bolt-icon {
  width: 14px !important;
  height: 21px !important;
}
body.edge-mode .big-action.ios-action.edge-mini-action .swirl-icon,
body.edge-mode .big-action.ios-action.edge-mini-action .reset-icon {
  width: 20px !important;
  height: 20px !important;
  border-width: 3px !important;
}
body.edge-mode .big-action.ios-action.edge-mini-action:active {
  transform: scale(.985) !important;
  filter: brightness(.96) !important;
}

/* 四行按钮会占高度，成员区域自动让出更多空间 */
body.edge-mode .member-list {
  max-height: calc(100dvh - 270px) !important;
}

/* mini 皮肤保留极窄宽度，但按钮仍然四行可点 */
body.edge-mode.edge-theme-mini .app-shell,
body.edge-mode.edge-theme-mini .action-dock {
  width: 138px !important;
  max-width: 138px !important;
}
body.edge-mode.edge-theme-mini .topbar {
  grid-template-columns: minmax(0, 1fr) 32px !important;
}
body.edge-mode.edge-theme-mini #settingsBtn {
  width: 32px !important;
  height: 32px !important;
}
body.edge-mode.edge-theme-mini .big-action.ios-action.edge-mini-action {
  min-height: 46px !important;
  height: 46px !important;
  padding: 0 10px !important;
  grid-template-columns: 18px minmax(0, 1fr) !important;
}
body.edge-mode.edge-theme-mini .big-action.ios-action.edge-mini-action b {
  font-size: 14px !important;
}


/* v10: 恢复设置页保存修改按钮 */
.simplified-actions .save-profile-action {
  min-height: 50px;
  border-radius: 14px;
  background: linear-gradient(180deg, #34d399, #10b981);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  box-shadow: inset 0 1px rgba(255,255,255,.18), 0 8px 18px rgba(16,185,129,.18);
}
.simplified-actions .save-profile-action:active {
  transform: scale(.985);
}
body.edge-theme-white .simplified-actions .save-profile-action,
body.edge-theme-card .simplified-actions .save-profile-action {
  background: linear-gradient(180deg, #22c55e, #16a34a);
  color: #fff;
}

/* ================================
   v11：默认单技能 + 左右显示位置
   目标：边栏极窄时保证技能1和报1/置1绝对可见
================================ */
body.edge-mode.edge-skill-single .edge-table-head,
body.edge-mode.edge-skill-single .edge-member-row {
  grid-template-columns: minmax(0, 1fr) 44px !important;
  gap: 4px !important;
}
body.edge-mode.edge-skill-single .edge-table-head span:nth-child(3),
body.edge-mode.edge-skill-single .edge-member-row .edge-state-cell:nth-of-type(3) {
  display: none !important;
}
body.edge-mode.edge-skill-single .edge-state-cell {
  height: 34px !important;
}
body.edge-mode.edge-skill-single .edge-state-cell b {
  font-size: 11px !important;
}
body.edge-mode.edge-skill-single .edge-member-name {
  font-size: 12px !important;
}
body.edge-mode.edge-skill-single .edge-member-meta {
  font-size: 9px !important;
}

/* 单技能时只有 报1/置1，按钮可以再大一点 */
body.edge-mode.edge-skill-single .member-list {
  max-height: calc(100dvh - 214px) !important;
}
body.edge-mode.edge-skill-single .big-action.ios-action.edge-mini-action {
  min-height: 54px !important;
  height: 54px !important;
  border-radius: 14px !important;
  padding: 0 14px !important;
}
body.edge-mode.edge-skill-single .big-action.ios-action.edge-mini-action b {
  font-size: 16px !important;
}
body.edge-mode.edge-skill-single.edge-theme-mini .big-action.ios-action.edge-mini-action {
  min-height: 50px !important;
  height: 50px !important;
}

/* 双技能才显示第二列和四个操作按钮 */
body.edge-mode.edge-skill-double .edge-table-head,
body.edge-mode.edge-skill-double .edge-member-row {
  grid-template-columns: minmax(0, 1fr) 30px 30px !important;
}
body.edge-mode.edge-skill-double .member-list {
  max-height: calc(100dvh - 270px) !important;
}

/* 左/右显示位置：用来配合 iPad 侧拉时只露一条边 */
body.edge-mode.edge-side-left .app-shell {
  margin-left: 0 !important;
  margin-right: auto !important;
  border-right: 1px solid rgba(255,255,255,.08);
  border-left: 0;
}
body.edge-mode.edge-side-left .action-dock {
  left: 0 !important;
  right: auto !important;
}
body.edge-mode.edge-side-right .app-shell {
  margin-left: auto !important;
  margin-right: 0 !important;
  border-left: 1px solid rgba(255,255,255,.08);
  border-right: 0;
}
body.edge-mode.edge-side-right .action-dock {
  left: auto !important;
  right: 0 !important;
}

/* 右侧模式下，把房间名压到左边，设置仍在右边，技能1状态靠右可见 */
body.edge-mode.edge-side-right .room-title {
  padding-left: 4px !important;
  padding-right: 4px !important;
}
body.edge-mode.edge-side-right .edge-state-cell:last-child {
  box-shadow: inset 0 0 0 1px rgba(96,165,250,.08);
}

/* 设置页：高级设置选项也走简洁风 */
.advanced-grid label select#edgeSide,
.advanced-grid label select#edgeSkillMode {
  font-weight: 800;
}
body.edge-skill-single .skill2-field {
  display: none !important;
}
body.edge-skill-double .skill2-field {
  display: grid !important;
}

/* 宽度保持极限，不再把行拉宽 */
body.edge-mode .app-shell,
body.edge-mode .action-dock {
  width: 146px !important;
  max-width: 146px !important;
}
body.edge-mode.edge-theme-mini .app-shell,
body.edge-mode.edge-theme-mini .action-dock {
  width: 138px !important;
  max-width: 138px !important;
}

/* ================================
   v13：名字和倒计时贴近显示
   解决左右侧拉时一边遮名字、一边遮倒计时的问题
================================ */
body.edge-mode .edge-table-head {
  grid-template-columns: minmax(0, 1fr) !important;
  padding-left: 6px !important;
  padding-right: 6px !important;
}
body.edge-mode .edge-table-head span:first-child::after {
  content: ' / 状态';
  opacity: .75;
}
body.edge-mode .edge-table-head span:nth-child(2),
body.edge-mode .edge-table-head span:nth-child(3) {
  display: none !important;
}
body.edge-mode .edge-member-row,
body.edge-mode.edge-skill-single .edge-member-row,
body.edge-mode.edge-skill-double .edge-member-row {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
  padding: 6px 6px 5px !important;
}
body.edge-mode .edge-member-row > .edge-state-cell {
  display: none !important;
}
body.edge-mode .edge-name-col {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 1px !important;
  min-width: 0 !important;
}
body.edge-mode .edge-member-mainline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
body.edge-mode .edge-member-name {
  display: block;
  min-width: 0;
  font-size: 11px !important;
  line-height: 14px !important;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
body.edge-mode .edge-compact-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  flex: 0 0 auto;
  max-width: 72px;
  overflow: hidden;
}
body.edge-mode .edge-inline-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 29px;
  height: 18px;
  padding: 0 3px;
  border-radius: 6px;
  font-size: 9px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
  background: rgba(15,23,42,.34);
  border: 1px solid rgba(255,255,255,.06);
}
body.edge-mode .edge-inline-state.ready {
  color: #22c55e;
  background: rgba(34,197,94,.10);
}
body.edge-mode .edge-inline-state.cooldown {
  color: #f59e0b;
  background: rgba(245,158,11,.11);
}
body.edge-mode .edge-inline-state.urgent {
  color: #ff3b30 !important;
  background: rgba(255,59,48,.14) !important;
  border-color: rgba(255,59,48,.28) !important;
}
body.edge-mode .edge-inline-state.empty {
  color: rgba(148,163,184,.72);
}
body.edge-mode .edge-member-meta {
  font-size: 8px !important;
  line-height: 10px !important;
  opacity: .72;
}
body.edge-mode.edge-theme-mini .edge-member-name {
  font-size: 10px !important;
}
body.edge-mode.edge-theme-mini .edge-inline-state {
  min-width: 27px;
  height: 17px;
  font-size: 8px;
  padding: 0 2px;
}
body.edge-mode.edge-theme-mini .edge-compact-status {
  max-width: 66px;
  gap: 2px;
}


/* ================================
   v14：房主分组选择 + 技能名紧贴倒计时
================================ */
body.edge-mode .edge-table-head.compact {
  display: block !important;
  padding: 0 6px 4px !important;
  color: rgba(100, 116, 139, .95) !important;
  font-size: 9px !important;
  font-weight: 800 !important;
}
body.edge-mode .edge-table-head.compact span {
  display: inline !important;
  text-align: left !important;
}
body.edge-mode .edge-member-row {
  display: block !important;
  grid-template-columns: none !important;
  padding: 6px 6px 5px !important;
  min-height: 0 !important;
}
body.edge-mode .edge-member-row > .edge-state-cell,
body.edge-mode .edge-compact-status {
  display: none !important;
}
body.edge-mode .edge-name-col {
  display: block !important;
  min-width: 0 !important;
}
body.edge-mode .edge-member-mainline {
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
  min-width: 0 !important;
  line-height: 13px !important;
}
body.edge-mode .edge-member-name {
  display: inline-block !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: 82px !important;
  font-size: 11px !important;
  line-height: 13px !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
body.edge-mode .edge-host-badge,
body.edge-mode .edge-group-badge {
  flex: 0 0 auto;
  height: 13px;
  padding: 0 3px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  font-size: 8px;
  line-height: 1;
  font-weight: 900;
}
body.edge-mode .edge-host-badge {
  color: #f59e0b;
  background: rgba(245, 158, 11, .14);
}
body.edge-mode .edge-group-badge {
  color: #60a5fa;
  background: rgba(96, 165, 250, .12);
}
body.edge-mode .edge-member-skills {
  margin-top: 2px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 2px 4px !important;
  min-width: 0 !important;
}
body.edge-mode .edge-skill-pill {
  display: inline-flex !important;
  align-items: baseline !important;
  max-width: 126px !important;
  min-width: 0 !important;
  height: 17px !important;
  padding: 1px 5px !important;
  border-radius: 7px !important;
  font-size: 10px !important;
  line-height: 14px !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
  border: 1px solid rgba(148, 163, 184, .12) !important;
  background: rgba(15, 23, 42, .08) !important;
}
body.edge-mode .edge-skill-pill em {
  min-width: 0 !important;
  max-width: 58px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-style: normal !important;
}
body.edge-mode .edge-skill-pill b {
  flex: 0 0 auto !important;
  font-weight: 900 !important;
}
body.edge-mode .edge-skill-pill.ready {
  color: #16a34a !important;
  background: rgba(34, 197, 94, .10) !important;
}
body.edge-mode .edge-skill-pill.cooldown {
  color: #d97706 !important;
  background: rgba(245, 158, 11, .12) !important;
}
body.edge-mode .edge-skill-pill.urgent {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, .14) !important;
  border-color: rgba(239, 68, 68, .24) !important;
}
body.edge-mode .edge-skill-pill.empty {
  color: rgba(100, 116, 139, .78) !important;
}
body.edge-mode.edge-theme-mini .edge-member-row {
  padding: 5px 5px 4px !important;
}
body.edge-mode.edge-theme-mini .edge-member-name {
  max-width: 76px !important;
  font-size: 10px !important;
}
body.edge-mode.edge-theme-mini .edge-skill-pill {
  height: 16px !important;
  padding: 1px 4px !important;
  font-size: 9px !important;
}
body.edge-mode.edge-theme-mini .edge-skill-pill em {
  max-width: 52px !important;
}
body.edge-mode.edge-theme-white .edge-skill-pill {
  background: rgba(255, 255, 255, .72) !important;
}
body.edge-mode.edge-theme-white .edge-skill-pill.ready {
  background: rgba(34, 197, 94, .11) !important;
}
body.edge-mode.edge-theme-white .edge-skill-pill.cooldown {
  background: rgba(245, 158, 11, .12) !important;
}

/* ================================
   v15：右侧显示时内容贴右
   说明：iPad 右侧侧拉时，游戏会遮住左边，右边才是可见区；
   所以右侧模式下把名字、技能状态、按钮文字都往右贴。
================================ */
body.edge-mode.edge-side-right .edge-table-head.compact {
  text-align: right !important;
  padding-left: 2px !important;
  padding-right: 6px !important;
}

body.edge-mode.edge-side-right .edge-member-row {
  text-align: right !important;
  padding-left: 3px !important;
  padding-right: 6px !important;
}

body.edge-mode.edge-side-right .edge-name-col {
  text-align: right !important;
}

body.edge-mode.edge-side-right .edge-member-mainline {
  justify-content: flex-end !important;
  text-align: right !important;
}

body.edge-mode.edge-side-right .edge-member-name {
  text-align: right !important;
  direction: rtl;
}

body.edge-mode.edge-side-right .edge-host-badge,
body.edge-mode.edge-side-right .edge-group-badge {
  order: -1;
}

body.edge-mode.edge-side-right .edge-member-skills {
  justify-content: flex-end !important;
  text-align: right !important;
}

body.edge-mode.edge-side-right .edge-skill-pill {
  justify-content: flex-end !important;
  text-align: right !important;
  max-width: 132px !important;
}

body.edge-mode.edge-side-right .edge-skill-pill em {
  text-align: right !important;
}

body.edge-mode.edge-side-right.edge-theme-mini .edge-skill-pill {
  max-width: 124px !important;
}

body.edge-mode.edge-side-right.edge-theme-mini .edge-member-name {
  max-width: 82px !important;
}

/* ================================
   v16：提升重置键命中率
   - 重置键更高，远离底部圆角/系统手势区
   - action dock 禁止滚动手势抢点
   - 点击时给即时反馈
================================ */
body.edge-mode .action-dock {
  padding-bottom: max(16px, calc(10px + env(safe-area-inset-bottom))) !important;
  touch-action: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

body.edge-mode .big-action.ios-action.edge-mini-action {
  touch-action: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

body.edge-mode .big-action.ios-action.edge-mini-action.warn {
  min-height: 56px !important;
  height: 56px !important;
  border-radius: 14px !important;
  font-size: 15px !important;
}

body.edge-mode.edge-theme-mini .big-action.ios-action.edge-mini-action.warn {
  min-height: 52px !important;
  height: 52px !important;
}

body.edge-mode .big-action.ios-action.edge-mini-action.tap-active,
body.edge-mode .big-action.ios-action.edge-mini-action:active {
  transform: scale(.97) !important;
  filter: brightness(.94) !important;
}
