/* 玛法攻略网 - 全站样式（PC / 移动端自适应） */

:root {
  --bg: #0f1115;
  --bg-soft: #171a21;
  --panel: #1d212a;
  --panel-2: #242936;
  --line: #313745;
  --text: #e8e6e0;
  --text-dim: #9aa1b0;
  --gold: #d5a742;
  --gold-soft: #f0cd7a;
  --gold-dark: #8c6a1f;
  --danger: #d4644c;
  --ok: #5aa06a;
  --radius: 10px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold-soft); text-decoration: none; }
a:hover { color: #fff; }

img { max-width: 100%; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 17, 21, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold-soft);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 1px;
  white-space: nowrap;
}
.brand .brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--gold-dark);
  border-radius: 8px;
  background: linear-gradient(145deg, #2b2413, #171a21);
  color: var(--gold);
  font-size: 20px;
}
.brand small { display: block; font-size: 11px; color: var(--text-dim); font-weight: 400; letter-spacing: 0; }

.header-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.header-nav a {
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
}
.header-nav a:hover { background: var(--panel); color: var(--gold-soft); }

/* ---------- 搜索框 ---------- */
.search-wrap { position: relative; flex: 1 1 240px; min-width: 180px; }
.search-wrap input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search-wrap input:focus { border-color: var(--gold-dark); box-shadow: 0 0 0 3px rgba(213,167,66,.12); }
.search-wrap input::placeholder { color: #6f7686; }
.search-wrap .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); font-size: 15px; pointer-events: none;
}
.search-results-info { color: var(--text-dim); font-size: 13px; margin: 4px 0 16px; }
.search-results-info strong { color: var(--gold); }

