/* 模板一：暗黑流光杂志风 (dark_mag.css) —— 适合精品写真配故事、视觉冲击强 */
:root {
  --bg: #0c0d12;
  --surface: #151722;
  --surface-hover: #1e2130;
  --text: #eef0f7;
  --muted: #9399b2;
  --accent: #f43f5e;
  --accent-2: #fb923c;
  --border: rgba(255, 255, 255, 0.08);
}
body.zg-alt-mode {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --text: #18181b;
  --muted: #64748b;
  --border: rgba(0, 0, 0, 0.09);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.75;
  padding-bottom: 64px;
}
body.zg-locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }

.dm-shell { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.dm-topbar {
  background: rgba(21, 23, 34, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.dm-topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
}
.dm-brand { display: flex; flex-direction: column; }
.dm-brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.dm-brand-sub { font-size: 0.78rem; color: var(--muted); }

.zg-search { display: flex; gap: 6px; }
.zg-search input {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  width: 180px;
}
.zg-search button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: #fff;
  padding: 7px 15px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.dm-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 14px;
  scrollbar-width: none;
}
.zg-nav-link {
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.zg-nav-link.active, .zg-nav-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.dm-tags-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.zg-tag-chip {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}
.zg-tag-chip:hover { color: var(--accent); border-color: var(--accent); }

.zg-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
  margin: 20px 0;
}
.zg-post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.22s, border-color 0.22s;
}
.zg-post-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.zg-card-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #1d2030;
  overflow: hidden;
}
.zg-card-thumb { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s; }
.zg-post-card:hover .zg-card-thumb { transform: scale(1.05); }
.zg-card-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.75rem;
  padding: 3px 9px;
  border-radius: 99px;
}
.zg-card-body { padding: 14px 16px 18px; }
.zg-card-meta {
  display: flex;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.zg-card-cat { color: var(--accent); font-weight: 600; }
.zg-card-title {
  font-size: 1.06rem;
  line-height: 1.45;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.zg-card-desc {
  font-size: 0.85rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}
.zg-mini-tag { font-size: 0.75rem; color: var(--muted); margin-right: 8px; }

/* 详情页与图文混排样式 */
.zg-article-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 20px;
  margin: 20px 0;
}
.zg-article-header h1 { font-size: 1.55rem; line-height: 1.4; margin-bottom: 12px; }
.zg-seo-lead {
  padding: 12px 15px;
  background: rgba(244, 63, 94, 0.08);
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-size: 0.92rem;
  border-radius: 6px;
  margin-bottom: 18px;
}
.zg-reader-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}
.zg-post-stats { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.zg-cat-pill { background: var(--accent); color: #fff; padding: 2px 9px; border-radius: 4px; }
.zg-reader-tools { display: flex; gap: 6px; }
.zg-tool-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
}
.zg-article-body { font-size: 1.05rem; }
.zg-article-body.font-sm { font-size: 0.94rem; }
.zg-article-body.font-lg { font-size: 1.22rem; line-height: 1.95; }
.zg-blk-heading { font-size: 1.25rem; margin: 24px 0 12px; color: var(--accent-2); }
.zg-blk-para { margin-bottom: 18px; text-indent: 2em; letter-spacing: 0.02em; }
.zg-blk-figure { margin: 22px 0; text-align: center; }
.zg-blk-img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  cursor: zoom-in;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
}
.zg-blk-caption { font-size: 0.82rem; color: var(--muted); margin-top: 8px; }
.zg-blk-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 22px 0;
}

/* 分页器与广告槽 */
.zg-content-pager, .zg-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 28px 0;
}
.zg-cpage-list { display: flex; gap: 6px; flex-wrap: wrap; }
.zg-cpage-num, .zg-cpage-btn, .zg-page-btn {
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
.zg-cpage-num.active, .zg-cpage-next {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
}
.zg-ad-slot { margin: 18px 0; text-align: center; }
.zg-prev-next {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 24px 0;
}
.zg-pn-box {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.zg-pn-box span { font-size: 0.76rem; color: var(--muted); }
.zg-related-sec { margin-top: 28px; }
.zg-sec-title { font-size: 1.1rem; margin-bottom: 14px; }
.zg-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.zg-rel-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: block;
}
.zg-rel-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.zg-rel-info { padding: 8px 10px; }
.zg-rel-info h4 { font-size: 0.88rem; line-height: 1.35; margin-bottom: 4px; }
.zg-rel-info span { font-size: 0.74rem; color: var(--muted); }

.dm-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 28px 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}
.dm-footer-links { display: flex; justify-content: center; gap: 16px; margin-bottom: 10px; flex-wrap: wrap; }

/* 通用 18+ 弹窗、悬浮广告与灯箱 */
.zg-age-overlay {
  position: fixed; inset: 0; background: rgba(5, 6, 10, 0.92);
  backdrop-filter: blur(14px); z-index: 9999;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.zg-age-dialog {
  max-width: 440px; width: 100%; background: #181a26; color: #f4f4f6;
  border: 1px solid rgba(244, 63, 94, 0.4); border-radius: 18px;
  padding: 30px 24px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,0.7);
}
.zg-age-badge {
  display: inline-block; background: #f43f5e; color: #fff;
  font-weight: 800; padding: 4px 12px; border-radius: 99px; font-size: 0.82rem; margin-bottom: 12px;
}
.zg-age-dialog h2 { margin-bottom: 10px; font-size: 1.4rem; }
.zg-age-dialog p { font-size: 0.92rem; color: #b4b9ce; margin-bottom: 22px; }
.zg-age-actions { display: flex; flex-direction: column; gap: 10px; }
.zg-age-enter {
  background: linear-gradient(135deg, #f43f5e, #fb923c); color: #fff;
  border: none; padding: 12px; border-radius: 10px; font-size: 1rem; font-weight: 700; cursor: pointer;
}
.zg-age-leave { color: #94a3b8; font-size: 0.86rem; padding: 8px; }

.zg-ad-sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: rgba(18, 20, 30, 0.96); border-top: 1px solid var(--border);
  padding: 8px 16px; text-align: center; display: none;
}
.zg-sticky-close {
  position: absolute; right: 10px; top: -24px; background: rgba(0,0,0,0.75);
  color: #fff; border: none; padding: 2px 8px; border-radius: 4px 4px 0 0; cursor: pointer; font-size: 0.75rem;
}
.zg-lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.94); z-index: 9990;
  align-items: center; justify-content: center; padding: 20px;
}
.zg-lb-stage { max-width: 92vw; max-height: 90vh; text-align: center; }
.zg-lb-stage img { max-width: 90vw; max-height: 82vh; object-fit: contain; border-radius: 6px; }
.zg-lb-cap { color: #cbd5e1; font-size: 0.88rem; margin-top: 10px; }
.zg-lb-close, .zg-lb-prev, .zg-lb-next {
  position: absolute; background: rgba(255,255,255,0.14); color: #fff;
  border: none; cursor: pointer; border-radius: 50%; width: 44px; height: 44px; font-size: 1.3rem;
}
.zg-lb-close { top: 18px; right: 20px; }
.zg-lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.zg-lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.zg-loading, .zg-empty, .zg-error { text-align: center; padding: 48px 16px; color: var(--muted); }
