/* ===== 阿里妈妈方圆体 + 卡通主题全局样式 ===== */

/* 引入阿里妈妈方圆体 */
@import url('https://fonts.googleapis.com/css2?family=ZCOOL+KuaiLe&display=swap');

/* ===== 卡通主题变量 ===== */
:root {
  /* 主色 - 森林绿 */
  --primary: #4CAF50;
  --primary-light: #66BB6A;
  --primary-lighter: #81C784;
  --primary-dark: #388E3C;
  --primary-deep: #2E7D32;

  /* 天空色 */
  --sky-top: #64B5F6;
  --sky-mid: #90CAF9;
  --sky-bottom: #BBDEFB;
  --sky-light: #E3F2FD;

  /* 草地色 */
  --grass-top: #7CB342;
  --grass-mid: #8BC34A;
  --grass-light: #9CCC65;
  --grass-bg: #C5E1A5;

  /* 暖色 */
  --sun: #FFD54F;
  --sun-glow: #FFF176;
  --warm: #FFF9C4;
  --cream: #FFFDE7;

  /* 文字色 */
  --text-dark: #3E2723;
  --text-brown: #5D4037;
  --text-green: #2E7D32;
  --text-muted: #795548;

  /* 功能色 */
  --blue: #42A5F5;
  --blue-light: #90CAF9;
  --red: #FF7043;
  --red-light: #FF8A65;
  --orange: #FFA726;
  --orange-light: #FFB74D;
  --yellow: #FFD54F;
  --pink: #F48FB1;
  --purple: #CE93D8;

  /* 卡片 */
  --card-bg: rgba(255, 255, 255, 0.35);
  --card-border: rgba(255, 255, 255, 0.5);
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  --card-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);

  /* 圆角 */
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;

  /* 字体 */
  --font-main: 'ZCOOL KuaiLe', 'Alimama FangYuanTi VF', 'PingFang SC', 'Microsoft YaHei', cursive, sans-serif;

  /* 阴影 */
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.1);
  --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* ===== 全局重置 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text-dark);
  background: var(--sky-light);
}

/* ===== 场景化背景 ===== */
.scene-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* 天空渐变 */
.sky-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 70%;
  background: linear-gradient(180deg,
    var(--sky-top) 0%,
    var(--sky-mid) 30%,
    var(--sky-bottom) 60%,
    var(--sky-light) 100%
  );
}

/* 太阳 */
.sun {
  position: absolute;
  top: 10%;
  right: 3%;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--sun) 30%, var(--sun-glow) 60%, rgba(255, 241, 118, 0) 70%);
  box-shadow: 0 0 60px rgba(255, 213, 79, 0.5), 0 0 120px rgba(255, 213, 79, 0.2);
  animation: sunPulse 4s ease-in-out infinite;
}

.sun::before {
  content: '';
  position: absolute;
  top: -15px;
  left: -15px;
  right: -15px;
  bottom: -15px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 241, 118, 0.3) 0%, transparent 70%);
  animation: sunGlow 3s ease-in-out infinite alternate;
}

/* 太阳光线 */
.sun-rays {
  position: absolute;
  top: 10%;
  right: 3%;
  width: 80px;
  height: 80px;
  animation: sunRaysSpin 20s linear infinite;
}

.sun-ray {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 30px;
  background: linear-gradient(to top, rgba(255, 213, 79, 0.6), transparent);
  transform-origin: center 0;
  border-radius: 2px;
}

@keyframes sunPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes sunGlow {
  0% { opacity: 0.6; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.2); }
}

@keyframes sunRaysSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 云朵 */
.cloud {
  position: absolute;
  background: white;
  border-radius: 50px;
  opacity: 0.9;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.05));
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: white;
  border-radius: 50%;
}

.cloud-1 {
  top: 14%;
  left: -5%;
  width: 120px;
  height: 40px;
  animation: cloudFloat1 25s ease-in-out infinite;
}
.cloud-1::before {
  width: 50px;
  height: 50px;
  top: -25px;
  left: 20px;
}
.cloud-1::after {
  width: 35px;
  height: 35px;
  top: -15px;
  left: 55px;
}

