/* ==========================================================================
   jackane宇 · 第 3 期 EdgeOne 云端全服殿堂样式（全服欧皇墙 / 公平三榜 / 云端存档同步）(sprint3-cloud.css)
   严守安卓微信 XWeb GPU 零 backdrop-filter 规范 + 暗夜/白昼双主题 + 移动端防缩放
   ========================================================================== */

/* ---------- 1. 主舞台顶部不拥挤的轻播报条（仅收到新全服欧皇捷报时轻滑现身） ---------- */
.global-hit-ticker {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 56px);
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  z-index: 44;
  max-width: min(560px, calc(100vw - 24px));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 12px;
  border-radius: 999px;
  background: #0d1629;
  border: 1px solid rgba(245, 200, 76, 0.56);
  color: #f8fafc;
  font-size: 12px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.48);
  cursor: pointer;
  contain: layout paint;
}

.global-hit-ticker[hidden] {
  display: none !important;
}

html[data-studio-light="day"] .global-hit-ticker {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(217, 119, 6, 0.5);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.global-hit-ticker-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-hit-ticker-text strong {
  color: #fde047;
}

html[data-studio-light="day"] .global-hit-ticker-text strong {
  color: #b45309;
}

.global-hit-ticker-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 0;
  background: rgba(148, 163, 184, 0.2);
  color: inherit;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  padding: 0;
}

/* ---------- 1b. 主舞台顶部公开人气轻角标（零 backdrop-filter，点击直达公平榜） ---------- */
.studio-live-stats-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.36);
  background: rgba(11, 18, 34, 0.86);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.34);
}

.studio-live-stats-pill[hidden],
.series-switcher.drawer-open .studio-live-stats-pill {
  display: none !important;
}

.studio-live-stats-pill b {
  color: #fde047;
  font-weight: 900;
}

html[data-studio-light="day"] .studio-live-stats-pill {
  background: rgba(255, 255, 255, 0.94);
  color: #334155;
  border-color: rgba(16, 185, 129, 0.42);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.1);
}

html[data-studio-light="day"] .studio-live-stats-pill b {
  color: #b45309;
}

.live-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22);
  flex-shrink: 0;
}

/* ---------- 1c. 全服云端殿堂公开三格人气看板 ---------- */
.cloud-stats-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.cloud-stat-box {
  padding: 9px 11px;
  border-radius: 13px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cloud-stat-box.is-total {
  border-color: rgba(245, 200, 76, 0.36);
  background: rgba(245, 200, 76, 0.08);
}

.cloud-stat-box.is-today {
  border-color: rgba(52, 211, 153, 0.36);
  background: rgba(16, 185, 129, 0.08);
}

.cloud-stat-box.is-packs {
  border-color: rgba(56, 189, 248, 0.34);
  background: rgba(14, 165, 233, 0.08);
}

html[data-studio-light="day"] .cloud-stat-box {
  background: rgba(15, 23, 42, 0.035);
}

html[data-studio-light="day"] .cloud-stat-box.is-total {
  background: rgba(245, 158, 11, 0.1);
}

html[data-studio-light="day"] .cloud-stat-box.is-today {
  background: rgba(16, 185, 129, 0.1);
}

html[data-studio-light="day"] .cloud-stat-box.is-packs {
  background: rgba(14, 165, 233, 0.1);
}

.cloud-stat-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  white-space: nowrap;
}

