/* 刻画社区主题 - 本地样式，无远程连接 */
:root {
  --color-primary: #0066ff;
  --color-primary-dark: #0052cc;
  --color-yellow: #ffc107;
  --color-yellow-dark: #e6ac00;
  --color-text: #333;
  --color-text-light: #666;
  --color-border: #e8e8e8;
  --color-bg: #f5f6f8;
  --color-white: #fff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 2px 8px rgba(0,0,0,.1);
  --radius: 12px;
  --header-h: 64px;
  --top-gap: 16px;
  --layout-gap: 16px;
  --sidebar-left-w: 256px;
  --sidebar-right-w: 310px;
  --max-content: 640px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ========== 顶部导航 ========== */
.kehua-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 100;
}

.kehua-header-inner {
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.kehua-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.kehua-logo-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.kehua-logo-img {
  max-height: 36px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
}

.kehua-nav-main {
  display: flex;
  gap: 0;
  flex: 1;
  height: 100%;
  align-items: stretch;
}

.kehua-nav-link {
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 15px;
  color: var(--color-text-light);
  border-radius: 0;
  transition: background .2s;
}

.kehua-nav-link:hover {
  background: #f5f6f8;
}

.kehua-header-actions {
  display: flex;
  align-items: center;
  gap: 30px;
}

.kehua-icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--color-text-light);
  transition: color .2s, background .2s;
}

.kehua-icon-btn:hover {
  color: var(--color-primary);
  background: rgba(0, 102, 255, .08);
}

.kehua-icon-btn svg {
  width: 18px;
  height: 18px;
}

.kehua-header-desktop-post svg {
  width: 22px;
  height: 22px;
}

.kehua-icon-btn--msgs {
  position: relative;
}
.kehua-header-msg-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  box-sizing: border-box;
  line-height: 16px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  background: #e53935;
  border-radius: 8px;
  box-shadow: 0 0 0 2px #fff;
  pointer-events: none;
  z-index: 1;
}

.kehua-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: transparent;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  transition: color .2s, background-color .2s;
}

.kehua-user-avatar--signed {
  padding: 0;
  overflow: hidden;
  background-image: none !important;
}

.kehua-user-avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.kehua-user-avatar:hover {
  color: var(--color-primary);
  background-color: rgba(0, 102, 255, .08);
}

.kehua-user-avatar svg {
  width: 18px;
  height: 18px;
}

.kehua-header-spacer {
  display: none;
}

.kehua-header-mobile-tools {
  display: none;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.kehua-header-desktop-search-bell {
  display: contents;
}

.kehua-header-menu-btn {
  display: none;
}

/* 手机端：左侧滑出导航（Remix Icon 内联符号，无远程字体） */
.kehua-mobile-drawer {
  display: none;
}

@media (max-width: 992px) {
  .kehua-mobile-drawer {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 950;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0.32s ease;
  }

  .kehua-mobile-drawer.kehua-mobile-drawer-open {
    pointer-events: auto;
    visibility: visible;
  }

  .kehua-mobile-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    opacity: 0;
    transition: opacity 0.32s ease;
    cursor: pointer;
  }

  .kehua-mobile-drawer-open .kehua-mobile-drawer-backdrop {
    opacity: 1;
  }

  .kehua-mobile-drawer-panel {
    --drawer-blue: color-mix(in srgb, var(--color-primary) 58%, #b8c5d8);
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    max-width: 100%;
    background: linear-gradient(
      165deg,
      rgba(255, 255, 255, 0.85) 0%,
      rgba(240, 248, 255, 0.76) 45%,
      rgba(232, 242, 255, 0.72) 100%
    );
    -webkit-backdrop-filter: blur(28px) saturate(135%);
    backdrop-filter: blur(28px) saturate(135%);
    border: 0;
    box-shadow: 12px 0 36px color-mix(in srgb, var(--color-primary) 12%, rgba(0, 0, 0, 0.04));
    transform: translate3d(-100%, 0, 0);
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    outline: none;
    border-radius: 0;
  }

  .kehua-mobile-drawer-open .kehua-mobile-drawer-panel {
    transform: translate3d(0, 0, 0);
  }

  .kehua-mobile-drawer-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 0 20px;
  }

  .kehua-mobile-drawer-brand {
    display: block;
    padding: 4px 22px 18px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--drawer-blue);
    line-height: 1.2;
  }

  .kehua-mobile-drawer-brand:active {
    opacity: 0.85;
  }

  .kehua-mobile-drawer-brand--logo {
    font-size: 0;
    line-height: 0;
  }

  .kehua-mobile-drawer-brand-img {
    display: block;
    max-height: 40px;
    max-width: 220px;
    width: auto;
    height: auto;
    object-fit: contain;
  }

  .kehua-mobile-drawer-nav {
    padding: 0 0 8px;
  }

  .kehua-mobile-drawer-item {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 12px 6px;
    padding: 12px 14px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    font-weight: 500;
    color: #333333;
    transition: background 0.2s ease, color 0.2s ease, backdrop-filter 0.2s ease;
  }

  .kehua-mobile-drawer-item:not(.kehua-active):active {
    background: rgba(51, 65, 85, 0.1);
  }

  .kehua-mobile-drawer-nav .kehua-drawer-ico-img {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    object-fit: contain;
    display: block;
    filter: none;
    -webkit-filter: none;
  }

  .kehua-drawer-ico-placeholder {
    display: block;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 4px;
    background: color-mix(in srgb, var(--color-primary) 10%, rgba(0, 0, 0, 0.04));
  }

  .kehua-mobile-drawer-item.kehua-active {
    background: rgba(255, 255, 255, 0);
    -webkit-backdrop-filter: blur(16px) saturate(1.15);
    backdrop-filter: blur(16px) saturate(1.15);
    color: #333333;
    font-weight: 500;
    box-shadow: none;
    border: none;
  }

  .kehua-mobile-drawer-item.kehua-active:active {
    background: rgba(255, 255, 255, 0.52);
  }

  .kehua-mobile-drawer-divider {
    height: 1px;
    margin: 14px 22px 16px;
    background: color-mix(in srgb, var(--color-primary) 14%, rgba(0, 0, 0, 0.06));
    border: none;
  }

  .kehua-mobile-drawer-rec {
    padding: 12px 16px 8px;
  }

  .kehua-mobile-drawer-rec-title {
    margin: 0 0 12px 6px;
    font-size: 14px;
    font-weight: 600;
    color: #999999;
    letter-spacing: 0.06em;
  }

  .kehua-mobile-drawer-rec-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .kehua-mobile-drawer-rec-card {
    position: relative;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 3 / 1;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  }

  .kehua-mobile-drawer-rec-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .kehua-mobile-drawer-rec-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.58) 100%);
    pointer-events: none;
  }

  .kehua-mobile-drawer-rec-label {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    text-align: center;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
    pointer-events: none;
  }

  .kehua-mobile-drawer-foot {
    margin-top: 16px;
    padding: 0 22px 4px;
    border: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #999999;
    text-align: center;
  }

  .kehua-mobile-drawer-foot::before {
    content: "";
    display: block;
    height: 1px;
    margin: 0 0 16px;
    background: #e5e5e5;
  }

  .kehua-header .kehua-logo {
    display: none;
  }

  .kehua-header-actions .kehua-header-desktop-post {
    display: none;
  }

  .kehua-header-spacer {
    display: block;
    flex: 1;
    min-width: 0;
  }

  .kehua-header-mobile-tools {
    display: flex;
  }

  .kehua-header-menu-btn {
    display: flex;
  }

  .kehua-header-desktop-search-bell {
    display: none;
  }

  .kehua-header-inner {
    gap: 10px;
  }

  .kehua-header-actions {
    gap: 6px;
    flex-shrink: 0;
  }
}

/* ========== 主布局 ========== */
.kehua-layout {
  display: flex;
  max-width: 1250px;
  margin: 0 auto;
  padding: calc(var(--header-h) + var(--top-gap)) 20px 80px;
  padding-left: calc(var(--sidebar-left-w) + var(--layout-gap) + 20px);
  gap: var(--layout-gap);
}

/* 发表主题/帖子页不显示左侧边栏 */
.kehua-layout-no-left {
  padding-left: 20px;
}

/* 首页 + 瀑布流列表：顶栏下方全宽大图轮播，主区通栏无左右侧栏，列表四列 */
body.kehua-index-masonry .kehua-slider-wrap--index-hero {
  margin: 0;
  margin-top: var(--header-h);
  width: 100%;
  max-width: none;
  border-radius: 0;
  box-sizing: border-box;
}

body.kehua-index-masonry .kehua-slider-wrap--index-hero .kehua-slider--index-hero {
  aspect-ratio: 21 / 8;
  max-height: min(52vh, 560px);
}

/* 与顶栏 .kehua-header-inner 同款：max-width 1250px + 左右 20px 内边距，整体居中 */
body.kehua-index-masonry .kehua-layout.kehua-layout-index-masonry {
  max-width: 1250px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: calc(var(--header-h) + var(--top-gap)) 20px 80px;
  box-sizing: border-box;
}

/* 有大图轮播时：轮播已在导航下占位，主区勿再留「顶栏高度」留白，与筛选条下同距（20px） */
body.kehua-index-masonry:has(.kehua-slider-wrap--index-hero) .kehua-layout.kehua-layout-index-masonry {
  padding-top: 20px;
}

/* ========== 板块页 + 瀑布流：与首页类似的通栏头图强对比 + 四列列表（仅 masonry） ========== */
/* 通栏头图用 100vw 时，纵向滚动条会令视口「可绘宽度」略小于 100vw，易出横向条；整页禁止横向滚动 */
body.kehua-forum-masonry {
  overflow-x: hidden;
}

body.kehua-forum-masonry .kehua-layout.kehua-layout-forum-masonry {
  max-width: 1250px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 0 20px 80px;
  box-sizing: border-box;
}

body.kehua-forum-masonry .kehua-layout-forum-masonry .kehua-main.kehua-forum-main--masonry {
  max-width: none;
  width: 100%;
  flex: 1 1 auto;
  min-width: 0;
}

/* 头图全宽贴边，上边与固定顶栏衔接（与首页幻灯片同逻辑） */
body.kehua-forum-masonry .kehua-forum-hero--masonry {
  position: relative;
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: var(--header-h);
  margin-bottom: 20px;
  height: auto;
  min-height: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  /* 略扁于 21:8，并压低 max-height，减少列表上方留白 */
  aspect-ratio: 21 / 6.5;
  max-height: min(40vh, 420px);
}

body.kehua-forum-masonry .kehua-forum-hero--masonry .kehua-forum-hero-mask {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.5) 100%);
}

body.kehua-forum-masonry .kehua-forum-hero--masonry .kehua-forum-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1250px;
  margin: 0 auto;
  padding: clamp(14px, 3.5vw, 32px) 20px clamp(12px, 2.8vw, 22px);
  box-sizing: border-box;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  text-align: left;
  color: #fff;
}

body.kehua-forum-masonry .kehua-forum-hero--masonry .kehua-forum-hero-title {
  margin: 0 0 8px;
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

body.kehua-forum-masonry .kehua-forum-hero--masonry .kehua-forum-hero-brief {
  margin: 0 0 14px;
  max-width: 36em;
  font-size: 14px;
  line-height: 1.55;
  opacity: 0.95;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

body.kehua-forum-masonry .kehua-forum-hero--masonry .kehua-forum-hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px 20px;
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 500;
  opacity: 1;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

body.kehua-forum-masonry .kehua-forum-hero--masonry .kehua-forum-hero-stats span {
  /* 主题/回复：去掉毛玻璃胶囊，仅保留文案（可读性依赖父级 .kehua-forum-hero-stats 的 text-shadow） */
  padding: 0;
  border-radius: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 0;
  box-shadow: none;
}

body.kehua-forum-masonry .kehua-forum-hero--masonry .kehua-forum-hero-mods {
  margin-top: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 0;
  box-shadow: none;
  justify-content: flex-start;
}

body.kehua-forum-masonry .kehua-forum-hero--masonry .kehua-forum-hero-mods-label {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-weight: 600;
  padding: 5px 12px;
}

body.kehua-forum-masonry .kehua-forum-hero--masonry .kehua-forum-mod {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

body.kehua-forum-masonry .kehua-forum-hero--masonry .kehua-forum-mod:hover {
  background: rgba(255, 255, 255, 0.22);
}

body.kehua-forum-masonry .kehua-forum-hero--masonry .kehua-forum-mod-empty {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

body.kehua-forum-masonry #kehua-forum-feed.kehua-up-masonry-wrap--forum-3 {
  gap: 12px;
}

body.kehua-forum-masonry #kehua-forum-feed.kehua-up-masonry-wrap--forum-3 .kehua-up-masonry-col {
  gap: 12px;
}

@media (max-width: 900px) {
  body.kehua-forum-masonry #kehua-forum-feed.kehua-up-masonry-wrap--forum-3 {
    flex-wrap: wrap;
    align-content: flex-start;
  }

  /* 桌面 3 列、窄屏 2 列：第三列单独换行时禁止 flex-grow 拉满整行（否则会出现单卡通栏超宽） */
  body.kehua-forum-masonry #kehua-forum-feed.kehua-up-masonry-wrap--forum-3 .kehua-up-masonry-col {
    flex: 0 1 calc((100% - 12px) / 2);
    max-width: calc((100% - 12px) / 2);
    min-width: 0;
  }
}

body.kehua-index-masonry .kehua-layout-index-masonry .kehua-main {
  max-width: none;
  width: 100%;
  flex: 1 1 auto;
  min-width: 0;
}

body.kehua-index-masonry #kehua-index-feed.kehua-up-masonry-wrap--index-3 {
  gap: 12px;
}

body.kehua-index-masonry #kehua-index-feed.kehua-up-masonry-wrap--index-3 .kehua-up-masonry-col {
  gap: 12px;
}

@media (max-width: 900px) {
  body.kehua-index-masonry #kehua-index-feed.kehua-up-masonry-wrap--index-3 {
    flex-wrap: wrap;
    align-content: flex-start;
  }

  body.kehua-index-masonry #kehua-index-feed.kehua-up-masonry-wrap--index-3 .kehua-up-masonry-col {
    flex: 0 1 calc((100% - 12px) / 2);
    max-width: calc((100% - 12px) / 2);
    min-width: 0;
  }
}

/* ========== 左侧边栏（固定 + 底部触底） ========== */
.kehua-sidebar-left {
  position: fixed;
  top: calc(var(--header-h) + var(--top-gap));
  left: max(20px, calc(50% - 1250px / 2 + 20px));
  bottom: 0;
  width: var(--sidebar-left-w);
  background: var(--color-white);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px;
  height: calc(100vh - var(--header-h) - var(--top-gap));
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.kehua-sidebar-left .kehua-sidebar-nav {
  margin-bottom: 20px;
}

.kehua-sidebar-left .kehua-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 16px;
  border-radius: 22px;
  color: var(--color-text);
  font-size: 14px;
  transition: background .2s, color .2s;
}

.kehua-sidebar-left .kehua-sidebar-link:hover {
  background: var(--color-bg);
  color: var(--color-primary);
}

.kehua-sidebar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  font-size: 18px;
  color: inherit;
}

.kehua-sidebar-left .kehua-sidebar-link .kehua-sidebar-icon {
  color: var(--color-text-light);
}

.kehua-sidebar-left .kehua-sidebar-link:hover .kehua-sidebar-icon {
  color: var(--color-primary);
}

.kehua-sidebar-left .kehua-sidebar-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.kehua-sidebar-left .kehua-sidebar-buttons .kehua-btn {
  height: 42px;
  padding: 0 20px;
  border-radius: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kehua-btn {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  transition: background .2s, color .2s;
}

.kehua-btn-full {
  width: 100%;
}

.kehua-btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.kehua-btn-primary:hover {
  background: var(--color-primary-dark);
  color: var(--color-white);
}

.kehua-btn-primary.kehua-btn-disabled,
.kehua-btn-primary:disabled {
  background: #d9d9d9;
  color: #888;
  cursor: not-allowed;
}
.kehua-btn-primary.kehua-btn-disabled:hover,
.kehua-btn-primary:disabled:hover {
  background: #d9d9d9;
  color: #888;
}

.kehua-btn-dark {
  background: #333;
  color: var(--color-white);
}

.kehua-btn-dark:hover {
  background: #555;
}

.kehua-btn-secondary {
  background: #e0e0e0;
  color: var(--color-text);
}

.kehua-btn-secondary:hover {
  background: #d0d0d0;
}

.kehua-btn-yellow {
  background: var(--color-yellow);
  color: #333;
}

.kehua-btn-yellow:hover {
  background: var(--color-yellow-dark);
}
.kehua-btn-outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}
.kehua-btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
/* 小号 outline 按钮与 kehua-btn-small 组合时背景为蓝色，hover 需保持白字 */
.kehua-btn-outline.kehua-btn-small:hover {
  color: var(--color-white);
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

/* 左侧底部：登录社区信息框 */
.kehua-sidebar-login-box {
  margin-top: 12px;
  padding: 16px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--color-text-light);
}

.kehua-sidebar-login-title {
  margin: 0 0 12px;
  font-weight: 600;
  color: var(--color-text);
  font-size: 14px;
}

.kehua-sidebar-login-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.kehua-sidebar-login-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  line-height: 1.4;
}

.kehua-sidebar-login-list li:last-child {
  margin-bottom: 0;
}

.kehua-sidebar-login-list .kehua-sidebar-icon {
  margin-top: 2px;
  color: var(--color-text-light);
}

/* 主题设置「左侧栏自定义 HTML」 */
.kehua-sidebar-login-box.kehua-sidebar-custom > :first-child {
  margin-top: 0;
}
.kehua-sidebar-login-box.kehua-sidebar-custom > :last-child {
  margin-bottom: 0;
}
.kehua-sidebar-login-box.kehua-sidebar-custom h1,
.kehua-sidebar-login-box.kehua-sidebar-custom h2,
.kehua-sidebar-login-box.kehua-sidebar-custom h3,
.kehua-sidebar-login-box.kehua-sidebar-custom h4 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}
.kehua-sidebar-login-box.kehua-sidebar-custom ul,
.kehua-sidebar-login-box.kehua-sidebar-custom ol {
  margin: 0;
  padding-left: 1.2em;
}
.kehua-sidebar-login-box.kehua-sidebar-custom li {
  margin-bottom: 6px;
}
.kehua-sidebar-login-box.kehua-sidebar-custom a {
  color: var(--color-primary);
}

/* 主内容区等仍用 sidebar-section 时保留，右侧不用可删 */
.kehua-sidebar-section {
  margin-bottom: 20px;
}

.kehua-sidebar-title {
  font-size: 13px;
  color: var(--color-text-light);
  margin: 0 0 10px;
  padding: 0 12px;
}

/* ========== 主内容区 ========== */
.kehua-main {
  flex: 1;
  min-width: 0;
  max-width: var(--max-content);
}

/* 幻灯片（无文字） */
.kehua-slider-wrap {
  margin-bottom: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-white);
}

.kehua-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 640 / 280;
  max-height: 320px;
}

.kehua-slider-inner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.kehua-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.kehua-slide.kehua-slide-active {
  opacity: 1;
  pointer-events: auto;
}

.kehua-slide-placeholder {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.kehua-slide-link {
  display: block;
  width: 100%;
  height: 100%;
}

.kehua-slide-has-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kehua-slide-bg-1 { background: linear-gradient(135deg, #e0e8f0 0%, #c8d4e0 100%); }
.kehua-slide-bg-2 { background: linear-gradient(135deg, #a8c0ff 0%, #c2e9fb 100%); }
.kehua-slide-bg-3 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }

.kehua-slider-dots {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}

.kehua-slider-dots .kehua-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  padding: 0;
  transition: background .2s, transform .2s;
}

.kehua-slider-dots .kehua-dot:hover {
  background: rgba(255,255,255,.8);
}

.kehua-slider-dots .kehua-dot.kehua-active {
  background: var(--color-white);
  transform: scale(1.2);
}

.kehua-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.kehua-tab {
  padding: 12px 20px;
  color: var(--color-text-light);
  position: relative;
  transition: color .2s;
}

.kehua-tab:hover,
.kehua-tab.kehua-active {
  color: var(--color-primary);
}

.kehua-tab.kehua-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--color-primary);
}

/* 首页动态/新帖/精华（仅瀑布流）；板块页瀑布流筛选同款（毛玻璃槽 + 蓝色选中胶囊）。图文列表勿用此套样式 */
body.kehua-index-masonry #kehua-index-tabs.kehua-tabs,
body.kehua-forum-masonry #kehua-forum-tabs.kehua-tabs {
  display: flex;
  width: auto;
  max-width: min(100%, 320px);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 20px;
  padding: 4px;
  gap: 2px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow:
    0 1px 1px rgba(255, 255, 255, 0.65) inset,
    0 4px 20px rgba(15, 23, 42, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.35);
  box-sizing: border-box;
}

body.kehua-index-masonry #kehua-index-tabs .kehua-tab,
body.kehua-forum-masonry #kehua-forum-tabs .kehua-tab {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(55, 55, 55, 0.52);
  text-decoration: none;
  position: relative;
  z-index: 0;
  transition: color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

body.kehua-index-masonry #kehua-index-tabs .kehua-tab:hover,
body.kehua-forum-masonry #kehua-forum-tabs .kehua-tab:hover {
  color: rgba(30, 30, 30, 0.85);
}

body.kehua-index-masonry #kehua-index-tabs .kehua-tab.kehua-active,
body.kehua-forum-masonry #kehua-forum-tabs .kehua-tab.kehua-active {
  color: #fff;
  background: var(--color-primary);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow:
    0 1px 2px rgba(0, 102, 255, 0.22),
    0 2px 10px rgba(0, 102, 255, 0.18);
}

body.kehua-index-masonry #kehua-index-tabs .kehua-tab.kehua-active::after,
body.kehua-forum-masonry #kehua-forum-tabs .kehua-tab.kehua-active::after {
  display: none;
}

.kehua-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 首页/版块动态流：瀑布流（后台「列表样式」） */
.kehua-feed.kehua-up-masonry-wrap.kehua-up-masonry-feed {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 18px;
  width: 100%;
}
.kehua-feed.kehua-up-masonry-wrap .kehua-up-masonry-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.kehua-feed.kehua-up-masonry-feed .kehua-post-card {
  margin-bottom: 0;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.04);
}
.kehua-feed.kehua-up-masonry-feed .kehua-post-desc,
.kehua-feed.kehua-up-masonry-feed .kehua-post-footer {
  margin-left: 0 !important;
  max-width: 100% !important;
}
/* 瀑布流摘要：固定两行，超出省略（手机/桌面 masonry 通用） */
.kehua-feed.kehua-up-masonry-feed .kehua-post-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  min-width: 0;
}
.kehua-feed.kehua-up-masonry-feed .kehua-post-actions {
  margin-right: 0 !important;
}
.kehua-feed.kehua-up-masonry-feed .kehua-post-thumb-single {
  margin-left: 0 !important;
  max-width: 100% !important;
}
.kehua-feed.kehua-up-masonry-feed .kehua-post-thumb-single .kehua-post-image.kehua-post-image--single {
  width: 100% !important;
  max-width: 100% !important;
}
.kehua-feed.kehua-up-masonry-feed .kehua-post-image.kehua-post-image--grid {
  margin-left: 0 !important;
  max-width: 100% !important;
}
.kehua-feed.kehua-up-masonry-feed .kehua-post-image-link--grid {
  margin-left: 0 !important;
  max-width: 100% !important;
  width: 100%;
  box-sizing: border-box;
}
.kehua-feed.kehua-up-masonry-feed .kehua-post-image-grid {
  width: 100% !important;
  max-width: 100%;
  gap: 6px;
}
.kehua-feed.kehua-up-masonry-feed .kehua-post-card > a.kehua-post-image-link.kehua-lightbox-thumb,
.kehua-feed.kehua-up-masonry-feed .kehua-post-card > a.kehua-post-image-link--bili {
  margin-left: 0 !important;
  max-width: 100% !important;
}
.kehua-feed.kehua-up-masonry-feed .kehua-post-media--video {
  margin-left: 0;
  max-width: 100%;
}

.kehua-feed.kehua-up-masonry-feed .kehua-post-avatar.kehua-post-avatar--img {
  width: 40px;
  height: 40px;
}

