/* ============================================================
   方案二：中等改造  — 角标 / 标题浮层 / 吸顶 / 暗色 / 空状态
   ============================================================ */

/* --- 继承方案一的核心 --- */
@import "theme-v1.css";

/* --- 隐藏卡片图片上的编号徽章 --- */
.card-num-badge {
  display: none;
}

/* --- 分类/时长/信息 气泡美化 --- */
.product-meta > span:first-child {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: #eaf2ef;
  color: var(--brand-dark);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.price-stack {
  display: flex;
  align-items: center;
  gap: 10px;
}

.price-stack small {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: #f5f0eb;
  color: #8b6f5a;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.info-line {
  gap: 8px;
}
.info-line span {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: #f0f4f8;
  color: #5a738b;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

/* 气泡悬停微效 */
.product-meta > span:first-child:hover,
.price-stack small:hover,
.info-line span:hover {
  filter: brightness(0.95);
  transition: filter 150ms ease;
}


/* --- 角标系统 --- */
/* --- 精选角标 --- */
.product-card[data-featured] .card-img-wrap::after {
  content: "精选";
  position: absolute;
  top: 10px; right: 10px;
  background: linear-gradient(135deg, #c8963e, #e0b860);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(200,150,62,0.3);
  z-index: 2;
}

/* --- 标题浮层：渐变遮罩 + 标题叠在图上 --- */
.list-view .product-card {
  grid-template-columns: 1fr;
  grid-template-rows: 280px auto;
  min-height: auto;
}
.list-view .card-img-wrap {
  grid-row: 1;
  position: relative;
}
.list-view .card-img-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 50%);
  z-index: 1;
  opacity: 0;
  transition: opacity 300ms ease;
}
.list-view .product-card:hover .card-img-wrap::before {
  opacity: 1;
}
.list-view .card-img-wrap img {
  height: 280px;
  object-fit: cover;
}
.list-view .product-body {
  padding: 16px 18px;
}
.list-view .product-body h2 {
  font-size: 19px;
}
.list-view .card-num-badge {
  z-index: 2;
  top: 12px; left: 12px;
}
/* 标题叠在图片底部 */
.list-view .product-card h2 {
  position: absolute;
  bottom: 14px; left: 18px; right: 18px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  z-index: 2;
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 300ms ease, transform 300ms ease;
  pointer-events: none;
}
.list-view .product-card:hover h2 {
  opacity: 1;
  transform: translateY(0);
}

/* --- 工具栏吸顶 --- */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.85);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  margin-bottom: 20px;
  padding: 14px 18px;
}

