* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #ff7a59;
  --primary-light: #ff9a7a;
  --secondary: #5ec4b4;
  --text: #2d2a26;
  --text-light: #8b7e74;
  --bg: #fdf8f5;
  --bg-card: #ffffff;
  --border: #e8ddd4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* === 导航栏 === */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.logo-icon { font-size: 1.8rem; }
.logo-text { font-size: 1.3rem; font-weight: 700; color: var(--primary); }

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-light);
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  background: var(--bg);
  transition: background 0.2s;
}

.user-info:hover { background: var(--border); }

.user-avatar { font-size: 1.2rem; }
.user-name { font-size: 0.9rem; font-weight: 500; }
.user-balance { font-size: 0.85rem; color: var(--primary); font-weight: 600; }

/* === 按钮 === */
.btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 122, 89, 0.3);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1rem;
  position: relative;
}

.btn-large .btn-sub {
  display: block;
  font-size: 0.75rem;
  opacity: 0.9;
  font-weight: 400;
  margin-top: 2px;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  background: var(--bg);
  color: var(--text-light);
  border: 1px solid var(--border);
}

.btn-sm:hover { background: var(--border); }

.btn-block { width: 100%; margin-top: 1rem; }

/* === 首页 Hero === */
.hero-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  min-height: 500px;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
}

.stat-item { text-align: center; }
.stat-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 400px;
}

.pet-showcase {
  position: relative;
  width: 300px;
  height: 300px;
}

.showcase-pet {
  position: absolute;
  font-size: 5rem;
  animation: float 3s ease-in-out infinite;
}

.showcase-pet.fox { top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 8rem; }
.showcase-pet.cat { top: 20%; right: 10%; font-size: 4rem; }
.showcase-pet.rabbit { bottom: 20%; left: 5%; font-size: 4.5rem; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* === 特性区 === */
.features-section {
  background: white;
  padding: 4rem 2rem;
  text-align: center;
}

.features-section h2 {
  font-size: 2rem;
  margin-bottom: 3rem;
}

.feature-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.feature-card {
  background: var(--bg);
  padding: 2rem 1.5rem;
  border-radius: 16px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(255, 122, 89, 0.1);
}

.feature-icon { font-size: 3rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.9rem; color: var(--text-light); }

/* === 宠物预览 === */
.pet-preview-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.pet-preview-section h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2.5rem;
}

.pet-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

/* === 商店 === */
.shop-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 3rem 2rem;
  text-align: center;
}

.shop-header h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.shop-header p { opacity: 0.9; }

.shop-filters {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.filter-tabs {
  display: flex;
  gap: 0.5rem;
  background: white;
  padding: 0.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  width: fit-content;
}

.filter-tab {
  padding: 0.6rem 1.2rem;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-light);
  transition: all 0.2s;
  font-family: inherit;
}

.filter-tab.active {
  background: var(--primary);
  color: white;
}

.shop-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.pet-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.pet-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(255, 122, 89, 0.15);
}

.pet-card-image {
  height: 180px;
  background: linear-gradient(135deg, #fff0eb, #f0faf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  position: relative;
}

.pet-card-rarity {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}

.rarity-common { background: #9ca3af; }
.rarity-rare { background: #3b82f6; }
.rarity-epic { background: #8b5cf6; }
.rarity-legendary { background: linear-gradient(135deg, #f59e0b, #ef4444); }

.pet-card-info {
  padding: 1rem;
}

.pet-card-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.pet-card-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.pet-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pet-card-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}

.pet-card-price.free { color: var(--success); }

.pet-card-btn {
  padding: 0.4rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  transition: background 0.2s;
}

.pet-card-btn:hover { background: var(--primary-light); }

/* === 下载页 === */
.download-hero {
  max-width: 800px;
  margin: 0 auto;
  padding: 5rem 2rem;
  text-align: center;
}

.download-hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.download-hero p {
  color: var(--text-light);
  margin-bottom: 3rem;
  font-size: 1.1rem;
}

.download-buttons {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.btn-download {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 2.5rem;
  background: white;
  border: 2px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.btn-download:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 122, 89, 0.15);
}

.dl-icon { font-size: 2.5rem; }
.dl-title { font-size: 1.1rem; font-weight: 600; text-align: left; }
.dl-sub { font-size: 0.85rem; color: var(--text-light); text-align: left; }

.download-info {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* === 用户中心 === */
.profile-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

.profile-sidebar {
  position: sticky;
  top: 84px;
  align-self: start;
}

.profile-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.profile-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.75rem;
  background: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.profile-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.profile-balance {
  background: var(--bg);
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.balance-num {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.profile-menu {
  background: white;
  border-radius: 16px;
  padding: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.menu-item {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.9rem;
}

.menu-item:hover { background: var(--bg); }
.menu-item.active { background: var(--primary); color: white; }

.profile-content {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  min-height: 500px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.profile-tab h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--bg);
}

.profile-tab-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--bg);
}

.profile-tab-header h2 {
  margin: 0;
  padding: 0;
  border: none;
}

.back-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-family: inherit;
  transition: background 0.2s;
}

.back-btn:hover {
  background: var(--bg);
}

.mobile-only {
  display: none;
}

.my-pets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.my-pet-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  transition: border-color 0.2s;
}

.my-pet-card:hover { border-color: var(--primary); }

.my-pet-emoji { font-size: 3rem; margin-bottom: 0.5rem; }
.my-pet-name { font-weight: 600; margin-bottom: 0.25rem; }
.my-pet-level { font-size: 0.8rem; color: var(--text-light); }

.orders-list .order-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.orders-list .order-item:last-child { border-bottom: none; }

.order-no { font-family: monospace; color: var(--text-light); font-size: 0.85rem; }
.order-amount { font-weight: 600; color: var(--primary); }
.order-status { font-size: 0.85rem; color: var(--success); }

.settings-form label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-light);
  margin: 1rem 0 0.5rem;
}

.settings-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}

.settings-form input:focus {
  outline: none;
  border-color: var(--primary);
}

/* === 关于页 === */
.about-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.about-content h1 { font-size: 2rem; margin-bottom: 1.5rem; }
.about-content p { margin-bottom: 1rem; color: var(--text-light); line-height: 2; }

/* === 弹窗 === */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.show { display: flex; }

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  position: relative;
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  line-height: 1;
}

