/**
 * 尘渊 - 内容新鲜度样式
 * 新鲜度指示器、相关内容推荐、内容日历
 */

/* ============================================
   内容新鲜度指示器
   ============================================ */
.content-freshness-indicator {
  display: flex;
  justify-content: flex-end;
  padding: 16px 0;
  margin-bottom: 24px;
}

.freshness-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.05) 0%, 
    rgba(255, 255, 255, 0.02) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.freshness-score-ring {
  position: relative;
  width: 48px;
  height: 48px;
}

.freshness-score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.freshness-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 3;
}

.freshness-ring-progress {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.6s ease;
}

.freshness-score {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: 700;
  color: var(--freshness-color, #10b981);
}

.freshness-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.freshness-status {
  font-size: 14px;
  font-weight: 600;
}

.freshness-date {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.freshness-days {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   更新提醒（管理员）
   ============================================ */
.content-update-reminder {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  max-width: 400px;
  animation: slideInReminder 0.4s ease;
}

@keyframes slideInReminder {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.update-reminder-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(245, 158, 11, 0.3);
}

.update-icon {
  font-size: 20px;
}

.update-text {
  flex: 1;
  font-size: 13px;
  color: #fff;
  line-height: 1.5;
}

.update-text strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.update-dismiss {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.update-dismiss:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   相关内容推荐
   ============================================ */
.related-content-section {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.related-content-wrapper {
  max-width: 100%;
}

.related-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 24px;
}

.related-icon {
  font-size: 1.5rem;
}

.related-count {
  margin-left: auto;
  padding: 4px 12px;
  background: rgba(144, 202, 249, 0.1);
  border: 1px solid rgba(144, 202, 249, 0.2);
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--md-sys-color-primary);
}

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

.related-card {
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.06) 0%, 
    rgba(255, 255, 255, 0.02) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.related-card:hover {
  transform: translateY(-4px);
  border-color: rgba(144, 202, 249, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.related-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    var(--md-sys-color-primary),
    var(--md-sys-color-tertiary)
  );
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.related-card:hover::before {
  transform: scaleX(1);
}

.related-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.related-category {
  padding: 4px 10px;
  background: rgba(144, 202, 249, 0.1);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--md-sys-color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.related-freshness {
  padding: 2px 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--freshness-color);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--freshness-color);
}

.related-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.related-card-title a {
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
  transition: color 0.2s ease;
}

.related-card-title a:hover {
  color: var(--md-sys-color-primary);
}

.related-card-desc {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.related-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.related-tag {
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.related-date {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   内容日历侧边栏
   ============================================ */
.content-calendar-sidebar {
  position: sticky;
  top: 100px;
  width: 280px;
}

.content-calendar-sidebar.calendar-floating {
  position: fixed;
  right: 20px;
  top: 100px;
  z-index: 100;
}

.calendar-widget {
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.06) 0%, 
    rgba(255, 255, 255, 0.02) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.calendar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 16px;
}

.calendar-current {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 20px;
}

.calendar-month {
  font-size: 32px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
}

.calendar-year {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.5);
}

.calendar-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.calendar-stat {
  text-align: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.calendar-upcoming h5 {
  font-size: 14px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 12px;
}

.upcoming-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.upcoming-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.upcoming-date {
  padding: 4px 10px;
  background: rgba(144, 202, 249, 0.1);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--md-sys-color-primary);
  white-space: nowrap;
}

.upcoming-content {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   调试面板
   ============================================ */
.content-debug-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 320px;
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  animation: slideUp 0.3s ease;
}

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

.debug-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(245, 158, 11, 0.2);
  border-radius: 12px 12px 0 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.debug-header button {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

.debug-content {
  padding: 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

.debug-content ul {
  margin: 12px 0;
  padding-left: 20px;
}

.debug-content li {
  margin: 4px 0;
}

/* ============================================
   移动端适配
   ============================================ */
@media (max-width: 768px) {
  .content-freshness-indicator {
    justify-content: flex-start;
    padding: 12px 0;
  }

  .freshness-badge {
    padding: 10px 14px;
  }

  .freshness-score-ring {
    width: 40px;
    height: 40px;
  }

  .freshness-score {
    font-size: 12px;
  }

  .freshness-status {
    font-size: 13px;
  }

  .freshness-date,
  .freshness-days {
    font-size: 11px;
  }

  .related-content-section {
    margin-top: 48px;
    padding-top: 32px;
  }

  .related-title {
    font-size: 1.25rem;
  }

  .related-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .related-card {
    padding: 16px;
  }

  .content-calendar-sidebar {
    display: none;
  }

  .content-update-reminder {
    left: 16px;
    right: 16px;
    top: auto;
    bottom: 80px;
    max-width: none;
  }
}

/* ============================================
   动画效果
   ============================================ */
@keyframes pulse-freshness {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
}

.freshness-badge[data-fresh="true"] {
  animation: pulse-freshness 2s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.related-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.03), 
    transparent
  );
  background-size: 200% 100%;
  animation: shimmer 3s infinite;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.related-card:hover::after {
  opacity: 1;
}
