/* 登录后桌面适配 + 丰富界面 + 聊天头像 */

.shell.logged {
  background:
    radial-gradient(800px 360px at 0% 0%, rgba(30,91,184,.08), transparent 50%),
    radial-gradient(700px 300px at 100% 10%, rgba(225,29,72,.06), transparent 45%),
    #f3f5f9;
}

.discover-banner {
  margin: 12px 16px 4px;
  padding: 22px 20px;
  border-radius: 20px;
  color: #fff;
  background-color: #1e5bb8;
  background-image: linear-gradient(120deg, rgba(30,91,184,.92), rgba(225,29,72,.78)), url("/assets/img/login-hero-opt.jpg");
  background-image: linear-gradient(120deg, rgba(30,91,184,.92), rgba(225,29,72,.78)), -webkit-image-set(
    url("/assets/img/login-hero.webp") type("image/webp"),
    url("/assets/img/login-hero-opt.jpg") type("image/jpeg")
  );
  background-size: cover;
  background-position: center;
  box-shadow: 0 12px 28px rgba(30,91,184,.22);
  position: relative;
  overflow: hidden;
}
.discover-banner::after {
  content: "";
  position: absolute;
  right: -20px; top: -30px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.discover-banner .db-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .02em;
  position: relative;
  z-index: 1;
}
.discover-banner .db-sub {
  margin-top: 6px;
  font-size: 13px;
  opacity: .92;
  position: relative;
  z-index: 1;
}

.discover-decor {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px 16px 4px;
}
.decor-item {
  background: #fff;
  border: 1px solid rgba(228,231,238,.9);
  border-radius: 14px;
  padding: 10px 6px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(18,24,38,.04);
}
.decor-item span {
  display: grid;
  place-items: center;
  height: 24px;
  margin-bottom: 4px;
  color: var(--brand, #e11d48);
}
.decor-item span svg { display: block; }
.decor-item b {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #4b5565;
  letter-spacing: .02em;
}
.discover-section-title {
  padding: 12px 16px 2px;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: .02em;
}

.card-user .cover {
  background-size: cover !important;
  background-position: center !important;
}
.photos img,
.avatar,
.profile-hero {
  object-fit: cover;
  background-size: cover !important;
  background-position: center center !important;
}

/* 聊天带头像 */
.chat-head .chat-peer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.chat-head .chat-peer img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #ddd;
  flex: 0 0 auto;
}
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}
.msg-row.mine { flex-direction: row-reverse; }
.msg-row .avatar.sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: #d6dbe6;
}
.msg-row .bubble { max-width: calc(78% - 42px); }

.me-banner {
  margin: 0 16px 14px;
  height: 120px;
  border-radius: 20px;
  background-color: #1e5bb8;
  background-image: linear-gradient(135deg, rgba(18,24,38,.35), rgba(30,91,184,.55)), url("/assets/img/login-hero-opt.jpg");
  background-size: cover;
  background-position: center;
  position: relative;
}
.me-head {
  margin-top: -42px;
  position: relative;
  z-index: 2;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 16px 12px;
}
.stat-box {
  background: #fff;
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid rgba(228,231,238,.8);
}
.stat-box b { display: block; font-size: 18px; color: var(--brand); }
.stat-box span { font-size: 11px; color: var(--muted); font-weight: 600; }

/* ===== 电脑端登录后布局 ===== */
@media (min-width: 900px) {
  .shell.logged .top-desktop {
    display: flex !important;
    position: sticky;
    top: 0;
    z-index: 60;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 28px;
    height: 64px;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 4px 18px rgba(18,24,38,.04);
  }
  .shell.logged .app-stage {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 20px 28px 48px !important;
    min-height: calc(100vh - 64px);
  }
  .shell.logged.chat-open .app-stage {
    max-width: none;
    padding: 0 !important;
  }
  .shell.logged .page > .topbar {
    display: none;
  }
  .shell.logged .page {
    min-height: auto;
    padding-bottom: 24px;
  }
  .shell.logged #page-discover,
  .shell.logged #page-messages,
  .shell.logged #page-me,
  .shell.logged #page-vip,
  .shell.logged #page-edit,
  .shell.logged #page-list {
    background: transparent;
  }

  .discover-banner {
    margin: 0 0 16px;
    padding: 28px 32px;
    border-radius: 24px;
  }
  .discover-banner .db-title { font-size: 26px; }
  .discover-decor {
    padding: 0 0 8px;
    gap: 12px;
    max-width: 640px;
  }
  .decor-item { padding: 14px 10px; border-radius: 16px; }
  .decor-item span { height: 26px; }
  .decor-item b { font-size: 12px; }
  .discover-section-title { padding: 8px 0 6px; font-size: 16px; }
  .filters { padding-left: 0; padding-right: 0; }
  .grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 18px;
    padding: 12px 0 24px;
  }
  .conv-list { padding: 0; max-width: none; }
  .me-wrap { max-width: none; }
  .me-banner { margin: 0 0 0; height: 160px; }
  .stats-row { padding: 0 0 16px; max-width: 520px; }
  .vip-card { margin-left: 0; margin-right: 0; }
  .menu { margin-left: 0; margin-right: 0; }

  .profile-layout {
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
  }
  .profile-hero { border-radius: 0; }
  .profile-body {
    box-shadow: none;
    border-radius: 0;
  }

  .chat-page.active {
    max-width: 920px;
    margin: 0 auto;
    height: 100vh;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
}

@media (min-width: 768px) and (max-width: 899px) {
  .shell.logged .top-desktop { display: flex !important; }
  .grid { grid-template-columns: repeat(3, 1fr) !important; }
}
