/* 
 * 时光日记系统样式文件
 * 最后更新: 2024-12-XX 时间线重构版本
 * 缓存版本: v2.0 - 如果你看到这个版本号，说明缓存已清除
 */

/* 重置和基础样式 */
* {
  margin: 0;
  padding: 0;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

/* 全局SVG和图片尺寸控制 */
svg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  flex-shrink: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 强制限制所有图标尺寸 */
.icon, .icon svg {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  flex-shrink: 0;
}

.icon-small, .icon-small svg {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  flex-shrink: 0;
}

.icon-large, .icon-large svg {
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  flex-shrink: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #374151;
  background-color: #f9fafb;
}

/* 容器和布局 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.flex {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
}

.flex-col {
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
}

.items-center {
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
}

.justify-center {
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
}

.justify-between {
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  -ms-flex-pack: justify;
  justify-content: space-between;
}

.space-x-2 > * + * {
  margin-left: 8px;
}

.space-x-3 > * + * {
  margin-left: 12px;
}

.space-y-3 > * + * {
  margin-top: 12px;
}

.space-y-6 > * + * {
  margin-top: 24px;
}

/* 网格布局 */
.grid {
  display: -ms-grid;
  display: grid;
  gap: 16px;
}

.grid-cols-1 {
  -ms-grid-columns: 1fr;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

/* 卡片样式 */
.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  padding: 24px;
  -webkit-transition: all 0.2s ease;
  -moz-transition: all 0.2s ease;
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  -webkit-transform: translateY(-2px);
  -moz-transform: translateY(-2px);
  -ms-transform: translateY(-2px);
  transform: translateY(-2px);
}

/* 按钮样式 */
.btn {
  display: -webkit-inline-box;
  display: -webkit-inline-flex;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  -webkit-transition: all 0.2s ease;
  -moz-transition: all 0.2s ease;
  transition: all 0.2s ease;
  font-size: 16px;
  min-height: 48px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  -webkit-transform: translateY(-1px);
  -moz-transform: translateY(-1px);
  -ms-transform: translateY(-1px);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: white;
  color: #374151;
  border: 2px solid #d1d5db;
}

.btn-secondary:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #9ca3af;
}

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
  min-height: 36px;
}

/* 输入框样式 */
.input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 16px;
  -webkit-transition: all 0.2s ease;
  -moz-transition: all 0.2s ease;
  transition: all 0.2s ease;
  background: white;
}

.input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-with-icon {
  padding-left: 48px;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #9ca3af;
}

/* 文本区域 */
.textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 16px;
  -webkit-transition: all 0.2s ease;
  -moz-transition: all 0.2s ease;
  transition: all 0.2s ease;
  background: white;
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
}

.textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 标签 */
.label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  font-size: 14px;
}

/* 登录页面样式 */
.login-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #e0f2fe, #f3e5f5);
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  padding: 16px;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.logo {
  width: 48px !important;
  height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-radius: 50%;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
  flex-shrink: 0;
}

.logo svg {
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  color: white;
  flex-shrink: 0;
}

/* 顶部导航栏 */
.navbar {
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  position: -webkit-sticky;
  top: 0;
  z-index: 1000;
}

.navbar-content {
  height: 64px;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  -ms-flex-pack: justify;
  justify-content: space-between;
}

.navbar-logo {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-radius: 50%;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-flex-shrink: 0;
  -ms-flex-negative: 0;
  flex-shrink: 0;
}

.navbar-logo svg {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  color: white;
  flex-shrink: 0;
}

.navbar-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
}

.navbar-subtitle {
  font-size: 12px;
  color: #6b7280;
}

/* 内容区域 */
.main-content {
  padding: 24px 16px;
}

/* 文件上传区域 */
.upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  background: #fafafa;
  -webkit-transition: border-color 0.2s ease;
  -moz-transition: border-color 0.2s ease;
  transition: border-color 0.2s ease;
  cursor: pointer;
}

.upload-area:hover {
  border-color: #3b82f6;
  background: #f0f9ff;
}

