/* ==========================================================================
   视觉升级：更有色彩的趣味风格（替换单调蓝白）
   ========================================================================== */

/* -------- 学生模式：多彩渐变主题 -------- */
[data-mode="student"] {
  --brand-1: #6366f1;
  --brand-2: #8b5cf6;
  --brand-3: #ec4899;
  --warm-1: #ff9a2e;
  --warm-2: #ff7d00;
}

/* 学生模式背景：柔和渐变 + 光斑 */
[data-mode="student"] body {
  background:
    radial-gradient(ellipse 800px 600px at 10% 0%, rgba(139, 92, 246, .10), transparent 60%),
    radial-gradient(ellipse 700px 500px at 90% 10%, rgba(236, 72, 153, .09), transparent 55%),
    radial-gradient(ellipse 600px 500px at 50% 100%, rgba(99, 102, 241, .08), transparent 60%),
    linear-gradient(175deg, #fafbff 0%, #f6f4ff 45%, #fff8fb 100%);
  background-attachment: fixed;
}

/* 学生模式卡片：更明显的圆角和立体感 */
[data-mode="student"] .card {
  border-radius: 20px;
  border: 1px solid rgba(139, 92, 246, .1);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  box-shadow:
    0 2px 8px -2px rgba(99, 102, 241, .08),
    0 10px 30px -12px rgba(139, 92, 246, .18);
}

/* 学生模式主按钮：紫色渐变（不再单调蓝） */
[data-mode="student"] .btn--primary {
  background: linear-gradient(125deg, #6366f1, #8b5cf6 55%, #a855f7);
  box-shadow: 0 6px 20px -8px rgba(139, 92, 246, .6);
  border: 0;
}
[data-mode="student"] .btn--primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

/* 学生模式导航：高亮更柔和 */
[data-mode="student"] .nav__item.is-active {
  background: linear-gradient(120deg, rgba(99, 102, 241, .12), rgba(139, 92, 246, .08));
  color: #6366f1;
  font-weight: 700;
}
[data-mode="student"] .tabbar__item.is-active {
  background: linear-gradient(120deg, rgba(99, 102, 241, .14), rgba(168, 85, 247, .1));
  color: #6366f1;
}

/* 学生模式标题：渐变文字 */
[data-mode="student"] .topbar h1 {
  background: linear-gradient(120deg, #6366f1, #a855f7 50%, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
}

/* ==========================================================================
   积分商店
   ========================================================================== */
.sh-balance {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  border-radius: 20px;
  margin-bottom: 16px;
  background: linear-gradient(125deg, #ffd666, #ffb84d 45%, #ff9a2e);
  box-shadow: 0 10px 30px -12px rgba(255, 154, 46, .55);
  position: relative;
  overflow: hidden;
}
.sh-balance::after {
  content: "";
  position: absolute;
  right: -30px; top: -50px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.32), transparent 68%);
}
.sh-balance__icon {
  font-size: 42px;
  line-height: 1;
  position: relative;
  animation: coinSpin 3.2s ease-in-out infinite;
}
@keyframes coinSpin {
  0%, 100% { transform: rotateY(0) scale(1); }
  50% { transform: rotateY(180deg) scale(1.06); }
}
.sh-balance__body { position: relative; }
.sh-balance__num {
  font-size: 34px;
  font-weight: 900;
  color: #7a4100;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.sh-balance__label {
  font-size: 12px;
  color: #a15d00;
  font-weight: 700;
  margin-top: 4px;
}

/* -------- 刷题挑战 -------- */
.sh-challenge {
  padding: 18px;
  border-radius: 20px;
  margin-bottom: 16px;
  background: linear-gradient(150deg, #fff5f5, #ffe8f0 60%, #ffeef8);
  border: 1.5px solid #ffd0e0;
  position: relative;
  overflow: hidden;
}
.sh-challenge.is-done {
  background: linear-gradient(150deg, #f0fff4, #e8f8ee);
  border-color: #b7ebc6;
}

.sh-challenge__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.sh-challenge__title {
  font-size: 16px;
  font-weight: 850;
  color: #1d2129;
  flex: 1;
}
.sh-challenge__reward {
  font-size: 12.5px;
  font-weight: 850;
  color: #fff;
  background: linear-gradient(135deg, #ff7d00, #ff9a2e);
  padding: 5px 13px;
  border-radius: 99px;
  box-shadow: 0 3px 10px -3px rgba(255,125,0,.5);
}

.sh-challenge__desc {
  font-size: 12px;
  color: #86909c;
  margin-bottom: 14px;
  line-height: 1.6;
}

.sh-challenge__stats {
  display: flex;
  gap: 26px;
  margin-bottom: 12px;
}
.sh-challenge__stat { display: flex; align-items: baseline; gap: 3px; }
.sh-challenge__num {
  font-size: 24px;
  font-weight: 900;
  color: #6366f1;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.sh-challenge__unit {
  font-size: 11.5px;
  color: #86909c;
  font-weight: 600;
}

.sh-challenge__bar {
  height: 11px;
  border-radius: 99px;
  background: rgba(255,255,255,.8);
  overflow: hidden;
  margin-bottom: 14px;
}
.sh-challenge__bar > div {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #ec4899, #f43f5e, #fb7185);
  transition: width .6s cubic-bezier(.22,.9,.3,1);
  position: relative;
  overflow: hidden;
}
.sh-challenge__bar > div::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  animation: gmShine 2s ease-in-out infinite;
}

.sh-challenge__btn {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(120deg, #ec4899, #f43f5e 55%, #fb7185);
  color: #fff;
  font-size: 14.5px;
  font-weight: 850;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 20px -8px rgba(236,72,153,.6);
  transition: all .2s;
}
.sh-challenge__btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.sh-challenge__btn.is-locked {
  background: rgba(0,0,0,.06);
  color: #86909c;
  box-shadow: none;
  cursor: not-allowed;
}
.sh-challenge__done {
  text-align: center;
  padding: 11px;
  border-radius: 12px;
  background: rgba(0,180,42,.1);
  color: #00b42a;
  font-size: 13px;
  font-weight: 800;
}

/* -------- 商品分组 -------- */
.sh-section { margin-bottom: 20px; }
.sh-section__title {
  font-size: 14.5px;
  font-weight: 850;
  color: #1d2129;
  margin-bottom: 12px;
}

.sh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.sh-item {
  background: #fff;
  border: 1px solid rgba(139,92,246,.1);
  border-radius: 16px;
  padding: 10px;
  transition: all .22s cubic-bezier(.22,.9,.3,1);
  box-shadow: 0 2px 10px -4px rgba(99,102,241,.12);
}
.sh-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px -10px rgba(139,92,246,.32);
}
.sh-item.is-owned { background: #fafbff; }

.sh-item__preview {
  height: 86px;
  border-radius: 12px;
  margin-bottom: 9px;
  position: relative;
  overflow: hidden;
}
.sh-item__preview--icon {
  display: grid;
  place-items: center;
  font-size: 34px;
  background: #f4f2ff;
}

.sh-item__name {
  font-size: 12.5px;
  font-weight: 800;
  color: #1d2129;
  margin-bottom: 3px;
  line-height: 1.3;
}
.sh-item__desc {
  font-size: 10.5px;
  color: #a0aec0;
  line-height: 1.5;
  margin-bottom: 9px;
  min-height: 16px;
}

.sh-item__btn {
  width: 100%;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(120deg, #ffd666, #ffb84d 55%, #ff9a2e);
  color: #7a4100;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  font-family: inherit;
  transition: all .18s;
}
.sh-item__btn:hover:not(:disabled) { filter: brightness(1.05); }
.sh-item__btn:disabled {
  background: #f0f2f6;
  color: #b8c4d4;
  cursor: not-allowed;
}

.sh-item__owned {
  text-align: center;
  padding: 7px;
  border-radius: 10px;
  background: rgba(0,180,42,.09);
  color: #00b42a;
  font-size: 11.5px;
  font-weight: 800;
}

/* -------- 手机端 -------- */
@media (max-width: 560px) {
  .sh-balance { padding: 16px 18px; border-radius: 17px; margin-bottom: 13px; gap: 12px; }
  .sh-balance__icon { font-size: 34px; }
  .sh-balance__num { font-size: 28px; }

  .sh-challenge { padding: 15px; border-radius: 17px; margin-bottom: 13px; }
  .sh-challenge__title { font-size: 15px; }
  .sh-challenge__num { font-size: 21px; }
  .sh-challenge__btn { height: 42px; font-size: 14px; }

  .sh-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sh-item { padding: 8px; border-radius: 14px; }
  .sh-item__preview { height: 72px; border-radius: 10px; margin-bottom: 8px; }
  .sh-item__name { font-size: 12px; }
}

@media (max-width: 360px) {
  .sh-grid { grid-template-columns: 1fr; }
}
