/* ==========================================
   个人中心页面样式 - 完整版
   ========================================== */

/* 骨架屏 */
.skeleton-screen {
  min-height: calc(100vh - 80px - 350px);
  padding: 100px 0 60px;
  background: var(--bg-color);
  filter: blur(8px);
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
}

.skeleton-card,
.skeleton-nav,
.skeleton-stat-card,
.skeleton-section {
  background-color: var(--white);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.skeleton-card {
  padding: 30px 20px;
  text-align: center;
  margin-bottom: 20px;
}

.skeleton-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  margin: 0 auto 16px;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 16px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}

.skeleton-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding-top: 20px;
  border-top: 1px solid #E8EAED;
}

.skeleton-stat {
  height: 50px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 8px;
}

.skeleton-nav {
  padding: 10px;
}

.skeleton-nav-item {
  height: 48px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 8px;
  margin-bottom: 8px;
}

.skeleton-nav-item:last-child {
  margin-bottom: 0;
}

.skeleton-header {
  height: 80px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 16px;
  margin-bottom: 30px;
}

.skeleton-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.skeleton-stat-card {
  height: 120px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

.skeleton-section {
  height: 300px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  padding: 30px;
}

/* 主体区域 */
.profile-main {
  min-height: calc(100vh - 80px - 350px);
  padding: 100px 0 60px;
  background: var(--bg-color);
}

.container-fluid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 布局 */
.profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ========== 左侧边栏 ========== */
.profile-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

/* 用户卡片 */
.user-card {
  background-color: var(--white);
  border-radius: 16px;
  padding: 30px 20px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.user-card-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-color);
  margin-bottom: 16px;
}

.user-card-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.user-card-username {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.user-card-stats {
  display: flex;
  justify-content: center;
  padding-top: 20px;
  border-top: 1px solid #E8EAED;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
  font-family: var(--font-family-number);
  margin-bottom: 6px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-light);
}

/* 侧边栏导航 */
.sidebar-nav {
  background-color: var(--white);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  color: var(--text-dark);
  font-size: 15px;
  font-weight: 500;
  transition: all var(--transition-base);
  margin-bottom: 4px;
}

.sidebar-nav .nav-item:last-child {
  margin-bottom: 0;
}

.sidebar-nav .nav-item i {
  width: 20px;
  font-size: 18px;
  color: var(--text-light);
}

.sidebar-nav .nav-item:hover {
  background-color: #FFF5F0;
  color: var(--primary-color);
}

.sidebar-nav .nav-item:hover i {
  color: var(--primary-color);
}

.sidebar-nav .nav-item.active {
  background: var(--gradient-primary);
  color: var(--white);
}

.sidebar-nav .nav-item.active i {
  color: var(--white);
}

/* ========== 右侧内容区 ========== */
.profile-content {
  min-height: 600px;
}

/* Tab面板 */
.tab-pane {
  display: none;
  animation: fadeInUp 0.4s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 内容标题 */
.content-header {
  margin-bottom: 30px;
}

.content-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.content-header p {
  font-size: 15px;
  color: var(--text-light);
}

/* ========== 概览页 ========== */

/* 快捷操作 */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
  background-color: var(--white);
  border: 2px solid #E8EAED;
  border-radius: 16px;
  cursor: pointer;
  transition: all var(--transition-base);
}

.quick-btn i {
  font-size: 32px;
  color: var(--primary-color);
}

.quick-btn span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
}

.quick-btn:hover {
  border-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(255, 107, 53, 0.15);
}

/* 数据统计卡片 */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background-color: var(--white);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon i {
  font-size: 24px;
  color: var(--white);
}

.stat-content {
  flex: 1;
}

.stat-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
  font-family: var(--font-family-number);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-title {
  font-size: 13px;
  color: var(--text-light);
}

/* 活动列表 */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.activity-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background-color: #F8F9FA;
  border-radius: var(--radius-md);
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon i {
  color: var(--white);
  font-size: 16px;
}

.activity-content {
  flex: 1;
}

