/* 微博 · 自原项目 pages.css 迁移（完整规则体） */

/* Weibo page */
.weibo-page { padding-bottom: calc(12px + var(--safe-bottom)); }
.weibo-feed {
  position: relative;
}
.weibo-feed.has-bg {
  background-repeat: no-repeat;
}
.weibo-feed-top {
  padding-top: 4px;
}
.weibo-feed-body {
  position: relative;
  z-index: 1;
  background: var(--bg);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  margin-top: 8px;
  padding-top: 8px;
}
.weibo-post {
  background: var(--bg-card);
  padding: 16px;
  border-bottom: 8px solid var(--bg);
}
.weibo-post-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.weibo-post-name { font-weight: 600; font-size: var(--font-md); }
.weibo-post-meta { font-size: var(--font-xs); color: var(--text-hint); }
.weibo-post-content { font-size: var(--font-md); line-height: 1.6; margin-bottom: 10px; }
.social-post-media-strip {
  margin-top: 4px;
  margin-bottom: 8px;
}
/* 朋友圈/微博/论坛正文中的 [表情包:名] 内联图与换行 */
.social-richtext {
  white-space: pre-wrap;
  word-break: break-word;
}
.social-richtext .chat-sticker-inline-wrap {
  vertical-align: text-bottom;
}
.weibo-post-images { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 10px; }
.weibo-post-images img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.weibo-post-actions { display: flex; justify-content: space-around; padding-top: 10px; border-top: 1px solid var(--border); }
.weibo-action-btn {
  display: flex; align-items: center; gap: 4px;
  font-size: var(--font-sm); color: var(--text-secondary); padding: 4px 8px;
}

/* Shared page scroll + cards */
.page-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 24px;
  -webkit-overflow-scrolling: touch;
}
.card-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.modal-sheet-tall {
  max-height: 88vh;
  overflow-y: auto;
}

/* 分享至聊天：固定弹层高度，列表内滚动，避免空白无限下滑 */
#modal-container .modal-overlay:has(.wb-share-sheet) {
  overscroll-behavior: none;
  touch-action: none;
}
#modal-container .modal-sheet.wb-share-sheet {
  display: flex;
  flex-direction: column;
  max-height: min(70dvh, calc(var(--app-height, 100dvh) - 24px));
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  touch-action: manipulation;
}
#modal-container .modal-sheet.wb-share-sheet .wb-share-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
}
#modal-container .modal-sheet.wb-share-sheet .wb-share-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(52dvh, 420px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#modal-container .modal-sheet.wb-share-sheet .wb-share-chat {
  flex-shrink: 0;
  width: 100%;
}

