/* === Notes & Images Section === */
.records-section {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 32px;
  box-shadow: var(--shadow-md);
}

.records-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.records-title {
  font-family: 'Bagel Fat One', sans-serif;
  font-size: 24px;
  color: var(--night);
}

.records-subtitle {
  color: var(--gray);
  font-size: 13px;
  margin-top: 2px;
}

.notes-area {
  width: 100%;
  min-height: 120px;
  padding: 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--night);
  background: var(--cream);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  resize: vertical;
  outline: none;
  transition: all 0.3s;
  line-height: 1.7;
}

.notes-area:focus {
  background: white;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.15);
}

.notes-area::placeholder {
  color: var(--gray);
}

.notes-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--gray);
}

.notes-save {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--mint-deep);
  font-weight: 700;
}

.notes-save.saved {
  animation: pop 0.4s;
}

.upload-area {
  margin-top: 24px;
}

.upload-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.upload-btn {
  padding: 16px;
  border: 2px dashed var(--cream-2);
  background: var(--cream);
  color: var(--night);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.upload-btn:hover {
  background: white;
  border-color: var(--sunset);
  color: var(--sunset-deep);
  transform: translateY(-2px);
}

.upload-btn .icon {
  font-size: 22px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.image-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--cream-2);
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: var(--shadow-sm);
}

.image-item:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
}

.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-item .delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  background: rgba(239, 71, 111, 0.95);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.image-item:hover .delete-btn {
  opacity: 1;
}

.image-item .date-tag {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  background: rgba(26, 31, 58, 0.7);
  color: white;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.upload-status {
  margin-top: 12px;
  padding: 10px;
  background: var(--cream);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--brown);
  text-align: center;
  min-height: 20px;
  display: none;
}

.upload-status.show { display: block; }

/* === Image Modal === */
.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.image-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.image-modal img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.image-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  transition: all 0.2s;
}

.image-modal-close:hover {
  background: rgba(255,255,255,0.3);
  transform: rotate(90deg);
}

.image-modal-meta {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  background: rgba(0,0,0,0.6);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13px;
  backdrop-filter: blur(10px);
}

/* === Records Tab === */
.records-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: white;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.records-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.records-filter-btn {
  padding: 8px 16px;
  background: var(--cream);
  border: none;
  border-radius: 100px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray);
  cursor: pointer;
  transition: all 0.2s;
}

.records-filter-btn.active {
  background: var(--sunset);
  color: white;
}

.export-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--mint), var(--mint-deep));
  color: white;
  border: none;
  border-radius: 100px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(6, 214, 160, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.export-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(6, 214, 160, 0.4);
}

.record-day-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--sunset);
}

.record-day-card.has-notes { border-left-color: var(--gold); }
.record-day-card.has-images { border-left-color: var(--cyan); }

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

.record-day-date {
  font-family: 'Bagel Fat One', sans-serif;
  font-size: 20px;
  color: var(--night);
}

.record-day-tags {
  display: flex;
  gap: 6px;
}

.record-tag {
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}

.record-tag.notes { background: rgba(255, 209, 102, 0.25); color: #8C6914; }
.record-tag.images { background: rgba(17, 138, 178, 0.15); color: var(--cyan); }
.record-tag.tasks { background: rgba(6, 214, 160, 0.15); color: var(--mint-deep); }

.record-day-content {
  white-space: pre-wrap;
  color: var(--brown);
  font-size: 14px;
  line-height: 1.7;
}

.record-day-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.record-day-images img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.record-day-images img:hover {
  transform: scale(1.05);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.empty-state-icon {
  font-size: 60px;
  margin-bottom: 16px;
  display: block;
  opacity: 0.7;
}

.empty-state-title {
  font-family: 'Bagel Fat One', sans-serif;
  font-size: 22px;
  color: var(--night);
  margin-bottom: 8px;
}

.empty-state-text {
  color: var(--gray);
  font-size: 14px;
}

/* === Scroll Bar === */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--gold-deep); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--sunset); }

/* === Image Modal 全屏 === */
.image-modal { padding: 0; align-items: stretch; }
.image-modal img {
  width: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0;
}
.image-modal-close { width: 50px; height: 50px; font-size: 28px; top: 12px; right: 12px; }
.image-modal-meta { font-size: 12px; padding: 6px 12px; bottom: 16px; }

@media (max-width: 640px) {
  .image-modal-meta { font-size: 11px; }
  .image-modal-close { width: 44px; height: 44px; font-size: 24px; }
}

/* === Image with timestamp === */
.record-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
}
.record-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  display: block;
}
.record-img-time {
  position: absolute;
  right: 4px;
  bottom: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Plus Jakarta Sans', monospace;
  letter-spacing: 0.5px;
  pointer-events: none;
  backdrop-filter: blur(4px);
}
