/* CSS 变量 */
:root {
  --primary-color: #375b80;
  --secondary-color: #34495e;
  --accent-color: #3498db;
  --background-color: #2c3e50;
  --panel-bg: rgba(0, 0, 0, 0.2);
  --text-color: #ecf0f1;
  --border-color: #7f8c8d;
  --header-height: 60px;
  --sidebar-width: 250px;
  --min-game-width: 320px;
  --block-size: 30px; /* 默认方块大小（大屏幕） */
  --ghost-opacity: 0.15; /* 模拟方块透明度 */
  --button-hover: #2980b9;
  --modal-bg: rgba(0, 0, 0, 0.8);
}

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

html {
  height: 100%;
  width: 100%;
  position: relative;
  min-width: 1100px;
}

body {
  font-family: "Arial", sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%; /* 防止iOS自动调整字体大小 */
}

.base-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  padding: 20px;
  overflow: auto;
  align-items: center;
  /* 设置滚动条样式 */
  scrollbar-color: #7c7a7a transparent; /* Firefox */
  scrollbar-width: thin; /* Firefox */
  /* Webkit浏览器 */
  &::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  &::-webkit-scrollbar-track {
    background: transparent;
  }
  &::-webkit-scrollbar-thumb {
    background: #7c7a7a;
    border-radius: 4px;
  }
  /* IE浏览器 */
  -ms-overflow-style: -ms-autohiding-scrollbar;
}

.base-content {
  max-width: 1000px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px; /* 元素间隔 */
  align-items: center;
  justify-content: center;
}

/* 游戏包装器 */
.game-wrapper {
  flex: 1;
  flex-direction: column;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
  overflow: auto;
  /* 设置滚动条样式 */
  scrollbar-color: #7c7a7a transparent; /* Firefox */
  scrollbar-width: thin; /* Firefox */
  /* Webkit浏览器 */
  &::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  &::-webkit-scrollbar-track {
    background: transparent;
  }
  &::-webkit-scrollbar-thumb {
    background: #7c7a7a;
    border-radius: 4px;
  }
  /* IE浏览器 */
  -ms-overflow-style: -ms-autohiding-scrollbar;
}

/* 游戏头部 */
.game-header {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  height: var(--header-height);
  margin-bottom: 20px;
}

.game-header h1 {
  font-size: 2em;
  font-weight: bold;
  color: var(--text-color);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.game-settings {
  display: flex;
  gap: 10px;
}

.review-content {
  margin-top: 20px;
  margin-bottom: 20px;
  margin-left: 10px;
  margin-right: 10px;
  width: 100%;
  padding: 20px;
  border-radius: 20px;
  background: #203040;
}

/* 图标按钮 */
.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-color);
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s;
}

.icon-btn:hover {
  background: var(--panel-bg);
}

/* 游戏容器 */
.game-container {
  /* flex: 1; */
  display: flex;
  gap: 20px;
  min-height: 0;
  position: relative;
  /* 设置子元素水平和垂直居中 */
  justify-content: center;
}

/* 侧边栏 */
.game-sidebar {
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-content {
  /* display: flex; */
  flex-direction: column;
  gap: 20px;
  height: 100%;
}

/* 面板样式 */
.panel {
  background: var(--panel-bg);
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.panel h3 {
  font-size: 1.2em;
  margin-bottom: 10px;
  color: var(--text-color);
  text-align: center;
}

.panel h2 {
  font-size: 1.2em;
  margin-bottom: 10px;
  color: var(--text-color);
  text-align: center;
}

/* 分数面板 */
.score-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 10px;
}

.score-item {
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 5px;
  text-align: center;
}

.score-item h3 {
  font-size: 0.9em;
  margin-bottom: 5px;
}

.score-item h2 {
  font-size: 0.9em;
  margin-bottom: 5px;
}

.score-item .value {
  font-size: 1.5em;
  font-weight: bold;
  color: var(--accent-color);
}

/* 游戏主区域 */
.game-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: var(--min-game-width);
  max-width: 100%;
  height: 100%;
}

.canvas-wrapper {
  flex: 1;
  width: 100%;
  /* height: 100%; */
  min-height: 0;
}

/* 画布容器 */
.canvas-container {
  background: var(--panel-bg);
  display: flex;
  justify-content: center;
  /* background: var(--panel-bg); */
  border-radius: 10px;
  padding: 10px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
  min-height: 0; /* 防止 flex 子元素溢出 */
}

