/* webapp/css/timecapsule.css */

/* ==================== 时间胶囊容器 ==================== */
.tc-container {
  min-height: 100vh;
  background: linear-gradient(180deg, #f5f7fa 0%, #ffffff 100%);
  padding: 0 0 40px 0;
}

/* ==================== 头部：月份切换 + 返回按钮 ==================== */
.tc-header {
  padding: 16px 16px 12px 16px;
  background: #ffffff;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tc-back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #f5f7fa;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
  flex-shrink: 0;
}

.tc-back-btn:hover {
  background: #e8ebef;
}

.tc-back-btn:active {
  transform: scale(0.95);
}

.back-icon {
  font-size: 24px;
  color: #666;
  font-weight: bold;
  line-height: 1;
}

.back-text {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.tc-month-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex: 1;
}

.tc-arrow-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f7fa;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
  flex-shrink: 0;
}

.tc-arrow-btn:hover {
  background: #e8ebef;
}

.tc-arrow-btn:active {
  background: #e8ebef;
  transform: scale(0.95);
}

.tc-arrow {
  font-size: 24px;
  color: #666;
  font-weight: bold;
  line-height: 1;
}

.tc-month-display {
  text-align: center;
  min-width: 120px;
}

.tc-month-text {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

.tc-header-spacer {
  width: 80px;
  flex-shrink: 0;
}

/* ==================== 加载状态 ==================== */
.tc-loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  gap: 16px;
}

.tc-loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #6C5CE7;
  border-radius: 50%;
  animation: tc-spin 1s linear infinite;
}

@keyframes tc-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.tc-loading-text {
  font-size: 14px;
  color: #999;
}

/* ==================== 日历 ==================== */
.tc-calendar-container {
  padding: 12px 12px 0 12px;
}

/* 星期标题行 */
.tc-weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.tc-weekday-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
}

.tc-weekday-text {
  font-size: 12px;
  color: #999;
  font-weight: 500;
}

/* 日历网格 */
.tc-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

/* 日期格子 */
.tc-day-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.tc-day-cell.tc-empty {
  background: transparent;
  border: none;
}

.tc-day-cell.tc-has-data {
  cursor: pointer;
}

.tc-day-cell.tc-has-data:hover {
  border-color: #6C5CE7;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.2);
}

.tc-day-cell.tc-has-data:active {
  transform: scale(0.95);
}

.tc-day-cell.tc-today {
  border-color: #6C5CE7;
  border-width: 2px;
}

/* 日期格子内部布局 */
.tc-date-cell {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 2px;
}

/* 日期数字 */
.tc-day-number {
  font-size: 14px;
  color: #333;
  font-weight: 500;
  line-height: 1;
}

.tc-day-number.tc-today-number {
  color: #6C5CE7;
  font-weight: bold;
}

/* 晚评emoji */
.tc-mood-emoji {
  font-size: 20px;
  line-height: 1;
}

/* ==================== 详情卡片遮罩 ==================== */
.tc-detail-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  animation: tc-fadeIn 0.3s ease-out;
}

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

/* 详情卡片 */
.tc-detail-card {
  width: 100%;
  max-height: 80vh;
  background: #ffffff;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  overflow-y: auto;
  position: relative;
}

.tc-detail-card.tc-show {
  transform: translateY(0);
}

/* 关闭按钮 */
.tc-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 50%;
  z-index: 10;
  cursor: pointer;
  transition: all 0.3s;
}

.tc-close-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

.tc-close-icon {
  font-size: 24px;
  color: #666;
  line-height: 1;
}

/* Tab切换 */
.tc-detail-tabs {
  display: flex;
  padding: 12px 16px 0 16px;
  gap: 12px;
}

.tc-tab-item {
  flex: 1;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f7fa;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
}

.tc-tab-item:hover {
  background: #e8ebef;
}

.tc-tab-item.tc-active {
  background: #6C5CE7;
}

.tc-tab-text {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.tc-tab-item.tc-active .tc-tab-text {
  color: #ffffff;
  font-weight: bold;
}

/* 日期标题 */
.tc-detail-header {
  padding: 16px 16px 8px 16px;
  text-align: center;
}

.tc-detail-date {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

/* 详情内容 */
.tc-detail-content {
  padding: 0 16px 20px 16px;
}

/* ==================== 早签内容 ==================== */

/* 签级徽章 */
.tc-fortune-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 24px;
  margin: 0 auto 12px auto;
  width: fit-content;
}

.tc-badge-icon {
  font-size: 16px;
  line-height: 1;
}

.tc-badge-text {
  font-size: 14px;
  font-weight: bold;
}

/* 签文标题 */
.tc-fortune-title {
  text-align: center;
  margin-bottom: 16px;
}

.tc-title-text {
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

/* 签文章节 */
.tc-fortune-section {
  margin-bottom: 16px;
}

.tc-section-title {
  display: block;
  font-size: 14px;
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
}

.tc-section-content {
  display: block;
  font-size: 14px;
  color: #666;
  line-height: 1.8;
}

.tc-section-content.tc-quote {
  font-style: italic;
  color: #999;
  padding: 8px;
  background: #f9f9f9;
  border-radius: 4px;
  border-left: 2px solid #6C5CE7;
}

.tc-section-content.tc-whisper {
  color: #999;
  font-size: 13px;
  font-style: italic;
}

/* 行动指南列表 */
.tc-action-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tc-action-item {
  display: flex;
  gap: 6px;
}

.tc-action-bullet {
  font-size: 14px;
  color: #6C5CE7;
  flex-shrink: 0;
}

.tc-action-text {
  font-size: 14px;
  color: #666;
  line-height: 1.8;
  flex: 1;
}

/* ==================== 晚评内容 ==================== */

/* 心情徽章 */
.tc-mood-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.tc-mood-emoji-large {
  font-size: 48px;
  line-height: 1;
}

.tc-mood-label {
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

/* 晚评章节 */
.tc-evening-section {
  margin-bottom: 16px;
}

.tc-section-content.tc-guardian-reply {
  background: linear-gradient(135deg, #f5f3ff 0%, #f0f0ff 100%);
  padding: 10px;
  border-radius: 6px;
  border-left: 2px solid #6C5CE7;
}

.tc-section-content.tc-tips {
  color: #999;
  font-size: 13px;
  padding: 8px;
  background: #fffef0;
  border-radius: 4px;
  border-left: 2px solid #FFD700;
}

/* ==================== 响应式调整 ==================== */
@media (min-width: 750px) {
  .tc-container {
    max-width: 750px;
    margin: 0 auto;
  }
}
