/* ig-page.css — 仿 Instagram 页面 */

/* ===== 亮/暗主题变量 ===== */
:root {
  --ig-bg: #ffffff;
  --ig-text: #262626;
  --ig-text-strong: #000000;
  --ig-sub: #737373;
  --ig-muted: #8e8e8e;
  --ig-border: #dbdbdb;
  --ig-border-light: #efefef;
  --ig-surface: #fafafa;
  --ig-surface-2: #efefef;
  --ig-hover: rgba(0, 0, 0, 0.05);
  --ig-btn-bg: #efefef;
  --ig-btn-active: #dbdbdb;
  --ig-login-btn-bg: #000000;
  --ig-login-btn-text: #ffffff;
  --ig-wordmark-fill: #262626;
  --ig-comment-bg: #ffffff;
  --ig-comment-text: #11151a;
  --ig-comment-sub: #6f7782;
  --ig-comment-border: #edf0f3;
  --ig-comment-composer-bg: #ffffff;
  --ig-comment-input-border: #e0e4e9;
  --ig-comment-avatar-bg: #eef1f4;
  --ig-backdrop: rgba(17, 24, 31, 0.68);
  --ig-story-ring-bg: #ffffff;
  --ig-story-add-bg: #252a31;
  --ig-story-add-border: #ffffff;
  --ig-avatar-border: #ffffff;
  --ig-avatar-fallback-bg: #efefef;
  --ig-profile-empty-border: #262626;
}

:root.theme-dark {
  --ig-bg: #000000;
  --ig-text: #f5f5f5;
  --ig-text-strong: #ffffff;
  --ig-sub: #a8a8a8;
  --ig-muted: #737373;
  --ig-border: #363636;
  --ig-border-light: #262626;
  --ig-surface: #121212;
  --ig-surface-2: #262626;
  --ig-hover: rgba(255, 255, 255, 0.08);
  --ig-btn-bg: #363636;
  --ig-btn-active: #4a4a4a;
  --ig-login-btn-bg: #f5f5f5;
  --ig-login-btn-text: #000000;
  --ig-wordmark-fill: #f5f5f5;
  --ig-comment-bg: #000000;
  --ig-comment-text: #f5f5f5;
  --ig-comment-sub: #a8a8a8;
  --ig-comment-border: #262626;
  --ig-comment-composer-bg: #000000;
  --ig-comment-input-border: #363636;
  --ig-comment-avatar-bg: #262626;
  --ig-backdrop: rgba(0, 0, 0, 0.75);
  --ig-story-ring-bg: #000000;
  --ig-story-add-bg: #f5f5f5;
  --ig-story-add-border: #000000;
  --ig-avatar-border: #000000;
  --ig-avatar-fallback-bg: #262626;
  --ig-profile-empty-border: #f5f5f5;
}

#ig-page {
  background: var(--ig-bg);
  color: var(--ig-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  z-index: 9999;
  overflow: hidden;
}

/* ===== Instagram 登录页 ===== */
.ig-login-page {
  background: var(--ig-bg);
  color: var(--ig-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  z-index: 60;
  overflow: hidden;
}

.ig-login-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0));
  left: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ig-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}

.ig-login-close:active {
  background: var(--ig-surface-2);
}

.ig-login-shell {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(58px + env(safe-area-inset-top, 0)) 32px calc(46px + env(safe-area-inset-bottom, 0));
}

.ig-login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.ig-login-icon-svg {
  width: 76px;
  height: 76px;
  display: block;
}

.ig-login-wordmark {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.ig-login-wordmark-svg {
  width: 166px;
  height: auto;
  display: block;
  fill: var(--ig-wordmark-fill);
}

.ig-login-subtitle {
  text-align: center;
  color: var(--ig-sub);
  font-size: 15px;
  line-height: 1.45;
  margin-bottom: 26px;
}

.ig-login-wechat {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--ig-login-btn-bg);
  color: var(--ig-login-btn-text);
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ig-login-wechat:active {
  opacity: 0.88;
}

.ig-login-wechat-svg {
  width: 21px;
  height: 21px;
  fill: var(--ig-login-btn-text);
  flex-shrink: 0;
}

.ig-login-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin: 24px 0 0;
  color: var(--ig-sub);
  font-size: 12px;
  font-weight: 700;
}

