/**
 * 人脉页独立样式（全部挂在 .rm-page 下，避免与全站/模板 CSS 互相覆盖）
 * 主题只改色，不改布局结构
 */

.rm-page {
  --rm-max: 1100px;
  --rm-radius: 14px;
  --rm-ink: var(--theme-ink, #0f1c2e);
  --rm-sea: var(--theme-sea, #1a4a5c);
  --rm-accent: var(--theme-accent, #d4782f);
  --rm-muted: var(--theme-muted, #6a7785);
  --rm-card: var(--theme-card, #fff);
  --rm-line: var(--theme-line, rgba(15, 28, 46, .08));
  --rm-nav: var(--theme-nav, linear-gradient(90deg, #0f1c2e, #1a4a5c));
  color: var(--rm-ink);
  padding-bottom: 48px;
}

.rm-page a {
  color: inherit;
  text-decoration: none;
  box-shadow: none;
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}
.rm-page a:hover,
.rm-page a:focus,
.rm-page a:active {
  color: inherit;
  text-decoration: none;
  box-shadow: none;
  outline: none;
}
.rm-page h1,
.rm-page h2,
.rm-page h3,
.rm-page h5 {
  color: inherit;
  margin: 0;
  font-family: inherit;
  font-weight: 700;
  line-height: 1.3;
}
.rm-page img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* Hero */
.rm-page .rm-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  margin-bottom: 16px;
  background: var(--rm-nav);
}
.rm-page .rm-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 90% 10%, rgba(255,255,255,.12), transparent 42%);
  pointer-events: none;
}
.rm-page .rm-cover-block {
  padding: 8px;
  overflow: visible;
  background: #eef2f5;
}
.rm-page .rm-cover-block__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  border-radius: 10px;
  background: #eef2f5;
}
.rm-page .rm-album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.rm-page .rm-album-grid a,
.rm-page .rm-album-grid .rm-album-item {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #eef2f5;
  cursor: pointer;
}
.rm-page .rm-album-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
@media (max-width: 575px) {
  .rm-page .rm-album-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.rm-viewer {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  flex-direction: column;
  background: rgba(8, 10, 14, .96);
  color: #fff;
}
.rm-viewer.is-on {
  display: flex;
}
.rm-viewer__bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  background: rgba(0, 0, 0, .45);
}
.rm-viewer__count {
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: .04em;
}
.rm-viewer__tools {
  display: flex;
  gap: 8px;
}
.rm-viewer__bar button {
  min-width: 44px;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
}
.rm-viewer__close {
  background: #c45c26 !important;
  font-weight: 700;
  font-size: .92rem !important;
  padding: 0 12px;
}
.rm-viewer__stage {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  padding: 8px 48px 8px;
}
.rm-viewer__stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
  will-change: transform;
}
.rm-viewer__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 72px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
.rm-viewer__prev { left: 6px; }
.rm-viewer__next { right: 6px; }
.rm-viewer__hint {
  flex: 0 0 auto;
  margin: 0;
  padding: 6px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: .75rem;
  opacity: .7;
}
@media (max-width: 767px) {
  .rm-viewer__stage {
    padding: 4px 42px;
  }
  .rm-viewer__nav {
    width: 36px;
    height: 88px;
    font-size: 1.7rem;
  }
}
.rm-page .rm-hero__inner {
  position: relative;
  max-width: var(--rm-max);
  margin: 0 auto;
  padding: 18px 16px 16px;
}
.rm-page .rm-hero__eyebrow {
  font-size: .75rem;
  letter-spacing: .16em;
  opacity: .8;
  margin-bottom: 4px;
}
.rm-page .rm-hero h1 {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  font-weight: 800;
  color: #fff;
}
.rm-page .rm-hero p {
  margin: 0;
  max-width: 36em;
  opacity: .88;
  line-height: 1.55;
  font-size: .95rem;
  color: #fff;
}

/* Toolbar */
.rm-page .rm-toolbar {
  max-width: var(--rm-max);
  margin: 0 auto 14px;
  padding: 0 16px;
}
.rm-page .rm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.rm-page .rm-tabs a {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .9rem;
  color: var(--rm-sea) !important;
  background: #fff;
  border: 1px solid var(--rm-line);
}
.rm-page .rm-tabs a.active,
.rm-page .rm-tabs a.is-on,
.rm-page .rm-tabs a:hover {
  background: var(--rm-sea);
  color: #fff !important;
  border-color: var(--rm-sea);
}
.rm-page .rm-filter {
  background: var(--rm-card);
  border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius);
  padding: 12px 14px;
}
.rm-page .rm-filter label {
  display: block;
  font-size: .8rem;
  color: var(--rm-muted);
  margin-bottom: 4px;
}
.rm-page .rm-filter .form-control {
  border-radius: 8px;
  border-color: #dce3ea;
  min-height: 40px;
  color: var(--rm-ink);
}
.rm-page .rm-filter .rm-submit {
  min-height: 40px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: var(--rm-accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

/* List */
.rm-page .rm-wrap {
  max-width: var(--rm-max);
  margin: 0 auto;
  padding: 0 16px;
}
.rm-page .pg-gate {
  margin-bottom: 12px;
}
.rm-page .rm-people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.rm-page .rm-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 14px 16px;
  border-radius: var(--rm-radius);
  background: var(--rm-card);
  border: 1px solid var(--rm-line);
  color: var(--rm-ink) !important;
}
.rm-page .rm-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--rm-sea) 30%, var(--rm-line));
  box-shadow: 0 10px 24px rgba(15, 28, 46, .08);
}
.rm-page .rm-card__top {
  margin-bottom: 10px;
}
.rm-page .rm-card__avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: #e8eef2;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}
.rm-page .rm-card__name {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--rm-ink);
}
.rm-page .rm-card__meta {
  color: var(--rm-muted);
  font-size: .85rem;
  line-height: 1.4;
}
.rm-page .rm-card__tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: .72rem;
  background: color-mix(in srgb, var(--rm-accent) 14%, #fff);
  color: var(--rm-accent);
}
.rm-page .rm-card__arrow {
  display: none;
}
.rm-page .rm-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 16px;
  color: var(--rm-muted);
  background: var(--rm-card);
  border-radius: var(--rm-radius);
  border: 1px dashed var(--rm-line);
}

