/* 全局样式 */
* {
  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-color: #f5f5f5;
  color: #333;
  -webkit-tap-highlight-color: transparent;
}

.page {
  min-height: 100vh;
  padding-bottom: 60px;
}

/* 登录页面 */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-logo {
  text-align: center;
  color: white;
  margin-bottom: 60px;
}

.login-logo h1 {
  font-size: 32px;
  margin-bottom: 10px;
}

.login-logo p {
  font-size: 16px;
  opacity: 0.9;
}

.btn-wechat {
  width: 100%;
  max-width: 240px;
  padding: 12px 24px;
  background: #07c160;
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.btn-wechat:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.login-form {
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0 auto;
}

.login-tip {
  color: white;
  font-size: 11px;
  text-align: center;
  opacity: 0.85;
  line-height: 1.6;
  max-width: 240px;
}

/* 头部 */
.header {
  background: white;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header h2 {
  font-size: 18px;
  font-weight: 500;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.user-info span {
  font-size: 14px;
}

#bed-info {
  color: #666;
  font-size: 12px;
}

/* 餐段选择 */
.meal-type-selector {
  display: flex;
  background: white;
  padding: 10px;
  gap: 10px;
  margin-bottom: 10px;
}

.meal-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.meal-tab span {
  font-size: 14px;
  color: #666;
}

.meal-tab.active {
  background: #667eea;
}

.meal-tab.active span {
  color: white;
}

/* 日期选择 */
.date-selector {
  display: flex;
  background: white;
  padding: 10px;
  gap: 10px;
  margin-bottom: 10px;
}

.date-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.date-tab span {
  font-size: 14px;
  color: #666;
}

.date-tab.active {
  background: #667eea;
}

.date-tab.active span {
  color: white;
}

/* 菜品列表 */
.dish-list {
  padding: 10px;
}

.dish-item {
  background: white;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 10px;
  display: flex;
  gap: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dish-image {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  background: #f0f0f0;
  overflow: hidden;
}

.dish-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dish-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dish-name {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 5px;
}

.dish-desc {
  font-size: 12px;
  color: #999;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dish-tags {
  display: flex;
  gap: 5px;
  margin-bottom: 5px;
}

.dish-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f0f0f0;
  color: #666;
}

.dish-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.price {
  color: #ff6b6b;
  font-size: 18px;
  font-weight: 600;
}

.btn-add {
  padding: 6px 15px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
}

.btn-add:active {
  transform: scale(0.95);
}

/* 购物车 */
.cart-list {
  padding: 10px;
}

.cart-item {
  background: white;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 10px;
  display: flex;
  gap: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 5px;
}

.cart-item-price {
  color: #ff6b6b;
  font-size: 16px;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-qty {
  width: 30px;
  height: 30px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty {
  font-size: 16px;
  min-width: 30px;
  text-align: center;
}

.cart-footer {
  position: fixed;
  bottom: 60px;
  left: 0;
  right: 0;
  background: white;
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.cart-total {
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-submit {
  padding: 10px 30px;
  background: #07c160;
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}

/* 订单列表 */
.order-list {
  padding: 10px;
}

.order-item {
  background: white;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

.order-no {
  font-size: 14px;
  color: #666;
}

.order-status {
  font-size: 14px;
  color: #07c160;
  font-weight: 500;
}

.order-status.pending {
  color: #ff9800;
}

.order-status.cancelled {
  color: #f44336;
}

.order-items {
  margin-bottom: 10px;
}

.order-item-name {
  font-size: 14px;
  color: #333;
  margin-bottom: 5px;
}

.order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

.order-total {
  font-size: 16px;
}

.order-total .price {
  font-size: 18px;
  font-weight: 600;
}

.order-actions {
  display: flex;
  gap: 10px;
}

.btn-order {
  padding: 6px 15px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
}

.btn-order.primary {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

/* 个人中心 */
.profile-info {
  background: white;
  padding: 20px;
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 10px;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: #f0f0f0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-details h3 {
  font-size: 18px;
  margin-bottom: 5px;
}

.user-details p {
  font-size: 14px;
  color: #666;
  margin-bottom: 3px;
}

.profile-menu {
  background: white;
  margin-top: 10px;
}

.menu-item {
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item span:first-child {
  font-size: 16px;
}

.menu-item span:last-child {
  font-size: 14px;
  color: #999;
}

/* 底部导航 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  display: flex;
  padding: 10px 0;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  position: relative;
  color: #999;
}

.nav-item.active {
  color: #667eea;
}

.nav-item .icon {
  font-size: 24px;
}

.nav-item span {
  font-size: 12px;
}

.badge {
  position: absolute;
  top: -5px;
  right: 20px;
  background: #ff6b6b;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

/* 加载提示 */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* 空状态 */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

.empty .icon {
  font-size: 48px;
  margin-bottom: 10px;
}

.empty p {
  font-size: 14px;
}