.cloud-2 {
  top: 20%;
  left: 30%;
  width: 90px;
  height: 30px;
  animation: cloudFloat2 30s ease-in-out infinite;
  opacity: 0.7;
}
.cloud-2::before {
  width: 40px;
  height: 40px;
  top: -20px;
  left: 15px;
}
.cloud-2::after {
  width: 28px;
  height: 28px;
  top: -12px;
  left: 42px;
}

.cloud-3 {
  top: 12%;
  right: 25%;
  width: 100px;
  height: 35px;
  animation: cloudFloat3 35s ease-in-out infinite;
  opacity: 0.8;
}
.cloud-3::before {
  width: 45px;
  height: 45px;
  top: -22px;
  left: 18px;
}
.cloud-3::after {
  width: 32px;
  height: 32px;
  top: -14px;
  left: 50px;
}

@keyframes cloudFloat1 {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(80px); }
}

@keyframes cloudFloat2 {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-60px); }
}

@keyframes cloudFloat3 {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(50px); }
}

/* 草地 */
.grass-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30%;
  background: linear-gradient(180deg,
    var(--grass-light) 0%,
    var(--grass-mid) 30%,
    var(--grass-top) 70%,
    #689F38 100%
  );
  border-radius: 50% 50% 0 0 / 15% 15% 0 0;
}

/* 草地波浪装饰 */
.grass-wave {
  position: absolute;
  bottom: 0;
  left: -5%;
  right: -5%;
  height: 25%;
}

.grass-wave svg {
  position: absolute;
  bottom: 0;
  width: 120%;
  left: -10%;
}

/* ===== 浮动装饰 ===== */
.floating-decor {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.leaf-particle {
  position: absolute;
  font-size: 16px;
  opacity: 0.6;
  animation: leafFall linear infinite;
}

.star-particle {
  position: absolute;
  font-size: 12px;
  opacity: 0;
  animation: starTwinkle 3s ease-in-out infinite;
}

@keyframes leafFall {
  0% {
    transform: translateY(-20px) rotate(0deg) translateX(0);
    opacity: 0;
  }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% {
    transform: translateY(100vh) rotate(360deg) translateX(80px);
    opacity: 0;
  }
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 0.8; transform: scale(1.2); }
}

/* ===== 顶部导航栏 ===== */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.45);
  border-bottom: 2px solid rgba(255, 255, 255, 0.6);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.nav-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--primary-dark);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 2px;
}

.nav-title .tree-icon {
  font-size: 30px;
  animation: treeIconBounce 2s ease-in-out infinite;
}

#nav-title-text {
  cursor: pointer;
  border-bottom: 2px dashed transparent;
  transition: border-color 0.2s ease;
}

#nav-title-text:hover {
  border-bottom-color: var(--primary-dark);
}

.nav-title-input {
  font-size: 24px;
  font-weight: 600;
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.3);
  border: none;
  border-bottom: 2px solid var(--primary-dark);
  outline: none;
  padding: 0 4px;
  width: 140px;
  letter-spacing: 2px;
  font-family: inherit;
}

@keyframes treeIconBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===== 系统配置下拉 ===== */
.settings-wrapper {
  position: relative;
}

.btn-settings {
  transition: transform 0.3s ease;
}

.btn-settings:hover {
  transform: rotate(60deg);
}

.btn-refresh {
  transition: transform 0.3s ease;
}

.btn-refresh:hover {
  transform: rotate(90deg);
}

.btn-refresh svg {
  width: 20px;
  height: 20px;
}

.btn-refresh.spinning svg {
  animation: spinOnce 0.6s ease;
}

@keyframes spinOnce {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.settings-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 200px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transition: all 0.25s ease;
  z-index: 200;
  overflow: hidden;
}

.settings-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.settings-header {
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-dark);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.settings-menu-item {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.settings-menu-item:last-child {
  border-bottom: none;
}

.settings-menu-item:hover {
  background: rgba(76, 175, 80, 0.08);
}

.settings-menu-item:active {
  background: rgba(76, 175, 80, 0.14);
}

.settings-menu-icon {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-dark);
}

