/* AI戒色模块专用样式 */

/* 戒色主题色彩 */
:root {
  --jieshe-primary: #4A90E2;
  --jieshe-success: #7ED321;
  --jieshe-warning: #F5A623;
  --jieshe-danger: #D0021B;
  --jieshe-calm: #E8F4FD;
  --jieshe-gradient: linear-gradient(135deg, #4A90E2 0%, #7ED321 100%);
}

/* 状态卡片样式 */
.status-card {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
}

.status-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--jieshe-gradient);
}

.status-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.status-card.current-streak::before {
  background: linear-gradient(90deg, #FF6B6B, #FF8E53);
}

.status-card.best-record::before {
  background: linear-gradient(90deg, #FFD93D, #FF6B6B);
}

.status-card.next-milestone::before {
  background: linear-gradient(90deg, #6BCF7F, #4D9DE0);
}

.status-icon {
  font-size: 3rem;
  opacity: 0.8;
}

.status-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--jieshe-primary);
  margin: 0;
}

.status-label {
  font-weight: 600;
  color: var(--dark-gray);
  margin-bottom: 0.5rem;
}

/* 操作按钮样式 */
.action-btn {
  border-radius: 0.75rem;
  font-weight: 600;
  padding: 1rem;
  transition: all 0.3s ease;
  border: none;
  position: relative;
  overflow: hidden;
}

.action-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.action-btn:hover::before {
  left: 100%;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* 欢迎区域 */
.welcome-section {
  background: var(--jieshe-calm);
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
}

.current-time {
  text-align: center;
  padding: 1rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 图表容器 */
.chart-container {
  position: relative;
  height: 300px;
  margin: 1rem 0;
}

/* 成就系统 */
.achievement-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}

.achievement-item:hover {
  background-color: var(--light-gray);
}

.achievement-item.completed {
  background-color: #E8F5E8;
  border-left: 4px solid var(--jieshe-success);
}

.achievement-item.locked {
  opacity: 0.6;
}

.achievement-icon {
  font-size: 1.5rem;
  margin-right: 0.75rem;
  width: 2rem;
  text-align: center;
}

.achievement-info {
  flex: 1;
}

.achievement-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.achievement-desc {
  font-size: 0.875rem;
  color: var(--gray);
}

.achievement-progress {
  font-size: 0.75rem;
  color: var(--jieshe-primary);
  font-weight: 500;
}

/* 日记卡片 */
.diary-card {
  border-left: 4px solid var(--jieshe-primary);
  margin-bottom: 1rem;
  transition: all 0.2s ease;
}

.diary-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateX(5px);
}

.diary-date {
  font-size: 0.875rem;
  color: var(--gray);
  font-weight: 500;
}

.diary-mood {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.mood-stars {
  color: #FFD93D;
}

.diary-preview {
  color: var(--dark-gray);
  line-height: 1.4;
  margin: 0.5rem 0;
}

/* AI聊天界面 */
.chat-container {
  height: 500px;
  overflow-y: auto;
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
  padding: 1rem;
  background: white;
}

.chat-message {
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.chat-message.user {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.chat-avatar.ai {
  background: var(--jieshe-primary);
  color: white;
}

.chat-avatar.user {
  background: var(--jieshe-success);
  color: white;
}

.chat-bubble {
  max-width: 70%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  position: relative;
}

.chat-bubble.ai {
  background: #f8f9fa;
  border-bottom-left-radius: 0.25rem;
}

.chat-bubble.user {
  background: var(--jieshe-primary);
  color: white;
  border-bottom-right-radius: 0.25rem;
}

.chat-time {
  font-size: 0.75rem;
  color: var(--gray);
  margin-top: 0.25rem;
}

.chat-input-container {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.chat-input {
  flex: 1;
  border-radius: 2rem;
  border: 1px solid #e9ecef;
  padding: 0.75rem 1rem;
}

.chat-send-btn {
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 知识库样式 */
.knowledge-category {
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  overflow: hidden;
}

.knowledge-category-header {
  background: var(--light-gray);
  padding: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.knowledge-category-header:hover {
  background: #e9ecef;
}

.knowledge-category-content {
  padding: 0;
}

.knowledge-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f8f9fa;
  transition: background-color 0.2s ease;
}

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

.knowledge-item:hover {
  background: var(--light-gray);
}

.knowledge-title {
  font-weight: 500;
  color: var(--dark-gray);
  text-decoration: none;
}

.knowledge-desc {
  font-size: 0.875rem;
  color: var(--gray);
  margin-top: 0.25rem;
}

/* 社区样式 */
.community-post {
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
  transition: box-shadow 0.2s ease;
}

.community-post:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-header {
  display: flex;
  justify-content: between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.post-author {
  font-weight: 600;
  color: var(--jieshe-primary);
}

.post-time {
  font-size: 0.875rem;
  color: var(--gray);
}

.post-content {
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.post-actions {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
}

.post-action {
  color: var(--gray);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-action:hover {
  color: var(--jieshe-primary);
}

/* 紧急求助模态框 */
.modal-content {
  border-radius: 1rem;
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header.bg-warning {
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .status-number {
    font-size: 2rem;
  }
  
  .status-icon {
    font-size: 2.5rem;
  }
  
  .action-btn {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  
  .welcome-section {
    padding: 1.5rem;
  }
  
  .chat-bubble {
    max-width: 85%;
  }
  
  .chart-container {
    height: 250px;
  }
}

@media (max-width: 576px) {
  .status-card {
    margin-bottom: 1rem;
  }
  
  .action-btn {
    margin-bottom: 0.5rem;
  }
  
  .chat-container {
    height: 400px;
  }
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.5s ease-out;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.pulse {
  animation: pulse 2s infinite;
}

/* 成功状态动画 */
@keyframes success {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
    background-color: var(--jieshe-success);
  }
  100% {
    transform: scale(1);
  }
}

.success-animation {
  animation: success 0.6s ease-out;
}