/* Weibo */
.weibo-page,
.forum-page,
.moments-page,
.schedule-page,
.world-book-page,
.timeline-select-page,
.au-panel-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.weibo-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.weibo-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated, var(--bg-paper-deep));
  font-size: 20px;
}
.weibo-profile-link {
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.weibo-post-name.weibo-profile-link {
  display: inline;
  font-weight: 600;
  font-size: var(--font-md);
  color: inherit;
}
.weibo-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.weibo-post-name { font-weight: 600; font-size: var(--font-md); }
.weibo-v-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  height: 14px;
  border-radius: 999px;
  margin-left: 4px;
  padding: 0 3px;
  font-size: 10px;
  line-height: 1;
  color: #fff;
  background: #ff3b30;
  vertical-align: middle;
}
.weibo-post-meta { font-size: var(--font-xs); color: var(--text-hint); }
.weibo-post-content { font-size: var(--font-sm); line-height: 1.5; white-space: pre-wrap; }
.weibo-repost-origin {
  margin: 4px 0 8px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  color: #6b7d95;
  background: #f6f9ff;
  border: 1px solid #e4edf9;
}
.weibo-images {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}
.weibo-images.is-single {
  grid-template-columns: 1fr;
  max-width: min(100%, 280px);
}
.weibo-images.is-four {
  grid-template-columns: repeat(2, 1fr);
  max-width: 260px;
}
.weibo-images.is-grid {
  grid-template-columns: repeat(3, 1fr);
  max-width: 320px;
}
.weibo-img-cell {
  position: relative;
  min-width: 0;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(120, 140, 170, 0.08);
}
.weibo-images.is-four .weibo-img-cell,
.weibo-images.is-grid .weibo-img-cell {
  aspect-ratio: 1;
}
.weibo-images.is-single .weibo-img-cell {
  aspect-ratio: auto;
  width: fit-content;
  max-width: 100%;
  background: transparent;
}
.weibo-img-cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  cursor: pointer;
}
.weibo-images.is-single .weibo-img-cell img {
  width: auto;
  height: auto;
  max-width: min(100%, 280px);
  max-height: 320px;
  object-fit: contain;
}
.weibo-img-cell.is-sticker {
  aspect-ratio: auto;
  width: fit-content;
  max-width: min(34vw, 116px);
  background: transparent;
}
.weibo-img-cell.is-sticker img {
  width: auto;
  height: auto;
  max-width: min(34vw, 116px);
  max-height: 116px;
  aspect-ratio: auto;
  object-fit: contain;
}
.weibo-actions {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-top: 10px;
  padding-top: 6px;
  border-top: 1px solid #f0f0f0;
}
.weibo-action-btn {
  min-width: 0;
  padding: 4px 2px;
  font-size: 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #7f7f7f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.weibo-action-btn.is-mini {
  height: 24px;
}
.weibo-action-btn.icon-only {
  width: 24px;
  padding: 0;
  justify-self: center;
}
.weibo-action-btn.danger {
  color: #9a9a9a;
}
.weibo-action-btn.danger:hover {
  color: #e15252;
}
.weibo-action-btn.is-liked {
  color: #e84b5a;
}
.weibo-action-btn.is-liked .weibo-act-svg {
  color: #e84b5a;
  opacity: 1;
}
.weibo-action-btn.is-liked .weibo-act-svg path {
  fill: currentColor;
}
.weibo-act-svg {
  width: 14px;
  height: 14px;
  opacity: 0.88;
}
.weibo-action-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}
.weibo-post-vis {
  margin-top: 4px;
}
.weibo-vis-badge {
  display: inline-block;
  font-size: 11px;
  line-height: 1.3;
  padding: 2px 8px;
  border-radius: 4px;
  background: #eef3f8;
  color: #5a6d82;
  border: 1px solid #dde6ef;
}
.weibo-comment-modal-stats {
  font-size: 12px;
  margin-bottom: 10px;
  color: #6f8cab;
}
.weibo-detail-metrics-bar {
  margin-top: 8px;
  font-size: 13px;
  color: #5a6d82;
  font-weight: 600;
}
.weibo-hot-comments {
  margin-top: 10px;
  background: #fafafa;
  border: 1px solid #f1f1f1;
  border-radius: 8px;
  padding: 8px 10px;
}
.weibo-hot-title {
  font-size: 11px;
  color: #999;
  margin-bottom: 6px;
}
.weibo-hot-item-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.weibo-hot-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px;
  align-items: baseline;
  line-height: 1.45;
  font-size: 13px;
}
.weibo-hot-item-wrap .social-post-media-strip {
  width: 100%;
}
.weibo-hot-author {
  color: #587ca3;
}
.weibo-hot-content {
  color: #343434;
}
.weibo-hot-like {
  color: #9a9a9a;
  font-size: 12px;
}
.weibo-hot-more {
  margin-top: 6px;
  border: none;
  background: transparent;
  color: #6d8aac;
  font-size: 12px;
  padding: 0;
  cursor: pointer;
}
.weibo-comment-sheet {
  max-height: 300px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.weibo-comment-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: start;
}
.weibo-comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef1f5;
  color: #67768a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  overflow: hidden;
  flex-shrink: 0;
}
.weibo-comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.weibo-comment-reply {
  margin-left: 6px;
  font-weight: 400;
  color: #8aa0b5;
}
.weibo-comment-author {
  font-size: 12px;
  color: #6f7d90;
}
.weibo-comment-text {
  font-size: 13px;
  color: #2f2f2f;
  line-height: 1.45;
  margin-top: 2px;
}
.weibo-comment-like {
  color: #9a9a9a;
  font-size: 12px;
}
.weibo-comment-del-btn {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid #e5e8ec;
  background: #fff;
  color: #9aa2ad;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.weibo-comment-del-btn .weibo-act-svg {
  width: 11px;
  height: 11px;
}
.weibo-dm-row {
  padding: 8px 0;
  border-bottom: 1px solid #edf1f5;
}
.weibo-dm-row:last-child {
  border-bottom: none;
}
.weibo-dm-meta {
  font-size: 12px;
  color: #7c8b9f;
}
.weibo-dm-text {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
  color: #2f2f2f;
  white-space: pre-wrap;
}
.weibo-dm-reply-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.weibo-dm-reply {
  margin-left: 14px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #f6f8fa;
  border: 1px solid #edf1f5;
}
.weibo-dm-reply.is-user {
  background: #eef6ff;
  border-color: #dbeafe;
}
.weibo-dm-reply.is-user-as-char {
  background: #fdf3ea;
  border-color: #f5e3cf;
}
.weibo-dm-reply.is-char-ai {
  background: #f2f0fb;
  border-color: #e2ddf5;
}
.weibo-dm-reply-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.weibo-dm-reply-tag {
  font-size: 11px;
  font-weight: 600;
  color: #7c8b9f;
}
.weibo-dm-reply-time {
  font-size: 11px;
  color: #9aa2ad;
}
.weibo-dm-reply-text {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.45;
  color: #2f2f2f;
  white-space: pre-wrap;
}
.weibo-dm-reply-toggle {
  margin-top: 8px;
}
.weibo-dm-composer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #edf1f5;
}
.weibo-dm-reply-input {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  border: 1px solid #e5e8ec;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  color: #2f2f2f;
  background: #fff;
}
.weibo-dm-composer-actions {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.weibo-dm-composer-hint {
  margin-top: 6px;
}

.weibo-trend-link {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: #333;
  text-align: left;
  cursor: pointer;
  line-height: 1.35;
}
.weibo-trend-link:hover {
  color: #ff7a45;
}

.wbp-fans-btn {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(0, 0, 0, 0.2);
}
.wbp-fans-btn:hover {
  color: #ff7a45;
}

.btn-linkish {
  border: none;
  background: none;
  padding: 0;
  margin: 0 0 0 4px;
  font: inherit;
  font-size: 11px;
  color: var(--primary, #4a6fa5);
  cursor: pointer;
  text-decoration: underline;
}
.btn-linkish:hover {
  opacity: 0.85;
}

.weibo-topic-page .weibo-topic-title {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 58vw;
}
.weibo-topic-section {
  margin-bottom: 12px;
}
.weibo-topic-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin: 0 0 8px 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.weibo-topic-news {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: #444;
}
.weibo-topic-post {
  margin-bottom: 10px;
}
.weibo-topic-post.is-official {
  border-left: 3px solid #e53935;
}
.weibo-topic-post.is-repost {
  border-left: 3px solid #6d8aac;
}
.weibo-topic-post-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.weibo-topic-author-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.weibo-topic-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #eef1f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.weibo-topic-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.weibo-topic-avatar--emoji {
  color: #67768a;
}
.weibo-topic-author {
  border: none;
  background: none;
  padding: 0;
  font-weight: 600;
  font-size: var(--font-sm);
  cursor: pointer;
  text-align: left;
  color: inherit;
  min-width: 0;
}
.weibo-topic-time {
  font-size: 11px;
  color: #999;
  flex-shrink: 0;
}
.weibo-topic-repost-line {
  font-size: 12px;
  color: #6b7d95;
  margin-bottom: 6px;
  padding: 6px 8px;
  background: #f6f9ff;
  border-radius: 8px;
  border: 1px solid #e4edf9;
}
.weibo-topic-body {
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  color: #2f2f2f;
}
.weibo-topic-actions {
  margin-top: 8px;
}
