/* 能量自留地 - 全局样式 */
:root {
  --color-primary: #4A90D9;
  --color-warm: #FFF8E7;
  --color-warm-accent: #F5A623;
  --color-light-blue: #E8F4FD;
  --color-light-blue-accent: #5DADE2;
  --color-gray: #F5F5F5;
  --color-gray-accent: #95A5A6;
  --color-dark-blue: #2C3E50;
  --color-dark-blue-accent: #34495E;
  --color-text: #333;
  --color-text-secondary: #666;
  --color-text-light: #999;
  --color-bg: #FAFAFA;
  --color-white: #fff;
  --color-border: #E8E8E8;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --tab-height: 60px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  overflow: hidden;
}

#app {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

#page-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--tab-height) + var(--safe-bottom));
}

/* 底部导航 */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--tab-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}

.tab-bar.hidden {
  display: none;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 16px;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: var(--radius-sm);
}

.tab-item.active {
  color: var(--color-primary);
}

.tab-item .tab-icon {
  font-size: 22px;
  margin-bottom: 2px;
}

.tab-item .tab-label {
  font-size: 11px;
  color: var(--color-text-light);
}

.tab-item.active .tab-label {
  color: var(--color-primary);
  font-weight: 500;
}

/* 页面通用 */
.page {
  min-height: 100%;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

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

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

/* 通用按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-xl);
  font-size: 15px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

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

.btn-primary:active {
  transform: scale(0.96);
  opacity: 0.9;
}

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

.btn-outline:active {
  background: var(--color-gray);
}

.btn-block {
  display: flex;
  width: 100%;
}

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  background: var(--color-gray);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.tag:active {
  transform: scale(0.95);
}

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

/* 卡片 */
.card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

/* 返回按钮 */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  font-size: 15px;
  color: var(--color-text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  margin-bottom: 12px;
}

.back-btn:active {
  opacity: 0.6;
}