.cloud-stat-box.is-today .cloud-stat-label .ptcg-ico { color: #34d399; }
.cloud-stat-box.is-packs .cloud-stat-label .ptcg-ico { color: #38bdf8; }

.cloud-stat-box strong {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
}

.cloud-stat-box.is-total strong { color: #fde047; }
.cloud-stat-box.is-today strong { color: #34d399; }
.cloud-stat-box.is-packs strong { color: #7dd3fc; }

.cloud-stat-box strong small {
  margin-left: 3px;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.78;
}

html[data-studio-light="day"] .cloud-stat-label { color: #475569; }
html[data-studio-light="day"] .cloud-stat-box.is-total strong { color: #b45309; }
html[data-studio-light="day"] .cloud-stat-box.is-today strong { color: #047857; }
html[data-studio-light="day"] .cloud-stat-box.is-packs strong { color: #0369a1; }

/* ---------- 2. 顶部连接态胶囊 & 通用小按钮 ---------- */
.cloud-head-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.cloud-net-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
}

.cloud-net-pill.is-online {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #34d399;
}

.cloud-net-pill.is-warm {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.42);
  color: #7dd3fc;
}

.cloud-net-pill.is-off {
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #94a3b8;
}

html[data-studio-light="day"] .cloud-net-pill.is-online { color: #047857; }
html[data-studio-light="day"] .cloud-net-pill.is-warm { color: #0369a1; }
html[data-studio-light="day"] .cloud-net-pill.is-off { color: #475569; }

.cloud-mini-btn {
  height: 31px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  flex-shrink: 0;
  min-width: max-content;
}

.cloud-sub-note {
  font-size: 11.5px;
  color: #94a3b8;
}

/* ---------- 3. 全服高罕欧皇实时播报墙 ---------- */
.cloud-ticker-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cloud-ticker-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.cloud-ticker-card.is-gold {
  border-color: rgba(245, 200, 76, 0.48);
  background: linear-gradient(145deg, rgba(245, 200, 76, 0.13), rgba(15, 23, 42, 0.42));
}

html[data-studio-light="day"] .cloud-ticker-card {
  background: rgba(15, 23, 42, 0.035);
}

html[data-studio-light="day"] .cloud-ticker-card.is-gold {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.14), rgba(255, 255, 255, 0.92));
}

.cloud-ticker-thumb {
  width: 56px;
  aspect-ratio: 500 / 698;
  object-fit: cover;
  border-radius: 7px;
  flex-shrink: 0;
}

.cloud-ticker-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cloud-ticker-top {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.cloud-badge {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
}

.cloud-badge.gold {
  background: rgba(245, 200, 76, 0.22);
  color: #fde047;
}

.cloud-badge.sr {
  background: rgba(192, 132, 252, 0.22);
  color: #e9d5ff;
}

html[data-studio-light="day"] .cloud-badge.gold { color: #92400e; }
html[data-studio-light="day"] .cloud-badge.sr { color: #6b21a8; }

.cloud-chan-tag,
.cloud-time {
  font-size: 10.5px;
  color: #94a3b8;
}

.cloud-time {
  margin-left: auto;
}

.cloud-ticker-title {
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-ticker-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
  color: #94a3b8;
}

.cloud-ticker-sub strong {
  color: #34d399;
}

html[data-studio-light="day"] .cloud-ticker-sub strong {
  color: #047857;
}

/* ---------- 4. 公平全服排行榜 ---------- */
.cloud-my-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(245, 200, 76, 0.36);
  background: rgba(245, 200, 76, 0.08);
}

.cloud-my-card.is-locked {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.08);
}

.cloud-my-meta {
  flex: 1;
  min-width: 200px;
}

.cloud-my-meta p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #cbd5e1;
}

html[data-studio-light="day"] .cloud-my-meta p {
  color: #334155;
}

.cloud-lb-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cloud-lb-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 13px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.035);
}

.cloud-lb-row[data-cloud-inspect] {
  cursor: pointer;
}

.cloud-lb-row.is-me {
  border-color: rgba(56, 189, 248, 0.56);
  background: rgba(14, 165, 233, 0.12);
}

html[data-studio-light="day"] .cloud-lb-row {
  background: rgba(15, 23, 42, 0.03);
}

.cloud-rank-num {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 900;
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.cloud-rank-num.top1 {
  background: rgba(245, 200, 76, 0.24);
  color: #facc15;
}

.cloud-rank-num.top2 {
  background: rgba(203, 213, 225, 0.22);
  color: #e2e8f0;
}

.cloud-rank-num.top3 {
  background: rgba(251, 146, 60, 0.22);
  color: #fdba74;
}

html[data-studio-light="day"] .cloud-rank-num { color: #334155; }
html[data-studio-light="day"] .cloud-rank-num.top1 { color: #b45309; }
html[data-studio-light="day"] .cloud-rank-num.top2 { color: #475569; }
html[data-studio-light="day"] .cloud-rank-num.top3 { color: #c2410c; }

.cloud-lb-who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cloud-lb-who strong {
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-lb-who em {
  font-style: normal;
  font-size: 11px;
  color: #94a3b8;
}

.cloud-lb-metric {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.cloud-lb-metric strong {
  font-size: 14.5px;
  color: #fde68a;
}

.cloud-lb-metric span {
  font-size: 11px;
  color: #94a3b8;
}

html[data-studio-light="day"] .cloud-lb-metric strong {
  color: #b45309;
}

/* ---------- 5. 跨设备云端存档同步 ---------- */
.cloud-save-card {
  padding: 14px;
  border-radius: 15px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.035);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

html[data-studio-light="day"] .cloud-save-card {
  background: rgba(15, 23, 42, 0.03);
}

.cloud-save-card h4,
.cloud-save-card p {
  margin: 0;
}

.cloud-save-card p {
  font-size: 12px;
  line-height: 1.5;
  color: #94a3b8;
}

.cloud-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(245, 200, 76, 0.1);
  border: 1px solid rgba(245, 200, 76, 0.42);
}

.cloud-code-box span {
  display: block;
  font-size: 11px;
  color: #94a3b8;
}

.cloud-code-box strong {
  font-size: 20px;
  letter-spacing: 0.08em;
  color: #fde047;
  font-family: var(--font-mono);
}

html[data-studio-light="day"] .cloud-code-box strong {
  color: #b45309;
}

.cloud-restore-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cloud-code-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  font-size: 16px; /* 手机聚焦禁止缩放 */
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

html[data-studio-light="day"] .cloud-code-input {
  background: #ffffff;
  color: #0f172a;
}

.cloud-save-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cloud-restore-preview {
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(52, 211, 153, 0.46);
  background: rgba(16, 185, 129, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cloud-status-msg {
  margin: 0;
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 700;
}

.cloud-status-msg.is-ok {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #34d399;
}

.cloud-status-msg.is-err {
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(251, 113, 133, 0.4);
  color: #fb7185;
}

html[data-studio-light="day"] .cloud-status-msg.is-ok { color: #047857; }
html[data-studio-light="day"] .cloud-status-msg.is-err { color: #be123c; }

/* ---------- 6. 移动端自适应 (<= 768px) ---------- */
@media (max-width: 768px) {
  .global-hit-ticker {
    top: calc(env(safe-area-inset-top, 0px) + 52px);
    max-width: calc(100vw - 18px);
    font-size: 11.5px;
    padding: 5px 8px 5px 10px;
  }

  .cloud-ticker-list {
    grid-template-columns: 1fr;
  }

  .cloud-restore-row {
    flex-direction: column;
    align-items: stretch;
  }

  .cloud-restore-row .cloud-mini-btn {
    width: 100%;
    height: 36px !important;
  }

  .studio-live-stats-pill {
    font-size: 10.5px;
    padding: 2.5px 9px;
  }

  .cloud-stat-box {
    padding: 8px 8px;
  }

  .cloud-stat-box strong {
    font-size: 15.5px;
  }
}

@media (max-width: 420px) {
  .stats-pill-packs {
    display: none;
  }
}