/* 瀑布流卡片：凡带 --mobile-card 的 feed（首页/版块/个人中心/作者页）全视口统一为上图下文、双列窄间距 */
.kehua-feed.kehua-up-masonry-feed--mobile-card.kehua-up-masonry-wrap {
  gap: 10px;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card.kehua-up-masonry-wrap .kehua-up-masonry-col {
  gap: 12px;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card {
  margin-bottom: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card .kehua-user-card-media:empty {
  display: none;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card .kehua-user-card-media:not(:empty) {
  width: 100%;
  margin: 0;
  line-height: 0;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card .kehua-user-card-media .kehua-post-thumb-single {
  margin: 0 !important;
  max-width: 100% !important;
  width: 100%;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card .kehua-user-card-media .kehua-post-image-link {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}
/* 瀑布流单图：随原图横/竖比例变化（不再固定 4:3 + cover 裁值） */
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card .kehua-user-card-media .kehua-post-image.kehua-post-image--single {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  border-radius: 0;
  aspect-ratio: auto;
  max-height: none;
  overflow: hidden;
}
/* 不设 max-height：限高会使竖图整体变窄，contain 下出现左右白边 */
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card .kehua-user-card-media .kehua-post-thumb-single .kehua-post-cover-img,
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card .kehua-user-card-media .kehua-post-thumb-single .kehua-bili-cover-img {
  width: 100% !important;
  height: auto !important;
  min-height: 0;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center;
  display: block;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card .kehua-post-thumb--cover-count .kehua-post-img-count-badge {
  left: 8px;
  right: auto;
  top: 8px;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card .kehua-user-card-title {
  margin: 0;
  padding: 10px 12px 0;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 600;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card .kehua-post-desc {
  font-size: 13px;
  color: #a9a9a9;
  margin: 6px 0 8px;
  padding: 0 12px;
  box-sizing: border-box;
  max-width: 100% !important;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card .kehua-post-desc a {
  color: inherit;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card .kehua-user-card-bottom {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 12px;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card .kehua-user-card-author {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card .kehua-user-card-author .kehua-post-author {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card .kehua-post-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 0 !important;
  font-size: 12px;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card .kehua-post-footer .kehua-post-views {
  line-height: 30px;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card .kehua-post-footer .kehua-post-actions {
  display: none !important;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card--no-media .kehua-user-card-title {
  padding-top: 14px;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card--no-media .kehua-post-desc {
  line-height: 1.55;
  margin-top: 6px;
  margin-bottom: 6px;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card--no-media .kehua-user-card-bottom {
  margin-top: 2px;
  padding-top: 8px;
  border-top: none;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-post-title {
  font-size: 15px;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-post-card:not(.kehua-user-thread-card) .kehua-post-desc {
  font-size: 13px;
  margin-bottom: 8px;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-post-footer {
  font-size: 12px;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-post-image-grid {
  gap: 4px;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-post-avatar.kehua-post-avatar--img {
  width: 36px;
  height: 36px;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-post-avatar-img {
  width: 36px !important;
  height: 36px !important;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card .kehua-post-avatar.kehua-post-avatar--img {
  width: 30px;
  height: 30px;
}
.kehua-feed.kehua-up-masonry-feed--mobile-card .kehua-user-thread-card .kehua-post-avatar-img {
  width: 30px !important;
  height: 30px !important;
}

/* 传统列表：紧凑、不展示缩略图/宫格；条目为独立圆角卡片 */
.kehua-feed.kehua-feed--list-classic {
  gap: 10px;
}
.kehua-feed.kehua-feed--list-classic .kehua-post-card {
  padding: 12px 16px;
}
.kehua-feed.kehua-feed--list-classic .kehua-post-thumb-single,
.kehua-feed.kehua-feed--list-classic .kehua-post-image-link--grid,
.kehua-feed.kehua-feed--list-classic .kehua-post-image-grid,
.kehua-feed.kehua-feed--list-classic .kehua-post-card > a.kehua-post-image-link.kehua-lightbox-thumb,
.kehua-feed.kehua-feed--list-classic .kehua-post-card > a.kehua-post-image-link--bili {
  display: none !important;
}
.kehua-feed.kehua-feed--list-classic .kehua-post-desc {
  margin-bottom: 8px;
}
.kehua-feed.kehua-feed--list-classic .kehua-post-footer {
  margin-top: 10px;
}

/* 传统列表 · 横排：左头像、标题+版块标签、下行昵称/浏览/回复 */
.kehua-feed.kehua-feed--list-classic .kehua-post-card.kehua-post-card--classic-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 0;
  padding: 14px 16px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.kehua-feed.kehua-feed--list-classic .kehua-post-card.kehua-post-card--classic-row:hover {
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.09);
  border-color: rgba(0, 0, 0, 0.09);
}
.kehua-feed.kehua-feed--list-classic .kehua-post-card.kehua-post-card--classic-row:last-child {
  margin-bottom: 0;
}
.kehua-feed.kehua-feed--list-classic .kehua-post-card--classic-meta .kehua-post-actions {
  flex-shrink: 0;
}
.kehua-post-card--classic-avatar.kehua-post-avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 8px;
}
.kehua-post-card--classic-avatar .kehua-post-avatar-img {
  border-radius: 8px;
}
.kehua-post-card--classic-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kehua-post-card--classic-title {
  min-width: 0;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}
.kehua-post-card--classic-title a {
  color: #1e3a5f;
  text-decoration: none;
  transition: color 0.2s;
}
.kehua-post-card--classic-title a:hover {
  color: var(--color-primary);
}
.kehua-post-card--classic-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #9ca3af;
}
.kehua-post-classic-meta-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.kehua-post-card--classic-meta .kehua-post-author {
  font-size: inherit;
  font-weight: 500;
  color: #6b7280;
}
.kehua-post-classic-time {
  color: #9ca3af;
  font-weight: 400;
  white-space: nowrap;
}
.kehua-post-classic-trace {
  margin: 0 2px 0 4px;
  color: #c4c4c4;
  font-size: 12px;
}
.kehua-post-classic-lastuser {
  color: #6b7280;
  font-weight: 500;
  text-decoration: none;
}
a.kehua-post-classic-lastuser:hover {
  color: var(--color-primary);
}
.kehua-post-classic-meta-replies {
  flex-shrink: 0;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.kehua-post-classic-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.kehua-post-classic-ico {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  opacity: 0.85;
  color: inherit;
}
a.kehua-post-classic-meta-link {
  color: inherit;
  text-decoration: none;
}
a.kehua-post-classic-meta-link:hover {
  color: var(--color-primary);
}

.kehua-post-card {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 20px;
  overflow: hidden;
}

.kehua-corner-badge {
  position: absolute;
  top: 8px;
  right: -32px;
  width: 110px;
  padding: 4px 0;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  text-align: center;
  line-height: 1.4;
  letter-spacing: 2px;
  transform: rotate(45deg);
  z-index: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.kehua-badge-top { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.kehua-badge-recommend { background: linear-gradient(135deg, #22c55e, #16a34a); }
/* 我的帖子、我的收藏页面不显示角标 */
.kehua-feed-no-corner-badge .kehua-corner-badge { display: none; }
.kehua-badge-digest { background: linear-gradient(135deg, #f59e0b, #d97706); }
.kehua-badge-hot { background: linear-gradient(135deg, #ef4444, #dc2626); }

/* 帖子卡片：头像在左 */
.kehua-post-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.kehua-post-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kehua-post-avatar.kehua-post-avatar--img {
  background-image: none !important;
  padding: 0;
  overflow: hidden;
  line-height: 0;
}

.kehua-post-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.kehua-post-avatar-1 { background: linear-gradient(135deg, #ff9a56, #ff6b6b); }
.kehua-post-avatar-2 { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.kehua-post-avatar-kehua {
  background: var(--color-primary);
  border: 1px solid var(--color-border);
}

.kehua-post-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kehua-post-meta .kehua-post-title {
  margin-top: 8px;
}

.kehua-post-author {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.kehua-post-author .kehua-post-author-link {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
  min-width: 0;
}
.kehua-post-author .kehua-post-author-link:hover {
  color: var(--color-primary);
}

.kehua-badge {
  display: inline-block;
  padding: 0 6px;
  font-size: 11px;
  background: var(--color-yellow);
  color: #333;
  border-radius: 4px;
  margin-left: 4px;
}

.kehua-post-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
}

.kehua-post-title a {
  color: var(--color-text);
  transition: color .2s;
}

.kehua-post-title a:hover {
  color: var(--color-primary);
}

/* 摘要、缩略图、底部与昵称左侧对齐，且不要太宽 */
.kehua-post-desc,
.kehua-post-image,
.kehua-post-footer {
  margin-left: 56px; /* 头像44px + 间距12px，与昵称左对齐 */
  max-width: calc(100% - 56px - 24px); /* 右侧留白，避免过宽 */
}

.kehua-post-desc {
  margin-top: 0;
  margin-bottom: 12px;
  margin-right: 0;
  color: var(--color-text-light);
  font-size: 14px;
  line-height: 1.5;
}

/* 列表单图：与摘要同宽左对齐；内层随原图横/竖/方比例自适应（不固定 16:9） */
.kehua-post-thumb-single {
  margin-left: 56px;
  margin-bottom: 10px;
  max-width: calc(100% - 56px - 24px);
  box-sizing: border-box;
}

.kehua-post-thumb-single .kehua-post-image {
  margin-left: 0 !important;
  margin-bottom: 0 !important;
  max-width: none !important;
}

.kehua-post-thumb-single .kehua-post-image-link {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  text-decoration: none;
  color: inherit;
}

/* 单图：与 .kehua-post-image-grid 同为父级宽度的 80%（桌面）；高度随原图比例 */
.kehua-post-thumb-single .kehua-post-image.kehua-post-image--single {
  display: block !important;
  width: 80% !important;
  max-width: 80% !important;
  position: relative !important;
  overflow: hidden !important;
  border-radius: var(--radius);
  box-sizing: border-box;
}

.kehua-post-thumb-single .kehua-post-image.kehua-post-image--single.kehua-post-image--lazy {
  background-color: transparent;
}

.kehua-post-thumb-single .kehua-post-cover-img,
.kehua-post-thumb-single .kehua-bili-cover-img {
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  display: block !important;
  border: 0;
  vertical-align: top;
  object-fit: contain;
  object-position: center;
}

.kehua-post-thumb--cover-count .kehua-post-img-count-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 1.5em;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* 旧版 HTML（无 .kehua-post-thumb-single 包裹）缓存命中 */
.kehua-post-card > a.kehua-post-image-link.kehua-lightbox-thumb,
.kehua-post-card > a.kehua-post-image-link.kehua-post-image-link--bili {
  display: block !important;
  width: 100% !important;
  max-width: calc(100% - 56px - 24px) !important;
}

.kehua-post-card > a.kehua-post-image-link.kehua-lightbox-thumb .kehua-post-image:not(.kehua-post-image--grid),
.kehua-post-card > a.kehua-post-image-link--bili .kehua-post-image:not(.kehua-post-image--grid) {
  width: 80% !important;
  max-width: 80% !important;
  position: relative !important;
  overflow: hidden !important;
}

.kehua-post-card > a.kehua-post-image-link.kehua-lightbox-thumb .kehua-post-image:not(.kehua-post-image--grid).kehua-post-image--lazy {
  background-color: transparent;
}

.kehua-post-card > a.kehua-post-image-link.kehua-lightbox-thumb .kehua-post-cover-img,
.kehua-post-card > a.kehua-post-image-link--bili .kehua-bili-cover-img {
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  display: block !important;
  object-fit: contain;
  object-position: center;
}

/* 单图缩略：随原图横/竖/方比例自适应（多图宫格用 .kehua-post-image--grid 另设） */
.kehua-post-image {
  margin-bottom: 10px;
  box-sizing: border-box;
  border-radius: var(--radius);
}

.kehua-post-image--lazy {
  padding: 0;
  overflow: hidden;
  background-color: #eceff1;
  background-image: none !important;
}

/* 列表：B 站封面，点击进帖子（无 data-fancybox） */
.kehua-post-image-link--bili {
  border: none;
  outline: none;
}

.kehua-post-image-link--bili:focus,
.kehua-post-image-link--bili:focus-visible {
  outline: none;
}

.kehua-post-image-link--bili .kehua-post-image {
  position: relative;
  border: none;
  box-shadow: none;
}

.kehua-post-image-link--bili .kehua-bili-cover-img {
  border: none;
  outline: none;
  vertical-align: top;
}

.kehua-post-image-link--bili .kehua-post-image::after {
  content: '▶';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  line-height: 48px;
  text-align: center;
  padding-left: 4px;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.kehua-post-image-link--bili-fallback .kehua-bili-cover-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  background: linear-gradient(135deg, #fb7299 0%, #23ade5 100%);
}

.kehua-bili-cover-fallback-text {
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.kehua-post-image-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* 列表多图：与摘要同宽铺满右侧；外框无大圆角；每格统一小圆角、格间留白（勿用 :has，部分浏览器不生效） */
.kehua-post-image-link--grid {
  margin-left: 56px;
  max-width: calc(100% - 56px - 24px);
  box-sizing: border-box;
}

.kehua-post-image-link--grid .kehua-post-image {
  margin-left: 0 !important;
}

.kehua-post-image.kehua-post-image--grid {
  width: 100%;
  max-width: 100%;
  border-radius: 0;
  background: transparent;
  /* 覆盖单图 16:9（含移动端 aspect-ratio），否则宫格高度被压扁、行被裁切 */
  aspect-ratio: auto;
  height: auto;
  min-height: 0;
}

.kehua-post-image.kehua-post-image--grid.kehua-post-image--lazy {
  overflow: visible;
  background-color: transparent;
}

.kehua-post-image--grid {
  height: auto;
  min-height: 0;
  aspect-ratio: auto;
}

.kehua-post-image-grid {
  display: grid;
  gap: 5px;
  width: 80%;
  max-width: 100%;
}

.kehua-post-image-grid--c2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kehua-post-image-grid--c3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 992px) {
  .kehua-post-image-grid {
    width: 100%;
  }

  /* 单图与宫格同宽（宫格在窄屏为 100%，单图同步） */
  .kehua-post-thumb-single .kehua-post-image.kehua-post-image--single {
    width: 100% !important;
    max-width: 100% !important;
  }

  .kehua-post-card > a.kehua-post-image-link.kehua-lightbox-thumb .kehua-post-image:not(.kehua-post-image--grid),
  .kehua-post-card > a.kehua-post-image-link--bili .kehua-post-image:not(.kehua-post-image--grid) {
    width: 100% !important;
    max-width: 100% !important;
  }
}

.kehua-post-grid-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 6px;
  background: #eceff1;
}

.kehua-post-grid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kehua-post-grid-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: clamp(16px, 4vw, 24px);
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.kehua-post-media--video {
  margin-top: 8px;
}

.kehua-article-body video,
.kehua-post-video-wrap video {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  background: #000;
}

.kehua-post-desc a {
  display: inline;
  color: inherit;
}

.kehua-post-desc a:hover {
  color: var(--color-primary);
}

/* ========== 作者页（user） ========== */
.kehua-userpage {
  width: 100%;
}

.kehua-usercard {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  margin-bottom: 14px;
}

.kehua-usercard-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.kehua-usercard-avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background-size: cover;
  background-position: center;
  flex: 0 0 auto;
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
}

.kehua-usercard-meta {
  flex: 1;
  min-width: 0;
}

.kehua-usercard-name {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.kehua-usercard-sub {
  font-size: 12px;
  color: var(--color-text-light);
}

.kehua-usercard-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.kehua-usercard-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.kehua-userstat {
  text-align: center;
}

.kehua-userstat-num {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.kehua-userstat-label {
  display: block;
  font-size: 12px;
  color: var(--color-text-light);
  margin-top: 2px;
}

.kehua-usersection-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 6px 0 10px;
}

.kehua-usersection-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.kehua-usersection-more {
  font-size: 12px;
  color: var(--color-text-light);
}

.kehua-usersection-more:hover {
  color: var(--color-primary);
}

@media (max-width: 768px) {
  .kehua-usercard-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .kehua-usercard-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }
}

/* ========== 作者页（知乎风格） ========== */
.kehua-userzh {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* 作者页为 layout 唯一主列时，避免 flex 子项 min-width:auto 被长内容撑出横向滚动 */
.kehua-layout .kehua-userzh {
  flex: 1 1 auto;
  min-width: 0;
}

.kehua-userzh-card {
  margin-top: 0;
  padding: 0 0 12px;
}

.kehua-userzh-card-no-cover {
  padding-top: 0;
}

.kehua-userzh-card-inner {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 18px;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.kehua-userzh-avatar-wrap {
  flex: 0 0 auto;
}
.kehua-userzh-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 4px solid var(--color-white);
  box-shadow: 0 10px 30px rgba(0,0,0,.16);
  margin-top: 0;
}

.kehua-userzh-avatar.kehua-userzh-avatar--img {
  background-image: none !important;
  overflow: hidden;
  padding: 0;
  line-height: 0;
  box-sizing: border-box;
}

.kehua-userzh-avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.kehua-userzh-uid {
  font-size: 13px;
  color: var(--color-text-light);
  display: block;
  margin-top: 2px;
}

.kehua-userzh-info {
  flex: 1;
  min-width: 0;
}

.kehua-userzh-name {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 6px;
}

.kehua-userzh-sub {
  font-size: 13px;
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.kehua-userzh-dot {
  opacity: .6;
}

.kehua-userzh-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.kehua-userzh-meta-item {
  font-size: 12px;
  color: var(--color-text-light);
  background: #f4f6fb;
  border: 1px solid #eef1f7;
  border-radius: 999px;
  padding: 4px 10px;
}

.kehua-userzh-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.kehua-userzh-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
}

.kehua-userzh-btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.kehua-userzh-btn-primary:hover {
  background: var(--color-primary-dark);
}

.kehua-userzh-btn-ghost {
  background: #fff;
  border-color: var(--color-border);
  color: var(--color-text);
}

.kehua-userzh-btn-ghost:hover {
  background: #f7f8fb;
}

/* 用户中心/个人中心 tabs - 长方形按钮样式 */
.kehua-userzh-tabs {
  margin-top: 12px;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
}

.kehua-userzh-tab {
  padding: 10px 20px;
  font-size: 14px;
  color: var(--color-text-light);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  white-space: nowrap;
  text-decoration: none;
  transition: all .2s;
}

.kehua-userzh-tab:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: rgba(0, 102, 255, .06);
}

.kehua-userzh-tab.kehua-active {
  color: #fff;
  background: var(--color-primary);
  border-color: var(--color-primary);
  font-weight: 600;
}

.kehua-userzh-tab.kehua-active::after {
  display: none;
}

.kehua-userzh-body {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: var(--layout-gap);
  align-items: start;
  width: 100%;
  min-width: 0;
}

.kehua-userzh-block {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.kehua-userzh-block-feed {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.kehua-userzh .kehua-feed {
  min-width: 0;
  max-width: 100%;
}

.kehua-userzh .kehua-post-title a,
.kehua-userzh .kehua-post-desc a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.kehua-userzh-block-follow {
  padding: 16px;
}

.kehua-userzh-block-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 10px;
}

.kehua-userzh-sidecard {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  position: sticky;
  top: calc(var(--header-h) + var(--top-gap));
}

.kehua-userzh-sidecard-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 10px;
}

.kehua-userzh-sideitem {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid #f0f2f6;
  font-size: 13px;
}

.kehua-userzh-sideitem:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.kehua-userzh-sideitem .k {
  color: var(--color-text-light);
}

.kehua-userzh-sideitem .v {
  flex: 1;
  min-width: 0;
  color: var(--color-text);
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.kehua-userzh-empty {
  padding: 50px 0;
  text-align: center;
  color: var(--color-text-light);
}

.kehua-userzh-btn-danger {
  background: #fff;
  border-color: #f56c6c;
  color: #f56c6c;
}

.kehua-userzh-btn-danger:hover {
  background: #f56c6c;
  color: #fff;
}

.kehua-userzh-thread {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f2f6;
}

.kehua-userzh-thread:first-child {
  padding-top: 0;
}

.kehua-userzh-thread:last-child {
  border-bottom: 0;
}

.kehua-userzh-thread-cover {
  width: 120px;
  height: 80px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  flex: 0 0 auto;
}

.kehua-userzh-thread-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.kehua-userzh-thread-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.kehua-userzh-thread-title a {
  color: var(--color-text);
}

.kehua-userzh-thread-title a:hover {
  color: var(--color-primary);
}

.kehua-userzh-thread-excerpt {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-light);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.kehua-userzh-thread-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-light);
}

.kehua-userzh-thread-tag {
  background: #f0f3ff;
  color: var(--color-primary);
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.kehua-userzh-pagination {
  padding: 16px 0 4px;
  text-align: center;
}

@media (max-width: 768px) {
  .kehua-userzh-thread-cover { width: 90px; height: 64px; }
}

/* ========== 关注/粉丝列表（复用作者页风格） ========== */
.kehua-followlist {
  display: flex;
  flex-direction: column;
}

.kehua-followitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f2f6;
}

.kehua-followitem:last-child {
  border-bottom: none;
}

.kehua-followitem-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.kehua-followitem-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #eee;
  background-size: cover;
  background-position: center;
  flex: 0 0 auto;
}

.kehua-followitem-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.kehua-followitem-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kehua-followitem-sub {
  font-size: 12px;
  color: var(--color-text-light);
}

.kehua-followitem-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 768px) {
  .kehua-followitem { padding: 10px 0; }
  .kehua-followitem-avatar { width: 40px; height: 40px; }
  .kehua-followitem-actions .kehua-userzh-btn { height: 34px; padding: 0 12px; }
}

@media (max-width: 1200px) {
  .kehua-userzh-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .kehua-userzh-sidecard {
    position: static;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}

@media (max-width: 768px) {
  .kehua-userzh {
    overflow-x: hidden;
  }

  /* 作者页顶部头像区：与个人中心 kehua-my-usercard 完全一致 */
  .kehua-userzh-card-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 24px 24px;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  }
  .kehua-userzh-avatar-wrap {
    width: 96px;
    height: 96px;
    margin: 0 auto 14px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--color-primary);
    box-shadow: 0 4px 16px rgba(56,132,244,0.18);
  }
  .kehua-userzh-avatar {
    width: 100%;
    height: 100%;
    border: none;
    box-shadow: none;
  }
  .kehua-userzh-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .kehua-userzh-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 4px;
  }
  .kehua-userzh-uid {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-primary), #60a5fa);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 10px;
    margin-bottom: 16px;
  }
  .kehua-userzh-actions {
    width: 100%;
  }
  .kehua-userzh-btn {
    flex: 1;
  }
}

.kehua-post-img-1 { background: linear-gradient(135deg, #a8c0ff 0%, #c2e9fb 100%); }
.kehua-post-img-2 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.kehua-post-img-3 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }

.kehua-post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 25px;
  color: var(--color-text-light);
  font-size: 13px;
}

.kehua-post-views {
  color: var(--color-text-light);
}

.kehua-post-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}

/* 帖子详情：正文下方点赞/收藏条 */
.kehua-article-actions {
  margin-top: 20px;
  padding-top: 18px;
  padding-bottom: 4px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}
.kehua-article-actions .kehua-post-actions {
  margin-right: 0;
  justify-content: center;
  gap: 26px;
  font-size: 1.0625rem;
}
.kehua-article-actions .kehua-post-actions svg {
  width: 30px;
  height: 30px;
}
.kehua-article-actions .kehua-post-actions span,
.kehua-article-actions .kehua-post-actions a {
  gap: 8px;
}

/* 桌面：略向右收回，平衡「贴边」与 max-width 留白（原 -50px 过贴，0 又过空） */
@media (min-width: 993px) {
  .kehua-post-actions {
    margin-right: -26px;
  }
  .kehua-article-actions .kehua-post-actions {
    margin-right: 0;
  }
}

.kehua-post-actions span,
.kehua-post-actions a {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  white-space: nowrap;
  cursor: pointer;
  transition: color .2s;
  color: var(--color-text-light);
  text-decoration: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.kehua-post-actions span:focus,
.kehua-post-actions a:focus {
  outline: none;
}

.kehua-post-actions span:active,
.kehua-post-actions a:active {
  outline: none;
}

.kehua-post-actions span.js-kehua-like:active,
.kehua-post-actions span.js-kehua-favorite:active,
.kehua-post-actions a[href]:active {
  color: var(--color-primary);
}

.kehua-post-actions .kehua-liked:active,
.kehua-post-actions .kehua-liked:active svg {
  color: #e74c3c !important;
}

.kehua-post-actions .kehua-favorited:active,
.kehua-post-actions .kehua-favorited:active svg {
  color: var(--color-yellow) !important;
}

.kehua-post-actions .kehua-liked,
.kehua-post-actions .kehua-liked svg {
  color: #e74c3c !important;
}

.kehua-post-actions .kehua-favorited,
.kehua-post-actions .kehua-favorited svg {
  color: var(--color-yellow) !important;
}

.kehua-post-actions svg {
  width: 24px;
  height: 24px;
}

.kehua-post-actions .js-kehua-like > svg,
.kehua-post-actions .js-kehua-like > .js-like-num,
.kehua-post-actions .js-kehua-favorite > svg,
.kehua-post-actions .js-kehua-favorite > .js-fav-num {
  pointer-events: none;
}

/* ========== 右侧边栏 ========== */
.kehua-sidebar-right {
  width: var(--sidebar-right-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-self: flex-start;
  /* 电脑端：随页面滚动时整块侧栏吸附在顶栏下方，避免热点/专题/关于滑出视口 */
  position: sticky;
  top: calc(var(--header-h) + var(--top-gap));
  max-height: calc(100vh - var(--header-h) - var(--top-gap) - 24px);
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.kehua-widget {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 16px;
}

.kehua-widget-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--color-text);
  line-height: 1.3;
}

/* 社区热点：有序列表，前3项数字橙红色，4-5项数字灰色 */
.kehua-hot-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.kehua-hot-list li {
  padding: 6px 0;
}

.kehua-hot-list a {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.4;
  transition: color .2s;
}

.kehua-hot-list .kehua-hot-num {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--color-text-light);
}

.kehua-hot-list .kehua-hot-num-top {
  color: #e65c00;
}

.kehua-hot-list a:hover {
  color: var(--color-primary);
}

/* 首页右侧 · 专题推荐（与手机抽屉同配置，卡片式版块入口） */
.kehua-sidebar-rec-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kehua-sidebar-rec-card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 3 / 1;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.kehua-sidebar-rec-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
.kehua-sidebar-rec-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.kehua-sidebar-rec-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}
.kehua-sidebar-rec-label {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  text-align: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  line-height: 1.3;
}

/* 首页右侧 · 友情链接（主题设置「友情链接」标签页） */
.kehua-friend-links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
}

.kehua-friend-links li {
  padding: 0;
  margin: 0;
  flex: 0 0 auto;
  max-width: 100%;
}

.kehua-friend-links a {
  display: inline-block;
  vertical-align: middle;
  max-width: 100%;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: var(--color-text);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.65);
  box-sizing: border-box;
  word-break: break-word;
  transition:
    color 0.25s ease,
    border-color 0.25s ease,
    background-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.kehua-friend-links a:hover {
  color: var(--color-primary);
  border-color: rgba(0, 102, 255, 0.38);
  background: rgba(0, 102, 255, 0.07);
  box-shadow: 0 4px 14px rgba(0, 102, 255, 0.14);
  transform: translateY(-2px);
}

.kehua-friend-links a:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 102, 255, 0.1);
  transition-duration: 0.12s;
}

.kehua-friend-links a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* 社区公告：前两项带橙色标记，后三项为数字列表 */
.kehua-announce-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.kehua-announce-list li {
  padding: 6px 0;
}

.kehua-announce-list a {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.4;
  transition: color .2s;
}

.kehua-announce-icon {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 6px;
  background: #e65c00;
  border-radius: 50%;
}

.kehua-announce-num-n {
  flex-shrink: 0;
  color: var(--color-text-light);
  font-weight: 500;
}

.kehua-announce-list a:hover {
  color: var(--color-primary);
}

/* 版权信息板块 */
.kehua-widget-footer {
  background: var(--color-white);
  padding: 20px;
}

.kehua-widget-footer .kehua-footer-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--color-text);
}

.kehua-widget-footer .kehua-footer-subtitle {
  font-size: 13px;
  color: var(--color-text);
  margin: 0 0 8px;
}

.kehua-widget-footer .kehua-footer-contact {
  font-size: 13px;
  color: var(--color-text);
  margin: 0 0 20px;
}

.kehua-widget-footer .kehua-footer-legal {
  font-size: 12px;
  color: var(--color-text-light);
  line-height: 1.6;
}

.kehua-widget-footer .kehua-footer-legal p {
  margin: 0 0 4px;
}

.kehua-widget-footer .kehua-footer-legal p:last-child {
  margin-bottom: 0;
}

/* 主题设置「首页右侧关于我们」自定义 HTML */
.kehua-widget-footer.kehua-widget-right-about > :first-child {
  margin-top: 0;
}
.kehua-widget-footer.kehua-widget-right-about > :last-child {
  margin-bottom: 0;
}
.kehua-widget-footer.kehua-widget-right-about h1,
.kehua-widget-footer.kehua-widget-right-about h2,
.kehua-widget-footer.kehua-widget-right-about h3,
.kehua-widget-footer.kehua-widget-right-about h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--color-text);
}
.kehua-widget-footer.kehua-widget-right-about p {
  font-size: 13px;
  color: var(--color-text);
  margin: 0 0 8px;
  line-height: 1.55;
}
.kehua-widget-footer.kehua-widget-right-about a {
  color: var(--color-primary);
}

.kehua-promo-widget p {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--color-text-light);
}

.kehua-promo-img {
  width: 100%;
  height: 100px;
  background: linear-gradient(135deg, #d4e4f7 0%, #e8f0f8 100%);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.kehua-btn-small {
  padding: 6px 12px;
  font-size: 12px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 6px;
}

.kehua-quick-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.kehua-quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  font-size: 12px;
  color: var(--color-text);
  background: var(--color-bg);
  border-radius: var(--radius);
  transition: background .2s, color .2s;
}

.quick-link:hover {
  background: rgba(0, 102, 255, .08);
  color: var(--color-primary);
}

.kehua-ql-icon {
  width: 28px;
  height: 28px;
  background: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 1px solid var(--color-border);
}

/* ========== 浮动按钮（返回顶部） ========== */
.kehua-fab {
  position: fixed;
  right: 24px;
  bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-white);
  color: var(--color-text);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s, visibility .25s, background .2s, transform .2s;
}

.kehua-fab.kehua-fab-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.kehua-fab:hover {
  background: #f0f0f0;
  transform: scale(1.05);
}

.kehua-fab svg {
  width: 22px;
  height: 22px;
}

/* 正文含网易云链接时显示底栏（.xn-gnp），须额外抬高避免与固定播放条重叠；--xn-gnp-height 由 xn-netease-player.js 写入 */
body.xn-gnp-pad .kehua-fab {
  bottom: calc(48px + var(--xn-gnp-height, 70px) + 12px + env(safe-area-inset-bottom, 0px));
}

/* 手机端底部标签栏（毛玻璃），默认隐藏 */
.kehua-mobile-tabbar {
  display: none;
}

/* ========== 响应式 ========== */
@media (max-width: 1200px) {
  .kehua-sidebar-right {
    width: 220px;
  }
}

@media (max-width: 992px) {
  :root {
    --sidebar-left-w: 0;
    --sidebar-right-w: 0;
  }

  .kehua-layout {
    flex-wrap: wrap;
    padding-left: 16px;
    padding-right: 16px;
  }

  .kehua-sidebar-left {
    display: none;
  }

  .kehua-sidebar-right {
    width: 100%;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
  }

  .kehua-widget {
    flex: 1;
    min-width: 200px;
  }

  /* 板块页「本板块热点」；首页「社区热点」与右侧关于/版权卡片：仅桌面端侧栏显示 */
  .kehua-widget--forum-hot-desktop-only,
  .kehua-widget--index-hot-desktop-only,
  .kehua-widget--index-about-desktop-only,
  .kehua-widget--index-rec-desktop-only,
  .kehua-widget--index-friendlinks-desktop-only {
    display: none !important;
  }

  /* 阅读页侧栏（楼主信息 + 热门帖子）：仅桌面端显示，手机端不堆在正文下方 */
  .kehua-page-read .kehua-read-sidebar {
    display: none !important;
  }

  .kehua-main {
    max-width: 100%;
    order: -1;
    width: 100%;
  }

  .kehua-nav-main {
    display: none;
  }
}

@media (max-width: 768px) {
  .kehua-header {
    background: rgba(255, 255, 255, 0.42);
    -webkit-backdrop-filter: blur(22px) saturate(185%);
    backdrop-filter: blur(22px) saturate(185%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  }

  .kehua-header-inner {
    padding: 0 12px;
    gap: 16px;
  }

  .kehua-logo-text {
    font-size: 14px;
  }

  .kehua-layout {
    padding-top: calc(var(--header-h) + var(--top-gap));
    padding-bottom: 70px;
  }

  /* 瀑布流列表：略收紧左右留白，更靠边但仍保留呼吸边（含刘海屏安全区） */
  body.kehua-index-masonry .kehua-layout.kehua-layout-index-masonry,
  body.kehua-forum-masonry .kehua-layout.kehua-layout-forum-masonry {
    padding-left: calc(10px + env(safe-area-inset-left, 0px));
    padding-right: calc(10px + env(safe-area-inset-right, 0px));
  }

  body.kehua-mobile-tabbar-on .kehua-layout {
    padding-bottom: calc(70px + 54px + env(safe-area-inset-bottom, 0px));
  }

  body.kehua-mobile-tabbar-on .kehua-fab {
    bottom: calc(40px + 54px + env(safe-area-inset-bottom, 0px));
  }

  .kehua-slider {
    aspect-ratio: 16 / 9;
    max-height: 220px;
  }

  body.kehua-index-masonry .kehua-slider-wrap--index-hero .kehua-slider--index-hero {
    aspect-ratio: 16 / 9;
    max-height: min(38vh, 240px);
  }

  body.kehua-forum-masonry .kehua-forum-hero--masonry {
    /* 桌面端用比例+max 压高度；手机端若沿用会被 max-height 裁切简介/统计/版主，改由内容撑高 */
    aspect-ratio: unset;
    max-height: none;
    min-height: 176px;
    /* 抵消 min-height 造成的「块状顶对齐、底部空一截」；信息区在头图内垂直居中，上下留白一致 */
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  body.kehua-forum-masonry .kehua-forum-hero--masonry .kehua-forum-hero-inner {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    align-self: stretch;
    /* 父级为 column 弹性盒时，继承的 margin:0 auto 会在横向把本块收窄并居中，需显式拉满宽度并左对齐 */
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: none;
    min-height: 0;
    padding: 18px 16px;
    box-sizing: border-box;
    text-align: left;
  }

  body.kehua-forum-masonry .kehua-forum-hero--masonry .kehua-forum-hero-title,
  body.kehua-forum-masonry .kehua-forum-hero--masonry .kehua-forum-hero-brief {
    text-align: left;
    width: 100%;
  }

  body.kehua-forum-masonry .kehua-forum-hero--masonry .kehua-forum-hero-stats,
  body.kehua-forum-masonry .kehua-forum-hero--masonry .kehua-forum-hero-mods {
    width: 100%;
    justify-content: flex-start;
  }

  body.kehua-forum-masonry .kehua-forum-hero--masonry .kehua-forum-hero-brief {
    margin-bottom: 12px;
  }

  body.kehua-forum-masonry .kehua-forum-hero--masonry .kehua-forum-hero-stats {
    margin-bottom: 12px;
  }

  .kehua-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  body.kehua-index-masonry #kehua-index-tabs.kehua-tabs,
  body.kehua-forum-masonry #kehua-forum-tabs.kehua-tabs {
    max-width: min(100%, 300px);
    margin-left: auto;
    margin-right: auto;
    padding: 3px;
    margin-bottom: 16px;
    border-radius: 999px;
  }

  body.kehua-index-masonry #kehua-index-tabs .kehua-tab,
  body.kehua-forum-masonry #kehua-forum-tabs .kehua-tab {
    padding: 8px 8px;
    font-size: 13px;
    border-radius: 999px;
  }

  .kehua-tab {
    white-space: nowrap;
    padding: 10px 16px;
    font-size: 13px;
  }

  .kehua-post-card {
    padding: 16px;
    overflow: hidden;
    box-sizing: border-box;
  }

  .kehua-post-desc,
  .kehua-post-image,
  .kehua-post-image-link,
  .kehua-post-footer,
  .kehua-post-thumb-single {
    margin-left: 0;
    max-width: 100%;
  }

  .kehua-post-image-link--grid {
    margin-left: 0;
    max-width: 100%;
  }

  .kehua-post-footer {
    min-width: 0;
    gap: 10px;
  }

  .kehua-post-views {
    flex: 1 1 auto;
    min-width: 0;
  }

  .kehua-post-actions {
    margin-right: 0;
    gap: 14px;
    max-width: 100%;
  }

  .kehua-post-actions span,
  .kehua-post-actions a {
    flex: 0 0 auto;
  }

  .kehua-post-actions svg {
    width: 20px;
    height: 20px;
  }

  .kehua-post-thumb-single .kehua-post-image-link {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .kehua-post-card > a.kehua-post-image-link.kehua-lightbox-thumb,
  .kehua-post-card > a.kehua-post-image-link.kehua-post-image-link--bili {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .kehua-post-image.kehua-post-image--grid {
    aspect-ratio: auto;
    height: auto;
  }

  .sidebar-right .kehua-widget {
    min-width: 100%;
  }

  .kehua-quick-links {
    grid-template-columns: repeat(3, 1fr);
  }

  .kehua-fab {
    right: 16px;
    bottom: calc(40px + env(safe-area-inset-bottom, 0px));
    width: 44px;
    height: 44px;
  }

  body.xn-gnp-pad .kehua-fab {
    bottom: calc(40px + var(--xn-gnp-height, 70px) + 12px + env(safe-area-inset-bottom, 0px));
  }

  body.kehua-mobile-tabbar-on.xn-gnp-pad .kehua-fab {
    bottom: calc(40px + 54px + var(--xn-gnp-height, 70px) + 12px + env(safe-area-inset-bottom, 0px));
  }

  .kehua-mobile-tabbar {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    pointer-events: none;
  }

  .kehua-mobile-tabbar-inner {
    pointer-events: auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 2px;
    min-height: 54px;
    padding: 6px 4px 8px;
    background: rgba(255, 255, 255, 0.8);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.06);
  }

  @supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .kehua-mobile-tabbar-inner {
      background: rgba(255, 255, 255, 0.94);
    }
  }

  /* 消息列表页：底栏与正文同色，去掉顶线/投影/毛玻璃（否则列表与底栏间像多出一道灰隔层） */
  body.kehua-mobile-tabbar-on:has(.kehua-msg-shell):not(:has(.kehua-msg-shell--chat-open)) .kehua-mobile-tabbar-inner {
    background: #fff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-top: none;
    box-shadow: none;
  }

  .kehua-mobile-tabbar-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding: 4px 2px;
    text-decoration: none;
    color: #bfbfbf;
    font-size: 11px;
    line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s, transform 0.12s;
  }

  .kehua-mobile-tabbar-item:visited {
    color: #bfbfbf;
  }

  .kehua-mobile-tabbar-item:active {
    transform: scale(0.96);
  }

  .kehua-mobile-tabbar-item--active {
    color: #2c2c2c;
  }

  .kehua-mobile-tabbar-item--active:visited {
    color: #2c2c2c;
  }

  .kehua-mobile-tabbar-ico {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
  }

  .kehua-mobile-tabbar-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    box-sizing: border-box;
    line-height: 16px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    background: #e53935;
    border-radius: 8px;
    box-shadow: 0 0 0 2px #fff;
    pointer-events: none;
    z-index: 1;
  }

  .kehua-mobile-tabbar-ico img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    opacity: 1;
    transition: opacity 0.15s;
  }

  .kehua-mobile-tabbar-ico-ph {
    display: block;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(100, 116, 139, 0.2);
  }

  .kehua-mobile-tabbar-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
  }

  /* 个人中心等页使用 skip_site_layout，无 .kehua-layout，底栏需在此留白（高度与 .kehua-mobile-tabbar-inner 一致） */
  body.kehua-mobile-tabbar-on .kehua-my-wrap {
    padding-bottom: calc(24px + 64px + env(safe-area-inset-bottom, 0px));
  }

  /* 消息列表：少用一截留白，列表区与固定底栏视觉连成一体 */
  body.kehua-mobile-tabbar-on .kehua-my-wrap:has(.kehua-msg-shell):not(:has(.kehua-msg-shell--chat-open)) {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  .kehua-mobile-tabbar-inner--dense .kehua-mobile-tabbar-label {
    font-size: 10px;
  }

  .kehua-mobile-tabbar-inner--dense .kehua-mobile-tabbar-ico {
    width: 24px;
    height: 24px;
  }

  .kehua-mobile-tabbar-inner--dense .kehua-mobile-tabbar-ico img {
    width: 22px;
    height: 22px;
  }
}

/* 发现页：旧版版块横滑样式（竖屏流上线后仅保留类名兼容） */
.kehua-discover {
  width: 100%;
  max-width: 100%;
  margin: 0;
  background: transparent;
}

.kehua-discover-inner {
  padding: 10px 12px 20px;
  box-sizing: border-box;
}

body.kehua-mobile-tabbar-on .kehua-discover-inner {
  padding-bottom: calc(20px + 64px + env(safe-area-inset-bottom, 0px));
}

.kehua-discover-scroller {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-left: -12px;
  margin-right: -12px;
  padding-left: 12px;
  padding-right: 12px;
  padding-bottom: 4px;
}

.kehua-discover-scroller::-webkit-scrollbar {
  display: none;
}

.kehua-discover-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 12px;
  width: max-content;
}

.kehua-discover-item {
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  width: 280px;
  max-width: 85vw;
  scroll-snap-align: start;
}

.kehua-discover-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: none;
  overflow: hidden;
}

.kehua-discover-card-head {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 14px 16px 16px;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.kehua-discover-card-head:active {
  background: rgba(248, 250, 252, 0.9);
}

.kehua-discover-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(145deg, #e2e8f0, #f8fafc);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.kehua-discover-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kehua-discover-card-main {
  flex: 1;
  min-width: 0;
  padding-right: 4px;
}

.kehua-discover-card-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.kehua-discover-card-desc {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kehua-discover-card-desc--muted {
  color: #94a3b8;
}

.kehua-discover-card-stat {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f8fafc;
}

.kehua-discover-card-go {
  flex-shrink: 0;
  align-self: center;
  color: #cbd5e1;
  display: flex;
  margin-top: 2px;
}

.kehua-discover-latest {
  padding: 12px 16px 14px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, #f8fafc 100%);
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.kehua-discover-latest-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.kehua-discover-latest-ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kehua-discover-latest-li {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.kehua-discover-latest-link {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  line-height: 1.4;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.kehua-discover-latest-link:active {
  color: #2563eb;
}

.kehua-discover-latest-time {
  flex-shrink: 0;
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  margin-top: 3px;
}

.kehua-discover-latest-link::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #3b82f6;
  margin-right: 8px;
  vertical-align: middle;
  margin-top: -2px;
}

.kehua-discover-empty {
  margin: 32px 16px;
  text-align: center;
  font-size: 14px;
  color: #94a3b8;
}

/* 发现页：竖屏滑动（随机帖）。滑块高度用视口计算，避免父级 height:100% 在 flex 内塌成 0 */
body.kehua-discover-vertical {
  overflow-x: hidden;
  background: var(--color-bg);
  --kehua-discover-slide-h: calc(100vh - var(--header-h));
}

@supports (height: 100dvh) {
  body.kehua-discover-vertical {
    --kehua-discover-slide-h: calc(100dvh - var(--header-h));
  }
}

@media (max-width: 900px) {
  body.kehua-mobile-tabbar-on.kehua-discover-vertical {
    --kehua-discover-slide-h: calc(100vh - var(--header-h) - 54px - env(safe-area-inset-bottom, 0px));
  }

  @supports (height: 100dvh) {
    body.kehua-mobile-tabbar-on.kehua-discover-vertical {
      --kehua-discover-slide-h: calc(100dvh - var(--header-h) - 54px - env(safe-area-inset-bottom, 0px));
    }
  }
}

body.kehua-discover-vertical .kehua-layout.kehua-layout-no-left {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: var(--header-h) 0 0;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

body.kehua-discover-vertical .kehua-main.kehua-discover--vertical {
  flex: 1 1 auto;
  min-height: 0;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--color-bg);
}

.kehua-discover-vscroll {
  box-sizing: border-box;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  height: var(--kehua-discover-slide-h);
  min-height: var(--kehua-discover-slide-h);
  max-height: var(--kehua-discover-slide-h);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-scroll-snap-type: y mandatory;
  scroll-padding: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: var(--color-bg);
  padding: 0;
  touch-action: pan-y;
}

.kehua-discover-vscroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.kehua-discover-vscroll-sentinel {
  height: 1px;
  width: 100%;
  flex-shrink: 0;
  pointer-events: none;
  scroll-snap-align: none;
}

.kehua-discover-vscroll--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-type: none;
  height: var(--kehua-discover-slide-h);
  min-height: var(--kehua-discover-slide-h);
}

.kehua-discover-vscroll--empty .kehua-discover-empty {
  margin: 32px 20px;
  color: var(--color-text-light);
}

.kehua-discover-vslide {
  position: relative;
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
  height: var(--kehua-discover-slide-h);
  min-height: var(--kehua-discover-slide-h);
  max-height: var(--kehua-discover-slide-h);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  box-shadow: none;
}

/* 有封面图/视频：整图铺满，文案叠在图上，无底部白底/渐变/分隔线 */
.kehua-discover-vslide--media {
  box-shadow: none;
  background: #0a0a0a;
  border-bottom: none;
}

.kehua-discover-vslide--media .kehua-discover-vslide-panel {
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  border: none;
  border-top: none;
  padding: 18px 62px 28px 18px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

.kehua-discover-vslide--media .kehua-discover-vslide-title {
  color: #fff;
  font-size: 19px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65), 0 2px 16px rgba(0, 0, 0, 0.45);
}

.kehua-discover-vslide--media .kehua-discover-vslide-text {
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), 0 1px 10px rgba(0, 0, 0, 0.35);
  -webkit-line-clamp: 5;
}

.kehua-discover-vslide--media .kehua-discover-vslide-meta {
  margin-top: 10px;
  margin-bottom: 0;
}

.kehua-discover-vslide--media .kehua-discover-vslide-user {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.kehua-discover-vslide--media .kehua-discover-vslide-avatar {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45), 0 2px 10px rgba(0, 0, 0, 0.35);
}

.kehua-discover-actions {
  position: absolute;
  right: max(10px, env(safe-area-inset-right, 0px));
  top: 50%;
  transform: translateY(-45%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  pointer-events: auto;
}

.kehua-discover-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 48px;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
  font: inherit;
}

.kehua-discover-action-item img {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.kehua-discover-action-count {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7), 0 0 12px rgba(0, 0, 0, 0.35);
}

.kehua-discover-action-comment:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
  border-radius: 6px;
}

.kehua-discover-actions--inline {
  position: static;
  right: auto;
  top: auto;
  transform: none;
  flex-direction: row;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 50px;
  flex-shrink: 0;
  pointer-events: auto;
}

.kehua-discover-actions--inline .kehua-discover-action-item {
  min-width: 0;
  gap: 2px;
}

.kehua-discover-actions--inline .kehua-discover-action-item img {
  width: 28px;
  height: 28px;
  filter: none;
}

.kehua-discover-vslide--no-media .kehua-discover-actions--inline .kehua-discover-action-count {
  color: #64748b;
  text-shadow: none;
  font-size: 11px;
  font-weight: 600;
}

.kehua-discover-vslide--no-media .kehua-discover-actions--inline .kehua-discover-action-comment:focus-visible {
  outline: 2px solid rgba(0, 102, 255, 0.85);
  outline-offset: 2px;
}

/* 纯文字帖：同样一屏一条，内容区垂直铺开 */
.kehua-discover-vslide--no-media {
  display: flex;
  flex-direction: column;
}

.kehua-discover-vslide--no-media .kehua-discover-vslide-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.kehua-discover-vslide--no-media .kehua-discover-vslide-panel {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: 28px 22px 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, #f1f5f9 0%, #ffffff 28%);
  border-top: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 2;
  pointer-events: none;
}

.kehua-discover-vslide--no-media .kehua-discover-vslide-panel::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary), rgba(0, 102, 255, 0.35));
  margin-bottom: 18px;
  flex-shrink: 0;
}

.kehua-discover-vslide--no-media .kehua-discover-vslide-panel .kehua-discover-vslide-user {
  pointer-events: auto;
}

.kehua-discover-vslide--no-media .kehua-discover-vslide-meta {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  margin-bottom: 0;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.kehua-discover-vslide--no-media .kehua-discover-vslide-user {
  min-width: 0;
  flex: 1 1 auto;
}

.kehua-discover-vslide--no-media .kehua-discover-vslide-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kehua-discover-vslide--no-media .kehua-discover-vslide-title {
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.kehua-discover-vslide--no-media .kehua-discover-vslide-text {
  -webkit-line-clamp: unset;
  display: block;
  overflow: visible;
  font-size: 15px;
  line-height: 1.65;
  color: #475569;
  margin-bottom: 0;
}

.kehua-discover-vslide--no-media .kehua-discover-vslide-avatar {
  width: 36px;
  height: 36px;
}

.kehua-discover-vslide-media {
  position: absolute;
  inset: 0;
  background: #e8ebf0;
  overflow: hidden;
}

.kehua-discover-vslide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kehua-discover-vslide-gallery {
  position: absolute;
  inset: 0;
}

.kehua-discover-vslide-gallery .kehua-discover-vslide-img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  z-index: 0;
  transition: opacity 0.95s ease-in-out;
  pointer-events: none;
  backface-visibility: hidden;
  transform-origin: center center;
}

.kehua-discover-vslide-gallery .kehua-discover-vslide-img:not(.kehua-discover-vslide-img--active) {
  animation: none;
  transform: scale(1);
}

.kehua-discover-vslide-gallery .kehua-discover-vslide-img--active {
  opacity: 1;
  z-index: 1;
  animation: kehua-discover-cover-breathe 16s ease-in-out infinite alternate;
}

@keyframes kehua-discover-cover-breathe {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.07);
  }
}

.kehua-discover-vslide--media .kehua-discover-vslide-media > img.kehua-discover-vslide-img {
  transform-origin: center center;
  backface-visibility: hidden;
  animation: kehua-discover-cover-breathe 16s ease-in-out infinite alternate;
}

@media (prefers-reduced-motion: reduce) {
  .kehua-discover-vslide--media .kehua-discover-vslide-media > img.kehua-discover-vslide-img {
    animation: none;
  }

  .kehua-discover-vslide-gallery .kehua-discover-vslide-img {
    transition-duration: 0.12s;
  }

  .kehua-discover-vslide-gallery .kehua-discover-vslide-img--active {
    animation: none;
    transform: scale(1);
  }
}

.kehua-discover-vslide-video {
  position: absolute;
  inset: 0;
}

.kehua-discover-vslide-video video,
.kehua-discover-vslide-video iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 0;
  position: absolute;
  inset: 0;
}

.kehua-discover-vslide-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #eef1f6 0%, #dfe5ef 100%);
}

.kehua-discover-vslide-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.22) 100%);
}

.kehua-discover-vslide-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.kehua-discover-vslide-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 16px 16px 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  background: transparent;
  border: none;
}

.kehua-discover-vslide-panel .kehua-discover-vslide-user {
  pointer-events: auto;
}

.kehua-discover-vslide-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-text);
  letter-spacing: -0.02em;
  text-shadow: none;
}

