/* ==================== 个人中心样式 ==================== */

.user-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  margin: 30px auto;
  max-width: 1200px;
}

/* ==================== 侧边栏 ==================== */

.user-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.user-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-align: center;
}

.user-avatar {
  font-size: 60px;
  margin-bottom: 15px;
}

.user-card h2 {
  margin: 10px 0;
  color: var(--text-color);
  font-size: 20px;
}

.user-card p {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 20px;
}

.user-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

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

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

.stat-label {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 5px;
}

/* ==================== 菜单 ==================== */

.user-menu {
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.menu-item {
  display: block;
  padding: 15px 20px;
  color: var(--text-color);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.3s;
  border-bottom: 1px solid var(--border-color);
}

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

.menu-item:hover {
  background: var(--bg-light);
  border-left-color: var(--primary-color);
}

.menu-item.active {
  background: var(--primary-color);
  color: white;
  border-left-color: var(--primary-color);
}

/* ==================== 主内容区 ==================== */

.user-main {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

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

.page-section h2 {
  margin-bottom: 20px;
  color: var(--text-color);
  font-size: 24px;
}

/* ==================== 下载历史 ==================== */

.history-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: var(--bg-light);
  border-radius: 4px;
  border-left: 3px solid var(--primary-color);
}

.history-info h3 {
  margin: 0 0 5px 0;
  color: var(--text-color);
}

.history-info p {
  margin: 0;
  font-size: 12px;
  color: var(--text-light);
}

.history-time {
  font-size: 12px;
  color: var(--text-light);
}

/* ==================== 收藏列表 ==================== */

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.favorite-card {
  background: var(--bg-light);
  padding: 15px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  transition: all 0.3s;
}

.favorite-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.favorite-card h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: var(--text-color);
}

.favorite-card p {
  margin: 0 0 12px 0;
  font-size: 12px;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 3px 6px;
  border-radius: 3px;
  font-size: 11px;
}

/* ==================== 表单 ==================== */

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 500px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 500;
  color: var(--text-color);
}

.form-group input {
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
}

.form-group input:disabled {
  background: var(--bg-light);
  cursor: not-allowed;
}

.form-group input:not(:disabled):focus {
  outline: none;
  border-color: var(--primary-color);
}

/* ==================== 空状态 ==================== */

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
  font-size: 14px;
}

/* ==================== 响应式设计 ==================== */

@media (max-width: 768px) {
  .user-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .user-sidebar {
    order: 2;
  }

  .user-main {
    order: 1;
  }

  .favorites-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .user-stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .user-container {
    margin: 15px auto;
  }

  .user-main {
    padding: 15px;
  }

  .page-section h2 {
    font-size: 18px;
  }

  .favorites-grid {
    grid-template-columns: 1fr;
  }

  .profile-form {
    max-width: 100%;
  }
}
