/**
 * 一日女友 · 搜索页 Figma 皮肤
 * 对应 Figma 225:29525 / 225:29972 · 1.1 搜索视频
 */

/* ── 顶栏 · 导航 80×38、搜索 370×38（覆盖 shell 320） ── */
body.dg-search-page .nav-search-wrap {
  margin-left: auto !important;
  min-width: 280px !important;
  max-width: 370px !important;
  flex: 0 1 370px !important;
  width: 370px !important;
}
body.dg-search-page .nav-search-box {
  width: 100% !important;
  height: 38px !important;
}

/* ── 页面背景 · Figma 225:29526 粉紫光晕 1923×724 ── */
body.dg-search-page {
  background: #111 !important;
  position: relative;
}

.dg-search-glow {
  position: absolute;
  top: 62px;
  left: 0;
  width: 100%;
  height: 724px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.dg-search-glow img {
  position: absolute;
  /* 稿面 glow 相对 mask：left -399 / top -1284，2579×2902 */
  left: -399px;
  top: -1284px;
  width: 2579px;
  height: 2902px;
  max-width: none;
  display: block;
}

.dg-search-glow::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17, 17, 17, 0.6) 0%, #111 100%);
}

/* 固定顶栏 62px，搜索页没有 .page 容器，必须给 main 留空，否则大搜索框会被挡住 */
body.dg-search-page main.dg-search-wrap,
body.dg-search-page .dg-search-wrap {
  /* body 为 footer 吸底 flex 列；main 若仅 max-width+margin:auto，空态会按内容收缩导致整页「缩小再放大」 */
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  box-sizing: border-box;
  /* 62(nav) + 40 = 与 Figma 搜索条约 y=102 对齐 */
  padding-top: calc(62px + 40px);
}

/* ── 大搜索框区域 · Figma 225:29534 框 1026×60 胶囊 + 按钮 81×40 在外侧 ── */
.dg-search-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 1121px;
  margin: 0 auto;
  z-index: 1;
}

.dg-search-bar-col {
  position: relative;
  flex: 1;
  min-width: 0;
}

.dg-search-bar {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  height: 60px;
  max-height: 60px;
  padding: 0 16px 0 38px;
  gap: 8px;
  background: #252632;
  border: 1px solid #3a3c50;
  border-radius: 34px;
  transition: border-color 0.2s;
}

.dg-search-bar:focus-within {
  border-color: rgba(255, 18, 144, 0.5);
}

.dg-search-bar-ico {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  opacity: 0.85;
  pointer-events: none;
  display: block;
  object-fit: contain;
}

.dg-search-clear {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dg-search-clear[hidden] { display: none; }

.dg-search-clear img {
  width: 24px;
  height: 24px;
  display: block;
}

.dg-search-bar input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 16px;
  font-family: inherit;
  caret-color: #ff1290;
  min-width: 0;
}

/* 与顶栏一致：隐藏原生清除钮，避免与其它清除控件叠成「两个删除」 */
.dg-search-bar input[type="search"]::-webkit-search-decoration,
.dg-search-bar input[type="search"]::-webkit-search-cancel-button,
.dg-search-bar input[type="search"]::-webkit-search-results-button,
.dg-search-bar input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: none !important;
}

.dg-search-bar input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.dg-search-btn {
  box-sizing: border-box;
  width: 81px;
  height: 40px;
  min-width: 81px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: #ff1290;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.15s;
  white-space: nowrap;
}

.dg-search-btn:hover { filter: brightness(1.1); }

/* 历史记录下拉 */
.dg-search-history {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 200;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #1a1b1e;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.dg-search-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: background 0.1s;
}

.dg-search-history-item:hover { background: rgba(255, 18, 144, 0.1); }

.dg-search-history-icon { color: rgba(255, 255, 255, 0.35); font-size: 12px; }

.dg-search-history-empty {
  padding: 16px 12px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.25);
}

/* ── 主内容区 ── */
/* padding 已在上方 body.dg-search-page .dg-search-wrap 统一处理 */

/* ── Tab 栏 · Figma 225:29546 数量徽标贴文案右上角 ── */
.dg-search-tabs {
  display: flex;
  align-items: flex-end;
  gap: 48px;
  border-bottom: 0;
  margin: 28px 0 24px;
  padding-bottom: 0;
  overflow: visible;
}

.dg-search-tab-badge {
  position: absolute;
  top: 0;
  left: 100%;
  transform: translateX(-40%);
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 100px;
  border: 1px solid #35363c;
  background: #27282d;
  color: #ff1290;
  font-size: 16px;
  font-weight: 500;
  line-height: 18px;
  text-align: center;
  box-sizing: border-box;
  pointer-events: none;
  white-space: nowrap;
}