/* ---------- 页面容器 ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 26px 18px 60px; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #1b1a16 0%, #171a21 55%, #141821 100%);
  border: 1px solid #3a3320;
  border-radius: 14px;
  padding: 36px 32px;
  margin-bottom: 26px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "⚔";
  position: absolute; right: 26px; bottom: -18px;
  font-size: 150px; opacity: .05;
}
.hero h1 { margin: 0 0 8px; font-size: 30px; color: var(--gold-soft); letter-spacing: 1px; }
.hero p { margin: 0; color: var(--text-dim); max-width: 560px; }
.hero .hero-tags { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.hero .hero-tags span {
  font-size: 12px; padding: 4px 10px; border: 1px solid #4a4029;
  border-radius: 20px; color: var(--gold); background: rgba(213,167,66,.06);
}

/* hero 内搜索：分「搜文章 / 搜版本」两类 */
.hero-search { margin-top: 20px; max-width: 620px; }
.hero-search .hs-tabs { display: inline-flex; gap: 4px; margin-bottom: 10px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.hero-search .hs-tab {
  background: none; border: 0; color: var(--text-dim); font-family: inherit;
  font-size: 13px; padding: 6px 16px; border-radius: 6px; cursor: pointer; transition: all .2s;
}
.hero-search .hs-tab:hover { color: var(--gold-soft); }
.hero-search .hs-tab.active { background: var(--gold); color: #1a1508; font-weight: 700; }
.hero-search .hs-form { display: flex; align-items: center; gap: 8px; position: relative; }
.hero-search .hs-icon { position: absolute; left: 12px; color: var(--text-dim); font-size: 15px; pointer-events: none; }
.hero-search .hs-form input {
  flex: 1; min-width: 0; padding: 11px 14px 11px 36px;
  background: var(--panel); border: 1px solid var(--gold-dark); border-radius: 8px;
  color: var(--text); font-size: 14px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.hero-search .hs-form input:focus { box-shadow: 0 0 0 3px rgba(213,167,66,.12); }
.hero-search .hs-form input::placeholder { color: #6f7686; }
.hero-search .hs-form .btn { flex: none; }
@media (max-width: 640px) {
  .hero-search .hs-form input { padding: 10px 12px 10px 34px; }
  .hero-search .hs-form .btn { padding: 10px 14px; }
}

/* ---------- 分类筛选 ---------- */
/* 筛选区改为块级：常用标签在一行，展开面板独占整行向下展开（参考美团分类展开） */
.filter-bar { margin-bottom: 20px; }
.filter-chip {
  padding: 7px 14px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--text-dim); font-size: 13px; transition: all .2s;
}
.filter-chip:hover { color: var(--gold-soft); border-color: var(--gold-dark); }
.filter-chip.active { background: var(--gold); border-color: var(--gold); color: #1a1508; font-weight: 700; }
.filter-chip:focus-visible, .filter-more:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; }

/* 全部版本入口按钮 */
.filter-more {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 20px; cursor: pointer;
  border: 1px dashed var(--gold-dark); background: rgba(213,167,66,.06);
  color: var(--gold); font-size: 13px; font-family: inherit; transition: all .2s;
}
.filter-more:hover { background: rgba(213,167,66,.14); border-color: var(--gold); }
.filter-more .more-count {
  background: var(--gold); color: #1a1508; border-radius: 10px;
  padding: 0 7px; font-size: 11px; font-weight: 700;
}

/* 全部版本面板：独占整行、向下展开的分类容器（参考美团「更多分类」） */
.filter-head { margin-bottom: 12px; }
.filter-label { font-size: 13px; color: var(--text-dim); font-weight: 600; }
/* 常用版本栅格：桌面每排最多 8 个，移动端每排 3 个 */
.filter-chips { width: 100%; }
.hot-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.hot-grid .filter-chip { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 全部版本：独立操作行、右对齐，不挤占版本栅格 */
.filter-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.filter-more.open { background: rgba(213,167,66,.14); border-style: solid; }
@media (max-width: 640px) {
  .hot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.version-panel {
  display: block; clear: both;
  width: 100%; margin-top: 10px; padding: 16px 20px 18px;
  background: var(--bg-soft); border: 1px solid var(--gold-dark);
  border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.22);
}
.vp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.vp-head strong { color: var(--gold-soft); font-size: 14px; }
.vp-close {
  background: none; border: 0; color: var(--text-dim); font-size: 12px;
  cursor: pointer; font-family: inherit; padding: 4px 8px; border-radius: 5px;
}
.vp-close:hover { color: var(--gold-soft); background: rgba(213,167,66,.1); }
.vp-search { padding: 12px 0 4px; }
.vp-search input {
  width: 100%; box-sizing: border-box; background: var(--panel); border: 1px solid var(--gold-dark);
  border-radius: 8px; color: var(--text); padding: 10px 14px;
  font-size: 14px; outline: none; font-family: inherit;
}
.vp-search input:focus { border-color: var(--gold-dark); box-shadow: 0 0 0 3px rgba(213,167,66,.1); }
.vp-body { padding: 4px 0 0; max-height: 46vh; overflow-y: auto; overscroll-behavior: contain; }
.vp-body::-webkit-scrollbar { width: 8px; }
.vp-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.vp-group {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-dim); font-size: 12px; font-weight: 600;
  margin: 14px 0 10px;
}
.vp-group::before { content: ""; width: 3px; height: 13px; background: var(--gold); border-radius: 2px; }
.vp-group-num {
  background: var(--panel-2); border-radius: 10px; padding: 1px 8px;
  color: var(--gold); font-weight: 400;
}
.vp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.vp-cell {
  position: relative; text-align: left; cursor: pointer; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; color: var(--text); font-family: inherit;
  display: flex; flex-direction: column; gap: 5px; transition: all .15s;
}
.vp-cell:hover { border-color: var(--gold); background: rgba(213,167,66,.07); }
.vp-cell.active { border-color: var(--gold); background: rgba(213,167,66,.14); }
.vp-cell:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; }
.vp-cell-name { font-size: 14px; font-weight: 600; padding-right: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-cell-sub { display: flex; align-items: center; gap: 6px; }
.vp-cell-num { font-size: 11px; color: var(--text-dim); }
.vp-hot { font-size: 10px; color: var(--gold); background: rgba(213,167,66,.12); border-radius: 4px; padding: 1px 6px; }
.vp-check { position: absolute; top: 8px; right: 10px; color: var(--gold); font-size: 13px; }
.vp-empty { text-align: center; padding: 30px 10px; color: var(--text-dim); font-size: 13px; }
@media (max-width: 640px) {
  .version-panel { padding: 14px 12px 16px; }
  .vp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 攻略标题列表（贴吧 / TapTap 风格，利于收录） ---------- */
.thread-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.thread-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px; border-bottom: 1px solid var(--line);
}
.thread-item:last-child { border-bottom: 0; }
.thread-item:hover { background: var(--bg-soft); }
.thread-cat {
  flex: none; min-width: 72px; text-align: center;
  font-size: 12px; color: var(--gold); background: rgba(213,167,66,.1);
  border-radius: 4px; padding: 3px 8px;
}
.thread-title { flex: 1; min-width: 0; margin: 0; font-size: 15px; font-weight: 500; line-height: 1.5; }
.thread-title a { color: var(--text); }
.thread-title a:hover { color: var(--gold-soft); }
.thread-date { flex: none; font-size: 12px; color: #71798a; }
.thread-replies { flex: none; min-width: 52px; text-align: right; font-size: 12px; color: var(--text-dim); }
@media (max-width: 640px) {
  .thread-item { flex-wrap: wrap; gap: 8px 12px; padding: 12px 14px; }
  .thread-title { flex-basis: 100%; order: 3; }
  .thread-date { margin-left: auto; }
}
.tag { display: inline-block; font-size: 11px; color: #8b93a3; margin-right: 6px; }
.tag::before { content: "#"; color: var(--gold-dark); }

.empty { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.empty .empty-icon { font-size: 48px; opacity: .4; }

/* ---------- 文章页 ---------- */
/* 文章页：header 只留品牌，搜索框由内容区顶栏提供，避免两个搜索框挤压导航 */
body.article-page .site-header .search-wrap { display: none; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
/* 文章页：探索区并入正文主栏，整版通栏 */
body.article-single-col .article-layout { grid-template-columns: minmax(0, 1fr); }
/* 版本首页：PC 端也保持上下单栏，主列表在上、其他版本在下 */
body.version-page .article-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 641px) {
  body.version-page .sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  body.version-page .sidebar .side-box { margin-bottom: 0; }
}
/* 版本首页顶栏：返回入口/版本名一行，搜索框独占下一行且铺满 */
body.version-page .article-topbar { align-items: center; }
body.version-page .article-search { flex: 1 1 100%; max-width: none; margin-left: 0; }
body.version-page .article-search input { flex: 1; min-width: 0; width: auto; }
body.version-page .article-search .btn { flex: none; }
.article-main, .sidebar { min-width: 0; }
.breadcrumb { margin-bottom: 18px; }
.article-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; padding: 12px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.back-home { color: var(--gold-soft); font-size: 14px; font-weight: 600; white-space: nowrap; }
.back-home:hover { color: #fff; }
.article-nav-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.back-version { color: var(--text-dim); font-size: 13px; white-space: nowrap; }
.back-version:hover { color: var(--gold-soft); }
.version-topbar-name { color: var(--gold-soft); font-weight: 700; font-size: 15px; white-space: nowrap; }
@media (max-width: 640px) { .version-topbar-name { display: none; } }
.article-search { display: flex; align-items: center; gap: 8px; flex: 1 1 320px; max-width: 460px; min-width: 0; margin-left: auto; }
.article-search input {
  flex: 1; min-width: 0; width: 100%;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 9px 14px; font-size: 14px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.article-search input:focus { border-color: var(--gold-dark); box-shadow: 0 0 0 3px rgba(213,167,66,.12); }
.article-search input::placeholder { color: #6f7686; }
.article-search .btn { flex: none; white-space: nowrap; }
@media (max-width: 640px) {
  .article-topbar { padding: 10px 12px; gap: 10px; }
  .article-search { flex-basis: 100%; max-width: none; margin-left: 0; }
}
.article-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px;
}
.article-header { border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 24px; }
.article-header h1 { margin: 10px 0 14px; font-size: 27px; line-height: 1.4; color: #fff; }
.article-header .meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.article-content { font-size: 15.5px; color: #d3d5d9; }
.article-content.text-only { max-width: 760px; }
.article-content.text-only p { line-height: 1.9; margin: 14px 0; }
.article-content .empty-content { color: var(--text-dim); font-style: italic; }
.article-content h2 { color: var(--gold-soft); font-size: 20px; margin: 30px 0 12px; padding-left: 12px; border-left: 3px solid var(--gold); }
.article-content p { margin: 12px 0; }
.article-content ul, .article-content ol { padding-left: 24px; }
.article-content li { margin: 7px 0; }
.article-content strong { color: #fff; }
.article-figure { margin: 20px 0; text-align: center; }
.article-figure img { display: block; width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.article-figure figcaption { margin-top: 8px; font-size: 12px; color: var(--text-dim); }
.img-fallback {
  display: block; padding: 22px 14px; margin: 18px 0; text-align: center;
  border: 1px dashed var(--gold-dark); border-radius: 8px;
  background: rgba(213,167,66,.05); color: var(--gold-soft); font-size: 13px;
}
.article-tags { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; }
.article-tags .tag { font-size: 12px; background: var(--panel-2); padding: 4px 10px; border-radius: 4px; }

.sidebar .side-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.side-box h4 { margin: 0 0 14px; color: var(--gold); font-size: 15px; }
.side-link { display: block; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.side-link:last-child { border-bottom: 0; }
.side-link:hover { color: var(--gold-soft); }

/* 文章页评论区下方探索区：通栏、两栏排布 */
.explore-zone { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 18px; margin-top: 30px; }
.explore-zone .side-box { margin-bottom: 0; }
.explore-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
@media (max-width: 640px) {
  .explore-zone { grid-template-columns: 1fr; }
  .explore-links { grid-template-columns: 1fr; }
}

/* ---------- 评论区 ---------- */
.comments { margin-top: 30px; }
.comments h3 { color: var(--gold); font-size: 19px; margin: 0 0 4px; }
.comments .comment-count { color: var(--text-dim); font-size: 13px; margin-bottom: 18px; }
.comment-form { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 22px; }
.comment-form .row { display: flex; gap: 12px; }
.comment-form input, .comment-form textarea {
  width: 100%; background: var(--panel); border: 1px solid var(--line);
  border-radius: 7px; color: var(--text); padding: 10px 12px; font-size: 14px; outline: none;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--gold-dark); }
.comment-form input { max-width: 200px; }
.comment-form textarea { margin: 12px 0; resize: vertical; min-height: 88px; }
.comment-form .form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.comment-form .hint { font-size: 12px; color: var(--text-dim); }

.comment-list { display: flex; flex-direction: column; gap: 14px; }
.comment-item { display: flex; gap: 12px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 9px; padding: 15px; }
.comment-item.pending { border-style: dashed; border-color: var(--gold-dark); background: rgba(213,167,66,.04); }
.avatar {
  flex: 0 0 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; color: #1a1508;
  background: linear-gradient(145deg, var(--gold-soft), var(--gold-dark));
}
.comment-item.pending .avatar { background: linear-gradient(145deg, #7a6a45, #4a4029); color: #e8d9b0; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.comment-head .name { font-weight: 600; color: #e8e6e0; font-size: 14px; }
.comment-head .date { font-size: 11px; color: #71798a; }
.comment-head .badge-pending { font-size: 11px; color: var(--gold); background: rgba(213,167,66,.12); border: 1px solid var(--gold-dark); padding: 1px 8px; border-radius: 4px; }
.comment-text { font-size: 14px; color: #c8ccd4; word-break: break-word; }
.comment-foot { margin-top: 8px; font-size: 12px; color: #71798a; display: flex; gap: 14px; }
.comment-foot .like-btn { cursor: pointer; }
.comment-foot .like-btn:hover, .comment-foot .like-btn.liked { color: var(--gold); }
.comment-item.pending .comment-foot .remove-btn { cursor: pointer; color: var(--danger); }

.toast {
  position: fixed; left: 50%; top: 80px; transform: translateX(-50%) translateY(-20px);
  background: #23301f; border: 1px solid var(--ok); color: #d7f0d9;
  padding: 12px 22px; border-radius: 8px; font-size: 14px; z-index: 200;
  opacity: 0; pointer-events: none; transition: all .3s; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; padding: 9px 18px; border-radius: 7px; border: 1px solid var(--gold-dark);
  background: var(--gold); color: #1a1508; font-weight: 700; font-size: 14px; cursor: pointer;
  transition: filter .2s; font-family: inherit;
}
.btn:hover { filter: brightness(1.1); color: #1a1508; }
.btn.ghost { background: transparent; color: var(--gold); }
.btn.ghost:hover { background: rgba(213,167,66,.1); color: var(--gold-soft); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: rgba(212,100,76,.12); color: #ff9a86; }
.btn.sm { padding: 5px 11px; font-size: 12px; }

/* ---------- 后台 ---------- */
.admin-wrap { max-width: 1180px; margin: 0 auto; padding: 24px 18px 70px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.admin-head h1 { margin: 0; font-size: 24px; color: var(--gold-soft); }
.admin-head p { margin: 4px 0 0; color: var(--text-dim); font-size: 13px; }
.admin-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-box { flex: 1; min-width: 140px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat-box .num { font-size: 26px; font-weight: 800; color: var(--gold); }
.stat-box .label { font-size: 12px; color: var(--text-dim); }

.notice {
  background: rgba(213,167,66,.08); border: 1px solid var(--gold-dark);
  border-radius: 8px; padding: 12px 16px; font-size: 13px; color: #e0cf9e; margin-bottom: 18px; line-height: 1.6;
}
.notice code { background: rgba(0,0,0,.3); padding: 1px 6px; border-radius: 4px; color: var(--gold-soft); }

.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-soft); color: var(--text-dim); font-weight: 600; font-size: 12px; }
tr:last-child td { border-bottom: 0; }
td .title-cell { color: var(--text); font-weight: 600; }
td .sub-cell { color: var(--text-dim); font-size: 12px; margin-top: 3px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 编辑弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 100;
  display: none; align-items: flex-start; justify-content: center; padding: 30px 16px; overflow-y: auto;
}
.modal-mask.open { display: flex; }
.modal {
  background: var(--panel); border: 1px solid var(--gold-dark); border-radius: 12px;
  width: 100%; max-width: 760px; box-shadow: var(--shadow); margin: auto 0;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; color: var(--gold-soft); }
.modal-close { background: none; border: 0; color: var(--text-dim); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 7px;
  color: var(--text); padding: 10px 12px; font-size: 14px; outline: none; font-family: inherit;
}
.field input:focus, .field textarea:focus { border-color: var(--gold-dark); }
.field textarea { min-height: 90px; resize: vertical; }
.field textarea.content-area { min-height: 260px; font-family: Consolas, Monaco, monospace; font-size: 13px; }
.field-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.comment-editor { border: 1px dashed var(--line); border-radius: 8px; padding: 14px; margin-bottom: 10px; background: var(--bg-soft); }
.comment-editor .ce-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 12px; color: var(--text-dim); }
.comment-editor .row { display: grid; grid-template-columns: 120px 1fr; gap: 10px; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); background: #0c0e12; padding: 24px 18px; text-align: center; color: #6f7686; font-size: 12px; }
.site-footer a { color: #8b93a3; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .sidebar .side-box { margin-bottom: 0; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .header-inner { padding: 10px 14px; gap: 10px; }
  .brand { font-size: 16px; }
  .brand .brand-mark { width: 32px; height: 32px; font-size: 17px; }
  .brand small { display: none; }
  .header-nav { order: 3; width: 100%; }
  .header-nav a { padding: 5px 10px; font-size: 13px; }
  .search-wrap { flex-basis: 100%; }
  .container { padding: 18px 14px 44px; }
  .hero { padding: 26px 20px; }
  .hero h1 { font-size: 23px; }
  .hero::after { display: none; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .sidebar { grid-template-columns: 1fr; }
  .article-card { padding: 20px 16px; }
  .article-header h1 { font-size: 22px; }
  .article-content { font-size: 15px; }
  .article-content h2 { font-size: 18px; }
  .comment-form .row { flex-direction: column; }
  .comment-form input { max-width: none; }
  .comment-form .form-foot { flex-direction: column; align-items: stretch; }
  .comment-form .btn { width: 100%; }
  .comment-item { padding: 12px; }
  .avatar { flex-basis: 34px; height: 34px; font-size: 14px; }
  .admin-wrap { padding: 18px 12px 50px; }
  .table-wrap { overflow-x: auto; }
  table { min-width: 680px; }
  .modal-body { padding: 16px; }
  .field-2 { grid-template-columns: 1fr; gap: 0; }
  .comment-editor .row { grid-template-columns: 1fr; }
}

/* ---------- 后台管理：脚本动态生成的部件 ---------- */
[hidden] { display: none !important; }
.btn-mini {
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--text);
  border-radius: 5px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.btn-mini:hover { border-color: var(--gold); color: var(--gold-soft); }
.btn-danger { color: #e08282; }
.btn-danger:hover { border-color: #e08282; color: #ff9d9d; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 11px 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table th { color: var(--text-dim); font-size: 12px; font-weight: 600; background: var(--bg-soft); }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table a { color: var(--gold-soft); text-decoration: none; }
.admin-table a:hover { text-decoration: underline; }
.admin-ops { white-space: nowrap; }
.admin-ops .btn-mini + .btn-mini { margin-left: 6px; }
.admin-empty { padding: 40px 16px; text-align: center; color: var(--text-dim); }
.editor-panel {
  background: var(--panel); border: 1px solid var(--gold-dark); border-radius: var(--radius);
  padding: 20px 22px; margin-top: 20px;
}
.editor-panel h2 { margin: 0 0 16px; color: var(--gold-soft); font-size: 18px; }
.editor-panel .field input, .editor-panel .field textarea, .editor-panel .field select {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 6px; color: var(--text); padding: 9px 11px; font-size: 14px;
  outline: none; font-family: inherit;
}
.editor-panel .field input:focus, .editor-panel .field textarea:focus { border-color: var(--gold-dark); }
.editor-panel .field textarea { min-height: 90px; resize: vertical; }
.editor-panel .field textarea.content-area { min-height: 230px; font-family: Consolas, Monaco, monospace; font-size: 13px; }
/* ---------- 后台：图文插入 ---------- */
.img-insert { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; margin-top: 8px; }
.img-insert input {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 6px; color: var(--text); padding: 8px 10px; font-size: 12px; outline: none;
}
.img-insert input:focus { border-color: var(--gold-dark); }

/* ---------- 所见即所得富文本编辑器 ---------- */
.rte { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg-soft); }
.rte:focus-within { border-color: var(--gold-dark); }
.rte-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 8px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.rte-toolbar button {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 5px;
  color: var(--text); padding: 5px 10px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.rte-toolbar button:hover { border-color: var(--gold); color: var(--gold-soft); }
.rte-toolbar .rte-hint { margin-left: auto; font-size: 11px; color: var(--text-dim); }
.rte-area {
  min-height: 300px; padding: 16px 18px; color: var(--text); font-size: 15px; line-height: 1.7;
  outline: none; overflow-wrap: break-word;
}
.rte-area:empty::before { content: attr(data-placeholder); color: #6f7686; }
.rte-area p { margin: 10px 0; }
.rte-area h2 { color: var(--gold-soft); font-size: 20px; margin: 20px 0 10px; }
.rte-area h3 { color: var(--gold-soft); font-size: 17px; margin: 16px 0 8px; }
.rte-area ul, .rte-area ol { padding-left: 24px; margin: 10px 0; }
.rte-area li { margin: 5px 0; }
.rte-area strong { color: #fff; }
.rte-area blockquote { border-left: 3px solid var(--gold-dark); padding-left: 12px; color: var(--text-dim); margin: 10px 0; }
.rte-area a { color: var(--gold-soft); text-decoration: underline; }
.rte-area figure { margin: 14px 0; text-align: center; }
.rte-area figure img { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.rte-area figcaption { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.rte-dialog-mask { position: fixed; inset: 0; background: rgba(0,0,0,.66); z-index: 120; display: grid; place-items: center; padding: 18px; }
.rte-dialog { width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--gold-dark); border-radius: 12px; padding: 22px; box-shadow: var(--shadow); }
.rte-dialog h3 { margin: 0 0 16px; color: var(--gold-soft); font-size: 18px; }

.comment-row {
  display: grid; grid-template-columns: 100px 1fr 150px 100px auto; gap: 8px;
  align-items: center; margin-bottom: 8px;
}
.comment-row input, .comment-row select {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 6px; color: var(--text); padding: 8px 10px; font-size: 13px; outline: none;
  font-family: inherit;
}
.comment-row input:focus, .comment-row select:focus { border-color: var(--gold-dark); }
.accent-line { display: flex; align-items: center; gap: 10px; }
.accent-preview { width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--line); flex: none; }
.editor-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.status-text { color: var(--gold-soft); font-size: 13px; }
@media (max-width: 640px) {
  .comment-row { grid-template-columns: 1fr; }
  .img-insert { grid-template-columns: 1fr; }
  .editor-panel { padding: 16px 14px; }
}

/* ---------- 独立后台：登录与标签页 ---------- */
.login-panel { min-height: 70vh; display: grid; place-items: center; padding: 24px 14px; }
.login-box {
  width: 100%; max-width: 380px; background: var(--panel);
  border: 1px solid var(--gold-dark); border-radius: 12px; padding: 28px;
  box-shadow: var(--shadow);
}
.login-box h1 { margin: 0 0 6px; color: var(--gold-soft); font-size: 22px; }
.login-box p { color: var(--text-dim); font-size: 13px; margin: 0 0 18px; }
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.tab-btn {
  background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
  color: var(--text-dim); font-size: 14px; padding: 10px 16px; font-family: inherit;
}
.tab-btn:hover { color: var(--gold-soft); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); font-weight: 700; }
.admin-toolbar input[type="text"] {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); padding: 8px 11px; font-size: 13px; outline: none; font-family: inherit;
  min-width: 220px;
}
.admin-toolbar input[type="text"]:focus { border-color: var(--gold-dark); }
.tab-panel { min-height: 120px; }

/* ---------- 文章列表分页 ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 18px; }
.pg-btn {
  min-width: 34px; padding: 6px 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; color: var(--text-dim); font-size: 13px; font-family: inherit; cursor: pointer;
  transition: all .15s;
}
.pg-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-soft); }
.pg-btn.active { background: var(--gold); border-color: var(--gold); color: #1a1508; font-weight: 700; }
.pg-btn:disabled { opacity: .4; cursor: not-allowed; }
.pg-info { margin-left: 6px; font-size: 12px; color: var(--text-dim); }
@media (max-width: 640px) {
  .pager { gap: 5px; }
  .pg-btn { min-width: 30px; padding: 5px 9px; font-size: 12px; }
}
