/* ============================================================
   传奇发布网 xcfw.18183game-s.com.cn
   热血门户风：暗底 + 热血红/金色，经典三栏，移动优先
   ============================================================ */

:root {
  --bg: #0d0d10;
  --bg-soft: #121216;
  --panel: #17171c;
  --panel-2: #1d1d24;
  --line: #2b2b33;
  --line-soft: #232329;
  --text: #d8d8df;
  --dim: #9696a1;
  --head: #f2f2f6;
  --red: #e0362c;
  --red-dark: #a51f18;
  --red-glow: #ff4d40;
  --gold: #d9a441;
  --gold-dim: #b98a33;
  --ok: #4caf7d;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "SimHei", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--head); text-decoration: none; }
a:hover { color: var(--gold); }
img { max-width: 100%; }

.wrap {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 12px;
}

/* ---------- 顶部 ---------- */
.topbar {
  background: linear-gradient(180deg, #1a0f0e 0%, #160d0c 100%);
  border-bottom: 3px solid var(--red);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--red), var(--red-dark));
  border-radius: 8px;
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(224, 54, 44, .35);
}
.logo-text { line-height: 1.25; }
.logo-text h1 { font-size: 22px; color: var(--gold); font-weight: 700; letter-spacing: 1px; }
.logo-text p { font-size: 12px; color: var(--dim); }
.top-tools { font-size: 13px; color: var(--dim); text-align: right; }
.top-tools .live { color: var(--red-glow); font-weight: 700; }

/* ---------- 导航 ---------- */
.navbar {
  background: var(--panel);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-list {
  display: flex;
  list-style: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.nav-list li { flex: 0 0 auto; }
.nav-list a {
  display: block;
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav-list a:hover { color: var(--gold); background: var(--panel-2); }
.nav-list a.active {
  color: #fff;
  border-bottom-color: var(--red);
  background: var(--panel-2);
}

/* ---------- 三栏布局 ---------- */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 14px 0 30px;
  flex: 1;
}

/* 移动端：主内容优先展示 */
.col-main { min-width: 0; order: -1; }
.col-side { min-width: 0; }

/* 面板 */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 14px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border-bottom: 1px solid var(--line);
}
.panel-head h2, .panel-head h3, .panel-head h1 {
  font-size: 15px;
  color: var(--gold);
  font-weight: 700;
  padding-left: 10px;
  border-left: 4px solid var(--red);
  line-height: 1.2;
}
.panel-head .more { font-size: 12px; color: var(--dim); }
.panel-head .more:hover { color: var(--gold); }
.panel-body { padding: 12px; }
.panel-body.no-pad { padding: 0; }

/* 站内公告 */
.notice-list { list-style: none; }
.notice-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 13px;
  color: var(--text);
  display: flex;
  gap: 6px;
}
.notice-list li:last-child { border-bottom: none; }
.notice-list .dot { color: var(--red); flex: 0 0 auto; }

/* 侧栏导航 */
.side-nav { list-style: none; }
.side-nav li { border-bottom: 1px solid var(--line-soft); }
.side-nav li:last-child { border-bottom: none; }
.side-nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 4px;
  font-size: 14px;
  color: var(--text);
}
.side-nav a:hover { color: var(--gold); padding-left: 8px; }
.side-nav .cnt { font-size: 12px; color: var(--dim); }

/* 标签 */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags a {
  font-size: 13px;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 10px;
  background: var(--bg-soft);
}
.tags a:hover { color: var(--gold); border-color: var(--gold-dim); }

/* 友情链接 */
.links { list-style: none; }
.links li { padding: 6px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13px; }
.links li:last-child { border-bottom: none; }

/* ---------- 新服表格 ---------- */
.table-wrap { overflow-x: auto; }
table.servers {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}
table.servers th {
  background: var(--panel-2);
  color: var(--gold);
  font-weight: 700;
  padding: 9px 6px;
  text-align: center;
  border-bottom: 2px solid var(--red);
  white-space: nowrap;
}
table.servers td {
  padding: 9px 6px;
  text-align: center;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.servers tbody tr:hover { background: var(--panel-2); }
table.servers .sname { color: var(--head); font-weight: 600; }
.stars { color: var(--gold); letter-spacing: 1px; }

/* ---------- 文章列表 ---------- */
.art-list { list-style: none; }
.art-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.art-list li:last-child { border-bottom: none; }
.art-list .t {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--head);
  line-height: 1.4;
}
.art-list .t:hover { color: var(--gold); }
.art-list .s {
  display: block;
  font-size: 13px;
  color: var(--dim);
  margin-top: 4px;
  line-height: 1.6;
}
.art-list .m {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--dim);
}
.art-list .m .cat { color: var(--gold-dim); }

