/* ==========================================
   木光集 · 森系相册 — 温暖木纹风格
   ========================================== */

/* ========== 基础 ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #F5EDE0;
  font-family: 'Noto Serif SC', 'Songti SC', 'STSong', Georgia, 'PingFang SC', sans-serif;
  color: #4A3F35;
  min-height: 100vh;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 木纹肌理叠加层 */
#texture-overlay {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(139,115,85,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(139,115,85,0.03) 0%, transparent 50%),
    repeating-linear-gradient(86deg, transparent 0px, transparent 3px, rgba(139,115,85,0.006) 3px, rgba(139,115,85,0.006) 4px);
  pointer-events: none; z-index: 9999;
}

/* ========== 容器 ========== */
.container {
  max-width: 1240px; margin: 0 auto; padding: 40px 32px 60px;
  position: relative; z-index: 1;
}

@media (max-width: 900px) {
  .container { padding: 24px 16px 40px; }
}
@media (max-width: 600px) {
  .container { padding: 16px 12px 32px; }
}

/* ========== 装饰条 ========== */
.header-accent {
  width: 80px; height: 3px;
  background: linear-gradient(90deg, #8B7355, #D4C5A9);
  border-radius: 2px; margin-bottom: 18px;
}

/* ========== 顶部导航 ========== */
.header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 36px; padding-bottom: 20px;
  border-bottom: 1px solid rgba(139,115,85,0.15);
}
@media (max-width: 900px) {
  .header { flex-direction: column; align-items: stretch; gap: 16px; }
}

.site-title h1 {
  font-size: 26px; font-weight: 600; color: #5C4A3A;
  letter-spacing: 6px; margin-bottom: 4px;
}
.site-title p {
  font-size: 12px; color: #8B7D6A; letter-spacing: 3px;
  font-family: 'PingFang SC', -apple-system, sans-serif;
}

.header-actions { display: flex; gap: 12px; align-items: center; }
@media (max-width: 900px) {
  .header-actions { flex-wrap: wrap; }
}