.btn-primary {
  background: linear-gradient(135deg, #00ff88 0%, #0099ff 100%);
  color: #0a0e1a;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 255, 136, 0.4);
}

canvas#gameCanvas {
  /* 使用方块大小计算画布宽度 */
  --canvas-width: calc(var(--block-size) * 10); /* 10 是游戏列数 */

  /* 基础样式 */
  width: var(--canvas-width);
  height: calc(var(--canvas-width) * 2); /* 高度是宽度的两倍 */
  max-width: 100%;
  max-height: 100%;
  display: block; /* 移除画布底部的额外空间 */
  border-radius: 10px;
}

/* 波浪加载动画 */
@keyframes waveLoading {
  0% {
    background-position: -200% 0;
    opacity: 0.4;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    background-position: 200% 0;
    opacity: 0.4;
  }
}

.gameCanvas-bg {
  position: relative;
  animation: waveLoading 15s infinite linear;
  background: linear-gradient(
    90deg,
    rgba(0, 153, 255, 0.05) 20%,
    rgba(9, 117, 189, 0.5) 35%,
    rgba(0, 217, 255, 0.6) 50%,
    rgba(0, 153, 255, 0.5) 65%,
    rgba(0, 153, 255, 0.05) 80%
  );
  background-size: 400% 100%;
  box-shadow: 0 0 15px rgba(0, 153, 255, 0.3);
  transition: all 0.3s ease;
}

.gameCanvas-bg:hover {
  box-shadow: 0 0 25px rgba(0, 153, 255, 0.5);
}

/* 预览和暂存区 */
.preview-container {
  aspect-ratio: 2/1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  padding: 10px;
}

/* 控制说明 */
.controls-list {
  display: grid;
  gap: 8px;
}

.control-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-item .key {
  background: var(--primary-color);
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
  min-width: 40px;
  text-align: center;
}

/* 积分规则面板 */
.scoring-rules-panel {
  width: 100%;
  margin-top: 15px;
}

.rules-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.rule-item {
  background: rgba(0, 0, 0, 0.2);
  padding: 8px;
  border-radius: 5px;
}

.rule-title {
  font-weight: bold;
  color: #ffcc00;
  margin-bottom: 5px;
  font-size: 0.9em;
  text-align: center;
}

.rule-desc {
  font-size: 0.85em;
  margin: 3px 0;
  color: #ffffff;
}

/* 按钮样式 */
.game-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.3s;
  background: var(--panel-bg);
  color: var(--text-color);
}

.btn:hover {
  background: var(--button-hover);
}

.btn.primary {
  background: var(--primary-color);
}

.btn.primary:hover {
  background: var(--primary-hover);
}

.btn.btn-mode {
  background: #ff9800;
  color: white;
  margin-left: 10px;
  transition: all 0.3s ease;
}

.btn.btn-mode:hover {
  background: #f57c00;
  transform: scale(1.05);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--background-color);
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  min-width: 300px;
}

.modal-content h2 {
  margin-bottom: 20px;
}

/* 游戏结束模态框按钮容器 */
.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 10px;
}

/* 重新开始按钮 */
.btn.restart-btn {
  background: #4caf50; /* 绿色 */
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  transition: all 0.3s ease;
  min-width: 100px;
}

.btn.restart-btn:hover {
  background: #388e3c;
  transform: scale(1.05);
}

/* 返回按钮 */
.btn.back-btn {
  background: #2196f3; /* 蓝色 */
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  transition: all 0.3s ease;
  min-width: 100px;
}

.btn.back-btn:hover {
  background: #1976d2;
  transform: scale(1.05);
}

.btn.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 5px;
  background-color: rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.btn.icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.btn.icon-btn.disabled {
  background-color: rgba(255, 255, 255, 0.1);
  cursor: default;
}

.btn.icon-btn .material-icons {
  font-size: 24px;
  transition: opacity 0.2s ease;
}

