/* ==========================================================================
   PGDer 社区论坛 — 二级页样式
   ========================================================================== */

.forum-hero {
  padding: 148px 0 0;
  position: relative;
  overflow: hidden;
}

.forum-hero::before {
  content: "";
  position: absolute;
  top: -220px;
  right: -120px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(217, 47, 42, 0.1), transparent 62%);
  pointer-events: none;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--dim);
  margin-bottom: 28px;
}

.breadcrumb a { color: var(--muted); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--red-bright); }
.breadcrumb i { font-style: normal; color: #c2cbd8; }

.forum-hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: end;
  padding-bottom: 44px;
  border-bottom: 1px solid var(--line);
}

.forum-hero h1 {
  font-family: var(--display);
  font-size: clamp(40px, 5.2vw, 68px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}

.forum-hero h1 span { color: var(--red-bright); }

.forum-hero p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.9;
  max-width: 540px;
}

.forum-hero-right {
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: flex-start;
}

.forum-stats {
  display: flex;
  gap: 40px;
}

.forum-stats b {
  display: block;
  font-family: var(--display);
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
}

.forum-stats span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--dim);
}

.forum-hero-right .btn svg { width: 15px; }

/* 主体布局 */
.forum-main {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 26px;
  padding: 44px 0 100px;
  align-items: start;
}

.sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 92px; }

.side-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 26px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--dim);
  background: #f7f9fc;
}

.side-head b { color: var(--text); font-weight: 600; letter-spacing: 0.06em; }

.cat-list { padding: 8px; }

.cat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: left;
  transition: background 0.2s, color 0.2s;
}

.cat-btn .ico {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b7c2d2;
  flex-shrink: 0;
  transition: background 0.2s, box-shadow 0.2s;
}

.cat-btn .count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
}

.cat-btn:hover { background: rgba(15, 23, 42, 0.045); color: var(--text); }

.cat-btn.active {
  background: linear-gradient(90deg, rgba(217, 47, 42, 0.12), rgba(217, 47, 42, 0.02));
  color: var(--red-deep);
}

.cat-btn.active .ico { background: var(--red-bright); box-shadow: 0 0 8px var(--red); }
.cat-btn.active .count { color: var(--red-deep); opacity: 0.75; }

.side-note { padding: 16px 18px; }

.side-note .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--red-bright);
  border: 1px solid rgba(226, 58, 53, 0.3);
  background: rgba(226, 58, 53, 0.07);
  border-radius: 999px;
  padding: 3px 9px;
  margin-bottom: 10px;
}

.side-note h4 { font-size: 13px; margin-bottom: 6px; line-height: 1.6; }

.side-note p { font-size: 11.5px; color: var(--dim); line-height: 1.8; }

.side-note p + p { margin-top: 6px; }

.contrib-list { padding: 10px 16px 14px; }

.contrib-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}

.contrib-item:last-child { border-bottom: 0; }

.contrib-avatar {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(150deg, #64748b, #475569);
  flex-shrink: 0;
}

.contrib-name { font-size: 12px; color: var(--muted); }
.contrib-name b { color: var(--text); font-weight: 600; }
.contrib-item .meta { margin-left: auto; font-family: var(--mono); font-size: 9.5px; color: var(--dim); }

/* 工具栏 */
.forum-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-box svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--dim);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 38px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-family: var(--body);
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input::placeholder { color: var(--dim); }

.search-box input:focus {
  outline: none;
  border-color: rgba(226, 58, 53, 0.55);
  box-shadow: 0 0 0 3px rgba(226, 58, 53, 0.1);
}

.sort-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
}

.sort-tabs button {
  padding: 7px 13px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.sort-tabs button:hover { color: var(--text); }

.sort-tabs button.active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.forum-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--dim);
}

.forum-count b { color: var(--red-bright); font-weight: 400; }

/* 帖子列表 */
.thread-list {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 30px rgba(15, 23, 42, 0.04);
}

.thread {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 16px;
  padding: 19px 22px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  position: relative;
}

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

.thread:hover {
  background: rgba(226, 58, 53, 0.035);
  box-shadow: inset 2px 0 0 var(--red);
}

.thread:hover .thread-title { color: var(--red-bright); }

.thread-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--avatar, linear-gradient(150deg, #64748b, #475569));
  flex-shrink: 0;
  user-select: none;
}

.thread-body { min-width: 0; }

.thread-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.cat-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
}

.cat-tag.hot { color: var(--red-bright); border-color: rgba(226, 58, 53, 0.35); background: rgba(226, 58, 53, 0.06); }

