:root {
  --forum-bg: #f2f2f2;
  --forum-panel: #ffffff;
  --forum-ink: #111111;
  --forum-accent: #000000;
  --forum-deep: #000000;
  --forum-line: #1a1a1a;
  --forum-rind: #ebebeb;
  --touch-target: 44px;
}

body {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0) 180px),
    radial-gradient(circle at top right, rgba(0, 0, 0, 0.08), transparent 30%),
    radial-gradient(circle at left center, rgba(0, 0, 0, 0.05), transparent 28%),
    var(--forum-bg);
  color: var(--forum-ink);
}

.forum-hero,
.board-section,
.detail-shell,
.profile-panel,
.admin-panel {
  border: 1px solid var(--forum-line);
  border-left: 6px solid var(--forum-accent);
  background: var(--forum-panel);
  box-shadow: 0 18px 50px rgba(31, 26, 23, 0.08);
}

.thread-grid {
  display: grid;
  grid-template-columns: 1fr !important;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .thread-grid {
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .thread-grid {
    gap: 1.25rem;
  }
}

.forum-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 0;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .forum-hero {
    grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr);
    gap: 1.25rem;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .forum-hero {
    gap: 1.5rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
  }
}

.hero-eyebrow,
.section-heading p,
.detail-meta,
.thread-card-foot,
.board-meta,
.coin-panel span,
.attachment-card span,
.reply-item header span,
.auth-switch-btn,
.forum-pagination {
  font-family: 'JetBrains Mono', monospace;
}

.hero-eyebrow {
  margin: 0 0 0.5rem;
  color: var(--forum-deep);
  letter-spacing: 0.18em;
  font-size: 0.65rem;
}

@media (min-width: 768px) {
  .hero-eyebrow {
    margin: 0 0 0.65rem;
    font-size: 0.75rem;
  }
}

.hero-actions,
.user-stack,
.captcha-row,
.detail-actions,
.forum-pagination {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

@media (min-width: 768px) {
  .hero-actions,
  .user-stack,
  .captcha-row,
  .detail-actions,
  .forum-pagination {
    gap: 0.75rem;
  }
}

.ghost-btn {
  border: 1px solid var(--forum-line);
  background: rgba(255, 255, 255, 0.75);
  color: var(--forum-ink);
  cursor: pointer;
  min-height: var(--touch-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ghost-btn,
.create-btn,
.small-btn {
  border-radius: 0;
  padding: 0.65rem 0.9rem;
  font-weight: 700;
}

@media (min-width: 768px) {
  .ghost-btn,
  .create-btn,
  .small-btn {
    padding: 0.75rem 1.15rem;
  }
}

.small-btn,
.small-create {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
}

@media (min-width: 768px) {
  .small-btn,
  .small-create {
    padding: 0.55rem 0.95rem;
    font-size: 0.85rem;
  }
}

.forum-hero-stats,
.attachment-grid,
.reply-list {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .forum-hero-stats,
  .attachment-grid,
  .reply-list {
    gap: 1rem;
  }
}

.forum-hero-stats {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .forum-hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .forum-hero-stats {
    grid-template-columns: 1fr;
  }
}

.hero-stat,
.coin-panel,
.attachment-card,
.reply-item,
.empty-card {
  border-radius: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--forum-line);
  background: rgba(255, 255, 255, 0.85);
}

@media (min-width: 768px) {
  .hero-stat,
  .coin-panel,
  .attachment-card,
  .reply-item,
  .empty-card {
    padding: 1rem 1.1rem;
  }
}

.hero-stat strong,
.coin-panel strong {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.2rem;
}

@media (min-width: 768px) {
  .hero-stat strong,
  .coin-panel strong {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
  }
}

.board-section,
.resource-panel,
.reply-panel,
.detail-body {
  border-radius: 0;
  padding: 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .board-section,
  .resource-panel,
  .reply-panel,
  .detail-body {
    padding: 1.25rem;
    margin-bottom: 1.15rem;
  }
}

@media (min-width: 1024px) {
  .board-section,
  .resource-panel,
  .reply-panel,
  .detail-body {
    padding: 1.4rem;
    margin-bottom: 1.25rem;
  }
}

.section-heading,
.section-heading.compact,
.detail-header,
.thread-card-top,
.thread-tags,
.attachment-card,
.reply-item header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .section-heading,
  .section-heading.compact,
  .detail-header,
  .thread-card-top,
  .thread-tags,
  .attachment-card,
  .reply-item header {
    gap: 0.85rem;
  }
}

.section-heading h2,
.detail-header h1 {
  margin: 0;
  font-size: 1.1rem;
}

@media (min-width: 768px) {
  .section-heading h2,
  .detail-header h1 {
    font-size: 1.25rem;
  }
}

.board-strip {
  display: grid;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .board-strip {
    gap: 0.75rem;
  }
}

.board-card {
  width: 100%;
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  border: 1px solid var(--forum-line);
  border-left: 6px solid var(--forum-accent);
  border-radius: 0;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(238,238,238,0.96));
  cursor: pointer;
  min-height: var(--touch-target);
}

@media (min-width: 768px) {
  .board-card {
    gap: 1rem;
    padding: 1rem 1.15rem;
  }
}

.board-card.active,
.auth-switch-btn.active {
  border-color: var(--forum-accent);
  background: linear-gradient(135deg, rgba(0,0,0,0.12), rgba(0,0,0,0.04));
}

.board-name {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .board-name {
    font-size: 1.05rem;
  }
}