.settings-menu-icon svg {
  width: 18px;
  height: 18px;
}

.settings-menu-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-brown);
  flex: 1;
}

.settings-menu-arrow {
  font-size: 18px;
  color: #9CA3AF;
  margin-left: 8px;
  transition: transform 0.2s ease;
}

.settings-menu-item:hover .settings-menu-arrow {
  transform: translateX(3px);
  color: var(--primary);
}

/* ===== 配置弹窗 ===== */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.dialog-overlay.active {
  opacity: 1;
  visibility: visible;
}

.dialog-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.06);
  width: 90%;
  max-width: 380px;
  padding: 0;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.dialog-card-wide {
  max-width: 420px;
}

.dialog-overlay.active .dialog-card {
  transform: scale(1) translateY(0);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
}

.dialog-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 0;
}

.dialog-close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  font-size: 14px;
  color: #9CA3AF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.dialog-close-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #6B7280;
}

.dialog-body {
  padding: 8px 24px 16px;
}

.dialog-field {
  margin-bottom: 14px;
}

.dialog-current-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
  font-size: 13px;
}

.dialog-current-label {
  color: #9CA3AF;
  font-weight: 400;
  white-space: nowrap;
}

.dialog-current-value {
  color: var(--text-brown);
  font-weight: 500;
  flex: 1;
  word-break: break-all;
}

.dialog-eye-btn {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.dialog-eye-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.dialog-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-brown);
  margin-bottom: 6px;
}

.dialog-field input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid rgba(129, 199, 132, 0.25);
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--font-main);
  outline: none;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-dark);
  box-sizing: border-box;
}

.dialog-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
  background: rgba(255, 255, 255, 0.9);
}

.dialog-field input::placeholder {
  color: rgba(117, 85, 72, 0.4);
}

.dialog-input-readonly {
  background: rgba(0, 0, 0, 0.03);
  color: #9CA3AF;
  cursor: default;
}

.dialog-section {
  margin-bottom: 8px;
}

.dialog-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-brown);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.dialog-section-btn {
  width: 100%;
  padding: 10px 0;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
}

.dialog-section-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.dialog-section-btn:active {
  transform: translateY(0) scale(0.98);
}

.dialog-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 12px 0 16px;
}

.dialog-footer {
  display: flex;
  gap: 10px;
  padding: 12px 24px 20px;
  justify-content: flex-end;
}

.dialog-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dialog-btn:hover {
  transform: translateY(-1px);
}

.dialog-btn:active {
  transform: translateY(0) scale(0.98);
}

.dialog-btn-cancel {
  background: rgba(0, 0, 0, 0.06);
  color: #6B7280;
}

.dialog-btn-cancel:hover {
  background: rgba(0, 0, 0, 0.1);
}

.dialog-btn-save {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.dialog-btn-save:hover {
  box-shadow: 0 6px 18px rgba(76, 175, 80, 0.4);
}

/* 小树数量徽标 - 角标样式 */
.btn-list {
  position: relative;
}

.tree-count-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  color: white;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.35);
  line-height: 1;
  pointer-events: none;
}

