/* ============ 全局样式 ============ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 主色系 */
  --green: #2E5A3C;
  --green-dark: #234a30;
  --green-light: #4a7a5c;
  --green-bg: #e8f0e8;
  --cream: #f8f1e3;
  --cream-dark: #f4e9d8;
  --cream-light: #fdf8ee;
  --brown: #5c4733;
  --brown-light: #8a7554;
  --brown-lighter: #b0a080;
  --border: #d1c3a8;
  --border-light: #e5dcc8;
  --white: #ffffff;
  --red: #c62828;
  --red-light: #e57373;
  --orange: #e65100;
  --orange-light: #ff9800;
  --gold: #FFD700;
  --gold-dark: #d4a017;
  --blue: #1565c0;
  --blue-light: #5c9ce6;
  --purple: #6a1b9a;
  --purple-light: #ab47bc;
  /* 五行色 */
  --wx-wood: #4caf50;
  --wx-fire: #f44336;
  --wx-earth: #ff9800;
  --wx-metal: #9e9e9e;
  --wx-water: #2196f3;
  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(94,71,51,0.06);
  --shadow-md: 0 2px 8px rgba(94,71,51,0.08);
  --shadow-lg: 0 4px 16px rgba(94,71,51,0.12);
  --shadow-green: 0 2px 12px rgba(46,90,60,0.15);
  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  /* 字体 */
  --font-sans: -apple-system, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-kai: "STKaiti", "KaiTi", "楷体", "AR PL UKai CN", "Noto Serif SC", serif;
  --font-song: "STSong", "SimSun", "宋体", "Noto Serif SC", serif;
}