.pin-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: #b7791f;
  border: 1px solid rgba(183, 121, 31, 0.35);
  background: rgba(183, 121, 31, 0.08);
  border-radius: 4px;
  padding: 2px 7px;
}

.thread-title {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  transition: color 0.2s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-excerpt {
  font-size: 12px;
  color: var(--dim);
  line-height: 1.7;
  margin-top: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.thread-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--dim);
  letter-spacing: 0.02em;
}

.thread-meta .author { color: var(--muted); }

.thread-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
  min-width: 58px;
}

.thread-stats b {
  font-family: var(--display);
  font-size: 19px;
  line-height: 1;
  font-weight: 700;
  color: var(--muted);
}

.thread:hover .thread-stats b { color: var(--text); }

.thread-stats span {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  color: var(--dim);
}

.thread-stats .views { margin-top: 4px; }

/* 空状态 */
.empty-state {
  padding: 70px 20px;
  text-align: center;
  color: var(--dim);
}

.empty-state svg { width: 30px; height: 30px; margin: 0 auto 14px; opacity: 0.5; }
.empty-state p { font-size: 13px; }
.empty-state button { color: var(--red-bright); font-size: 13px; border-bottom: 1px solid rgba(226, 58, 53, 0.4); }

/* 分页 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

.page-info {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--dim);
}

.page-btns { display: flex; gap: 6px; }

.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.page-btn:hover:not(:disabled) { border-color: rgba(226, 58, 53, 0.45); color: var(--text); }

.page-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* 只读提示：访客不能回复 */
.reply-readonly {
  margin-top: 18px;
  padding: 13px 16px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.gb-form {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
}

.gb-form input,
.gb-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.8;
  padding: 10px 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.gb-form input { height: 38px; padding: 0 12px; max-width: 260px; margin-bottom: 10px; }

.gb-form textarea { min-height: 74px; resize: vertical; }

.gb-form input::placeholder,
.gb-form textarea::placeholder { color: var(--dim); }

.gb-form input:focus,
.gb-form textarea:focus {
  outline: none;
  border-color: rgba(226, 58, 53, 0.55);
  box-shadow: 0 0 0 3px rgba(226, 58, 53, 0.1);
}

.gb-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
}

.gb-actions .hint { font-size: 11px; color: var(--dim); }

.gb-list { padding: 4px 22px 8px; }

.gb-empty { padding: 26px 0 22px; font-size: 12.5px; color: var(--dim); }

.gb-item {
  display: flex;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-soft);
}

.gb-item:last-child { border-bottom: 0; }

.gb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(150deg, #64748b, #475569);
  flex-shrink: 0;
  user-select: none;
}

.gb-main { min-width: 0; flex: 1; }

.gb-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 3px;
}

.gb-name { font-size: 12px; font-weight: 600; color: var(--text); }

.gb-time { font-family: var(--mono); font-size: 9px; color: var(--dim); }

.gb-text { font-size: 12.5px; color: var(--muted); line-height: 1.8; word-break: break-word; }