.upload-icon {
  width: 48px;
  height: 48px;
  color: #3b82f6;
  margin: 0 auto 16px;
}

/* 媒体预览 */
.media-preview {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

.media-preview img,
.media-preview video {
  width: 100%;
  height: 200px;
  -o-object-fit: cover;
  object-fit: cover;
  display: block;
}

.media-preview audio {
  width: 100%;
}

/* 模态框样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}

.modal-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-animation: modalShow 0.3s ease-out;
  animation: modalShow 0.3s ease-out;
}

.register-modal {
  max-width: 600px;
}

.modal-header {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  -ms-flex-pack: justify;
  justify-content: space-between;
  padding: 24px 24px 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 24px;
  padding-bottom: 16px;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  color: #6b7280;
  -webkit-transition: all 0.2s ease;
  -moz-transition: all 0.2s ease;
  transition: all 0.2s ease;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #374151;
}

.modal-body {
  padding: 0 24px;
}

.modal-footer {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: end;
  -webkit-justify-content: flex-end;
  -ms-flex-pack: end;
  justify-content: flex-end;
  gap: 12px;
  padding: 24px;
  border-top: 1px solid #e5e7eb;
  margin-top: 24px;
}

.space-y-4 > * + * {
  margin-top: 16px;
}

.text-red-500 {
  color: #ef4444;
}

.text-gray-500 {
  color: #6b7280;
}

@-webkit-keyframes modalShow {
  from {
    opacity: 0;
    -webkit-transform: scale(0.9) translateY(-20px);
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    -webkit-transform: scale(1) translateY(0);
    transform: scale(1) translateY(0);
  }
}

@keyframes modalShow {
  from {
    opacity: 0;
    -webkit-transform: scale(0.9) translateY(-20px);
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    -webkit-transform: scale(1) translateY(0);
    transform: scale(1) translateY(0);
  }
}

/* 消息提示 */
.message {
  text-align: center;
  font-size: 14px;
  min-height: 24px;
  -webkit-transition: all 0.3s ease;
  -moz-transition: all 0.3s ease;
  transition: all 0.3s ease;
}

.message-error {
  color: #dc2626;
}

.message-success {
  color: #059669;
}

/* 加载动画 */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  -webkit-animation: spin 1s linear infinite;
  animation: spin 1s linear infinite;
}

