/* acgshare 前台样式:浅底 + 单一强调色,和原型一致 */
:root {
  --bg: #F6F6F8; --card: #FFFFFF; --line: #E4E4EA; --ink: #17171C; --ink2: #44444F; --muted: #5A5A66;
  --accent: #B8285F; --accent-dark: #8E1C48; --accent-soft: #FCE8F0; --chip: #F1F1F4;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Noto Sans SC', system-ui, -apple-system, 'PingFang SC', sans-serif; }
a { color: var(--accent); text-decoration: none; } a:hover { color: var(--accent-dark); }
img { display: block; max-width: 100%; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* 顶栏 */
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.logo { font-size: 22px; font-weight: 700; color: var(--ink); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a { padding: 10px 14px; border-radius: 8px; color: var(--ink2); }
.nav a.on { background: var(--accent-soft); color: var(--accent-dark); font-weight: 500; }
.search { flex: 1 1 260px; display: flex; min-width: 0; }
.search input { flex: 1; min-width: 0; height: 44px; border: 1px solid #D5D5DD; border-radius: 22px;
  padding: 0 18px; font: inherit; font-size: 14px; background: var(--bg); }

/* 布局 */
main.wrap { padding-top: 20px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 20px; }
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.cols > .main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.cols > .side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 10px; }
.box h2, .sec-h { margin: 0; font-size: 16px; }
h1 { margin: 0; }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* 标签、按钮 */
.chip { padding: 8px 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line);
  color: var(--ink2); font-size: 14px; }
.chip.soft { background: var(--chip); border: 0; padding: 6px 12px; font-size: 13px; }
.pill { height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid #D5D5DD; background: var(--card);
  color: var(--ink2); font: inherit; font-size: 14px; display: inline-flex; align-items: center; cursor: pointer; }
.pill.on { background: var(--accent); border-color: var(--accent); color: #FFF; }
.btn { height: 44px; padding: 0 20px; border-radius: 22px; border: 1px solid var(--accent); background: var(--accent);
  color: #FFF; font: inherit; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.btn.ghost { background: var(--card); color: var(--ink2); border-color: #D5D5DD; font-weight: 400; }
.btn.faved { background: var(--card); color: var(--accent); }

/* 作品卡片:瀑布流 */
.masonry { columns: 220px; column-gap: 14px; }
.card { display: block; break-inside: avoid; margin-bottom: 14px; background: var(--card); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--line); color: var(--ink); }
.card .thumb { position: relative; background: #E2E2E8; }
.card .thumb img { width: 100%; height: auto; }
.badge { position: absolute; top: 8px; right: 8px; font-size: 12px; color: #FFF; background: rgba(23,23,28,.6);
  padding: 2px 8px; border-radius: 10px; }
.card .meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.card .t { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .s { font-size: 12px; color: var(--muted); display: flex; gap: 10px; }
.text-card .excerpt { font-size: 13px; color: var(--ink2); line-height: 1.6; padding: 14px 12px 0;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.grid .card { margin: 0; }

/* 排行 */
.rank a { display: flex; gap: 10px; align-items: center; color: var(--ink); }
.rank .no { width: 22px; font-weight: 700; color: var(--accent); }
.rank img, .rank .ph { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; background: #E2E2E8; }
.rank .tt { display: flex; flex-direction: column; min-width: 0; }
.rank .tt span:first-child { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 广告位 */
.ad { border: 1px dashed #B9B9C4; border-radius: var(--radius); background: var(--card); display: flex;
  align-items: center; justify-content: center; color: #6A6A75; font-size: 13px; overflow: hidden; }
.masonry .ad { break-inside: avoid; margin-bottom: 14px; min-height: 250px; }

/* 阅读器 */
.reader { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 12px; }
.reader .stage img { margin: 0 auto; max-height: 85vh; width: auto; }
.reader.scroll .stage { display: flex; flex-direction: column; gap: 8px; }
.reader.scroll .stage img { max-height: none; width: 100%; }
.reader .ctrl { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; align-items: center; }
.strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.strip button { flex: none; width: 60px; height: 80px; padding: 0; border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; background: #E2E2E8; cursor: pointer; }
.strip button.on { border: 3px solid var(--accent); }
.strip img { width: 100%; height: 100%; object-fit: cover; }
.info { display: grid; grid-template-columns: 72px minmax(0, 1fr); row-gap: 8px; font-size: 14px; }

/* 文字帖 */
.article { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  display: flex; flex-direction: column; gap: 16px; }
.article h1 { font-size: 28px; line-height: 1.4; }
.prose { font-size: 17px; line-height: 1.9; color: #24242B; }
.prose p { margin: 0 0 1em; }
.prose.s { font-size: 15px; } .prose.l { font-size: 20px; }
.toc a { display: block; font-size: 14px; padding: 6px 8px; border-radius: 6px; color: var(--ink); }
.toc a.on { background: var(--accent-soft); color: var(--accent-dark); font-weight: 500; }

/* 分页 */
.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.pager a, .pager span { min-width: 44px; height: 44px; padding: 0 12px; border-radius: 8px; background: var(--card);
  border: 1px solid #D5D5DD; color: var(--ink2); display: flex; align-items: center; justify-content: center; }
.pager .cur { background: var(--accent); border-color: var(--accent); color: #FFF; }

footer.foot { border-top: 1px solid var(--line); background: var(--card); }
footer.foot .wrap { padding-top: 20px; padding-bottom: 20px; display: flex; flex-wrap: wrap; gap: 20px; font-size: 13px; color: var(--muted); }
.empty { padding: 48px; text-align: center; color: var(--muted); background: var(--card); border-radius: var(--radius); }

/* 年龄确认:<html class="age-gate"> 时显示弹层、模糊其余内容(class 由 base.html 头部脚本加) */
.age-modal { display: none; }
html.age-gate { overflow: hidden; }
html.age-gate body > :not(.age-modal) { filter: blur(24px); pointer-events: none; user-select: none; }
html.age-gate .age-modal { display: flex; position: fixed; inset: 0; z-index: 100; align-items: center;
  justify-content: center; padding: 16px; background: rgba(23, 23, 28, .55); }
.age-box { background: var(--card); border-radius: var(--radius); padding: 28px; max-width: 440px; width: 100%;
  display: flex; flex-direction: column; gap: 14px; }
.age-box h2 { margin: 0; font-size: 22px; }
.age-box p { margin: 0; color: var(--ink2); line-height: 1.7; font-size: 15px; }
.age-act { display: flex; flex-wrap: wrap; gap: 10px; }
