:root {
  --bg: #0c0e14;
  --bg-soft: #141824;
  --card: #1a1f2e;
  --card-2: #222941;
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef1f7;
  --text-dim: #98a1b6;
  --gold: #f2c14e;
  --gold-deep: #d29a2b;
  --blue: #4a9cff;
  --green: #33c48d;
  --red: #ff6b6b;
  --radius: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: radial-gradient(1200px 640px at 50% -240px, #1d2740 0%, var(--bg) 62%) fixed;
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }

button, input { font-family: inherit; }

.view { min-height: 100vh; }
.hidden { display: none !important; }

/* 启动：加载态（详情页启动即显示，避免闪屏） */
.boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.boot-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .15);
  border-top-color: var(--gold);
  animation: bootSpin .8s linear infinite;
}
@keyframes bootSpin { to { transform: rotate(360deg); } }
.boot-text { color: var(--text-dim); font-size: 13px; margin: 0; }
/* 加载失败：原因 + 返回账号管理页 */
.boot-fail { color: var(--red); font-size: 13px; margin: 0; padding: 0 24px; text-align: center; }
.boot-back { margin: 8px auto 0; max-width: 240px; }

/* ---------------- 通用组件 ---------------- */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  backdrop-filter: blur(6px);
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #0b0d12;
  background: #e8ecf5;
  cursor: pointer;
  transition: transform .12s ease, opacity .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn.primary {
  background: linear-gradient(135deg, #5aa4ff, #3577f5);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(58, 130, 246, .9);
}
.btn.gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #3a2a05;
  box-shadow: 0 8px 20px -8px rgba(242, 193, 78, .8);
}
.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn.block { display: block; width: 100%; }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn.tiny { padding: 6px 12px; font-size: 12px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
a.btn.block { display: flex; }

.loading, .empty {
  color: var(--text-dim);
  text-align: center;
  padding: 18px 8px;
  font-size: 13px;
}

/* 提示条 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translate(-50%, 24px);
  max-width: 84vw;
  background: rgba(20, 24, 36, .96);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 120;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 添加账号弹窗内的 Tab / 表单（accounts 页共用） ---------------- */
.tabs {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, .25);
  border-radius: 999px;
  padding: 4px;
  margin: 12px 0 18px;
}
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  padding: 9px 0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}
.tab.active {
  color: #1a1204;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
}

.panel { display: none; }
.panel.active { display: block; }

.hint { color: var(--text-dim); font-size: 13px; text-align: center; margin: 0 0 14px; }

/* 二维码区域固定 1:1 */
.qr-box {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow: hidden;
}
.qr-box img { width: 100%; height: 100%; display: block; object-fit: contain; }
.qr-box .btn { color: #0b0d12; max-width: 100%; }

.status { text-align: center; color: var(--text-dim); font-size: 13px; margin: 6px 0 0; min-height: 20px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; color: var(--text-dim); font-size: 12px; margin-bottom: 6px; }
.field input {
  width: 100%;
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color .2s ease;
}
.field input:focus { border-color: var(--gold); }
.field input::placeholder { color: #5c6577; }

.field-row { display: flex; gap: 10px; }
.field-row input { flex: 1; }
.field-row .btn { flex-shrink: 0; }

.footnote { text-align: center; color: #5c6577; font-size: 12px; padding: 20px 24px 30px; margin: 0; }

/* ---------------- 主页面 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(12, 14, 20, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #1a1204;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.user-name {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-type {
  flex-shrink: 0;
  font-size: 11px;
  line-height: 16px;
  color: var(--gold);
  border: 1px solid rgba(242, 193, 78, .4);
  border-radius: 5px;
  padding: 0 5px;
}

/* 顶栏 xcx-openid：整行一致的胶囊按钮，点击复制 */
.xcx-line {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 340px;
  margin-top: 5px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .06);
  color: var(--text-dim);
  font-size: 11px;
  line-height: 18px;
  cursor: pointer;
  text-align: left;
  transition: background .18s ease, border-color .18s ease;
}
.xcx-line:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .16); }
.xcx-line:active { background: rgba(255, 255, 255, .15); }
.xcx-label {
  flex-shrink: 0;
  color: var(--text-dim);
  letter-spacing: .5px;
}
.xcx-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text);
  user-select: text;
  -webkit-user-select: text;
}
.xcx-copy {
  flex-shrink: 0;
  color: var(--gold);
  font-weight: 600;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.content {
  padding: 16px 16px calc(40px + env(safe-area-inset-bottom));
  max-width: 560px;
  margin: 0 auto;
}

.block { margin-bottom: 22px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 12px; }
.block-head h2 { font-size: 16px; margin: 0; padding-left: 10px; position: relative; }
.block-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
}
.block-tip { color: var(--text-dim); font-size: 12px; }