.ig-login-divider span {
  height: 1px;
  background: var(--ig-border);
}

.ig-login-divider em {
  font-style: normal;
}

.ig-login-users {
  margin-top: 14px;
  border: 1px solid var(--ig-border);
  border-radius: 8px;
  max-height: min(320px, 38vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--ig-bg);
}

.ig-login-user {
  width: 100%;
  min-height: 64px;
  border: 0;
  border-bottom: 1px solid var(--ig-border-light);
  background: transparent;
  color: var(--ig-text);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ig-login-user:last-child {
  border-bottom: 0;
}

.ig-login-user:active {
  background: var(--ig-surface);
}

.ig-login-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #feda75, #d62976 54%, #4f5bd5);
  padding: 2px;
}

.ig-login-user-avatar img,
.ig-story-avatar img,
.ig-bottombar-avatar img,
.ig-profile-avatar img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  background: var(--ig-bg);
}

.ig-login-user-avatar span,
.ig-story-avatar span,
.ig-bottombar-avatar span,
.ig-profile-avatar span {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--ig-avatar-fallback-bg);
  color: var(--ig-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
}

.ig-login-user-avatar img,
.ig-login-user-avatar span {
  border: 3px solid var(--ig-avatar-border);
  box-sizing: border-box;
}

.ig-login-user-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ig-login-user-name {
  color: var(--ig-text);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ig-login-user-account {
  color: var(--ig-sub);
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ig-login-user i {
  color: var(--ig-muted);
  font-size: 17px;
  flex-shrink: 0;
}

.ig-login-loading,
.ig-login-empty {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ig-sub);
  font-size: 14px;
  text-align: center;
}

.ig-login-empty span {
  font-size: 12px;
  color: var(--ig-muted);
}

/* ===== 顶部导航栏 ===== */
.ig-topbar {
  flex-shrink: 0;
  z-index: 10;
  background: var(--ig-bg);
  border-bottom: 1px solid var(--ig-border);
  padding-top: env(safe-area-inset-top, 0);
}

.ig-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 16px;
}

.ig-topbar-inner.is-profile {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  justify-content: initial;
  padding: 0 8px;
}

.ig-topbar-logo {
  display: flex;
  align-items: center;
  height: 36px;
}

.ig-topbar-logo svg {
  height: 36px;
  width: auto;
}

.ig-topbar-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  color: var(--ig-text);
  font-size: 17px;
  line-height: 1.2;
  font-weight: 700;
}

.ig-topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ig-topbar-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--ig-text);
}

.ig-topbar-inner.is-profile .ig-topbar-btn {
  justify-content: center;
  width: 44px;
  height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.ig-topbar-left {
  justify-self: start;
}

.ig-topbar-right {
  justify-self: end;
}

.ig-topbar-btn svg {
  width: 24px;
  height: 24px;
}

.ig-topbar-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.ig-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== Stories 栏 ===== */
.ig-stories {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 16px 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--ig-border);
}

.ig-story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.ig-story-ring {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ig-story-ring-bg);
  box-shadow: 0 0 0 4px var(--ig-story-ring-bg);
}

.ig-story-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
}

.ig-story-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ig-story-add {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ig-story-add-bg);
  color: var(--ig-story-add-border);
  font-size: 11px;
  border: 4px solid var(--ig-story-add-border);
  box-sizing: content-box;
  line-height: 1;
}

.ig-story-name {
  font-size: 11px;
  color: var(--ig-text);
  max-width: 72px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== 帖子列表 ===== */
.ig-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== 单条帖子 ===== */
.ig-post {
  border-bottom: 1px solid var(--ig-border-light);
}

.ig-post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
}

.ig-post-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ig-post-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

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

.ig-post-userinfo {
  display: flex;
  flex-direction: column;
}

.ig-post-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--ig-text);
  line-height: 1.3;
}

.ig-post-location {
  font-size: 11px;
  color: var(--ig-text);
  font-weight: 400;
  line-height: 1.3;
}

