/* ===== geek.log 深色极客风博客 ===== */
:root {
  --bg: rgba(10,14,20,.6);
  --bg-soft: rgba(15,21,32,.72);
  --bg-card: rgba(17,24,38,.8);
  --border: #1e2a3a;
  --text: #c9d4e3;
  --text-dim: #7a8aa0;
  --accent: #4ade80;
  --accent-2: #22d3ee;
  --warn: #fbbf24;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: linear-gradient(rgba(10,14,20,.65), rgba(10,14,20,.7)), url(assets/bg.jpg?v=20260907) center / cover no-repeat fixed;
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.75;
  min-height: 100vh; min-height: 100dvh;
}
::selection { background: rgba(74, 222, 128, .25); }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); }

/* 扫描线氛围 */
body::before {
  content: "";
  position: fixed; inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(255,255,255,.012) 2px 4px);
  pointer-events: none; z-index: 999;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 0 24px; }

/* 导航 */
nav {
  position: sticky; top: 0; z-index: 500;
  background: rgba(10,14,20,.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-family: var(--mono); font-size: 17px; color: var(--accent); font-weight: 700; }
.logo .cursor { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
nav ul { display: flex; gap: 26px; list-style: none; font-family: var(--mono); font-size: 14px; }
nav ul a { color: var(--text-dim); }
nav ul a:hover { color: var(--accent); text-decoration: none; }
nav ul a::before { content: "./"; color: var(--accent); opacity: .6; }

/* Hero 终端窗口 */
.hero { padding: 56px 0 40px; }
.term {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
}
.term-bar {
  display: flex; align-items: center; gap: 8px;
  background: #131b29; padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.r { background: #ff5f56; } .dot.y { background: #ffbd2e; } .dot.g { background: #27c93f; }
.term-bar .title { margin-left: 10px; font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.term-body { padding: 22px 24px; font-family: var(--mono); font-size: 14px; }
.term-body .ln { margin-bottom: 8px; white-space: pre-wrap; }
.p { color: var(--accent); }  /* prompt */
.c { color: var(--text-dim); } /* comment */
.o { color: var(--text); }
.k { color: var(--accent-2); } /* keyword */
.hl { color: var(--warn); }

/* 区块 */
section { padding: 40px 0; }
.sec-title {
  font-family: var(--mono); font-size: 16px; color: var(--accent);
  margin-bottom: 24px; display: flex; align-items: center; gap: 10px;
}
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.sec-title .num { color: var(--text-dim); font-size: 13px; }

/* 标签筛选 */
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.tag-btn {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--bg-card); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 13px; cursor: pointer; transition: all .18s;
}
.tag-btn:hover { color: var(--accent); border-color: var(--accent); }
.tag-btn.active { color: #052e16; background: var(--accent); border-color: var(--accent); font-weight: 700; }

/* 文章卡片 */
.post-list { display: flex; flex-direction: column; gap: 16px; }
.post-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 22px 26px;
  transition: transform .18s, border-color .18s;
  display: block;
}
.post-card:hover { transform: translateY(-2px); border-color: var(--accent); text-decoration: none; }
.post-card h3 { font-size: 18px; color: var(--text); margin-bottom: 8px; }
.post-card:hover h3 { color: var(--accent); }
.post-card .meta { font-family: var(--mono); font-size: 12.5px; color: var(--text-dim); margin-bottom: 10px; display: flex; gap: 16px; flex-wrap: wrap; }
.post-card .excerpt { font-size: 14px; color: var(--text-dim); }
.post-card .ptags { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.ptag { font-family: var(--mono); font-size: 11px; color: var(--accent-2); background: rgba(34,211,238,.08); border: 1px solid rgba(34,211,238,.25); border-radius: 4px; padding: 2px 8px; }
.post-card.hidden { display: none; }

/* 归档时间线 */
.timeline { border-left: 2px solid var(--border); padding-left: 24px; margin-left: 6px; }
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item::before {
  content: ""; position: absolute; left: -31px; top: 8px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.tl-date { font-family: var(--mono); font-size: 12.5px; color: var(--text-dim); }
.tl-item a { font-size: 15px; }

/* 页脚 */
footer { border-top: 1px solid var(--border); padding: 26px 0 40px; margin-top: 30px; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-family: var(--mono); font-size: 12.5px; color: var(--text-dim); }

/* 文章页 */
article.post-page { padding: 50px 0 30px; }
article.post-page h1 { font-size: 26px; margin: 14px 0 18px; line-height: 1.4; }
article.post-page .meta { font-family: var(--mono); font-size: 13px; color: var(--text-dim); margin-bottom: 30px; display: flex; gap: 18px; flex-wrap: wrap; }
.post-content h2 { font-size: 19px; color: var(--accent); margin: 34px 0 14px; }
.post-content h2::before { content: "## "; color: var(--text-dim); font-family: var(--mono); font-size: 15px; }
.post-content p { margin-bottom: 16px; font-size: 15.5px; }
.post-content pre {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px;
  padding: 18px 20px; overflow-x: auto; margin: 18px 0 22px;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.7;
}
.post-content code.inline { font-family: var(--mono); color: var(--accent); background: rgba(74,222,128,.08); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.post-content blockquote {
  border-left: 3px solid var(--accent); background: rgba(74,222,128,.04);
  padding: 10px 18px; margin: 18px 0; color: var(--text-dim); border-radius: 0 8px 8px 0;
}
.back-home { display: inline-block; font-family: var(--mono); font-size: 13.5px; margin-bottom: 6px; }

@media (max-width: 640px) {
  nav ul { gap: 12px; font-size: 12px; }
  nav .wrap, .wrap { padding: 0 14px; }
  .term-body { font-size: 12.5px; }
  /* 触屏端隐藏右侧竖向指示器(易遮挡+无滚轮语义) */
  #scrollRail { display: none; }
  /* 封面图压缩纵向占比, 留出导航与底部备案栏 */
  .cover-panel img { max-height: 50vh; max-height: 50dvh; }
  /* 开场加载 logo 缩小 */
  .pl-logo-wrap { width: 118px; height: 118px; }
  /* 图片墙双列更紧凑 */
  .img-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .img-cell img { height: 108px; }
  /* 长串文本(链接/代码)不撑破容器 */
  article, .cmt-panel, .bContent, pre { overflow-wrap: anywhere; word-break: break-word; }
  pre { overflow-x: auto; max-width: 100%; }
  /* 备案栏更紧凑 */
  .beian-bar { font-size: 11px; padding: 3px 8px 30px; }
}

/* ===== 备案栏（参考运营商官网规范：独立居中底部栏） ===== */
.beian-bar {
  text-align: center;
  padding: 4px 0 34px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-dim);
}
.beian-bar a { color: var(--text-dim); }
.beian-bar a:hover { color: var(--accent); }
.beian-bar .sep { margin: 0 10px; opacity: .5; }

/* logo 可点击返回首页 */
a.logo { text-decoration: none; display: inline-block; }
a.logo:hover { text-decoration: none; opacity: .85; }

/* ===== 用户管理面板 ===== */
.user-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 4px; border-bottom: 1px dashed var(--border);
}
.user-row.u-disabled { opacity: .55; }
.role-badge {
  font-family: var(--mono); font-size: 10px; padding: 1px 7px;
  border-radius: 4px; vertical-align: 1px;
  color: #052e16; background: var(--accent);
}
.role-badge.member { color: var(--accent-2); background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.3); }
.role-badge.disabled { color: #f87171; background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.3); }
.role-badge.me { color: var(--warn); background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.3); }

/* ===== 成员图片墙 + 内容锁 ===== */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.img-cell {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; display: block; transition: transform .18s, border-color .18s;
}
.img-cell:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.img-cell img { width: 100%; height: 130px; object-fit: cover; display: block; }
.img-cap { font-family: var(--mono); font-size: 11px; color: var(--text-dim); padding: 8px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lock-card { color: var(--text-dim); text-align: center; font-family: var(--mono); font-size: 13.5px; }

/* ===== 访客门禁：need-auth 板块默认隐藏，登录后由 JS 移除标记 ===== */
section.need-auth { display: none; }

/* ===== 板块设置面板 ===== */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pick-cell {
  border: 2px solid var(--border); border-radius: 8px; overflow: hidden;
  cursor: pointer; background: var(--bg); transition: border-color .15s;
}
.pick-cell:hover { border-color: var(--accent-2); }
.pick-cell.sel { border-color: var(--accent); }
.pick-cell img { width: 100%; height: 90px; object-fit: cover; display: block; }
.pick-cell .none-lab {
  height: 90px; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; color: var(--text-dim);
}

/* ===== 主页 logo 占位区 ===== */
.logo-placeholder {
  border: 2px dashed var(--border); border-radius: 12px;
  padding: 72px 20px; text-align: center;
  font-family: var(--mono); font-size: 14px; color: var(--text-dim);
}

/* ===== 权限开关按钮 ===== */
.mini-btn.perm.on { color: var(--accent); border-color: rgba(74,222,128,.45); }
.mini-btn.perm.off { color: #f87171; border-color: rgba(248,113,113,.45); }

/* ===== 站点 logo 图标（圆环Y） ===== */
.logo-img {
  height: 26px; width: 26px;
  border-radius: 50%;
  vertical-align: -7px;
  margin-right: 8px;
  border: 1px solid var(--border);
  background: #000;
}

/* ===== 讨论板块 ./talk ===== */
.talk-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; }
.talk-input-row { display: flex; gap: 10px; margin-bottom: 18px; }
.talk-input-row input {
  flex: 1; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px; font-family: var(--mono); font-size: 13.5px; outline: none;
}
.talk-input-row input:focus { border-color: var(--accent); }
.talk-list { max-height: 420px; overflow-y: auto; }
.talk-msg { display: flex; gap: 12px; padding: 12px 2px; border-bottom: 1px dashed var(--border); align-items: flex-start; }
.talk-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: rgba(74,222,128,.12); border: 1px solid rgba(74,222,128,.4);
  color: var(--accent); font-family: var(--mono); font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.talk-body { flex: 1; min-width: 0; }
.talk-meta { font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); margin-bottom: 4px; }
.talk-meta b { color: var(--accent-2); }
.talk-text { font-size: 14.5px; color: var(--text); overflow-wrap: break-word; white-space: pre-wrap; }
.talk-del { flex-shrink: 0; }

/* ===== 访客首图热区 ===== */
.hero-hotspot {
  position: absolute; display: block; border-radius: 6px;
  cursor: pointer; transition: background .15s, box-shadow .15s;
}
.hero-hotspot:hover {
  background: rgba(74,222,128,.10);
  box-shadow: 0 0 0 2px rgba(74,222,128,.55);
}

/* ===== 公安备案徽标 ===== */
.ghs-badge { height: 14px; width: auto; vertical-align: -2px; margin-right: 4px; }
.ghs-badge { height: 15px; width: 15px; object-fit: contain; vertical-align: -3px; margin-right: 4px; }

/* ===== Lusion 式滚动体验: 右侧竖向分段指示器 + 交错浮现 ===== */
#scrollRail {
  position: fixed; right: 22px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  z-index: 550;
}
.rail-seg {
  width: 3px; height: 18px; border-radius: 2px;
  background: rgba(201,212,227,.28);
  cursor: pointer;
  transition: height .35s cubic-bezier(.16,1,.3,1), background .25s, box-shadow .25s;
}
.rail-seg:hover { background: rgba(201,212,227,.6); }
.rail-seg.cur {
  height: 34px; background: var(--accent);
  box-shadow: 0 0 8px rgba(74,222,128,.6);
}
.rv {
  opacity: 0; transform: translateY(30px);
  transition: opacity .75s ease, transform .75s cubic-bezier(.16, 1, .3, 1);
  will-change: opacity, transform;
}
.rv.in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
}

/* Lusion式: 惯性平滑滚动, 无吸附 */
#guestHero, #logoSlot, #boards {
  min-height: 100vh; min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#guestHero { min-height: 100vh; min-height: 100dvh; }

/* ===== 讨论互动: 观看/闪电/评论 ===== */
.discuss-stats {
  display: flex; align-items: center; gap: 16px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-family: var(--mono); font-size: 12.5px; color: var(--text-dim);
}
.dstat { background: none; border: none; cursor: default; padding: 2px 4px; color: var(--text-dim); font-family: var(--mono); font-size: 12.5px; }
.dstat b { color: var(--text); }
button.dstat { cursor: pointer; transition: color .15s; }
button.dstat:hover { color: var(--accent); }
.like-btn.liked { color: var(--warn); }
.like-btn.liked b { color: var(--warn); }
.cmt-panel {
  margin-top: 12px; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px;
}
.cmt-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); align-items: flex-start; }
.cmt-del { padding: 0 8px; height: 24px; line-height: 22px; }

