/* ===== 全局重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;
  background: #1a0a2e;
  overflow: hidden;
}

/* ===== 屏幕管理 ===== */
.screen {
  position: fixed; inset: 0;
  display: none; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.4s ease;
}
.screen.active { display: flex; opacity: 1; }

/* ===== 登录注册界面 ===== */
#screen-auth {
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  flex-direction: column;
}
.auth-container {
  position: relative; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.auth-container .stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, #fff 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 40%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(2px 2px at 55% 20%, rgba(255,255,255,0.9) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 60%, #fff 0%, transparent 100%),
    radial-gradient(2px 2px at 85% 25%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 20% 75%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 85%, #fff 0%, transparent 100%),
    radial-gradient(2px 2px at 65% 90%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 80%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 5% 50%, rgba(255,255,255,0.5) 0%, transparent 100%);
  pointer-events: none;
}
.auth-box {
  background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 32px;
  padding: 40px 36px;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  animation: auth-fade-in 0.5s ease-out;
  position: relative; z-index: 1;
}
@keyframes auth-fade-in {
  0% { transform: translateY(30px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.auth-header { text-align: center; margin-bottom: 36px; }
.auth-icon {
  font-size: 56px; margin-bottom: 12px;
  animation: bounce 2s infinite; display: block;
}
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-15px)} }
.auth-title {
  font-size: 42px; font-weight: 900; color: #fff;
  text-shadow: 0 0 20px rgba(255,200,0,0.8), 0 0 40px rgba(255,150,0,0.5), 2px 2px 0 rgba(0,0,0,0.5);
  letter-spacing: 6px;
}
.auth-subtitle {
  font-size: 18px; color: rgba(255,220,120,0.9);
  margin-top: 6px; letter-spacing: 3px;
}

.auth-form { width: 100%; }
.form-title {
  font-size: 26px; font-weight: 800; color: #fff;
  text-align: center; margin-bottom: 24px;
  letter-spacing: 2px;
}
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.8);
  margin-bottom: 8px; letter-spacing: 1px;
}
.form-input {
  width: 100%; padding: 14px 18px; font-size: 16px; font-weight: 600;
  background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.15);
  border-radius: 14px; color: #fff; outline: none;
  transition: all 0.3s; font-family: inherit;
}
.form-input:focus {
  border-color: rgba(240,147,251,0.7);
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 20px rgba(240,147,251,0.2);
}
.form-input::placeholder { color: rgba(255,255,255,0.4); font-weight: 400; }
.btn-auth {
  width: 100%; padding: 16px; font-size: 18px; font-weight: 700; letter-spacing: 2px;
  background: linear-gradient(135deg, #f093fb, #f5576c); color: #fff;
  border: none; border-radius: 28px; cursor: pointer;
  box-shadow: 0 8px 30px rgba(245,87,108,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 10px;
}
.btn-auth:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 12px 40px rgba(245,87,108,0.7); }
.btn-auth:active { transform: scale(0.97); }
.form-switch {
  text-align: center; color: rgba(255,255,255,0.6);
  font-size: 14px; margin-top: 20px;
}
.link {
  color: #f093fb; cursor: pointer; font-weight: 700;
  text-decoration: underline; text-underline-offset: 4px;
  transition: color 0.2s;
}
.link:hover { color: #f5576c; }
.auth-message {
  margin-top: 16px; padding: 12px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 600; text-align: center;
  animation: auth-message-pop 0.3s ease-out;
}
@keyframes auth-message-pop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.auth-message.error {
  background: rgba(245,87,108,0.2); border: 1px solid rgba(245,87,108,0.4);
  color: #f5576c;
}
.auth-message.success {
  background: rgba(0,220,130,0.2); border: 1px solid rgba(0,220,130,0.4);
  color: #00dc82;
}

/* ===== 开始界面 ===== */
#screen-start {
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  flex-direction: column;
}
.stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, #fff 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 40%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(2px 2px at 55% 20%, rgba(255,255,255,0.9) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 60%, #fff 0%, transparent 100%),
    radial-gradient(2px 2px at 85% 25%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 20% 75%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 85%, #fff 0%, transparent 100%),
    radial-gradient(2px 2px at 65% 90%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 80%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 5% 50%, rgba(255,255,255,0.5) 0%, transparent 100%);
  pointer-events: none;
}
.start-container { text-align: center; z-index: 1; }
.title-wrap { margin-bottom: 50px; }
.title-icon { font-size: 64px; animation: bounce 2s infinite; display: block; margin-bottom: 10px; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-15px)} }
.main-title {
  font-size: 56px; font-weight: 900; color: #fff;
  text-shadow: 0 0 20px rgba(255,200,0,0.8), 0 0 40px rgba(255,150,0,0.5), 2px 2px 0 rgba(0,0,0,0.5);
  letter-spacing: 6px;
}
.sub-title { font-size: 20px; color: rgba(255,220,120,0.9); margin-top: 8px; letter-spacing: 4px; }
.btn-start {
  padding: 18px 60px; font-size: 22px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #f093fb, #f5576c); border: none; border-radius: 50px;
  cursor: pointer; box-shadow: 0 8px 30px rgba(245,87,108,0.5); transition: transform 0.2s, box-shadow 0.2s;
  letter-spacing: 2px;
}
.btn-start:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 12px 40px rgba(245,87,108,0.7); }
.btn-start:active { transform: scale(0.98); }

