/* ========================================
   BRUTALIST DESIGN - 方块风格 + 大量动画
   ======================================== */

:root {
  --bg: #f0f0f0;
  --fg: #0a0a0a;
  --accent: #ff0000;
  --grid-size: 20px;
  --border-width: 3px;
  --transition: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础重置 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 桌面端/移动端显示控制 */
.desktop-only {
  display: flex;
}

.mobile-only {
  display: none;
}

.mobile-back {
  display: none;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  overflow-x: hidden;
}

/* 网格背景 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  pointer-events: none;
  z-index: -1;
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(var(--grid-size), var(--grid-size)); }
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
  border-left: var(--border-width) solid var(--fg);
}

::-webkit-scrollbar-thumb {
  background: var(--fg);
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* 选中文本 */
::selection {
  background: var(--fg);
  color: var(--bg);
}

/* ========================================
   导航栏
   ======================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--fg);
  color: var(--bg);
  border-bottom: var(--border-width) solid var(--fg);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  height: 100%;
  cursor: pointer;
  border-right: var(--border-width) solid rgba(255,255,255,0.2);
  transition: var(--transition);
}

.nav-brand:hover {
  background: var(--bg);
  color: var(--fg);
}

.nav-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid currentColor;
  animation: iconPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(5deg); }
}

.nav-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-actions {
  display: flex;
  align-items: center;
  height: 100%;
}

.search-box {
  display: flex;
  align-items: center;
  height: 100%;
  border-right: var(--border-width) solid rgba(255,255,255,0.2);
}

.search-input {
  width: 200px;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--bg);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0 1rem;
  outline: none;
  text-transform: uppercase;
}

.search-input::placeholder {
  color: rgba(255,255,255,0.5);
}

.search-input:focus {
  background: var(--bg);
  color: var(--fg);
}

.search-btn {
  width: 50px;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.search-btn:hover {
  background: var(--bg);
  color: var(--fg);
}

.user-menu-wrapper {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 0.5rem;
}

.user-menu-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 2px solid var(--bg);
  color: var(--bg);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  margin: 0 0.25rem;
}

.user-menu-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--bg);
  transition: var(--transition);
  z-index: -1;
}

.user-menu-btn:hover {
  color: var(--fg);
}

.user-menu-btn:hover::before {
  left: 0;
}

/* ========================================
   主容器
   ======================================== */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 1rem 2rem;
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  gap: 1.5rem;
  min-height: 100vh;
}

/* ========================================
   侧边栏
   ======================================== */
.left-sidebar,
.right-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-block {
  background: white;
  border: var(--border-width) solid var(--fg);
  position: relative;
  overflow: hidden;
}

.sidebar-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(0,0,0,0.02) 10px,
    rgba(0,0,0,0.02) 20px
  );
  animation: diagonalMove 10s linear infinite;
  pointer-events: none;
}

@keyframes diagonalMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(20px, 20px); }
}

.block-header {
  background: var(--fg);
  color: var(--bg);
  padding: 0.75rem 1rem;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.block-content {
  padding: 1rem;
  position: relative;
  z-index: 1;
}

/* 统计数字 */
.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.25rem;
  animation: numberGlow 3s ease-in-out infinite;
}

@keyframes numberGlow {
  0%, 100% { text-shadow: 0 0 0 transparent; }
  50% { text-shadow: 0 0 20px rgba(0,0,0,0.1); }
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* 板块列表 */
.board-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.board-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--fg);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  background: white;
}

.board-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--fg);
  transition: var(--transition);
  z-index: 0;
}

.board-item:hover::before,
.board-item.active::before {
  left: 0;
}

.board-item:hover,
.board-item.active {
  color: var(--bg);
}

