/* ===== 主题：典雅幻想（低饱和 + 细金边） ===== */

:root {
  --primary: #7C6FA8;
  --primary-light: #B8AED6;
  --secondary: #8FA9A0;
  --secondary-light: #D9E5DF;
  --accent: #C6A15B;
  --accent-light: #F1E6CE;
  --success: #6F9C7E;
  --warning: #C0904B;
  --danger: #B26A5E;
  --bg-main: #F5F1E8;
  --bg-card: #FCFAF5;
  --text-dark: #3A352C;
  --text-mid: #6E6656;
  --text-light: #9A9280;
  --border: #E3D9C4;
  --line-strong: #C6A15B;
  --gold: #C6A15B;
  --gold-soft: #E7D9BC;
  --shadow: 0 8px 24px rgba(90, 75, 50, 0.08);
  --shadow-hover: 0 12px 30px rgba(90, 75, 50, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg-main);
  background-image:
    radial-gradient(900px 500px at 12% -8%, rgba(124, 111, 168, 0.10), transparent 60%),
    radial-gradient(700px 420px at 96% 4%, rgba(198, 161, 91, 0.12), transparent 62%),
    radial-gradient(800px 520px at 82% 96%, rgba(143, 169, 160, 0.10), transparent 64%);
  color: var(--text-dark);
  font-size: 15px;
  line-height: 1.6;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D8CBB2; border-radius: 99px; }

/* 卡片：细金边 + 内描边 = 卷轴感 */
.card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  background: var(--bg-card);
  position: relative;
}
.card:hover { transform: none; box-shadow: var(--shadow-hover); }

/* 按钮 */
.btn {
  border: 1px solid var(--gold) !important;
  border-radius: 12px !important;
  padding: 9px 16px;
  font-weight: 700;
  letter-spacing: .3px;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0));
  box-shadow: 0 3px 10px rgba(90, 75, 50, 0.12) !important;
  transition: filter .15s ease, transform .1s ease;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #8D80BC, #75699F) !important; color: #FFFDF8 !important; }
