/* ===== 全局重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { 
  width: 100%; height: 100%; 
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f5f5f5; color: #333; font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ===== 页面容器 ===== */
#app { width: 100%; min-height: 100vh; padding-bottom: 60px; }
.page { display: none; width: 100%; min-height: calc(100vh - 60px); }
.page.active { display: block; }

/* ===== TabBar ===== */
#tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; height: 56px;
  background: #fff; display: flex; border-top: 1px solid #eee;
  z-index: 100;
}
#tabbar .tab-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #7a7e83; font-size: 10px; cursor: pointer;
  transition: color 0.2s;
}
#tabbar .tab-item.active { color: #d4af37; }
#tabbar .tab-item .tab-icon { font-size: 22px; margin-bottom: 2px; }
#tabbar .tab-item .tab-label { font-size: 11px; }

/* 非 Tab 页面隐藏 tabbar */
body.hide-tabbar #tabbar { display: none; }
body.hide-tabbar #app { padding-bottom: 0; }

/* ===== Toast ===== */
.toast {
  position: fixed; top: 40%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75); color: #fff; padding: 12px 24px;
  border-radius: 8px; font-size: 14px; z-index: 9999;
  transition: opacity 0.3s; pointer-events: none;
  max-width: 80%; text-align: center;
}
.toast.hidden { opacity: 0; }

/* ===== 通用组件 ===== */
.btn-primary {
  width: 100%; padding: 14px 0; border: none; border-radius: 25px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff; font-size: 16px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 12px rgba(102,126,234,0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary:active { transform: scale(0.97); box-shadow: 0 2px 6px rgba(102,126,234,0.2); }
.btn-primary:disabled { background: #e0e0e0; color: #999; box-shadow: none; }

.btn-gold {
  padding: 12px 0; border: none; border-radius: 25px;
  background: linear-gradient(135deg, #d4af37 0%, #f7d774 100%);
  color: #8b4513; font-size: 15px; font-weight: bold; cursor: pointer;
  box-shadow: 0 3px 8px rgba(212,175,55,0.4);
}
.btn-gold:active { transform: scale(0.97); }
.btn-gold:disabled { background: #e0e0e0; color: #999; box-shadow: none; }

.section-card {
  background: #fff; padding: 16px; margin: 10px 15px;
  border-radius: 12px; box-shadow: 0 1px 5px rgba(0,0,0,0.03);
}
.section-header {
  display: flex; align-items: center; margin-bottom: 14px;
}
.section-mark {
  width: 4px; height: 16px; background: #667eea;
  border-radius: 2px; margin-right: 8px;
}
.section-title { font-size: 16px; font-weight: 600; color: #1a1a2e; }
.section-subtitle { font-size: 12px; color: #999; margin-left: 8px; }

/* ===== 弹窗遮罩 ===== */
.modal-mask {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal-mask.hidden { display: none; }
.modal-box {
  width: 85%; max-width: 340px; background: #fff;
  border-radius: 12px; overflow: hidden; padding-top: 20px;
}
.modal-title {
  font-size: 17px; font-weight: 700; color: #333; text-align: center;
  margin-bottom: 16px;
}
.modal-body { padding: 0 20px; max-height: 50vh; overflow-y: auto; }
.modal-section-title { font-size: 14px; font-weight: 600; color: #333; margin: 10px 0 5px; }
.modal-text { font-size: 13px; color: #666; line-height: 1.6; text-align: justify; }
.modal-buttons {
  display: flex; border-top: 1px solid #eee; margin-top: 16px;
}
.modal-buttons button {
  flex: 1; padding: 14px 0; border: none; font-size: 15px; cursor: pointer;
}
.modal-buttons .btn-cancel { background: #fff; color: #999; }
.modal-buttons .btn-confirm { background: #1a1a2e; color: #fff; }

/* ===== 加载动画 ===== */
.spinner {
  width: 40px; height: 40px; margin: 0 auto 16px;
  border: 3px solid #e0e0e0; border-top-color: #667eea;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 标签 ===== */
.tags-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-item {
  padding: 5px 12px; background: #f0f0f0; border-radius: 15px;
  font-size: 12px; color: #666; cursor: pointer; transition: all 0.2s;
}
.tag-item.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}