.activity-text {
  font-size: 14px;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.activity-time {
  font-size: 12px;
  color: var(--text-light);
}

/* ========== 签到页 ========== */

.checkin-card {
  background-color: var(--white);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.checkin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 2px solid #E8EAED;
}

.checkin-info h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.checkin-info p {
  font-size: 15px;
  color: var(--text-light);
}

.checkin-info .highlight {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 18px;
}

.btn-checkin {
  padding: 0 32px;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--gradient-primary);
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-checkin:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 107, 53, 0.4);
}

.btn-checkin:disabled {
  background: #E8EAED;
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-checkin i {
  font-size: 20px;
}

/* 签到日历 */
.checkin-calendar {
  margin-bottom: 30px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.current-month {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
}

.btn-prev-month,
.btn-next-month {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #F8F9FA;
  border: none;
  border-radius: 50%;
  color: var(--text-dark);
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-prev-month:hover,
.btn-next-month:hover {
  background-color: var(--primary-color);
  color: var(--white);
}

.calendar-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  /* 🔥 關鍵修復：添加默認顏色和背景 */
  color: var(--text-dark);
  background-color: #F8F9FA;
}

/* 🔥 關鍵修復：星期標題不使用 aspect-ratio */
.calendar-day.header {
  /* 完全重置 aspect-ratio，讓它跟隨 grid */
  aspect-ratio: unset !important;
  height: 40px !important;
  min-height: 40px;
  max-height: 40px;
  /* 確保在正常文檔流中 */
  position: static !important;
  /* 樣式屬性 */
  color: var(--text-light);
  font-weight: 600;
  cursor: default;
  background-color: transparent;
}

.calendar-day.disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  background-color: #FAFAFA;
  opacity: 0.6;
}

.calendar-day.today {
  background-color: #FFF5F0;
  color: var(--primary-color);
  font-weight: 700;
}

.calendar-day.checked {
  background: var(--gradient-primary);
  color: var(--white);
  font-weight: 600;
}

.calendar-day.checked:hover {
  transform: scale(1.05);
}

/* 签到规则 */
.checkin-rules {
  background-color: #F8F9FA;
  padding: 24px;
  border-radius: var(--radius-md);
}

.checkin-rules h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.checkin-rules ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.checkin-rules li {
  padding: 10px 0;
  color: var(--text-dark);
  font-size: 14px;
  line-height: 1.6;
}

.checkin-rules li strong {
  color: var(--primary-color);
}

/* ========== 积分页 ========== */

.points-overview {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
  margin-bottom: 30px;
}

.points-total {
  background: var(--gradient-primary);
  padding: 40px 30px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 8px 20px rgba(255, 107, 53, 0.2);
}

.points-icon {
  width: 60px;
  height: 60px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.points-icon i {
  font-size: 30px;
  color: var(--white);
}

.points-number {
  font-size: 48px;
  font-weight: 700;
  color: var(--white);
  font-family: var(--font-family-number);
  line-height: 1;
  margin-bottom: 8px;
}

.points-label {
  font-size: 16px;
  color: var(--white);
  opacity: 0.9;
}

.points-stats {
  background-color: var(--white);
  padding: 30px;
  border-radius: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.points-stat-item {
  text-align: center;
  padding: 20px;
  border-radius: var(--radius-md);
  background-color: #F8F9FA;
}

.points-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent-color);
  font-family: var(--font-family-number);
  margin-bottom: 8px;
}

.points-stat-label {
  font-size: 14px;
  color: var(--text-light);
}

/* 积分记录 */
.points-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.points-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background-color: #F8F9FA;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.points-item:hover {
  background-color: #FFF5F0;
}

.points-item-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.points-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.points-item-icon i {
  color: var(--white);
  font-size: 16px;
}

.points-item-text h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.points-item-text p {
  font-size: 13px;
  color: var(--text-light);
}

.points-item-value {
  text-align: right;
}

.points-change {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-family-number);
  margin-bottom: 4px;
}

.points-change.positive {
  color: #00D4AA;
}

.points-change.negative {
  color: #E53E3E;
}

/* ========== 个人信息页 ========== */

.info-card {
  background-color: var(--white);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.avatar-section {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 2px solid #E8EAED;
}

.edit-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary-color);
  margin-bottom: 20px;
}

