@charset "utf-8";
/* PG26 Mobile Forum Page Styles — aligned with pinggu-mobile-forum/index.html */
:root {
  font-size: clamp(16px, 4.2666667vw, 32px);
  --ink: #292c32;
  --muted: #858c98;
  --line: #edf0f3;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1rem; }
body.pg26-forum-page {
  margin: 0;
  background: #f1f2f4 !important;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: inherit; text-decoration: none; }
:where(.pg26-m-page) button,
.action-bar button,
dialog button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
:where(.pg26-m-page) svg,
.action-bar svg,
dialog svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
}

.page {
  max-width: 750px;
  margin: auto;
  background: #fff;
  min-height: 100vh;
  padding: 0 max(0px, env(safe-area-inset-right)) calc(5rem + env(safe-area-inset-bottom)) max(0px, env(safe-area-inset-left));
}

/* Breadcrumbs (adapts Discuz $navigation to "论坛 / 分区" style) */
body.pg26-forum-page .crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  padding: 1rem 1.25rem 0;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.4;
}
body.pg26-forum-page .crumbs span { color: #bdc2ca; }
body.pg26-forum-page .crumbs em {
  font-style: normal;
  color: #bdc2ca;
  font-size: 0;
}
body.pg26-forum-page .crumbs em::before {
  content: "/";
  font-size: .75rem;
}
body.pg26-forum-page .crumbs > em:first-child,
body.pg26-forum-page .crumbs > em:has(+ a:nth-of-type(n+3):last-child),
body.pg26-forum-page .crumbs > a:nth-of-type(n+3):last-child {
  display: none;
}

/* Forum header & WeChat group */
body.pg26-forum-page .forum-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1.25rem;
}
body.pg26-forum-page .forum-intro h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
  color: var(--ink);
}
body.pg26-forum-page .wechat {
  display: flex;
  align-items: center;
  gap: .3rem;
  min-height: 44px;
  font-size: .75rem;
  color: #558869;
  padding: 0;
  white-space: nowrap;
}

/* Thread types / quick topics */
body.pg26-forum-page .topics {
  padding: .25rem 1.25rem 1.25rem;
}
body.pg26-forum-page .topics-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
body.pg26-forum-page .topics-heading h2 {
  font-size: .8125rem;
  font-weight: 400;
  color: var(--muted);
  margin: 0;
}
body.pg26-forum-page .topics-heading button {
  display: flex;
  align-items: center;
  gap: .2rem;
  min-height: 44px;
  font-size: .8125rem;
  color: var(--ink);
  padding: 0;
}
body.pg26-forum-page .topics-heading svg {
  width: 1rem;
  height: 1rem;
}
body.pg26-forum-page .quick-topics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
}
body.pg26-forum-page .quick-topics a {
  font-size: .75rem;
  background: #f5f6f8;
  color: #626b78;
  border-radius: .35rem;
  padding: .5rem .65rem;
  line-height: 1.5;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
body.pg26-forum-page .quick-topics a.active {
  background: #fff4eb;
  color: var(--brand-primary);
  font-weight: 500;
}

/* Preserved subforums capsule section */
body.pg26-forum-page .pg26-subforums {
  padding: .25rem 1.25rem 1.25rem;
  background: #fff;
}
body.pg26-forum-page .pg26-subforums-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  font-size: .8125rem;
  color: var(--muted);
}
body.pg26-forum-page .pg26-subforums-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
body.pg26-forum-page .pg26-subforums-list a {
  display: inline-flex;
  align-items: center;
  padding: .4rem .65rem;
  border-radius: .35rem;
  background: #f5f6f8;
  color: #626b78;
  font-size: .75rem;
  line-height: 1.5;
}
body.pg26-forum-page .pg26-subforums-list a:active {
  background: #fff4eb;
  color: var(--brand-primary);
}
body.pg26-forum-page .pg26-subforums-list.is-collapsed a:nth-child(n+7) {
  display: none;
}
body.pg26-forum-page .pg26-subforums-toggle {
  color: var(--brand-primary);
  font-size: .75rem;
  min-height: 36px;
  padding: 0 .2rem;
}

/* Posts list */
body.pg26-forum-page .posts-section {
  padding: 0 1.25rem;
}
body.pg26-forum-page .section-heading {
  padding: 1rem 0 .2rem;
}
body.pg26-forum-page .section-heading h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}
body.pg26-forum-page .section-heading span,
#category-dialog .sheet-header h2 span {
  font-weight: 400;
  font-size: .75rem;
  color: var(--muted);
  margin-left: .4rem;
}
body.pg26-forum-page .ordinary {
  margin-top: .25rem;
  padding-top: 1rem;
}
body.pg26-forum-page .posts {
  list-style: none;
  margin: 0;
  padding: 0;
}
body.pg26-forum-page .post {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
body.pg26-forum-page .post h3 {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}
body.pg26-forum-page .pin,
body.pg26-forum-page .digest-badge {
  display: inline-block;
  vertical-align: 2px;
  font-size: .625rem;
  line-height: 1.6;
  padding: 0 .25rem;
  margin-right: .4rem;
  border-radius: 3px;
}
body.pg26-forum-page .pin {
  color: var(--brand-primary);
  background: #fff4eb;
}
body.pg26-forum-page .digest-badge {
  color: #1d6fd6;
  background: #eef6ff;
}
body.pg26-forum-page .post-icons {
  display: inline;
  white-space: nowrap;
  margin-left: .35rem;
}
body.pg26-forum-page .post-icons img {
  display: inline-block;
  width: .875rem;
  height: .875rem;
  vertical-align: -.08rem;
  transform: none;
  object-fit: contain;
  margin-right: .2rem;
}
body.pg26-forum-page .meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: .55rem;
  color: var(--muted);
  font-size: .6875rem;
  line-height: 1.5;
}
body.pg26-forum-page .author {
  display: flex;
  align-items: center;
  gap: .3rem;
  min-width: 0;
  overflow-wrap: anywhere;
}
body.pg26-forum-page .author img {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}
body.pg26-forum-page .meta time {
  white-space: nowrap;
  margin-left: auto;
}
body.pg26-forum-page .count {
  min-width: 1.6rem;
  text-align: center;
  font-weight: 500;
  background: #f0f1f3;
  border-radius: .25rem;
  padding: .05rem .3rem;
  color: #969da7;
  flex: none;
}