/* ===== 按钮通用 ===== */
.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-icon:hover {
  transform: scale(1.15) translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.btn-icon:active {
  transform: scale(0.95);
}

.btn-list {
  background: rgba(129, 199, 132, 0.3);
  border-color: rgba(129, 199, 132, 0.5);
  color: var(--primary-dark);
}

.btn-list:hover {
  background: rgba(129, 199, 132, 0.5);
}

/* ===== 置顶按钮 ===== */
.scroll-top-btn {
  position: fixed;
  bottom: 34px;
  right: 112px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  color: var(--primary-dark);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.8);
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.scroll-top-btn:hover {
  transform: scale(1.15) translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.scroll-top-btn:active {
  transform: scale(0.95);
}

.scroll-top-btn svg {
  width: 20px;
  height: 20px;
}

/* ===== 语音按钮 ===== */
.voice-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 200;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.6);
  cursor: pointer;
  background: linear-gradient(145deg, var(--blue), #1E88E5);
  color: white;
  font-size: 28px;
  box-shadow: 0 6px 24px rgba(66, 165, 245, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-btn:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 10px 30px rgba(66, 165, 245, 0.5);
}

.voice-btn.recording {
  background: linear-gradient(145deg, var(--red), #E53935);
  box-shadow: 0 6px 24px rgba(255, 112, 67, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.2);
  animation: pulseRecord 1.5s ease-in-out infinite;
}

@keyframes pulseRecord {
  0%, 100% { transform: scale(1); box-shadow: 0 6px 24px rgba(255, 112, 67, 0.5); }
  50% { transform: scale(1.12); box-shadow: 0 8px 32px rgba(255, 112, 67, 0.6); }
}

/* ===== 语音识别浮层 ===== */
.voice-overlay {
  position: fixed;
  bottom: 108px;
  right: 24px;
  z-index: 199;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-lg);
  border: 2px solid rgba(255, 255, 255, 0.6);
  padding: 18px 22px;
  box-shadow: var(--card-shadow-hover);
  max-width: 300px;
  display: none;
  animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.voice-overlay.active {
  display: block;
}

.voice-overlay .voice-text {
  font-size: 16px;
  color: var(--text-dark);
  min-height: 28px;
  font-weight: 500;
}

.voice-overlay .voice-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  opacity: 0.8;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(15px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== 侧边栏 ===== */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 300;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

.sidebar {
  position: fixed;
  top: 0;
  left: -380px;
  width: 380px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 2px solid rgba(255, 255, 255, 0.5);
  z-index: 301;
  transition: left 0.4s ease-out;
  box-shadow: 4px 0 30px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
}

.sidebar.active {
  left: 0;
}

.sidebar-header {
  padding: 22px 20px;
  border-bottom: 2px solid rgba(129, 199, 132, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(129, 199, 132, 0.15), rgba(255, 255, 255, 0.1));
}

.sidebar-header h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--primary-dark);
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sidebar-count-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  color: white;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.35);
  animation: bubbleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-count-bubble.bubble-pop {
  animation: bubblePop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bubbleIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes bubblePop {
  0% { transform: scale(1); }
  40% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.sidebar-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 18px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-close:hover {
  background: rgba(255, 112, 67, 0.15);
  color: var(--red);
  transform: rotate(90deg) scale(1.1);
}

.sidebar-add-btn {
  padding: 12px 20px;
  margin: 18px 20px 10px;
  border-radius: var(--radius-md);
  border: 2.5px dashed var(--primary-light);
  background: linear-gradient(135deg, rgba(129, 199, 132, 0.1), rgba(255, 255, 255, 0.2));
  color: var(--primary);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-main);
}

.sidebar-add-btn:hover {
  background: rgba(129, 199, 132, 0.2);
  border-color: var(--primary);
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 20px 20px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: all 0.25s ease;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.3);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.sidebar-item:hover {
  background: rgba(129, 199, 132, 0.15);
  border-color: rgba(129, 199, 132, 0.3);
  transform: translateX(4px);
}

.sidebar-item .name {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.sidebar-item .sidebar-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.sidebar-item .level-badge {
  font-size: 13px;
  font-weight: 500;
  color: white;
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  padding: 4px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

.sidebar-item .sidebar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.sidebar-item .edit-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 112, 67, 0.1);
  color: var(--red);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-item:hover .edit-btn {
  opacity: 1;
}

.sidebar-item .edit-btn:hover {
  background: rgba(255, 112, 67, 0.25);
  transform: scale(1.15);
}

.sidebar-item .reset-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 112, 67, 0.1);
  color: var(--red);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-item:hover .reset-btn {
  opacity: 1;
}

.sidebar-item .reset-btn:hover {
  background: rgba(255, 112, 67, 0.25);
  transform: scale(1.15);
}

.sidebar-item .delete-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 112, 67, 0.1);
  color: var(--red);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-item:hover .delete-btn {
  opacity: 1;
}

.sidebar-item .delete-btn:hover {
  background: rgba(255, 112, 67, 0.25);
  transform: scale(1.15);
}

/* ===== 弹窗通用 ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-xl);
  border: 2px solid rgba(255, 255, 255, 0.6);
  padding: 32px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.06);
  animation: modalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.85) translateY(30px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal h3 {
  font-size: 22px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 22px;
  text-align: center;
  letter-spacing: 1px;
}

.modal label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-brown);
  margin-bottom: 8px;
}

.modal input {
  width: 100%;
  padding: 14px 16px;
  border: 2.5px solid rgba(129, 199, 132, 0.25);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: var(--font-main);
  outline: none;
  transition: all 0.3s ease;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-dark);
}

.modal input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.12);
  background: rgba(255, 255, 255, 0.8);
}

.modal input::placeholder {
  color: rgba(117, 85, 72, 0.4);
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.modal-actions button {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: var(--font-main);
  letter-spacing: 1px;
}

.btn-confirm {
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.btn-confirm:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(76, 175, 80, 0.4);
}

.btn-confirm:active {
  transform: translateY(0) scale(0.98);
}

.btn-cancel {
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-muted);
  border: 2px solid rgba(0, 0, 0, 0.06);
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
}

/* ===== 森林网格 ===== */
.forest-container {
  position: relative;
  z-index: 2;
  padding: 8px 12px 120px;
  max-width: 1200px;
  margin: 0 auto;
}

.forest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  padding: 4px 0;
}

/* ===== 小树卡片 - 玻璃拟态 ===== */
.tree-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  border: 2px solid var(--card-border);
  padding: 8px 8px 8px;
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: visible;
}