.modal-close:hover { color: var(--text); }

.modal-content h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.modal-content label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-light);
  margin: 0.75rem 0 0.5rem;
}

.modal-content input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}

.modal-content input:focus {
  outline: none;
  border-color: var(--primary);
}

.modal-footer {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

.modal-footer a { color: var(--primary); text-decoration: none; }

/* === 充值选项 === */
.recharge-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.recharge-item {
  padding: 1rem 0.5rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.recharge-item:hover, .recharge-item.selected {
  border-color: var(--primary);
  background: #fff5f2;
}

.recharge-amount {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}

.recharge-bonus {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

.recharge-custom { margin-bottom: 0.5rem; }

.buy-pet-info {
  text-align: center;
  padding: 1rem 0;
}

.buy-pet-info .pet-emoji { font-size: 4rem; margin-bottom: 0.5rem; }
.buy-pet-info .pet-name { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.5rem; }
.buy-pet-info .pet-price { font-size: 1.5rem; color: var(--primary); font-weight: 700; }

/* === Toast === */
.toast {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(45, 42, 38, 0.95);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === Footer === */
.footer {
  background: #2d2a26;
  color: #8b7e74;
  padding: 2rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
}

.footer p { font-size: 0.85rem; }

/* === 移动端菜单按钮 === */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
  margin: 0 auto;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-btn.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* === 移动端菜单 === */
.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  z-index: 99;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  animation: slideDown 0.3s ease;
}

.mobile-menu.show { display: block; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-menu-user {
  background: var(--bg);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.mobile-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.mobile-user-avatar {
  width: 48px;
  height: 48px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.mobile-user-name {
  font-weight: 600;
  font-size: 1rem;
}

.mobile-user-balance {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
}

.mobile-arrow {
  margin-left: auto;
  font-size: 1.5rem;
  color: var(--text-light);
}

.mobile-menu-guest {
  margin-bottom: 1rem;
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-menu-link {
  display: block;
  padding: 0.9rem 1rem;
  text-decoration: none;
  color: var(--text);
  font-size: 1rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.mobile-menu-link:hover {
  background: var(--bg);
  color: var(--primary);
}

.mobile-menu-logout {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* === 响应式 === */
@media (max-width: 900px) {
  .hero-section { grid-template-columns: 1fr; text-align: center; }
  .hero-content h1 { font-size: 2rem; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .pet-preview-grid, .shop-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-container { grid-template-columns: 1fr; }
  .profile-sidebar { position: static; }
  .nav-links { display: none; }
  .my-pets-grid { grid-template-columns: repeat(2, 1fr); }
  .mobile-menu-btn { display: flex; }
  .nav-user { display: none; }
  .nav-container { padding: 0 1rem; }
}

@media (max-width: 500px) {
  .feature-grid { grid-template-columns: 1fr; }
  .pet-preview-grid, .shop-grid { grid-template-columns: 1fr; }
  .download-buttons { flex-direction: column; }
  .recharge-options { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { gap: 1.5rem; justify-content: center; flex-wrap: wrap; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .hero-buttons .btn { width: 100%; max-width: 280px; }
  .shop-header h1 { font-size: 1.8rem; }
  .filter-tabs { flex-wrap: wrap; width: 100%; }
  .filter-tab { flex: 1; padding: 0.5rem; font-size: 0.85rem; }
  .profile-content { padding: 1rem; }
  .profile-tab h2 { font-size: 1.2rem; }
  .mobile-only { display: block; }
}