.btn-secondary { background: linear-gradient(180deg, #9FB8AF, #849E95) !important; color: #223028 !important; }
.btn-success { background: linear-gradient(180deg, #86AD93, #6F9C7E) !important; color: #1F3327 !important; }
.btn-warning { background: linear-gradient(180deg, #D8B57A, #C0904B) !important; color: #4A3A1C !important; }
.btn-danger { background: linear-gradient(180deg, #C58277, #B26A5E) !important; color: #FFF8F5 !important; }
.btn-ghost { background: #FBF7EE !important; color: var(--text-dark) !important; border-color: var(--gold-soft) !important; }
.btn-lg { padding: 12px 22px; font-size: 16px; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 10px !important; }
.btn-icon { border-radius: 11px !important; }

/* 标签 */
.badge {
  border: 1px solid var(--gold-soft);
  border-radius: 99px;
  font-weight: 700;
  padding: 2px 9px;
  background: #FBF6E9;
  color: var(--text-mid);
  box-shadow: none;
}
.badge-primary { background: #EFEAF7; color: #5E5486; border-color: #D6CBE8; }
.badge-success { background: #EAF2EC; color: #4C7059; border-color: #CBDDD0; }
.badge-warning { background: #F7EEDB; color: #7A5C28; border-color: #E6D3AE; }
.badge-danger { background: #F6E9E6; color: #8C4B42; border-color: #E3C9C3; }
.badge-purple { background: #EFEAF7; color: #5E5486; border-color: #D6CBE8; }

/* 进度条 */
.progress-bar {
  background: #EFE8DA;
  border: 1px solid #DCCDAF;
  border-radius: 99px;
  height: 10px;
  box-shadow: inset 0 1px 2px rgba(90, 75, 50, 0.08);
  overflow: hidden;
}
.progress-fill {
  border-radius: 99px;
  box-shadow: none;
  background: linear-gradient(90deg, #D8B57A, #C6A15B) !important;
}
.progress-fill::after { display: none; }
.progress-exp { background: linear-gradient(90deg, #D8B57A, #C6A15B) !important; }
.progress-health { background: linear-gradient(90deg, #C58277, #B26A5E) !important; }
.progress-hungry { background: linear-gradient(90deg, #DDB77C, #C0904B) !important; }
.progress-happy { background: linear-gradient(90deg, #B8AED6, #8D80BC) !important; }
.progress-clean { background: linear-gradient(90deg, #9FB8AF, #7E9A90) !important; }

/* 表单 */
.input-group label { color: var(--text-mid); font-size: 12.5px; font-weight: 700; letter-spacing: .2px; }
.input-field {
  border-radius: 11px;
  border: 1px solid var(--border);
  background: #FDFBF6;
  padding: 11px 14px;
  font-size: 15px;
  color: var(--text-dark);
  box-shadow: inset 0 1px 2px rgba(90, 75, 50, 0.04);
}
.input-field:focus {
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(198, 161, 91, 0.16);
}
.input-icon { color: var(--text-light); }

/* 弹窗：淡底纹 */
.modal-overlay { background: rgba(58, 53, 44, 0.42); backdrop-filter: blur(2px); }
.modal-box {
  border-radius: 20px;
  border: 1px solid var(--gold-soft);
  background-color: #FCFAF5;
  background-image:
    repeating-linear-gradient(45deg, rgba(198, 161, 91, 0.045) 0 1px, transparent 1px 10px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(250, 246, 236, 0.2));
  box-shadow: 0 18px 46px rgba(60, 50, 35, 0.22), inset 0 0 0 1px #fff;
}
.toast {
  border-radius: 12px;
  border: 1px solid var(--gold-soft);
  background: #FBF7EE !important;
  color: var(--text-dark) !important;
  box-shadow: 0 8px 24px rgba(60, 50, 35, 0.18);
  font-weight: 700;
}
.toast-success { border-color: #CBDDD0; }
.toast-error { border-color: #E3C9C3; }
.toast-info { border-color: #D6CBE8; }
.toast-warning { border-color: #E6D3AE; }

/* 顶栏 / 底栏 */
.topbar {
  background: rgba(252, 250, 245, 0.96);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(90, 75, 50, 0.05);
  backdrop-filter: blur(8px);
}
.topbar-logo .logo-icon { animation: none; color: var(--primary); }
.topbar-logo .logo-icon svg { width: 24px; height: 24px; }
.topbar-points {
  background: #FBF4E6;
  border: 1px solid var(--gold-soft);
  border-radius: 99px;
  color: var(--text-dark);
  font-weight: 700;
}
.topbar-avatar { border: 1px solid var(--gold-soft); background: #FBF4E6; }

.bottom-nav {
  background: rgba(252, 250, 245, 0.97);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 14px rgba(90, 75, 50, 0.05);
  backdrop-filter: blur(8px);
}
.nav-item { color: var(--text-light); font-size: 11.5px; font-weight: 600; letter-spacing: .3px; }
.nav-item.active { color: var(--primary); font-weight: 700; }
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, #D8B57A, #C6A15B);
}
.nav-icon { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; }
.nav-icon svg { width: 20px; height: 20px; }

/* 标题：衬线字 + 细金字 */
.page-title, .teacher-page-title {
  font-family: "Songti SC", "Noto Serif SC", "SimSun", serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .5px;
  color: #3A352C;
}
.page-title { display: flex; align-items: center; gap: 8px; }
.teacher-page-title { display: flex; align-items: center; gap: 8px; }
.page-title svg, .teacher-page-title svg { width: 19px; height: 19px; color: var(--gold); }

/* 统计卡 */
.stat-card { border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--bg-card); }
.stat-icon-box { border-radius: 12px; background: #F6EFE0; border: 1px solid var(--gold-soft); color: var(--gold); }
.stat-icon-box svg { width: 19px; height: 19px; }
.stat-value { font-weight: 800; letter-spacing: -.2px; color: var(--text-dark); }
.stat-label { color: var(--text-light); font-weight: 600; }

/* 表格 */
.data-table th { background: #F7F0E2; color: var(--text-mid); font-weight: 700; border-bottom: 1px solid var(--border); }
.data-table td { border-bottom: 1px dashed var(--border); }
.data-table tr:hover td { background: #FBF7EE; }

/* 排行榜 */
.rank-item { border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--bg-card); }
.rank-item:hover { transform: none; box-shadow: var(--shadow-hover); }
.rank-1 { background: linear-gradient(135deg, #F3E3BE, #E7D0A0) !important; color: #5A4218 !important; }
.rank-2 { background: linear-gradient(135deg, #EDE8DA, #DED6C2) !important; color: #4A4335 !important; }
.rank-3 { background: linear-gradient(135deg, #EEDCC8, #E0C7AC) !important; color: #5A3A1E !important; }
.rank-other { background: #FBF7EE !important; color: var(--text-mid) !important; }
.rank-num { border-radius: 9px; border: 1px solid var(--gold-soft); }

/* 宠物操作 */
.action-btn {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #FDFBF6, #F7F1E5);
  box-shadow: 0 4px 12px rgba(90, 75, 50, 0.08);
}
.action-btn:hover { transform: none; border-color: var(--gold); }
.action-feed, .action-bath, .action-play, .action-heal { background: linear-gradient(180deg, #FDFBF6, #F7F1E5) !important; color: var(--text-dark) !important; }
.action-btn .action-icon svg { width: 24px; height: 24px; color: var(--primary); }
.action-btn .action-cost { color: var(--text-light); font-weight: 700; }

/* 宠物场景 */
.pet-scene, .pet-bg {
  background: radial-gradient(120% 90% at 50% 20%, #FBF6EA 0%, #F0E7D6 55%, #E7DCC6 100%) !important;
}
.pet-status-bubble { border-radius: 14px; border: 1px solid var(--gold-soft); background: #FFFDF8; }
.pet-level-badge { border: 1px solid var(--gold-soft); border-radius: 99px; background: #FBF4E6; }
.pet-name { font-family: "Songti SC", serif; font-weight: 700; }

/* 任务卡 */
.task-card { border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--bg-card); }
.task-card.submitted { border-color: #B8AED6; }
.task-card.completed { border-color: #BFD6C7; opacity: 1; }
.task-points { color: var(--warning); font-weight: 700; }

/* 头像菜单 */
.avatar-dropdown {
  border-radius: 16px; border: 1px solid var(--gold-soft); background: #FDFBF6;
  box-shadow: 0 14px 36px rgba(60, 50, 35, 0.18);
  background-image: repeating-linear-gradient(45deg, rgba(198, 161, 91, 0.04) 0 1px, transparent 1px 10px);
}
.avatar-menu-item:hover { background: #FBF6E9; }
.avatar-menu-logout { color: var(--danger); }
.points-notify-popup { border-radius: 16px; border: 1px solid var(--gold-soft); background: #FDFBF6; }

/* 宠物立绘 */
.pet-svg { width: 100%; height: 100%; display: block; }
.pet-art-box { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pet-art { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.pet-art-box.is-egg .pet-egg-svg { width: 100%; height: 100%; }
.pet-emoji { width: 290px; height: 290px; max-width: 84vw; margin: 0 auto; }
.pet-emoji .pet-art { animation: petBreath 3.6s ease-in-out infinite; transform-origin: 50% 88%; }
.hero-pet { width: 64px; height: 64px; flex-shrink: 0; }
.hero-pet .pet-art { width: 100%; height: 100%; object-fit: contain; }
.hero-pet .pet-art-box { animation: petFloat 3.4s ease-in-out infinite; }
.item-svg { width: 26px; height: 26px; display: block; }
.shop-item-icon {
  width: 54px; height: 54px; border-radius: 14px;
  border: 1px solid var(--border); background: #FBF7EE;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.shop-item-icon .item-svg { width: 34px; height: 34px; }
#root .big-item { display: flex; justify-content: center; margin-bottom: 8px; }
#root .big-item .item-svg { width: 72px; height: 72px; }

/* 图标尺寸 */
.status-ico { width: 20px; height: 20px; margin: 0 auto; color: var(--text-mid); }
.status-ico svg { width: 20px; height: 20px; }
.task-ico { width: 26px; height: 26px; display: inline-flex; color: var(--text-mid); }
.task-ico svg { width: 26px; height: 26px; }
.task-ico-sm { display: inline-flex; width: 18px; height: 18px; vertical-align: -3px; }
.task-ico-sm svg { width: 18px; height: 18px; }
.detail-ico { width: 48px; height: 48px; margin: 0 auto 6px; }
.detail-ico svg { width: 48px; height: 48px; }
.status-bar-item .icon svg { width: 17px; height: 17px; }
.mini-ico { display: inline-flex; width: 16px; height: 16px; vertical-align: -3px; }
.mini-ico svg { width: 16px; height: 16px; }
.quick-ico { width: 38px; height: 38px; margin: 0 auto 8px; color: var(--primary); }
.quick-ico svg { width: 38px; height: 38px; }
.mini-pet { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mini-pet-lg { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; }
.rank-hero-pet { width: 40px; height: 40px; }
.rank-pet { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.podium-pet { width: 64px; height: 64px; margin: 0 auto 4px; }
.podium-pet.champion { width: 86px; height: 86px; }
.adopt-pet { width: 64px; height: 64px; margin: 0 auto 6px; }
.levelup-pet { width: 92px; height: 92px; margin: 8px auto 0; }

/* ===== 首页：宠物占约三分之一屏 ===== */
.home-hero {
  position: relative;
  margin-bottom: 16px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--gold-soft);
  background:
    radial-gradient(120% 90% at 50% 104%, rgba(198, 161, 91, 0.20), transparent 62%),
    linear-gradient(165deg, #F8F3E7 0%, #F1ECF7 52%, #E9F0EC 100%);
  box-shadow: 0 10px 30px rgba(90, 75, 50, 0.10), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  padding: 16px 16px 18px;
  text-align: center;
}
.home-hero::before {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(198, 161, 91, 0.35);
  border-radius: 16px;
  pointer-events: none;
}
.home-hero-art {
  height: 32vh;
  min-height: 220px;
  max-height: 330px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}
.home-hero-art .pet-art-box { height: 100%; }
.home-hero-art .pet-art {
  max-height: 100%;
  filter: drop-shadow(0 14px 18px rgba(90, 75, 50, 0.18));
  animation: petBreath 4s ease-in-out infinite;
  transform-origin: 50% 90%;
}
.home-hero-info { padding-top: 6px; }
.home-hero-hello {
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 20px;
  font-weight: 700;
  color: #3A352C;
  letter-spacing: .5px;
}
.home-hero-sub { font-size: 12.5px; color: var(--text-mid); margin-top: 2px; }
.home-hero-chips { display: flex; justify-content: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: #5C5142;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--gold-soft);
  border-radius: 99px;
  padding: 4px 12px;
  backdrop-filter: blur(4px);
}

@keyframes petBreath {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.015); }
}
@keyframes petFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
  .pet-art, .home-hero-art .pet-art { animation: none !important; }
}

.coin-fly { display: none !important; }

@media (max-width: 420px) {
  body { font-size: 14.5px; }
  .page-title, .teacher-page-title { font-size: 20px; }
  .pet-emoji { width: 240px; height: 240px; }
  .home-hero-art { height: 30vh; min-height: 200px; }
}

.topbar-logo, .topbar-logo span { color: var(--text-dark) !important; font-weight: 700; letter-spacing: .5px; }
.topbar-logo .logo-icon { color: var(--primary) !important; }

.lp-demo { margin-top: 14px; text-align: center; font-size: 12px; color: #9A9280; letter-spacing: .2px; }