.tree-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent);
  pointer-events: none;
}

.tree-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(129, 199, 132, 0.4);
}

.tree-card .tree-svg-container {
  width: 100%;
  aspect-ratio: 26 / 26;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.tree-card .tree-svg-container svg {
  width: 100%;
  height: 100%;
  transition: all 0.5s ease;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.tree-card .student-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 3px 0 1px;
  letter-spacing: 1px;
}

.tree-card .level-display {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.level-badge-inline {
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  color: white;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3);
}

.stage-name {
  color: var(--text-brown);
  font-size: 13px;
}

.tree-card .action-buttons {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 6px;
}

.btn-water {
  padding: 6px 12px;
  border-radius: 18px;
  border: 1.5px solid rgba(66, 165, 245, 0.25);
  background: linear-gradient(145deg, #81D4FA, #4FC3F7);
  color: #0D47A1;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: var(--font-main);
  display: flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 2px 8px rgba(79, 195, 247, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-water:hover {
  background: linear-gradient(145deg, #4FC3F7, #29B6F6);
  color: white;
  box-shadow: 0 4px 14px rgba(79, 195, 247, 0.4);
  transform: scale(1.06) translateY(-1px);
}

.btn-water:active {
  transform: scale(0.95);
}

.btn-bug {
  padding: 6px 12px;
  border-radius: 18px;
  border: 1.5px solid rgba(255, 183, 77, 0.25);
  background: linear-gradient(145deg, #FFE0B2, #FFCC80);
  color: #BF360C;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: var(--font-main);
  display: flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 2px 8px rgba(255, 204, 128, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-bug:hover {
  background: linear-gradient(145deg, #FFCC80, #FFB74D);
  color: white;
  box-shadow: 0 4px 14px rgba(255, 183, 77, 0.4);
  transform: scale(1.06) translateY(-1px);
}

.btn-bug:active {
  transform: scale(0.95);
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 72px;
  margin-bottom: 20px;
  animation: emptyBounce 2s ease-in-out infinite;
}

@keyframes emptyBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.05); }
}

.empty-state p {
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--text-brown);
}

.empty-state .hint {
  font-size: 14px;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ===== Toast 提示 ===== */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px) scale(0.9);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 14px 28px;
  border-radius: 30px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  font-size: 15px;
  font-weight: 500;
  z-index: 1100;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  font-family: var(--font-main);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.toast.success {
  color: var(--primary-dark);
  border-color: rgba(129, 199, 132, 0.4);
  background: rgba(200, 230, 201, 0.7);
}

.toast.error {
  color: var(--red);
  border-color: rgba(255, 112, 67, 0.3);
  background: rgba(255, 204, 188, 0.7);
}

.toast.info {
  color: var(--blue);
  border-color: rgba(66, 165, 245, 0.3);
  background: rgba(187, 222, 251, 0.7);
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(129, 199, 132, 0.25);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(129, 199, 132, 0.4);
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
  .forest-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }

  .tree-card .tree-svg-container {
    height: 120px;
  }

  .nav-title {
    display: none;
  }

  .voice-btn {
    width: 58px;
    height: 58px;
    font-size: 24px;
    bottom: 20px;
    right: 20px;
  }

  .sun {
    width: 60px;
    height: 60px;
  }

  /* 移动端侧边栏选中态 */
  .sidebar-item .edit-btn,
  .sidebar-item .reset-btn,
  .sidebar-item .delete-btn {
    pointer-events: none;
  }

  .sidebar-item.selected {
    background: rgba(129, 199, 132, 0.2);
    border-color: rgba(76, 175, 80, 0.5);
    box-shadow: 0 2px 12px rgba(76, 175, 80, 0.15);
  }

  .sidebar-item.selected .edit-btn,
  .sidebar-item.selected .reset-btn,
  .sidebar-item.selected .delete-btn {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ===== 登录/注册页面 ===== */
.auth-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-page .scene-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
}

.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.auth-card {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-xl);
  border: 2px solid rgba(255, 255, 255, 0.6);
  padding: 40px 32px 32px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.1), 0 8px 24px rgba(0, 0, 0, 0.05);
  animation: authCardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes authCardIn {
  from { opacity: 0; transform: scale(0.85) translateY(30px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-logo {
  font-size: 56px;
  text-align: center;
  margin-bottom: 8px;
  animation: authLogoFloat 3s ease-in-out infinite;
}

@keyframes authLogoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.auth-title {
  font-size: 26px;
  font-weight: 600;
  color: var(--primary-dark);
  text-align: center;
  margin-bottom: 4px;
  letter-spacing: 2px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.auth-field {
  margin-bottom: 18px;
}

.auth-field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-brown);
  margin-bottom: 6px;
}

.auth-field input {
  width: 100%;
  padding: 13px 16px;
  border: 2.5px solid rgba(129, 199, 132, 0.25);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font-main);
  outline: none;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-dark);
  box-sizing: border-box;
}

.auth-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.12);
  background: rgba(255, 255, 255, 0.85);
}

.auth-field input::placeholder {
  color: rgba(117, 85, 72, 0.4);
}

.auth-error {
  font-size: 13px;
  color: var(--red);
  min-height: 20px;
  margin-bottom: 8px;
  text-align: center;
  transition: all 0.3s ease;
}

.auth-submit-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: var(--font-main);
  letter-spacing: 4px;
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.2);
  margin-bottom: 16px;
}