/* 角色 chips */
.role-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 4px 12px;
  margin: 0 -4px;
  scrollbar-width: none;
}
.role-chips::-webkit-scrollbar { display: none; }
.role-chips:empty { display: none; }
.chip {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .2s ease;
}
.chip.active {
  color: #1a1204;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  border-color: transparent;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.chip.active .dot { background: #1a1204; }

/* 角色卡片 */
.role-card { padding: 18px 16px; }
.role-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.role-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--card-2);
  border: 1px solid var(--line);
}
.role-name { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.role-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 11px; color: var(--text-dim); background: rgba(255, 255, 255, .06); border-radius: 6px; padding: 3px 9px; }
.tag.online.on { color: var(--green); }
.tag.online.busy { color: var(--gold); }
.tag.online.off { color: var(--text-dim); }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: rgba(0, 0, 0, .22); border-radius: var(--radius-sm); padding: 12px 6px; text-align: center; min-width: 0; }
.stat-val {
  font-size: clamp(15px, 4.4vw, 18px);
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.stat-key { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.role-more {
  width: 100%;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease;
}
.role-more:active { background: rgba(255, 255, 255, .08); }
.role-more .arrow { color: var(--gold); font-size: 18px; }

/* 营地信息：统计磁贴 */
.tile-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
}
.tile-gold {
  background: linear-gradient(135deg, rgba(242, 193, 78, .18), rgba(242, 193, 78, .04));
  border-color: rgba(242, 193, 78, .3);
}
.tile-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.tile-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.coin-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, var(--gold-deep));
  display: inline-block;
}

/* 入口列表 */
.entry-list {
  margin-top: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.entry {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background .2s ease;
}
.entry:last-child { border-bottom: 0; }
.entry:active { background: rgba(255, 255, 255, .05); }
.entry-ico { font-size: 20px; width: 30px; text-align: center; }
.entry-main { flex: 1; display: flex; flex-direction: column; }
.entry-title { font-size: 15px; font-weight: 600; }
.entry-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.entry-arrow { color: var(--text-dim); font-size: 20px; }

/* ---------------- 二级模态框（底部弹出） ---------------- */
.modal { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .58);
  opacity: 0;
  transition: opacity .25s ease;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.modal-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #1e2537, #121620 62%);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.22, .61, .36, 1);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, .9);
}
.modal.open { pointer-events: auto; }
.modal.open .modal-mask { opacity: 1; }
.modal.open .modal-sheet { transform: translateY(0); }

.modal-handle { width: 40px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .25); margin: 10px auto 2px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 12px;
}
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
}
.modal-close:active { background: rgba(255, 255, 255, .08); }
.modal-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 20px 26px; }

