/* 使用:host代替:root */
:host {
  --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;
}

/* 组件容器样式 */
:host {
  display: block;
  background: linear-gradient(135deg, #fff5f5 0%, #fff0f0 100%);
  color: var(--dark);
  line-height: 1.6;
  padding-bottom: 80px;
  min-height: 100vh;
}

.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 i {
  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;
  transition: var(--transition);
  
  &:hover {
    background: var(--primary-light);
    color: var(--white);
    transform: scale(1.05);
  }
}

/* User Profile */
.profile-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 15px 15px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 0 0 30px 30px;
  margin-bottom: 20px;
  color: var(--white);
  position: relative;
  overflow: hidden;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0 0 50% 50%;
  }
}

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--white);
  background: linear-gradient(45deg, #ff9a9e, #fad0c4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--white);
  margin-bottom: 15px;
  z-index: 1;
  position: relative;
}

.user-name {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 5px;
  z-index: 1;
}

.user-level {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 15px;
  border-radius: 20px;
  font-size: 13px;
  margin-bottom: 15px;
  z-index: 1;
}

.stats-container {
  display: flex;
  justify-content: space-around;
  width: 100%;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 15px;
  padding: 15px;
  margin-top: 10px;
  z-index: 1;
}

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

.stat-value {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 12px;
  opacity: 0.9;
}

/* Health Profile */
.health-section {
  background: var(--white);
  border-radius: 15px;
  box-shadow: var(--card-shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
  padding-left: 12px;
  
  h2 {
    font-size: 18px;
    color: var(--dark);
  }
  
  h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
  }
}

.section-title .edit-btn {
  color: var(--primary);
  font-size: 14px;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: var(--transition);
  
  &:hover {
    color: var(--primary-dark);
    transform: translateY(-2px);
  }
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.health-card {
  background: var(--light-gray);
  border-radius: 12px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: var(--transition);
  cursor: pointer;
  
  &:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow);
  }
}

.health-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 18px;
  margin-bottom: 10px;
  transition: var(--transition);
  
  &.active {
    background: var(--primary) !important;
    color: var(--white) !important;
  }
}

.health-title {
  font-weight: 600;
  margin-bottom: 8px;
  text-align: center;
}

.health-content {
  font-size: 13px;
  color: var(--gray);
  text-align: center;
  min-height: 36px;
}

/* Order Analysis */
.analysis-section {
  background: var(--white);
  border-radius: 15px;
  box-shadow: var(--card-shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.chart-container {
  width: 100%;
  height: 200px;
  margin-top: 15px;
  position: relative;
}

.analysis-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
  text-align: center;
}

.analysis-stat {
  padding: 10px;
  background: var(--light-gray);
  border-radius: 10px;
  transition: var(--transition);
  
  &:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow);
  }
}

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

.analysis-label {
  font-size: 12px;
  color: var(--gray);
  margin-top: 4px;
}

/* Membership Section */
.membership-section {
  background: var(--white);
  border-radius: 15px;
  box-shadow: var(--card-shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.vip-card {
  background: linear-gradient(135deg, #ffd700, #ffa500);
  border-radius: 15px;
  padding: 20px;
  color: #6e4800;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  
  &::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
  }
}

.vip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.vip-title {
  font-weight: bold;
  font-size: 18px;
}

.vip-icon {
  font-size: 24px;
}

.vip-level {
  font-size: 14px;
  margin-bottom: 20px;
}

.progress-container {
  height: 10px;
  background: rgba(110, 72, 0, 0.2);
  border-radius: 10px;
  overflow: hidden;
  margin: 15px 0;
}

.progress-bar {
  height: 100%;
  background: rgba(110, 72, 0, 0.8);
  border-radius: 10px;
  width: 0;
  transition: width 1s ease-in-out;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-top: 5px;
}

.benefits-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--light-gray);
  padding: 10px;
  border-radius: 10px;
  font-size: 14px;
  transition: var(--transition);
  
  &:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow);
  }
}

.benefit-icon {
  width: 30px;
  height: 30px;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

/* Function Grid */
.function-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin: 20px 0;
}

.function-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px 5px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  cursor: pointer;
  
  &:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  }
}

.function-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 18px;
  transition: var(--transition);
  
  &.active {
    background: var(--primary) !important;
    color: var(--white) !important;
  }
}

.function-text {
  font-size: 12px;
  color: var(--gray);
}

.vip-card {
  animation: pulse 3s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 480px) {
  .health-grid {
    grid-template-columns: 1fr;
  }
  
  .benefits-container {
    grid-template-columns: 1fr;
  }
  
  .function-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 科技感增强效果 */
.profile-container {
  position: relative;
  overflow: hidden;
  
  &::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 0;
    right: 0;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20' preserveAspectRatio='none'%3E%3Cpath d='M0,0 L100,0 L100,20 L0,20 Z' fill='white'/%3E%3C/svg%3E");
    background-size: 100% 100%;
    opacity: 0.1;
  }
}

.health-card, .analysis-stat, .benefit-item {
  position: relative;
  overflow: hidden;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255,255,255,0.1), transparent);
    pointer-events: none;
  }
}

.section-title h2 {
  position: relative;
  padding-left: 15px;
  
  &::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 30px;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
  }
  
  &:hover::after {
    width: 50px;
  }
}