.ig-post-more {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--ig-text);
  display: flex;
  align-items: center;
}

.ig-post-more svg {
  width: 24px;
  height: 24px;
}

/* 帖子图片 */
.ig-post-image {
  width: 100%;
  position: relative;
  background: var(--ig-surface-2);
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}

.ig-post-image img {
  width: 100%;
  display: block;
}

.ig-post-image:focus-visible {
  outline: 2px solid #0095f6;
  outline-offset: -2px;
}

/* 帖子操作栏 */
.ig-post-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
}

.ig-post-actions-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ig-post-actions-right {
  display: flex;
  align-items: center;
}

.ig-action-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.ig-post-action {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--ig-text);
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

.ig-post-action svg {
  width: 24px;
  height: 24px;
}

.ig-post-action.ig-like.liked {
  color: #ed4956;
}

.ig-action-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--ig-text);
  padding: 0 2px;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

/* 点赞信息 */
.ig-post-likes {
  padding: 0 14px;
  font-size: 13px;
  color: var(--ig-text);
  line-height: 1.5;
}

.ig-post-likes strong {
  font-weight: 600;
}

/* 配文 */
.ig-post-caption {
  padding: 2px 14px 0;
  font-size: 13px;
  color: var(--ig-text);
  line-height: 1.5;
}

.ig-post-caption strong {
  font-weight: 600;
}

/* 时间 */
.ig-post-time {
  padding: 4px 14px 12px;
  font-size: 10px;
  color: var(--ig-muted);
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

/* ===== 底部导航栏 ===== */
.ig-bottombar {
  flex-shrink: 0;
  background: var(--ig-bg);
  border-top: 1px solid var(--ig-border);
  display: flex;
  align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 10;
}

.ig-bottombar-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ig-bottombar-item svg {
  width: 24px;
  height: 24px;
  color: var(--ig-text);
}

.ig-bottombar-item.active svg {
  color: var(--ig-text-strong);
}

.ig-bottombar-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ig-muted);
  overflow: hidden;
  flex-shrink: 0;
}

.ig-bottombar-item.active .ig-bottombar-avatar {
  box-shadow: 0 0 0 1.5px var(--ig-text);
}

/* ===== 个人主页 ===== */
.ig-profile-page {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--ig-bg);
}

.ig-profile-hero {
  padding: 15px 16px 12px;
  border-bottom: 1px solid var(--ig-border-light);
}

.ig-profile-top {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.ig-profile-avatar {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--ig-avatar-fallback-bg);
  color: var(--ig-text);
  flex-shrink: 0;
}

.ig-profile-avatar span {
  font-size: 24px;
  font-weight: 700;
}

.ig-profile-stats {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  text-align: center;
}

.ig-profile-stat {
  min-width: 0;
  color: var(--ig-text);
}

.ig-profile-stat strong {
  display: block;
  font-size: 17px;
  line-height: 1.1;
  font-weight: 600;
}

.ig-profile-stat span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 400;
  color: var(--ig-text);
}