/* ========== 搜索框 ========== */
.search-box {
  display: flex; align-items: center;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(139,115,85,0.2);
  border-radius: 24px; padding: 8px 16px; width: 220px;
  transition: all 0.3s; backdrop-filter: blur(8px);
}
.search-box:focus-within {
  border-color: #8B7355; background: rgba(255,255,255,0.9);
  box-shadow: 0 2px 12px rgba(139,115,85,0.1);
}
.search-box svg { width: 16px; height: 16px; color: #8B7D6A; margin-right: 8px; opacity: 0.6; flex-shrink: 0; }
.search-box input {
  border: none; background: transparent; font-size: 13px; color: #4A3F35;
  outline: none; width: 100%;
  font-family: 'PingFang SC', -apple-system, sans-serif;
}
.search-box input::placeholder { color: #A99B8A; font-weight: 300; }

@media (max-width: 900px) {
  .search-box { width: 100%; }
}

/* ========== 上传按钮 ========== */
.btn-upload {
  background: #8B7355; color: #FFF; border: none; border-radius: 24px;
  padding: 9px 22px; font-size: 13px;
  font-family: 'PingFang SC', -apple-system, sans-serif;
  cursor: pointer; transition: all 0.25s; letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(139,115,85,0.2);
  white-space: nowrap;
}
.btn-upload:hover {
  background: #6F5B41; transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(139,115,85,0.3);
}
.btn-upload:active { transform: translateY(0); }

/* ========== 分类入口 ========== */
.categories {
  display: flex; gap: 8px; margin-bottom: 32px; flex-wrap: wrap;
}
.category-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px; border: 1px solid rgba(139,115,85,0.15);
  border-radius: 28px; background: rgba(255,255,255,0.45);
  cursor: pointer; transition: all 0.25s;
  font-size: 13px; color: #6F5B41; opacity: 0.7;
  font-family: 'PingFang SC', -apple-system, sans-serif;
  letter-spacing: 1px;
}
.category-item:hover { opacity: 1; background: rgba(255,255,255,0.65); }
.category-item.active {
  opacity: 1; background: rgba(139,115,85,0.12);
  border-color: rgba(139,115,85,0.3);
}
.category-icon { font-size: 16px; }

/* ========== 视图标题 ========== */
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.section-header h2 {
  font-size: 17px; font-weight: 500; color: #5C4A3A; letter-spacing: 2px;
}
.header-tools { display: flex; gap: 6px; }
.btn-grid-layout {
  background: transparent; border: 1px solid rgba(139,115,85,0.15);
  border-radius: 6px; padding: 4px 10px; cursor: pointer;
  font-size: 16px; color: #A99B8A; transition: all 0.2s;
  line-height: 1;
}
.btn-grid-layout:hover { border-color: #8B7355; color: #6F5B41; }
.btn-grid-layout.active { background: rgba(139,115,85,0.08); color: #6F5B41; }

/* ========== 时光走廊子导航 ========== */
.timeline-nav { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.timeline-btn {
  background: transparent; border: 1px solid rgba(139,115,85,0.12);
  border-radius: 16px; padding: 4px 16px; font-size: 12px;
  color: #8B7D6A; cursor: pointer; transition: all 0.2s;
  font-family: 'PingFang SC', -apple-system, sans-serif;
}
.timeline-btn:hover { border-color: #8B7355; color: #5C4A3A; }
.timeline-btn.active { background: rgba(139,115,85,0.08); color: #5C4A3A; }

/* ========== 标签云 ========== */
.tag-cloud {
  display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap;
}
.tag-cloud-item {
  background: rgba(255,255,255,0.5); border: 1px solid rgba(139,115,85,0.1);
  border-radius: 14px; padding: 4px 14px;
  font-size: 12px; color: #8B7D6A; cursor: pointer;
  transition: all 0.2s;
  font-family: 'PingFang SC', -apple-system, sans-serif;
}
.tag-cloud-item:hover {
  background: rgba(139,115,85,0.08); color: #5C4A3A;
}
.tag-count {
  font-size: 10px; color: #B0A090; margin-left: 4px;
}

/* ========== 地点列表 ========== */
.location-list {
  display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap;
}
.location-item {
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(139,115,85,0.1);
  padding: 12px 18px; border-radius: 10px;
  cursor: pointer; transition: all 0.2s;
  width: calc(50% - 5px); min-width: 200px;
}
.location-item:hover {
  background: rgba(255,255,255,0.7);
  box-shadow: 0 2px 8px rgba(139,115,85,0.05);
}
.location-item .loc-name { font-size: 14px; color: #5C4A3A; font-weight: 500; }
.location-item .loc-count { font-size: 11px; color: #B0A090; margin-top: 2px; }
@media (max-width: 600px) {
  .location-item { width: 100%; }
}

/* ========== 照片网格 ========== */
.photo-grid {
  display: grid; gap: 16px;
  min-height: 120px; position: relative;
}
.photo-grid.grid-view {
  grid-template-columns: repeat(4, 1fr);
}
.photo-grid.list-view {
  grid-template-columns: 1fr;
}

@media (max-width: 1000px) {
  .photo-grid.grid-view { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
@media (max-width: 700px) {
  .photo-grid.grid-view { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (max-width: 420px) {
  .photo-grid.grid-view { grid-template-columns: 1fr; }
}

/* 加载动画 */
.loading-spinner {
  grid-column: 1 / -1; text-align: center; padding: 60px 0;
  font-size: 14px; color: #A99B8A; letter-spacing: 2px;
}

/* ========== 照片卡片 ========== */
.photo-card {
  background: #FFF; border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(139,115,85,0.08), 0 1px 3px rgba(139,115,85,0.05);
  transition: all 0.3s; cursor: pointer;
  animation: fadeUp 0.4s ease-out;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.photo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(139,115,85,0.12), 0 2px 6px rgba(139,115,85,0.08);
}
.photo-card.list-view .photo-placeholder { aspect-ratio: 16 / 9; }

.photo-placeholder {
  width: 100%; aspect-ratio: 1; overflow: hidden;
  background: linear-gradient(135deg, #E8DCCB, #D4C5A9);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.photo-placeholder img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s;
}
.photo-card:hover .photo-placeholder img {
  transform: scale(1.05);
}

.photo-info { padding: 12px 14px 14px; }
.photo-info .date {
  font-size: 11px; color: #A99B8A;
  font-family: 'PingFang SC', -apple-system, sans-serif;
  margin-bottom: 3px;
}
.photo-info .location {
  font-size: 13px; color: #5C4A3A; font-weight: 500;
}
.photo-info .tags {
  display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap;
}
.photo-info .tags span {
  font-size: 10px; background: rgba(139,115,85,0.1);
  color: #6F5B41; padding: 2px 8px; border-radius: 10px;
  font-family: 'PingFang SC', -apple-system, sans-serif;
}

/* ========== 空状态 ========== */
.empty-state { text-align: center; padding: 60px 0; grid-column: 1 / -1; }
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.6; }
.empty-state p { font-size: 15px; color: #8B7D6A; margin-bottom: 4px; }
.empty-hint { font-size: 12px; color: #B0A090; }

/* ========== 加载更多 ========== */
.load-more { text-align: center; padding: 24px 0 8px; }
.btn-load-more {
  background: transparent; border: 1px solid rgba(139,115,85,0.2);
  border-radius: 24px; padding: 8px 32px;
  font-size: 13px; color: #8B7D6A; cursor: pointer;
  transition: all 0.2s;
  font-family: 'PingFang SC', -apple-system, sans-serif;
  letter-spacing: 1px;
}
.btn-load-more:hover {
  border-color: #8B7355; color: #5C4A3A;
  box-shadow: 0 2px 8px rgba(139,115,85,0.05);
}

/* ========== 底部 ========== */
.footer {
  text-align: center; padding: 32px 0 8px;
  border-top: 1px solid rgba(139,115,85,0.1);
  font-size: 12px; color: #A99B8A; letter-spacing: 1px;
  margin-top: 24px;
}

/* ========== 弹窗基础 ========== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(74,63,53,0.5);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow-y: auto;
  animation: fadeIn 0.25s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #FAF5EE; border-radius: 16px;
  max-width: 600px; width: 100%; max-height: 90vh;
  overflow-y: auto; box-shadow: 0 20px 48px rgba(74,63,53,0.15);
  animation: slideUp 0.3s ease-out;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px 16px; border-bottom: 1px solid rgba(139,115,85,0.1);
}
.modal-header h3 { font-size: 18px; color: #5C4A3A; letter-spacing: 1px; font-weight: 500; }
.modal-close {
  background: none; border: none; font-size: 22px; color: #8B7D6A;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
  transition: all 0.2s; line-height: 1;
}
.modal-close:hover { background: rgba(139,115,85,0.08); color: #5C4A3A; }

.modal-body { padding: 24px; }

/* ========== 拖拽区 ========== */
.drop-zone {
  border: 2px dashed rgba(139,115,85,0.2);
  border-radius: 12px; padding: 40px 24px; text-align: center;
  cursor: pointer; transition: all 0.25s;
  background: rgba(255,255,255,0.3);
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: #8B7355;
  background: rgba(139,115,85,0.04);
}
.drop-icon { font-size: 40px; margin-bottom: 8px; opacity: 0.7; }
.drop-zone p { font-size: 14px; color: #8B7D6A; }
.drop-hint { font-size: 11px; color: #B0A090; margin-top: 6px; }

/* ========== 文件列表 ========== */
.file-list { margin-bottom: 16px; }
.file-preview {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 12px; background: rgba(255,255,255,0.4);
  border-radius: 8px; margin-bottom: 8px;
}
.file-preview-thumb { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; }
.file-preview-info { flex: 1; }
.file-preview-name { font-size: 12px; color: #5C4A3A; }
.file-preview-size { font-size: 10px; color: #A99B8A; margin-top: 2px; }
.file-preview-remove {
  background: none; border: none; font-size: 18px;
  color: #B0A090; cursor: pointer; padding: 4px;
  transition: color 0.2s;
}
.file-preview-remove:hover { color: #D45A4A; }

/* ========== 元数据表单 ========== */
.meta-form { margin-bottom: 16px; }
.form-row { margin-bottom: 12px; }
.form-row label {
  display: block; font-size: 12px; color: #8B7D6A;
  margin-bottom: 4px; letter-spacing: 0.5px;
}
.form-row input, .form-row textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid rgba(139,115,85,0.2);
  border-radius: 8px; font-size: 13px; color: #4A3F35;
  background: rgba(255,255,255,0.6);
  font-family: 'PingFang SC', -apple-system, sans-serif;
  outline: none; transition: all 0.2s;
}
.form-row input:focus, .form-row textarea:focus {
  border-color: #8B7355; background: rgba(255,255,255,0.9);
  box-shadow: 0 0 0 2px rgba(139,115,85,0.08);
}
.form-row textarea { resize: vertical; min-height: 48px; }

/* ========== 进度条 ========== */
.upload-progress { margin-bottom: 16px; }
.progress-bar {
  width: 100%; height: 4px; background: rgba(139,115,85,0.1);
  border-radius: 2px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: #8B7355; border-radius: 2px;
  transition: width 0.3s;
}
.progress-text { font-size: 12px; color: #8B7D6A; margin-top: 6px; text-align: center; }

/* ========== 提交按钮 ========== */
.btn-submit {
  width: 100%; padding: 12px; background: #8B7355; color: #FFF;
  border: none; border-radius: 10px; font-size: 15px;
  cursor: pointer; transition: all 0.25s; letter-spacing: 1px;
  font-family: 'PingFang SC', -apple-system, sans-serif;
}
.btn-submit:hover { background: #6F5B41; }
.btn-submit:disabled { opacity: 0.4; cursor: default; }

/* ========== 图片查看弹窗 ========== */
.modal-img-view { align-items: flex-start; padding-top: 40px; }
.modal-img {
  background: transparent; max-width: 960px; width: 100%;
  display: flex; gap: 24px; align-items: flex-start;
  position: relative;
}
.modal-img-close {
  position: absolute; top: 0; right: 0; z-index: 10;
  color: #FFF; font-size: 28px; background: rgba(0,0,0,0.3);
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.modal-img-close:hover { background: rgba(0,0,0,0.5); }

.img-viewer {
  flex: 1; min-width: 0; border-radius: 12px; overflow: hidden;
  background: rgba(0,0,0,0.05);
}
.img-viewer img { width: 100%; display: block; border-radius: 12px; }
.img-placeholder {
  width: 100%; aspect-ratio: 1; display: flex;
  align-items: center; justify-content: center;
}
.spinner {
  width: 32px; height: 32px; border: 3px solid rgba(139,115,85,0.1);
  border-top-color: #8B7355; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.img-info {
  width: 280px; flex-shrink: 0;
  background: #FAF5EE; border-radius: 12px; padding: 20px;
  max-height: 70vh; overflow-y: auto;
}
.detail-meta { margin-bottom: 16px; }
.detail-meta .date { font-size: 11px; color: #A99B8A; }
.detail-meta h3 { font-size: 16px; color: #5C4A3A; margin: 6px 0 4px; font-weight: 500; }
.detail-meta p { font-size: 13px; color: #6F5B41; line-height: 1.5; }

.related-section h4 {
  font-size: 13px; color: #5C4A3A; margin-bottom: 10px; letter-spacing: 1px;
  font-weight: 500;
}
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.related-item {
  aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  background: rgba(139,115,85,0.08); cursor: pointer;
  transition: all 0.2s;
}
.related-item:hover { opacity: 0.7; }
.related-item img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 800px) {
  .modal-img { flex-direction: column; }
  .img-info { width: 100%; max-height: none; }
}

/* ========== 滚动条美化 ========== */
.modal::-webkit-scrollbar, .img-info::-webkit-scrollbar { width: 4px; }
.modal::-webkit-scrollbar-track, .img-info::-webkit-scrollbar-track { background: transparent; }
.modal::-webkit-scrollbar-thumb, .img-info::-webkit-scrollbar-thumb {
  background: rgba(139,115,85,0.15); border-radius: 2px;
}