.dg-search-tab {
  position: relative;
  padding: 16px 0 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: #9d9fa8;
  font-size: 18px;
  line-height: 21px;
  font-family: inherit;
  white-space: nowrap;
  overflow: visible;
  transition: color 0.15s;
}

.dg-search-tab-lab {
  display: inline-block;
  line-height: 21px;
}

.dg-search-tab:hover { color: rgba(255, 255, 255, 0.85); }

.dg-search-tab.active {
  color: #fff;
  font-weight: 400;
}

.dg-search-tab.active::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 26px;
  height: 2px;
  background: #ff1290;
  border-radius: 24px;
}

/* ── 结果网格 ── */
.dg-search-grid {
  display: grid;
  gap: 16px;
  align-items: stretch;
}

.dg-search-grid--videos { grid-template-columns: repeat(3, 1fr); }
.dg-search-grid--posts  { grid-template-columns: repeat(3, 1fr); }
.dg-search-grid--girls  { grid-template-columns: repeat(5, 1fr); }

/* ── 视频卡片 ── */
.dg-sc-video {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: 100%;
  background: #1a1b1e;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.15s;
}

.dg-sc-video:hover { transform: translateY(-3px); }

.dg-sc-video-cover {
  position: relative;
  width: 100%;
  padding-top: 58%;
  background: #0a0a0a;
  overflow: hidden;
}

.dg-sc-video-cover > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dg-sc-video-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 6px;
  padding: 0 8px 8px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 56.7%, #000);
  pointer-events: none;
}

.dg-sc-video-dur {
  padding: 4px 7px;
  border-radius: 5px;
  background: rgba(27, 27, 27, 0.4);
  color: #eee;
  font-size: 14px;
  line-height: 14px;
  font-weight: 500;
}

.dg-sc-video-badge {
  padding: 4px 7px;
  border-radius: 5px;
  background: rgba(255, 200, 92, 0.1);
  color: #ffc85c;
  font-size: 14px;
  line-height: 14px;
  font-weight: 500;
}

.dg-sc-video-coin {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px 0 8px;
  border-radius: 10px;
  border: 1px solid #f5d79a;
  background: #322b2c;
  color: #ffc85c;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  box-sizing: border-box;
}

.dg-sc-video-coin img {
  position: relative;
  inset: auto;
  width: 14px;
  height: 14px;
  display: block;
  flex-shrink: 0;
}

.dg-sc-video-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 10px 12px 14px;
}

.dg-sc-video-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.dg-sc-video-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #ff43a7, #ef2df9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.dg-sc-video-avatar img { width: 100%; height: 100%; object-fit: cover; }

.dg-sc-video-name {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dg-sc-video-date {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.dg-sc-video-title {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dg-sc-video-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

.dg-sc-video-tag {
  font-size: 12px;
  line-height: 14px;
  padding: 4px 7px;
  border-radius: 5px;
  color: #ffc85c;
  background: rgba(255, 200, 92, 0.1);
}

.dg-sc-video-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
  flex-shrink: 0;
  font-size: 14px;
  color: #fff;
}

.dg-sc-video-stats span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
}

.dg-sc-video-stats img {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}

/* ── 动态卡片 ── */
.dg-sc-post {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: 100%;
  position: relative;
  background: #1a1b1e;
  border-radius: 12px;
  padding: 14px;
  text-decoration: none;
  transition: transform 0.15s;
}

.dg-sc-post:hover { transform: translateY(-3px); }

.dg-sc-post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-right: 72px;
}

.dg-sc-post-coin {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px 0 6px;
  border-radius: 10px;
  border: 1px solid #f5d79a;
  background: #322b2c;
  color: #ffc85c;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}
.dg-sc-post-coin img {
  width: 10px;
  height: 10px;
  display: block;
}

.dg-sc-post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #ff43a7, #ef2df9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.dg-sc-post-avatar img { width: 100%; height: 100%; object-fit: cover; }

.dg-sc-post-meta { flex: 1; min-width: 0; }

.dg-sc-post-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.3;
}

.dg-sc-post-date { font-size: 11px; color: rgba(255, 255, 255, 0.35); }

.dg-sc-post-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.65;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dg-sc-post.is-paid .dg-sc-post-text {
  color: #fff;
  font-weight: 500;
  -webkit-line-clamp: 2;
}

.dg-sc-post-topics {
  font-size: 11px;
  color: #ff1290;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dg-sc-post-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }

.dg-sc-post-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
}

