/* ============================================================
   白穆 · 个人博客 全站样式 (深色科技风, 与手势遥控器 App 统一)
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --cyan: #22D3EE; --cyan-soft: #67E8F9; --orange: #FFCC80; --purple: #A78BFA;
  --bg1: #060A14; --bg2: #0B1226;
  --glass: rgba(34, 211, 238, 0.06); --glass2: rgba(34, 211, 238, 0.1);
  --line: rgba(34, 211, 238, 0.18); --line2: rgba(34, 211, 238, 0.35);
  --text: #E6EEF9; --dim: #8FA3C8; --dim2: #B9C7DE;
}
html { scroll-behavior: smooth; }
::selection { background: rgba(34,211,238,.35); color: #E0F7FF; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #070C18; }
::-webkit-scrollbar-thumb { background: rgba(34,211,238,.25); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(34,211,238,.45); }
body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(180deg, rgba(6,10,20,.82), rgba(6,10,20,.88)),
    url("/static/bg.jpg") center top / cover no-repeat #060A14;
  background-attachment: fixed, fixed;
  color: var(--text); line-height: 1.75; overflow-x: hidden;
}
a { color: var(--cyan); text-decoration: none; }
#pjview { transition: opacity .2s ease; min-height: 55vh; }  /* PJAX 局部换页容器 */
img { max-width: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; margin: 0 auto; padding: 0 24px; }

/* 全站纵向呼吸感: 主体顶距 + 各节间距 */
main { padding: 46px 0 34px; }
main > section { padding: 30px 0; }

/* ---------------- 导航 ---------------- */
nav {
  position: sticky; top: 0; z-index: 99;
  background: rgba(6, 10, 20, 0.78); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 12px; }
.logo { font-weight: 700; font-size: 18px; letter-spacing: 2px; color: var(--text); }
.logo b { color: var(--cyan); }
.logo small { display: block; font-size: 9px; letter-spacing: 5px; color: var(--dim); font-weight: 400; line-height: 1; }
.navlinks { display: flex; gap: 22px; font-size: 14px; }
.navlinks a { color: var(--dim); transition: color .2s; letter-spacing: 1px; }
.navlinks a:hover, .navlinks a.on { color: var(--cyan); }

/* ---------------- 页脚 ---------------- */
footer { border-top: 1px solid var(--line); padding: 44px 0 28px; margin-top: 70px; }
footer .wrap { color: var(--dim); font-size: 13px; }
.foot-grid { display: grid; grid-template-columns: 1.2fr 1.4fr 1fr; gap: 34px; }
.foot-brand .foot-logo { font-weight: 700; font-size: 20px; letter-spacing: 2px; color: var(--text); }
.foot-brand .foot-logo b { color: var(--cyan); }
.foot-brand p { margin-top: 10px; line-height: 1.9; }
.foot-col h5 { font-size: 13px; letter-spacing: 2px; color: var(--text); margin-bottom: 12px; }
.foot-col a { display: block; color: var(--dim); padding: 4px 0; }
.foot-col a:hover { color: var(--cyan); }
.foot-col .foot-more { color: var(--cyan); }
.foot-base { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-top: 30px; padding-top: 18px; border-top: 1px dashed rgba(34, 211, 238, .12); }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--cyan); }
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr; gap: 26px; } }