/* --- 价格强化 --- */
.price-stack strong {
  background: linear-gradient(135deg, var(--accent), #e07b65);
  color: #fff;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
}

/* --- 空状态插画 --- */
.empty-state {
  background: #fafaf8;
  border: 2px dashed var(--line);
  border-radius: 16px;
  min-height: 240px;
  font-size: 16px;
  color: #a0a8ac;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.empty-state::before {
  content: "🔍";
  font-size: 48px;
  opacity: 0.4;
}

/* --- 暗色模式 --- */
@media (prefers-color-scheme: dark) {
  body {
    background: #1a1e20;
    color: #d8dcdd;
  }
  .product-card {
    background: #24282a;
    border-color: #33383a;
  }
  .product-card:hover {
    border-color: var(--brand);
  }
  .toolbar {
    background: rgba(26,30,32,0.85);
    border-color: #33383a;
  }
  .product-body p { color: #9aa0a4; }
  .tag {
    background: #2a3235;
    color: #8cc4c9;
  }
  .site-header {
    background: #1e2224;
    border-color: #33383a;
  }
  input, select {
    background: #2a2e30;
    border-color: #444;
    color: #d8dcdd;
  }
  .empty-state {
    background: #1e2224;
    border-color: #3a4044;
  }
  .detail-dialog {
    background: #24282a;
  }
  .detail-info {
    background: #24282a;
  }
  .detail-img-wrap {
    background: #1a1e20;
  }
}

/* --- 品牌标题美化 --- */
.site-header {
  justify-content: center;
  text-align: center;
  min-height: 140px;
  padding: 40px 20px 32px;
  background: linear-gradient(180deg, #faf9f5 0%, #f3f1ea 100%);
  border-bottom: 2px solid #e8e4d8;
  position: relative;
  overflow: hidden;
}

.site-header::before {
  content: "";
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(47,111,115,0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.site-title {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #1a5c60 0%, #2f6f73 40%, #3d8a8f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  line-height: 1.3;
  position: relative;
}

.title-sub {
  margin: 10px 0 0;
  font-size: 14px;
  color: #8b9a9d;
  letter-spacing: 0.15em;
  font-weight: 400;
}

.top-actions {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
}

/* ============================================================
   移动端全面优化 (≤ 760px)
   ============================================================ */
@media (max-width: 760px) {

  /* --- 标题区域：强制居中 --- */
  .site-header {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 28px 16px 20px;
    min-height: auto;
  }
  .brand-block {
    width: 100%;
    text-align: center;
  }
  .site-title {
    font-size: 24px;
    letter-spacing: 0.04em;
  }
  .title-sub {
    font-size: 12px;
    margin-top: 6px;
  }
  .top-actions {
    position: static;
    transform: none;
    margin-top: 12px;
    display: flex;
    justify-content: center;
  }
  .top-actions .ghost-button {
    font-size: 13px;
    min-height: 34px;
    padding: 0 12px;
  }

  /* --- 隐藏视图切换按钮 --- */
  .view-toggle {
    display: none;
  }

  /* --- 列表卡片：16:9 比例 --- */
  .list-view .product-card {
    grid-template-rows: auto auto;
  }
  .list-view .card-img-wrap {
    aspect-ratio: 16 / 9;
    height: auto;
  }
  .list-view .card-img-wrap img {
    height: 100%;
    width: 100%;
    object-fit: cover;
  }

  /* --- 工具栏不吸顶，精简布局 --- */
  .toolbar {
    position: static;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #fff;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 12px;
  }
  .toolbar .search-wrap {
    grid-column: 1 / -1;
  }
  .toolbar label {
    font-size: 11px;
  }
  .toolbar input,
  .toolbar select {
    min-height: 36px;
    font-size: 13px;
    padding: 6px 8px;
  }

  /* --- 商品卡片间距 --- */
  .products {
    gap: 10px;
  }
  .product-body {
    padding: 12px 14px;
    gap: 6px;
  }
  .product-body h2 {
    font-size: 16px;
  }
  .product-summary {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }
  .product-meta > span:first-child {
    font-size: 11px;
    padding: 2px 8px;
  }
  .price-stack strong {
    font-size: 12px;
    padding: 2px 8px;
  }
  .price-stack small {
    font-size: 11px;
    padding: 2px 8px;
  }
  .info-line span {
    font-size: 11px;
    padding: 2px 7px;
  }
  .tag {
    font-size: 10px;
    min-height: 22px;
    padding: 0 7px;
  }

  /* --- 详情弹窗：全屏 + 可滚动 --- */
  .detail-dialog {
    max-width: 100%;
    width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
  }
  #detailContent {
    grid-template-columns: 1fr;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .detail-img-wrap {
    max-height: 45vh;
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f3f5f5;
  }
  .detail-img-wrap img {
    max-height: 45vh;
    object-fit: contain;
  }
  .detail-info {
    padding: 16px;
    gap: 12px;
    max-height: none;
    overflow: visible;
  }
  .detail-header {
    flex-direction: row;
    gap: 10px;
  }
  .detail-num {
    min-width: 40px;
    height: 40px;
    font-size: 16px;
    border-radius: 10px;
  }
  .detail-header h2 {
    font-size: 18px;
  }
  #detailContent p {
    max-height: none;
    font-size: 13px;
    line-height: 1.7;
  }
  #detailContent .info-boxes {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  #detailContent .info-boxes span {
    font-size: 11px;
    min-height: 32px;
  }

  /* --- 关闭按钮 --- */
  .dialog-close {
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    font-size: 16px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    z-index: 20;
  }

  /* --- 分页简化 --- */
  .pager {
    gap: 6px;
  }
  .pager button {
    min-width: 48px;
    font-size: 12px;
    padding: 0 8px;
    min-height: 34px;
  }
  #pageInfo {
    font-size: 12px;
    min-width: 80px;
  }

  /* --- 结果行 --- */
  .result-line {
    min-height: 32px;
    font-size: 13px;
    margin-bottom: 0;
  }
  #resultCount {
    font-size: 12px;
  }
}