.kehua-discover-vslide-text {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-light);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: none;
}

.kehua-discover-vslide-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 10px;
}

.kehua-discover-vslide-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
}

.kehua-discover-vslide-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

@media (max-width: 900px) {
  body.kehua-mobile-tabbar-on.kehua-discover-vertical .kehua-layout.kehua-layout-no-left {
    padding-bottom: calc(54px + env(safe-area-inset-bottom, 0px));
  }

  .kehua-discover-vscroll {
    max-width: none;
  }

  .kehua-discover-vslide-panel {
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .kehua-discover-vslide--media .kehua-discover-vslide-panel {
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 480px) {
  .kehua-logo-text {
    display: none;
  }

  .kehua-post-footer {
    flex-wrap: wrap;
    gap: 8px;
  }

  .kehua-post-actions {
    gap: 12px;
    font-size: 12px;
  }

  .kehua-post-actions span,
  .kehua-post-actions a {
    flex: 0 0 auto;
  }

  .kehua-post-actions svg {
    width: 18px;
    height: 18px;
  }

  .kehua-quick-links {
    grid-template-columns: 1fr 1fr;
  }
}

/* ========== 阅读页 ========== */
.kehua-page-read .kehua-read-layout {
  max-width: 1250px;
  margin: 0 auto;
  padding: calc(var(--header-h) + var(--top-gap)) 20px 80px;
  display: flex;
  gap: var(--layout-gap);
  align-items: flex-start;
}

/* ========== 板块页（forum） ========== */
.kehua-forum-main {
  width: 100%;
}

/* 作者资料页：解除主栏 640px 限制，与 .kehua-layout 同宽 */
.kehua-main.kehua-user-main {
  max-width: 100%;
  width: 100%;
}

.kehua-forum-hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  height: 180px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.kehua-forum-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
}

.kehua-forum-hero-mask {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,.18) 0%, rgba(0,0,0,.30) 100%);
}

