/**
 * 我的页面样式 - profile.html
 * 🎯 大师级极简设计 - 融合所有目标元素
 */

/* 导航栏样式 */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: none; /* 默认隐藏，PC端显示 */
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.navbar-brand {
  display: flex;
  align-items: center;
}

.logo {
  width: 32px;
  height: 32px;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
  border-radius: 8px;
}

.logo-icon {
  font-size: 16px;
}

.brand-title {
  font-size: 24px;
  font-weight: 800;
  color: #1C1C1E;
}

.navbar-menu {
  display: flex;
  flex: 1;
  justify-content: center;
  margin: 0 40px;
  gap: 120px;
}

.nav-menu-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  color: #666;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.nav-menu-item:hover {
  background: rgba(255, 107, 53, 0.1);
  color: #FF6B35;
  text-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
}

.nav-menu-item.active {
  background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
  color: white;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-icon {
  display: none;
}

.nav-text {
  font-size: 15px;
}

.navbar-auth {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.simple-login-btn {
  background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
  border-radius: 25px;
  box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
  transition: all 0.3s ease;
  width: 65px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.simple-login-btn:active {
  transform: scale(0.95);
  box-shadow: 0 1px 4px rgba(255, 107, 53, 0.4);
}

.login-btn-text {
  color: white;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.user-menu {
  display: flex;
  align-items: center;
}

.user-menu .user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 8px;
}

.username {
  font-size: 14px;
  color: #1C1C1E;
  font-weight: 600;
}

.hidden {
  display: none !important;
}

.container {
  background: #F5F5F7;
  min-height: 100vh;
  padding: 16px;
  padding-bottom: 80px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', Helvetica, Arial, sans-serif;
}

/* 🎨 用户信息卡片 - 白色卡片设计 */
.user-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: 0.5px solid #E5E5EA;
}

.user-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  position: relative;
}

/* 🎯 头像容器 - 保持不变 */
.avatar-container {
  position: relative;
  display: inline-block;
  margin-right: 12px;
}

.user-avatar {
  width: 50px;
  height: 50px;
  border-radius: 25px;
  border: 1.5px solid #F2F2F7;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.user-avatar:active {
  transform: scale(0.95);
}

/* 🎯 更换头像按钮 - 保持不变 */
.change-avatar-btn {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #007AFF;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  padding: 0;
}

.change-avatar-btn:active {
  transform: scale(0.9);
}

.user-info {
  flex: 1;
}

.user-name {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #1D1D1F;
  margin-bottom: 4px;
}

.user-status {
  font-size: 12px;
  color: #86868B;
  background: #F2F2F7;
  padding: 3px 6px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 4px;
}

/* 🔧 新增：已获得成就样式 */
.user-achievements {
  font-size: 11px;
  color: #34C759;
  margin-top: 4px;
  font-weight: 500;
  display: block;
}

/* 🎮 等级展示 - 蓝色渐变突出 */
.level-display {
  text-align: center;
  margin-bottom: 16px;
  padding: 12px;
  background: linear-gradient(135deg, #007AFF 0%, #5AC8FA 100%);
  border-radius: 10px;
  color: white;
}

.level-title {
  display: block;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.level-achievement {
  font-size: 14px;
  opacity: 0.9;
  font-weight: 600;
}

/* 📊 经验值进度 - 清晰显示280/300 */
.progress-section {
  background: #F8F9FA;
  padding: 12px;
  border-radius: 8px;
}

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

.progress-label {
  font-size: 14px;
  font-weight: 600;
  color: #1D1D1F;
}

.progress-value {
  font-size: 14px;
  font-weight: 700;
  color: #007AFF;
}

.progress-bar {
  height: 4px;
  background: #E5E5EA;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #007AFF 0%, #5AC8FA 100%);
  border-radius: 2px;
  transition: width 0.8s ease;
}

.next-level {
  font-size: 12px;
  color: #86868B;
  text-align: center;
}


/* 🏆 成就徽章卡片 - 白色卡片设计 */
.achievement-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: 0.5px solid #E5E5EA;
}

.card-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: #1D1D1F;
  margin-bottom: 12px;
}

/* 成就徽章 - 绿色已解锁，灰色未解锁 */
.badges-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.badge {
  flex: 1;
  text-align: center;
  padding: 10px 6px;
  border-radius: 8px;
  border: 1px solid #E5E5EA;
  transition: all 0.3s ease;
}

.badge.unlocked {
  background: linear-gradient(135deg, #E8F5E8 0%, #F0FFF4 100%);
  border-color: #34C759;
  transform: translateY(-1px);
}

.badge.locked {
  background: #F8F9FA;
  opacity: 0.6;
}

.badge-icon {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.badge-name {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #1D1D1F;
  margin-bottom: 2px;
}

.badge.locked .badge-name {
  color: #86868B;
}

.badge-level {
  display: block;
  font-size: 9px;
  font-weight: 500;
  color: #007AFF;
}

.badge.locked .badge-level {
  color: #C7C7CC;
}

/* 🎁 下一个成就 - 金色闪光动画 */
.next-achievement {
  background: linear-gradient(135deg, #FFF8E1 0%, #FFFBF0 100%);
  border: 1px solid #FFD700;
  border-radius: 10px;
  padding: 12px;
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
}

.next-achievement::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
  animation: slide 3s ease-in-out infinite;
}

@keyframes slide {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: -100%; }
}

.next-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #1D1D1F;
  margin-bottom: 8px;
  position: relative;
  z-index: 2;
}

.next-info {
  position: relative;
  z-index: 2;
}

.next-badge {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #FF8C00;
  margin-bottom: 4px;
}

.next-progress {
  display: block;
  font-size: 12px;
  color: #86868B;
}

/* 🔧 立即分享按钮 */
.share-section {
  margin-top: 10px;
  text-align: center;
}

.share-btn {
  background: linear-gradient(135deg, #007AFF 0%, #5AC8FA 100%);
  color: white;
  border: none;
  border-radius: 5px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s ease;
}

.share-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

/* 📱 功能菜单卡片 - 白色卡片+蓝色渐变图标 */
.menu-card {
  background: #FFFFFF;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: 0.5px solid #E5E5EA;
  overflow: hidden;
}

.menu-card .card-title {
  padding: 12px 16px 0 16px;
  margin-bottom: 8px;
}

.menu-list {
  padding: 0;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.menu-item:active {
  background: #F8F9FA;
}

.menu-divider {
  height: 0.5px;
  background: #F2F2F7;
  margin: 0 16px;
}

/* 蓝色渐变图标 */
.menu-icon {
  font-size: 20px;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #007AFF 0%, #5AC8FA 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
}

.menu-content {
  flex: 1;
}

.menu-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #1D1D1F;
  margin-bottom: 3px;
}

.menu-desc {
  font-size: 12px;
  color: #86868B;
  line-height: 1.4;
}

.menu-arrow {
  font-size: 16px;
  color: #C7C7CC;
  font-weight: 300;
}

/* 🔧 协议链接区域 */
.agreement-links {
  margin-bottom: 12px;
}

.agreement-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.agreement-header {
  padding: 15px;
  background: linear-gradient(135deg, #34C759 0%, #30D158 100%);
}

.agreement-title {
  font-size: 16px;
  font-weight: 600;
  color: white;
}

.agreement-items {
  padding: 0;
}

.agreement-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  border-bottom: 0.5px solid #F2F2F7;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

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

.agreement-item:active {
  background: #F8F9FA;
}

.agreement-name {
  font-size: 15px;
  color: #1D1D1F;
  font-weight: 500;
}

.agreement-arrow {
  font-size: 14px;
  color: #86868B;
  font-weight: 600;
}

/* 退出登录 - 极简设计 */
.logout-section {
  margin-top: 16px;
  padding: 0;
}

.logout-btn {
  width: 100%;
  background: #FFFFFF;
  color: #FF3B30;
  border: 1px solid #FF3B30;
  border-radius: 12px;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(255, 59, 48, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.logout-btn:active {
  background: #FF3B30;
  color: white;
  transform: scale(0.98);
  box-shadow: 0 4px 16px rgba(255, 59, 48, 0.3);
}

/* 响应式适配 - 大师级极简设计 */
@media (max-width: 750px) {
  .container {
    padding: 12px;
    padding-bottom: 80px;
  }

  .user-card,
  .achievement-card,
  .menu-card {
    padding: 12px;
  }

  .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    margin-right: 10px;
  }

  .user-name {
    font-size: 16px;
  }

  .level-title {
    font-size: 18px;
  }

  .level-achievement {
    font-size: 12px;
  }

  .card-title {
    font-size: 14px;
  }

  .badges-row {
    gap: 6px;
  }

  .badge {
    padding: 8px 4px;
  }

  .badge-icon {
    font-size: 14px;
  }

  .badge-name {
    font-size: 10px;
  }

  .menu-item {
    padding: 10px 12px;
  }

  .menu-icon {
    width: 32px;
    height: 32px;
    font-size: 18px;
    border-radius: 8px;
    margin-right: 10px;
  }

  .menu-title {
    font-size: 14px;
  }

  .menu-desc {
    font-size: 11px;
  }

  .logout-btn {
    padding: 14px;
    font-size: 14px;
  }
}

/* PC端响应式样式 - 屏幕宽度 >= 1100px */
@media (min-width: 1100px) {
  body {
    background-color: #e5e5ea;
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }

  .container {
    width: 1200px;
    max-width: 1200px;
    margin: 0 auto;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
    background-color: #F5F5F7;
    padding: 0;
    padding-bottom: 0;
    box-sizing: border-box;
    overflow: hidden;
  }

  /* 导航栏在container内，不需要额外padding */
  .navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    margin: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }

  /* 给内容区域添加padding */
  .user-card,
  .achievement-card,
  .menu-card,
  .share-card,
  .logout-section {
    margin-left: 16px;
    margin-right: 16px;
  }

  .user-card {
    margin-top: 16px;
  }

  .logout-section {
    margin-bottom: 16px;
  }

  /* 显示顶部导航栏 */
  .navbar {
    display: flex !important;
  }

  /* 隐藏导航栏登录按钮 */
  .navbar-auth {
    display: none !important;
  }

  /* 隐藏底部导航栏 */
  .tabbar {
    display: none !important;
  }
}

/* 移动端响应式样式 - 屏幕宽度 < 1100px */
@media (max-width: 1099px) {
  /* 隐藏顶部导航栏 */
  .navbar {
    display: none !important;
  }

  /* 显示底部导航栏 */
  .tabbar {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    transform: none !important;
  }

  /* 确保container有底部padding，避免内容被导航栏遮挡 */
  .container {
    padding-bottom: 70px;
  }
}

/* 修改密码弹窗样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.3s;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.close {
  font-size: 28px;
  font-weight: 300;
  color: #999;
  cursor: pointer;
  line-height: 1;
}

.close:hover {
  color: #333;
}

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.form-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: #667eea;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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