.btn-upload-avatar {
  padding: 10px 24px;
  background-color: var(--white);
  border: 2px solid var(--primary-color);
  border-radius: var(--radius-full);
  color: var(--primary-color);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-upload-avatar:hover {
  background-color: var(--primary-color);
  color: var(--white);
}

/* 编辑表单 */
.edit-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.edit-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.edit-form label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}

.edit-form .form-control {
  height: 48px;
  padding: 0 16px;
  border: 2px solid #E8EAED;
  border-radius: var(--radius-md);
  font-size: 15px;
  background-color: #F8F9FA;
  transition: all var(--transition-base);
}

.edit-form .form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: var(--white);
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
}

.edit-form .form-control:read-only {
  background-color: #F0F0F0;
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}

.btn-save {
  padding: 0 32px;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gradient-primary);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.3);
}

.btn-cancel {
  padding: 0 32px;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--white);
  border: 2px solid #E8EAED;
  color: var(--text-dark);
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-cancel:hover {
  border-color: var(--text-dark);
}

/* ========== 账号安全页 ========== */

.security-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
}

.security-item {
  display: flex;
  gap: 20px;
  padding: 24px;
  background-color: var(--white);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.security-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.security-icon i {
  font-size: 24px;
  color: var(--white);
}

.security-content {
  flex: 1;
}

.security-content h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.security-desc {
  font-size: 14px;
  color: var(--text-light);
}

.security-level {
  display: flex;
  align-items: center;
  gap: 16px;
}

.level-bar {
  flex: 1;
  height: 8px;
  background-color: #E8EAED;
  border-radius: 4px;
  overflow: hidden;
}

.level-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 4px;
  transition: width var(--transition-base);
}

.level-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-color);
  min-width: 50px;
}

/* 修改密码表单 */
.password-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.password-input {
  position: relative;
}

.password-input .form-control {
  padding-right: 50px;
}

.toggle-password {
  position: absolute;
  right: 0;
  top: 0;
  height: 48px;
  width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  cursor: pointer;
  transition: color var(--transition-fast);
  background: none;
  border: none;
}

.toggle-password:hover {
  color: var(--primary-color);
}

.password-strength {
  margin-top: 8px;
  display: none;
}

.password-strength.show {
  display: block;
}

.strength-bar {
  height: 4px;
  background-color: #E8EAED;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.strength-fill {
  height: 100%;
  width: 0;
  transition: all var(--transition-base);
  border-radius: 2px;
}

.strength-fill.weak {
  width: 33.33%;
  background-color: #E53E3E;
}

.strength-fill.medium {
  width: 66.66%;
  background-color: #FFA62B;
}

.strength-fill.strong {
  width: 100%;
  background-color: #00D4AA;
}

.strength-text {
  font-size: 12px;
  color: var(--text-light);
}

.strength-text span {
  font-weight: 600;
}

.strength-text span.weak { color: #E53E3E; }
.strength-text span.medium { color: #FFA62B; }
.strength-text span.strong { color: #00D4AA; }

/* 通用卡片 */
.section-card {
  background-color: var(--white);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #E8EAED;
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
  
  .profile-sidebar {
    position: relative;
    top: 0;
  }
  
  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
  }
  
  .sidebar-nav .nav-item span {
    display: none;
  }
  
  .sidebar-nav .nav-item {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .profile-main {
    padding: 60px 0 40px;
  }
  
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .checkin-card {
    padding: 24px;
  }
  
  .checkin-header {
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
  }
  
  .btn-checkin {
    width: 100%;
    justify-content: center;
  }
  
  .points-overview {
    grid-template-columns: 1fr;
  }
  
  .info-card {
    padding: 24px;
  }
  
  .edit-form .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-cards {
    grid-template-columns: 1fr;
  }
  
  .sidebar-nav {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  
  .user-card-stats {
    grid-template-columns: 1fr;
  }
}

/* Parsley错误样式 */
.parsley-errors-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0 0;
  font-size: 13px;
  color: #E53E3E;
}

.parsley-errors-list li::before {
  content: '! ';
  font-weight: bold;
}

