/* ==========================================================================
   discuss.css — 留言讨论板块样式（hongyuguo.com）
   沿用 Cursor 设计系统：奶油底 #f7f7f4 + 墨色 #26251e + 橙色 #f54e00，
   白卡片 + 8/12px 圆角，与首页 preview-cursor.css 完全一致。
   ========================================================================== */

/* 普通滚动页：顶栏固定，内容下移避开 64px */
.discuss-main {
  padding: 64px 0 0;
  background: var(--canvas);
  min-height: calc(100vh - 64px);
}

.nav-links a.active {
  color: var(--primary);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   话题列表视图
   -------------------------------------------------------------------------- */
.board-view {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 24px 72px;
}

.board-hero {
  text-align: center;
  margin-bottom: 48px;
}

.board-hero .eyebrow { margin-bottom: 12px; }

.board-title {
  font-size: 52px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -1.56px;
  color: var(--ink);
  margin-bottom: 16px;
}

.board-sub {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  max-width: 620px;
  margin: 0 auto;
}

.board-sub-zh {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}

/* 话题卡片网格：产品 2 列 */
.board-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* 分组标题 */
.board-group-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 48px 0 18px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.board-group-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

/* 扩展话题：紧凑行（扩展占比小，不占版面） */
.ext-topic-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ext-topic {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  padding: 12px 16px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.ext-topic:hover { border-color: var(--hairline-strong); }

.ext-topic-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
}

.ext-topic-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }

.ext-topic-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.ext-topic-en {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ext-topic-go {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  flex-shrink: 0;
}

/* 自由讨论卡片 */
.general-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-lg);
  padding: 28px 32px;
}

.general-minor {
  display: inline-block;
  margin-left: 14px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.general-minor:hover { color: var(--primary); }

.general-copy { max-width: 560px; }
.general-title { font-size: 20px; font-weight: 600; color: var(--ink); }
.general-sub { margin: 8px 0 18px; font-size: 14px; line-height: 1.7; color: var(--body); }

.general-qr { text-align: center; flex-shrink: 0; }
.general-qr img {
  width: 104px;
  height: 104px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
}
.general-qr p { margin-top: 8px; font-size: 12px; color: var(--muted); }

.topic-card {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.topic-card:hover {
  border-color: var(--hairline-strong);
  box-shadow: 0 10px 30px rgba(38, 37, 30, 0.08);
  transform: translateY(-2px);
}

.topic-card-main {
  display: block;
  color: inherit;
  text-decoration: none;
  flex: 1;
}

.topic-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.topic-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
}

.topic-kind {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.topic-name {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.1px;
  color: var(--ink);
  line-height: 1.3;
}

.topic-en {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.topic-tagline {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--body);
}

.topic-card-foot {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topic-qr {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.topic-qr img {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  display: block;
}

.topic-qr:hover { color: var(--primary); }

/* 底部整站二维码入口（已移除，首页结尾幕保留同类入口） */

/* --------------------------------------------------------------------------
   话题详情视图
   -------------------------------------------------------------------------- */
.topic-view {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 72px;
}

.topic-view-inner { width: 100%; }

.back-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
  margin-bottom: 24px;
  transition: color 0.2s ease;
}
.back-link:hover { color: var(--primary); }

.topic-head {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 28px;
}

.topic-icon-lg {
  width: 84px;
  height: 84px;
  border-radius: 16px;
  object-fit: contain;
  border: 1px solid var(--hairline);
  flex-shrink: 0;
}

.topic-title { font-size: 32px; font-weight: 400; letter-spacing: -0.64px; color: var(--ink); line-height: 1.2; }
.topic-head .topic-tagline { margin-top: 8px; max-width: 620px; font-size: 15px; }
.topic-head-actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; }

.btn-sm { padding: 8px 16px; font-size: 13px; }

.topic-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}

.topic-main-title { font-size: 20px; font-weight: 600; color: var(--ink); }
.topic-main-note { margin: 6px 0 18px; font-size: 13px; line-height: 1.6; color: var(--muted); }

/* giscus 容器：白卡片 */
.giscus {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-lg);
  padding: 20px 22px;
  min-height: 360px;
}

.giscus-fallback {
  background: var(--surface-card);
  border: 1px dashed var(--hairline-strong);
  border-radius: var(--rounded-lg);
  padding: 48px 24px;
  text-align: center;
}

.giscus-fallback-inner { max-width: 420px; margin: 0 auto; }
.gf-title { font-size: 18px; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.gf-copy { font-size: 14px; line-height: 1.7; color: var(--body); margin-bottom: 20px; }

/* 侧栏 */
.topic-side { display: flex; flex-direction: column; gap: 16px; }

.side-card {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-lg);
  padding: 20px;
  text-align: center;
}

.side-qr {
  width: 168px;
  height: 168px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
}

.side-qr-caption { margin-top: 10px; font-size: 13px; color: var(--body); }

.side-card h3 { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 12px; }
.side-card h3 { text-align: left; }
.side-steps { list-style: none; text-align: left; counter-reset: step; }
.side-steps li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--body);
}
.side-steps li:last-child { margin-bottom: 0; }
.side-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(245, 78, 0, 0.1);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 18px;
}