/* 小图标按钮样式 */
.btn.icon-btn.small-icon {
  width: 35px;
  height: 35px;
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn.icon-btn.small-icon:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

.btn.icon-btn.small-icon.disabled {
  background-color: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 1024px) {
  :root {
    /* --panel-bg: transparent; */
  }

  .sidebar-content {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .panel {
    flex: 1;
    min-width: 200px;
  }

  :root {
    --sidebar-width: 220px;
    --block-size: 30px; /* 中等屏幕方块大小 */
  }

  .game-wrapper {
    padding: 10px;
  }
}

@media (max-width: 768px) {
  body {
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
  }

  html {
    min-width: 0;
    position: relative;
    overflow-y: auto;
  }

  .panel {
    min-width: 150px;
  }

  .score-grid {
    display: grid;
    width: 50px;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
  }

  .preview-container {
    padding: 5px; /* 减小预览区域的内边距 */
  }

  .score-item {
    border-radius: 5px;
    padding: 5px;
  }

  .score-item h3 {
    font-size: 0.7em; /* 减小标题字体大小 */
  }

  .score-item h2 {
    font-size: 0.7em; /* 减小标题字体大小 */
  }

  .score-item .value {
    font-size: 1em; /* 减小分数字体大小 */
  }

  /* 移动设备适配语言切换 */
  .language-dropdown-content {
    right: 0;
    left: auto;
    min-width: 100px;
  }

  .mobile-lang-dropdown {
    position: relative;
  }

  .mobile-lang-dropdown .language-dropdown-content {
    top: 100%;
    right: 0;
  }

  .lang-flag-icon {
    width: 35px;
    height: 35px;
    font-size: 20px;
  }
}

/* 移动设备适配 */
@media (max-width: 480px) {
  :root {
    --block-size: calc(100vw / 10);
  }

  .base-wrapper {
    padding: 0;
  }

  .panel {
    min-width: 100%;
    padding: 10px; /* 减小面板内边距 */
  }

  .game-controls {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    padding: 8px 16px; /* 减小按钮内边距 */
  }

  /* 移动设备上的模态框和按钮样式 */
  .modal-content {
    width: 85%;
    padding: 20px 15px;
  }

  .modal-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .btn.restart-btn,
  .btn.back-btn {
    min-width: 100%;
    margin: 0;
    padding: 12px 0;
    font-size: 16px;
  }

  .modal-content h2 {
    font-size: 20px;
  }

  .modal-content p {
    font-size: 14px;
    margin: 8px 0;
  }

  .control-item .key {
    min-width: 30px; /* 减小按键提示的宽度 */
    padding: 2px 4px; /* 减小按键提示的内边距 */
    font-size: 0.9em; /* 减小按键提示的字体大小 */
  }

  canvas#gameCanvas {
    border-radius: 5px;
    width: auto;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: block;
    image-rendering: pixelated;
  }

  .preview-container {
    width: 20px;
    height: 20px;
    margin: 10px auto 0px auto;
    background: transparent;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .mobile-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: var(--primary-color);
    color: var(--text-color);
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-btn.large {
    width: 60px;
    height: 60px;
  }

  /* 移动版积分规则面板 */
  .mobile-scoring-rules {
    margin-top: 20px;
    margin-bottom: 10px;
    margin-left: 10px;
    margin-right: 10px;
    width: auto;
    padding: 10px;
    border-radius: 20px;
    background: #203040;
  }

  .rules-header {
    text-align: center;
    margin-bottom: 10px;
  }

  .rules-header h3 {
    font-size: 16px;
    color: #ffcc00;
    margin: 0;
  }

  .rules-header h2 {
    font-size: 16px;
    color: #ffcc00;
    margin: 0;
  }

  .mobile-rules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .mobile-rule-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: 5px;
  }

  /* 移除滚动条 */
  ::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 360px) {
  :root {
    --block-size: 20px;
  }
}

/* 覆盖层样式 */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  color: white;
  text-align: center;
}

.overlay-content {
  background-color: var(--block-color-i);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  max-width: 80%;
}

.overlay-content h2 {
  margin-top: 0;
  color: white;
  font-size: 1.8rem;
}

.overlay-content p {
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

/* 游戏区域相对定位，用于覆盖层定位 */
.game-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 游戏控制按钮区域 */
.game-controls {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.score-animation {
  position: relative; /* 定位交给 wrapper，自己只做动画即可 */
  animation: score-float 1.5s ease-out forwards;
  opacity: 1;
  transform-origin: center;

  display: flex;
  flex-direction: column; /* 垂直排列：上面 combo，下面 score */
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

/* 下方：得分文案 */
.score-animation-score {
  font-size: 1.8rem;
  font-weight: bold;
  color: #fae644; /* 你原来的黄色 */
  text-shadow: 0 0 5px rgb(75 45 45 / 80%), 0 0 10px rgb(0 0 0 / 80%);
  margin-top: 2px; /* 和上面那行略微拉开一点距离 */

  display: flex;
  align-items: center;
}

/* COMBO x 部分：颜色深一点的黄 / 橙黄 */
.score-animation-combo {
  color: #e8a804; /* 深黄，Tailwind 的 amber-400 风格 */
  font-size: 1.4rem !important;
  text-shadow: 0 0 5px rgb(255 0 0 / 80%), 0 0 10px rgb(0 0 0 / 80%);
  margin-right: 15px;
}

@keyframes score-float {
  0% {
    transform: translateY(0) scale(0.8) rotate(-5deg);
    opacity: 0; /* 动画开始时不可见 */
  }
  10% {
    transform: translateY(-10px) scale(1.2) rotate(0deg);
    opacity: 1;
  }
  20% {
    transform: translateY(-20px) scale(1.1) rotate(5deg);
  }
  50% {
    transform: translateY(-40px) scale(1) rotate(-2deg);
    opacity: 1;
  }
  80% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-80px) scale(0.9) rotate(0deg);
    opacity: 0;
  }
}

/* 分数滚动效果 */
.score-roll {
  position: relative;
  overflow: hidden;
  height: 1.5em;
  line-height: 1.5em;
}

.score-roll-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  animation: score-roll-animation 0.5s ease-out;
}