/* ===== 年级选择界面 ===== */
#screen-grade {
  background: linear-gradient(160deg, #0a1628, #0d3b6e, #0a2342);
  overflow-y: auto; align-items: flex-start; padding: 20px;
}
.grade-container { width: 100%; max-width: 500px; margin: auto; text-align: center; padding: 20px 0 30px; position: relative; }
.btn-grade-back {
  position: absolute; top: 20px; left: 0;
  padding: 8px 18px; background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.2); border-radius: 20px; font-size: 14px; cursor: pointer; transition: background 0.2s;
}
.btn-grade-back:hover { background: rgba(255,255,255,0.2); color: #fff; }
.grade-title { font-size: 28px; color: #fff; margin-bottom: 8px; margin-top: 50px; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.grade-hint { color: rgba(255,255,255,0.6); font-size: 15px; margin-bottom: 28px; }
.grade-grid { display: flex; flex-direction: column; gap: 14px; }
.grade-row {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 16px;
  padding: 14px 20px; transition: background 0.2s;
}
.grade-row:hover { background: rgba(255,255,255,0.1); }
.grade-label { font-size: 17px; font-weight: 700; color: #fff; width: 70px; text-align: left; flex-shrink: 0; }
.btn-grade {
  flex: 1; padding: 12px 0; font-size: 15px; font-weight: 700; border: none; border-radius: 12px;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s; letter-spacing: 2px;
}
.btn-grade:first-of-type { background: linear-gradient(135deg,#f093fb,#f5576c); color:#fff; box-shadow:0 4px 14px rgba(245,87,108,0.35); }
.btn-grade:last-of-type  { background: linear-gradient(135deg,#4facfe,#00f2fe); color:#fff; box-shadow:0 4px 14px rgba(79,172,254,0.35); }
.btn-grade:hover  { transform: translateY(-2px) scale(1.04); }
.btn-grade:active { transform: scale(0.97); }

/* ===== 上次年级存档提示 ===== */
.last-grade-hint {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, rgba(255,193,7,0.18), rgba(255,152,0,0.12));
  border: 1.5px solid rgba(255,193,7,0.45);
  border-radius: 16px; padding: 12px 18px; margin-bottom: 20px;
  animation: fadeInDown 0.4s ease;
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.last-grade-info {
  display: flex; align-items: center; gap: 8px;
  color: #fff; font-size: 15px;
}
.last-grade-icon { font-size: 20px; }
.last-grade-info strong { color: #ffd54f; font-size: 16px; }
.btn-last-grade {
  background: linear-gradient(135deg, #ffd54f, #ff9800);
  color: #1a0a2e; border: none; border-radius: 20px;
  padding: 8px 18px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap; box-shadow: 0 3px 12px rgba(255,152,0,0.4);
}
.btn-last-grade:hover  { transform: translateY(-2px) scale(1.04); box-shadow: 0 5px 16px rgba(255,152,0,0.55); }
.btn-last-grade:active { transform: scale(0.97); }

/* ===== 选择宠物界面 ===== */
#screen-select {
  background: linear-gradient(160deg, #0a2342, #1a5a7a, #0d4a44);
  overflow-y: auto; align-items: flex-start; padding: 20px;
}
.select-container { width: 100%; max-width: 960px; margin: auto; text-align: center; padding: 20px 0; }
.select-title { font-size: 30px; color: #fff; margin-bottom: 8px; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.select-hint { color: rgba(255,255,255,0.7); font-size: 15px; margin-bottom: 24px; }
.pet-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.pet-card {
  width: 168px; padding: 16px 12px 14px;
  background: rgba(255,255,255,0.1); backdrop-filter: blur(10px);
  border: 2px solid rgba(255,255,255,0.2); border-radius: 22px;
  cursor: pointer; transition: transform 0.2s, background 0.2s, box-shadow 0.2s; user-select: none;
}
.pet-card:hover {
  transform: translateY(-8px) scale(1.05);
  background: rgba(255,255,255,0.22); box-shadow: 0 14px 40px rgba(0,0,0,0.35);
  border-color: rgba(255,255,255,0.5);
}
.pet-card:active { transform: scale(0.97); }
.pet-svg-wrap { width: 100px; height: 116px; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; }
.pet-svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3)); transition: transform 0.3s; }
.pet-card:hover .pet-svg { transform: scale(1.08) rotate(-3deg); }
.pet-card-name { font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 5px; }
.pet-desc { font-size: 12px; color: rgba(255,255,255,0.6); line-height: 1.4; }

/* ===== 命名弹窗 ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center; z-index: 9000;
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: linear-gradient(145deg, #1e2d5a, #0f1e3e);
  border: 1px solid rgba(255,255,255,0.15); border-radius: 24px;
  padding: 32px 36px; text-align: center; min-width: 300px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: pop-in 0.3s ease-out;
}
.modal-title { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.modal-hint { font-size: 13px; color: rgba(255,255,255,0.5); margin-bottom: 20px; }
.name-input {
  width: 100%; padding: 12px 16px; font-size: 18px; font-weight: 700; text-align: center;
  background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.2); border-radius: 14px;
  color: #fff; outline: none; transition: border-color 0.2s; font-family: inherit;
}
.name-input:focus { border-color: rgba(240,147,251,0.7); }
.name-input::placeholder { color: rgba(255,255,255,0.3); font-weight: 400; }
.name-error { font-size: 13px; color: #f5576c; margin-top: 8px; }
.modal-btns { margin-top: 22px; }
.btn-modal-confirm {
  padding: 12px 50px; font-size: 16px; font-weight: 700;
  background: linear-gradient(135deg,#f093fb,#f5576c); color: #fff;
  border: none; border-radius: 30px; cursor: pointer;
  box-shadow: 0 4px 16px rgba(245,87,108,0.4); transition: transform 0.2s;
}
.btn-modal-confirm:hover { transform: scale(1.05); }

/* ===== 主养成界面 ===== */
#screen-main { background: linear-gradient(160deg, #1a1a2e, #16213e, #0f3460); align-items: stretch; }
.main-container {
  width: 100%; max-width: 600px; margin: auto;
  display: flex; flex-direction: column; height: 100%; padding: 12px; gap: 10px;
}
.top-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: rgba(255,255,255,0.08); border-radius: 16px; padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.1); flex-wrap: nowrap;
}
.pet-info { display: flex; align-items: center; gap: 4px; min-width: 0; }
.pet-label { font-size: 16px; }
.pet-name-badge { font-size: 15px; font-weight: 700; color: #ffd700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }
.grade-info-badge {
  font-size: 11px; font-weight: 700; color: #a5f3fc;
  background: rgba(14,165,233,0.18); border: 1px solid rgba(14,165,233,0.35);
  border-radius: 20px; padding: 3px 8px; white-space: nowrap; flex-shrink: 0;
}
.score-info { font-size: 14px; color: #ffd700; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.top-btns { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.btn-icon {
  width: 32px; height: 32px; border: none; border-radius: 10px;
  background: rgba(255,255,255,0.1); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.15s;
}
.btn-icon:hover { background: rgba(255,255,255,0.22); transform: scale(1.1); }
.btn-back {
  padding: 5px 12px; font-size: 12px; background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.2); border-radius: 20px; cursor: pointer; transition: background 0.2s; white-space: nowrap;
}
.btn-back:hover { background: rgba(255,255,255,0.2); }

/* 宠物展示区 */
.pet-stage {
  flex: 1; border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.1); position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden; padding: 16px; min-height: 260px;
  background: transparent;
}
.stage-bg {
  position: absolute; inset: 0; border-radius: 24px;
  overflow: hidden; pointer-events: none; z-index: 0;
}
.pet-display-wrap { position: relative; display: flex; flex-direction: column; align-items: center; z-index: 1; }

/* 宠物全身SVG展示 */
.pet-body {
  width: 160px; height: 180px;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.4));
  cursor: default; user-select: none; position: relative; z-index: 1;
}
.pet-body svg { width: 100%; height: 100%; }

/* 死亡界面宠物 */
.dead-pet-body { width: 130px; height: 152px; margin: 0 auto 16px; filter: grayscale(1); animation: dead-sway 3s ease-in-out infinite; }
.dead-pet-body svg { width: 100%; height: 100%; }
@keyframes dead-sway { 0%,100%{transform:rotate(-5deg)} 50%{transform:rotate(5deg)} }
@keyframes pop-in { 0%{transform:translateX(-50%) scale(0.6);opacity:0} 100%{transform:translateX(-50%) scale(1);opacity:1} }
@keyframes pop-in-center { 0%{transform:scale(0.6);opacity:0} 100%{transform:scale(1);opacity:1} }

.pet-speech {
  position: absolute; top: -56px; left: 50%;
  transform: translateX(-50%);
  background: #fff; color: #333; padding: 8px 16px; border-radius: 20px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2); animation: pop-in 0.3s ease-out;
  max-width: 260px; white-space: normal; text-align: center; z-index: 2;
}
.pet-speech::after {
  content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  border: 8px solid transparent; border-top-color: #fff; border-bottom: 0;
}
.hidden { display: none !important; }

/* 状态条 */
.status-area { width: 100%; margin-top: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 1; position: relative; }
.status-row { display: flex; align-items: center; gap: 10px; }
.status-label { font-size: 12px; color: rgba(255,255,255,0.9); width: 76px; flex-shrink: 0; text-shadow: 0 1px 4px rgba(0,0,0,0.6); }
.bar-bg { flex: 1; height: 13px; background: rgba(0,0,0,0.25); border-radius: 7px; overflow: hidden; }
.bar { height: 100%; border-radius: 7px; transition: width 0.5s ease; }
.hunger-bar { background: linear-gradient(90deg,#f093fb,#f5576c); }
.mood-bar   { background: linear-gradient(90deg,#4facfe,#00f2fe); }
.bar-text { font-size: 12px; color: rgba(255,255,255,0.9); width: 36px; text-align: right; flex-shrink: 0; text-shadow: 0 1px 4px rgba(0,0,0,0.6); }

/* 饥饿警告 */
.hunger-warning {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(245,87,108,0.92); color: #fff; padding: 7px 18px; border-radius: 18px;
  font-size: 12px; font-weight: 600; text-align: center;
  animation: warning-pulse 1s ease-in-out infinite; white-space: nowrap; z-index: 2;
}
@keyframes warning-pulse { 0%,100%{opacity:1} 50%{opacity:0.7} }
.countdown { font-size: 11px; margin-top: 3px; opacity: 0.9; }

/* 操作按钮 */
.action-area { display: flex; gap: 10px; }
.btn-feed, .btn-play {
  flex: 1; padding: 14px; font-size: 16px; font-weight: 700; border: none; border-radius: 14px;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; letter-spacing: 1px;
}
.btn-feed { background: linear-gradient(135deg,#f093fb,#f5576c); color:#fff; box-shadow:0 5px 18px rgba(245,87,108,0.4); }
.btn-feed:hover { transform: translateY(-2px); box-shadow: 0 9px 26px rgba(245,87,108,0.6); }
.btn-play { background: linear-gradient(135deg,#4facfe,#00f2fe); color:#fff; box-shadow:0 5px 18px rgba(79,172,254,0.4); }
.btn-play:hover { transform: translateY(-2px); box-shadow: 0 9px 26px rgba(79,172,254,0.6); }
.btn-feed:active,.btn-play:active { transform: scale(0.97); }
.pet-status-text { text-align: center; font-size: 13px; color: rgba(255,255,255,0.7); padding: 2px 0 6px; text-shadow: 0 1px 4px rgba(0,0,0,0.4); }

/* ===== 场景背景 ===== */

/* ── 非洲大草原（狮子）── */
.scene-savanna-sky {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #fed7aa 0%, #fde68a 40%, #fbbf24 65%, #78350f 100%);
}
.scene-sun {
  position: absolute; top: 14%; left: 62%;
  width: 48px; height: 48px; border-radius: 50%;
  background: radial-gradient(circle, #fef08a 30%, #fbbf24 70%);
  box-shadow: 0 0 28px 12px rgba(251,191,36,0.6);
  animation: sun-glow 3s ease-in-out infinite;
}
@keyframes sun-glow { 0%,100%{box-shadow:0 0 28px 12px rgba(251,191,36,0.6)} 50%{box-shadow:0 0 40px 18px rgba(251,191,36,0.8)} }
.scene-cloud {
  position: absolute;
  background: rgba(255,255,255,0.7); border-radius: 50px;
}
.scene-cloud::before, .scene-cloud::after {
  content:''; position:absolute; background:rgba(255,255,255,0.7); border-radius:50%;
}
.scene-cloud1 { top:12%; left:8%; width:60px; height:20px; animation: cloud-drift 12s linear infinite; }
.scene-cloud1::before { width:28px;height:28px;top:-14px;left:10px; }
.scene-cloud1::after  { width:20px;height:20px;top:-10px;left:32px; }
.scene-cloud2 { top:20%; left:30%; width:44px; height:14px; animation: cloud-drift 18s linear infinite reverse; }
.scene-cloud2::before { width:20px;height:20px;top:-10px;left:8px; }
.scene-cloud2::after  { width:16px;height:16px;top:-8px;left:24px; }
@keyframes cloud-drift { 0%{transform:translateX(0)} 100%{transform:translateX(40px)} }
.scene-savanna-ground {
  position: absolute; bottom: 0; left: 0; right: 0; height: 42%;
  background: linear-gradient(180deg, #92400e 0%, #78350f 100%);
  border-radius: 0 0 24px 24px;
}
.scene-acacia1 {
  position: absolute; bottom: 36%; left: 6%;
  width: 0; height: 0;
}
.scene-acacia1::before {
  content:''; position:absolute; bottom:0; left:-4px;
  width:8px; height:30px; background:#451a03; border-radius:4px;
}
.scene-acacia1::after {
  content:''; position:absolute; bottom:26px; left:-22px;
  width:52px; height:18px; background:#166534; border-radius:50% 50% 0 0;
}
.scene-acacia2 {
  position: absolute; bottom: 36%; right: 8%;
  width: 0; height: 0;
}
.scene-acacia2::before {
  content:''; position:absolute; bottom:0; left:-5px;
  width:10px; height:40px; background:#451a03; border-radius:4px;
}
.scene-acacia2::after {
  content:''; position:absolute; bottom:36px; left:-30px;
  width:68px; height:22px; background:#15803d; border-radius:50% 50% 0 0;
}
.scene-savanna-grass {
  position: absolute; bottom: 38%; left: 0; right: 0; height: 10px;
  background: repeating-linear-gradient(90deg, #15803d 0, #15803d 4px, transparent 4px, transparent 14px);
  opacity: 0.6;
}

/* ── 温馨家庭（猫、狗）── */
.scene-room-bg {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #fef9c3 0%, #fef3c7 50%, #fde68a 100%);
}
.scene-wall-deco {
  position: absolute; top: 12%; left: 50%; transform: translateX(-50%);
  width: 50px; height: 38px;
  border: 3px solid #d97706; border-radius: 6px;
  background: linear-gradient(135deg, #bfdbfe, #ddd6fe);
  box-shadow: 2px 2px 8px rgba(0,0,0,0.15);
}
.scene-wall-deco::before {
  content:'🌸'; position:absolute; top:50%; left:50%;
  transform:translate(-50%,-50%); font-size:18px;
}
.scene-window {
  position: absolute; top: 8%; right: 10%;
  width: 54px; height: 48px;
  border: 3px solid #92400e; border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #bae6fd 0%, #e0f2fe 100%);
  overflow: hidden;
}
.scene-window::before {
  content:''; position:absolute; top:0; left:50%; width:2px; height:100%;
  background:#92400e;
}
.scene-window::after {
  content:''; position:absolute; left:0; top:50%; width:100%; height:2px;
  background:#92400e;
}
.scene-sofa {
  position: absolute; bottom: 16%; left: 50%; transform: translateX(-50%);
  width: 110px; height: 36px;
  background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
  border-radius: 10px 10px 4px 4px;
  box-shadow: 0 4px 0 #c2410c;
}
.scene-sofa::before {
  content:''; position:absolute; top:-18px; left:4px; right:4px; height:22px;
  background: linear-gradient(180deg, #fb923c 0%, #f97316 100%);
  border-radius: 10px 10px 0 0;
}
.scene-sofa::after {
  content:''; position:absolute; top:-18px; left:-8px;
  width:18px; height:40px;
  background:#f97316; border-radius:10px 4px 4px 10px;
  box-shadow: 92px 0 0 #f97316;
}
.scene-floor {
  position: absolute; bottom: 0; left: 0; right: 0; height: 18%;
  background: repeating-linear-gradient(90deg, #d97706 0, #d97706 30px, #b45309 30px, #b45309 60px);
  border-radius: 0 0 24px 24px; opacity: 0.6;
}

/* ── 热带丛林（蛇）── */
.scene-jungle-bg {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #052e16 0%, #14532d 40%, #166534 100%);
}
.scene-jungle-leaf {
  position: absolute;
  background: #16a34a;
  border-radius: 0 80% 0 80%;
  box-shadow: inset -4px -4px 8px rgba(0,0,0,0.3);
}
.scene-leaf1 { top:-8%; left:-6%; width:80px; height:50px; transform:rotate(30deg); opacity:0.9; }
.scene-leaf2 { top:-4%; right:-4%; width:70px; height:44px; transform:rotate(-40deg) scaleX(-1); opacity:0.85; }
.scene-leaf3 { bottom:30%; left:-4%; width:60px; height:38px; transform:rotate(10deg); opacity:0.8; animation: leaf-sway 4s ease-in-out infinite; }
.scene-leaf4 { bottom:28%; right:-4%; width:65px; height:40px; transform:rotate(-20deg) scaleX(-1); opacity:0.8; animation: leaf-sway 5s ease-in-out infinite reverse; }
@keyframes leaf-sway { 0%,100%{transform:rotate(10deg)} 50%{transform:rotate(18deg)} }
.scene-jungle-ground {
  position: absolute; bottom: 0; left: 0; right: 0; height: 28%;
  background: linear-gradient(180deg, #052e16 0%, #14532d 100%);
  border-radius: 0 0 24px 24px;
}
.scene-jungle-vine {
  position: absolute; top: 0; width: 4px; border-radius: 2px;
  background: linear-gradient(180deg, #15803d, #166534);
  animation: vine-sway 6s ease-in-out infinite;
}
.scene-vine1 { height: 55%; left: 18%; animation-delay: 0s; }
.scene-vine2 { height: 45%; right: 22%; animation-delay: -3s; }
@keyframes vine-sway { 0%,100%{transform:rotate(-4deg) translateX(0)} 50%{transform:rotate(4deg) translateX(4px)} }

/* ── 鱼缸水族箱（鲨鱼）── */
.scene-tank-bg {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #0c4a6e 0%, #075985 25%, #0369a1 60%, #1e3a5f 100%);
  border-radius: 24px;
}
.scene-tank-frame {
  position: absolute; inset: 0;
  border: 6px solid rgba(147,197,253,0.5);
  border-radius: 24px;
  box-shadow: inset 0 0 30px rgba(56,189,248,0.15), 0 0 20px rgba(56,189,248,0.1);
  pointer-events: none;
}
.scene-bubble {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3);
  animation: bubble-rise linear infinite;
}
.scene-bubble::after { content:''; position:absolute; top:20%; left:20%; width:30%; height:20%; background:rgba(255,255,255,0.5); border-radius:50%; }
.scene-bubble1 { width:10px;height:10px; left:15%; bottom:10%; animation-duration:4s; }
.scene-bubble2 { width:7px; height:7px;  left:30%; bottom:5%;  animation-duration:5s; animation-delay:-1s; }
.scene-bubble3 { width:12px;height:12px; left:55%; bottom:8%;  animation-duration:3.5s; animation-delay:-2s; }
.scene-bubble4 { width:8px; height:8px;  left:72%; bottom:12%; animation-duration:6s; animation-delay:-0.5s; }
.scene-bubble5 { width:6px; height:6px;  left:85%; bottom:6%;  animation-duration:4.5s; animation-delay:-3s; }
@keyframes bubble-rise {
  0%   { transform: translateY(0) translateX(0); opacity:0.8; }
  50%  { transform: translateY(-40px) translateX(6px); opacity:1; }
  100% { transform: translateY(-90px) translateX(-4px); opacity:0; }
}
.scene-seaweed {
  position: absolute; bottom: 0; width: 12px; border-radius: 6px;
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
  transform-origin: bottom center;
  animation: seaweed-wave 3s ease-in-out infinite;
}
.scene-sw1 { height: 55px; left: 12%; animation-delay: 0s; }
.scene-sw2 { height: 45px; left: 28%; animation-delay: -1s; }
.scene-sw3 { height: 62px; right: 16%; animation-delay: -2s; }
@keyframes seaweed-wave {
  0%,100% { transform: rotate(-12deg) skewX(4deg); }
  50%      { transform: rotate(12deg)  skewX(-4deg); }
}
.scene-coral {
  position: absolute; bottom: 0;
}
.scene-coral1 { left: 60%; }
.scene-coral2 { right: 28%; }
.scene-coral1::before, .scene-coral1::after,
.scene-coral2::before, .scene-coral2::after {
  content:''; position:absolute; bottom:0; border-radius:6px;
}
.scene-coral1::before { width:10px;height:32px;left:0; background:linear-gradient(#f87171,#ef4444); }
.scene-coral1::after  { width:8px; height:24px;left:14px; background:linear-gradient(#fb923c,#f97316); transform:rotate(12deg); transform-origin:bottom; }
.scene-coral2::before { width:10px;height:28px;left:0; background:linear-gradient(#c084fc,#a855f7); }
.scene-coral2::after  { width:8px; height:20px;left:-12px; background:linear-gradient(#e879f9,#d946ef); transform:rotate(-10deg); transform-origin:bottom; }
.scene-sand {
  position: absolute; bottom: 0; left: 0; right: 0; height: 20%;
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  border-radius: 0 0 20px 20px;
}

/* ===== 宠物动画类（每种动物专属）===== */

/* 狮子：呼吸起伏 + 尾巴摇摆 */
.pet-body.anim-lion { animation: lion-breathe 3.5s ease-in-out infinite; }
@keyframes lion-breathe {
  0%,100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-10px) scale(1.02); }
}

/* 小猫：抓耳朵动作循环（手臂摇摆） */
.pet-body.anim-cat { animation: cat-scratch 2s ease-in-out infinite; }
@keyframes cat-scratch {
  0%,100% { transform: translateY(0); }
  25%      { transform: translateY(-8px) rotate(2deg); }
  75%      { transform: translateY(-4px) rotate(-1deg); }
}

/* 小狗：奔跑弹跳（左右横移+跳跃感） */
.pet-body.anim-dog { animation: dog-run 0.9s ease-in-out infinite; }
@keyframes dog-run {
  0%,100% { transform: translateX(0) translateY(0) rotate(0deg); }
  25%      { transform: translateX(6px)  translateY(-8px) rotate(2deg); }
  50%      { transform: translateX(10px) translateY(0)    rotate(0deg); }
  75%      { transform: translateX(4px)  translateY(-6px) rotate(-2deg); }
}

/* 小蛇：身体盘踞微微摆头 */
.pet-body.anim-snake { animation: snake-sway 4s ease-in-out infinite; }
@keyframes snake-sway {
  0%,100% { transform: rotate(0deg) translateY(0); }
  30%      { transform: rotate(-4deg) translateY(-6px); }
  70%      { transform: rotate(4deg) translateY(-3px); }
}

/* 小鲨鱼：左右游动（最动态） */
.pet-body.anim-shark { animation: shark-swim 2.4s ease-in-out infinite; }
@keyframes shark-swim {
  0%,100% { transform: translateX(0)    translateY(0)  rotate(0deg); }
  25%      { transform: translateX(14px) translateY(-8px) rotate(4deg); }
  50%      { transform: translateX(24px) translateY(0)    rotate(0deg); }
  75%      { transform: translateX(10px) translateY(8px)  rotate(-4deg); }
}

/* 饥饿/进食/开心动画 */
.pet-body.eating { animation: eat-bounce 0.4s ease-in-out 3 !important; }
.pet-body.hungry { animation: hungry-shake 0.5s ease-in-out infinite !important; }
.pet-body.dead   { filter: grayscale(1) drop-shadow(0 8px 20px rgba(0,0,0,0.4)); animation: none !important; }
.pet-body.happy  { animation: happy-jump 0.5s ease-in-out 2 !important; }

@keyframes eat-bounce   { 0%,100%{transform:scale(1)} 50%{transform:scale(1.18) rotate(8deg)} }
@keyframes hungry-shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
@keyframes happy-jump   { 0%,100%{transform:translateY(0) scale(1)} 40%{transform:translateY(-18px) scale(1.05)} 60%{transform:translateY(-10px)} }

/* ===== 响应式 ===== */

/* ===== 答题界面 ===== */
#screen-quiz { background: linear-gradient(160deg,#0c1445,#1a3a6e,#0d2b52); align-items: stretch; }
.quiz-container {
  width: 100%; max-width: 600px; margin: auto;
  display: flex; flex-direction: column; height: 100%; padding: 20px 18px; gap: 16px;
}
.quiz-header { display: flex; justify-content: space-between; align-items: center; }
.quiz-title { font-size: 20px; font-weight: 800; color: #fff; }
.quiz-meta { display: flex; gap: 8px; }
.subject-badge, .grade-badge { padding: 4px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.subject-badge { background: rgba(240,147,251,0.3); color: #f093fb; border: 1px solid rgba(240,147,251,0.4); }
.grade-badge   { background: rgba(79,172,254,0.3);  color: #4facfe; border: 1px solid rgba(79,172,254,0.4); }
.quiz-body { flex: 1; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.question-wrap { background: rgba(255,255,255,0.07); border-radius: 18px; padding: 20px; border: 1px solid rgba(255,255,255,0.1); }
.question-num  { font-size: 12px; color: rgba(255,255,255,0.5); margin-bottom: 10px; }
.question-text { font-size: 19px; color: #fff; font-weight: 600; line-height: 1.6; }
.options-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option-btn {
  padding: 14px 10px; background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.15);
  border-radius: 14px; color: #fff; font-size: 15px; font-weight: 500; cursor: pointer;
  transition: all 0.2s; text-align: center; line-height: 1.4;
}
.option-btn:hover:not(:disabled) { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.4); transform: translateY(-2px); }
.option-btn:active:not(:disabled) { transform: scale(0.97); }
.option-btn.correct { background: rgba(0,220,130,0.25); border-color: #00dc82; color: #00dc82; }
.option-btn.wrong   { background: rgba(245,87,108,0.25); border-color: #f5576c; color: #f5576c; }

/* AI互动反馈区 */
.quiz-result {
  background: rgba(255,255,255,0.07); border-radius: 18px; padding: 20px;
  border: 1px solid rgba(255,255,255,0.1); animation: pop-in-center 0.35s ease-out;
}
.ai-feedback { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.ai-pet-icon { width: 70px; height: 82px; flex-shrink: 0; }
.ai-pet-icon svg { width: 100%; height: 100%; }
.ai-bubble {
  background: rgba(255,255,255,0.1); border-radius: 16px; padding: 12px 16px;
  border: 1px solid rgba(255,255,255,0.15); position: relative; flex: 1;
}
.ai-bubble::before {
  content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  border: 10px solid transparent; border-right-color: rgba(255,255,255,0.1); border-left: 0;
}
.result-icon { font-size: 32px; margin-bottom: 6px; }
.result-ai-text { font-size: 17px; font-weight: 700; color: #fff; }
.result-text { font-size: 14px; color: rgba(255,255,255,0.75); line-height: 1.5; }
.btn-next {
  display: block; margin: 14px auto 0; padding: 11px 36px; font-size: 15px; font-weight: 700;
  background: linear-gradient(135deg,#f093fb,#f5576c); color: #fff; border: none; border-radius: 28px;
  cursor: pointer; box-shadow: 0 4px 14px rgba(245,87,108,0.4); transition: transform 0.2s;
}
.btn-next:hover { transform: scale(1.05); }
.btn-cancel-quiz {
  padding: 11px; background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; font-size: 14px; cursor: pointer; transition: background 0.2s;
}
.btn-cancel-quiz:hover { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.7); }

/* ===== 死亡界面 ===== */
#screen-dead { background: linear-gradient(160deg,#1a0a0a,#3a1010,#200808); }
.dead-container { text-align: center; padding: 30px 24px; max-width: 460px; }
.dead-title { font-size: 30px; color: rgba(255,255,255,0.8); margin-bottom: 10px; }
.dead-desc { font-size: 15px; color: rgba(255,255,255,0.5); margin-bottom: 14px; line-height: 1.6; }
.dead-msg { font-size: 13px; color: rgba(255,150,100,0.85); margin-bottom: 10px; padding: 10px 18px; background: rgba(255,100,100,0.1); border-radius: 12px; display: inline-block; }
.dead-score { font-size: 20px; color: #ffd700; font-weight: 700; margin: 16px 0; }
.btn-restart {
  padding: 14px 52px; font-size: 17px; font-weight: 700;
  background: linear-gradient(135deg,#f093fb,#f5576c); color: #fff; border: none; border-radius: 36px;
  cursor: pointer; box-shadow: 0 6px 22px rgba(245,87,108,0.5); transition: transform 0.2s; margin-top: 8px;
}
.btn-restart:hover { transform: scale(1.05); }

/* ===== 错题本界面 ===== */
#screen-notebook {
  background: linear-gradient(160deg, #0a1f2e, #0f3a50, #0a2030);
  align-items: stretch; overflow-y: auto;
}
.notebook-container { width: 100%; max-width: 600px; margin: auto; padding: 20px; display: flex; flex-direction: column; height: 100%; }
.notebook-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.notebook-title { font-size: 24px; font-weight: 800; color: #fff; }
.btn-close {
  padding: 8px 18px; font-size: 14px; font-weight: 600;
  background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.2); border-radius: 20px; cursor: pointer; transition: background 0.2s;
}
.btn-close:hover { background: rgba(255,255,255,0.2); }
.notebook-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 20px; }
.notebook-empty { text-align: center; color: rgba(255,255,255,0.4); font-size: 16px; margin-top: 60px; }
.notebook-item {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; padding: 16px 18px;
}
.nb-meta { display: flex; gap: 8px; margin-bottom: 8px; }
.nb-badge { padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.nb-subject { background: rgba(240,147,251,0.2); color: #f093fb; }
.nb-grade   { background: rgba(79,172,254,0.2); color: #4facfe; }
.nb-question { font-size: 15px; color: #fff; font-weight: 600; margin-bottom: 8px; line-height: 1.5; }
.nb-my-answer { font-size: 13px; color: #f5576c; margin-bottom: 4px; }
.nb-right-answer { font-size: 13px; color: #00dc82; }

/* ===== 意见箱界面 ===== */
#screen-suggestion {
  background: linear-gradient(160deg, #1a0a2e, #2e1060, #1a0a3a);
  align-items: stretch; overflow-y: auto;
}
.suggestion-container { width: 100%; max-width: 600px; margin: auto; padding: 20px; display: flex; flex-direction: column; height: 100%; }
.suggestion-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.suggestion-title { font-size: 24px; font-weight: 800; color: #fff; }
.suggestion-hint { font-size: 14px; color: rgba(255,255,255,0.55); margin-bottom: 14px; }
.suggestion-input {
  width: 100%; height: 120px; padding: 14px 16px; font-size: 15px; resize: none;
  background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.15); border-radius: 16px;
  color: #fff; outline: none; font-family: inherit; transition: border-color 0.2s; line-height: 1.6;
}
.suggestion-input:focus { border-color: rgba(167,139,250,0.7); }
.suggestion-input::placeholder { color: rgba(255,255,255,0.3); }
.suggestion-count { text-align: right; font-size: 12px; color: rgba(255,255,255,0.4); margin: 6px 0 14px; }
.btn-submit-suggestion {
  padding: 13px 30px; font-size: 16px; font-weight: 700;
  background: linear-gradient(135deg,#a855f7,#7c3aed); color: #fff; border: none; border-radius: 30px;
  cursor: pointer; box-shadow: 0 4px 16px rgba(168,85,247,0.4); transition: transform 0.2s; align-self: flex-start;
}
.btn-submit-suggestion:hover { transform: scale(1.05); }
.suggestion-history { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; flex: 1; padding-bottom: 10px; }
.suggestion-history-title {
  font-size: 13px; color: rgba(255,255,255,0.45); margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
}
.sg-count {
  background: rgba(168,85,247,0.25); color: #c084fc;
  padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700;
}
.sg-loading { color: rgba(255,255,255,0.3); font-size: 13px; padding: 8px 0; }
.sg-empty {
  text-align: center; color: rgba(255,255,255,0.3); font-size: 13px;
  padding: 24px 0; letter-spacing: 0.5px;
}
.suggestion-history-item {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px; padding: 12px 16px;
  transition: transform 0.2s;
}
.suggestion-history-item:hover { transform: translateX(3px); }
.sg-item-new {
  background: rgba(168,85,247,0.12);
  border-color: rgba(168,85,247,0.4);
  animation: sgSlideIn 0.4s ease;
}
@keyframes sgSlideIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sg-item-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.sg-index {
  font-size: 11px; font-weight: 700; color: rgba(168,85,247,0.7);
  background: rgba(168,85,247,0.12); padding: 1px 7px; border-radius: 10px;
}
.sg-badge-new {
  font-size: 11px; font-weight: 700; color: #f0abfc;
  background: rgba(168,85,247,0.3); padding: 2px 8px; border-radius: 20px;
  animation: sgPulse 1.2s ease infinite alternate;
}
@keyframes sgPulse {
  from { opacity: 0.7; } to { opacity: 1; }
}
.sg-time { font-size: 11px; color: rgba(255,255,255,0.35); margin-left: auto; }
.sg-text { font-size: 14px; color: rgba(255,255,255,0.85); line-height: 1.6; word-break: break-all; }

/* ===== 存档管理界面 ===== */
#screen-savemanage {
  background: linear-gradient(160deg, #1a0a2e, #2e1060, #1a0a3a);
  align-items: stretch; overflow-y: auto;
}
.savemanage-container {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.savemanage-box {
  background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 24px;
  padding: 30px;
  width: 100%; max-width: 700px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  position: relative; z-index: 1;
}
.savemanage-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.savemanage-title {
  font-size: 28px; font-weight: 800; color: #fff;
  letter-spacing: 2px;
}
.section-title {
  font-size: 18px; font-weight: 700; color: rgba(255,255,255,0.9);
  margin-bottom: 12px; letter-spacing: 1px;
}

/* 当前存档 */
.current-save-section {
  margin-bottom: 30px; padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.save-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px; padding: 16px 20px;
  margin-bottom: 16px;
}
.save-info-placeholder {
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  text-align: center;
  padding: 20px 0;
}
.save-info-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.save-info-item {
  display: flex; flex-direction: column;
}
.save-info-label {
  font-size: 12px; color: rgba(255,255,255,0.5);
  margin-bottom: 4px;
}
.save-info-value {
  font-size: 16px; font-weight: 700; color: #fff;
}
.save-info-value.highlight {
  color: #fbbf24;
}
.btn-manual-save {
  width: 100%; padding: 14px; font-size: 16px; font-weight: 700;
  background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff;
  border: none; border-radius: 14px; cursor: pointer;
  box-shadow: 0 4px 16px rgba(168,85,247,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-manual-save:hover {
  transform: translateY(-2px); box-shadow: 0 6px 24px rgba(168,85,247,0.6);
}
.btn-manual-save:active { transform: scale(0.98); }

/* 存档列表 */
.saves-list-section { margin-bottom: 20px; }
.saves-list {
  display: flex; flex-direction: column; gap: 12px;
  max-height: 400px; overflow-y: auto;
  padding-right: 4px;
}
.save-placeholder {
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  text-align: center;
  padding: 30px 0;
}
.save-list-item {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  transition: all 0.2s;
}
.save-list-item:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(168,85,247,0.3);
  transform: translateX(4px);
}
.save-main-info { flex: 1; }
.save-pet-info {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.save-pet-icon { font-size: 24px; }
.save-pet-name {
  font-size: 16px; font-weight: 700; color: #fff;
}
.save-status-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.save-status-badge.alive {
  background: rgba(0, 220, 130, 0.2);
  color: #00dc82;
}
.save-status-badge.dead {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}
.save-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
}
.save-meta-item {
  font-size: 13px; color: rgba(255,255,255,0.6);
}
.save-meta-item strong {
  color: rgba(255,255,255,0.9);
}
.save-time {
  font-size: 12px; color: rgba(255,255,255,0.4);
  margin-top: 4px;
}
.save-actions {
  display: flex; gap: 8px; margin-left: 12px;
}
.btn-save-action {
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  border: none; border-radius: 10px; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-save-load {
  background: linear-gradient(135deg, #00dc82, #10b981); color: #fff;
  box-shadow: 0 2px 8px rgba(0,220,130,0.3);
}
.btn-save-load:hover {
  transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,220,130,0.5);
}
.btn-save-delete {
  background: rgba(245,87,108,0.2); color: #f5576c;
  border: 1px solid rgba(245,87,108,0.3);
}
.btn-save-delete:hover {
  background: rgba(245,87,108,0.3);
  transform: translateY(-2px);
}

/* 开始界面的存档按钮 */
.btn-save-list {
  margin-top: 16px; padding: 14px 32px; font-size: 16px; font-weight: 700;
  background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff;
  border: none; border-radius: 30px; cursor: pointer;
  box-shadow: 0 6px 24px rgba(168,85,247,0.4);
  transition: transform 0.2s, box-shadow 0.2s; letter-spacing: 1px;
}
.btn-save-list:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 32px rgba(168,85,247,0.6);
}
.btn-save-list:active { transform: scale(0.98); }

/* ===== 错题本提示文字 ===== */
.notebook-hint {
  font-size: 13px; color: rgba(255,220,100,0.8); margin-bottom: 12px;
  text-align: center; background: rgba(255,200,50,0.1); border-radius: 10px;
  padding: 6px 14px; border: 1px solid rgba(255,200,50,0.2);
}
.notebook-item-clickable {
  cursor: pointer; transition: transform 0.18s, background 0.18s, box-shadow 0.18s;
}
.notebook-item-clickable:hover {
  transform: translateY(-3px) scale(1.01);
  background: rgba(255,255,255,0.13);
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}
.nb-ai-hint {
  background: linear-gradient(135deg, rgba(168,85,247,0.3), rgba(79,172,254,0.3));
  color: #c4b5fd;
  border: 1px solid rgba(168,85,247,0.4);
  margin-left: auto;
  animation: ai-hint-pulse 2s ease-in-out infinite;
}
@keyframes ai-hint-pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

/* ===== AI讲解弹窗 ===== */
.ai-explain-box {
  max-width: 520px; width: 92vw; max-height: 88vh;
  display: flex; flex-direction: column; gap: 0;
  padding: 0; overflow: hidden;
}
.ai-explain-header {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 22px 14px; border-bottom: 1px solid rgba(255,255,255,0.1);
  background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(79,172,254,0.2));
}
.ai-explain-avatar {
  width: 40px; height: 40px; background: linear-gradient(135deg, #a855f7, #4facfe);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
  animation: avatar-float 3s ease-in-out infinite;
}
@keyframes avatar-float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-5px)} }
.ai-explain-title { font-size: 18px; font-weight: 800; color: #fff; flex: 1; }
.ai-explain-close {
  background: rgba(255,255,255,0.1); border: none; color: rgba(255,255,255,0.6);
  width: 30px; height: 30px; border-radius: 50%; font-size: 14px; cursor: pointer;
  transition: background 0.2s; flex-shrink: 0;
}
.ai-explain-close:hover { background: rgba(255,100,100,0.3); color: #fff; }

.ai-explain-question {
  padding: 14px 22px 8px;
  font-size: 16px; font-weight: 700; color: #fff;
  background: rgba(255,255,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.07);
  line-height: 1.5;
}
.ai-explain-options {
  padding: 10px 22px; display: flex; flex-direction: column; gap: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.ai-explain-option {
  font-size: 14px; color: rgba(255,255,255,0.75);
  padding: 6px 12px; border-radius: 8px; background: rgba(255,255,255,0.05);
}
.ai-explain-option.ai-explain-correct {
  color: #00dc82; background: rgba(0,220,130,0.12); border: 1px solid rgba(0,220,130,0.3);
  font-weight: 600;
}
.ai-explain-option.ai-explain-wrong {
  color: #f5576c; background: rgba(245,87,108,0.12); border: 1px solid rgba(245,87,108,0.3);
}
.ai-explain-answer {
  padding: 8px 22px; display: flex; gap: 8px; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.ai-explain-content {
  flex: 1; overflow-y: auto; padding: 16px 22px;
  min-height: 120px; max-height: 260px;
}
.ai-explain-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: rgba(255,255,255,0.5); font-size: 14px; padding: 20px 0;
}
.ai-loading-dots { display: flex; gap: 8px; }
.ai-loading-dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #4facfe);
  animation: dot-bounce 1.2s ease-in-out infinite;
}
.ai-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-bounce { 0%,100%{transform:translateY(0);opacity:0.5} 50%{transform:translateY(-8px);opacity:1} }
#ai-explain-text {
  font-size: 14px; color: rgba(255,255,255,0.85); line-height: 1.8;
  white-space: pre-line; word-break: break-all;
}
.ai-explain-btns {
  padding: 14px 22px; display: flex; gap: 10px; align-items: center;
  justify-content: flex-end; border-top: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03); flex-wrap: wrap;
}
.btn-ai-speak {
  padding: 9px 20px; font-size: 14px; font-weight: 600;
  background: linear-gradient(135deg, #4facfe, #00f2fe); color: #fff; border: none;
  border-radius: 24px; cursor: pointer; box-shadow: 0 3px 12px rgba(79,172,254,0.4);
  transition: transform 0.2s;
}
.btn-ai-speak:hover { transform: scale(1.05); }
.btn-ai-stop {
  padding: 9px 20px; font-size: 14px; font-weight: 600;
  background: linear-gradient(135deg, #f093fb, #f5576c); color: #fff; border: none;
  border-radius: 24px; cursor: pointer; transition: transform 0.2s;
}
.btn-ai-stop:hover { transform: scale(1.05); }

/* 音乐按钮激活状态 */
#btn-music { font-size: 16px; }

/* 用户信息按钮 */
.btn-icon[title^="当前用户"] {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  font-size: 18px;
}

/* ===== Toast ===== */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-80px);
  background: rgba(0,0,0,0.88); color: #fff; padding: 11px 26px; border-radius: 28px;
  font-size: 14px; font-weight: 600; z-index: 9999; transition: transform 0.3s ease;
  white-space: nowrap; backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.15);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== 响应式 ===== */
@media (max-height: 680px) {
  .pet-body { width: 110px; height: 128px; }
  .main-container { gap: 7px; padding: 10px; }
  .pet-stage { min-height: 200px; }
  .btn-feed, .btn-play { padding: 11px; font-size: 15px; }
}
@media (max-width: 480px) {
  .pet-grid { gap: 10px; }
  .pet-card { width: 148px; }
  .options-grid { grid-template-columns: 1fr; }
  .main-title { font-size: 40px; }
  .top-bar { padding: 8px 10px; }
  .pet-name-badge { max-width: 70px; }
}