/* 战绩列表 */
.battle-list, .log-list { list-style: none; margin: 0; padding: 0; }
.battle { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.battle:last-child { border-bottom: 0; }
.battle-avatar {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--card-2);
  border: 1px solid var(--line);
}
.battle-info { flex: 1; min-width: 0; }
.battle-main { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.battle-hero { font-weight: 600; font-size: 14px; }
.battle-kda { font-size: 14px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.battle-sub { display: flex; justify-content: space-between; color: var(--text-dim); font-size: 12px; margin-top: 3px; }

/* 日志列表 */
.log { padding: 12px 0; border-bottom: 1px solid var(--line); }
.log:last-child { border-bottom: 0; }
.log-date { font-size: 12px; color: var(--gold); margin-bottom: 3px; }
.log-summary { font-size: 13px; color: var(--text); word-break: break-word; }

/* 商城 */
.shop-balance {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(242, 193, 78, .18), rgba(242, 193, 78, .04));
  border: 1px solid rgba(242, 193, 78, .3);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.shop-balance .num { font-size: 24px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.shop-balance .txt { font-size: 12px; color: var(--text-dim); }

/* 商城 sheet 页（本周 / 本期） */
.sheet-tabs {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, .28);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 16px;
}
.sheet-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  padding: 9px 0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}
.sheet-tab.active {
  color: #1a1204;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
}
.sheet-panel { animation: sheetFade .22s ease; }
@keyframes sheetFade {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.shop-group + .shop-group { margin-top: 18px; }
.shop-group-title { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }
.gift-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gift {
  background: rgba(0, 0, 0, .22);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.gift-icon { width: 52px; height: 52px; object-fit: contain; margin-bottom: 6px; }
.gift-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; word-break: break-word; }
.gift-desc { font-size: 11px; color: var(--text-dim); margin-bottom: 8px; min-height: 16px; word-break: break-word; }
.gift-foot { width: 100%; margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.gift-cost { font-size: 12px; color: var(--gold); font-weight: 700; }

/* ---------------- 响应式：移动端 / 平板 / 桌面 ---------------- */

@media (min-width: 480px) {
  .qr-box { max-width: 280px; }
}

/* 平板及以上：模态框改为居中弹窗 */
@media (min-width: 600px) {
  .footnote { padding-bottom: 40px; }

  .modal { display: flex; align-items: center; justify-content: center; }
  .modal-sheet {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    margin: 0;
    width: 560px;
    max-width: 92vw;
    max-height: 86vh;
    border-radius: 20px;
    border-bottom: 1px solid var(--line);
    transform: translateY(14px) scale(.98);
    opacity: 0;
    transition: transform .28s cubic-bezier(.22, .61, .36, 1), opacity .22s ease;
  }
  .modal.open .modal-sheet { transform: none; opacity: 1; }
  .modal-handle { display: none; }
}

/* 桌面：主内容双栏布局 */
@media (min-width: 960px) {
  .topbar { padding: 16px 28px; }
  .content {
    max-width: 1080px;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 24px;
    align-items: start;
    padding: 28px 28px 40px;
  }
  .block { margin-bottom: 0; }
  .gift-grid { grid-template-columns: repeat(3, 1fr); }
  .qr-box { max-width: 300px; }
}

/* ---------------- 账号管理页 ---------------- */
.page-title { font-weight: 600; font-size: 16px; margin-left: 2px; }

/* 覆盖桌面端 .content 的双栏网格，账号页保持单栏 */
.content.accounts-content { display: block; max-width: 760px; }

.accounts-tip {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.6;
  margin: 0 4px 14px;
}
.refresh-all { margin-top: 6px; }

.account-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.account-card.current {
  border-color: rgba(242, 193, 78, .45);
  background: linear-gradient(180deg, rgba(242, 193, 78, .1), rgba(255, 255, 255, .015));
}
.account-head { display: flex; align-items: center; gap: 12px; }
.account-head .avatar { width: 40px; height: 40px; font-size: 15px; }
.account-info { flex: 1; min-width: 0; }
.account-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-bottom: 4px;
}
.account-name .user-name-txt {
  min-width: 0;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-badge {
  flex-shrink: 0;
  font-size: 11px;
  line-height: 16px;
  color: #1a1204;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  border-radius: 6px;
  padding: 2px 7px;
}
.account-meta { margin: 12px 0; color: var(--text-dim); font-size: 12px; }
.account-meta b { color: var(--text); font-weight: 700; }
.account-meta .st-ok { color: var(--green); }
.account-meta .st-bad { color: var(--red); }
.account-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.account-actions .btn { flex: 1; min-width: 0; }
.btn.danger { color: var(--red); border-color: rgba(255, 107, 107, .35); }
.btn.danger:active { background: rgba(255, 107, 107, .12); }

/* 接口额度卡片（ranklist 配额） */
.quota-card {
  background: linear-gradient(180deg, rgba(74, 156, 255, .13), rgba(255, 255, 255, .015));
  border: 1px solid rgba(74, 156, 255, .28);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.quota-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.quota-title { font-weight: 600; font-size: 14px; }
.quota-limit { color: var(--text-dim); font-size: 12px; }
.quota-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 10px; }
.quota-item { background: rgba(255, 255, 255, .045); border-radius: var(--radius-sm); padding: 8px 10px; }
.quota-val { font-size: 17px; font-weight: 700; }
.quota-label { color: var(--text-dim); font-size: 11px; margin-top: 2px; }
.quota-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.quota-foot-label { color: var(--text-dim); }
.quota-foot-val { color: var(--gold); font-weight: 600; }
.quota-countdown { color: var(--blue); }
.quota-note { margin: 10px 0 0; color: var(--text-dim); font-size: 11px; line-height: 1.5; }

/* 账号卡片内的接口额度行 */
.account-quota {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 12px;
  font-size: 12px;
  color: var(--text-dim);
}
.account-quota .aq-val b { color: var(--green); font-weight: 700; }
.account-quota .aq-val.aq-full b { color: var(--red); }
.account-quota .aq-reset { color: var(--gold); }
.account-quota .aq-countdown { color: var(--blue); }

/* 窄屏下顶栏按钮紧凑一些，避免挤压账号信息 */
@media (max-width: 420px) {
  .topbar-actions { gap: 6px; }
  .topbar-actions .btn.small { padding: 6px 10px; font-size: 12px; }
}

/* ==================== v2：节点用户体系 ==================== */

/* 顶栏角色标签（管理员 / 普通用户） */
.user-tag {
  flex-shrink: 0;
  font-size: 11px;
  line-height: 16px;
  color: var(--blue);
  border: 1px solid rgba(74, 156, 255, .4);
  border-radius: 5px;
  padding: 0 5px;
}

/* 顶栏第二行说明（节点信息 / 最后登录） */
.node-meta-line {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------- 登录页 / 单账号登录页 ---------------- */
.auth-view {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 16px calc(28px + env(safe-area-inset-bottom));
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 40px 4px 22px;
}
.brand-badge {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: #1a1204;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  box-shadow: 0 12px 30px -12px rgba(242, 193, 78, .9);
  flex-shrink: 0;
}
.brand-text { min-width: 0; }
.brand-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .5px;
  background: linear-gradient(120deg, #fff, var(--gold) 78%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-sub { margin: 4px 0 0; font-size: 12px; color: var(--text-dim); }

.auth-main {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-card { padding: 20px 18px; animation: cardIn .32s ease both; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.auth-tip { margin: 0 0 16px; color: var(--text-dim); font-size: 12.5px; line-height: 1.6; }
.auth-form .field:last-of-type { margin-bottom: 18px; }

.auth-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 107, 107, .3);
  background: rgba(255, 107, 107, .1);
  color: var(--red);
  font-size: 13px;
}

.shake { animation: shake .38s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

.auth-links { text-align: center; font-size: 13px; color: var(--text-dim); }
.dot-sep { margin: 0 8px; color: #3d4457; }
.link { color: var(--gold); text-decoration: none; border-bottom: 1px dashed rgba(242, 193, 78, .45); }
.link:active { opacity: .7; }

/* 说明卡片（单账号登录页：归属管理员 / 入口关闭） */
.notice-card { border-color: rgba(255, 255, 255, .12); }
.notice-text { margin: 0; font-size: 13px; line-height: 1.7; color: var(--text-dim); }
.notice-text b { color: var(--text); }
.notice-text code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: rgba(0, 0, 0, .35);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--gold);
}
.notice-warn {
  border-color: rgba(242, 193, 78, .32);
  background: linear-gradient(180deg, rgba(242, 193, 78, .12), rgba(255, 255, 255, .015));
}
.notice-warn .notice-text { color: #e8d8ab; }
.notice-bad {
  border-color: rgba(255, 107, 107, .3);
  background: linear-gradient(180deg, rgba(255, 107, 107, .1), rgba(255, 255, 255, .015));
}
.notice-bad .notice-text { color: #ffc9c9; }

.dim { color: var(--text-dim); }
/* 登录卡片底部的流程说明 */
.boot-hint { margin: 14px 0 0; font-size: 12px; line-height: 1.6; }

/* 错误态里的按钮组 */
.boot-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 260px; margin: 8px auto 0; }
.boot-actions .btn { width: 100%; }

/* ---------------- 接口凭证卡片 ---------------- */
.cred-card {
  background: linear-gradient(180deg, rgba(242, 193, 78, .13), rgba(255, 255, 255, .015));
  border: 1px solid rgba(242, 193, 78, .28);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.cred-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cred-title { font-weight: 600; font-size: 14px; }
.cred-at { color: var(--text-dim); font-size: 11px; }
.cred-value {
  margin: 10px 0 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .34);
  border: 1px solid var(--line);
  overflow-x: auto;
}
.cred-token {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--gold);
  user-select: text;
  -webkit-user-select: text;
  word-break: break-all;
}
.cred-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cred-note { margin: 10px 0 0; color: var(--text-dim); font-size: 11.5px; line-height: 1.6; }
.cred-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--gold);
  /* 完整接口地址很长，允许在任意位置换行，避免横向溢出 */
  overflow-wrap: anywhere;
  word-break: break-all;
}
/* 高级接口列表：1、<完整地址>  接口文档 */
.cred-note-title { color: var(--text-dim); }
.cred-api-list { margin: 4px 0 0; padding: 0; list-style: none; counter-reset: cred-api; }
.cred-api-list li {
  counter-increment: cred-api;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}
.cred-api-list li::before {
  content: counter(cred-api) "、";
  color: var(--text-dim);
  flex-shrink: 0;
}
.cred-api-url { flex: 1; min-width: 0; }
.cred-doc { flex-shrink: 0; font-size: 11.5px; }
.cred-note-hint { margin: 8px 0 0; color: var(--text-dim); font-size: 11px; }
.cred-sample {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .34);
  border: 1px solid var(--line);
  color: #cbd3e3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.6;
  white-space: pre;
  overflow-x: auto;
}

/* ---------------- 列表工具栏（范围切换 + 搜索） ---------------- */
.list-toolbar { display: flex; gap: 10px; align-items: center; margin: 4px 0 12px; flex-wrap: wrap; }
.seg-switch {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, .28);
  border-radius: 999px;
  padding: 4px;
}
.seg {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color .2s ease, background .2s ease;
}
.seg.active {
  color: #1a1204;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
}
.tool-input {
  flex: 1;
  min-width: 160px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  padding: 9px 16px;
  font-size: 13px;
  outline: none;
  transition: border-color .2s ease;
}
.tool-input:focus { border-color: var(--gold); }
.tool-input::placeholder { color: #5c6577; }

/* 额度卡片四列（账号 / 已用 / 剩余 / 用满） */
.quota-body-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 420px) {
  .quota-body-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------- 账号卡片补充：停用态 / 备注 / 开关 ---------------- */
.account-card.off { opacity: .62; }
.account-card.off .avatar { filter: grayscale(.7); }
.off-badge { background: rgba(255, 255, 255, .12); color: var(--text-dim); }
/* 营地 Token 已失效（上游判定）：选号会跳过该账号，重新扫码登录或手动清除后恢复 */
.warn-badge { background: rgba(255, 107, 107, .16); color: var(--red); }
.account-remark { margin: 0 0 8px; color: var(--text-dim); font-size: 12px; word-break: break-word; }
.account-quota .aq-label { color: #5c6577; }
.account-remark b { color: var(--text); font-weight: 600; }

.switch { position: relative; display: inline-flex; align-items: center; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid var(--line);
  transition: background .22s ease, border-color .22s ease;
  position: relative;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e8ecf5;
  transition: transform .22s cubic-bezier(.22, .61, .36, 1);
}
.switch input:checked + .switch-track {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  border-color: transparent;
}
.switch input:checked + .switch-track::after { transform: translateX(18px); background: #fff; }

/* ---------------- 二次确认弹窗 ---------------- */
.confirm-text { margin: 4px 0 20px; color: var(--text); font-size: 14px; line-height: 1.7; white-space: pre-line; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn { flex: 1; }
.btn.danger-solid {
  background: linear-gradient(135deg, #ff7b7b, #e04b4b);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(224, 75, 75, .85);
}

/* 弹窗内的小字提示 */
.modal-hint { margin: 14px 0 0; }

/* toast 状态色 */
.toast[data-kind="error"] {
  border-color: rgba(255, 107, 107, .45);
  color: #ffd0d0;
}