/* 排序条 */
.rm-page .rm-sort {
  max-width: var(--rm-max);
  margin: 0 auto 14px;
  padding: 0 16px;
}
.rm-page .rm-sort__label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--rm-muted);
  margin-bottom: 8px;
}
.rm-page .rm-sort__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rm-page .rm-sort__item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--rm-line);
  background: var(--rm-card);
  color: var(--rm-sea) !important;
  font-size: .88rem;
  font-weight: 600;
}
.rm-page .rm-sort__item.active {
  background: var(--rm-sea);
  border-color: var(--rm-sea);
  color: #fff !important;
}
.rm-page .rm-sort__item.is-locked {
  opacity: .72;
  background: #f6f7f8;
  color: var(--rm-muted) !important;
}
.rm-page .rm-sort__item.is-locked span {
  font-size: .7rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0,0,0,.08);
}
.rm-page .rm-sort__tip {
  margin: 8px 0 0;
  font-size: .82rem;
  color: #ad4e00;
  line-height: 1.45;
}

/* Profile detail */
.rm-page .rm-profile {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px 48px;
}
.rm-page .rm-panel {
  background: var(--rm-card);
  border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius);
  padding: 18px;
  margin-bottom: 12px;
}
.rm-page .rm-kv {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 8px;
  color: var(--rm-ink);
}
.rm-page .rm-kv span {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--rm-accent) 12%, #fff);
  color: var(--rm-accent);
  font-size: .75rem;
  margin-right: 6px;
}

@media (max-width: 767px) {
  .rm-page .rm-people {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .rm-page .rm-card {
    padding: 12px 8px 12px;
  }
  .rm-page .rm-card__top {
    width: 100%;
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
  }
  /* 不用 min()，兼容微信内置浏览器；头像尽量撑满卡片 */
  .rm-page .rm-card__avatar {
    width: 92% !important;
    max-width: 180px !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    min-height: 120px;
    border-width: 2px;
  }
  .rm-page .rm-card__name {
    font-size: .95rem;
  }
  .rm-page .rm-card__meta {
    font-size: .78rem;
  }
}

@media (max-width: 575px) {
  .rm-page .rm-card__avatar {
    width: 94% !important;
    max-width: 190px !important;
    min-height: 130px;
  }
}

@media (min-width: 768px) {
  .rm-page .rm-people {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
  }
  .rm-page .rm-card {
    padding: 20px 16px 18px;
  }
  .rm-page .rm-card__avatar {
    width: 112px;
    height: 112px;
  }
}

/* 不支持 aspect-ratio 时用固定大尺寸兜底 */
@supports not (aspect-ratio: 1 / 1) {
  @media (max-width: 767px) {
    .rm-page .rm-card__avatar {
      width: 140px !important;
      height: 140px !important;
      min-height: 0;
    }
  }
  @media (max-width: 575px) {
    .rm-page .rm-card__avatar {
      width: 150px !important;
      height: 150px !important;
    }
  }
}

/* 社交增强 */
.rm-page .rm-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  font-size: .86rem;
  opacity: .92;
}
.rm-page .rm-stats span {
  background: rgba(255,255,255,.12);
  padding: 3px 10px;
  border-radius: 999px;
}
.rm-page .rm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.rm-page .rm-actions form { margin: 0; }
.rm-page .rm-post {
  padding: 12px 0;
  border-bottom: 1px solid var(--rm-line);
}
.rm-page .rm-post:last-child { border-bottom: 0; padding-bottom: 0; }
.rm-page .rm-post__meta {
  font-size: .78rem;
  color: var(--rm-muted);
  margin-bottom: 6px;
}
.rm-page .rm-post__body {
  white-space: pre-wrap;
  line-height: 1.55;
}
.rm-page .rm-post__imgs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.rm-page .rm-post__imgs img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
}
.rm-page .rm-people-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}
.rm-page .rm-people-list .rm-people__item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
}
.rm-page .rm-people-list .rm-people__item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.rm-page .rm-people-list .rm-people__item small {
  color: var(--rm-muted);
  font-size: .75rem;
}
.rm-page .rm-hub {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 575px) {
  .rm-page .rm-hub { grid-template-columns: 1fr; }
}
.rm-page .rm-hub a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f4f7f9;
  border: 1px solid var(--rm-line);
}
.rm-page .rm-hub a strong { font-size: 1rem; }
.rm-page .rm-hub a span { font-size: .82rem; color: var(--rm-muted); }
.rm-page .rm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rm-line);
}
.rm-page .rm-row:last-child { border-bottom: 0; }
.rm-page .rm-row__user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.rm-page .rm-row__user img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.rm-page .rm-row__acts {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.rm-page .rm-row__acts form { margin: 0; }