.ig-profile-name {
  margin-top: 11px;
  font-size: 14px;
  line-height: 1.28;
  font-weight: 600;
  color: var(--ig-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ig-profile-account {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 400;
  color: var(--ig-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ig-profile-bio {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.38;
  font-weight: 400;
  color: var(--ig-text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ig-profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 12px;
}

.ig-profile-action {
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: var(--ig-btn-bg);
  color: var(--ig-text);
  font-size: 13px;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ig-profile-action:active {
  background: var(--ig-btn-active);
}

.ig-profile-tabs {
  height: 44px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--ig-border-light);
}

.ig-profile-tab {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--ig-muted);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ig-profile-tab.active {
  color: var(--ig-text);
}

.ig-profile-tab-svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.ig-profile-video-svg {
  width: 20px;
  height: 20px;
}

.ig-profile-video-triangle {
  fill: #fff;
}

.ig-profile-tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--ig-text);
}

.ig-profile-empty {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ig-text);
}

.ig-profile-empty-icon {
  width: 60px;
  height: 60px;
  border: 2px solid var(--ig-profile-empty-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.ig-profile-empty-title {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
}

/* ===== 评论面板 ===== */
.ig-comments-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  color: var(--ig-comment-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.ig-comments-overlay.show {
  pointer-events: auto;
}

.ig-comments-backdrop {
  position: absolute;
  inset: 0;
  background: var(--ig-backdrop);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.ig-comments-overlay.show .ig-comments-backdrop {
  opacity: 1;
}

.ig-comments-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(92%, 720px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--ig-comment-bg);
  border-radius: 32px 32px 0 0;
  overflow: hidden;
  box-shadow: 0 -14px 38px rgba(0, 0, 0, 0.18);
  transform: translateY(100%);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ig-comments-overlay.show .ig-comments-sheet {
  transform: translateY(0);
}

.ig-comments-handle {
  flex: 0 0 auto;
  width: 38px;
  height: 4px;
  margin: 14px auto 12px;
  border-radius: 999px;
  background: var(--ig-comment-sub);
}

.ig-comments-header {
  position: relative;
  flex: 0 0 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--ig-comment-border);
}

.ig-comments-title {
  position: absolute;
  bottom: 14px;
  font-size: 18px;
  line-height: 1;
  font-weight: 550;
  letter-spacing: 0;
}

.ig-comments-send {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ig-text-strong);
}

.ig-comments-send svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.35;
}

.ig-comments-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px 12px;
}

.ig-comment-thread {
  margin-bottom: 14px;
}

.ig-comment-row {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  column-gap: 10px;
  align-items: start;
  padding: 0 0 0;
}

.ig-comment-reply-row {
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  margin: 12px 0 0 52px;
  column-gap: 9px;
}

.ig-comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--ig-comment-avatar-bg);
}

.ig-comment-reply-row .ig-comment-avatar {
  width: 28px;
  height: 28px;
}

.ig-comment-avatar img,
.ig-comments-me img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ig-comment-body {
  min-width: 0;
}

.ig-comment-copy {
  font-size: 15.5px;
  line-height: 1.26;
  color: var(--ig-comment-text);
  font-weight: 400;
  overflow-wrap: anywhere;
}

.ig-comment-username {
  font-weight: 600;
}

.ig-comment-time {
  color: var(--ig-comment-sub);
  font-weight: 550;
}

.ig-comment-text {
  margin-top: 4px;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 400;
  color: var(--ig-comment-text);
}

.ig-comment-mention {
  color: #3557e9;
}

.ig-comment-reply {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ig-comment-sub);
  font-size: 14.5px;
  line-height: 1;
  font-weight: 550;
}

.ig-comment-like {
  justify-self: end;
  width: 28px;
  height: 28px;
  padding: 0;
  margin-top: 21px;
  border: 0;
  background: transparent;
  color: var(--ig-comment-sub);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ig-comment-like svg {
  width: 23px;
  height: 23px;
}

.ig-comment-like-count {
  position: absolute;
  right: 0;
  top: 55px;
  width: 28px;
  text-align: center;
  color: var(--ig-comment-sub);
  font-size: 14px;
  line-height: 1;
  font-weight: 600;
}

.ig-comments-replies-toggle {
  margin: 11px 0 0 51px;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ig-comment-sub);
  font-size: 15px;
  line-height: 1;
  font-weight: 550;
}

.ig-comments-replies-line {
  width: 28px;
  height: 1px;
  background: var(--ig-comment-border);
}

.ig-comments-replies {
  display: none;
}

.ig-comment-thread.replies-open .ig-comments-replies {
  display: block;
}

.ig-comments-composer {
  flex: 0 0 auto;
  background: var(--ig-comment-composer-bg);
  border-top: 1px solid var(--ig-comment-border);
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px));
}

.ig-comments-input-row {
  display: flex;
  align-items: center;
  gap: 11px;
}

.ig-comments-me {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--ig-comment-avatar-bg);
}

.ig-comments-input-pill {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 1px solid var(--ig-comment-input-border);
  border-radius: 999px;
  display: flex;
  align-items: center;
  padding: 0 17px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02);
  color: var(--ig-comment-sub);
  font-size: 16px;
  font-weight: 400;
}