.dg-sc-post-imgs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.dg-sc-post-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.dg-sc-post .post-lock {
  box-sizing: border-box;
  width: 100%;
  min-height: 130px;
  margin: 0 0 10px;
  padding: 16px 10px 14px;
  border-radius: 8px;
  border: 1px solid #35363c;
  background: linear-gradient(160deg, rgb(35, 29, 25) 5.8%, rgb(79, 77, 86) 93.5%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
}
.dg-sc-post .post-lock-head {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.dg-sc-post .post-lock-head img {
  width: 16px;
  height: 15px;
  display: block;
}
.dg-sc-post .post-lock-coins {
  margin: 0;
  color: #b3b3b3;
  font-size: 12px;
  font-weight: 400;
  line-height: normal;
}
.dg-sc-post .post-lock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 108px;
  height: 30px;
  margin-top: 4px;
  border-radius: 12px;
  background: linear-gradient(105deg, rgb(255, 67, 167) 0%, rgb(239, 45, 249) 95.3%);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

/* 搜索动态卡底栏 · Figma 225:30458 · 贴卡片底 */
.dg-sc-post-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.12);
}

.dg-sc-post-stats span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #fff;
}

.dg-sc-post-stats img {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}

/* ── 女友卡片 ── */
.dg-sc-girl {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: 100%;
  text-decoration: none;
  transition: transform 0.15s;
}

.dg-sc-girl:hover { transform: translateY(-3px); }

.dg-sc-girl-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
  background: #1a1b1e;
  flex-shrink: 0;
}

.dg-sc-girl-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.dg-sc-girl-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dg-sc-girl-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dg-sc-girl-author {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 6px;
}

.dg-sc-girl-author-ico {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #ff43a7, #ef2df9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  flex-shrink: 0;
}

.dg-sc-girl-author-ico img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dg-sc-girl-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; }

.dg-sc-girl-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  cursor: pointer;
}

.dg-sc-girl-tag--pink   { background: rgba(255, 18, 144, 0.6); color: #fff; }
.dg-sc-girl-tag--gray   { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.65); }
.dg-sc-girl-tag--purple { background: rgba(141, 55, 249, 0.5); color: #fff; }

.dg-sc-girl-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
  flex-shrink: 0;
}

.dg-sc-girl-stars { color: #ffd700; font-size: 12px; }
.dg-sc-girl-price { font-size: 12px; color: rgba(255, 255, 255, 0.55); }

/* ── 空状态 ── */
.dg-search-empty {
  padding: 64px 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 14px;
}

.dg-search-empty-ico {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.4;
}

/* ── 分页器（对齐 Figma：共 N 条 · ‹12345› · 前往 X 页） ── */
.dg-search-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 36px;
  flex-wrap: wrap;
  font-size: 16px;
}

.dg-search-total {
  color: #fff;
  letter-spacing: -0.01px;
  white-space: nowrap;
  margin-right: 0;
}

.dg-search-pager-pages {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dg-search-pager button {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 2px;
  border: 0;
  background: #232429;
  color: #fff;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.dg-search-pager button:hover:not(:disabled) {
  background: #2e3038;
}

.dg-search-pager button.active {
  background: #ff1290;
  color: #fff;
  font-weight: 600;
}

.dg-search-pager button:disabled { opacity: 0.35; cursor: not-allowed; }

.dg-search-pager-goto {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  white-space: nowrap;
  font-size: 16px;
}

.dg-search-pager-goto input {
  width: 40px;
  height: 24px;
  padding: 0 4px;
  border-radius: 2px;
  border: 1px solid #dcdfe6;
  background: #232429;
  color: #fff;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  outline: none;
  -moz-appearance: textfield;
}

.dg-search-pager-goto input::-webkit-outer-spin-button,
.dg-search-pager-goto input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

body.dg-search-page .dg-site-footer {
  position: relative;
  z-index: 1;
}
@media (max-width: 1200px) {
  .dg-search-grid--girls { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
  .dg-search-grid--videos { grid-template-columns: repeat(2, 1fr); }
  .dg-search-grid--posts  { grid-template-columns: repeat(2, 1fr); }
  .dg-search-grid--girls  { grid-template-columns: repeat(3, 1fr); }
  .dg-search-hero { margin: 20px 0 0; }
}

@media (max-width: 600px) {
  .dg-search-grid--videos { grid-template-columns: 1fr; }
  .dg-search-grid--posts  { grid-template-columns: 1fr; }
  .dg-search-grid--girls  { grid-template-columns: repeat(2, 1fr); }
  .dg-search-tabs { gap: 24px; }
  .dg-search-tab { font-size: 14px; }
}