body {
  background: #1a1a2e;
  background: linear-gradient(160deg, #f5ecd7 0%, #e8dcc0 40%, #ddd0b0 100%);
  background-attachment: fixed;
  font-family: var(--font-sans);
  color: #3f2e1f;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

#app {
  max-width: 750px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
  background: linear-gradient(160deg, #f5ecd7 0%, #e8dcc0 40%, #ddd0b0 100%);
}

/* ============ 通用组件 ============ */
.card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 4px 20px rgba(94,71,51,0.10), 0 1px 3px rgba(94,71,51,0.06);
  border: 1px solid rgba(209,195,168,0.5);
  transition: box-shadow 0.3s, transform 0.3s;
}

.card:first-child {
  margin-top: 0;
}

.card-title {
  font-size: 17px;
  font-weight: bold;
  color: var(--green);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(46,90,60,0.12);
}

.card-title-icon {
  margin-right: 8px;
  font-size: 20px;
}

.btn-primary {
  background: linear-gradient(135deg, #3a7a55 0%, #1a4028 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  width: 100%;
  margin-top: 14px;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 14px rgba(46,90,60,0.30);
  letter-spacing: 2px;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 2px 6px rgba(46,90,60,0.20);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2E5A3C 0%, #122e1a 100%);
  box-shadow: 0 6px 20px rgba(46,90,60,0.35);
}

.btn-primary:hover::after {
  left: 100%;
}

.btn-secondary {
  background: var(--cream);
  color: var(--green);
  border: 1.5px solid var(--green);
  border-radius: 12px;
  padding: 13px 20px;
  font-size: 16px;
  width: 100%;
  margin-top: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:active {
  background: var(--cream-dark);
  transform: scale(0.97);
}

/* 表单 */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  font-size: 14px;
  color: var(--brown);
  margin-bottom: 6px;
  font-weight: 500;
  display: block;
}

.form-input, .form-select {
  background: var(--cream-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 15px;
  color: #3f2e1f;
  width: 100%;
  transition: all 0.2s;
}

.form-input:focus, .form-select:focus {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(46,90,60,0.1);
  background: #fff;
}

.form-input::placeholder {
  color: var(--brown-lighter);
}

/* 分段选择器 */
.seg-group {
  display: flex;
  gap: 8px;
}

.seg-btn {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: var(--radius-md);
  background: var(--cream-light);
  border: 1px solid var(--border);
  font-size: 15px;
  color: var(--brown);
  cursor: pointer;
  transition: all 0.2s;
}

.seg-btn.active {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff;
  border-color: var(--green);
  box-shadow: 0 2px 8px rgba(46,90,60,0.2);
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  margin-right: 6px;
  margin-bottom: 6px;
  font-weight: 500;
}

.tag-success { background: #e6f0e6; color: var(--green); }
.tag-warning { background: #fff3e0; color: var(--orange); }
.tag-danger  { background: #ffebee; color: var(--red); }
.tag-info    { background: #e3f2fd; color: #1565c0; }

/* 导航栏 */
.navbar {
  background: linear-gradient(135deg, #3a7a55 0%, #1a4028 100%);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(26,64,40,0.35);
  padding-top: calc(16px + env(safe-area-inset-top));
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.navbar-back {
  font-size: 24px;
  margin-right: 14px;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
  line-height: 1;
  width: 30px;
  text-align: center;
}

.navbar-back:active {
  opacity: 0.5;
  transform: scale(0.85);
}

.navbar-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 2px;
}

/* 底部Tab栏 */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 750px;
  background: rgba(255,253,248,0.97);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(209,195,168,0.4);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(94,71,51,0.06);
}

.tabbar-item {
  flex: 1;
  text-align: center;
  padding: 10px 0 8px;
  color: var(--brown-light);
  cursor: pointer;
  text-decoration: none;
  font-size: 12px;
  transition: color 0.2s;
}

.tabbar-item.active {
  color: var(--green);
  font-weight: 600;
}

.tabbar-icon {
  font-size: 24px;
  display: block;
  margin-bottom: 3px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tabbar-item.active .tabbar-icon {
  transform: scale(1.15) translateY(-2px);
}

/* 页面容器 */
.page {
  padding: 12px 16px;
}

/* 加载中 */
.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.loading-box {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px 36px;
  text-align: center;
  font-size: 15px;
  color: var(--brown);
  box-shadow: var(--shadow-lg);
}

.loading-box span:first-child {
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.78);
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-size: 14px;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  max-width: 80%;
  text-align: center;
  line-height: 1.5;
}

.toast.show {
  opacity: 1;
}

/* 免责声明 */
.disclaimer {
  margin: 16px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fff8e1, #fff3e0);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--orange);
  font-size: 12px;
  color: var(--brown);
  line-height: 1.7;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--brown-light);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* 文本工具类 */
.text-primary { color: var(--green); }
.text-secondary { color: var(--brown-light); }
.text-center { text-align: center; }
.text-bold { font-weight: bold; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }

.detail-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--brown);
}

.intro-text {
  font-size: 13px;
  color: var(--brown-light);
  line-height: 1.7;
  margin-bottom: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--cream-light), var(--cream));
  border-radius: var(--radius-md);
  border-left: 3px solid var(--green-light);
}

/* VIP标识 */
.vip-badge {
  display: inline-block;
  padding: 2px 10px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #fff;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  margin-left: 8px;
  box-shadow: 0 1px 4px rgba(255,165,0,0.3);
}

/* 响应式 */
@media (min-width: 750px) {
  #app {
    border-left: 1px solid #e0d5c0;
    border-right: 1px solid #e0d5c0;
    box-shadow: 0 0 30px rgba(0,0,0,0.06);
  }
}

/* 页面过渡动画 */
.page {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 卡片入场动画 */
.card {
  animation: cardIn 0.35s ease backwards;
}

.card:nth-child(1) { animation-delay: 0.02s; }
.card:nth-child(2) { animation-delay: 0.06s; }
.card:nth-child(3) { animation-delay: 0.10s; }
.card:nth-child(4) { animation-delay: 0.14s; }
.card:nth-child(5) { animation-delay: 0.18s; }
.card:nth-child(6) { animation-delay: 0.22s; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
