/* IT博客 - 静态站样式 v2（美化版） */
:root {
  --bg: #f2f4fa;
  --fg: #26272f;
  --muted: #7a7f8c;
  --accent: #5b6bf0;
  --accent2: #a05cf0;
  --card: #ffffff;
  --border: #e6e8f2;
  --code-bg: #f3f4f9;
  --shadow: 0 2px 12px rgba(90, 100, 200, 0.07);
  --shadow-hover: 0 10px 28px rgba(90, 100, 200, 0.16);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--fg);
  font: 16px/1.8 -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(160deg, #eef1fb 0%, #f7f3fb 45%, #eef7fa 100%) fixed;
  min-height: 100vh;
}
/* 粒子画布铺满全屏，位于内容之下 */
#bg-canvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.6;
}
.wrap { max-width: 800px; margin: 0 auto; padding: 0 20px; }
main.wrap { position: relative; z-index: 1; padding-top: 32px; padding-bottom: 60px; min-height: 70vh; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent2); }
::selection { background: rgba(91, 107, 240, 0.25); }

/* 阅读进度条 */
#read-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  z-index: 99; border-radius: 0 3px 3px 0; transition: width 0.08s linear;
}

/* 顶栏：毛玻璃 */
.site-header {
  background: rgba(255, 255, 255, 0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.site-logo {
  font-size: 20px; font-weight: 800; letter-spacing: 0.5px;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.site-nav a { margin-left: 20px; color: var(--muted); font-size: 15px; position: relative; }
.site-nav a::after {
  content: ''; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px; transition: width 0.25s;
}
.site-nav a:hover { color: var(--accent); text-decoration: none; }
.site-nav a:hover::after { width: 100%; }

/* 文章卡片 */
.post-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 26px; margin-bottom: 20px; box-shadow: var(--shadow);
  transition: transform 0.22s, box-shadow 0.22s;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.post-title { margin: 0 0 6px; font-size: 20px; line-height: 1.5; }
.post-title a { color: var(--fg); }
.post-title a:hover { color: var(--accent); text-decoration: none; }
.post-meta { font-size: 13px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.post-meta .cat {
  color: var(--accent); background: rgba(91, 107, 240, 0.08);
  padding: 1px 10px; border-radius: 20px;
}
.post-summary { margin: 10px 0 8px; color: #555b6b; font-size: 14.5px; }
.tag {
  display: inline-block; font-size: 12px; color: var(--muted);
  background: var(--code-bg); border-radius: 4px; padding: 1px 8px; margin-right: 6px;
  transition: all 0.2s;
}
.tag:hover { color: #fff; background: var(--accent); text-decoration: none; }

/* 分页 */
.pager { text-align: center; margin: 34px 0 10px; }
.pg {
  display: inline-block; padding: 5px 16px; margin: 0 6px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--card);
  box-shadow: var(--shadow); transition: all 0.2s;
}
.pg:hover { color: #fff; background: var(--accent); border-color: var(--accent); text-decoration: none; }
.pg.cur { color: var(--muted); border-style: dashed; background: transparent; }
.pg.cur:hover { color: var(--muted); background: transparent; border-color: var(--border); }

/* 文章页 */
.page-title { font-size: 24px; border-bottom: 2px solid var(--border); padding-bottom: 10px; }
.post-full {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 34px 36px; box-shadow: var(--shadow);
}
.post-full h1 {
  margin-top: 0; font-size: 27px; line-height: 1.45;
  background: linear-gradient(120deg, var(--fg), #4550a0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.post-content { margin-top: 20px; }
.post-content h2, .post-content h3 {
  border: none; padding-left: 12px; position: relative; margin-top: 1.6em;
}
.post-content h2::before, .post-content h3::before {
  content: ''; position: absolute; left: 0; top: 0.18em; bottom: 0.18em; width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent2)); border-radius: 2px;
}
.post-content img {
  max-width: 100%; height: auto; border-radius: 8px;
  box-shadow: var(--shadow); transition: transform 0.25s;
}
.post-content img:hover { transform: scale(1.015); }
.post-content pre, .codehilite {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.65;
}
.post-content code { background: var(--code-bg); border-radius: 4px; padding: 1px 6px; font-size: 0.88em; color: #b34a8e; }
.post-content pre code, .codehilite code { background: none; padding: 0; color: inherit; }
.post-content blockquote { margin: 0; padding: 6px 16px; color: var(--muted); border-left: 3px solid var(--accent); background: rgba(91,107,240,0.04); border-radius: 0 8px 8px 0; }
.post-content table { border-collapse: collapse; width: 100%; }
.post-content th { background: var(--code-bg); }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 6px 12px; }
.post-content .codehilite { margin: 16px 0; }
.post-tags { margin-top: 26px; }
.post-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; font-size: 14px; flex-wrap: wrap; }
.post-nav a { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 9px 16px; box-shadow: var(--shadow); transition: all 0.2s; }
.post-nav a:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

/* 评论 */
.comments { margin-top: 26px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 22px 26px; box-shadow: var(--shadow); }
.comment { display: flex; gap: 12px; padding: 12px 0; border-top: 1px dashed var(--border); }
.comment .avatar { width: 38px; height: 38px; border-radius: 50%; }
.comment p { margin: 4px 0 0; }
.cmt-note { color: var(--muted); font-size: 13px; }

/* 归档/列表 */
.index-list, .archive-list { list-style: none; padding: 0; }
.archive-list li { padding: 7px 0; border-bottom: 1px dashed var(--border); transition: padding-left 0.2s; }
.archive-list li:hover { padding-left: 8px; }
.archive-list time { color: var(--muted); font-size: 13px; margin-right: 14px; }
.archive-list h2 { margin-top: 30px; }

/* 火箭回顶按钮 */
#rocket-btn {
  position: fixed; right: 26px; bottom: 30px; width: 48px; height: 48px;
  border: none; border-radius: 50%; cursor: pointer; font-size: 22px; z-index: 50;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; box-shadow: var(--shadow-hover);
  opacity: 0; transform: translateY(20px) scale(0.8); pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
#rocket-btn.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
#rocket-btn:hover { transform: translateY(-4px) scale(1.06) !important; }
#rocket-btn.launch { transition: transform 0.6s cubic-bezier(0.5, -0.5, 0.7, -0.5), opacity 0.5s 0.2s; transform: translateY(-120vh) rotate(-35deg) !important; opacity: 0 !important; }

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; padding: 22px 0 30px; text-align: center; position: relative; z-index: 1; }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c9cde0; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 640px) {
  .site-header .wrap { height: auto; padding: 10px 16px; flex-wrap: wrap; }
  .site-nav { width: 100%; }
  .site-nav a { margin: 0 14px 0 0; }
  .post-full { padding: 22px 20px; }
  #rocket-btn { right: 16px; bottom: 20px; }
  #bg-canvas { opacity: 0.4; }
}

@media (prefers-reduced-motion: reduce) {
  #bg-canvas { display: none; }
  * { transition: none !important; }
}

/* pygments */
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.codehilite .hll { background-color: #ffffcc }
.codehilite { background: #f8f8f8; }
.codehilite .c { color: #3D7B7B; font-style: italic } /* Comment */
.codehilite .err { border: 1px solid #F00 } /* Error */
.codehilite .k { color: #008000; font-weight: bold } /* Keyword */
.codehilite .o { color: #666 } /* Operator */
.codehilite .ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */
.codehilite .cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */
.codehilite .cp { color: #9C6500 } /* Comment.Preproc */
.codehilite .cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */
.codehilite .c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */
.codehilite .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
.codehilite .gd { color: #A00000 } /* Generic.Deleted */
.codehilite .ge { font-style: italic } /* Generic.Emph */
.codehilite .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.codehilite .gr { color: #E40000 } /* Generic.Error */
.codehilite .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.codehilite .gi { color: #008400 } /* Generic.Inserted */
.codehilite .go { color: #717171 } /* Generic.Output */
.codehilite .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.codehilite .gs { font-weight: bold } /* Generic.Strong */
.codehilite .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.codehilite .gt { color: #04D } /* Generic.Traceback */
.codehilite .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.codehilite .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.codehilite .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.codehilite .kp { color: #008000 } /* Keyword.Pseudo */
.codehilite .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.codehilite .kt { color: #B00040 } /* Keyword.Type */
.codehilite .m { color: #666 } /* Literal.Number */
.codehilite .s { color: #BA2121 } /* Literal.String */
.codehilite .na { color: #687822 } /* Name.Attribute */
.codehilite .nb { color: #008000 } /* Name.Builtin */
.codehilite .nc { color: #00F; font-weight: bold } /* Name.Class */
.codehilite .no { color: #800 } /* Name.Constant */
.codehilite .nd { color: #A2F } /* Name.Decorator */
.codehilite .ni { color: #717171; font-weight: bold } /* Name.Entity */
.codehilite .ne { color: #CB3F38; font-weight: bold } /* Name.Exception */
.codehilite .nf { color: #00F } /* Name.Function */
.codehilite .nl { color: #767600 } /* Name.Label */
.codehilite .nn { color: #00F; font-weight: bold } /* Name.Namespace */
.codehilite .nt { color: #008000; font-weight: bold } /* Name.Tag */
.codehilite .nv { color: #19177C } /* Name.Variable */
.codehilite .ow { color: #A2F; font-weight: bold } /* Operator.Word */
.codehilite .w { color: #BBB } /* Text.Whitespace */
.codehilite .mb { color: #666 } /* Literal.Number.Bin */
.codehilite .mf { color: #666 } /* Literal.Number.Float */
.codehilite .mh { color: #666 } /* Literal.Number.Hex */
.codehilite .mi { color: #666 } /* Literal.Number.Integer */
.codehilite .mo { color: #666 } /* Literal.Number.Oct */
.codehilite .sa { color: #BA2121 } /* Literal.String.Affix */
.codehilite .sb { color: #BA2121 } /* Literal.String.Backtick */
.codehilite .sc { color: #BA2121 } /* Literal.String.Char */
.codehilite .dl { color: #BA2121 } /* Literal.String.Delimiter */
.codehilite .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.codehilite .s2 { color: #BA2121 } /* Literal.String.Double */
.codehilite .se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */
.codehilite .sh { color: #BA2121 } /* Literal.String.Heredoc */
.codehilite .si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */
.codehilite .sx { color: #008000 } /* Literal.String.Other */
.codehilite .sr { color: #A45A77 } /* Literal.String.Regex */
.codehilite .s1 { color: #BA2121 } /* Literal.String.Single */
.codehilite .ss { color: #19177C } /* Literal.String.Symbol */
.codehilite .bp { color: #008000 } /* Name.Builtin.Pseudo */
.codehilite .fm { color: #00F } /* Name.Function.Magic */
.codehilite .vc { color: #19177C } /* Name.Variable.Class */
.codehilite .vg { color: #19177C } /* Name.Variable.Global */
.codehilite .vi { color: #19177C } /* Name.Variable.Instance */
.codehilite .vm { color: #19177C } /* Name.Variable.Magic */
.codehilite .il { color: #666 } /* Literal.Number.Integer.Long */