/* 首页最新文章双列 */
.art-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 20px;
}

/* 热门榜 */
.hot-list { list-style: none; counter-reset: hot; }
.hot-list li {
  counter-increment: hot;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line-soft);
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}
.hot-list li:last-child { border-bottom: none; }
.hot-list li::before {
  content: counter(hot);
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-dim);
  flex: 0 0 18px;
  text-align: center;
}
.hot-list li:nth-child(-n+3)::before { color: var(--red); }
.hot-list a { color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-list a:hover { color: var(--gold); }

/* ---------- 面包屑 ---------- */
.crumb {
  font-size: 13px;
  color: var(--dim);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.crumb a { color: var(--dim); }
.crumb a:hover { color: var(--gold); }
.crumb .cur { color: var(--gold); }

/* ---------- 文章页 ---------- */
.article-head { padding: 16px 16px 0; }
.article-head h1 {
  font-size: 20px;
  color: var(--head);
  line-height: 1.45;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--dim);
}
.article-meta .cat a { color: var(--gold-dim); }

.article-body { padding: 14px 16px 20px; }
.article-body p { margin: 12px 0; text-align: justify; }
.article-body h3 {
  font-size: 16px;
  color: var(--gold);
  margin: 20px 0 6px;
  padding-left: 10px;
  border-left: 4px solid var(--red);
}
.article-body ul, .article-body ol { margin: 10px 0 10px 22px; }
.article-body li { margin: 6px 0; }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
  table-layout: fixed;
}
.article-body th {
  background: var(--panel-2);
  color: var(--gold);
  padding: 8px 6px;
  border: 1px solid var(--line);
  text-align: center;
}
.article-body td {
  padding: 8px 6px;
  border: 1px solid var(--line-soft);
  text-align: center;
}

.kw-box { padding: 10px 16px 0; }
.kw-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.kw-tags span {
  font-size: 12px;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 8px;
}

.art-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.art-nav a { color: var(--dim); max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-nav a:hover { color: var(--gold); }
.art-nav .next { text-align: right; }

.related { padding: 12px 16px 16px; }
.related h3 {
  font-size: 14px;
  color: var(--gold);
  margin-bottom: 8px;
  padding-left: 10px;
  border-left: 4px solid var(--red);
}
.related-list { list-style: none; }
.related-list li {
  padding: 7px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.related-list li:last-child { border-bottom: none; }
.related-list a { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related-list a:hover { color: var(--gold); }
.related-list time { color: var(--dim); font-size: 12px; flex: 0 0 auto; }

/* ---------- 页脚 ---------- */
.footer {
  background: var(--panel);
  border-top: 3px solid var(--red);
  margin-top: auto;
}
.footer-inner {
  padding: 18px 0 22px;
  text-align: center;
  font-size: 13px;
  color: var(--dim);
  line-height: 1.9;
}
.footer-links { margin-bottom: 6px; }
.footer-links a { color: var(--text); margin: 0 8px; }
.footer-links a:hover { color: var(--gold); }
.footer .cp { font-size: 12px; }

/* ---------- 404 ---------- */
.error-box { text-align: center; padding: 70px 16px; }
.error-box .code { font-size: 64px; color: var(--red); font-weight: 700; }
.error-box p { color: var(--dim); margin: 10px 0 20px; }
.btn {
  display: inline-block;
  background: linear-gradient(145deg, var(--red), var(--red-dark));
  color: #fff;
  padding: 9px 26px;
  border-radius: 5px;
  font-size: 14px;
}
.btn:hover { color: #fff; filter: brightness(1.12); }

/* 回到顶部 */
#toTop {
  position: fixed;
  right: 16px;
  bottom: 20px;
  width: 40px;
  height: 40px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 18px;
  cursor: pointer;
  display: none;
  z-index: 60;
  box-shadow: 0 3px 12px rgba(0,0,0,.4);
}
#toTop.show { display: block; }

/* ---------- 响应式：平板（两栏，隐藏左侧辅助栏） ---------- */
@media (min-width: 768px) {
  .layout { grid-template-columns: 1fr 260px; }
  .col-main { order: 0; }
  .col-side:first-of-type { display: none; }
  .art-grid { grid-template-columns: 1fr 1fr; }
  .article-head h1 { font-size: 22px; }
}

/* 窄屏：隐藏线路列，允许单元格换行，保证开区时间完整可读 */
@media (max-width: 767px) {
  table.servers th:nth-child(4),
  table.servers td:nth-child(4) { display: none; }
  table.servers td { white-space: normal; }
}

/* ---------- 响应式：桌面三栏 ---------- */
@media (min-width: 1100px) {
  .layout { grid-template-columns: 210px 1fr 260px; }
  .col-side:first-of-type { display: block; }
  .logo-text h1 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