.board-meta {
  white-space: nowrap;
  font-size: 0.7rem;
}

@media (min-width: 768px) {
  .board-meta {
    font-size: 0.78rem;
  }
}

.board-meta i {
  font-style: normal;
  margin: 0 0.35rem;
}

.thread-card {
  border-radius: 0;
  border: 1px solid var(--forum-line);
  border-left: 6px solid var(--forum-accent);
  background: rgba(255, 253, 248, 0.92);
  padding: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 768px) {
  .thread-card {
    padding: 1.15rem;
  }
}

@media (min-width: 1024px) {
  .thread-card {
    padding: 1.25rem;
  }
}

.thread-card:hover,
.ghost-btn:hover,
.board-card:hover,
.attachment-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(31, 26, 23, 0.1);
}

.thread-card h3,
.detail-header h1 {
  margin: 0.35rem 0 0.5rem;
  font-size: 1rem;
  line-height: 1.3;
}

@media (min-width: 768px) {
  .thread-card h3,
  .detail-header h1 {
    margin: 0.4rem 0 0.55rem;
    font-size: 1.1rem;
  }
}

@media (min-width: 1024px) {
  .thread-card h3,
  .detail-header h1 {
    margin: 0.45rem 0 0.6rem;
    font-size: 1.15rem;
  }
}

.thread-tags span,
.mini-badge {
  border-radius: 0;
  padding: 0.3rem 0.55rem;
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.07);
}

@media (min-width: 768px) {
  .thread-tags span,
  .mini-badge {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
  }
}

.mini-badge.hot { background: rgba(0, 0, 0, 0.16); }
.mini-badge.coin { background: rgba(0, 0, 0, 0.12); }

.detail-shell { 
  border-radius: 0; 
  padding: 1rem; 
}

@media (min-width: 768px) {
  .detail-shell { 
    padding: 1.25rem; 
  }
}

@media (min-width: 1024px) {
  .detail-shell { 
    padding: 1.5rem; 
  }
}

.detail-header { margin-bottom: 0.85rem; }
@media (min-width: 768px) { .detail-header { margin-bottom: 1rem; } }

.detail-body { line-height: 1.7; font-size: 0.9rem; }
@media (min-width: 768px) { .detail-body { line-height: 1.8; font-size: 0.95rem; } }
@media (min-width: 1024px) { .detail-body { font-size: 1rem; } }

.detail-body img, .reply-item img { max-width: 100%; border-radius: 0; height: auto; }
.detail-body pre, .reply-item pre { 
  overflow: auto; 
  padding: 0.75rem; 
  background: #f7f3eb; 
  border-radius: 0;
  font-size: 0.8rem;
}
@media (min-width: 768px) {
  .detail-body pre, .reply-item pre { 
    padding: 1rem;
    font-size: 0.85rem;
  }
}

.coin-panel.small strong { font-size: 1.1rem; }
@media (min-width: 768px) { .coin-panel.small strong { font-size: 1.25rem; } }

.attachment-grid { grid-template-columns: 1fr; }
@media (min-width: 640px) { .attachment-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
@media (min-width: 1024px) { .attachment-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }

.attachment-card strong { display: block; margin-bottom: 0.3rem; font-size: 0.9rem; }
@media (min-width: 768px) { .attachment-card strong { margin-bottom: 0.35rem; font-size: 1rem; } }

.reply-item { display: grid; gap: 0.6rem; }
@media (min-width: 768px) { .reply-item { gap: 0.75rem; } }

.reply-form { display: grid; gap: 0.75rem; margin-top: 0.85rem; }
@media (min-width: 768px) { .reply-form { gap: 1rem; margin-top: 1rem; } }

.auth-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
@media (min-width: 768px) {
  .auth-switch {
    gap: 0.5rem;
    margin-bottom: 1rem;
  }
}

.auth-switch-btn,
.captcha-box {
  border: 1px solid var(--forum-line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.9);
}

.auth-switch-btn { 
  padding: 0.65rem 0.85rem; 
  cursor: pointer; 
  min-height: var(--touch-target);
  font-size: 0.8rem;
}
@media (min-width: 768px) {
  .auth-switch-btn { 
    padding: 0.8rem 1rem;
    font-size: 0.875rem;
  }
}

.captcha-box { 
  min-height: 50px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
}
@media (min-width: 768px) { .captcha-box { min-height: 58px; } }

.captcha-box svg { width: 100%; height: auto; }
.forum-pagination { justify-content: center; padding: 0.85rem 0 0.5rem; }
@media (min-width: 768px) { .forum-pagination { padding: 1rem 0 0.5rem; } }

/* 移动端优化 */
@media (max-width: 767px) {
  .forum-hero { grid-template-columns: 1fr; }
  .detail-header { align-items: flex-start; }
  
  .subtitle,
  .section-heading p {
    display: none;
  }

  .board-card,
  .detail-header,
  .thread-card-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
  }

  .thread-card {
    padding: 0.85rem;
  }

  .thread-card h3 {
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
  }
  
  .thread-card p {
    font-size: 0.8rem;
    line-height: 1.5;
  }

  .category-tabs {
    display: none;
  }
  
  .hero-stat strong,
  .coin-panel strong {
    font-size: 1.3rem;
  }
  
  .forum-hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 平板端优化 */
@media (min-width: 768px) and (max-width: 1023px) {
  .forum-hero {
    grid-template-columns: 1fr;
  }
  
  .forum-hero-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}