.board-name,
.board-count {
  position: relative;
  z-index: 1;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.board-count {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* 最新帖子 */
.latest-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.latest-item {
  padding: 0.75rem;
  border: 2px solid var(--fg);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  background: white;
}

.latest-item::before {
  content: '→';
  position: absolute;
  right: -2rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 900;
  transition: var(--transition);
}

.latest-item:hover {
  padding-right: 2.5rem;
  background: var(--fg);
  color: var(--bg);
}

.latest-item:hover::before {
  right: 0.75rem;
}

.latest-title {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.latest-meta {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* ========================================
   内容区
   ======================================== */
.content-area {
  min-width: 0;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: var(--border-width) solid var(--fg);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0;
}

.sort-buttons {
  display: flex;
  gap: 0.5rem;
}

.sort-btn {
  padding: 0.5rem 1rem;
  background: white;
  border: 2px solid var(--fg);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: var(--transition);
}

.sort-btn:hover,
.sort-btn.active {
  background: var(--fg);
  color: var(--bg);
}

/* 帖子网格 */
.thread-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.thread-card {
  background: white;
  border: var(--border-width) solid var(--fg);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  animation: cardEnter 0.5s ease forwards;
}

@keyframes cardEnter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.thread-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 40px 40px 0;
  border-color: transparent var(--fg) transparent transparent;
  transition: var(--transition);
}

.thread-card:hover {
  transform: translateY(-4px);
  box-shadow: 8px 8px 0 var(--fg);
}

.thread-card:hover::before {
  border-width: 0 50px 50px 0;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 0;
  flex: 1;
  min-width: 0;
}

.card-badges {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.badge {
  padding: 0.2rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 2px solid;
}

.badge-pinned {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.badge-hot {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.card-body {
  margin-bottom: 1rem;
}

.card-excerpt {
  font-size: 0.9rem;
  line-height: 1.5;
  opacity: 0.8;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 2px solid var(--fg);
  font-size: 0.8rem;
}

.card-meta {
  display: flex;
  gap: 0.75rem;
  opacity: 0.7;
}

.card-stats {
  display: flex;
  gap: 1rem;
  font-weight: 700;
}

/* 分页 */
.pagination-block {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-btn-block {
  min-width: 44px;
  height: 44px;
  padding: 0 0.75rem;
  background: white;
  border: 2px solid var(--fg);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn-block:hover:not(:disabled) {
  background: var(--fg);
  color: var(--bg);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--fg);
}

.page-btn-block.active {
  background: var(--fg);
  color: var(--bg);
}

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

/* ========================================
   帖子详情
   ======================================== */
.detail-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 1rem 2rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: white;
  border: 2px solid var(--fg);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 1rem;
  text-transform: uppercase;
  transition: var(--transition);
}

.back-btn:hover {
  background: var(--fg);
  color: var(--bg);
}

.post-content {
  background: white;
  border: var(--border-width) solid var(--fg);
}

.post-header {
  padding: 1.5rem;
  border-bottom: var(--border-width) solid var(--fg);
  background: var(--fg);
  color: var(--bg);
}

.post-title {
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1.3;
  margin: 0 0 1rem;
  text-transform: uppercase;
}

.post-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.post-author-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.post-author-avatar {
  width: 40px;
  height: 40px;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.2rem;
  animation: avatarRotate 10s linear infinite;
}

@keyframes avatarRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.post-author {
  font-weight: 700;
}

.post-role {
  font-size: 0.75rem;
  opacity: 0.7;
}

.post-time {
  font-size: 0.85rem;
  opacity: 0.7;
}

.post-body {
  padding: 1.5rem;
  font-size: 1rem;
  line-height: 1.8;
}

.post-body p {
  margin-bottom: 1rem;
}

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

.post-body img {
  max-width: 100%;
  height: auto;
  border: 2px solid var(--fg);
}

.post-body pre {
  background: var(--bg);
  color: var(--bg);
  padding: 1rem;
  overflow-x: auto;
  border: 2px solid var(--fg);
}

/* 附件 */
.attachments-section {
  padding: 1.5rem;
  border-top: var(--border-width) solid var(--fg);
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(0,0,0,0.02) 10px,
    rgba(0,0,0,0.02) 20px
  );
}

.attachments-title {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0 0 1rem;
}

/* 回复 */
.replies-section {
  padding: 1.5rem;
  border-top: var(--border-width) solid var(--fg);
}

.replies-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.replies-title {
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0;
}

.replies-count {
  font-size: 0.9rem;
  opacity: 0.7;
}

.replies-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.reply-item-block {
  padding: 1.25rem;
  border: 2px solid var(--fg);
  background: white;
  transition: var(--transition);
}

.reply-item-block:hover {
  transform: translateX(10px);
  box-shadow: -5px 0 0 var(--fg);
}

.reply-header-block {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.reply-author-block {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.reply-avatar {
  width: 32px;
  height: 32px;
  background: var(--fg);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.9rem;
}

.reply-content-block {
  font-size: 0.95rem;
  line-height: 1.7;
}

/* 回复表单 */
.reply-form-section {
  padding: 1.5rem;
  border-top: var(--border-width) solid var(--fg);
}

.reply-form-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.reply-textarea {
  width: 100%;
  min-height: 120px;
  padding: 1rem;
  border: 2px solid var(--fg);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  outline: none;
  transition: var(--transition);
}

.reply-textarea:focus {
  box-shadow: 4px 4px 0 var(--fg);
  transform: translate(-2px, -2px);
}

/* 操作栏 */
.action-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.action-block {
  background: white;
  border: var(--border-width) solid var(--fg);
  padding: 1rem;
}

.action-title {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--fg);
}

.action-btn-block {
  width: 100%;
  padding: 0.875rem;
  background: white;
  border: 2px solid var(--fg);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  position: relative;
  overflow: hidden;
}

.action-btn-block::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: var(--fg);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
  z-index: 0;
}

.action-btn-block:hover::before {
  width: 300px;
  height: 300px;
}

.action-btn-block:hover {
  color: var(--bg);
}

.action-btn-block span {
  position: relative;
  z-index: 1;
}

.action-btn-block.liked {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.action-count {
  font-weight: 900;
}

/* ========================================
   空状态
   ======================================== */
.empty-block {
  text-align: center;
  padding: 3rem;
  border: var(--border-width) dashed var(--fg);
  opacity: 0.5;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: emptyBounce 2s ease-in-out infinite;
}

@keyframes emptyBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.empty-text-block {
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ========================================
   悬浮按钮
   ======================================== */
.fab-block {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background: var(--fg);
  color: var(--bg);
  border: none;
  font-size: 1.75rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
  transition: var(--transition);
  z-index: 100;
  text-decoration: none;
}

.fab-block:hover {
  transform: rotate(90deg) scale(1.1);
  background: var(--accent);
  box-shadow: 6px 6px 0 rgba(0,0,0,0.3);
}

/* ========================================
   模态框
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-block {
  background: white;
  border: var(--border-width) solid var(--fg);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  border-bottom: var(--border-width) solid var(--fg);
}

.modal-tab {
  flex: 1;
  padding: 1rem;
  background: white;
  border: none;
  border-right: var(--border-width) solid var(--fg);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: var(--transition);
}

.modal-tab:last-child {
  border-right: none;
}

.modal-tab:hover {
  background: var(--bg);
}

.modal-tab.active {
  background: var(--fg);
  color: var(--bg);
}

.modal-body {
  padding: 1.5rem;
}

.modal-title-block {
  font-size: 1.5rem;
  font-weight: 900;
  text-transform: uppercase;
  margin: 0 0 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--fg);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.form-input:focus {
  box-shadow: 4px 4px 0 var(--fg);
  transform: translate(-2px, -2px);
}

.captcha-box {
  height: 60px;
  border: 2px solid var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  margin-bottom: 0.5rem;
}

.captcha-refresh {
  font-size: 0.8rem;
  color: var(--fg);
  cursor: pointer;
  text-decoration: underline;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.checkbox-label input {
  margin-top: 0.2rem;
}

.auth-feedback {
  padding: 0.875rem 1rem;
  border: 2px solid var(--fg);
  background: var(--bg);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  display: none;
}

.auth-feedback.error {
  background: #fee2e2;
  border-color: #dc2626;
}

.btn-block {
  width: 100%;
  padding: 1rem;
  background: var(--fg);
  color: var(--bg);
  border: 2px solid var(--fg);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: var(--transition);
}

.btn-block:hover {
  background: var(--bg);
  color: var(--fg);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--fg);
}

.btn-block-secondary {
  background: white;
  color: var(--fg);
}

.btn-block-secondary:hover {
  background: var(--fg);
  color: var(--bg);
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 1200px) {
  .main-container {
    grid-template-columns: 220px 1fr 220px;
  }
}

@media (max-width: 992px) {
  .main-container {
    grid-template-columns: 1fr;
    padding-top: 70px;
  }
  
  .left-sidebar,
  .right-sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .sidebar-block {
    height: 100%;
  }
  
  .detail-container {
    grid-template-columns: 1fr;
  }
  
  .action-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: var(--border-width) solid var(--fg);
    padding: 0.5rem;
    z-index: 100;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    box-sizing: border-box;
  }
  
  .action-sidebar .back-btn {
    display: none;
  }
  
  .action-grid {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 0.5rem;
  }
  
  .action-block {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.25rem;
    min-height: 56px;
  }
  
  .action-icon {
    font-size: 1.25rem;
  }
  
  .action-label {
    font-size: 0.65rem;
  }
  
  .action-count {
    font-size: 0.75rem;
    min-width: 18px;
    height: 18px;
    padding: 0 0.25rem;
  }
  
  .fab-block {
    bottom: 5rem;
  }
}

@media (max-width: 768px) {
  .navbar {
    height: 56px;
  }
  
  .nav-title {
    font-size: 1rem;
  }
  
  .search-box {
    display: none;
  }
  
  .main-container {
    padding: 66px 0.75rem 1.5rem;
  }
  
  .left-sidebar,
  .right-sidebar {
    grid-template-columns: 1fr;
  }
  
  .thread-grid {
    grid-template-columns: 1fr;
  }
  
  .thread-card {
    padding: 1rem;
  }
  
  .card-title {
    font-size: 1rem;
  }
  
  .content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .section-title {
    font-size: 1.25rem;
  }
  
  .post-title {
    font-size: 1.25rem;
  }
  
  .post-header,
  .post-body,
  .replies-section,
  .reply-form-section {
    padding: 1rem;
  }
  
  .action-sidebar {
    padding: 0.5rem;
  }
  
  .action-btn-block {
    padding: 0.75rem;
    font-size: 0.75rem;
  }
  
  .fab-block {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
    bottom: 4.5rem;
    right: 1rem;
  }
  
  .modal-block {
    max-height: 95vh;
  }
  
  .modal-body {
    padding: 1rem;
  }
  
  /* 移动端显示控制 */
  .desktop-only {
    display: none !important;
  }
  
  .mobile-only {
    display: flex !important;
  }
  
  .mobile-back {
    display: flex !important;
  }
}

@media (max-width: 480px) {
  .nav-brand {
    padding: 0 0.75rem;
  }
  
  .nav-icon {
    width: 32px;
    height: 32px;
  }
  
  .nav-title {
    font-size: 0.9rem;
    letter-spacing: 0.05em;
  }
  
  .user-menu-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .pagination-block {
    gap: 0.35rem;
  }
  
  .page-btn-block {
    min-width: 40px;
    height: 40px;
    font-size: 0.85rem;
  }
  
  /* 小屏手机优化 */
  .main-container {
    padding: 60px 0.5rem 1rem;
  }
  
  .thread-card {
    padding: 0.875rem;
    border-width: 2px;
  }
  
  .card-title {
    font-size: 0.95rem;
    line-height: 1.4;
  }
  
  .card-excerpt {
    font-size: 0.8rem;
    -webkit-line-clamp: 2;
  }
  
  .card-footer {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
  
  .card-meta {
    font-size: 0.75rem;
  }
  
  .card-stats {
    font-size: 0.75rem;
  }
  
  .section-title {
    font-size: 1.1rem;
  }
  
  .sort-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
  }
  
  .sidebar-block {
    border-width: 2px;
  }
  
  .block-header {
    padding: 0.6rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .board-item {
    padding: 0.5rem 0.75rem;
    border-width: 2px;
  }
  
  .latest-item {
    padding: 0.75rem;
  }
  
  .latest-title {
    font-size: 0.85rem;
  }
  
  /* 底部操作栏优化 */
  .mobile-action-bar {
    padding: 0.4rem 0.5rem;
    gap: 0.25rem;
  }
  
  .mobile-action-btn {
    padding: 0.35rem 0.25rem;
    min-width: 56px;
  }
  
  .mobile-action-btn svg {
    width: 20px;
    height: 20px;
  }
  
  .mobile-action-btn span {
    font-size: 0.65rem;
  }
  
  /* 模态框优化 */
  .modal-block {
    width: calc(100% - 1rem);
    margin: 0.5rem;
    border-width: 2px;
  }
  
  .tab-btn {
    padding: 0.75rem;
    font-size: 0.85rem;
  }
  
  .form-input-block {
    padding: 0.75rem;
    font-size: 16px; /* 防止iOS缩放 */
  }
  
  /* 详情页优化 */
  .post-header-card {
    padding: 1rem;
    border-width: 2px;
  }
  
  .post-title-main {
    font-size: 1.1rem;
  }
  
  .post-category-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }
  
  .post-meta-row {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .post-content-wrapper {
    padding: 1rem;
  }
  
  .post-content-main {
    font-size: 0.95rem;
  }
  
  .action-btn-main {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
  
  .action-btn-main svg {
    width: 18px;
    height: 18px;
  }
  
  .comments-section {
    padding: 1rem;
  }
  
  .comments-title {
    font-size: 1rem;
  }
  
  .comment-input-section {
    padding: 1rem;
    margin: 0 -0.5rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .comment-textarea {
    min-height: 80px;
    font-size: 16px;
  }
  
  .btn-submit-comment {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
  
  /* 悬浮按钮优化 */
  .fab-block {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
    bottom: 4rem;
    right: 0.75rem;
    border-width: 2px;
  }
}

/* ========================================
   评论输入框优化
   ======================================== */
.comment-input-section {
  background: white;
  border: var(--border-width) solid var(--fg);
  padding: 1.5rem;
  margin-top: 2rem;
}

.comment-input-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.author-avatar-small {
  width: 36px;
  height: 36px;
  background: var(--fg);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.9rem;
}

.comment-input-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.comment-input-title {
  font-weight: 800;
  font-size: 1rem;
}

.comment-input-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.comment-textarea-wrapper {
  position: relative;
  border: 2px solid var(--fg);
  transition: var(--transition);
}

.comment-textarea-wrapper:focus-within {
  box-shadow: 4px 4px 0 var(--fg);
  transform: translate(-2px, -2px);
}

.comment-textarea {
  width: 100%;
  min-height: 100px;
  padding: 1rem;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  outline: none;
  line-height: 1.6;
}

.comment-toolbar {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg);
  border-top: 2px solid var(--fg);
}

.toolbar-btn {
  width: 36px;
  height: 36px;
  background: white;
  border: 2px solid var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.toolbar-btn:hover {
  background: var(--fg);
  color: var(--bg);
  transform: translateY(-2px);
}

.toolbar-btn svg {
  width: 16px;
  height: 16px;
}

.comment-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.comment-char-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

.comment-actions-right {
  display: flex;
  gap: 0.75rem;
}

.btn-comment-secondary {
  padding: 0.75rem 1.25rem;
  background: white;
  border: 2px solid var(--fg);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-comment-secondary:hover {
  background: var(--fg);
  color: var(--bg);
}

.btn-submit-comment {
  padding: 0.75rem 1.5rem;
  background: var(--fg);
  color: var(--bg);
  border: 2px solid var(--fg);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-submit-comment:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
}

.btn-submit-comment svg {
  width: 16px;
  height: 16px;
}

/* ========================================
   底部备案信息
   ======================================== */
.site-footer-block {
  background: var(--fg);
  color: var(--bg);
  padding: 2rem 1rem;
  margin-top: 3rem;
  border-top: var(--border-width) solid var(--fg);
}

.footer-content {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--bg);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  position: relative;
}

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.footer-links a:hover::after {
  width: 100%;
}

.footer-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.8rem;
  opacity: 0.8;
}

.footer-divider {
  opacity: 0.5;
}

.footer-info a {
  color: var(--bg);
  text-decoration: none;
  transition: var(--transition);
}

.footer-info a:hover {
  color: var(--accent);
}

/* 移动端底部优化 */
@media (max-width: 768px) {
  .site-footer-block {
    padding: 1.5rem 1rem;
    margin-bottom: 60px; /* 为底部操作栏留出空间 */
  }
  
  .footer-links {
    gap: 1rem;
  }
  
  .footer-links a {
    font-size: 0.85rem;
  }
  
  .footer-info {
    font-size: 0.75rem;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .footer-divider {
    display: none;
  }
  
  /* 移动端评论输入框优化 */
  .comment-input-section {
    padding: 1rem;
    margin: 0 -0.5rem;
    border-left: none;
    border-right: none;
  }
  
  .comment-input-header {
    margin-bottom: 0.75rem;
  }
  
  .author-avatar-small {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
  
  .comment-input-title {
    font-size: 0.95rem;
  }
  
  .comment-input-hint {
    font-size: 0.7rem;
  }
  
  .comment-textarea {
    min-height: 80px;
    padding: 0.75rem;
    font-size: 16px; /* 防止iOS缩放 */
  }
  
  .comment-toolbar {
    padding: 0.35rem;
    gap: 0.35rem;
  }
  
  .toolbar-btn {
    width: 32px;
    height: 32px;
  }
  
  .toolbar-btn svg {
    width: 14px;
    height: 14px;
  }
  
  .comment-form-actions {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  
  .comment-char-count {
    font-size: 0.75rem;
    text-align: center;
  }
  
  .comment-actions-right {
    justify-content: center;
  }
  
  .btn-comment-secondary,
  .btn-submit-comment {
    flex: 1;
    justify-content: center;
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
  }
}