@-webkit-keyframes spin {
  from {
    -webkit-transform: rotate(0deg);
  }
  to {
    -webkit-transform: rotate(360deg);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 工具类 */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }

.p-4 { padding: 16px; }
.p-6 { padding: 24px; }

.hidden { display: none; }
.block { display: block; }

.relative { position: relative; }
.absolute { position: absolute; }

.border { border: 1px solid #d1d5db; }
.border-t { border-top: 1px solid #e5e7eb; }

.bg-white { background-color: white; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-red-50 { background-color: #fef2f2; }

.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-red-600 { color: #dc2626; }
.text-blue-600 { color: #2563eb; }
.text-green-700 { color: #15803d; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.rounded { border-radius: 6px; }
.rounded-lg { border-radius: 12px; }
.rounded-xl { border-radius: 16px; }

/* 编辑页面日期显示样式 */
.edit-date-display {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.1));
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  margin-bottom: 24px;
}

.edit-date-text {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.edit-weekday {
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  background: rgba(59, 130, 246, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.edit-lunar-info {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.4;
}

.edit-lunar-date {
  color: #6366f1;
  font-weight: 500;
  margin-bottom: 3px;
}

.edit-lunar-suitable {
  color: #6b7280;
  font-size: 10px;
  font-weight: 400;
}

/* 响应式设计 */
@media (min-width: 640px) {
  .container {
    padding: 0 24px;
  }
  
  .grid-cols-1 {
    -ms-grid-columns: 1fr;
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  
  .sm\:grid-cols-2 {
    -ms-grid-columns: 1fr 1fr;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .navbar-content {
    height: 80px;
  }
  
  .navbar-logo {
    width: 32px !important;
    height: 32px !important;
  }
  
  .navbar-logo svg {
    width: 16px !important;
    height: 16px !important;
  }
  
  .navbar-title {
    font-size: 20px;
  }
  
  .navbar-subtitle {
    font-size: 14px;
  }
  
  .logo {
    width: 48px !important;
    height: 48px !important;
  }
  
  .logo svg {
    width: 24px !important;
    height: 24px !important;
  }
  
  .login-card {
    padding: 48px;
  }
  
  .main-content {
    padding: 32px 24px;
  }
  
  .media-preview img,
  .media-preview video {
    height: 224px;
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 {
    -ms-grid-columns: 1fr 1fr;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .main-content {
    padding: 40px 32px;
  }
}

@media (min-width: 1280px) {
  .xl\:grid-cols-3 {
    -ms-grid-columns: 1fr 1fr 1fr;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Edge浏览器特定修复 */
@supports (-ms-ime-align: auto) {
  .card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }
  
  .btn {
    -ms-flex-align: center;
    -ms-flex-pack: center;
  }
}

/* IE和旧版Edge兼容 */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  .grid {
    display: block;
  }
  
  .grid .card {
    margin-bottom: 16px;
  }
  
  .flex {
    display: block;
  }
  
  .items-center,
  .justify-center,
  .justify-between {
    text-align: center;
  }
}

/* 时间线页面样式 */
.timeline-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #fce7f3, #f3e8ff, #ede9fe);
  background-attachment: fixed;
}

.timeline-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* 写新日记按钮 */
.new-entry-section {
  margin-bottom: 40px;
}

.new-entry-btn {
  width: 100%;
  background: linear-gradient(135deg, #ec4899, #f97316);
  border: none;
  border-radius: 20px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.3);
  color: white;
}

.new-entry-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(236, 72, 153, 0.4);
}

.new-entry-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.new-entry-text {
  text-align: left;
}

.new-entry-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.new-entry-subtitle {
  font-size: 14px;
  opacity: 0.9;
}

/* 时间线内容 */
.timeline-content {
  position: relative;
}

.timeline-content::before {
  content: '';
  position: absolute;
  left: 32px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #ec4899, #f97316, #eab308);
  border-radius: 1px;
}

.timeline-list {
  position: relative;
}

.timeline-item {
  display: flex;
  margin-bottom: 32px;
  position: relative;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

/* 时间线圆点 */
.timeline-dot {
  width: 64px;
  height: 64px;
  position: relative;
  flex-shrink: 0;
  z-index: 2;
}

.timeline-dot-inner {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #ec4899, #f97316);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 16px rgba(236, 72, 153, 0.3);
  border: 4px solid white;
}

/* 时间线卡片 */
.timeline-content-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 24px;
  margin-left: 24px;
  flex: 1;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.timeline-content-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* 时间线日期 */
.timeline-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.1), rgba(168, 85, 247, 0.1));
  border-radius: 16px;
  border: 1px solid rgba(236, 72, 153, 0.2);
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.1);
  transition: all 0.3s ease;
}

.timeline-date:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(236, 72, 153, 0.15);
}

/* 星期显示样式 */
.timeline-weekday {
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  background: rgba(168, 85, 247, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* 农历信息样式 */
.lunar-info {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.4;
}

.lunar-date {
  color: #8b5cf6;
  font-weight: 500;
  margin-bottom: 3px;
}

.lunar-suitable {
  color: #6b7280;
  font-size: 10px;
  font-weight: 400;
}

.timeline-date-text {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, #ec4899, #a855f7);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 2px rgba(236, 72, 153, 0.2);
  letter-spacing: -0.5px;
  position: relative;
}

.timeline-date-text::before {
  content: "📅";
  position: absolute;
  left: -32px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.timeline-time {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(236, 72, 153, 0.05));
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid rgba(236, 72, 153, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(4px);
  position: relative;
}

.timeline-time::before {
  content: "🕐";
  margin-right: 6px;
  font-size: 12px;
}

/* 日记条目内容 */
.timeline-entry-content {
  margin-bottom: 16px;
}

.entry-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 12px;
  line-height: 1.4;
}

.entry-text {
  color: #374151;
  line-height: 1.6;
  font-size: 15px;
}

/* 媒体网格 */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 16px;
  max-width: 100%;
}

.media-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  aspect-ratio: 1;
  max-width: 100px;
  height: 80px;
}

.media-item:hover {
  transform: scale(1.05);
}

.media-item img,
.media-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #f3f4f6;
}

.media-item video {
  background: #000;
}

.media-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: white;
  pointer-events: none;
  border-radius: 8px;
}

.media-item:hover .media-overlay {
  opacity: 1;
}

/* 为视频缩略图添加视觉提示 */
.media-item.video-item::after {
  content: "▶️";
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 10px;
  z-index: 2;
}

.media-overlay svg {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
}

.audio-item {
  background: #f9fafb;
  padding: 8px;
  border: 1px solid #e5e7eb;
  cursor: default;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.audio-item:hover {
  transform: none;
}

.audio-preview {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #6b7280;
  font-size: 10px;
  text-align: center;
}

.audio-preview svg {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
}

.audio-item audio {
  display: none; /* 在缩略图中隐藏音频控件 */
}

/* 时间线操作按钮 */
.timeline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(236, 72, 153, 0.1);
}

.timeline-action-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #f3f4f6;
  color: #6b7280;
}

.timeline-action-btn:hover {
  transform: scale(1.1);
}

.edit-btn:hover {
  background: #dbeafe;
  color: #2563eb;
}

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

.view-btn:hover {
  background: #f0fdf4;
  color: #16a34a;
}

/* 空状态和错误状态 */
/* 加载更多按钮容器 */
.load-more-container {
  text-align: center;
  padding: 40px 20px;
  margin-top: 30px;
}

.load-more-btn {
  min-width: 280px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.load-more-btn:active {
  transform: translateY(0);
}

.load-more-hint {
  margin-top: 12px;
  font-size: 13px;
  color: #9ca3af;
  font-weight: 400;
}

.all-loaded-hint {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
  padding: 20px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 12px;
  display: inline-block;
}

.empty-state,
.error-state,
.loading-state {
  text-align: center;
  padding: 64px 24px;
}

.empty-icon,
.error-icon {
  font-size: 64px;
  margin-bottom: 24px;
}

.empty-title,
.error-title {
  font-size: 20px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.empty-description,
.error-description {
  color: #6b7280;
  margin-bottom: 24px;
}

/* 媒体模态框 */
.media-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  box-sizing: border-box;
}

.media-modal-content {
  max-width: 95vw;
  max-height: 95vh;
  background: #1f2937;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.media-modal-header {
  background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #4b5563;
}

.media-modal-title {
  color: #f9fafb;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.media-modal-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.media-control-btn {
  background: #4b5563;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  color: #e5e7eb;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  position: relative;
}

.media-control-btn:hover {
  background: #6b7280;
  transform: translateY(-1px);
}

.media-control-btn:active {
  transform: translateY(0);
}

.speed-indicator {
  font-size: 11px;
  font-weight: 500;
  min-width: 20px;
  text-align: center;
}

.media-modal-close {
  background: #dc2626;
  border: none;
  border-radius: 8px;
  padding: 8px;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-modal-close:hover {
  background: #b91c1c;
  transform: scale(1.05);
}

.media-modal-body {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  min-height: 200px;
}

.media-modal-body img {
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.media-modal-body video {
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.media-modal-footer {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  padding: 16px 20px;
  border-top: 1px solid #374151;
}

.video-info-panel {
  display: flex;
  gap: 24px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.video-info-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #d1d5db;
  font-size: 13px;
}

.info-label {
  font-weight: 500;
  color: #9ca3af;
}

.info-value {
  color: #f3f4f6;
  font-weight: 600;
}

.video-tips, .image-tips {
  color: #9ca3af;
  font-size: 12px;
  text-align: center;
  line-height: 1.4;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .media-modal {
    padding: 10px;
  }
  
  .media-modal-header {
    padding: 12px 16px;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .media-modal-title {
    font-size: 16px;
    text-align: center;
  }
  
  .media-modal-controls {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .media-control-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
  
  .media-modal-body {
    padding: 15px;
  }
  
  .media-modal-footer {
    padding: 12px 16px;
  }
  
  .video-info-panel {
    gap: 16px;
    justify-content: center;
    text-align: center;
  }
  
  .video-info-item {
    flex-direction: column;
    gap: 2px;
    text-align: center;
  }
  
  .video-tips, .image-tips {
    font-size: 11px;
  }
}

/* 图片缩放样式 */
.media-modal-body img {
  user-select: none;
  -webkit-user-drag: none;
  max-width: none !important;
  max-height: none !important;
}

/* 画中画按钮激活状态 */
.media-control-btn.pip-active {
  background: #3b82f6 !important;
  color: white !important;
}

/* 播放速度按钮激活状态 */
.media-control-btn.speed-active {
  background: #f59e0b !important;
  color: white !important;
}

/* 下载按钮特殊样式 */
.media-control-btn[onclick*="downloadMedia"] {
  background: #059669;
}

.media-control-btn[onclick*="downloadMedia"]:hover {
  background: #047857;
}

/* 加载状态 */
.media-modal-body video[data-loading="true"] {
  opacity: 0.7;
}

/* 错误状态 */
.video-error-container {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 20px;
  margin-top: 16px;
  text-align: center;
  color: #dc2626;
}

.video-error-container button {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 8px;
  transition: background 0.2s ease;
}

.video-error-container button:hover {
  background: #2563eb;
}

.video-error-container a {
  background: #6b7280;
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  display: inline-block;
  transition: background 0.2s ease;
}

.video-error-container a:hover {
  background: #4b5563;
}

/* 详情页样式 */
.detail-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #fce7f3, #f3e8ff, #ede9fe);
  background-attachment: fixed;
}

.detail-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px;
}

.detail-content {
  min-height: 400px;
}

.detail-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 详情页头部 */
.detail-header {
  margin-bottom: 32px;
}

.detail-date-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.detail-emoji {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #ec4899, #f97316);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 16px rgba(236, 72, 153, 0.3);
  border: 4px solid white;
}

.detail-date-info {
  flex: 1;
}

.detail-date {
  font-size: 20px;
  font-weight: 600;
  color: #ec4899;
  margin-bottom: 4px;
}

.detail-time {
  font-size: 14px;
  color: #9ca3af;
  background: rgba(236, 72, 153, 0.1);
  padding: 4px 12px;
  border-radius: 12px;
  display: inline-block;
}

/* 详情页农历信息样式 */
.detail-lunar-info {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
}

.detail-lunar-date {
  color: #8b5cf6;
  font-weight: 500;
  margin-bottom: 4px;
}

.detail-lunar-suitable {
  color: #6b7280;
  font-size: 11px;
  font-weight: 400;
}

/* 详情页标题 */
.detail-title-section {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(236, 72, 153, 0.1);
}

.detail-title {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.3;
  margin: 0;
}

/* 详情页内容 */
.detail-content-section {
  margin-bottom: 32px;
}

.detail-text {
  font-size: 16px;
  line-height: 1.8;
  color: #374151;
}

.detail-text p {
  margin-bottom: 16px;
}

.detail-text p:last-child {
  margin-bottom: 0;
}

.empty-content {
  color: #9ca3af;
  font-style: italic;
  text-align: center;
  padding: 32px;
  background: rgba(236, 72, 153, 0.05);
  border-radius: 12px;
}

/* 详情页媒体 */
.detail-media-section {
  margin-bottom: 32px;
}

.detail-media-title {
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-media-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.detail-media-item {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  background: white;
}

.detail-media-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.detail-media-item.image-item {
  position: relative;
  cursor: pointer;
}

.detail-media-item img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  background: #f9fafb;
}

.detail-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: white;
}

.detail-media-item.image-item:hover .detail-image-overlay {
  opacity: 1;
}

.detail-media-item.video-item {
  position: relative;
  cursor: pointer;
}

.detail-video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.detail-media-item.video-item:hover .detail-video-overlay {
  opacity: 1;
}

.detail-media-item video {
  width: 100%;
  max-height: 400px;
  background: #000;
}

.detail-media-item.audio-item {
  padding: 24px;
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1px solid #e0f2fe;
}

.audio-player {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.audio-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.audio-icon {
  color: #ec4899;
  flex-shrink: 0;
}

.audio-label {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
}

.audio-player audio {
  width: 100%;
  height: 48px;
  background: white;
  border-radius: 8px;
}

/* 详情页操作 */
.detail-actions {
  display: flex;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(236, 72, 153, 0.1);
}

.detail-actions .btn {
  flex: 1;
}

/* 响应式设计 */
@media (max-width: 640px) {
  .timeline-container,
  .detail-container {
    padding: 16px 12px;
  }
  
  .timeline-content::before {
    left: 24px;
  }
  
  .timeline-dot {
    width: 48px;
    height: 48px;
  }
  
  .timeline-dot-inner {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
  
  .timeline-content-card {
    margin-left: 16px;
    padding: 20px;
  }
  
  .new-entry-btn {
    padding: 20px;
  }
  
  .new-entry-icon {
    width: 40px;
    height: 40px;
  }
  
  .new-entry-title {
    font-size: 16px;
  }
  
  .media-grid {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 6px;
    max-width: 240px;
  }
  
  .media-item {
    height: 60px;
    max-width: 80px;
  }
  
  .audio-item {
    height: 50px;
    font-size: 8px;
  }
  
  .timeline-actions {
    justify-content: center;
  }
  
  .detail-card {
    padding: 24px;
  }
  
  .detail-emoji {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
  
  .detail-date {
    font-size: 18px;
  }
  
  .detail-title {
    font-size: 20px;
  }
  
  .detail-actions {
    flex-direction: column;
  }
  
  .detail-media-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .detail-media-item img {
    max-height: 300px;
  }
}

@media (max-width: 480px) {
  .timeline-date {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
  }

  .timeline-date-text {
    font-size: 20px;
    margin-left: 28px; /* 为emoji图标留出空间 */
  }

  .timeline-date-text::before {
    left: -28px;
    font-size: 18px;
  }

  .timeline-time {
    align-self: flex-end;
    font-size: 13px;
    padding: 6px 12px;
  }
  
  /* 小屏幕下的星期和农历信息样式 */
  .timeline-weekday {
    font-size: 12px;
    padding: 2px 6px;
  }
  
  .lunar-info {
    font-size: 10px;
    margin-top: 4px;
  }
  
  .lunar-date {
    font-size: 10px;
    margin-bottom: 2px;
  }
  
  .lunar-suitable {
    font-size: 9px;
  }
  
  .detail-lunar-info {
    font-size: 11px;
  }
  
  .detail-lunar-date {
    font-size: 11px;
  }
  
  .detail-lunar-suitable {
    font-size: 10px;
  }
  
  /* 编辑页面日期信息响应式 */
  .edit-date-display {
    padding: 12px 16px;
  }
  
  .edit-date-text {
    font-size: 18px;
  }
  
  .edit-weekday {
    font-size: 12px;
    padding: 2px 6px;
  }
  
  .edit-lunar-info {
    font-size: 10px;
  }
  
  .edit-lunar-date {
    font-size: 10px;
  }
  
  .edit-lunar-suitable {
    font-size: 9px;
  }
  
  .detail-date-section {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  
  .media-grid {
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    max-width: 200px;
  }
  
  .media-item {
    height: 50px;
    max-width: 60px;
  }
  
  .detail-media-grid {
    grid-template-columns: 1fr;
  }
}