/* 全局样式变量 */
:root {
  --primary: #ff6b6b;
  --primary-light: #ff8e8e;
  --primary-dark: #e55a5a;
  --secondary: #4ecdc4;
  --dark: #333;
  --gray: #666;
  --light-gray: #f5f5f5;
  --white: #fff;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
}

/* 基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: linear-gradient(135deg, #fff5f5 0%, #fff0f0 100%);
  color: var(--dark);
  line-height: 1.6;
  padding-bottom: 80px;
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Header Styles */
header {
  background: var(--white);
  padding: 15px 0 10px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--card-shadow);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.logo fa-icon {
  font-size: 22px;
}

.user-actions {
  display: flex;
  gap: 15px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--light-gray);
  color: var(--gray);
  font-size: 16px;
  border: none;
  cursor: pointer;
}

/* Main Content */
.cart-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 15px;
}

.section-title {
  display: flex;
  align-items: center;
  margin: 0 0 15px;
  position: relative;
  padding-left: 12px;
  font-size: 18px;
  color: var(--dark);
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 16px;
  background: var(--primary);
  border-radius: 2px;
}

/* Shared Card Styles */
.cart-card,
.nutrition-container,
.budget-container,
.suggestion-container,
.history-container,
.summary-container {
  background: var(--white);
  border-radius: 15px;
  box-shadow: var(--card-shadow);
  padding: 20px;
}

/* Nutrition Chart */
.nutrition-status {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 10px;
}

.status-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.status-value {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary);
}

.status-label {
  font-size: 12px;
  color: var(--gray);
}

/* Order Summary */
.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  font-size: 18px;
  padding: 15px 0;
  color: var(--primary);
}

.primary {
  color: var(--primary);
}

.checkout-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  border: none;
  border-radius: 30px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 15px rgba(255, 107, 107, 0.4);
  transition: var(--transition);
  margin-top: 10px;
}

.checkout-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(255, 107, 107, 0.6);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--white);
  display: flex;
  border-top: 1px solid #eee;
  z-index: 100;
}

.nav-item {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  color: var(--gray);
  font-size: 12px;
  position: relative;
}

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

.nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 3px;
  background: var(--primary);
  border-radius: 3px;
}

.nav-item fa-icon {
  font-size: 20px;
  margin-bottom: 4px;
}

/* Responsive */
@media (max-width: 480px) {
  .history-grid {
    grid-template-columns: 1fr;
  }
}