/* --------------------------------------------------------------------------
   弹层：帖子详情 / 发帖
   -------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.modal.open { opacity: 1; visibility: visible; }

.dialog {
  width: 100%;
  max-width: 780px;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 40px 100px rgba(15, 23, 42, 0.28);
  transform: translateY(18px) scale(0.99);
  transition: transform 0.3s var(--ease);
  overflow: hidden;
}

.modal.open .dialog { transform: translateY(0) scale(1); }

.dialog-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fc;
  flex-shrink: 0;
}

.dialog-head .thread-top { margin-bottom: 7px; }

.dialog-title {
  font-family: var(--display);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.35;
}

.dialog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--dim);
}

.dialog-close {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  flex-shrink: 0;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}

.dialog-close:hover { color: var(--text); border-color: rgba(226, 58, 53, 0.5); transform: rotate(90deg); }

.dialog-close svg { width: 16px; height: 16px; }

.dialog-body {
  padding: 24px 26px 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.post-body p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.95;
  margin-bottom: 14px;
}

.post-body p:last-child { margin-bottom: 0; }

.post-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 4px 0 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
  color: var(--text);
  font-family: var(--display);
  line-height: 1.5;
  margin: 22px 0 10px;
}

.post-body h3 { font-size: 18px; }
.post-body h4 { font-size: 16px; }
.post-body h5,
.post-body h6 { font-size: 14px; }

.post-body ul,
.post-body ol {
  margin: 0 0 14px 20px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.9;
}

.post-body li { margin-bottom: 4px; }

.post-body blockquote {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-left: 3px solid rgba(226, 58, 53, 0.45);
  background: rgba(226, 58, 53, 0.04);
  border-radius: 0 6px 6px 0;
}

.post-body blockquote p { margin-bottom: 0; }

.post-body pre {
  overflow-x: auto;
  margin: 0 0 16px;
  padding: 14px 16px;
  background: #f7f7f5;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.post-body pre code {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: #3f4650;
  white-space: pre;
}

.post-body a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.post-body hr {
  height: 1px;
  margin: 18px 0;
  border: 0;
  background: var(--line);
}

.post-body .md-align-left { text-align: left; }
.post-body .md-align-center { text-align: center; }
.post-body .md-align-right { text-align: right; }
.post-body .md-align-justify { text-align: justify; }

.post-body .md-indent-1 { margin-left: 1.5em; }
.post-body .md-indent-2 { margin-left: 3em; }
.post-body .md-indent-3 { margin-left: 4.5em; }
.post-body .md-indent-4 { margin-left: 6em; }
.post-body .md-indent-5 { margin-left: 7.5em; }
.post-body .md-indent-6 { margin-left: 9em; }

.post-body .md-table-wrap {
  overflow-x: auto;
  margin: 0 0 16px;
}

.post-body .md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.7;
}

.post-body .md-table th,
.post-body .md-table td {
  padding: 8px 12px;
  border: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.post-body .md-table th {
  background: var(--panel-2);
  color: var(--text);
  font-weight: 600;
}

.post-body .md-table tbody tr:nth-child(even) { background: rgba(0, 0, 0, 0.015); }

.post-body .md-table p { margin-bottom: 0; }

/* 公众号富文本正文：保留内联样式，同时提供与站点一致的基础排版 */
.post-body .wx-article {
  color: var(--text);
  font-size: 15px;
  line-height: 1.85;
  overflow-wrap: break-word;
  word-break: break-word;
}

.post-body .wx-article p,
.post-body .wx-article section,
.post-body .wx-article div {
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.post-body .wx-article p { margin: 0 0 1em; }
.post-body .wx-article p:last-child { margin-bottom: 0; }

.post-body .wx-article h1,
.post-body .wx-article h2,
.post-body .wx-article h3,
.post-body .wx-article h4,
.post-body .wx-article h5,
.post-body .wx-article h6 {
  color: inherit;
  font-size: 1.25em;
  line-height: 1.5;
  margin: 1em 0 0.6em;
}

.post-body .wx-article ul,
.post-body .wx-article ol {
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.post-body .wx-article blockquote {
  color: inherit;
  font-size: inherit;
}

.post-body .wx-article img {
  max-width: 100%;
  height: auto;
}

.post-body .wx-article table {
  max-width: 100%;
}

.post-body .code {
  font-family: var(--mono);
  font-size: 11.5px;
  color: #a16207;
  background: #fef9e7;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 1px 6px;
}

.reply-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--dim);
}

.reply-head b { color: var(--text); font-weight: 600; }

.reply-item {
  display: flex;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-soft);
}

.reply-item:last-child { border-bottom: 0; }

.reply-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(150deg, #64748b, #475569);
  flex-shrink: 0;
}

.reply-main { min-width: 0; flex: 1; }

.reply-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 3px;
}

.reply-author { font-size: 12px; font-weight: 600; color: var(--text); }

.reply-time { font-family: var(--mono); font-size: 9px; color: var(--dim); }

.reply-text { font-size: 12.5px; color: var(--muted); line-height: 1.8; }

.reply-op {
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--red-bright);
  border: 1px solid rgba(226, 58, 53, 0.3);
  border-radius: 3px;
  padding: 1px 5px;
}

.reply-form {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.reply-form label {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--dim);
  margin-bottom: 8px;
}

.reply-form textarea,
.field textarea,
.field input,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.8;
  padding: 10px 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.reply-form textarea { min-height: 82px; resize: vertical; }

.field textarea:focus,
.field input:focus,
.field select:focus,
.reply-form textarea:focus {
  outline: none;
  border-color: rgba(226, 58, 53, 0.55);
  box-shadow: 0 0 0 3px rgba(226, 58, 53, 0.1);
}

.reply-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
}

.reply-actions .hint { font-size: 11px; color: var(--dim); }

/* 发帖表单 */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--dim);
  margin-bottom: 7px;
}

.field input, .field select { height: 42px; padding: 0 12px; }

.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #6b7280 50%), linear-gradient(135deg, #6b7280 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }

.field textarea { min-height: 150px; resize: vertical; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.form-note { font-size: 11px; color: var(--dim); margin-top: 4px; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border: 1px solid rgba(31, 138, 76, 0.3);
  border-radius: 9px;
  background: #f0fdf4;
  color: #166534;
  font-size: 12.5px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.toast i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* 论坛底部 */
.forum-footer-note {
  border-top: 1px solid var(--line);
  padding: 30px 0 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--dim);
}

@media (max-width: 1024px) {
  .forum-hero-grid { grid-template-columns: 1fr; gap: 30px; align-items: start; }
  .forum-main { grid-template-columns: 220px minmax(0, 1fr); }
  .sidebar { position: static; }
}

@media (max-width: 820px) {
  .forum-hero { padding-top: 116px; }
  .forum-hero-grid { padding-bottom: 30px; }
  .forum-main { grid-template-columns: 1fr; gap: 18px; padding: 28px 0 70px; }
  .sidebar { gap: 12px; }
  .cat-list { display: flex; flex-wrap: wrap; gap: 4px; }
  .cat-btn { width: auto; padding: 6px 11px; border: 1px solid var(--line); font-size: 11.5px; }
  .cat-btn .count { margin-left: 4px; }
  .side-card.contrib, .side-card.note { display: none; }
  .forum-toolbar { gap: 8px; }
  .search-box { flex: 1 1 100%; }
  .sort-tabs { flex: 1; }
  .sort-tabs button { flex: 1; }
  .forum-toolbar > .btn { flex: 1; }
  .thread { grid-template-columns: 36px minmax(0, 1fr); padding: 16px; gap: 12px; }
  .thread-avatar { width: 36px; height: 36px; font-size: 14px; }
  .thread-stats { display: none; }
  .thread-title { white-space: normal; font-size: 13.5px; }
  .pagination { flex-direction: column; align-items: flex-start; }
  .dialog { max-height: calc(100vh - 40px); }
  .dialog-head { padding: 18px 18px; }
  .dialog-title { font-size: 19px; }
  .dialog-body { padding: 18px; }
  .field-row { grid-template-columns: 1fr; }
  .forum-footer-note { flex-direction: column; align-items: flex-start; gap: 8px; }
  .gb-head { padding: 16px 16px 13px; }
  .gb-form { padding: 14px 16px; }
  .gb-form input { max-width: 100%; }
  .gb-list { padding: 0 16px 6px; }
  .gb-actions { flex-wrap: wrap; }
}

/* ==========================================================================
   主题详情页（整页展示）
   ========================================================================== */

.thread-view {
  padding: 132px 0 80px;
}

.thread-view .breadcrumb {
  margin-bottom: 22px;
}

.thread-article {
  max-width: 960px;
  margin: 0 auto;
  padding: 34px 40px 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.012));
}

.thread-article-head {
  padding-bottom: 22px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.thread-article-title {
  margin: 12px 0 16px;
  font-size: 27px;
  line-height: 1.45;
  letter-spacing: -0.02em;
  color: var(--text);
}

.thread-article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.thread-article-meta .thread-avatar {
  width: 26px;
  height: 26px;
  margin-right: 2px;
  font-size: 11px;
}

.thread-article-meta .author {
  color: var(--text);
  font-weight: 600;
}

.thread-article-meta .dot {
  color: var(--dim);
}

.thread-article .post-body p {
  font-size: 14px;
}

.thread-article .post-body h3 { font-size: 19px; }
.thread-article .post-body h4 { font-size: 16.5px; }

.thread-article .reply-head {
  margin-top: 36px;
}

.thread-replies .reply-item {
  padding: 16px 0;
}

.thread-no-reply {
  padding: 6px 0 4px;
  font-size: 12.5px;
  color: var(--dim);
}

.thread-back-wrap {
  max-width: 960px;
  margin: 22px auto 0;
}

.thread-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  transition: color 0.2s;
}

.thread-back:hover {
  color: var(--red-bright);
}

.thread-empty {
  padding: 60px 30px;
  text-align: center;
}

.thread-empty h1 {
  margin-bottom: 12px;
  font-size: 22px;
}

.thread-empty p {
  margin-bottom: 22px;
  font-size: 13.5px;
  color: var(--muted);
}

@media (max-width: 820px) {
  .thread-view { padding: 108px 0 56px; }
  .thread-article { padding: 24px 20px; border-radius: 14px; }
  .thread-article-title { font-size: 21px; }
  .thread-article .post-body p { font-size: 13.5px; }
}
