/* ==========================================================================
   宫格资料卡（女生卡）
   --------------------------------------------------------------------------
   一条消息 = 一张卡：艺名 / 地址 / 价格 / 联系方式 / 车评 / 标签 / 评分
   + 下面一个照片和视频混排的宫格（3 列）。
   访客页、App、管理端共用这一份样式。
   ========================================================================== */
.wcard {
  --wc-gap: 2px;
  --wc-pad: 8px;
  /* 手机上别太占地方：默认 62vw，最多 300px */
  width: min(62vw, 300px);
  max-width: 100%;
  background: #fff;
  border-radius: 10px;
  padding: 0; /* 无边框：照片直接顶到边缘 */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
  overflow: hidden;
}
/* 电脑上（鼠标）可以稍微大一点，手机上保持紧凑 */
@media (min-width: 700px) {
  .wcard {
    width: min(46vw, 380px);
  }
}
.wcard * {
  box-sizing: border-box;
}
/* 只有文字部分留内边距，宫格本身顶到边 */
.wcard-name,
.wcard-intro,
.wcard-rows,
.wcard-tags,
.wcard-score {
  padding-left: var(--wc-pad);
  padding-right: var(--wc-pad);
}

.wcard-name {
  padding-top: var(--wc-pad);
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
  color: #191919;
  word-break: break-all;
}
.wcard-intro {
  font-size: 12px;
  color: #7a7a7a;
  line-height: 1.45;
  margin-top: 2px;
  word-break: break-all;
}

/* ---------------- 宫格 ---------------- */
.wcard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--wc-gap);
  margin-top: var(--wc-gap);
}
.wcard-grid[data-count='1'] {
  grid-template-columns: 1fr;
}
.wcard-grid[data-count='2'],
.wcard-grid[data-count='4'] {
  grid-template-columns: repeat(2, 1fr);
}
/* 1 张：全宽显示，不要拉成方块 */
.wcard-grid[data-count='1'] .wg-cell {
  aspect-ratio: auto;
  max-height: 60vh;
}
.wcard-grid[data-count='1'] .wg-cell img,
.wcard-grid[data-count='1'] .wg-cell video {
  position: static;
  height: auto;
  max-height: 60vh;
  width: 100%;
  object-fit: contain;
}
.wg-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f5f5f5;
  cursor: pointer;
}
/* 超过 6 格时，最后一格压一层「+N」 */
.wg-more {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.wg-cell img,
.wg-cell video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* 图片用浅底（透明 PNG 才不会变成一坨黑），视频用黑底 */
.wg-cell img {
  background: #f5f5f5;
}
.wg-cell video {
  background: #000;
}
.wg-cell.is-video::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  margin: -9px 0 0 -7px;
  border: 9px solid transparent;
  border-left: 14px solid rgba(255, 255, 255, 0.92);
  border-right: 0;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55));
  pointer-events: none;
}
.wg-dur {
  position: absolute;
  right: 5px;
  bottom: 5px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 10.5px;
  line-height: 1;
  padding: 3px 4px;
  border-radius: 3px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

/* ---------------- 资料行 ---------------- */
.wcard-rows {
  margin-top: 7px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wcard-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: #2c2c2c;
  word-break: break-all;
  white-space: pre-wrap;
}
.wcard-row .wc-ico {
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 1.5;
}
.wcard-row b {
  font-weight: 600;
}
.wcard-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}
.wcard-tags span {
  background: #f0f6ff;
  color: #2f6bd8;
  border-radius: 4px;
  font-size: 11.5px;
  line-height: 1;
  padding: 4px 6px;
}
.wcard-score {
  margin-top: 7px;
  padding-top: 6px;
  padding-bottom: var(--wc-pad);
  border-top: 1px solid #f0f0f0;
  font-size: 11.5px;
  line-height: 1.5;
  color: #576b95;
  word-break: break-all;
}
/* 没有评分那行时，最后一段文字自己留出底边距 */
.wcard-tags:last-child,
.wcard-rows:last-child {
  padding-bottom: var(--wc-pad);
}

/* 深色模式（访客页有暗色主题） */
body.dark .wcard,
html.dark .wcard {
  background: #2c2c2c;
}
body.dark .wcard-name,
html.dark .wcard-name {
  color: #ededed;
}
body.dark .wcard-row,
html.dark .wcard-row {
  color: #d8d8d8;
}
body.dark .wcard-score,
html.dark .wcard-score {
  border-top-color: #3a3a3a;
}
body.dark .wg-cell,
html.dark .wg-cell {
  background: #3a3a3a;
}

/* ---------------- 全屏看图 / 看视频 ---------------- */
.wviewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.wviewer img,
.wviewer video {
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  background: #000;
}
.wviewer .wv-close {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: 14px;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  padding: 6px 10px;
  z-index: 2;
}
.wviewer .wv-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 26px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  z-index: 2;
}
.wviewer[data-many='1'] .wv-nav {
  display: flex;
}
.wviewer .wv-prev {
  left: 10px;
}
.wviewer .wv-next {
  right: 10px;
}
.wviewer .wv-count {
  position: absolute;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.wviewer .wv-tip {
  position: absolute;
  bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  pointer-events: none;
}
.wviewer[data-kind='video'] .wv-tip {
  display: none;
}