.ig-comments-input-pill span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ===== Instagram 论坛设定页 ===== */
#ig-forum-page {
  background: var(--c-bg, #fff);
  color: var(--c-text, #3a3a3a);
  font-family: var(--font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  z-index: 9999;
}

.igf-topbar {
  flex-shrink: 0;
  background: var(--c-bg, #fff);
  border-bottom: 1px solid var(--c-border, rgba(0, 0, 0, 0.05));
  padding-top: env(safe-area-inset-top, 0);
}

.igf-topbar-inner {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  height: 44px;
  padding: 0 8px;
}

.igf-topbar-btn,
.igf-topbar-spacer {
  width: 44px;
  height: 44px;
}

.igf-topbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--c-text, #3a3a3a);
  font-size: 22px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.igf-topbar-btn:active {
  background: var(--c-surface-2, #f3f3f3);
}

.igf-topbar-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  color: var(--c-text, #3a3a3a);
  font-size: 17px;
  line-height: 1.2;
  font-weight: 700;
}

.igf-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px calc(24px + env(safe-area-inset-bottom, 0));
  background: var(--c-bg, #fff);
}

.igf-section {
  position: relative;
  margin: 0 0 12px;
  background: var(--ig-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    inset 1px 1px 0 0 rgba(255, 255, 255, 0.55),
    inset -1px -1px 0 0 rgba(255, 255, 255, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.025);
}

.igf-section::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.035);
  pointer-events: none;
}

.igf-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px 9px;
}

.igf-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-sub, #888);
  letter-spacing: 0;
}

.igf-world-card,
.igf-setting-row {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.igf-world-card {
  padding: 11px 14px 14px;
}

.igf-setting-row {
  padding: 12px 14px;
}

.igf-world-card:active,
.igf-setting-row:active {
  background: var(--c-surface, #fbfbfb);
}

.igf-setting-row + .igf-setting-row {
  border-top: 1px solid var(--c-border, rgba(0, 0, 0, 0.05));
}

.igf-world-icon,
.igf-setting-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--c-surface-2, #f3f3f3);
  color: var(--c-accent-dark, #787878);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.igf-world-icon {
  font-size: 18px;
}

.igf-setting-icon {
  font-size: 15px;
}

.igf-world-info,
.igf-setting-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.igf-world-name,
.igf-setting-label {
  font-size: 15px;
  color: var(--c-text, #3a3a3a);
  line-height: 1.32;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.igf-world-desc,
.igf-setting-value {
  font-size: 12px;
  color: var(--c-sub, #888);
  line-height: 1.35;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.igf-world-chevron,
.igf-setting-chevron {
  flex-shrink: 0;
  color: var(--c-hint, #b8b8b8);
  font-size: 15px;
}

.igf-footer-note {
  padding: 4px 4px 0;
  text-align: center;
  font-size: 12px;
  color: var(--c-hint, #b8b8b8);
  line-height: 1.6;
}

.igf-picker-list {
  max-height: 320px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px 8px;
}

.igf-picker-row {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--c-border, rgba(0, 0, 0, 0.05));
  cursor: pointer;
}

.igf-picker-row:last-child {
  border-bottom: 0;
}

.igf-picker-row input {
  flex-shrink: 0;
  accent-color: var(--c-accent-dark, #787878);
}

.igf-picker-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--c-surface-2, #f3f3f3);
  flex-shrink: 0;
}

.igf-picker-avatar img,
.igf-picker-avatar span {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.igf-picker-avatar img {
  object-fit: cover;
}

.igf-picker-avatar span {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text, #3a3a3a);
  font-size: 14px;
  font-weight: 600;
}

.igf-picker-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.igf-picker-name {
  color: var(--c-text, #3a3a3a);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.igf-picker-meta,
.igf-picker-empty {
  color: var(--c-sub, #888);
  font-size: 12px;
  line-height: 1.35;
}

.igf-picker-empty {
  padding: 26px 0;
  text-align: center;
}

.igf-topic-editor {
  padding: 0 16px 8px;
}

.igf-topic-input {
  min-height: 150px;
  resize: none;
  line-height: 1.45;
}