/* ===== 开场加载动画(Lusion式) ===== */
#preloader {
  position: fixed; inset: 0; z-index: 3000;
  background: #0a0e14;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity .65s ease .2s;
}
#preloader.hide { opacity: 0; pointer-events: none; }
.pl-logo-wrap {
  position: relative; width: 170px; height: 170px;
  transition: transform .75s cubic-bezier(.16, 1, .3, 1), opacity .5s ease .2s;
}
.pl-ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.pl-ring circle { fill: none; stroke-width: 3; }
.pl-ring .ring-bg { stroke: var(--border); }
.pl-ring .ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 439.8; stroke-dashoffset: 439.8; }
.pl-logo { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 112px; height: 112px; border-radius: 50%; }
.pl-pct { font-family: var(--mono); font-size: 15px; color: var(--accent); margin-top: 20px; }
.pl-text { font-family: var(--mono); font-size: 11px; color: var(--text-dim); margin-top: 6px; letter-spacing: 3px; }

/* ===== 登录态同步应用(防访客界面闪现) ===== */
html.gl-in #guestHero { display: none !important; }
html.gl-in #logoSlot { display: flex !important; }
html:not(.gl-in) .need-auth { display: none !important; }

/* ===== 板块封面选择页(登录后) ===== */

.board-panel {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; min-height: 100dvh;
  position: relative;
}
.board-panel img {
  width: auto; max-width: min(92vw, 960px); max-height: 70vh;
  display: block; border-radius: 10px; border: 1px solid var(--border);
  opacity: 0; transform: scale(.45);
  transition: transform .75s cubic-bezier(.16,1,.3,1), opacity .55s ease, filter .35s;
}
.board-panel.active img { opacity: 1; transform: scale(1); }
.board-panel.active:hover img { transform: scale(1.03); filter: brightness(1.12); }

/* 触屏: 原生吸附翻页 */
@media (hover: none), (pointer: coarse) {
  html { scroll-snap-type: y mandatory; }
  .board-panel { scroll-snap-align: start; scroll-snap-stop: always; }
}