/* Expandable extra pinned posts */
body.pg26-forum-page .pinned-more summary {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  gap: .3rem;
  font-size: .75rem;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  padding: .7rem 0;
}
body.pg26-forum-page .pinned-more summary::-webkit-details-marker { display: none; }
body.pg26-forum-page .collapse-label { display: none; }
body.pg26-forum-page .pinned-more[open] .expand-label { display: none; }
body.pg26-forum-page .pinned-more[open] .collapse-label { display: inline; }
body.pg26-forum-page .pinned-more[open] summary svg { transform: rotate(180deg); }

/* Pagination & footer */
body.pg26-forum-page .pager-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}
body.pg26-forum-page .load-more {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  font-size: .8125rem;
  color: var(--muted);
  padding: 1rem .5rem;
  cursor: pointer;
}
body.pg26-forum-page footer {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  padding: 1rem;
  font-size: .75rem;
  color: var(--muted);
}

/* Fixed bottom action bar */
body.pg26-forum-page .action-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 750px;
  background: #fff;
  border-top: 1px solid #e7eaee;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  padding: .4rem .65rem calc(.4rem + env(safe-area-inset-bottom));
  z-index: 45;
}
body.pg26-forum-page .action-bar > a,
body.pg26-forum-page .action-bar > button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  min-height: 44px;
  padding: .4rem 0;
  font-size: .6875rem;
  color: #737d8b;
}
body.pg26-forum-page .action-bar .post-action,
body.pg26-forum-page .action-bar button[aria-pressed="true"] {
  color: var(--brand-primary);
}
body.pg26-forum-page .action-bar button[aria-pressed="true"] svg {
  fill: currentColor;
}
body.pg26-forum-page .action-bar svg {
  width: 1.35rem;
  height: 1.35rem;
}

/* Category bottom sheet */
#category-dialog.sheet {
  position: fixed;
  inset: auto 0 0;
  margin: 0 auto;
  width: 100%;
  max-width: 750px;
  max-height: 85dvh;
  box-sizing: border-box;
  border: 0;
  border-radius: 1rem 1rem 0 0;
  padding: 0 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
  background: #fff;
  color: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
}
#category-dialog.sheet::backdrop,
#wechat-dialog.wechat-dialog::backdrop {
  background: #17202d66;
}
#category-dialog .sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: #fff;
  padding: 1.25rem 0 1rem;
  z-index: 2;
}
#category-dialog .sheet-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}
#category-dialog .category-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
}
#category-dialog .category-list a,
#category-dialog .all-category {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: .8125rem;
  line-height: 1.5;
  min-height: 44px;
  border-radius: .4rem;
  padding: .65rem .5rem;
  background: #f5f6f8;
  color: #626b78;
}
#category-dialog .all-category {
  width: 100%;
  margin-bottom: .6rem;
}
#category-dialog .all-category[aria-current="page"],
#category-dialog .all-category.active,
#category-dialog .category-list a.active {
  color: var(--brand-primary);
  background: #fff4eb;
  font-weight: 500;
}

/* WeChat group modal */
#wechat-dialog.wechat-dialog {
  border: 0;
  border-radius: .75rem;
  max-width: 90vw;
  padding: 1.25rem;
  text-align: center;
  background: #fff;
  color: var(--ink);
}
#wechat-dialog .close {
  float: right;
  margin: -.5rem -.5rem 0 0;
}
#wechat-dialog h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: .25rem 0 0;
  clear: both;
}
#wechat-dialog > img {
  display: block;
  width: 10rem;
  max-width: 100%;
  margin: 1rem auto;
}
#wechat-dialog > a {
  font-size: .8rem;
  color: #558869;
}

#toast {
  position: fixed;
  bottom: calc(5.3rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  background: #292c32ed;
  color: #fff;
  border-radius: .5rem;
  padding: .75rem 1.2rem;
  z-index: 50;
  font-size: .875rem;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media (max-width: 350px) {
  body.pg26-forum-page .crumbs,
  body.pg26-forum-page .forum-intro,
  body.pg26-forum-page .topics,
  body.pg26-forum-page .pg26-subforums,
  body.pg26-forum-page .posts-section {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  body.pg26-forum-page .forum-intro h1 { font-size: 1.35rem; }
  body.pg26-forum-page .meta { gap: .4rem; }
  body.pg26-forum-page .author { max-width: 45%; }
}