.auth-submit-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(76, 175, 80, 0.45);
}

.auth-submit-btn:active {
  transform: translateY(0) scale(0.98);
}

.auth-switch {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.auth-switch a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
}

.auth-switch a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.auth-forgot-row {
  text-align: right;
  margin-bottom: 8px;
}

.auth-forgot-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s;
}

.auth-forgot-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ===== 忘记密码弹窗结果 ===== */
.fp-result {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 10px;
}

.fp-result-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.fp-result-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-dark);
  letter-spacing: 1px;
  word-break: break-all;
}

.fp-result-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fp-copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: rgba(76, 175, 80, 0.15);
  color: var(--primary-dark);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.fp-copy-btn:hover {
  background: rgba(76, 175, 80, 0.3);
  transform: scale(1.05);
}

.fp-copy-btn.copied {
  background: rgba(76, 175, 80, 0.35);
  color: #2E7D32;
}

.fp-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(255, 77, 79, 0.08);
  border: 1px solid rgba(255, 77, 79, 0.2);
  border-radius: 10px;
  font-size: 13px;
  color: #FF4D4F;
}



/* ===== 导航栏用户名 & 退出按钮 ===== */
.nav-username {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary-dark);
  margin-right: 4px;
  white-space: nowrap;
}

.btn-logout {
  transition: transform 0.3s ease;
}

.btn-logout:hover {
  transform: translateX(2px);
}

.btn-logout svg {
  width: 20px;
  height: 20px;
}