.kehua-forum-hero-inner {
  position: relative;
  z-index: 2;
  padding: 22px 22px;
  color: #fff;
}

.kehua-forum-hero-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0,0,0,.45);
}

.kehua-forum-hero-brief {
  margin: 0 0 10px;
  max-width: 820px;
  font-size: 13px;
  opacity: .92;
  line-height: 1.55;
  text-shadow: 0 2px 10px rgba(0,0,0,.45);
}

.kehua-forum-hero-stats {
  display: flex;
  gap: 14px;
  font-size: 12px;
  opacity: .92;
  text-shadow: 0 2px 10px rgba(0,0,0,.45);
}

.kehua-forum-hero-mods {
  margin-top: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.kehua-forum-hero-mods-label {
  font-size: 12px;
  opacity: .92;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(6px);
}

.kehua-forum-mod {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(6px);
  color: #fff;
  transition: background .15s;
}

.kehua-forum-mod:hover {
  background: rgba(255,255,255,.18);
}

.kehua-forum-mod-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  flex: 0 0 auto;
}

.kehua-forum-mod-avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.kehua-forum-mod-name {
  font-size: 12px;
  opacity: .95;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kehua-forum-mod-empty {
  font-size: 12px;
  opacity: .9;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(6px);
}

.kehua-forum-tabs .kehua-tab {
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  /* 描述多行时不再用固定高度，避免挤压底部版主区；桌面端仍保持固定高度 */
  .kehua-forum-hero {
    height: auto;
    min-height: 148px;
  }

  .kehua-forum-hero-inner {
    padding: 16px 16px 15px;
  }

  .kehua-forum-hero-title {
    font-size: 18px;
    margin-bottom: 4px;
  }

  .kehua-forum-hero-brief {
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.5;
  }

  .kehua-forum-hero-stats {
    font-size: 11px;
    gap: 12px;
  }

  .kehua-forum-hero-mods {
    margin-top: 10px;
    row-gap: 8px;
  }
}

.kehua-page-read .kehua-read-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: transparent;
}

/* 阅读页：内容板块与评论区为两个独立白色卡片 */
.kehua-read-main .kehua-content-block,
.kehua-read-main .kehua-comment-block {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 32px 40px;
  min-width: 0;
}

/* 帖子页评论区分页：与 my-follow 同款 kehua-pagination，与回复列表细分隔 */
.kehua-read-main .kehua-comment-block .kehua-article + .kehua-thread-pagination.kehua-my-pagination {
  border-top: 1px solid var(--color-border);
  padding-top: 20px;
}

.kehua-page-read .kehua-article-title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text);
}

/* 阅读页标题下：桌面仍为「日期 · 浏览」一行；头像与昵称仅手机端展示 */
.kehua-page-read .kehua-article-head {
  margin-bottom: 24px;
}

.kehua-page-read .kehua-article-head-avatar {
  display: none;
}

.kehua-page-read .kehua-article-head-avatar img {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-bg, #f0f0f0);
}

.kehua-page-read .kehua-article-author-name {
  display: none;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--color-text);
}

.kehua-page-read .kehua-article-meta {
  margin-bottom: 0;
  font-size: 13px;
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

.kehua-page-read .kehua-article-meta .kehua-meta-sep {
  margin: 0 10px;
  opacity: 0.55;
  user-select: none;
}

/* 覆盖全局 .kehua-article-meta span+span，避免与「·」分隔混用时间距加倍 */
.kehua-page-read .kehua-article-meta > span + span {
  margin-left: 0;
}

.kehua-page-read .kehua-article-body,
.kehua-read-main .kehua-article-body {
  font-size: 15px;
  line-height: 1.75;
  color: var(--color-text);
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  overflow-x: auto;
}

.kehua-page-read .kehua-article-body p {
  margin: 0 0 1em;
}

.kehua-page-read .kehua-article-body p:last-child {
  margin-bottom: 0;
}

.kehua-page-read .kehua-article-body img,
.kehua-read-main .kehua-article-body img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.kehua-page-read .kehua-article-body pre,
.kehua-read-main .kehua-article-body pre,
.kehua-post-message pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  box-sizing: border-box;
}

.kehua-post-message {
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  overflow-x: auto;
}

/* 修罗原版：被回复的评论引用样式（适用于所有 blockquote.blockquote） */
.kehua-post-message blockquote.blockquote,
.kehua-article-body blockquote.blockquote,
blockquote.blockquote {
  position: relative;
  margin: 10px 0 12px;
  padding: 10px 56px 10px 12px;
  background: #f2f2f2 !important;
  border: 1px dashed #ccc !important;
  border-radius: 4px;
  font-size: 13px;
  color: var(--color-text-light);
  line-height: 1.5;
}

.kehua-post-message blockquote.blockquote::after,
.kehua-article-body blockquote.blockquote::after,
blockquote.blockquote::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: url(../images/quote.png) no-repeat center;
  background-size: contain;
}

.kehua-post-message blockquote.blockquote .avatar-1,
.kehua-article-body blockquote.blockquote .avatar-1,
blockquote.blockquote .avatar-1 {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 6px;
  object-fit: cover;
}

.kehua-post-message blockquote.blockquote .user,
.kehua-article-body blockquote.blockquote .user,
blockquote.blockquote .user {
  display: inline;
  font-size: 12px;
  color: #666 !important;
  text-decoration: none;
  margin-right: 6px;
}

/* 评论项：约135px高度，增加间距 */
.kehua-post-item {
  padding: 36px 0;
  border-bottom: 1px solid var(--color-border);
  min-height: 135px;
  box-sizing: border-box;
}

/* 固定顶栏：#post-xxx 锚点滚动时预留顶栏高度，避免内容被遮挡 */
.kehua-page-read .kehua-comment-block .kehua-post-item {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.kehua-post-item:last-child {
  border-bottom: none;
}

/* 锚点定位到某条评论时的短暂高亮（消息/链接跳转 #post-pid） */
.kehua-post-item.kehua-post-target-flash {
  animation: kehua-post-target-flash 3s ease-out forwards;
  border-radius: 8px;
}
@keyframes kehua-post-target-flash {
  0% {
    background-color: rgba(0, 102, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(0, 102, 255, 0.35);
  }
  35% {
    background-color: rgba(0, 102, 255, 0.1);
    box-shadow: inset 0 0 0 1px rgba(0, 102, 255, 0.2);
  }
  100% {
    background-color: transparent;
    box-shadow: none;
  }
}

.kehua-post-reply {
  color: #999;
  font-size: 12px;
}
.kehua-post-reply:hover {
  color: var(--color-primary);
}

.kehua-link-muted {
  color: var(--color-text-light);
}
.kehua-link-muted:hover {
  color: var(--color-primary);
}

/* 回帖板块：头像+昵称+楼层，输入框，回帖/高级回复 */
.kehua-reply-to-hint { display: none !important; }
.kehua-reply-box {
  margin-top: 24px;
  padding: 20px 0;
  position: relative;
}
.kehua-reply-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.kehua-reply-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--color-bg) no-repeat center;
  background-size: cover;
}

.kehua-reply-avatar.kehua-reply-avatar--img {
  background-image: none !important;
  padding: 0;
  overflow: hidden;
  line-height: 0;
}

.kehua-reply-avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.kehua-reply-username {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
}
.kehua-reply-floor {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--color-text-light);
  background: var(--color-bg);
  border-radius: 999px;
}
.kehua-btn-cancel-reply {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--color-text-light);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.kehua-btn-cancel-reply:hover {
  color: var(--color-text);
  background: #e8eaef;
}
.kehua-reply-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color .2s;
}
.kehua-reply-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}
.kehua-reply-textarea::placeholder {
  color: #aaa;
}
.kehua-reply-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 10px;
}
.kehua-reply-actions-left {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.kehua-reply-submit {
  padding: 8px 20px;
  font-size: 14px;
  border-radius: 8px;
}
.kehua-reply-advanced {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--color-text-light);
  text-decoration: none;
  transition: color .2s;
}
.kehua-reply-advanced:hover {
  color: var(--color-primary);
}

/* 主题已关闭：替代回帖框的提示（与后台发帖限制一致） */
.kehua-reply-closed-tip {
  margin-top: 24px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: #f5f7fa;
  border: 1px solid var(--color-border);
  text-align: center;
}
.kehua-reply-closed-tip-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-text-light);
}

/* 未登录：底部回复区引导 */
.kehua-reply-login-gate {
  margin-top: 24px;
}
.kehua-reply-login-gate-card {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius, 12px);
  background: linear-gradient(145deg, #fafcfb 0%, #f0f4f2 100%);
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.05);
}
.kehua-reply-login-gate-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(61, 155, 92, 0.12);
  color: var(--color-primary);
}
.kehua-reply-login-gate-text {
  flex: 1;
  min-width: 160px;
}
.kehua-reply-login-gate-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.02em;
}
.kehua-reply-login-gate-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-text-light);
}
.kehua-reply-login-gate-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 10px rgba(61, 155, 92, 0.28);
}
.kehua-reply-login-gate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(61, 155, 92, 0.35);
}
@media (max-width: 640px) {
  .kehua-reply-login-gate-card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
}
  .kehua-reply-login-gate-icon {
    margin: 0 auto;
  }
  .kehua-reply-login-gate-btn {
    width: 100%;
    box-sizing: border-box;
  }
}

/* 阅读页右侧：作者信息 */
.kehua-page-read .kehua-read-sidebar {
  width: 320px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-h) + var(--top-gap));
  display: flex;
  flex-direction: column;
  /* 与 .kehua-sidebar-right 一致（本板块热点 / 专题推荐 等区块间距），且勿与 .kehua-read-sidebar-widget 的 margin 叠加 */
  gap: 20px;
}

.kehua-page-read .kehua-read-sidebar-widget {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 16px;
}

.kehua-page-read .kehua-author-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 20px;
}

.kehua-page-read .kehua-author-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.kehua-page-read .kehua-author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, #ff9a56, #ff6b6b);
}

.kehua-page-read .kehua-author-head-text {
  flex: 1;
  min-width: 0;
}

.kehua-page-read .kehua-author-name {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.kehua-page-read .kehua-author-uid {
  font-size: 12px;
  color: var(--color-text-light);
}

.kehua-page-read .kehua-author-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.kehua-page-read .kehua-author-btn {
  flex: 1;
  height: 36px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.kehua-page-read .kehua-author-btn-follow {
  background: var(--color-primary);
  color: var(--color-white);
}

.kehua-page-read .kehua-author-btn-follow:hover {
  background: var(--color-primary-dark);
}

.kehua-page-read .kehua-author-btn-msg {
  background: var(--color-bg);
  color: var(--color-text);
}

.kehua-page-read .kehua-author-btn-msg:hover {
  background: #e8eaef;
}

.kehua-page-read .kehua-author-stats {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--color-border);
  padding-top: 14px;
}

.kehua-page-read .kehua-author-stat {
  flex: 1;
  text-align: center;
  padding: 0 4px;
}

.kehua-page-read .kehua-author-stat:not(:last-child) {
  border-right: 1px solid var(--color-border);
}

.kehua-page-read .kehua-author-stat-num {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.kehua-page-read .kehua-author-stat-label {
  font-size: 12px;
  color: var(--color-text-light);
}

@media (max-width: 768px) {
  /* 列布局时必须 stretch，否则 align-items:flex-start 会让主栏/卡片随内容缩窄 */
  .kehua-page-read .kehua-read-layout {
    flex-direction: column;
    align-items: stretch;
    padding-left: 16px;
    padding-right: 16px;
    /* 勿 hidden：会压住正文内表格的横向滚动，表格在 .kehua-article-body 内滑动 */
    overflow-x: visible;
  }

  .kehua-page-read .kehua-read-main {
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    box-sizing: border-box;
  }

  .kehua-page-read .kehua-read-sidebar {
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    position: static;
  }

  .kehua-page-read .kehua-read-main .kehua-content-block,
  .kehua-page-read .kehua-read-main .kehua-comment-block {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 24px 20px;
  }

  .kehua-page-read .kehua-mod-bar {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .kehua-page-read .kehua-article-title {
    font-size: 18px;
    margin-bottom: 14px;
  }

  .kehua-page-read .kehua-article-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
  }

  .kehua-page-read .kehua-article-head-avatar {
    display: block;
    flex-shrink: 0;
    line-height: 0;
  }

  .kehua-page-read .kehua-article-head-main {
    flex: 1;
    min-width: 0;
  }

  .kehua-page-read .kehua-article-author-name {
    display: block;
    margin-bottom: 4px;
  }

  .kehua-page-read .kehua-article-meta {
    font-size: 12px;
    line-height: 1.4;
  }

  .kehua-page-read .kehua-article-meta .kehua-meta-sep {
    margin: 0 6px;
  }
}

/* 阅读页在 layout 内（无 page-read 包装时） */
.kehua-main.kehua-read-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: transparent;
}

.kehua-main.kehua-read-main .kehua-content-block,
.kehua-main.kehua-read-main .kehua-comment-block {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 32px 40px;
  min-width: 0;
}
.kehua-article-title { margin: 0 0 12px; font-size: 22px; font-weight: 600; line-height: 1.35; color: var(--color-text); }
.kehua-article-meta { margin-bottom: 24px; font-size: 13px; color: var(--color-text-light); }
.kehua-article-meta span + span { margin-left: 16px; }
.kehua-article-body { font-size: 15px; line-height: 1.75; color: var(--color-text); overflow-wrap: anywhere; word-break: break-word; max-width: 100%; }
.kehua-article-body p { margin: 0 0 1em; }
.kehua-article-body p:last-child { margin-bottom: 0; }
.kehua-article-body img { max-width: 100%; height: auto; vertical-align: middle; }
.kehua-read-main img { max-width: 100%; height: auto; vertical-align: middle; }

.kehua-sidebar-right .kehua-author-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 20px;
}
.kehua-author-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.kehua-author-avatar { width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; background: linear-gradient(135deg, #ff9a56, #ff6b6b); }

.kehua-author-avatar.kehua-author-avatar--img {
  background: none !important;
  padding: 0;
  overflow: hidden;
  line-height: 0;
}

.kehua-author-avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.kehua-author-head-text { flex: 1; min-width: 0; }
.kehua-author-name { margin: 0 0 4px; font-size: 16px; font-weight: 600; color: var(--color-text); line-height: 1.3; }
.kehua-author-uid { font-size: 12px; color: var(--color-text-light); }
.kehua-author-actions { display: flex; gap: 10px; margin-bottom: 18px; }
.kehua-author-btn { flex: 1; height: 36px; border: none; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; transition: background .2s, color .2s; text-align: center; line-height: 36px; text-decoration: none; }
.kehua-author-btn-follow { background: var(--color-primary); color: var(--color-white); }
.kehua-author-btn-follow:hover { background: var(--color-primary-dark); color: var(--color-white); }
.kehua-author-stats { display: flex; align-items: stretch; border-top: 1px solid var(--color-border); padding-top: 14px; }
.kehua-author-stat { flex: 1; text-align: center; padding: 0 4px; }
.kehua-author-stat:not(:last-child) { border-right: 1px solid var(--color-border); }
.kehua-author-stat-num { display: block; font-size: 15px; font-weight: 600; color: var(--color-text); margin-bottom: 2px; }
.kehua-author-stat-label { font-size: 12px; color: var(--color-text-light); }
.kehua-read-sidebar-widget { background: var(--color-white); border-radius: var(--radius); padding: 16px; }

/* 阅读页底部管理栏（删除/移动/置顶/关闭）- 评论板块外、页面底部 */
.kehua-mod-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-top: 24px;
  padding: 14px 24px;
  background: #fff;
  border: none;
  border-radius: var(--radius);
}
.kehua-mod-btn {
  flex: 1;
  max-width: 100px;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--color-text);
  text-align: center;
  text-decoration: none;
  transition: color .2s;
}
.kehua-mod-btn:hover {
  color: var(--color-primary);
}
.kehua-mod-btn:not(:last-child) {
  border-right: 1px solid var(--color-border);
}

/* 手机端管理操作：用网格 + 1px 间隙模拟分割线，避免每格独立 border 错位；奇数个时最后一项通栏 */
@media (max-width: 768px) {
  .kehua-mod-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--color-border);
    border: none;
  }
  .kehua-mod-bar .kehua-mod-btn {
    padding: 14px 12px;
    max-width: none;
    margin: 0;
    border: none;
    border-radius: 0;
    background: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    box-sizing: border-box;
  }
  .kehua-mod-bar .kehua-mod-btn:not(:last-child) {
    border-right: none;
  }
  .kehua-mod-bar .kehua-mod-btn:hover {
    background: #f7f8fa;
    color: var(--color-primary);
  }
  .kehua-mod-bar .kehua-mod-btn:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

/* ========== 发布帖子页（两栏：左标题+编辑器，右版块+附件） ========== */
.kehua-post-main { max-width: none; }
.kehua-post-page { width: 100%; padding: 0; }
.kehua-post-form {
  margin: 0;
  padding: 0;
  border: 0;
  display: block;
  width: 100%;
  box-sizing: border-box;
}
/* Grid：左列 start＝白卡顶与行顶对齐；右列 stretch＝壳层拉满行高，sticky 才有足够滚动区间（整页 align-items:start 会让右列只剩内容高，吸顶失效） */
.kehua-post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}
.kehua-post-left {
  align-self: start;
  min-width: 0;
  margin: 0;
  padding: 0;
}
.kehua-post-right {
  align-self: stretch;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  box-sizing: border-box;
}
/* 吸顶壳：无 padding/背景/overflow，与 .kehua-post-side-card 分离，解决 sticky+内部滚动一体时相对左侧顶边下移 */
.kehua-post-side-sticky {
  width: 100%;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  align-self: flex-start;
  box-sizing: border-box;
}
.kehua-post-card { background: var(--color-white); border-radius: var(--radius); padding: 28px 32px; }
.kehua-post-page-title { margin: 0 0 24px; font-size: 20px; font-weight: 600; color: var(--color-text); text-align: center; }
.kehua-form-group { margin-bottom: 20px; }
.kehua-form-group:last-child { margin-bottom: 0; }
.kehua-label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: var(--color-text); }
.kehua-label-dot::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--color-primary); margin-right: 6px; vertical-align: 0.15em; }
.kehua-input { width: 100%; padding: 10px 14px; border: 1px solid var(--color-border); border-radius: 8px; font-size: 14px; box-sizing: border-box; }
.kehua-editor-textarea { width: 100%; min-height: 360px; padding: 12px; border: 1px solid var(--color-border); border-radius: 8px; font-size: 14px; resize: vertical; box-sizing: border-box; }
/* 发帖可选区块：details 折叠，无 JS；编辑已有数据时模板带 open */
.kehua-post-collapse > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}
.kehua-post-collapse > summary:focus {
  outline: none;
}
.kehua-post-collapse > summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 6px;
}
.kehua-post-collapse > summary::-webkit-details-marker {
  display: none;
}
.kehua-post-collapse > summary::after {
  content: '';
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-right: 2px solid var(--color-text-light);
  border-bottom: 2px solid var(--color-text-light);
  transform: rotate(-45deg);
  flex-shrink: 0;
  opacity: 0.55;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.kehua-post-collapse[open] > summary::after {
  transform: rotate(45deg);
  margin-top: 2px;
  opacity: 0.85;
}
details.kehua-post-collapse--paylink > summary::after {
  border-right-color: #6366f1;
  border-bottom-color: #6366f1;
  opacity: 0.7;
}
details.kehua-post-collapse--paylink[open] > summary::after {
  opacity: 1;
}
/* 隐藏内容折叠：外层与「付费下载」同款虚线框 + 浅紫渐变底 + 标题色 */
details.kehua-hidden-post-wrap.kehua-post-collapse > summary::after {
  border-right-color: #6366f1;
  border-bottom-color: #6366f1;
  opacity: 0.7;
}
details.kehua-hidden-post-wrap.kehua-post-collapse[open] > summary::after {
  opacity: 1;
}
.kehua-post-collapse__body {
  padding-top: 4px;
}
.kehua-hidden-post-wrap {
  margin: 18px 0 8px;
  padding: 12px 18px 16px;
  border-radius: 14px;
  border: 1px dashed #c7d2fe;
  background: linear-gradient(145deg, #eef2ff 0%, #fff 55%, #f5f3ff 100%);
  box-sizing: border-box;
}
.kehua-hidden-post-wrap > summary {
  padding: 6px 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: #3730a3;
}
.kehua-hidden-post-wrap .kehua-post-collapse__body {
  padding-top: 8px;
}
.kehua-hidden-post-row { margin-bottom: 10px; }
.kehua-hidden-post-label { display: block; font-size: 13px; font-weight: 500; color: var(--color-text); margin-bottom: 6px; }
.kehua-hidden-select { max-width: 340px; }
.kehua-hidden-mode-radios {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: 2px;
}
.kehua-hidden-mode-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-white);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  font-size: 14px;
  color: var(--color-text);
  flex: 1 1 0;
  min-width: 0;
  box-sizing: border-box;
}
.kehua-hidden-mode-item:hover {
  border-color: rgba(0, 102, 255, 0.35);
  background: rgba(0, 102, 255, 0.04);
}
.kehua-hidden-mode-item:has(.kehua-hidden-mode-radio:checked) {
  border-color: var(--color-primary);
  background: rgba(0, 102, 255, 0.08);
}
.kehua-hidden-mode-radio {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}
.kehua-hidden-mode-text {
  flex: 1;
  min-width: 0;
  line-height: 1.45;
  text-align: left;
}
.kehua-hidden-textarea { min-height: 120px; font-family: inherit; line-height: 1.5; resize: vertical; }
.kehua-hidden-hint { font-size: 12px; color: var(--color-text-light); margin: 8px 0 0; line-height: 1.55; }
.kehua-hidden-block { margin-top: 16px; padding: 14px 16px; border-radius: var(--radius); background: #f5f7fa; border: 1px solid var(--color-border); }
.kehua-hidden-body { font-size: 14px; line-height: 1.65; color: var(--color-text); word-break: break-word; }
/* 无权限查看隐藏区：与「参与讨论」引导条同款浅底，整句同色文案（无链接、无强调色） */
.kehua-hidden-block--locked {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius, 12px);
  background: linear-gradient(145deg, #fafcfb 0%, #f0f4f2 100%);
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.05);
}
.kehua-hidden-lock-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--color-text-light);
}
.kehua-hidden-lock-line {
  display: inline;
  color: inherit;
}
.kehua-post-plugin-bottom { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kehua-post-submit-wrap { margin-top: 20px; text-align: right; }
.kehua-btn-post-submit { padding: 10px 28px; font-size: 15px; }
.kehua-fid-hidden { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* 发帖/编辑成功：轻提示（不占用整页） */
.kehua-post-toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  z-index: 10050;
  pointer-events: none;
}
.kehua-post-toast.kehua-post-toast-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.kehua-post-toast-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  max-width: min(92vw, 400px);
}
.kehua-post-toast-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 28px;
  text-align: center;
}
.kehua-post-toast-body { min-width: 0; }
.kehua-post-toast-text { font-weight: 600; color: var(--color-text); font-size: 15px; line-height: 1.4; }
.kehua-post-toast-sub { margin-top: 4px; font-size: 12px; color: var(--color-text-light); }

