/* profile.css */
:root {
  --primary-color: #1E90FF;
  --secondary-color: #FFA500;
  --bg-color: #F8F9FA;
  --text-color: #333;
  --text-light: #666;
  --border-color: #E0E0E0;
  --card-bg: #FFF;
  --success-color: #28A745;
  --warning-color: #FFC107;
  --danger-color: #DC3545;
  --info-color: #17A2B8;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.08);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

.profile-container {
  display: flex;
  max-width: 1200px;
  margin: 20px auto;
  gap: 20px;
  padding: 0 20px;
}

.profile-sidebar {
  flex: 0 0 280px;
}

.user-card {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  margin-bottom: 20px;
}

.avatar-container {
  position: relative;
  margin: 0 auto 15px;
  width: 120px;
  height: 120px;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-color);
}

.edit-avatar-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 32px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.edit-avatar-btn:hover {
  background-color: #1a7fd9;
}

.username {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--text-color);
}

.token-balance {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #F0F8FF;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 15px;
}

.token-balance i {
  color: var(--secondary-color);
}

.buy-token-btn {
  background-color: var(--secondary-color);
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.buy-token-btn:hover {
  background-color: #e69500;
}

.profile-nav {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 10px 0;
}

.profile-nav ul {
  list-style: none;
}

.profile-nav li {
  margin-bottom: 2px;
}

.profile-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: var(--text-color);
  text-decoration: none;
  transition: var(--transition);
}

.profile-nav a:hover, .profile-nav li.active a {
  background-color: rgba(30, 144, 255, 0.1);
  color: var(--primary-color);
}

.profile-nav i {
  font-size: 1.1rem;
}

.profile-content {
  flex: 1;
}

.profile-section {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 20px;
  display: none;
}

.profile-section.active {
  display: block;
}

.profile-section h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary-color);
}

.profile-form {
  max-width: 600px;
}

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

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group input:focus, .form-group textarea:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(30, 144, 255, 0.2);
}

.save-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.save-btn:hover {
  background-color: #1a7fd9;
}

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

.view-all {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.view-all:hover {
  text-decoration: underline;
}

.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.material-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.material-card:hover {
  box-shadow: var(--shadow-md);
}

.material-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.material-info {
  padding: 15px;
}

.material-info h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.meta {
  display: flex;
  gap: 15px;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.meta i {
  margin-right: 3px;
}

.actions {
  display: flex;
  gap: 8px;
}

.edit-btn, .delete-btn {
  flex: 1;
  padding: 6px 10px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.edit-btn {
  background-color: #E9ECEF;
  color: var(--text-color);
}

.edit-btn:hover {
  background-color: #DEE2E6;
}

.delete-btn {
  background-color: #F8D7DA;
  color: var(--danger-color);
}

.delete-btn:hover {
  background-color: #F1B0B7;
}

.upload-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.upload-btn:hover {
  background-color: #1a7fd9;
}

.task-tabs {
  display: flex;
  gap: 5px;
  background-color: #E9ECEF;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.tab-btn {
  padding: 6px 12px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn.active {
  background-color: white;
  box-shadow: var(--shadow-sm);
}

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

.task-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 15px;
  position: relative;
  transition: var(--transition);
}

.task-card:hover {
  box-shadow: var(--shadow-sm);
}

.task-status {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
}

.task-status.in-progress {
  background-color: #FFF3CD;
  color: #856404;
}

.task-status.completed {
  background-color: #D4EDDA;
  color: #155724;
}

.task-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  padding-right: 80px;
}

.task-desc {
  color: var(--text-light);
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.task-meta {
  display: flex;
  gap: 15px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.task-meta i {
  margin-right: 3px;
}

.task-actions {
  display: flex;
  gap: 8px;
}

.submit-btn, .detail-btn, .view-btn {
  flex: 1;
  padding: 6px 10px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.submit-btn {
  background-color: var(--primary-color);
  color: white;
}

.submit-btn:hover {
  background-color: #1a7fd9;
}

.detail-btn, .view-btn {
  background-color: #E9ECEF;
  color: var(--text-color);
}

.detail-btn:hover, .view-btn:hover {
  background-color: #DEE2E6;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.setting-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 15px;
}

.setting-card h3 {
  font-size: 1.1rem;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.change-pwd-btn, .two-factor-btn {
  display: block;
  width: 100%;
  padding: 8px;
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
  background-color: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.change-pwd-btn:hover, .two-factor-btn:hover {
  background-color: #F8F9FA;
}

.toggle-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.theme-options {
  display: flex;
  gap: 10px;
}

.theme-option {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border-color);
  background-color: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.theme-option.active {
  border-color: var(--primary-color);
  background-color: #F0F8FF;
}

.theme-option.light {
  background-color: #F8F9FA;
}

.theme-option.dark {
  background-color: #343A40;
  color: white;
}

@media (max-width: 768px) {
  .profile-container {
    flex-direction: column;
  }
  
  .profile-sidebar {
    flex: 1;
  }
  
  .materials-grid {
    grid-template-columns: 1fr;
  }
}