.side-note { text-align: left; }
.side-note p { font-size: 13px; line-height: 1.7; color: var(--body); }

/* 复制成功提示 */
.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 9999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 200;
}
.copy-toast.show { opacity: 1; }

/* --------------------------------------------------------------------------
   自由讨论论坛视图（站内，数据同步 GitHub Discussions）
   -------------------------------------------------------------------------- */
.forum-view {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 72px;
}

.forum-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 24px;
}

.forum-title { font-size: 32px; font-weight: 400; letter-spacing: -0.64px; color: var(--ink); }
.forum-sub { margin-top: 8px; font-size: 14px; line-height: 1.7; color: var(--body); max-width: 520px; }

.forum-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.forum-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--body);
  margin-right: 4px;
}

.f-user-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ea44f;
}

.f-link, .f-login {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.forum-body { min-height: 240px; }

.f-loading, .f-empty, .f-error { text-align: center; color: var(--muted); font-size: 14px; padding: 48px 16px; }
.f-error { color: #cf222e; }
.f-error-detail { margin-top: 8px; font-size: 12px; word-break: break-all; }
.f-cache-note { font-size: 12px; color: var(--muted); margin: 0 0 10px; text-align: center; }

.f-list { display: flex; flex-direction: column; gap: 10px; }

.f-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  padding: 16px 20px;
  color: inherit;
  transition: border-color 0.2s ease;
}
.f-item:hover { border-color: var(--hairline-strong); }

.f-item-title { font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.f-item-meta { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.f-item-meta a { color: var(--muted); text-decoration: underline; }
.f-item-go { color: var(--muted); font-size: 18px; }

.f-detail { background: var(--surface-card); border: 1px solid var(--hairline); border-radius: var(--rounded-lg); padding: 24px 28px; }
.f-detail-title { font-size: 22px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.f-body { margin-top: 14px; font-size: 15px; line-height: 1.7; color: var(--ink); word-break: break-word; }

.f-comments-title { margin: 28px 0 12px; font-size: 15px; font-weight: 600; color: var(--ink); }
.f-comments { display: flex; flex-direction: column; gap: 14px; }

.f-comment {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  padding: 16px 18px;
}
.f-comment-head { display: flex; align-items: center; gap: 10px; }
.f-comment-author { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.f-comment-time { font-size: 12px; color: var(--muted); margin-left: auto; }
.f-comment-body { margin-top: 10px; font-size: 14.5px; line-height: 1.7; color: var(--ink); word-break: break-word; }
.f-replies { margin: 12px 0 0 22px; padding-left: 16px; border-left: 2px solid var(--hairline); display: flex; flex-direction: column; gap: 10px; }

.f-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: inline-block; vertical-align: middle; }
.f-avatar-empty { background: var(--canvas-parchment); border: 1px solid var(--hairline); text-align: center; line-height: 32px; font-size: 14px; color: var(--muted); }

.f-login-banner { background: var(--surface-card); border: 1px dashed var(--hairline-strong); border-radius: var(--rounded-md); padding: 18px; text-align: center; margin-bottom: 16px; }

.f-comment-box { margin-bottom: 18px; }
.f-input {
  width: 100%;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--rounded-md);
  padding: 10px 12px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface-card);
  resize: vertical;
  box-sizing: border-box;
}
.f-input:focus { outline: 2px solid rgba(245, 78, 0, 0.35); border-color: var(--primary); }
.f-comment-box-actions, .f-form-actions { margin-top: 10px; display: flex; align-items: center; gap: 10px; }

.f-form {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-lg);
  padding: 24px 28px;
}
.f-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin: 16px 0 8px; }
.f-label:first-child { margin-top: 0; }

@media (max-width: 734px) {
  .forum-view { padding: 24px 16px 56px; }
  .forum-head { flex-direction: column; align-items: flex-start; }
  .f-detail { padding: 18px 16px; }
  .f-replies { margin-left: 10px; padding-left: 10px; }
}

/* --------------------------------------------------------------------------
   页脚
   -------------------------------------------------------------------------- */
.discuss-footer {
  background: var(--canvas);
  border-top: 1px solid var(--hairline);
  padding: 32px 24px;
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}
.discuss-footer .zh { margin-top: 2px; }

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .board-grid { grid-template-columns: repeat(2, 1fr); }
  .topic-layout { grid-template-columns: 1fr; }
  .topic-side { flex-direction: row; flex-wrap: wrap; }
  .side-card { flex: 1 1 220px; }
}

@media (max-width: 734px) {
  .discuss-main { padding-top: 64px; }
  .board-view { padding: 40px 16px 56px; }
  .board-title { font-size: 38px; letter-spacing: -1.14px; }
  .board-grid { grid-template-columns: 1fr; gap: 14px; }
  .board-group-title { margin-top: 36px; }
  .ext-topic-grid { grid-template-columns: 1fr; }
  .general-card { flex-direction: column; text-align: center; padding: 24px 20px; }
  .topic-head { flex-direction: column; }
  .topic-icon-lg { width: 64px; height: 64px; }
  .topic-title { font-size: 26px; }
  .topic-side { flex-direction: column; }
  .giscus { padding: 14px; }
}