/* 发帖/编辑成功：居中弹窗（遮罩 + 卡片） */
.kehua-post-success-overlay {
  position: fixed;
  inset: 0;
  z-index: 100500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  pointer-events: none;
}
.kehua-post-success-overlay.kehua-post-success-overlay--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.kehua-post-success-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.kehua-post-success-overlay-panel {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 32px 28px 28px;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  text-align: center;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.25s ease;
}
.kehua-post-success-overlay--visible .kehua-post-success-overlay-panel {
  transform: translateY(0) scale(1);
}
.kehua-post-success-overlay-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}
.kehua-post-success-overlay-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.45;
}
.kehua-post-success-overlay-sub {
  margin-top: 12px;
  font-size: 13px;
  color: var(--color-text-light);
  line-height: 1.5;
}

/* 发帖校验/业务提示：与成功弹窗同结构，图标为琥珀色「!」 */
.kehua-post-success-overlay--notice .kehua-post-success-overlay-icon {
  background: linear-gradient(145deg, #f59e0b 0%, #ea580c 100%);
  font-size: 28px;
  font-weight: 800;
}
.kehua-post-success-overlay-btn {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--color-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
}
.kehua-post-success-overlay-btn:hover {
  opacity: 0.92;
}
.kehua-post-success-overlay-btn:active {
  transform: scale(0.98);
}

@media (max-width: 992px) {
  .kehua-post-page,
  .kehua-post-main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .kehua-post-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .kehua-post-left,
  .kehua-post-right {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .kehua-post-right {
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
  }

  .kehua-post-side-sticky {
    position: static;
    top: auto;
    align-self: stretch;
  }

  .kehua-post-side-card {
    position: static;
    top: auto;
    margin-top: 0;
    max-height: none;
    overflow-y: visible;
    padding: 16px;
  }

  .kehua-post-card {
    padding: 16px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .kehua-post-page-title {
    font-size: 18px;
    margin-bottom: 16px;
  }
}

.kehua-post-side-card {
  width: 100%;
  margin: 0;
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 20px 20px 20px;
  box-sizing: border-box;
}
@media (min-width: 993px) {
  .kehua-post-side-sticky {
    position: -webkit-sticky;
    position: sticky;
    top: calc(var(--header-h) + var(--top-gap));
  }
  .kehua-post-side-card {
    max-height: calc(100vh - var(--header-h) - var(--top-gap) - 16px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}
.kehua-post-tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 1px solid var(--color-border); }
.kehua-post-tab { margin: 0; padding: 10px 16px; font-size: 14px; color: var(--color-text-light); background: none; border: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.kehua-post-tab.kehua-active { color: var(--color-primary); font-weight: 500; border-bottom-color: var(--color-primary); }
.kehua-post-tab-panel { display: none; }
.kehua-post-tab-panel.kehua-active { display: block; }

.kehua-forum-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.kehua-forum-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: 8px; cursor: pointer; transition: border-color .2s, background .2s; }
.kehua-forum-card:hover { border-color: var(--color-primary); background: rgba(0,102,255,.04); }
.kehua-forum-card-selected { border-color: var(--color-primary); background: rgba(0,102,255,.08); }
.kehua-forum-card-icon { width: 24px; height: 24px; border-radius: 6px; background: var(--color-bg); flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.kehua-forum-card-icon-img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block; }
.kehua-forum-card-selected .kehua-forum-card-icon { background: var(--color-bg); }
.kehua-forum-card-name { flex: 1; font-size: 14px; color: var(--color-text); }
.kehua-forum-radio { margin: 0; }
.kehua-tag-add { width: 100%; padding: 10px 14px; border: 1px dashed var(--color-border); border-radius: 8px; background: var(--color-bg); color: var(--color-text-light); font-size: 14px; cursor: pointer; }
.kehua-tag-add:hover { border-color: var(--color-primary); color: var(--color-primary); }

.kehua-add-attach { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 12px 20px; border: 1px dashed var(--color-border); border-radius: 8px; background: var(--color-bg); color: var(--color-text-light); font-size: 14px; cursor: pointer; position: relative; transition: border-color .2s, color .2s; }
.kehua-add-attach:hover { border-color: var(--color-primary); color: var(--color-primary); }
.kehua-add-attach-text { white-space: nowrap; }
.kehua-add-attach input[type="file"] { position: absolute; width: 0.1px; height: 0.1px; opacity: 0; overflow: hidden; z-index: -1; }
/* 已上传附件列表：发帖侧栏 + 帖子阅读页正文等（勿只写 .kehua-post-right，阅读页在 .kehua-article-body） */
fieldset.fieldset.kehua-attach-fieldset,
fieldset.fieldset:has(ul.attachlist),
.attachlist_parent > fieldset.fieldset {
	margin-top: 14px;
	padding: 14px 12px 12px;
	border: 1px solid var(--color-border);
	border-radius: 12px;
	background: linear-gradient(165deg, #f8fafc 0%, #ffffff 55%);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 18px rgba(15, 23, 42, 0.04);
	font-size: 13px;
	min-width: 0;
}
.kehua-attach-fieldset-legend,
fieldset.fieldset:has(ul.attachlist) > legend {
	padding: 0 8px;
	margin: 0 0 0 2px;
	font-size: 13px;
	font-weight: 600;
	color: var(--color-text);
	letter-spacing: 0.02em;
}
fieldset.fieldset.kehua-attach-fieldset ul.attachlist,
fieldset.fieldset:has(ul.attachlist) ul.attachlist,
.attachlist_parent ul.attachlist {
	list-style: none;
	padding: 0;
	margin: 8px 0 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
fieldset.fieldset.kehua-attach-fieldset ul.attachlist > li,
fieldset.fieldset:has(ul.attachlist) ul.attachlist > li,
.attachlist_parent ul.attachlist > li {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 10px;
	padding: 10px 12px;
	margin: 0;
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 10px;
	background: var(--color-white, #fff);
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
	transition: border-color 0.2s, box-shadow 0.2s;
}
fieldset.fieldset.kehua-attach-fieldset ul.attachlist > li:hover,
fieldset.fieldset:has(ul.attachlist) ul.attachlist > li:hover,
.attachlist_parent ul.attachlist > li:hover {
	border-color: rgba(0, 102, 255, 0.22);
	box-shadow: 0 2px 10px rgba(0, 102, 255, 0.06);
}
fieldset.fieldset.kehua-attach-fieldset ul.attachlist > li > a:first-of-type,
fieldset.fieldset:has(ul.attachlist) ul.attachlist > li > a:first-of-type,
.attachlist_parent ul.attachlist > li > a:first-of-type {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	flex: 1;
	min-width: 0;
	text-decoration: none;
	color: var(--color-text);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.35;
	word-break: break-all;
	transition: color 0.2s;
}
fieldset.fieldset.kehua-attach-fieldset ul.attachlist > li > a:first-of-type:hover,
fieldset.fieldset:has(ul.attachlist) ul.attachlist > li > a:first-of-type:hover,
.attachlist_parent ul.attachlist > li > a:first-of-type:hover {
	color: var(--color-primary);
}
/* 附件行右侧：大小 · 下载次数 */
fieldset.fieldset.kehua-attach-fieldset ul.attachlist > li > .kehua-attach-meta,
fieldset.fieldset:has(ul.attachlist) ul.attachlist > li > .kehua-attach-meta,
.attachlist_parent ul.attachlist > li > .kehua-attach-meta,
ul.attachlist > li > .kehua-attach-meta {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--color-text-light);
	white-space: nowrap;
}
.kehua-attach-meta-sep {
	opacity: 0.5;
	padding: 0 3px;
}
/* 不显示文件类型小图标（避免空白方框/雪碧图占位） */
fieldset.fieldset.kehua-attach-fieldset ul.attachlist .icon.filetype,
fieldset.fieldset:has(ul.attachlist) ul.attachlist .icon.filetype,
.attachlist_parent ul.attachlist .icon.filetype,
ul.attachlist .icon.filetype {
	display: none !important;
}
fieldset.fieldset.kehua-attach-fieldset ul.attachlist a.delete,
fieldset.fieldset:has(ul.attachlist) ul.attachlist a.delete,
.attachlist_parent ul.attachlist a.delete {
	margin-left: 0.75rem;
	padding: 5px 10px;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 500;
	color: #b91c1c !important;
	background: rgba(185, 28, 28, 0.08);
	text-decoration: none;
	transition: background 0.2s, color 0.2s;
	flex-shrink: 0;
}
fieldset.fieldset.kehua-attach-fieldset ul.attachlist > li:not(:has(.kehua-attach-meta)) > a.delete,
fieldset.fieldset:has(ul.attachlist) ul.attachlist > li:not(:has(.kehua-attach-meta)) > a.delete,
.attachlist_parent ul.attachlist > li:not(:has(.kehua-attach-meta)) > a.delete {
	margin-left: auto;
}
fieldset.fieldset.kehua-attach-fieldset ul.attachlist a.delete:hover,
fieldset.fieldset:has(ul.attachlist) ul.attachlist a.delete:hover,
.attachlist_parent ul.attachlist a.delete:hover {
	color: #991b1b !important;
	background: rgba(185, 28, 28, 0.14);
}
.kehua-post-right .fieldset:not(.kehua-attach-fieldset) {
	margin-top: 12px;
	font-size: 13px;
}

/* 发帖/编辑页右侧栏：左栏文件名+次行元数据；右栏删除跨行垂直居中（不靠底对齐） */
.kehua-post-right fieldset.fieldset.kehua-attach-fieldset ul.attachlist > li,
.kehua-post-right fieldset.fieldset:has(ul.attachlist) ul.attachlist > li,
.kehua-post-right .attachlist_parent ul.attachlist > li {
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-rows: auto auto;
	align-items: start;
	column-gap: 10px;
	row-gap: 4px;
	padding-top: 8px;
	padding-bottom: 8px;
}
.kehua-post-right fieldset.fieldset.kehua-attach-fieldset ul.attachlist > li > a:first-of-type,
.kehua-post-right fieldset.fieldset:has(ul.attachlist) ul.attachlist > li > a:first-of-type,
.kehua-post-right .attachlist_parent ul.attachlist > li > a:first-of-type {
	grid-column: 1;
	grid-row: 1;
	flex: none;
	width: auto;
	max-width: 100%;
	min-width: 0;
	word-break: break-word;
	overflow-wrap: anywhere;
}
.kehua-post-right fieldset.fieldset.kehua-attach-fieldset ul.attachlist > li > .kehua-attach-meta,
.kehua-post-right fieldset.fieldset:has(ul.attachlist) ul.attachlist > li > .kehua-attach-meta,
.kehua-post-right .attachlist_parent ul.attachlist > li > .kehua-attach-meta {
	grid-column: 1;
	grid-row: 2;
	justify-self: start;
	align-self: center;
	margin: 0;
	font-size: 11px;
	line-height: 1.35;
	opacity: 0.92;
}
.kehua-post-right fieldset.fieldset.kehua-attach-fieldset ul.attachlist > li > a.delete,
.kehua-post-right fieldset.fieldset:has(ul.attachlist) ul.attachlist > li > a.delete,
.kehua-post-right .attachlist_parent ul.attachlist > li > a.delete {
	grid-column: 2;
	grid-row: 1 / -1;
	justify-self: end;
	align-self: center;
	margin: 0;
}
.kehua-post-right fieldset.fieldset.kehua-attach-fieldset ul.attachlist > li:not(:has(.kehua-attach-meta)) > a.delete,
.kehua-post-right fieldset.fieldset:has(ul.attachlist) ul.attachlist > li:not(:has(.kehua-attach-meta)) > a.delete,
.kehua-post-right .attachlist_parent ul.attachlist > li:not(:has(.kehua-attach-meta)) > a.delete {
	grid-column: 2;
	grid-row: 1;
	align-self: center;
}

/* 附件受限：与正常附件同一套 fieldset + ul.attachlist > li 卡片，不再使用虚线 fieldset */
.kehua-article-body .kehua-attach-guard:not(.kehua-attach-fieldset),
.kehua-post-message .kehua-attach-guard:not(.kehua-attach-fieldset) {
	border-radius: 8px;
	padding: 12px 14px;
	margin: 12px 0;
	background: var(--color-bg, #f8f9fa);
	border: 1px dashed var(--color-border, #ddd);
}
fieldset.fieldset.kehua-attach-fieldset.kehua-attach-guard {
	border-style: solid;
	border-color: var(--color-border);
	background: linear-gradient(165deg, #f8fafc 0%, #ffffff 55%);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 18px rgba(15, 23, 42, 0.04);
}
ul.attachlist > li.kehua-attach-guard-item {
	cursor: default;
}
ul.attachlist > li.kehua-attach-guard-item:hover {
	border-color: rgba(0, 0, 0, 0.06);
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}
.kehua-attach-guard-hint {
	display: block;
	margin: 0;
	font-size: 14px;
	font-weight: 500;
	color: var(--color-text-light, #666);
	line-height: 1.5;
}

/* ===== 搜索弹窗（毛玻璃） ===== */
.kehua-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px 40px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.kehua-search-overlay.kehua-search-open {
  opacity: 1;
  visibility: visible;
}
.kehua-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.kehua-search-content {
  position: relative;
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.kehua-search-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  border-radius: 50%;
  transition: color .2s, background .2s;
}
.kehua-search-close:hover {
  color: var(--color-text);
  background: rgba(0, 0, 0, .06);
}
.kehua-search-close svg {
  width: 22px;
  height: 22px;
}
.kehua-search-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.kehua-search-tabs {
  display: flex;
  align-items: center;
  padding: 4px;
  gap: 4px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 9999px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}
.kehua-search-tab {
  padding: 8px 18px;
  font-size: 14px;
  color: var(--color-text-light);
  border-radius: 9999px;
  transition: all .2s;
}
.kehua-search-tab:hover {
  color: var(--color-text);
}
.kehua-search-tab.kehua-active {
  background: var(--color-white);
  color: var(--color-text);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}
.kehua-search-form {
  width: 100%;
}
.kehua-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 12px 20px;
  background: var(--color-white);
  border: 2px solid #e8e8e8;
  border-radius: 9999px;
  transition: border-color .2s, box-shadow .2s;
}
.kehua-search-input-wrap:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, .15);
}
.kehua-search-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--color-text-light);
}
.kehua-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  font-size: 16px;
  color: var(--color-text);
  background: transparent;
  outline: none;
}
.kehua-search-input::placeholder {
  color: #aaa;
}
.kehua-search-submit {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 50%;
  transition: background .2s;
}
.kehua-search-submit:hover {
  background: var(--color-primary-dark);
}
.kehua-search-submit svg {
  width: 20px;
  height: 20px;
}
.kehua-search-history,
.kehua-search-recommend {
  width: 100%;
}
.kehua-search-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--color-text-light);
}
.kehua-search-section-icon {
  width: 18px;
  height: 18px;
  color: var(--color-text-light);
}
.kehua-search-icon-fire {
  color: #f97316;
}
.kehua-search-clear,
.kehua-search-refresh {
  margin-left: auto;
  padding: 0;
  font-size: 13px;
  color: #999;
  background: none;
  border: none;
  cursor: pointer;
  transition: color .2s;
}
.kehua-search-clear:hover,
.kehua-search-refresh:hover {
  color: var(--color-text);
}
.kehua-search-refresh {
  padding: 4px;
}
.kehua-search-refresh svg {
  width: 16px;
  height: 16px;
}
.kehua-search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.kehua-search-tag {
  padding: 6px 14px;
  font-size: 13px;
  color: var(--color-text);
  background: var(--color-white);
  border: 1px solid #e8e8e8;
  border-radius: 9999px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.kehua-search-tag:hover {
  border-color: var(--color-primary);
  background: rgba(0, 102, 255, .04);
}

/* 搜索结果页 */
.kehua-search-page { max-width: 900px; margin: 0 auto; }
.kehua-main.kehua-search-page .kehua-search-user-body {
  width: 100%;
  min-width: 0;
}
.kehua-main.kehua-search-page .kehua-search-user-body .kehua-up-feed {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
.kehua-search-result-hero {
  background: linear-gradient(135deg, rgba(0, 102, 255, .06) 0%, rgba(0, 102, 255, .02) 100%);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 24px;
  border: 1px solid rgba(0, 102, 255, .08);
}
.kehua-search-result-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--color-text);
  letter-spacing: -0.02em;
}
.kehua-search-result-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.kehua-search-result-form { flex: 1; min-width: 0; }
.kehua-search-result-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px 10px 16px;
  background: var(--color-white);
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  transition: border-color .2s, box-shadow .2s;
}
.kehua-search-result-input-wrap:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(0, 102, 255, .12);
}
.kehua-search-result-input-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--color-text-light);
}
.kehua-search-result-input {
  flex: 1;
  min-width: 0;
  border: none;
  font-size: 14px;
  color: var(--color-text);
  background: transparent;
  outline: none;
}
.kehua-search-result-input::placeholder { color: #9ca3af; }
.kehua-search-result-submit {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s;
}
.kehua-search-result-submit:hover { background: var(--color-primary-dark); }
@media (max-width: 600px) {
  .kehua-search-result-bar { flex-direction: column; align-items: flex-start; }
  .kehua-search-result-tabs { align-self: flex-start; }
  .kehua-search-result-form { min-width: 0; width: 100%; }
}
.kehua-search-keyword { color: var(--color-primary); font-weight: 800; }
.kehua-search-result-tabs {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  gap: 4px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}
.kehua-search-result-tab { padding: 8px 20px; font-size: 14px; font-weight: 500; color: var(--color-text-light); border-radius: 8px; transition: all .2s; }
.kehua-search-result-tab:hover { color: var(--color-text); background: rgba(0,0,0,.04); }
.kehua-search-result-tab.kehua-active { background: var(--color-primary); color: #fff; }
.kehua-search-result-hint { margin: 0; font-size: 15px; color: var(--color-text-light); }
.kehua-search-feed { margin-top: 0; }
/* 搜索结果-用户：双列网格（作者页关注为三列，此处单独两列更适配搜索页宽度） */
/* 勿用 kehua-feed--list-classic：会给 .kehua-post-card 加强制 padding，破坏关系卡 */
.kehua-main.kehua-search-page #kehua-search-user-relations-wrap.kehua-feed.kehua-up-feed--user-relations {
  display: grid !important;
  flex-direction: unset;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  align-items: start;
}
@media (max-width: 768px) {
  .kehua-main.kehua-search-page #kehua-search-user-relations-wrap.kehua-feed.kehua-up-feed--user-relations {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
}
.kehua-main.kehua-search-page #kehua-search-user-relations-wrap.kehua-up-feed--user-relations .kehua-user-relation-card.kehua-post-card {
  padding: 0 !important;
}
.kehua-main.kehua-search-page #kehua-search-user-relations-wrap.kehua-up-feed--user-relations .kehua-user-relation-card {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
}
.kehua-main.kehua-search-page #kehua-search-user-relations-wrap.kehua-up-feed--user-relations > article.kehua-post-card:not(.kehua-user-relation-card) {
  grid-column: 1 / -1;
  justify-self: stretch;
}
.kehua-main.kehua-search-page .kehua-user-relation-card.kehua-post-card {
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.1);
  border: 1px solid rgba(226, 232, 240, 0.95);
  padding: 0;
  background: #fff;
}
/* 与 user.htm 作者页一致：组标签仅在 .kehua-user-main 下有样式，搜索页需补全 */
.kehua-main.kehua-search-page .kehua-user-relation-card .kehua-up-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: #f3f4f6;
  color: #374151;
}
.kehua-main.kehua-search-page .kehua-user-relation-card .kehua-up-tag-dark {
  background: #111827;
  color: #fff;
}
.kehua-main.kehua-search-page .kehua-ur-card__banner {
  position: relative;
  height: 112px;
  background-color: #ffffff;
  background-size: cover;
  background-position: center bottom;
  background-image: none;
}
.kehua-main.kehua-search-page .kehua-ur-card__banner.kehua-ur-card__banner--custom {
  background-image: none;
  background-color: #ffffff;
}
.kehua-main.kehua-search-page .kehua-ur-card__banner.kehua-ur-card__banner--custom::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 70%;
  background: linear-gradient(to bottom, transparent 0%, rgba(255,255,255,0.5) 50%, #fff 92%);
  pointer-events: none;
}
.kehua-main.kehua-search-page .kehua-ur-card__body {
  position: relative;
  padding: 0 18px 18px;
  margin-top: -40px;
}
.kehua-main.kehua-search-page .kehua-ur-card__row1 {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  min-height: 48px;
}
.kehua-main.kehua-search-page .kehua-ur-card__avatar {
  flex-shrink: 0;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  background: #fff;
  overflow: hidden;
}
.kehua-main.kehua-search-page .kehua-ur-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.kehua-main.kehua-search-page .kehua-ur-card__nameblock {
  flex: 1;
  min-width: 0;
  padding-bottom: 4px;
}
.kehua-main.kehua-search-page .kehua-ur-card__name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
}
.kehua-main.kehua-search-page .kehua-ur-card__name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.02em;
  line-height: 1.25;
  min-width: 0;
}
.kehua-main.kehua-search-page .kehua-ur-card__name a {
  color: inherit;
  text-decoration: none;
}
.kehua-main.kehua-search-page .kehua-ur-card__name a:hover {
  color: #2563eb;
}
.kehua-main.kehua-search-page .kehua-ur-card__badges-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.kehua-main.kehua-search-page .kehua-ur-card__badges-inline .kehua-vip-badge {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  margin-left: 0;
}
.kehua-main.kehua-search-page .kehua-ur-card__badges-inline .kehua-vip-badge--active {
  color: #c6303e;
}
.kehua-main.kehua-search-page .kehua-ur-card__badges-inline .kehua-vip-badge--inactive {
  color: #9ca3af;
}
.kehua-main.kehua-search-page .kehua-ur-card__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.kehua-main.kehua-search-page .kehua-ur-card__uid {
  font-size: 12px;
  color: #9ca3af;
}
/* 与作者页一致：仅竖线分隔三列，外层无圆角灰底盒子 */
.kehua-main.kehua-search-page .kehua-ur-card__stats {
  display: flex;
  align-items: stretch;
  margin-top: 16px;
  padding: 4px 0;
  background: transparent;
  border: none;
  border-radius: 0;
}
.kehua-main.kehua-search-page .kehua-ur-card__stat {
  flex: 1;
  min-width: 0;
  text-align: center;
  border: none;
  border-left: 1px solid #e8ecf1;
}
.kehua-main.kehua-search-page .kehua-ur-card__stat:first-child {
  border-left: none;
}
.kehua-main.kehua-search-page .kehua-ur-card__stat-num {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}
.kehua-main.kehua-search-page .kehua-ur-card__stat-label {
  margin-top: 4px;
  font-size: 12px;
  color: #8b95a1;
}
.kehua-main.kehua-search-page .kehua-ur-card__actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.kehua-main.kehua-search-page .kehua-ur-card__btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.kehua-main.kehua-search-page .kehua-ur-card__btn:hover {
  background: #f9fafb;
}
.kehua-main.kehua-search-page .kehua-ur-card__btn--pm .kehua-ur-card__ic {
  color: #22c55e;
}
.kehua-main.kehua-search-page .kehua-ur-card__btn--follow {
  border: none;
  background: var(--color-primary);
  color: var(--color-white);
}
.kehua-main.kehua-search-page .kehua-ur-card__btn--follow:hover {
  background: var(--color-primary-dark);
  color: var(--color-white);
}
.kehua-main.kehua-search-page .kehua-ur-card__btn--followed {
  border: none;
  background: #e5e7eb;
  color: #374151;
}
.kehua-main.kehua-search-page .kehua-ur-card__btn--followed:hover {
  background: #d1d5db;
}
.kehua-main.kehua-search-page .kehua-ur-card__btn .haya-follow-btn {
  pointer-events: none;
}
.kehua-search-empty { color: var(--color-text-light); padding: 40px 0; margin: 0; font-size: 15px; text-align: center; }

/* 私信页（ax_notice_sx 整合） */
/* 私信弹窗：Bootstrap 弹窗最小样式 + 与截图一致（灰顶栏、白底、圆角、蓝按钮） */
/* 须保留 display:none，否则无 .show 的 .modal 会铺满视口且无法关闭（覆盖 Bootstrap .modal{display:none}） */
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 1050; width: 100%; height: 100%; overflow-x: hidden; overflow-y: auto; outline: 0; }
.modal.fade { opacity: 0; transition: opacity .15s linear; }
.modal.show { display: block; opacity: 1; }
.modal-dialog { position: relative; width: auto; max-width: 500px; margin: 1.75rem auto; pointer-events: none; }
.modal-content { position: relative; display: flex; flex-direction: column; width: 100%; pointer-events: auto; background: var(--color-white); border: none; border-radius: var(--radius); box-shadow: 0 5px 15px rgba(0,0,0,.2); }
.modal-backdrop { position: fixed; top: 0; left: 0; z-index: 1040; width: 100vw; height: 100vh; background: rgba(0,0,0,.5); }
.modal-backdrop.fade { opacity: 0; }
.modal-backdrop.show { opacity: 1; }
.modal-header { background: #f0f0f0; border-bottom: 1px solid var(--color-border); border-radius: var(--radius) var(--radius) 0 0; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.modal-header .modal-title { font-size: 15px; font-weight: 600; color: var(--color-text); margin: 0; }
.modal-header .close { font-size: 24px; color: #999; opacity: 1; padding: 0 4px; background: none; border: none; cursor: pointer; line-height: 1; }
.modal-body { position: relative; flex: 1 1 auto; padding: 20px 24px 24px; }
.modal-body h5 { margin: 0; font-size: 14px; font-weight: 500; color: var(--color-text); line-height: 1.5; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 24px 20px; border-top: 1px solid var(--color-border); background: #fafafa; border-radius: 0 0 var(--radius) var(--radius); }
.modal-footer .btn { display: inline-block; padding: 8px 20px; font-size: 14px; line-height: 1.5; border-radius: 8px; cursor: pointer; border: none; transition: background .2s; }
.modal-footer .btn-primary { background: var(--color-primary); color: #fff; }
.modal-footer .btn-primary:hover { background: var(--color-primary-dark); color: #fff; }
.modal-footer .btn-secondary { background: #e8e8e8; color: var(--color-text); }
.modal-footer .btn-secondary:hover { background: #ddd; color: var(--color-text); }
.modal .kehua-sx-page { padding: 0; }
.kehua-sx-page { padding: 24px 28px; }
.kehua-sx-page .kehua-sx-to { margin: 0 0 16px; font-size: 14px; color: var(--color-text-light); }
.kehua-sx-page .kehua-sx-to strong { color: var(--color-text); }
.kehua-sx-page textarea.kehua-input { min-height: 140px; resize: vertical; border: 1px solid #cce; }
.kehua-sx-page .kehua-btn { width: 100%; margin-top: 12px; border-radius: 9999px; }
.modal .kehua-sx-page textarea.kehua-input { margin-bottom: 4px; }
.modal .kehua-sx-page .kehua-btn { margin-top: 16px; border-radius: 9999px; }

/* 管理弹窗（删除/移动/置顶/关闭）内容样式 */
.kehua-mod-form { padding: 8px 0; }
.kehua-mod-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--color-text);
}
.kehua-mod-row:last-of-type { margin-bottom: 24px; }
.kehua-mod-label { color: var(--color-text-light); flex-shrink: 0; }
.kehua-mod-value { font-weight: 600; color: #e53e3e; }
.kehua-mod-select {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  min-width: 140px;
  background: #fff;
}
.kehua-mod-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
}
.kehua-mod-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 400;
  color: var(--color-text);
}
.kehua-mod-radio input { margin: 0; cursor: pointer; }
.kehua-mod-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}
.kehua-mod-btn {
  padding: 10px 24px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: background .2s;
  min-width: 72px;
  white-space: nowrap;
}
.kehua-mod-form .kehua-btn-primary { background: var(--color-primary); color: #fff; }
.kehua-mod-form .kehua-btn-primary:hover { background: var(--color-primary-dark); color: #fff; }
.kehua-mod-form .kehua-btn-secondary { background: #e8e8e8; color: var(--color-text); }
.kehua-mod-form .kehua-btn-secondary:hover { background: #ddd; color: var(--color-text); }

/* ===== Personal Center ===== */
.kehua-my-wrap {
  display: flex;
  gap: 28px;
  max-width: 1250px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 24px) 20px 32px;
}
.kehua-my-sidebar {
  width: 260px;
  flex-shrink: 0;
}
.kehua-my-content {
  flex: 1;
  min-width: 0;
}

/* 个人中心页内抽屉：桌面为侧栏列；≤900px 为右侧滑出（见 my_sidebar.inc.htm） */
.kehua-my-wrap > .kehua-my-drawer:not(.kehua-my-drawer-floating) {
  width: 260px;
  flex-shrink: 0;
  align-self: flex-start;
  position: relative;
}
.kehua-my-wrap > .kehua-my-drawer:not(.kehua-my-drawer-floating) .kehua-my-drawer-backdrop {
  display: none;
}
.kehua-my-wrap > .kehua-my-drawer:not(.kehua-my-drawer-floating) .kehua-my-drawer-panel {
  position: static;
  transform: none !important;
  width: 100%;
  max-height: none;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  border: none;
  border-radius: 0;
  display: block;
  overflow: visible;
}

/* 全站浮动个人中心抽屉（非 my 路由，任意屏宽均为右侧毛玻璃滑层） */
.kehua-my-drawer-floating {
  position: fixed;
  inset: 0;
  z-index: 960;
  width: 0 !important;
  height: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  flex: 0 0 0 !important;
  margin: 0;
  padding: 0;
  overflow: visible;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.32s ease;
}
.kehua-my-drawer-floating.kehua-my-drawer-open {
  pointer-events: auto;
  visibility: visible;
}
.kehua-my-drawer-floating .kehua-my-drawer-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  opacity: 0;
  transition: opacity 0.32s ease;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.kehua-my-drawer-floating.kehua-my-drawer-open .kehua-my-drawer-backdrop {
  opacity: 1;
}
.kehua-my-drawer-floating .kehua-my-drawer-panel {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(90vw, 300px);
  max-width: 100%;
  overflow: hidden;
  outline: none;
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-right: none;
  box-shadow: -16px 0 44px rgba(15, 23, 42, 0.14);
  background: linear-gradient(
    200deg,
    rgba(255, 255, 255, 0.82) 0%,
    rgba(240, 248, 255, 0.72) 42%,
    rgba(232, 242, 255, 0.7) 100%
  );
  -webkit-backdrop-filter: blur(26px) saturate(140%);
  backdrop-filter: blur(26px) saturate(140%);
  transform: translate3d(100%, 0, 0);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
.kehua-my-drawer-floating.kehua-my-drawer-open .kehua-my-drawer-panel {
  transform: translate3d(0, 0, 0) !important;
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .kehua-my-drawer-floating .kehua-my-drawer-panel {
    background: rgba(248, 250, 252, 0.97);
  }
}
.kehua-my-drawer-floating .kehua-my-drawer-panel .kehua-my-sidebar {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 10px calc(16px + env(safe-area-inset-bottom, 0px));
}
.kehua-my-drawer-floating .kehua-my-drawer-panel .kehua-my-usercard {
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}
.kehua-my-drawer-floating .kehua-my-drawer-panel .kehua-my-nav {
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.kehua-my-usercard {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  padding: 32px 24px 24px;
  text-align: center;
  margin-bottom: 16px;
}
.kehua-my-avatar-wrap {
  width: 96px;
  height: 96px;
  margin: 0 auto 14px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--color-primary);
  box-shadow: 0 4px 16px rgba(56,132,244,0.18);
}
.kehua-my-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.kehua-my-username {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 4px;
}
.kehua-my-uid {
  display: inline-block;
  background: linear-gradient(135deg, var(--color-primary), #60a5fa);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 10px;
  margin-bottom: 16px;
}
.kehua-my-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}
.kehua-my-stat {
  text-align: center;
}
.kehua-my-stat-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-heading);
  line-height: 1.2;
}
.kehua-my-stat-label {
  font-size: 12px;
  color: var(--color-text-light);
}
.kehua-my-nav {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  overflow: hidden;
}
.kehua-my-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  font-size: 14px;
  color: var(--color-text);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all .2s;
}
.kehua-my-nav a:hover {
  background: #f6f8fc;
  color: var(--color-primary);
}
.kehua-my-nav a.kehua-my-nav-active {
  color: var(--color-primary);
  background: #eef4ff;
  border-left-color: var(--color-primary);
  font-weight: 600;
}
.kehua-my-nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.65;
}
.kehua-my-nav a.kehua-my-nav-active .kehua-my-nav-icon {
  opacity: 1;
}
.kehua-my-nav-logout {
  border-top: 1px solid #f0f0f0;
  color: #e74c3c !important;
}
.kehua-my-nav-logout:hover {
  background: #fef2f2 !important;
  color: #dc2626 !important;
}
.kehua-my-nav-logout .kehua-my-nav-icon {
  opacity: 0.8;
}
.kehua-my-panel {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  overflow: hidden;
}
/* 个人中心/关注页面 tabs - 长方形按钮样式 */
.kehua-my-tabs {
  display: flex;
  padding: 16px 28px;
  gap: 8px;
  overflow-x: auto;
  flex-wrap: wrap;
}
.kehua-my-tab {
  padding: 10px 20px;
  font-size: 14px;
  color: var(--color-text-light);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: all .2s;
}
.kehua-my-tab:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: rgba(0, 102, 255, .06);
}
.kehua-my-tab.kehua-active {
  color: #fff;
  background: var(--color-primary);
  border-color: var(--color-primary);
  font-weight: 600;
}

/* 手机端：隐藏资料子页顶栏 Tab（与侧栏 / 手机宫格入口重复） */
@media (max-width: 768px) {
  .kehua-my-wrap .kehua-my-panel > .kehua-my-tabs {
    display: none !important;
  }
}

/* 动态页子 tabs（全部/主题/回复） */
.kehua-my-tabs-sub {
  border-bottom: none !important;
  padding: 0 0 16px !important;
}
/* 我的积分页：顶栏子筛选（积分 / 收支明细），与个人资料 Tab 分离 */
.kehua-points-subtabs {
  padding: 16px 28px 12px;
  border-bottom: none;
}
.kehua-points-record-body {
  padding-top: 20px;
}
.kehua-points-record-empty {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--color-text-light);
}
.kehua-points-record-table-wrap {
  overflow-x: auto;
}
.kehua-points-record-table .kehua-points-record-time {
  white-space: nowrap;
}
.kehua-points-record-table .kehua-points-record-memo {
  max-width: min(320px, 48vw);
  word-break: break-word;
}
.kehua-points-record-pager {
  margin-top: 20px;
}
.kehua-my-body {
  padding: 28px;
}
.kehua-my-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.kehua-my-info-item {
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
}
.kehua-my-info-label {
  width: 90px;
  flex-shrink: 0;
  color: var(--color-text-light);
}
.kehua-my-info-value {
  color: var(--color-heading);
  font-weight: 500;
}

/* 「我的」基本资料页 · 手机头图（仅 .kehua-my-wrap--profile-hero，≤768px 展示） */
.kehua-my-mhero {
  display: none;
}
.kehua-my-mhero {
  position: relative;
  color: #0f172a;
}
.kehua-my-mhero-banner {
  position: relative;
  height: calc(152px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  box-sizing: border-box;
  border-radius: 0;
  background-color: #8fa8bc;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 360" preserveAspectRatio="xMidYMax slice"><defs><linearGradient id="g" x1="0%25" y1="0%25" x2="0%25" y2="100%25"><stop offset="0%25" stop-color="%23c5d4e2"/><stop offset="55%25" stop-color="%238fa3b5"/><stop offset="100%25" stop-color="%235d7285"/></linearGradient></defs><rect width="1200" height="360" fill="url(%23g)"/><path fill="%234a5f72" opacity="0.35" d="M0 360 L180 200 L320 280 L480 160 L620 240 L780 120 L920 200 L1080 80 L1200 140 L1200 360 Z"/></svg>');
  background-size: cover;
  background-position: center bottom;
}
.kehua-my-mhero-banner--custom {
  background-image: none;
  background-color: #ffffff;
  background-size: cover;
  background-position: center;
}
.kehua-my-mhero-banner::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72%;
  background: linear-gradient(to bottom, transparent 0%, rgba(255,255,255,0.75) 55%, #f1f5f9 100%);
  pointer-events: none;
}
.kehua-my-mhero-profile {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -40px 16px 12px;
}
.kehua-my-mhero-avatar {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  background: #fff;
}
.kehua-my-mhero-avatar-hit {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.kehua-my-mhero-avatar-hit:active {
  opacity: 0.92;
}
.kehua-my-mhero-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.kehua-my-mhero-id {
  min-width: 0;
}
.kehua-my-mhero-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.kehua-my-mhero-name-link {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  word-break: break-word;
}
.kehua-my-mhero-name-link:active {
  opacity: 0.88;
}
.kehua-my-mhero-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}

/* 手机「我的」· 会员推广条（头像区下方、四宫格上方 · 黑金横条：左皇冠 / 中文案 / 右箭头） */
.kehua-my-mhero-vip-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 12px 10px;
  padding: 12px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: #faf3e0;
  background: linear-gradient(118deg, #141413 0%, #0a0a0b 45%, #121110 100%);
  border: 1px solid rgba(201, 162, 72, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 8px 22px rgba(0, 0, 0, 0.12);
  -webkit-tap-highlight-color: transparent;
  transition: filter 0.12s ease, background 0.12s ease;
}
.kehua-my-mhero-vip-strip:active {
  filter: brightness(1.06);
}
.kehua-my-mhero-vip-strip-ico {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(201, 162, 72, 0.5);
  background: linear-gradient(145deg, rgba(32, 28, 20, 0.95) 0%, rgba(14, 12, 9, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.1);
  color: #e8c547;
}
.kehua-my-mhero-vip-strip-ico .kehua-my-nav-icon {
  width: 22px;
  height: 22px;
  opacity: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}
.kehua-my-mhero-vip-strip-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kehua-my-mhero-vip-strip-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #faf3e0;
  line-height: 1.25;
}
.kehua-my-mhero-vip-strip-sub {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: rgba(214, 188, 128, 0.88);
}
.kehua-my-mhero-vip-strip--member .kehua-my-mhero-vip-strip-sub {
  color: rgba(200, 175, 95, 0.9);
}
.kehua-my-mhero-vip-strip-chevron {
  flex-shrink: 0;
  display: block;
  opacity: 0.65;
  color: #c9a227;
}

/* 手机「我的」头像下入口（图标与侧栏 .kehua-my-nav 一致） */
.kehua-my-mhero-quick {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 12px 0;
  padding: 14px 10px;
  background: #fff;
  border-radius: 10px;
  box-shadow: none;
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.kehua-my-mhero-quick-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 12px;
  text-decoration: none;
  color: #334155;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.kehua-my-mhero-quick-item:active {
  background: #f1f5f9;
}
.kehua-my-mhero-quick-item .kehua-my-nav-icon {
  width: 22px;
  height: 22px;
  opacity: 0.72;
  color: #475569;
}
.kehua-my-mhero-quick-label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
}
/* 手机「我的」第二栏：账户与服务（与上方四宫格一致：上图标下文字 · 4 列网格） */
.kehua-my-mhero-more {
  margin: 10px 12px 0;
  padding: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: none;
  border: 1px solid rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
.kehua-my-mhero-more-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 6px;
  padding: 14px 10px;
  overflow: visible;
}
.kehua-my-mhero-more-grid .kehua-my-mhero-quick-item {
  flex: initial;
  width: auto;
  min-width: 0;
  min-height: 66px;
  justify-content: flex-start;
  padding-left: 2px;
  padding-right: 2px;
}
/* 手机「我的」宫格下方：退出登录（白底卡片与上方一致；窄屏无侧栏时仍可退出） */
.kehua-my-mhero-logout-wrap {
  margin: 16px 12px 0;
}
.kehua-my-mhero-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  color: #e74c3c;
  text-decoration: none;
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s;
}
.kehua-my-mhero-logout .kehua-my-nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.85;
}
.kehua-my-mhero-logout:active {
  background: #fef2f2;
  color: #dc2626;
}
.kehua-my-form-group {
  margin-bottom: 20px;
}
.kehua-my-form-label {
  display: block;
  font-size: 14px;
  color: var(--color-text-light);
  margin-bottom: 8px;
  font-weight: 500;
}
.kehua-my-input {
  width: 100%;
  max-width: 400px;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  background: #fafbfc;
  color: var(--color-text);
}
.kehua-my-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(56,132,244,0.1);
  background: #fff;
}
.kehua-my-email-code-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  max-width: 400px;
}
.kehua-my-email-code-row .kehua-my-input {
  flex: 1 1 160px;
  width: auto;
  max-width: none;
  min-width: 0;
}
.kehua-my-email-code-row .kehua-auth-send-code {
  height: 40px;
  border-radius: 10px;
}
.kehua-my-email-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--color-text-light);
  line-height: 1.5;
}
.kehua-my-btn {
  display: inline-block;
  padding: 10px 32px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all .2s;
}
.kehua-my-btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.kehua-my-btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56,132,244,0.25);
}
.kehua-my-avatar-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.kehua-my-avatar-preview {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #e8e8e8;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  position: relative;
  cursor: pointer;
}
.kehua-my-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.kehua-my-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .25s;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}
.kehua-my-avatar-preview:hover .kehua-my-avatar-overlay {
  opacity: 1;
}
.kehua-my-avatar-progress {
  width: 200px;
  height: 6px;
  background: #eee;
  border-radius: 3px;
  overflow: hidden;
  display: none;
}
.kehua-my-avatar-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), #60a5fa);
  border-radius: 3px;
  width: 0;
  transition: width .3s;
}
.kehua-my-thread-feed {
  padding: 16px 24px;
}

/* 个人中心/关注页列表：与顶部 tabs 左对齐，优化列表样式 */
.kehua-my-body .kehua-feed,
.kehua-my-body .kehua-my-feed-list {
  padding: 0 0 24px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kehua-my-body .kehua-feed .kehua-post-card,
.kehua-my-body .kehua-my-feed-list .kehua-post-card {
  padding: 14px 16px;
  margin: 0;
  border-radius: 10px;
  background: #fafbfc;
  border: 1px solid #f0f2f5;
  box-shadow: none;
  border-bottom: 1px solid #f0f2f5;
  transition: background .2s, border-color .2s;
}
.kehua-my-body .kehua-feed .kehua-post-card:hover,
.kehua-my-body .kehua-my-feed-list .kehua-post-card:hover {
  background: #fff;
  border-color: #e8eaef;
}
.kehua-my-body .kehua-feed .kehua-post-card:last-child,
.kehua-my-body .kehua-my-feed-list .kehua-post-card:last-child {
  border-bottom: 1px solid #f0f2f5;
}
/* 动态列表：头像+用户名+时间 同一行 */
.kehua-timeline-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
}
.kehua-timeline-header .kehua-post-meta {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.kehua-timeline-header .kehua-post-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}
.kehua-timeline-time {
  font-size: 12px;
  color: var(--color-text-light);
}
/* 动态列表：主题标题突出显示 */
.kehua-timeline-desc {
  margin-left: 56px;
  margin-top: 10px;
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.6;
}
.kehua-timeline-hint {
  color: var(--color-text-light);
  font-size: 13px;
}
.kehua-timeline-title {
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  margin: 0 2px;
}
.kehua-timeline-title:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}
.kehua-timeline-reply {
  color: var(--color-text);
  font-size: 14px;
  margin-left: 2px;
}
.kehua-timeline-reply:hover {
  color: var(--color-primary);
}
.kehua-timeline-emoji {
  vertical-align: middle;
  width: 20px;
  height: 20px;
}
.kehua-my-pagination {
  padding: 16px 0;
  text-align: center;
}

/* 分页：圆角方形蓝色按钮，水平排列 */
.kehua-pagination {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}
.kehua-pagination .page-item {
  margin: 0 !important;
}
.kehua-pagination .page-link {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  margin: 0 !important;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-light);
  background: var(--color-bg) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 8px;
  text-decoration: none !important;
  transition: all .2s;
}
.kehua-pagination .page-link:hover {
  color: var(--color-primary);
  background: rgba(0, 102, 255, .08) !important;
  border-color: var(--color-primary) !important;
}
.kehua-pagination .page-item.active .page-link {
  color: #fff !important;
  background: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}
.kehua-pager-wrap {
  padding: 16px;
  text-align: center;
}
.kehua-follow-card .kehua-post-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.kehua-follow-card .kehua-post-meta {
  flex: 1;
  min-width: 0;
}
.kehua-follow-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .kehua-post-layout { grid-template-columns: 1fr; }
  .kehua-post-right { width: 100%; max-width: 100%; }
  .kehua-forum-cards { grid-template-columns: 1fr; }
  .kehua-my-wrap {
    flex-direction: column;
    gap: 16px;
    padding: calc(var(--header-h) + 16px) 12px 24px;
    margin: 0 auto;
  }
  .kehua-my-wrap--profile-hero:not(:has(.kehua-msg-shell)) {
    padding-left: 0;
    padding-right: 0;
  }
  /* 手机：取消「我的」页内右侧滑出个人中心菜单（改由资料页宫格等入口） */
  .kehua-my-wrap > .kehua-my-drawer:not(.kehua-my-drawer-floating),
  .kehua-my-wrap > .kehua-my-drawer:not(.kehua-my-drawer-floating).kehua-my-drawer-open {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
  }
  /* 消息中心：内容紧贴固定顶栏底边，不留空隙 */
  .kehua-my-wrap:has(.kehua-msg-shell) {
    padding-top: var(--header-h);
  }
  /* 消息中心：去掉侧栏占位与主栏之间的 gap，否则顶部一条缝露 body 背景 */
  .kehua-my-wrap:has(.kehua-msg-shell) {
    gap: 0 !important;
  }

  .kehua-my-info-grid { grid-template-columns: 1fr; }
  .kehua-my-body { padding: 20px 16px; }
  .kehua-my-tabs { padding: 16px; }
}

/* 窄屏：禁用全站浮动个人中心抽屉（与顶栏 avatar 点进「我的」一致，见 main.js min-width 993px） */
@media (max-width: 992px) {
  #kehua-my-drawer.kehua-my-drawer-floating {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* ===== Auth Modal ===== */
.kehua-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}
.kehua-auth-overlay.kehua-auth-open {
  opacity: 1;
  visibility: visible;
}
.kehua-auth-modal {
  width: 420px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.18);
  padding: 36px 32px 32px;
  position: relative;
  transform: translateY(24px) scale(0.96);
  transition: transform .35s cubic-bezier(.16,1,.3,1);
  overflow-y: auto;
}
.kehua-auth-open .kehua-auth-modal {
  transform: translateY(0) scale(1);
}
.kehua-auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: none;
  background: #f0f2f5;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: all .2s;
}
.kehua-auth-close:hover {
  background: #e4e6eb;
  color: #333;
  transform: rotate(90deg);
}
.kehua-auth-header {
  text-align: center;
  margin-bottom: 24px;
}
.kehua-auth-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--color-primary), #60a5fa);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 6px 20px rgba(56,132,244,0.25);
}
.kehua-auth-logo.kehua-auth-logo--img {
  width: auto;
  height: auto;
  background: none;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
}
.kehua-auth-logo.kehua-auth-logo--img img {
  display: block;
  max-width: 180px;
  max-height: 52px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}
.kehua-auth-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-heading);
  margin: 0 0 4px;
}
.kehua-auth-desc {
  font-size: 13px;
  color: var(--color-text-light);
  margin: 0;
}
.kehua-auth-tabs {
  display: flex;
  background: #f0f2f5;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
}
.kehua-auth-tab {
  flex: 1;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  transition: all .25s;
}
.kehua-auth-tab.kehua-active {
  background: #fff;
  color: var(--color-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.kehua-auth-field {
  display: flex;
  align-items: center;
  border: 1.5px solid #e4e6eb;
  border-radius: 12px;
  padding: 0 14px;
  margin-bottom: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.kehua-auth-field:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(56,132,244,0.1);
}
.kehua-auth-field svg {
  width: 20px;
  height: 20px;
  color: #b0b0b0;
  flex-shrink: 0;
}
.kehua-auth-field:focus-within svg {
  color: var(--color-primary);
}
.kehua-auth-field input {
  flex: 1;
  height: 48px;
  border: none;
  background: transparent;
  font-size: 14px;
  padding: 0 12px;
  outline: none;
  color: var(--color-text);
  min-width: 0;
}
.kehua-auth-field input::placeholder {
  color: #aaa;
}
.kehua-auth-field--readonly {
  background: #f8f9fb;
  border-color: #e8eaee;
}
.kehua-auth-field--readonly:focus-within {
  border-color: #d8dbe0;
  box-shadow: none;
}
.kehua-auth-field--readonly input[readonly] {
  color: var(--color-text-light);
  cursor: default;
}
.kehua-auth-field-code {
  flex-wrap: nowrap;
}
.kehua-auth-send-code {
  flex-shrink: 0;
  height: 34px;
  padding: 0 14px;
  border: none;
  background: var(--color-primary);
  color: #fff;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
}
.kehua-auth-send-code:hover:not(:disabled) {
  background: var(--color-primary-dark);
}
.kehua-auth-send-code:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.kehua-auth-error {
  background: #fef2f2;
  color: #dc2626;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
  line-height: 1.5;
}
.kehua-auth-error.kehua-show {
  display: block;
}
.kehua-auth-submit {
  width: 100%;
  height: 48px;
  border: none;
  background: linear-gradient(135deg, var(--color-primary), #60a5fa);
  color: #fff;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
  margin-top: 4px;
  letter-spacing: 0.5px;
}
.kehua-auth-submit:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(56,132,244,0.35);
  transform: translateY(-1px);
}
.kehua-auth-submit:active:not(:disabled) {
  transform: translateY(0);
}
.kehua-auth-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.kehua-auth-submit.kehua-auth-success {
  background: linear-gradient(135deg, #22c55e, #4ade80);
}
.kehua-auth-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
}
.kehua-auth-footer a {
  color: var(--color-primary);
  text-decoration: none;
}
.kehua-auth-footer a:hover {
  text-decoration: underline;
}
@media (max-width: 480px) {
  .kehua-auth-modal {
    padding: 28px 20px 24px;
    border-radius: 20px;
    max-width: calc(100vw - 24px);
  }
  .kehua-auth-logo:not(.kehua-auth-logo--img) {
    width: 48px;
    height: 48px;
    font-size: 18px;
    border-radius: 14px;
  }
  .kehua-auth-logo.kehua-auth-logo--img img {
    max-height: 46px;
  }
  .kehua-auth-title {
    font-size: 18px;
  }
}

/* 独立登录/注册页（非弹窗） */
.kehua-auth-page {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 48px;
  background: linear-gradient(165deg, #eef4ff 0%, #f8fafc 42%, #f0f2f5 100%);
}
.kehua-auth-modal-static {
  transform: none !important;
  margin-top: 0;
}
.kehua-auth-modal-wide {
  width: 440px;
  max-width: calc(100vw - 32px);
}
.kehua-auth-back {
  display: inline-block;
  font-size: 13px;
  color: var(--color-text-light);
  text-decoration: none;
  margin-bottom: 16px;
  transition: color .2s;
}
.kehua-auth-back:hover {
  color: var(--color-primary);
}
.kehua-auth-page .kehua-auth-modal {
  position: relative;
}
.kehua-auth-page-links {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--color-text-light);
}
.kehua-auth-page-links a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}
.kehua-auth-page-links a:hover {
  text-decoration: underline;
}
.kehua-auth-page-dot {
  margin: 0 8px;
  opacity: 0.45;
}
.kehua-auth-page .kehua-auth-field .invalid-feedback {
  display: none;
  width: 100%;
  font-size: 12px;
  color: #dc2626;
  margin-top: 4px;
}
.kehua-auth-page .kehua-auth-field.is-invalid .invalid-feedback {
  display: block;
}

/* ===== 消息中心（私信 + 通知）— 白 / 蓝 / 灰，与主题一致 ===== */
.kehua-my-content--wide {
  max-width: 100%;
}
.kehua-msg-shell {
  display: grid;
  gap: 0;
  background: var(--color-white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}
/* 固定整体高度，三列同高；内部各自 overflow 滚动 */
.kehua-msg-shell--pm {
  grid-template-columns: 168px 280px minmax(0, 1fr);
  grid-template-rows: 1fr;
  height: min(600px, calc(100vh - var(--header-h) - 96px));
  min-height: 420px;
}
.kehua-msg-shell--notice {
  grid-template-columns: 168px minmax(0, 1fr);
  grid-template-rows: 1fr;
  height: min(600px, calc(100vh - var(--header-h) - 96px));
  min-height: 420px;
}
.kehua-msg-mobhead {
  display: none;
}
.kehua-msg-cats {
  background: #fafbfc;
  border-right: 1px solid var(--color-border);
  padding: 12px 0;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.kehua-msg-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--color-text-light);
  transition: background .15s, color .15s;
  text-decoration: none;
}
.kehua-msg-cat-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.kehua-msg-cat-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kehua-msg-cat-label-mob {
  display: none;
}
.kehua-msg-top-mobtitle {
  display: none;
}
.kehua-msg-chat-head-slot {
  display: none;
}
.kehua-msg-cat-badge {
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  line-height: 18px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  background: #e53935;
  border-radius: 9px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.kehua-msg-cat:hover {
  background: rgba(0, 102, 255, 0.06);
  color: var(--color-text);
}
.kehua-msg-cat-active {
  background: rgba(0, 102, 255, 0.1);
  color: var(--color-primary);
  font-weight: 600;
  border-right: 3px solid var(--color-primary);
  padding-right: 11px;
}
.kehua-msg-cat-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 1.25em;
  opacity: 0.72;
  color: currentColor;
}
.kehua-msg-cat-ico svg {
  width: 18px;
  height: 18px;
  vertical-align: 0;
}
.kehua-msg-cat-active .kehua-msg-cat-ico {
  opacity: 1;
}
.kehua-msg-threads {
  background: #f5f6f8;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.kehua-msg-toolbar {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-white);
  flex-shrink: 0;
}
.kehua-msg-toolbar-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.kehua-msg-toolbar > .kehua-msg-toolbar-title {
  margin-bottom: 4px;
}
.kehua-msg-toolbar-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--color-text);
  margin-bottom: 0;
}
.kehua-msg-toolbar-badge {
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  line-height: 18px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  background: #e53935;
  border-radius: 9px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.kehua-msg-toolbar-meta {
  font-size: 12px;
  color: var(--color-text-light);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.kehua-msg-linkbtn {
  border: none;
  background: none;
  color: var(--color-primary);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.kehua-msg-linkbtn:hover {
  color: var(--color-primary-dark);
}
.kehua-msg-threadlist {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: var(--color-white);
  -webkit-overflow-scrolling: touch;
}
.kehua-msg-threadlist li {
  border-bottom: 1px solid var(--color-border);
}
.kehua-msg-thread-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  position: relative;
}
.kehua-msg-thread-avwrap {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
}
.kehua-msg-thread-active .kehua-msg-thread-row {
  background: rgba(0, 102, 255, 0.08);
}
.kehua-msg-thread-row:hover {
  background: rgba(0, 102, 255, 0.04);
}
.kehua-msg-thread-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #e8eaed center/cover no-repeat;
}
.kehua-msg-thread-avwrap .kehua-msg-thread-avatar {
  display: block;
  width: 100%;
  height: 100%;
}

.kehua-msg-thread-avatar.kehua-msg-thread-avatar--img {
  background-image: none !important;
  overflow: hidden;
  padding: 0;
  line-height: 0;
}

.kehua-msg-thread-avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.kehua-msg-thread-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kehua-msg-thread-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.kehua-msg-thread-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
  min-width: 0;
  line-height: 1.25;
}
.kehua-msg-thread-time {
  font-size: 11px;
  color: #999;
  flex-shrink: 0;
  line-height: 1.25;
}
.kehua-msg-thread-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.kehua-msg-thread-preview {
  font-size: 14px;
  color: var(--color-text-light);
  flex: 1;
  min-width: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kehua-msg-thread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  box-sizing: border-box;
  border-radius: 9px;
  background: #e53935;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  box-shadow: none;
}
.kehua-msg-thread-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--color-text-light);
  font-size: 13px;
}
.kehua-msg-chat {
  background: #f8f8f8;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
.kehua-msg-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-white);
  flex-shrink: 0;
}
.kehua-msg-chat-back {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: -6px 0 -6px -8px;
  border-radius: 10px;
  color: #1a1a1a;
  flex-shrink: 0;
}
.kehua-msg-chat-back:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-primary);
}
.kehua-msg-chat-back svg {
  width: 22px;
  height: 22px;
  display: block;
}
.kehua-msg-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e8eaed center/cover no-repeat;
}

.kehua-msg-chat-avatar.kehua-msg-chat-avatar--img {
  background-image: none !important;
  overflow: hidden;
  padding: 0;
  line-height: 0;
  display: inline-block;
}

.kehua-msg-chat-avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.kehua-msg-chat-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--color-text);
  flex: 1;
}
.kehua-msg-chat-profile {
  font-size: 12px;
  color: var(--color-primary);
}
.kehua-msg-chat-profile:hover {
  text-decoration: underline;
  color: var(--color-primary-dark);
}
/* 块级滚动：避免 flex+overflow 子项底部 padding/伪元素在部分浏览器不计入 scrollHeight，导致最后一条贴底 */
.kehua-msg-bubbles {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  background: #f8f8f8;
  -webkit-overflow-scrolling: touch;
  display: block;
  overflow-anchor: none;
}
.kehua-msg-pm-topkit {
  display: block;
}
.kehua-msg-pm-rows {
  display: block;
}
/* 底部占位（真实 DOM），保证滚到底时与输入区有可视间距 */
.kehua-msg-pm-endpad {
  display: block;
  height: 20px;
  min-height: 20px;
  width: 100%;
  pointer-events: none;
}
.kehua-msg-pm-sentinel {
  height: 1px;
  width: 100%;
  pointer-events: none;
  visibility: hidden;
}
.kehua-msg-pm-loadbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 0 12px;
  font-size: 13px;
  color: var(--color-text-light);
}
.kehua-msg-pm-loadbar[hidden] {
  display: none !important;
}
.kehua-msg-conv-sentinel-li {
  list-style: none;
  height: 1px;
  margin: 0;
  padding: 0;
  border: none;
  overflow: hidden;
}
.kehua-msg-conv-sentinel {
  height: 1px;
  width: 100%;
  pointer-events: none;
  visibility: hidden;
}
.kehua-msg-conv-loadbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--color-text-light);
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
}
.kehua-msg-conv-loadbar[hidden] {
  display: none !important;
}
.kehua-msg-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  align-items: flex-start;
}
.kehua-msg-row-mine {
  flex-direction: row-reverse;
}
.kehua-msg-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #e8eaed center/cover no-repeat;
}

.kehua-msg-av.kehua-msg-av--img {
  background-image: none !important;
  overflow: hidden;
  padding: 0;
  line-height: 0;
}

.kehua-msg-av-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.kehua-msg-col {
  max-width: 78%;
}
.kehua-msg-row-mine .kehua-msg-col {
  text-align: right;
}
.kehua-msg-time {
  font-size: 11px;
  color: #999;
  margin-bottom: 4px;
}
/* 对方：浅灰 + 左上小圆角（朝头像一侧），其余大圆角 */
.kehua-msg-bubble {
  display: inline-block;
  text-align: left;
  padding: 12px 16px;
  border-radius: 5px 16px 16px 16px;
  font-size: 14px;
  line-height: 1.5;
  font-family: inherit, "Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  color: #1a1a1a;
  background: #ebebeb;
  word-break: break-word;
  border: none;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  max-width: 100%;
}
/* 自己：主题色 + 右上小圆角（朝右侧头像） */
.kehua-msg-row-mine .kehua-msg-bubble {
  border-radius: 16px 5px 16px 16px;
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.kehua-msg-compose {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--color-border);
  background: var(--color-white);
  flex-shrink: 0;
  position: relative;
}
.kehua-msg-textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 72px;
  background: var(--color-white);
  color: var(--color-text);
}
.kehua-msg-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12);
}
.kehua-msg-compose-bar {
  display: flex;
  align-items: center;
  margin-top: 10px;
  gap: 10px;
}
.kehua-msg-compose-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.kehua-msg-toolbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.kehua-msg-toolbtn:hover:not(:disabled) {
  background: #f0f2f5;
  color: var(--color-primary);
}
.kehua-msg-toolbtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.kehua-msg-toolsvg {
  width: 22px;
  height: 22px;
  display: block;
}
.kehua-msg-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.kehua-msg-emoji-pop {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  bottom: 100%;
  margin-bottom: 6px;
  z-index: 40;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}
.kehua-msg-emoji-pop[hidden] {
  display: none !important;
}
.kehua-msg-emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 4px;
  padding: 10px;
  max-height: min(40vh, 240px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  box-sizing: border-box;
}
.kehua-msg-emoji-cell {
  border: none;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  min-width: 0;
  padding: 4px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
}
.kehua-msg-emoji-cell:hover {
  background: #f0f2f5;
}
.kehua-msg-compose-hint {
  font-size: 12px;
  color: var(--color-text-light);
  margin-top: 6px;
  line-height: 1.4;
}
.kehua-msg-send {
  flex-shrink: 0;
  margin-left: auto;
}
.kehua-msg-embed {
  margin: 6px 0 0;
  max-width: 100%;
}
.kehua-msg-embed img {
  display: block;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
#kehua-msg-bubbles .kehua-msg-embed img {
  cursor: zoom-in;
}
.kehua-msg-pm-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100050;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
  background: rgba(0, 0, 0, 0.92);
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
.kehua-msg-pm-lightbox[hidden] {
  display: none !important;
}
.kehua-msg-pm-lightbox-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top, 12px));
  right: max(12px, env(safe-area-inset-right, 12px));
  z-index: 2;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.kehua-msg-pm-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
}
.kehua-msg-pm-lightbox-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px 12px 20px;
  box-sizing: border-box;
}
.kehua-msg-pm-lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
  user-select: none;
  -webkit-user-drag: none;
}
.kehua-msg-chat-empty {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  font-size: 14px;
  padding: 48px 24px;
  text-align: center;
  background: #f5f6f8;
}
.kehua-msg-notice-panel {
  background: #f5f6f8;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.kehua-msg-notice-scrollwrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  position: relative;
}
.kehua-msg-noticelist {
  flex: 0 0 auto;
  list-style: none;
  margin: 0;
  padding: 0;
}
.kehua-msg-notice-loadbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--color-text-light);
  background: linear-gradient(180deg, rgba(245,246,248,0) 0%, #f0f2f5 40%);
  border-top: 1px solid var(--color-border);
}
/* author 的 display:flex 会盖掉 [hidden] 的默认隐藏，导致加载条一直可见 */
.kehua-msg-notice-loadbar[hidden] {
  display: none !important;
}
.kehua-msg-notice-loadbar[hidden] .kehua-msg-notice-spinner {
  animation: none;
}
.kehua-msg-notice-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 102, 255, 0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: kehua-msg-spin 0.65s linear infinite;
}
@keyframes kehua-msg-spin {
  to { transform: rotate(360deg); }
}
.kehua-msg-notice-nomore {
  flex-shrink: 0;
  margin: 0;
  padding: 12px 16px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-light);
}
.kehua-msg-notice-sentinel {
  flex-shrink: 0;
  height: 1px;
  width: 100%;
  pointer-events: none;
  visibility: hidden;
}

/* 个人中心收藏/点赞/帖子：触底 sentinel 需参与视口检测（避免部分桌面端 IO 不触发） */
.kehua-my-wrap .kehua-fav-infinite-footer .kehua-msg-notice-sentinel {
  visibility: visible;
  opacity: 0;
  height: 8px;
}

/* 个人中心瀑布流：与首页 #kehua-index-feed.kehua-up-masonry-wrap--index-3 一致（窄屏由 kehuaMasonryMergeTwoColsIfNeeded 合并为三桶→真实两列） */
.kehua-my-wrap .kehua-feed.kehua-up-masonry-wrap--index-3 {
  gap: 12px;
}
.kehua-my-wrap .kehua-feed.kehua-up-masonry-wrap--index-3 .kehua-up-masonry-col {
  gap: 12px;
}
@media (max-width: 900px) {
  .kehua-my-wrap .kehua-feed.kehua-up-masonry-wrap--index-3 {
    flex-wrap: wrap;
    align-content: flex-start;
  }
  .kehua-my-wrap .kehua-feed.kehua-up-masonry-wrap--index-3 .kehua-up-masonry-col {
    flex: 0 1 calc((100% - 12px) / 2);
    max-width: calc((100% - 12px) / 2);
    min-width: 0;
  }
}

/* 「我的」基本资料：手机仅保留顶部头图+头像昵称；下方 Tab/资料在桌面显示 */
@media (max-width: 768px) {
  html:has(.kehua-my-wrap--profile-hero) {
    --header-h: 0px;
  }
  body:has(.kehua-my-wrap--profile-hero) .kehua-header,
  body:has(.kehua-my-wrap--profile-hero) #header.navbar {
    display: none !important;
  }
  body:has(.kehua-my-wrap--profile-hero):not(:has(.kehua-msg-shell)) {
    background: #f1f5f9;
  }
  .kehua-my-wrap--profile-hero:not(:has(.kehua-msg-shell)) {
    padding-top: 0 !important;
    gap: 0;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .kehua-my-wrap--profile-hero .kehua-my-content {
    padding-left: 12px;
    padding-right: 12px;
    padding-top: 0;
  }
  .kehua-my-wrap--profile-hero .kehua-my-mhero {
    display: block;
    margin-left: -12px;
    margin-right: -12px;
    width: calc(100% + 24px);
    margin-bottom: 0;
    padding-bottom: 16px;
  }
  .kehua-my-wrap--profile-hero .kehua-my-panel {
    display: none !important;
  }
}

/* 消息中心 · 手机端：顶部分类圆标 + 列表；全站底栏保留，仅聊天内隐藏 */
@media (max-width: 768px) {
  /* 消息页（列表/通知/全屏聊天）：隐藏全站顶栏；--header-h 归零，避免顶部留白或 fixed 壳错位 */
  /* 与 .kehua-msg-mobhead 渐变顶部同色，铺满到系统状态栏区域（需 viewport-fit=cover） */
  html:has(.kehua-msg-shell) {
    --header-h: 0px;
    background-color: #eff6ff;
  }
  body:has(.kehua-msg-shell) {
    background-color: #eff6ff;
  }
  html:has(.kehua-msg-shell--pm.kehua-msg-shell--chat-open),
  body:has(.kehua-msg-shell--pm.kehua-msg-shell--chat-open) {
    background-color: #fff;
  }
  body:has(.kehua-msg-shell) .kehua-header {
    display: none !important;
  }
  body:has(.kehua-msg-shell) #header.navbar {
    display: none !important;
  }
  html:has(.kehua-msg-shell--pm.kehua-msg-shell--chat-open),
  body:has(.kehua-msg-shell--pm.kehua-msg-shell--chat-open) {
    overflow: hidden;
    overscroll-behavior: none;
  }
  /* fixed 聊天壳脱离文档流后，若保留 min-height:100dvh 会在键盘时撑起整页可滚空白（中间一大块白 + 返回顶按钮） */
  .kehua-my-wrap:has(.kehua-msg-shell--pm.kehua-msg-shell--chat-open) {
    min-height: 0 !important;
    padding-top: 0 !important;
    gap: 0 !important;
  }
  body:has(.kehua-msg-shell--pm.kehua-msg-shell--chat-open) .kehua-fab {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  .kehua-my-wrap:has(.kehua-msg-shell) {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding-top: var(--header-h);
    padding-left: 0;
    padding-right: 0;
    gap: 0;
    background: transparent;
  }

  body:has(.kehua-my-wrap .kehua-msg-shell):not(:has(.kehua-msg-shell--chat-open)) {
    background-color: #eff6ff;
  }
  .kehua-my-wrap:has(.kehua-msg-shell--chat-open) {
    padding-bottom: 0 !important;
  }
  /* 仅全屏聊天时隐藏全站底栏，消息列表可切首页/发现等 */
  body:has(.kehua-msg-shell--chat-open) .kehua-mobile-tabbar {
    display: none !important;
  }
  .kehua-my-wrap:has(.kehua-msg-shell) .kehua-my-content {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: transparent;
  }
  .kehua-my-content--wide:has(.kehua-msg-shell) {
    padding-left: 0;
    padding-right: 0;
  }
  .kehua-msg-shell {
    border-radius: 0;
    border: none;
    box-shadow: none;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    background: transparent;
  }
  .kehua-msg-shell--pm {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .kehua-msg-shell--notice {
    display: flex;
    flex-direction: column;
    grid-template-columns: unset;
    grid-template-rows: unset;
    min-height: 0;
  }
  .kehua-msg-shell--notice .kehua-msg-notice-panel {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    background: #fff;
  }
  .kehua-msg-mobhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 12px;
    margin: 0;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.92) 0%, rgba(250, 245, 255, 0.55) 45%, #fff 100%);
    border-bottom: none;
    -webkit-tap-highlight-color: transparent;
  }
  .kehua-msg-shell--chat-open .kehua-msg-mobhead {
    display: none !important;
  }
  .kehua-msg-mobhead-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #0f172a;
  }
  .kehua-msg-mobhead-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0 -8px 0 0;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.65);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .kehua-msg-mobhead-clear:active {
    opacity: 0.85;
    transform: scale(0.96);
  }
  .kehua-msg-mobhead-clear-ico {
    display: block;
    width: 24px;
    height: 24px;
    object-fit: contain;
    pointer-events: none;
  }
  .kehua-msg-cats {
    position: relative;
    z-index: 6;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-around;
    gap: 4px;
    height: auto;
    min-height: 0;
    /* 顶栏由 .kehua-msg-mobhead 承接安全区，此处仅留常规间距 */
    padding: 12px 8px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-right: none;
    border-bottom: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .kehua-msg-shell--chat-open .kehua-msg-cats {
    display: none;
  }
  .kehua-msg-cat {
    position: relative;
    flex: 1;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
    padding: 2px 4px 0;
    font-size: 11px;
    line-height: 1.2;
    color: #bfbfbf;
    border-radius: 0;
    max-width: 25%;
    min-width: 0;
    -webkit-tap-highlight-color: transparent;
  }
  .kehua-msg-cat-main {
    flex-direction: column;
    gap: 6px;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 auto;
  }
  .kehua-msg-cat-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f8f8f8;
    color: #2c2c2c;
    opacity: 1;
  }
  .kehua-msg-cat-ico svg {
    width: 22px;
    height: 22px;
  }
  .kehua-msg-cat-text {
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
  }
  .kehua-msg-cat-label-full {
    display: none;
  }
  .kehua-msg-cat-label-mob {
    display: inline;
  }
  .kehua-msg-cat:hover {
    background: transparent;
    color: #bfbfbf;
  }
  .kehua-msg-cat-active {
    background: transparent;
    color: #2c2c2c;
    font-weight: 600;
    border-right: none;
    border-bottom: none;
    padding-right: 4px;
    padding-left: 4px;
  }
  .kehua-msg-cat-active .kehua-msg-cat-ico {
    background: #f8f8f8;
    color: #2c2c2c;
    opacity: 1;
  }
  .kehua-msg-cat > .kehua-msg-cat-badge {
    position: absolute;
    top: 4px;
    left: 50%;
    margin-left: 12px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    line-height: 16px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    transform: none;
    transform-origin: center;
    box-shadow: 0 0 0 2px #fff;
  }
  .kehua-msg-threads {
    border-right: none;
    background: #fff;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
  }
  .kehua-msg-top-mobtitle {
    display: none;
  }
  .kehua-msg-toolbar {
    display: none;
  }
  .kehua-msg-threadlist {
    background: #fff;
  }
  .kehua-msg-threadlist li {
    border-bottom: none;
  }
  .kehua-msg-thread-row {
    padding: 12px 14px;
    gap: 12px;
    align-items: center;
    border: none;
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
  }
  .kehua-msg-thread-active .kehua-msg-thread-row {
    background: #ebebeb;
  }
  .kehua-msg-thread-name {
    font-size: 16px;
    font-weight: 500;
  }
  .kehua-msg-thread-time {
    font-size: 12px;
    color: #b2b2b2;
  }
  .kehua-msg-thread-preview {
    font-size: 14px;
    color: #888;
  }
  .kehua-msg-conv-loadbar {
    background: #fff;
    border-top: none;
  }
  .kehua-msg-shell--pm.kehua-msg-shell--chat-open .kehua-msg-threads {
    display: none !important;
  }
  .kehua-msg-chat {
    background: #f8f8f8;
  }
  .kehua-msg-shell--pm:not(.kehua-msg-shell--chat-open) .kehua-msg-chat {
    display: none;
  }
  /* 全屏私信：fixed；top/height 由 JS 写入。键盘时须含 offsetTop，无键盘时勿加，否则顶栏下留白或中间留白会交替出现。 */
  .kehua-msg-shell--pm.kehua-msg-shell--chat-open {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 90;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex: none !important;
    height: auto;
    max-height: none;
  }
  .kehua-msg-shell--pm.kehua-msg-shell--chat-open .kehua-msg-chat {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
  }
  .kehua-msg-chat-back {
    display: inline-flex;
  }
  .kehua-msg-chat-head {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 40px 36px 1fr 40px;
    align-items: center;
    gap: 0 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #e5e5e5;
  }
  .kehua-msg-shell--pm.kehua-msg-shell--chat-open .kehua-msg-chat-head {
    padding-top: max(8px, env(safe-area-inset-top, 0px));
  }
  .kehua-msg-chat-back {
    grid-column: 1;
  }
  .kehua-msg-chat-avatar {
    grid-column: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }
  .kehua-msg-chat-name {
    grid-column: 3;
    flex: none;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    line-height: 1.25;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    color: #000;
  }
  .kehua-msg-chat-profile {
    display: none;
  }
  .kehua-msg-chat-head-slot {
    display: block;
    grid-column: 4;
    width: 40px;
    height: 1px;
  }
  .kehua-msg-bubbles {
    background: #f8f8f8;
    padding: 12px;
  }
  .kehua-msg-row {
    margin-bottom: 16px;
  }
  .kehua-msg-av {
    width: 40px;
    height: 40px;
  }
  .kehua-msg-col {
    max-width: 72%;
  }
  .kehua-msg-bubble {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px 12px 12px 12px;
    box-shadow: none;
    padding: 10px 12px;
    font-size: 16px;
  }
  .kehua-msg-row-mine .kehua-msg-bubble {
    background: var(--color-primary);
    color: #fff;
    border-color: transparent;
    border-radius: 12px 4px 12px 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  }
  .kehua-msg-row-mine .kehua-msg-bubble a {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: underline;
  }
  .kehua-msg-compose {
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #dcdcdc;
    background: #f7f7f7;
  }
  .kehua-msg-textarea {
    min-height: 40px;
    border-radius: 8px;
    border-color: #e0e0e0;
    font-size: 16px;
  }
  .kehua-msg-compose-bar {
    margin-top: 8px;
    align-items: center;
  }
  .kehua-msg-send {
    margin-left: auto;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    background: var(--color-primary) !important;
    border: none;
    color: #fff !important;
    box-shadow: none;
  }
  .kehua-msg-send:hover {
    background: var(--color-primary-dark) !important;
    color: #fff !important;
  }
  .kehua-msg-compose-hint {
    display: none;
  }
  /* 与私信一致：灰底居中标题；副栏（条数、全部已读）手机端隐藏 */
  .kehua-msg-notice-panel:not(.kehua-msg-notice-panel--off) .kehua-msg-toolbar {
    display: none;
  }
  .kehua-msg-notice-panel--off .kehua-msg-toolbar {
    display: block !important;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
  }
  .kehua-msg-notice-scrollwrap {
    background: #fff;
  }
  .kehua-msg-notice-item {
    border-bottom: none;
  }
}

/* 我的收藏：触底加载底部区域 */
.kehua-fav-infinite-footer {
  margin-top: 0;
}
.kehua-fav-loadbar {
  border-top: none;
  background: transparent;
}
@keyframes kehua-fav-card-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.kehua-fav-feed .kehua-post-card.kehua-fav-card-enter,
.kehua-like-feed .kehua-post-card.kehua-fav-card-enter,
.kehua-inf-feed .kehua-post-card.kehua-fav-card-enter,
.kehua-up-masonry-feed .kehua-post-card.kehua-fav-card-enter {
  animation: kehua-fav-card-in 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.kehua-msg-notice-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 16px 16px 13px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-white);
  border-left: 3px solid transparent;
  transition: background 0.15s ease;
}
.kehua-msg-notice-item:hover {
  background: #fafbfc;
}
.kehua-msg-notice-unread {
  background: rgba(0, 102, 255, 0.06);
  border-left-color: var(--color-primary);
}
.kehua-msg-notice-unread:hover {
  background: rgba(0, 102, 255, 0.09);
}
.kehua-msg-notice-item--jump {
  cursor: pointer;
}
.kehua-msg-notice-av {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #e8eaed center/cover no-repeat;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.kehua-msg-notice-body {
  flex: 1;
  min-width: 0;
}
.kehua-msg-notice-meta {
  font-size: 12px;
  color: var(--color-text-light);
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.kehua-msg-notice-meta strong {
  color: var(--color-text);
  font-weight: 600;
  font-size: 14px;
}
.kehua-msg-notice-meta > span:last-of-type {
  font-size: 12px;
  color: #999;
}
.kehua-msg-notice-msg {
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.55;
  word-break: break-word;
}
.kehua-msg-notice-msg a {
  color: var(--color-primary);
  text-decoration: none;
}
.kehua-msg-notice-msg a:hover {
  text-decoration: underline;
}
.kehua-msg-notice-msg .comment-info {
  font-size: 13px;
  color: #888;
  margin-bottom: 8px;
  line-height: 1.45;
}
.kehua-msg-notice-msg .comment-info a {
  color: #888;
}
.kehua-msg-notice-msg .comment-info a:hover {
  color: var(--color-primary);
}
.kehua-msg-notice-msg .single-comment,
.kehua-msg-notice-msg .reply-comment {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
}
.kehua-msg-notice-msg .single-comment a,
.kehua-msg-notice-msg .reply-comment a {
  color: inherit;
  font-weight: 600;
}
.kehua-msg-notice-msg .quote-comment {
  font-size: 13px;
  color: var(--color-text-light);
  padding: 8px 12px;
  margin: 0 0 8px;
  background: #f0f2f5;
  border-radius: 8px;
  border-left: 3px solid #d0d4dc;
  line-height: 1.45;
}
.kehua-msg-notice-em {
  width: 22px;
  height: 22px;
  vertical-align: text-bottom;
  display: inline-block;
  margin: 0 2px;
  object-fit: contain;
}
.kehua-msg-pagination {
  padding: 12px 16px;
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
}
.kehua-msg-pagination .pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.kehua-msg-pagination .pagination li {
  display: inline-block;
}
.kehua-msg-pagination .pagination a,
.kehua-msg-pagination .pagination span {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--color-text);
  background: #f5f6f8;
  border: 1px solid var(--color-border);
}
/* 仅平板宽度：勿与 max-width:768 手机微信风叠加以致覆盖 shell 高度与 threads max-height:220px */
@media (max-width: 1024px) and (min-width: 769px) {
  .kehua-msg-shell--pm,
  .kehua-msg-shell--notice {
    grid-template-rows: auto;
    height: auto;
    min-height: 0;
    max-height: none;
  }
  .kehua-msg-shell--pm {
    grid-template-columns: 1fr;
  }
  .kehua-msg-cats {
    display: flex;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    height: auto;
    max-height: none;
    overflow-y: visible;
  }
  .kehua-msg-cat-active {
    border-right: none;
    border-bottom: none;
    padding-right: 14px;
  }
  .kehua-msg-cat {
    flex: 1 1 42%;
    justify-content: space-between;
  }
  .kehua-msg-threads {
    border-right: none;
    height: auto;
    max-height: 220px;
    min-height: 0;
  }
  .kehua-msg-threadlist {
    flex: 1;
    min-height: 0;
  }
  .kehua-msg-chat {
    height: min(420px, calc(100vh - var(--header-h) - 280px));
    min-height: 280px;
    max-height: 55vh;
  }
  .kehua-msg-bubbles {
    flex: 1;
    min-height: 0;
  }
  .kehua-msg-notice-panel {
    height: auto;
    min-height: min(360px, 50vh);
    max-height: min(480px, 60vh);
  }
  .kehua-msg-notice-scrollwrap {
    flex: 1;
    min-height: 0;
  }
}

/* 个人中心 · 积分（主题 my-points） */
.kehua-my-points {
  padding-top: 8px;
}
.kehua-points-hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 640px) {
  .kehua-points-hero {
    grid-template-columns: 1fr;
  }
}
.kehua-points-card {
  border-radius: 14px;
  padding: 18px 16px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 88px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.kehua-points-card--a {
  background: linear-gradient(135deg, #5a9f7a 0%, #3d7a5c 100%);
}
.kehua-points-card--b {
  background: linear-gradient(135deg, #4a7abf 0%, #355a9e 100%);
}
.kehua-points-card--c {
  background: linear-gradient(135deg, #e88a2a 0%, #c96a12 100%);
}
.kehua-points-card__label {
  font-size: 13px;
  opacity: 0.92;
  font-weight: 500;
}
.kehua-points-card__val {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.kehua-points-tier {
  background: #f8fafc;
  border: 1px solid #e8ecf1;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.kehua-points-tier__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #555;
  margin-bottom: 8px;
}
.kehua-points-tier__pct {
  font-weight: 700;
  color: var(--color-primary);
}
.kehua-points-tier__bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.kehua-points-tier__bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary), #38bdf8);
  transition: width 0.25s ease;
}
.kehua-points-tier__hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #94a3b8;
}
.kehua-points-intro {
  font-size: 14px;
  color: #475569;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  margin-bottom: 18px;
  line-height: 1.55;
}
.kehua-points-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: 12px;
}
.kehua-points-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 480px;
}
.kehua-points-table th,
.kehua-points-table td {
  padding: 12px 14px;
  text-align: center;
  border-bottom: 1px solid #f1f5f9;
}
.kehua-points-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #334155;
}
.kehua-points-table td:first-child,
.kehua-points-table th:first-child {
  text-align: left;
}
.kehua-points-table tbody tr:last-child td {
  border-bottom: none;
}
.kehua-points-extra {
  margin: 20px 0 0;
  text-align: center;
}
.kehua-points-extra__link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.kehua-points-extra__link:hover {
  color: var(--color-primary-dark);
}

/* 付费下载链接 [ttDown] — 帖内与发帖页 */
.kehua-ttdown {
  margin: 1.1rem 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #f8fafc 0%, #fff 50%, #f1f5f9 100%);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.kehua-ttdown__inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
}
.kehua-ttdown__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(145deg, #3b82f6, #60a5fa);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kehua-ttdown__body {
  flex: 1;
  min-width: 0;
}
.kehua-ttdown__title {
  font-weight: 700;
  font-size: 15px;
  color: #0f172a;
  letter-spacing: 0.02em;
}
.kehua-ttdown__meta {
  margin: 6px 0 0;
  font-size: 13px;
  color: #64748b;
}
.kehua-ttdown__meta strong {
  color: #ef4444;
  font-weight: 700;
}
.kehua-ttdown--locked .kehua-ttdown-paybtn {
  flex-shrink: 0;
  margin-left: auto;
}
.kehua-ttdown--ok .kehua-ttdown__inner,
.kehua-ttdown--unlocked .kehua-ttdown__inner {
  background: linear-gradient(120deg, #ecfdf5, #fff);
  border-color: #a7f3d0;
}
.kehua-ttdown__badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #047857;
  background: #d1fae5;
  margin-right: 8px;
}
.kehua-ttdown__icon--ok {
  color: #059669;
  background: #d1fae5;
  flex-shrink: 0;
}
.kehua-ttdown--unlocked .kehua-ttdown__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.kehua-ttdown__link-url {
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
  word-break: break-all;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.15s;
}
.kehua-ttdown__link-url:hover {
  color: #059669;
  text-decoration: underline;
}
.kehua-ttdown__hint {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 400;
}
.kehua-ttdown--unlocked .kehua-ttdown-open {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(5,150,105,0.25);
  flex-shrink: 0;
  padding: 8px 20px;
}
.kehua-ttdown--unlocked .kehua-ttdown-open:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  box-shadow: 0 4px 12px rgba(5,150,105,0.35);
}
.kehua-ttdown-open {
  text-decoration: none !important;
}
@media (max-width: 640px) {
  .kehua-ttdown__inner {
    display: grid !important;
    grid-template-columns: auto 1fr !important;
    grid-template-rows: auto auto !important;
    gap: 10px !important;
    align-items: center !important;
  }
  .kehua-ttdown__icon {
    width: 40px !important;
    height: 40px !important;
    grid-row: 1 !important;
    grid-column: 1 !important;
  }
  .kehua-ttdown__body {
    grid-row: 1 !important;
    grid-column: 2 !important;
    min-width: 0 !important;
  }
  .kehua-ttdown__title {
    font-size: 15px !important;
  }
  .kehua-ttdown__meta {
    font-size: 13px !important;
  }
  .kehua-ttdown-paybtn,
  .kehua-btn.kehua-ttdown-paybtn {
    grid-row: 2 !important;
    grid-column: 1 / -1 !important;
    width: 100% !important;
    margin: 0 !important;
  }
}
.kehua-ttdown-mip {
  margin: 1rem 0;
  padding: 12px 14px;
  background: #fffbeb;
  border-radius: 10px;
  color: #92400e;
  border: 1px solid #fde68a;
}
.kehua-post-paylink {
  margin: 18px 0 8px;
  padding: 12px 18px 16px;
  border-radius: 14px;
  border: 1px dashed #c7d2fe;
  background: linear-gradient(145deg, #eef2ff 0%, #fff 55%, #f5f3ff 100%);
}
.kehua-post-paylink__summary {
  padding: 6px 0 4px;
}
.kehua-post-paylink__title {
  display: block;
  font-weight: 700;
  font-size: 15px;
  color: #3730a3;
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
  text-align: left;
}
.kehua-post-paylink__body {
  padding-top: 8px;
}
.kehua-post-paylink__hint {
  display: block;
  font-size: 12px;
  line-height: 1.55;
  color: #64748b;
  margin: 0 0 12px;
}
.kehua-post-paylink__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.kehua-post-paylink__input {
  flex: 1;
  min-width: 200px;
}
.kehua-post-paylink__row--price {
  margin-bottom: 10px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(99, 102, 241, 0.25);
}
.kehua-post-paylink__priceinput {
  width: 110px;
  max-width: 100%;
  flex: 0 0 auto;
}
.kehua-post-paylink__typeselect {
  flex: 0 1 140px;
  min-width: 0;
}
/* tt_credits「付费内容」弹窗内重复的售价行改在主题块填写，避免双份 content_num / content_type 冲突 */
#text_f_modal .modal-body + .modal-body {
  display: none !important;
}
@media (max-width: 576px) {
  .kehua-ttdown__inner {
    flex-direction: column;
    align-items: stretch;
  }
  .kehua-ttdown--locked .kehua-ttdown-paybtn {
    margin-left: 0;
    width: 100%;
  }
  .kehua-post-paylink__row {
    flex-direction: column;
    align-items: stretch;
  }
  .kehua-post-paylink__input {
    min-width: 0;
    width: 100%;
  }
  .kehua-post-paylink__typeselect {
    flex: none;
    width: 100%;
    height: 42px;
  }
  .kehua-post-paylink__typeselect select {
    height: 42px !important;
    min-height: 42px;
    max-height: 42px;
  }
  .kehua-post-paylink__priceinput {
    width: 100%;
  }
}

/* 自定义支付弹窗 */
.kehua-pay-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kehua-pay-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}
.kehua-pay-modal__container {
  position: relative;
  width: 90%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: kehua-modal-in 0.25s ease-out;
  overflow: hidden;
}
@keyframes kehua-modal-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.kehua-pay-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #f1f5f9;
}
.kehua-pay-modal__title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: #1e293b;
}
.kehua-pay-modal__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  font-size: 20px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}
.kehua-pay-modal__close:hover {
  background: #e2e8f0;
  color: #334155;
}
.kehua-pay-modal__body {
  padding: 20px 22px;
}
.kehua-pay-modal__subject {
  padding: 14px 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #dbeafe;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #1e40af;
  margin-bottom: 18px;
  line-height: 1.5;
}
.kehua-pay-modal__info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px dashed #e2e8f0;
  border-bottom: 1px dashed #e2e8f0;
}
.kehua-pay-modal__price-box {
  display: flex;
  flex-direction: column;
}
.kehua-pay-modal__label {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 4px;
}
.kehua-pay-modal__price {
  display: flex;
  align-items: baseline;
}
.kehua-pay-modal__price-num {
  font-size: 36px;
  font-weight: 700;
  color: #6366f1;
  line-height: 1;
}
.kehua-pay-modal__price-unit {
  font-size: 14px;
  color: #6366f1;
  margin-left: 6px;
  font-weight: 500;
}
.kehua-pay-modal__balance-box {
  text-align: right;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
}
.kehua-pay-modal__balance-label {
  font-size: 12px;
  color: #94a3b8;
}
.kehua-pay-modal__balance-num {
  font-size: 16px;
  font-weight: 600;
  color: #10b981;
}
.kehua-pay-modal__balance-num--low {
  color: #ef4444;
}
.kehua-pay-modal__warning {
  margin-top: 14px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 13px;
  color: #dc2626;
  text-align: center;
}
.kehua-pay-modal__footer {
  display: flex;
  gap: 12px;
  padding: 16px 22px 20px;
  justify-content: flex-end;
}
.kehua-pay-modal__btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.kehua-pay-modal__btn--cancel {
  background: #f1f5f9;
  color: #64748b;
}
.kehua-pay-modal__btn--cancel:hover {
  background: #e2e8f0;
  color: #475569;
}
.kehua-pay-modal__btn--primary,
.kehua-pay-modal__btn--recharge,
.kehua-pay-modal__btn--login {
  background: #0066ff;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 102, 255, 0.35);
}
.kehua-pay-modal__btn--primary:hover,
.kehua-pay-modal__btn--recharge:hover,
.kehua-pay-modal__btn--login:hover {
  background: #0052cc;
  box-shadow: 0 6px 20px rgba(0, 102, 255, 0.45);
  color: #fff;
  text-decoration: none;
}
.kehua-pay-modal__btn--primary:disabled {
  background: #66a3ff;
  box-shadow: none;
  cursor: not-allowed;
}
@media (max-width: 480px) {
  .kehua-pay-modal__container {
    width: 95%;
    border-radius: 12px;
  }
  .kehua-pay-modal__info {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .kehua-pay-modal__balance-box {
    text-align: center;
  }
  .kehua-pay-modal__footer {
    flex-direction: column;
  }
  .kehua-pay-modal__btn {
    width: 100%;
  }
}

/* 发帖页面附件列表样式 */
.kehua-attach-fieldset .attachlist {
  list-style: none;
  padding: 0;
  margin: 0;
}
.kehua-attach-fieldset .attachlist li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.kehua-attach-fieldset .attachlist li:last-child {
  margin-bottom: 0;
}
.kehua-attach-fieldset .attachlist li > a:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1e293b;
  text-decoration: none;
  font-size: 14px;
}
.kehua-attach-fieldset .attachlist li > a:first-child:hover {
  color: #3b82f6;
}
.kehua-attach-fieldset .attachlist li .kehua-attach-meta {
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
}
.kehua-attach-fieldset .attachlist li a.delete {
  flex-shrink: 0;
  padding: 4px 10px;
  background: #fef2f2;
  color: #ef4444;
  border-radius: 4px;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}
.kehua-attach-fieldset .attachlist li a.delete:hover {
  background: #fee2e2;
}

/* 发帖页面附件价格输入框 */
.kehua-attach-price-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  flex-shrink: 0;
}
.kehua-attach-price-label {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
}
.kehua-attach-price-input {
  width: 50px;
  padding: 4px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
}
.kehua-attach-price-input:focus {
  outline: none;
  border-color: #3b82f6;
}
.kehua-attach-price-type {
  padding: 4px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 12px;
  background: #fff;
  cursor: pointer;
}
.kehua-attach-price-type:focus {
  outline: none;
  border-color: #3b82f6;
}

/* 帖子阅读页面收费附件列表 */
/* 收费附件列表 - 帖子查看页 */
ul.kehua-attachlist-paid {
  padding: 0 !important;
  margin: 0 !important;
  list-style: none !important;
}
ul.kehua-attachlist-paid > li.kehua-attach-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  flex-direction: row !important;
  gap: 12px !important;
  padding: 14px 16px !important;
  margin-bottom: 10px !important;
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 10px !important;
  transition: all 0.2s !important;
}
ul.kehua-attachlist-paid > li.kehua-attach-item:last-child {
  margin-bottom: 0 !important;
}
ul.kehua-attachlist-paid > li.kehua-attach-item:hover {
  border-color: #d1d5db !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
}
ul.kehua-attachlist-paid > li.kehua-attach-item--locked {
  background: #fffbfb !important;
  border-color: #fecdd3 !important;
}
ul.kehua-attachlist-paid > li.kehua-attach-item--locked:hover {
  border-color: #fda4af !important;
  box-shadow: 0 2px 8px rgba(244,63,94,0.08) !important;
}
.kehua-attach-item__left {
  display: flex !important;
  align-items: center !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
}
.kehua-attach-item__right {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex: 0 0 auto !important;
  margin-left: auto !important;
}
.kehua-attach-item__link {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  color: #1e293b !important;
  text-decoration: none !important;
  min-width: 0 !important;
  font-weight: 500 !important;
}
.kehua-attach-item__link:hover {
  color: #0066ff !important;
}
.kehua-attach-item__locked {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  color: #64748b !important;
  min-width: 0 !important;
}
.kehua-attach-item__name {
  font-size: 14px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.kehua-attach-item__status {
  padding: 4px 10px !important;
  font-size: 12px !important;
  border-radius: 20px !important;
  background: #ecfdf5 !important;
  color: #059669 !important;
  font-weight: 500 !important;
}
.kehua-attach-item__price {
  font-size: 14px !important;
  color: #64748b !important;
  white-space: nowrap !important;
}
.kehua-attach-item__price em {
  font-style: normal !important;
  font-weight: 600 !important;
  color: #ef4444 !important;
}
button.kehua-attach-paybtn {
  padding: 8px 20px !important;
  background: #0066ff !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  white-space: nowrap !important;
}
button.kehua-attach-paybtn:hover {
  background: #0052cc !important;
  box-shadow: 0 4px 12px rgba(0,102,255,0.25) !important;
}
button.kehua-attach-paybtn:disabled {
  background: #94a3b8 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}
@media (max-width: 640px) {
  ul.kehua-attachlist-paid > li.kehua-attach-item {
    flex-wrap: wrap !important;
    gap: 10px !important;
    padding: 12px 14px !important;
  }
  .kehua-attach-item__left {
    width: 100% !important;
  }
  .kehua-attach-item__right {
    width: 100% !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .kehua-attach-item__price {
    text-align: left !important;
  }
  .kehua-attach-item__status {
    align-self: flex-start !important;
    width: auto !important;
  }
  button.kehua-attach-paybtn {
    width: 100% !important;
    padding: 10px 20px !important;
    text-align: center !important;
  }
  .kehua-attach-item__name {
    font-size: 13px !important;
  }
}

@media (max-width: 576px) {
  .kehua-attach-fieldset .attachlist li {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .kehua-attach-fieldset .attachlist li > a:first-child {
    white-space: normal;
    word-break: break-all;
  }
  .kehua-attach-fieldset .attachlist li .kehua-attach-meta {
    order: 1;
  }
  .kehua-attach-price-wrap {
    order: 2;
    width: 100%;
    justify-content: flex-start;
  }
  .kehua-attach-price-input {
    flex: 1;
    max-width: 80px;
  }
  .kehua-attach-fieldset .attachlist li a.delete {
    order: 3;
    text-align: center;
  }
  .kehua-attach-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .kehua-attach-item__main {
    flex-wrap: wrap;
  }
  .kehua-attach-paybtn {
    width: 100%;
  }
}

/* VIP皇冠：会员红冠，非会员灰冠（关注卡等传 show_inactive_crown） */
.kehua-vip-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  vertical-align: middle;
  text-decoration: none;
}
.kehua-vip-badge--active {
  color: #c6303e;
}
.kehua-vip-badge--inactive {
  color: #9ca3af;
}
.kehua-vip-badge svg.kehua-vip-badge-crown {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: block;
}
.kehua-vip-badge--active svg.kehua-vip-badge-crown {
  filter: drop-shadow(0 1px 1px rgba(198, 48, 62, 0.22));
}
.kehua-vip-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  background: linear-gradient(135deg, #c6303e 0%, #9a1b2a 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1.2;
}
.kehua-vip-username {
  color: #c6303e !important;
  font-weight: 600;
}
.kehua-vip-username:hover {
  color: #9a1b2a !important;
}
.kehua-vip-username .kehua-post-author-link {
  color: inherit !important;
}
.kehua-vip-username .kehua-post-author-link:hover {
  color: #9a1b2a !important;
}

/* 个性签名样式 */
.kehua-user-signature {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px dashed #e5e7eb;
  font-size: 12px;
  color: #b0b8c1;
  line-height: 1.5;
}
.kehua-signature-text {
  word-break: break-word;
}
.kehua-signature-text a {
  color: #b0b8c1;
  text-decoration: none;
}
.kehua-signature-text a:hover {
  color: #8b95a1;
  text-decoration: underline;
}
.kehua-sig-compact {
  margin-top: 10px;
  padding-top: 8px;
  font-size: 12px;
  border-top-style: dotted;
}
