﻿* { box-sizing: border-box; }
body {
  font-family: "HarmonyOS Sans SC", "HarmonyOS Sans", system-ui, "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(ellipse 800px 500px at 10% -10%, rgba(99,102,241,0.12), transparent 60%),
    radial-gradient(ellipse 600px 400px at 90% 0%, rgba(56,189,248,0.10), transparent 55%),
    radial-gradient(ellipse 500px 400px at 50% 100%, rgba(168,85,247,0.06), transparent 60%),
    linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 50%, #E8EEF7 100%);
  color: #1E293B;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 精致毛玻璃卡片 */
.frosted-glass {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.8);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.04),
    0 8px 32px -8px rgba(30,41,59,0.12),
    inset 0 1px 0 rgba(255,255,255,0.9);
}

/* 精致软卡片 */
.soft-card {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(226,232,240,0.8);
  box-shadow:
    0 1px 3px rgba(0,0,0,0.04),
    0 4px 20px -6px rgba(30,41,59,0.08);
  transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.soft-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent);
}
.soft-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 4px 6px rgba(0,0,0,0.04),
    0 20px 40px -12px rgba(30,41,59,0.15);
  border-color: rgba(148,163,184,0.5);
}

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ===== 精致连体胶囊 ===== */
.capsule-group {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #F1F5F9, #E2E8F0);
  border-radius: 999px;
  padding: 4px;
  gap: 0;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
}
.capsule-tab {
  border: none;
  background: transparent;
  color: #64748B;
  transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 10px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
}
.capsule-tab:hover { color: #1D4ED8; }
.capsule-tab.active {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: #fff;
  box-shadow:
    0 2px 8px rgba(79,70,229,0.4),
    0 4px 16px -4px rgba(79,70,229,0.3),
    inset 0 1px 0 rgba(255,255,255,0.2);
}

/* ===== 砖块闯关画布 ===== */
.brick-stage {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: url('../images/game_bg_new.png') bottom/cover no-repeat;
  border: 2px solid rgba(255,255,255,0.6);
  box-shadow:
    0 4px 6px rgba(0,0,0,0.04),
    0 20px 50px -12px rgba(30,41,59,0.2),
    inset 0 2px 4px rgba(255,255,255,0.3);
}
.brick-row {
  position: absolute;
  left: 24px; right: 24px;
  top: 50%;
  transform: translateY(-60%);
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 20px 10px 30px;
}
.brick-row::-webkit-scrollbar { display: none; }
.brick-row { -ms-overflow-style: none; scrollbar-width: none; }

/* ===== 高清3D图片砖块 ===== */
.brick {
  position: relative;
  flex: 0 0 auto;
  width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: transform .25s cubic-bezier(0.4, 0, 0.2, 1);
}
.brick:hover { transform: translateY(-8px) scale(1.05); }
.brick:active { transform: translateY(-3px) scale(0.98); }
.brick img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3));
  transition: filter .25s ease;
}
.brick .b-name {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  text-shadow:
    0 1px 3px rgba(0,0,0,0.5),
    0 0 8px rgba(0,0,0,0.3);
  letter-spacing: .5px;
  white-space: nowrap;
  background: rgba(0,0,0,0.3);
  padding: 3px 12px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* 已通关：绿色光效 */
.brick.done img {
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.25)) drop-shadow(0 0 12px rgba(34,197,94,0.5));
}
/* 当前关卡：黄色发光 */
.brick.open img {
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.25)) drop-shadow(0 0 20px rgba(251,191,36,0.7));
  animation: brickImgGlow 2s ease-in-out infinite;
}
@keyframes brickImgGlow {
  0%, 100% { filter: drop-shadow(0 6px 12px rgba(0,0,0,0.25)) drop-shadow(0 0 14px rgba(251,191,36,0.5)); }
  50% { filter: drop-shadow(0 6px 12px rgba(0,0,0,0.25)) drop-shadow(0 0 28px rgba(251,191,36,0.8)); }
}
.brick.open .b-tag {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #F87171, #EF4444);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 999px;
  white-space: nowrap;
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(239,68,68,0.4);
  z-index: 2;
  animation: tagBounce 1.2s ease-in-out infinite;
}
@keyframes tagBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
}
/* 未解锁 */
.brick.locked { cursor: not-allowed; }
.brick.locked img {
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.2)) grayscale(0.3) brightness(0.85);
  opacity: 0.8;
}

/* 像素小人 */
.runner {
  position: absolute;
  bottom: 28px;
  left: 40px;
  width: 56px;
  height: 64px;
  z-index: 5;
  transition: left .45s cubic-bezier(0.34, 1.3, 0.5, 1), bottom .3s ease;
}
.runner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}
.runner.flip-left img { transform: scaleX(-1); }
.runner.jump { bottom: 60px; }

/* 终点旗帜 */
.flag-goal {
  position: absolute;
  bottom: 10px;
  right: 16px;
  z-index: 4;
  width: 70px;
  height: 110px;
}
.flag-goal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
  animation: flagSway 2.5s ease-in-out infinite;
}
@keyframes flagSway {
  0%, 100% { transform: rotate(-1.5deg); }
  50% { transform: rotate(1.5deg); }
}

.rank-badge { background: transparent !important; }

.hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,23,42,0.7);
  color: #fff;
  font-size: 12px;
  padding: 6px 16px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.rank-subtab {
  transition: all .25s ease;
  cursor: pointer;
  border: none;
}

/* 精致按钮通用样式 */
.btn-primary {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .25s ease;
  box-shadow:
    0 2px 8px rgba(79,70,229,0.3),
    0 4px 16px -4px rgba(79,70,229,0.2),
    inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 4px 12px rgba(79,70,229,0.4),
    0 8px 24px -4px rgba(79,70,229,0.3),
    inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-primary:active { transform: translateY(0); }

/* 精致图标容器 */
.icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.1),
    inset 0 1px 0 rgba(255,255,255,0.3);
}

/* 渐变文字 */
.gradient-text {
  background: linear-gradient(135deg, #2563EB, #3B82F6, #06B6D4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 精致分割线 */
.divider-soft {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(148,163,184,0.3), transparent);
}

/* 浮动动画 */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.float-animation { animation: float 4s ease-in-out infinite; }

/* 脉冲光晕 */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(99,102,241,0); }
}
.pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }
