:root {
  --pw-red: #c8161d;
  --pw-red-dark: #a01218;
  --pw-black: #1a1a1a;
  --pw-nav: #2b2b2b;
  --dz-link: #1e6bb8;
  --dz-link-hover: #c8161d;
  --dz-text: #333;
  --dz-muted: #999;
  --dz-border: #e0e0e0;
  --dz-border-light: #eee;
  --dz-bg: #f2f2f2;
  --dz-card: #fff;
  --dz-head-bg: #ececec;
  --font-sans: 'Microsoft YaHei', 'PingFang SC', Tahoma, 'Segoe UI', Arial, sans-serif;
  --max-width: 1200px;
  --color-primary: var(--pw-red);
  --color-muted: var(--dz-muted);
  --color-border: var(--dz-border);
  --color-card: var(--dz-card);
  --color-hot: var(--pw-red);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-sans); color: var(--dz-text); background: var(--dz-bg); line-height: 1.5; font-size: 12px; }
a { color: var(--dz-link); text-decoration: none; }
a:hover { color: var(--dz-link-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--dz-bg);
}

#main-content {
  flex: 1;
}

.dz-wrap { width: var(--max-width); max-width: 100%; margin: 0 auto; padding: 0 10px; }
.btn { padding: 8px 18px; border: none; background: var(--pw-red); color: #fff; font-size: 13px; font-weight: bold; border-radius: 3px; cursor: pointer; }
.btn:hover { background: var(--pw-red-dark); color: #fff; text-decoration: none; }
.input-light { width: 100%; padding: 8px 10px; border: 1px solid var(--dz-border); background: #fff; color: var(--dz-text); font-size: 13px; font-family: inherit; border-radius: 3px; }
.input-light:focus { outline: none; border-color: var(--pw-red); }

/* Header */
.forum-header { background: var(--pw-black); }
.top-bar { background: #000; border-bottom: 1px solid #333; }
.top-inner { display: flex; align-items: center; height: 40px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-logo { font-size: 13px; font-weight: bold; color: #fff; white-space: nowrap; }
.brand-logo:hover { color: #fff; text-decoration: underline; }
.brand-b { padding-left: 12px; border-left: 1px solid #444; color: #ccc; font-weight: normal; }
.top-links { display: flex; flex: 1; flex-wrap: wrap; gap: 4px 18px; }
.top-links a { color: #ccc; font-size: 12px; white-space: nowrap; }
.top-links a:hover, .top-links a.active { color: #fff; text-decoration: none; }
.top-links a.active { font-weight: bold; }
.top-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.user-name { color: #aaa; font-size: 12px; }
.logout-form { margin: 0; }
.btn-outline { padding: 4px 14px; border: 1px solid #666; border-radius: 14px; background: transparent; color: #fff; font-size: 12px; cursor: pointer; }
.btn-outline:hover { border-color: #fff; color: #fff; text-decoration: none; }
.btn-login { display: inline-flex; align-items: center; }
.hero-banner { position: relative; width: 100%; overflow: hidden; background: #f5c6cb; }
.banner-img { width: 100%; height: 200px; object-fit: cover; }
.banner-overlay { position: absolute; inset: 0; display: flex; align-items: center; pointer-events: none; }
.banner-title { font-size: 36px; font-weight: bold; color: rgba(80, 40, 50, 0.35); letter-spacing: 4px; }
.sub-nav { background: var(--pw-nav); border-bottom: 3px solid var(--pw-red); }
.sub-inner { display: flex; align-items: stretch; justify-content: space-between; min-height: 42px; }
.nav-tabs { display: flex; flex-wrap: wrap; align-items: stretch; }
.tab { display: flex; align-items: center; padding: 0 18px; color: #ccc; font-size: 13px; white-space: nowrap; }
.tab:hover { color: #fff; background: rgba(255,255,255,0.06); text-decoration: none; }
.tab.active { background: var(--pw-red); color: #fff; font-weight: bold; }
.nav-tools { display: flex; align-items: center; margin-left: auto; }
.search-box { display: flex; align-items: center; height: 32px; margin: 5px 0; background: #1a1a1a; border: 1px solid #444; }
.search-type { height: 100%; padding: 0 8px; background: #1a1a1a; color: #aaa; border: none; border-right: 1px solid #444; font-size: 12px; }
.search-input { width: 160px; height: 100%; padding: 0 10px; border: none; background: transparent; color: #fff; font-size: 12px; }
.search-input:focus { outline: none; }
.btn-icon { width: 36px; height: 100%; border: none; border-left: 1px solid #444; background: transparent; color: #aaa; cursor: pointer; font-size: 16px; }

/* Footer */
.forum-footer { margin-top: 8px; padding: 16px 0; background: #fff; border-top: 1px solid var(--dz-border); text-align: center; font-size: 12px; color: var(--dz-muted); }
.forum-footer p { margin: 4px 0; }
.pipe { margin: 0 8px; color: #ddd; }

/* Home */
.forum-home { padding: 0 0 20px; background: var(--dz-bg); }
.home-inner { padding-top: 0; }
.empty-hint { text-align: center; color: var(--dz-muted); padding: 24px; margin-top: 10px; background: var(--dz-card); border: 1px solid var(--dz-border); }
.error-hint { color: var(--pw-red); }
.home-meta-wrap { margin-bottom: 10px; background: var(--dz-card); border: 1px solid var(--dz-border); }
.home-meta { display: flex; align-items: flex-start; justify-content: space-between; padding: 10px 14px 8px; gap: 12px; }
.meta-left { flex: 1; min-width: 0; }
.breadcrumb, .breadcrumb-simple { margin: 0 0 6px; font-size: 12px; color: var(--dz-muted); }
.breadcrumb a, .breadcrumb-simple a { color: var(--dz-link); }
.breadcrumb a:hover, .breadcrumb-simple a:hover { color: var(--pw-red); }
.breadcrumb-simple span { margin: 0 6px; color: #ccc; }
.home-icon { color: var(--dz-link); font-size: 14px; text-decoration: none; }
.home-icon:hover { color: var(--pw-red); text-decoration: none; }
.sep { margin: 0 6px; color: #ccc; }
.stats-line { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 12px; color: #5a8ab8; }
.stat-item { display: inline-flex; align-items: center; gap: 4px; }
.stat-ico { font-style: normal; font-size: 8px; color: #7ab; }
.stats-line em { font-style: normal; font-weight: bold; color: #3a6a9a; }
.latest-toggle { flex-shrink: 0; }
.latest-toggle summary { list-style: none; cursor: pointer; color: var(--dz-link); font-size: 12px; white-space: nowrap; }
.latest-toggle summary::-webkit-details-marker { display: none; }
.latest-link { color: var(--dz-link); }
.chevron { display: inline-block; font-size: 10px; margin-left: 2px; }
.latest-panel { padding: 8px 14px 12px; border-top: 1px dashed var(--dz-border-light); background: #fafafa; }
.reply-list { list-style: none; margin: 0; padding: 0; }
.reply-list li { padding: 5px 0; border-bottom: 1px dashed #e8e8e8; font-size: 12px; }
.reply-list .meta { color: var(--dz-muted); }
.home-latest { margin-bottom: 12px; background: var(--dz-card); border: 1px solid var(--dz-border); }
.latest-head { height: 36px; padding: 0 14px; display: flex; align-items: center; background: var(--dz-head-bg); border-bottom: 1px solid var(--dz-border); }
.latest-head h2 { margin: 0; font-size: 14px; font-weight: bold; color: #444; }
.latest-list { list-style: none; margin: 0; padding: 8px 14px 12px; }
.latest-list li { padding: 8px 0; border-bottom: 1px dashed var(--dz-border-light); }
.latest-list .title { display: block; font-size: 13px; font-weight: bold; margin-bottom: 4px; color: var(--dz-link); }
.latest-list .title:hover { color: var(--pw-red); text-decoration: none; }
.latest-list .meta { font-size: 11px; color: var(--dz-muted); }
.board-group { margin-bottom: 12px; background: var(--dz-card); border: 1px solid var(--dz-border); }
.group-header { display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 0 14px; background: var(--dz-head-bg); border-bottom: 1px solid var(--dz-border); }
.group-title { margin: 0; font-size: 14px; font-weight: bold; color: #444; }
.group-body { background: #fff; }
.board-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.board-cell { display: flex; gap: 10px; padding: 12px 14px; min-height: 92px; min-width: 0; background: #fff; border-right: 1px solid var(--dz-border-light); border-bottom: 1px dashed #ddd; overflow: hidden; }
.cell-body { flex: 1; min-width: 0; padding-top: 4px; }
.icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 6px;
  border: 1px solid var(--dz-border-light);
  overflow: hidden;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.icon-box-hero {
  width: 88px;
  height: 88px;
  border-radius: 8px;
}

.icon-thumb-0 { background: linear-gradient(135deg, #4a6fa5, #2d4a6f); }
.icon-thumb-1 { background: linear-gradient(135deg, #c45c26, #8b3a1a); }
.icon-thumb-2 { background: linear-gradient(135deg, #3d8b6e, #245a45); }
.icon-thumb-3 { background: linear-gradient(135deg, #7b4b9a, #4e2d63); }
.icon-thumb-4 { background: linear-gradient(135deg, #b83b4a, #7a2230); }

.icon-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.icon-txt {
  display: block;
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  line-height: 1;
  text-transform: uppercase;
}

.icon-box-hero .icon-txt {
  font-size: 28px;
}
.cell-title { margin: 0 0 6px; font-size: 14px; font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-title a { color: #222; text-decoration: none; }
.cell-title a:hover { color: var(--pw-red); text-decoration: underline; }
.badge-new { color: var(--pw-red); font-weight: normal; margin-left: 4px; }
.cell-stats, .cell-last { margin: 0 0 6px; font-size: 12px; color: #999; }
.last-label { color: #999; margin-right: 4px; }
.last-title { display: block; color: #666; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.last-title:hover { color: var(--pw-red); }
.last-time { display: block; font-size: 11px; color: #aaa; margin-top: 2px; }
.muted { color: #ccc; }

/* Board page */
.board-page, .thread-page, .static-page { padding: 0 0 24px; background: var(--dz-bg); }
.page-meta { margin-bottom: 10px; background: var(--dz-card); border: 1px solid var(--dz-border); padding: 10px 14px; }
.current { color: #666; }
.board-hero { display: flex; align-items: flex-start; gap: 16px; padding: 18px 20px; margin-bottom: 12px; background: var(--dz-card); border: 1px solid var(--dz-border); }
.board-hero .icon-box { width: 88px; height: 88px; border-radius: 8px; }
.hero-icon { flex-shrink: 0; }
.hero-body { flex: 1; min-width: 0; padding-top: 4px; }
.hero-title, .thread-title { margin: 0 0 8px; font-size: 18px; font-weight: bold; color: #222; line-height: 1.35; }
.hero-desc { margin: 0 0 10px; font-size: 12px; color: #888; }
.hero-stats, .thread-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 12px; color: #5a8ab8; }
.hero-stats em { font-style: normal; font-weight: bold; color: #3a6a9a; }
.hero-stats .today { color: var(--pw-red); font-weight: bold; }
.btn-post { display: inline-block; padding: 8px 18px; background: var(--pw-red); color: #fff; font-size: 13px; font-weight: bold; border-radius: 3px; }
.btn-post:hover { background: var(--pw-red-dark); color: #fff; text-decoration: none; }
.thread-panel, .posts-panel, .reply-panel, .content-panel { background: var(--dz-card); border: 1px solid var(--dz-border); overflow: hidden; margin-bottom: 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 0 14px; background: var(--dz-head-bg); border-bottom: 1px solid var(--dz-border); }
.panel-head h1, .panel-head h2 { margin: 0; font-size: 14px; font-weight: bold; color: #444; }
.panel-count { font-size: 12px; color: var(--dz-muted); }
.thread-table-wrap { overflow-x: auto; }
.thread-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.thread-table thead th { padding: 10px 12px; text-align: left; font-weight: bold; color: #666; background: #fafafa; border-bottom: 1px solid var(--dz-border); }
.thread-row td { padding: 12px; border-bottom: 1px dashed var(--dz-border-light); vertical-align: middle; }
.thread-row:hover td { background: #fafcff; }
.col-title { min-width: 200px; }
.col-author { width: 100px; color: #666; }
.col-num { width: 72px; text-align: center; color: #888; }
.col-last { width: 150px; font-size: 11px; }
.title-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.thread-link { font-size: 13px; font-weight: bold; color: var(--dz-link); line-height: 1.4; }
.badge { display: inline-block; padding: 1px 6px; font-size: 10px; border-radius: 2px; white-space: nowrap; }
.badge-top { background: var(--pw-red); color: #fff; }
.badge-hot { background: #ff9800; color: #fff; }
.badge-lock { background: #999; color: #fff; }
.last-poster { display: block; color: #666; margin-bottom: 2px; }
.last-time { display: block; color: #aaa; }
.empty { text-align: center; color: var(--dz-muted); padding: 32px 16px !important; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 12px 14px; border-top: 1px solid var(--dz-border); background: #fafafa; }
.pager-btn { padding: 6px 14px; border: 1px solid var(--dz-border); background: #fff; color: var(--dz-link); font-size: 12px; border-radius: 3px; }
.pager-btn.disabled { opacity: 0.45; pointer-events: none; }
.pager-info { font-size: 12px; color: var(--dz-muted); }

/* Thread page */
.thread-hero { padding: 16px 20px; margin-bottom: 12px; background: var(--dz-card); border: 1px solid var(--dz-border); }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.btn-back { flex-shrink: 0; padding: 6px 14px; border: 1px solid var(--dz-border); background: #fafafa; color: var(--dz-link); font-size: 12px; border-radius: 3px; }
.thread-meta .dot { margin: 0 8px; color: #ccc; }
.post-card { display: flex; border-bottom: 1px dashed var(--dz-border-light); }
.post-card.is-op { background: #fffdf8; }
.post-side { width: 130px; flex-shrink: 0; padding: 16px 12px; background: #f8f8f8; border-right: 1px solid var(--dz-border-light); text-align: center; }
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 8px;
  border-radius: 8px;
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.author { display: block; font-size: 13px; color: var(--dz-link); margin-bottom: 4px; word-break: break-word; }
.role-tag { display: inline-block; padding: 1px 6px; margin-bottom: 6px; font-size: 10px; background: var(--pw-red); color: #fff; border-radius: 2px; }
.floor { display: block; font-size: 11px; color: var(--dz-muted); }
.post-body { flex: 1; min-width: 0; padding: 16px 20px; }
.post-content { font-size: 13px; line-height: 1.75; color: #333; word-break: break-word; }
.post-content p { margin: 0 0 10px; }
.post-content p:last-child { margin-bottom: 0; }
.post-content ul, .post-content ol { margin: 0 0 10px; padding-left: 22px; }
.post-content h3, .post-content h4 { margin: 12px 0 8px; font-size: 14px; color: #222; }
.post-content strong { color: #222; }
.post-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 10px; border-top: 1px dashed var(--dz-border-light); font-size: 11px; color: var(--dz-muted); }
.floor-link { color: var(--dz-muted); text-decoration: none; }
.floor-link:hover { color: var(--pw-red); }
.empty-posts { text-align: center; color: var(--dz-muted); padding: 32px 16px; margin: 0; }
.reply-body { padding: 16px 20px; }
.reply-area { width: 100%; padding: 10px 12px; border: 1px solid var(--dz-border); font-size: 13px; font-family: inherit; line-height: 1.6; resize: vertical; min-height: 120px; border-radius: 3px; }
.reply-area:focus { outline: none; border-color: var(--pw-red); }
.reply-actions { margin-top: 12px; display: flex; justify-content: flex-end; }
.btn-submit { padding: 8px 22px; border: none; background: var(--pw-red); color: #fff; font-size: 13px; font-weight: bold; border-radius: 3px; cursor: pointer; }
.login-prompt { text-align: center; padding: 20px; font-size: 13px; color: var(--dz-muted); }
.locked-hint { text-align: center; padding: 20px; margin: 0; background: var(--dz-card); border: 1px solid var(--dz-border); color: var(--dz-muted); }

/* Search / login / static / 404 */
.search-page { padding-top: 20px; padding-bottom: 24px; }
.search-page h1 { font-size: 1.1rem; margin: 0 0 12px; }
.search-form { display: flex; gap: 8px; max-width: 480px; margin-bottom: 20px; }
.hint { color: var(--dz-muted); font-size: 13px; }
.results { list-style: none; margin: 0; padding: 0; background: var(--dz-card); border: 1px solid var(--dz-border); border-radius: 4px; }
.results li { padding: 12px 14px; border-bottom: 1px solid var(--dz-border); display: flex; justify-content: space-between; gap: 12px; }
.results li.empty { justify-content: center; color: var(--dz-muted); }
.results .meta { font-size: 12px; color: var(--dz-muted); flex-shrink: 0; }
.login-page { display: flex; justify-content: center; padding: 40px 16px; }
.login-card { width: 100%; max-width: 400px; padding: 24px; background: var(--dz-card); border: 1px solid var(--dz-border); }
.login-card h1 { margin: 0 0 8px; font-size: 1.2rem; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; margin-bottom: 6px; font-size: 13px; font-weight: bold; }
.error { color: var(--pw-red); font-size: 13px; }
.new-thread { padding-top: 16px; padding-bottom: 24px; max-width: 800px; }
.form-card { background: var(--dz-card); border: 1px solid var(--dz-border); border-radius: 4px; padding: 20px; }
.content-area { resize: vertical; min-height: 200px; }
.form-actions { display: flex; gap: 12px; align-items: center; }
.btn-cancel { color: var(--dz-muted); font-size: 13px; }
.panel-body { padding: 20px; font-size: 13px; line-height: 1.75; color: #444; }
.panel-body p { margin: 0 0 12px; }
.panel-body ul { margin: 0 0 12px; padding-left: 20px; }
.panel-body a { color: var(--dz-link); }
.panel-body a:hover { color: var(--pw-red); }
.footer-inner .links a { color: var(--dz-muted); }
.footer-inner .links a:hover { color: var(--pw-red); }
.error-panel { text-align: center; padding: 40px 20px; background: var(--dz-card); border: 1px solid var(--dz-border); margin: 20px auto; }

@media (max-width: 960px) {
  .board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-cell:nth-child(2n) { border-right: none; }
}

@media (max-width: 900px) {
  .top-links { display: none; }
  .search-input { width: 100px; }
  .banner-title { font-size: 22px; }
  .board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .board-grid { grid-template-columns: minmax(0, 1fr); }
  .board-cell { border-right: none; }
  .board-hero { flex-wrap: wrap; }
  .hero-actions { width: 100%; padding-top: 0; }
  .post-card { flex-direction: column; }
  .post-side { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; border-right: none; border-bottom: 1px solid var(--dz-border-light); }
  .avatar { width: 40px; height: 40px; margin-bottom: 0; font-size: 16px; }
}
