/* ══════════════════════════════════════════
   鳌鲨渔具 · 战利品图片墙
   响应式Grid · 固定比例 · 悬浮微交互
   ══════════════════════════════════════════ */

:root {
  --bg: #000;
  --surface: #0d0d0d;
  --card: #141414;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.1);
  --text: rgba(255,255,255,0.92);
  --text2: rgba(255,255,255,0.5);
  --text3: rgba(255,255,255,0.25);
  --accent: #d4a843;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; }

/* ═══ 顶栏 ═══ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 48px;
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.9);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
}
.topbar-logo {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text2);
  letter-spacing: 1.5px;
  transition: .2s;
}
.topbar-logo:hover { color: var(--text); }

/* ═══ 主舞台 ═══ */
.stage {
  min-height: 100vh;
  padding-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ═══ 搜索框 ═══ */
.search-box {
  max-width: 520px;
  width: 100%;
  padding: 60px 20px 0;
}
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  transition: .2s;
}
.search-input-wrap:focus-within {
  border-color: var(--border-hover);
  background: #111;
}
.search-input-wrap .icon {
  color: var(--text3);
  font-size: 0.8rem;
  flex-shrink: 0;
}
.search-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.88rem;
  padding: 11px 0;
  font-family: inherit;
}
.search-input-wrap input::placeholder { color: var(--text3); }
.search-input-wrap .clear {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 4px;
  display: none;
}
.search-input-wrap .clear.show { display: block; }

/* ═══ 搜索结果区 ═══ */
.result-area {
  width: 100%;
  max-width: 1200px;
  padding: 0 20px;
  display: none;
  animation: fadeUp .3s ease;
}
.result-area.show { display: block; }
.result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 16px;
  font-size: 0.78rem;
  color: var(--text2);
}
.result-top .back-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 0;
  transition: .15s;
}
.result-top .back-btn:hover { color: var(--text2); }

/* ═══ 核心：响应式Grid图片墙 ═══ */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding-bottom: 48px;
}

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

/* ═══ 图片卡片 ═══ */
.card {
  border-radius: 8px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  animation: fadeUp .35s ease both;
}
.card:nth-child(1) { animation-delay: .00s; }
.card:nth-child(2) { animation-delay: .04s; }
.card:nth-child(3) { animation-delay: .08s; }
.card:nth-child(4) { animation-delay: .12s; }
.card:nth-child(5) { animation-delay: .16s; }
.card:nth-child(n+6) { animation-delay: .2s; }

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  border-color: var(--border-hover);
}

/* 固定比例容器 + 裁切 */
.card .img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface);
}
.card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.card:hover .img-wrap img {
  transform: scale(1.06);
}

/* ═══ Hover遮罩 ═══ */
.card .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.85) 0%,
    rgba(0,0,0,0.6) 40%,
    rgba(0,0,0,0) 60%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.card:hover .overlay {
  opacity: 1;
}

.overlay .name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  margin-bottom: 2px;
}
.overlay .prod {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.65);
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  margin-bottom: 8px;
}
.overlay .like-btn {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  transition: all .2s;
  font-family: inherit;
  backdrop-filter: blur(4px);
}
.overlay .like-btn:hover {
  background: rgba(244,67,54,0.15);
  border-color: rgba(244,67,54,0.25);
  color: #f44336;
}
.overlay .like-btn i {
  font-size: 0.8rem;
  transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.overlay .like-btn.liked {
  background: rgba(244,67,54,0.15);
  border-color: rgba(244,67,54,0.25);
  color: #f44336;
}
.overlay .like-btn.liked i {
  animation: pop .35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.4); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* ═══ 空状态 ═══ */
.empty-state {
  display: none;
  text-align: center;
  padding: 80px 20px;
  max-width: 360px;
}
.empty-state.show { display: block; animation: fadeUp .3s ease; }
.empty-state .fish { font-size: 2.2rem; margin-bottom: 12px; opacity: 0.4; }
.empty-state h3 { font-size: 0.95rem; font-weight: 400; color: var(--text2); margin-bottom: 4px; }
.empty-state p { font-size: 0.78rem; color: var(--text3); }

/* ═══ 加载 ═══ */
.load-spin { display: none; justify-content: center; padding: 30px 0; }
.spin {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--text3);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ 底部 ═══ */
.footer {
  text-align: center;
  padding: 40px 16px 32px;
  font-size: 0.78rem;
  color: var(--text2);
  margin-top: auto;
  width: 100%;
  letter-spacing: 0.3px;
}
.footer svg {
  vertical-align: -2px;
  margin-right: 3px;
  opacity: 0.8;
}
.footer a { color: var(--text3); }
.footer a:hover { color: var(--text2); }

/* ═══ 灯箱（复用） ═══ */
.viewer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.95);
}
.viewer.show { display: flex; flex-direction: column; }
.viewer-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 14px;
}
.viewer-close {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.06);
  border: none;
  border-radius: 6px;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .15s;
}
.viewer-close:hover { background: rgba(255,255,255,0.1); color: #fff; }
.viewer-prev, .viewer-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  z-index: 10;
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.04);
  border: none;
  border-radius: 6px;
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .15s;
  opacity: 0;
}
.viewer:hover .viewer-prev, .viewer:hover .viewer-next { opacity: 1; }
.viewer-prev:hover, .viewer-next:hover { background: rgba(255,255,255,0.1); color: #fff; }
.viewer-prev { left: 12px; }
.viewer-next { right: 12px; }
.viewer-body {
  display: flex;
  width: 100%; height: 100%;
  align-items: center;
  justify-content: center;
  padding: 52px 60px;
  gap: 24px;
}
.viewer-img {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 100%;
}
.viewer-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}
.viewer-info { width: 200px; min-width: 200px; }
.viewer-info .angler { font-size: 0.85rem; font-weight: 500; color: var(--text); margin-bottom: 1px; }
.viewer-info .product { font-size: 0.75rem; color: var(--text2); margin-bottom: 10px; }
.viewer-info .review {
  font-size: 0.78rem; color: var(--text); line-height: 1.5; opacity: 0.7;
  border-left: 2px solid var(--accent); padding-left: 10px;
}
.viewer-info .extra { font-size: 0.7rem; color: var(--text3); margin-top: 8px; }
.viewer-info .like-btn { margin-top: 12px; }

/* ═══ 响应式 ═══ */
@media (max-width: 900px) {
  .result-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
  }
  .result-area { padding: 0 16px; }
}

@media (max-width: 600px) {
  .result-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-bottom: 32px;
  }
  .result-area { padding: 0 12px; }
  .search-box { padding: 40px 16px 0; }
  .search-input-wrap input { font-size: 0.85rem; padding: 10px 0; }
  .result-top { padding: 16px 0 10px; }
  .card .img-wrap { aspect-ratio: 4 / 3; }

  /* 手机端：hover遮罩改为一直可见（但淡化），方便触屏 */
  .card .overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 40%, transparent 60%);
    padding: 12px;
  }
  .overlay .like-btn { padding: 3px 8px; font-size: 0.65rem; }

  .footer { padding: 32px 12px 24px; }
}
