* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: #0a0e17;
  color: #c8ccd4;
  font-size: 14px;
  line-height: 1.6;
}

canvas { display: block; vertical-align: bottom; }

#tsparticles {
  position: fixed;
  width: 100%;
  height: 100%;
  background: #0a0e17;
  z-index: -1;
}

a { color: #8b9dc3; text-decoration: none; transition: color .2s; }
a:hover { color: #c5d5f0; }

/* ===== 顶部条 ===== */
.top-bar {
  background: rgba(12, 16, 28, 0.95);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
}
.top-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-links a, .top-user a { color: #6b7280; margin-right: 12px; }
.top-links a:hover, .top-user a:hover { color: #9ca3af; }
.top-user em { color: #f59e0b; font-style: normal; }
.top-user { display: flex; align-items: center; gap: 12px; }
.top-user span { display: flex; align-items: center; gap: 12px; }
.login-btn { color: #60a5fa !important; }
.reg-btn { color: #34d399 !important; }

/* 顶部导航链接按钮 */
.top-nav-links {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.top-nav-links .nav-link-btn {
  padding: 4px 14px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff !important;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
  border: none;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
.top-nav-links .nav-link-btn:hover {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
}
.top-nav-links .nav-link-btn.nav-qq {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}
.top-nav-links .nav-link-btn.nav-qq:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.5);
}

/* ===== 主头部 ===== */
.main-header {
  background: rgba(12, 16, 28, 0.9);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 30px;
}
.logo {
  font-size: 28px;
  font-weight: 700;
  color: #e5e7eb;
  letter-spacing: 2px;
}
.logo-desc {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}
.header-search {
  flex: 1;
  max-width: 400px;
  display: flex;
}
.header-search input {
  flex: 1;
  padding: 8px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-right: none;
  border-radius: 4px 0 0 4px;
  color: #e5e7eb;
  font-size: 13px;
  outline: none;
}
.header-search input:focus { border-color: #3b82f6; }
.header-search input::placeholder { color: #4b5563; }
.header-search button {
  padding: 8px 18px;
  background: #1e40af;
  color: #fff;
  border: 1px solid #1e40af;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 13px;
}
.header-search button:hover { background: #1d4ed8; }
.btn-publish {
  padding: 9px 22px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.btn-publish:hover { opacity: 0.9; }

/* ===== 导航栏 ===== */
.main-nav {
  background: rgba(15, 20, 35, 0.95);
  border-bottom: 2px solid #1e40af;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
}
.nav-item {
  padding: 12px 20px;
  color: #9ca3af;
  font-size: 14px;
  position: relative;
}
.nav-item:hover { color: #e5e7eb; }
.nav-item.active {
  color: #60a5fa;
}
.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #3b82f6;
}

.nav-links {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-link-btn {
  padding: 6px 14px;
  color: #9ca3af;
  font-size: 13px;
  border: 1px solid #374151;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-link-btn:hover {
  color: #60a5fa;
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.nav-link-btn.nav-qq {
  background: #1e3a5f;
  border-color: #3b82f6;
  color: #60a5fa;
}

.nav-link-btn.nav-qq:hover {
  background: #2563eb;
  color: #fff;
}

/* ===== 主体布局 ===== */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  gap: 16px;
}
.content-area { flex: 1; min-width: 0; }
.sidebar { width: 280px; flex-shrink: 0; }

/* ===== 公告栏 ===== */
.notice-bar {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #d4a843;
}
.notice-icon { margin-right: 6px; }

/* ===== 广告位 ===== */
.ad-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}
.ad-container {
  width: 100%;
  background: rgba(15, 20, 35, 0.8);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 14px;
}
.ad-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}
.ad-row:last-child { margin-bottom: 0; }
.ad-item {
  border-radius: 4px;
  overflow: hidden;
  background: rgba(0,0,0,0.3);
  transition: transform 0.2s;
}
.ad-item:hover { transform: scale(1.01); }
.ad-item a { display: block; }
.ad-item img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}
.ad-item .ad-title {
  padding: 6px 10px;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
}

/* ===== 板块标签 ===== */
.board-header {
  background: rgba(15, 20, 35, 0.8);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.board-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab-btn {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 3px;
  color: #9ca3af;
  cursor: pointer;
  font-size: 13px;
  transition: all .2s;
}
.tab-btn:hover { border-color: #3b82f6; color: #60a5fa; }
.tab-btn.active {
  background: #1e40af;
  border-color: #1e40af;
  color: #fff;
}

/* ===== 帖子列表头部 ===== */
.post-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  margin-bottom: 6px;
  font-size: 13px;
  color: #6b7280;
}
.post-count em { color: #f59e0b; font-style: normal; }
.sort-options { display: flex; gap: 14px; }
.sort-btn { cursor: pointer; color: #6b7280; }
.sort-btn:hover, .sort-btn.active { color: #60a5fa; }

/* ===== 帖子列表 ===== */
.post-list { display: flex; flex-direction: column; gap: 8px; }

.post-item {
  background: rgba(15, 20, 35, 0.8);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all .2s;
}
.post-item:hover {
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(20, 28, 50, 0.9);
}

.post-item-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.post-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  flex-shrink: 0;
}
.post-tag.dev { background: #059669; }
.post-tag.agent { background: #d97706; }
.post-tag.expert { background: #7c3aed; }
.post-tag.designer { background: #2563eb; }
.post-tag.service { background: #0891b2; }
.post-tag.resource { background: #dc2626; }

.post-tag-top {
  display: inline-block;
  padding: 2px 6px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  border-radius: 2px;
  flex-shrink: 0;
}
.post-tag-new {
  display: inline-block;
  padding: 2px 6px;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  border-radius: 2px;
  flex-shrink: 0;
}

.post-title-text {
  font-size: 15px;
  color: #e5e7eb;
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-item:hover .post-title-text { color: #60a5fa; }

.post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: #6b7280;
}
.post-meta span { display: flex; align-items: center; gap: 4px; }
.post-meta .author { color: #8b9dc3; }

/* ===== 分页 ===== */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 20px 0 10px;
  justify-content: center;
}
.page-btn {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  background: rgba(15, 20, 35, 0.8);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 3px;
  color: #9ca3af;
  font-size: 13px;
}
.page-btn:hover { border-color: #3b82f6; color: #60a5fa; }
.page-btn.active {
  background: #1e40af;
  border-color: #1e40af;
  color: #fff;
}
.page-ellipsis { color: #4b5563; padding: 0 4px; }

/* ===== 侧边栏 ===== */
.sidebar-box {
  background: rgba(15, 20, 35, 0.8);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  margin-bottom: 14px;
  overflow: hidden;
}
.sidebar-title {
  padding: 12px 14px;
  font-size: 14px;
  color: #e5e7eb;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(20, 28, 50, 0.6);
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px;
}
.stat-item {
  text-align: center;
  padding: 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
}
.stat-num {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: #f59e0b;
}
.stat-label { font-size: 12px; color: #6b7280; }

.hot-list { list-style: none; padding: 8px 14px 14px; }
.hot-list li { margin-bottom: 8px; }
.hot-list li:last-child { margin-bottom: 0; }
.hot-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #9ca3af;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hot-list a:hover { color: #60a5fa; }
.hot-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #4b5563;
  color: #fff;
  font-size: 11px;
  border-radius: 2px;
  flex-shrink: 0;
}
.rank1 { background: #dc2626; }
.rank2 { background: #ea580c; }
.rank3 { background: #d97706; }

.active-users { padding: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.user-tag {
  padding: 4px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 3px;
  font-size: 12px;
  color: #9ca3af;
}

.friend-links { padding: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.friend-links a {
  padding: 4px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 3px;
  font-size: 12px;
  color: #6b7280;
}
.friend-links a:hover { color: #60a5fa; border-color: rgba(59,130,246,0.3); }

/* ===== 底部 ===== */
.footer {
  text-align: center;
  padding: 30px 16px;
  color: #4b5563;
  font-size: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 20px;
}
.footer p { margin-bottom: 4px; }

/* ===== 弹窗 ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.75);
  animation: fadeIn .2s;
}
.modal.show {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 16px;
  overflow-y: auto;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 24px;
  width: 100%;
  max-width: 520px;
  position: relative;
  animation: slideDown .25s;
}
@keyframes slideDown { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-close {
  position: absolute;
  right: 16px; top: 12px;
  font-size: 22px;
  cursor: pointer;
  color: #6b7280;
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.modal-close:hover { background: rgba(255,255,255,0.1); color: #e5e7eb; }

.modal-content h2 {
  font-size: 18px;
  color: #e5e7eb;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #9ca3af;
}
.required { color: #ef4444; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  color: #e5e7eb;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: #3b82f6; }
.form-group input::placeholder,
.form-group textarea::placeholder { color: #4b5563; }
.form-group select option { background: #111827; }
.input-tip { font-size: 12px; color: #4b5563; margin-top: 4px; display: block; }
.link { color: #60a5fa; }

/* 图片上传 */
.upload-area {
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}
.upload-area:hover { border-color: rgba(59,130,246,0.5); }
#uploadPlaceholder span { color: #64748b; font-size: 14px; }
#uploadPreview { position: relative; display: inline-block; }
#uploadPreview img { max-width: 200px; max-height: 150px; border-radius: 4px; }
.btn-remove-img {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.btn-submit {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}
.btn-submit:hover { opacity: 0.9; }

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: #4b5563;
  background: rgba(15, 20, 35, 0.8);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .header-inner { flex-wrap: wrap; gap: 12px; }
  .header-search { order: 3; max-width: 100%; flex: 1 1 100%; }
  .logo-area { flex: 1; }
}
@media (max-width: 600px) {
  .top-bar { display: none; }
  .main-header { padding: 12px 0; }
  .header-inner { padding: 12px; }
  .logo { font-size: 22px; }
  .nav-inner { overflow-x: auto; }
  .nav-item { padding: 10px 14px; white-space: nowrap; }
  .board-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tab-btn { white-space: nowrap; }
  .post-item { padding: 12px; }
  .post-title-text { font-size: 14px; }
}