.score-roll-old {
  animation: score-roll-out 0.5s ease-out;
}

/* 评论区域高亮效果 */
@keyframes highlight-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(52, 152, 219, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
  }
}

@keyframes score-roll-animation {
  0% {
    transform: translateY(100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes score-roll-out {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-100%);
    opacity: 0;
  }
}

/* 限时模式倒计时警告样式 */
.time-warning {
  color: #ff3838 !important;
  animation: time-warning-pulse 1s infinite alternate,
    time-warning-scale 1s infinite alternate,
    time-warning-color 1s infinite alternate;
  font-weight: bold;
}

@keyframes time-warning-pulse {
  from {
    opacity: 1;
    text-shadow: 0 0 5px rgba(255, 56, 56, 0.5);
  }
  to {
    opacity: 0.7;
    text-shadow: 0 0 15px rgba(255, 56, 56, 0.8);
  }
}

@keyframes time-warning-scale {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.2);
  }
}

@keyframes time-warning-color {
  from {
    color: #ff3838;
  }
  to {
    color: #ff8080;
  }
}

/* 语言切换相关样式 */
.language-dropdown {
  position: relative;
  display: inline-block;
}

.language-dropdown-content {
  display: none;
  position: absolute;
  background-color: rgba(32, 48, 64, 0.95);
  min-width: 120px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.3);
  border-radius: 5px;
  z-index: 1001;
  padding: 5px 0;
  margin-top: 5px;
  right: 0;
}

.language-dropdown-content button {
  color: white;
  padding: 8px 12px;
  text-decoration: none;
  display: block;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.language-dropdown-content button:last-child {
  border-bottom: none;
}

.language-dropdown-content button:hover {
  background-color: rgba(52, 152, 219, 0.3);
}

.language-dropdown:hover .language-dropdown-content {
  display: block;
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lang-flag-icon {
  font-size: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.lang-flag-icon:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: rotate(10deg);
}

.gradient-text {
  background: linear-gradient(135deg, #00ff9d 0%, #00b8ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 默认：超宽桌面 ─ 300×600 */
.ad_sidebar {
  display: block;
  min-width: 200px; /* 给出下限，避免 width=0 */
  max-width: 350px; /* 不可超出 */
  height: 600px; /* 固定高或 max-height 同理 */
}

/* ≤ 767 px：不显示（无手机适配需求）*/
@media (max-width: 767px) {
  .ad_sidebar {
    display: none;
  }
}

.ad_sidebar_right {
  display: block;
  min-width: 200px; /* 给出下限，避免 width=0 */
  max-width: 350px; /* 不可超出 */
  height: 600px; /* 固定高或 max-height 同理 */
}

@media (max-width: 1279px) {
  .ad_sidebar_right {
    display: none;
  }
}

.ad_banner-slot {
  display: block;
  text-align: center;
}

/* 桌面端 */
@media (min-width: 768px) {
  .ad_banner-slot {
    width: 100%;
    max-width: 1000px;
    height: 90px;
  }
}

/* 移动端 */
@media (max-width: 767px) {
  .ad_banner-slot {
    width: 100%;
    height: 50px;
    max-height: 80px;
  }
}

/* 骨架背景：纯灰色占位，不再动画 */
.ad-skeleton {
  position: relative; /* 让 ::after 能绝对居中 */
  background: var(--panel-bg); /* 纯灰占位 */
  border-radius: 10px;
}

/* 加载 Spinner */
.ad-skeleton::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px; /* 精准居中 */
  border: 3px solid #ccc; /* 灰色环 */
  border-top-color: #999; /* 高光 */
  border-radius: 50%;
  animation: spin 1s linear infinite;
  pointer-events: none;
}

/* Spinner 旋转关键帧 */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 广告加载完成后隐藏骨架 */
.ad-shell.loaded .ad-skeleton,
.ad-shell.loaded .ad-skeleton::after {
  opacity: 0;
  transition: opacity 0.3s;
}

/* 无库存时直接折叠 */
.ad-shell.empty {
  display: none !important;
}