/* ---------------- 通用组件 ---------------- */
.badge {
  display: inline-block; padding: 4px 16px; border: 1px solid var(--line);
  border-radius: 999px; color: var(--cyan); font-size: 12.5px; letter-spacing: 3px;
  background: var(--glass);
}
.btn {
  display: inline-block; padding: 12px 34px; border-radius: 12px; font-size: 15px;
  letter-spacing: 2px; border: 1px solid var(--line); transition: .2s; cursor: pointer;
  background: transparent; color: var(--cyan); font-family: inherit;
}
.btn-main {
  background: linear-gradient(120deg, #0891B2, #6D28D9); color: #E0F7FF; font-weight: 700;
  box-shadow: 0 0 26px rgba(34, 211, 238, .3);
}
.btn-main:hover { box-shadow: 0 0 40px rgba(34, 211, 238, .55); transform: translateY(-2px); }
.btn-ghost:hover { background: var(--glass); }
.btn-sm { padding: 6px 16px; font-size: 13px; border-radius: 9px; }
.btn-danger { border-color: rgba(248, 113, 113, .4); color: #f87171; }
.btn-danger:hover { background: rgba(248, 113, 113, .1); }

.card {
  border: 1px solid var(--line); border-radius: 18px; padding: 28px 26px;
  background: linear-gradient(160deg, rgba(34,211,238,.07), rgba(167,139,250,.05));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: .25s; display: block;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 44px rgba(34,211,238,.15); border-color: var(--line2); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }

.sec-title { font-size: 28px; letter-spacing: 4px; margin-bottom: 8px; }
.sec-sub { color: var(--dim); font-size: 14px; letter-spacing: 2px; margin-bottom: 40px; }
.sec-sub::before { content: "── "; color: var(--cyan); }
.sec-sub::after { content: " ──"; color: var(--cyan); }
.center { text-align: center; }

.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  padding: 4px 14px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; color: var(--dim); background: rgba(255,255,255,.02); transition: .2s;
}
.chip:hover, .chip.on { color: var(--cyan); border-color: var(--line2); background: var(--glass); }

/* ---------------- 页面头 ---------------- */
.pagehead { text-align: center; padding: 64px 0 10px; }
.pagehead h1 { font-size: 38px; letter-spacing: 6px; }
.pagehead h1 .grad {
  background: linear-gradient(100deg, #67E8F9 10%, #A78BFA 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pagehead .sub { color: var(--dim); margin-top: 10px; font-size: 15px; letter-spacing: 2px; }

/* ---------------- 文章卡片 ---------------- */
.postcard { border: 1px solid var(--line); border-radius: 16px; padding: 24px 26px; transition: .2s; display: block; background: rgba(255,255,255,.02); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.postcard:hover { border-color: var(--line2); background: var(--glass); transform: translateY(-3px); }
.postcard h3 { font-size: 18px; letter-spacing: 1px; color: var(--text); margin-bottom: 8px; }
.postcard:hover h3 { color: var(--cyan-soft); }
.postcard .sum { color: var(--dim); font-size: 14px; }
.pmeta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--dim); margin-bottom: 10px; align-items: center; }
.pmeta .cat { color: var(--orange); border: 1px solid rgba(255,204,128,.3); padding: 1px 10px; border-radius: 999px; font-size: 12px; }
.pmeta .tag { color: var(--purple); }

/* ---------------- 文章正文排版 ---------------- */
.post-body { font-size: 15.5px; color: var(--dim2); }
.post-body h1, .post-body h2, .post-body h3, .post-body h4 {
  color: var(--text); margin: 34px 0 14px; letter-spacing: 1.5px; line-height: 1.5;
}
.post-body h2 { font-size: 22px; border-left: 3px solid var(--cyan); padding-left: 14px; }
.post-body h3 { font-size: 18px; color: var(--cyan-soft); }
.post-body h4 { font-size: 16px; color: var(--purple); }
.post-body p { margin: 14px 0; }
.post-body a { border-bottom: 1px dashed var(--line2); }
.post-body ul, .post-body ol { padding-left: 26px; margin: 14px 0; }
.post-body li { margin: 6px 0; }
.post-body blockquote {
  border-left: 3px solid var(--purple); background: rgba(167,139,250,.07);
  padding: 12px 18px; margin: 18px 0; border-radius: 0 10px 10px 0; color: var(--dim);
}
.post-body code {
  background: rgba(34,211,238,.1); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 7px; font-size: 13.5px; color: var(--cyan-soft);
  font-family: Consolas, "JetBrains Mono", monospace;
}
.post-body pre {
  background: #0A101F; border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; overflow-x: auto; margin: 18px 0; line-height: 1.6;
}
.post-body pre code { background: none; border: none; padding: 0; color: #C9D6F0; font-size: 13.5px; }
.post-body table { border-collapse: collapse; width: 100%; margin: 18px 0; font-size: 14px; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 9px 14px; }
.post-body th { background: rgba(34,211,238,.08); color: var(--cyan-soft); letter-spacing: 1px; }
.post-body hr { border: none; border-top: 1px dashed var(--line); margin: 30px 0; }
.post-body img { border-radius: 12px; border: 1px solid var(--line); }

/* 代码高亮 (pygments 默认 class 输出, 暗色手工配色) */
.highlight { background: none !important; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .ow { color: #C792EA; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sd, .highlight .sa { color: #A5D6A7; }
.highlight .n, .highlight .na, .highlight .nx, .highlight .nd { color: #89DDFF; }
.highlight .nf, .highlight .fm { color: #82AAFF; }
.highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo { color: #F78C6C; }
.highlight .c, .highlight .c1, .highlight .ch, .highlight .cm, .highlight .cs { color: #5C6B8A; font-style: italic; }
.highlight .o, .highlight .p { color: #89DDFF; }
.highlight .nb, .highlight .nc, .highlight .nn { color: #FFCB6B; }
.highlight .kc { color: #FF5370; }

/* ---------------- 表单 ---------------- */
input[type=text], input[type=search], input[type=password], textarea, select {
  width: 100%; background: rgba(6,10,20,.55); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 15px;
  font-size: 14.5px; font-family: inherit; outline: none; transition: border-color .2s;
}
input:focus, textarea:focus { border-color: var(--line2); }
textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
label { display: block; font-size: 13.5px; color: var(--dim); margin: 16px 0 6px; letter-spacing: 1px; }
.form-card { border: 1px solid var(--line); border-radius: 16px; padding: 26px 28px; background: rgba(255,255,255,.02); }
.tip-ok { color: #34d399; font-size: 14px; }
.tip-err { color: #f87171; font-size: 14px; }

/* ---------------- 表格 (管理后台) ---------------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.tbl th { background: rgba(34,211,238,.08); color: var(--cyan-soft); letter-spacing: 1px; white-space: nowrap; }
.tbl tr:hover td { background: rgba(34,211,238,.04); }
.state-ok { color: #34d399; font-weight: 600; }
.state-bad { color: #f87171; font-weight: 600; }

/* ---------------- 站长互动: 公告条 / 站长回复 / 客服按钮 ---------------- */
#notice-bar {
  position: relative;
  max-width: 1080px; margin: 28px auto 0; padding: 13px 44px 14px 18px;
  border: 1px solid rgba(34,211,238,.6); border-radius: 14px;
  background: linear-gradient(110deg, rgba(34,211,238,.07) 25%, rgba(34,211,238,.17) 50%, rgba(34,211,238,.07) 75%);
  background-size: 220% 100%;
  color: var(--text);
  animation: nb-glow 2.8s ease-in-out infinite, nb-sheen 6s linear infinite;
}
@keyframes nb-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(34,211,238,.18), 0 0 28px rgba(34,211,238,.08); }
  50%      { box-shadow: 0 0 20px rgba(34,211,238,.45), 0 0 56px rgba(34,211,238,.20); }
}
@keyframes nb-sheen { 0% { background-position: 0% 0; } 100% { background-position: -220% 0; } }
.nb-tag {
  display: inline-block; color: var(--cyan); border: 1px solid var(--cyan);
  border-radius: 999px; padding: 3px 14px; font-size: 14px; font-weight: 600;
  letter-spacing: 1px; white-space: nowrap;
  animation: nb-tag-pulse 2.8s ease-in-out infinite;
}
@keyframes nb-tag-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(34,211,238,.2); }
  50%      { box-shadow: 0 0 12px rgba(34,211,238,.65); }
}
@media (prefers-reduced-motion: reduce) {
  #notice-bar, .nb-tag { animation: none; }
}
.nb-text {
  display: block; margin-top: 9px; text-align: left; text-indent: 2em;
  font-size: 15.5px; line-height: 1.75; word-break: break-word;
}
#nb-close {
  position: absolute; top: 12px; right: 12px;
  background: none; border: none; color: var(--dim);
  font-size: 17px; cursor: pointer; padding: 2px 6px; line-height: 1;
}
#nb-close:hover { color: var(--text); }

.owner-reply {
  display: flex; gap: 12px; margin: 12px 0 2px 50px; padding: 12px 16px;
  border-left: 2px solid var(--cyan); border-radius: 0 12px 12px 0;
  background: rgba(34,211,238,.06);
}
.owner-reply-avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; margin-top: 2px; }
.owner-reply .msg-body { font-size: 14px; }

#qq-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  border-radius: 999px; border: 1px solid rgba(34,211,238,.45);
  background: rgba(8,14,30,.88); color: var(--text); text-decoration: none;
  font-size: 13.5px; box-shadow: 0 8px 24px rgba(0,0,0,.35); transition: .2s;
}
#qq-float:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-2px); }
#qq-float svg { width: 18px; height: 18px; }
@media (max-width: 720px) {
  #notice-bar { margin: 20px 12px 0; padding: 14px 44px 16px 16px; }
  .nb-text { font-size: 15px; }
  .owner-reply { margin-left: 10px; }
  #qq-float { right: 12px; bottom: 12px; padding: 10px 13px; }
}

/* ---------------- 首页 Hero ---------------- */
.hero { text-align: center; padding: 92px 0 60px; position: relative; }
.hero .wrap { position: relative; }
.hero-title { font-size: 48px; letter-spacing: 8px; line-height: 1.3; margin-top: 22px; }
.hero-sub { color: var(--dim); margin-top: 14px; font-size: 16px; letter-spacing: 2px; }
.hero-acts { margin-top: 36px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.tool-price { color: var(--orange); font-size: 30px; font-weight: 800; }

/* ---------------- 留言板 ---------------- */
.msg-item { border: 1px solid var(--line); border-radius: 14px; padding: 18px 22px; margin-bottom: 14px; background: rgba(255,255,255,.02); }
.msg-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); margin-bottom: 6px; }
.msg-head > :last-child { margin-left: auto; }
.msg-head b { color: var(--cyan-soft); font-size: 14.5px; letter-spacing: 1px; }
.msg-body { color: var(--dim2); font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #0891B2, #6D28D9);
  display: inline-flex; align-items: center; justify-content: center;
  color: #E0F7FF; font-weight: 700; font-size: 16px;
}
.msg-row { display: flex; gap: 14px; }
.msg-main { flex: 1; min-width: 0; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 640px) {
  body { background-attachment: scroll, scroll; background-size: cover, auto cover; font-size: 15px; }

  /* 布局节奏 */
  .wrap, .narrow { padding: 0 16px; }
  main { padding: 28px 0 24px; }
  main > section { padding: 22px 0; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .card, .postcard { padding: 18px 16px; border-radius: 14px; }
  footer { margin-top: 44px; padding: 32px 0 22px; }

  /* 导航: 链接加大点击区 */
  nav .wrap { height: auto; padding: 10px 0; flex-wrap: wrap; }
  .navlinks { gap: 6px; font-size: 13px; flex-wrap: wrap; }
  .navlinks a { padding: 7px 8px; }

  /* 标题降级 */
  .pagehead { padding: 40px 0 6px; }
  .pagehead h1 { font-size: 24px; letter-spacing: 2px; }
  .sec-title { font-size: 21px; letter-spacing: 2px; }
  .sec-sub { font-size: 13px; margin-bottom: 26px; }

  /* 首页 Hero */
  .hero { padding: 52px 0 38px; }
  .hero-title { font-size: 29px; letter-spacing: 3px; margin-top: 16px; }
  .hero-sub { font-size: 14px; letter-spacing: 1px; }
  .hero-acts { margin-top: 26px; gap: 12px; }
  .hero-acts .btn { flex: 1 1 140px; text-align: center; }
  .tool-price { font-size: 24px; }

  /* 按钮: 触控高度 ≥44px */
  .btn { padding: 12px 24px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .btn-sm { min-height: 36px; }
  .chip { padding: 6px 15px; }

  /* 表单: 16px 防 iOS 聚焦缩放 */
  input[type=text], input[type=search], input[type=password], textarea, select { font-size: 16px; padding: 10px 14px; }

  /* 博客搜索行: 竖排 */
  #sform { flex-wrap: wrap; }
  #sform input { flex: 1 1 100%; }
  #sform .btn { width: 100%; margin-top: 8px; }

  /* 正文表格横向可滚 */
  .post-body table { display: block; overflow-x: auto; white-space: nowrap; }

  /* 留言板 */
  .msg-row { gap: 10px; }
  .avatar { width: 34px; height: 34px; font-size: 15px; }
  .msg-item { padding: 14px 14px; }
}

