/* ==========================================================
   基础
   ========================================================== */
:root {
  --bg:          #080b13;
  --surface:     #101724;
  --surface-2:   #151d2e;
  --line:        #222c3f;
  --line-soft:   #1a2233;
  --ink:         #dbe2ec;
  --ink-mid:     #8b97a8;
  --ink-dim:     #5e6b7d;
  --brand:       #7eb6e0;
  --brand-hover: #a3cdec;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
               "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  background-color: #080b13;
  background-image:
    radial-gradient(ellipse 120% 70% at 50% -10%,
      #16233c 0%, #0c1220 45%, #080b13 100%);
  background-attachment: fixed;
}

a { color: var(--brand); text-decoration: none; transition: color .2s; }
a:hover { color: var(--brand-hover); }
img { max-width: 100%; height: auto; border: 0; }
::selection { background: #1e3a5f; color: #eaf2fb; }

/* ==========================================================
   流星
   ========================================================== */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.meteor {
  position: absolute;
  width: 140px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg,
    rgba(190, 220, 255, 0)   0%,
    rgba(190, 220, 255, .45) 55%,
    rgba(235, 245, 255, .95) 100%);
  filter: drop-shadow(0 0 4px rgba(170, 210, 255, .55));
  transform-origin: 100% 50%;
  opacity: 0;
}

.m1 { top:  8%; left:  6%; animation: shoot 16s linear 0s    infinite; }
.m2 { top: 30%; left: 52%; animation: shoot 20s linear 6s    infinite; }
.m3 { top:  2%; left: 30%; animation: shoot 24s linear 13.5s infinite; }

@keyframes shoot {
  0%   { opacity: 0; transform: translate3d(0, 0, 0) rotate(35deg); }
  3%   { opacity: 1; }
  15%  { opacity: 1; }
  24%  { opacity: 0; transform: translate3d(620px, 434px, 0) rotate(35deg); }
  100% { opacity: 0; transform: translate3d(620px, 434px, 0) rotate(35deg); }
}

/* ==========================================================
   顶栏
   ========================================================== */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 11, 19, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.site-head-in {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-title {
  font-size: 18px;
  font-weight: 600;
  color: #e6ecf4;
  letter-spacing: .02em;
  white-space: nowrap;
}
.site-title:hover { color: var(--brand); }

.site-menu { display: flex; align-items: center; gap: 2px; }

.site-menu > a {
  padding: 6px 12px;
  border-radius: 4px;
  color: var(--ink-mid);
  font-size: 14.5px;
  white-space: nowrap;
  transition: color .2s, background .2s;
}
.site-menu > a:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }

.site-search {
  display: flex;
  align-items: stretch;
  margin-left: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, .03);
  overflow: hidden;
  transition: border-color .2s;
}
.site-search:focus-within { border-color: rgba(126, 182, 224, .5); }

.site-search input {
  width: 120px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
}
.site-search input::placeholder { color: var(--ink-dim); }

.site-search button {
  padding: 0 11px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--ink-dim);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: color .2s;
}
.site-search button:hover { color: var(--brand); }

.site-menu-check { display: none; }
.site-menu-btn { display: none; }

/* ==========================================================
   两栏布局（保证透明，流星才透得出来）
   ========================================================== */
#main {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 32px 20px;
  display: flex;
  align-items: flex-start;
  gap: 40px;
  background: transparent !important;
}
#mainContent { flex: 1; min-width: 0; background: transparent !important; }
#sideBar {
  width: 250px;
  flex-shrink: 0;
  position: sticky;
  top: 96px;
  background: transparent !important;
}

#navigator,
#blogTitle,
#footer { display: none !important; }

/* ==========================================================
   文章
   ========================================================== */
.post, .day {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 36px 40px;
  margin-bottom: 24px;
  transition: border-color .25s;
}
.post:hover, .day:hover { border-color: #2c3a52; }

.dayTitle {
  margin: 0 0 16px;
  color: var(--ink-dim);
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: .12em;
}

.postTitle, .postTitle2 {
  margin: 0 0 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.45;
}
.postTitle a, .postTitle2 a { color: #e6ecf4; transition: color .2s; }
.postTitle a:hover, .postTitle2 a:hover { color: var(--brand); }

.postBody {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.85;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.postBody p { margin: 0 0 1.15em; }
.postBody p:last-child { margin-bottom: 0; }

.postBody h2, .postBody h3, .postBody h4,
.postBody h5, .postBody h6 {
  color: #e6ecf4;
  font-weight: 600;
  line-height: 1.5;
}
.postBody h2 { margin: 2em 0 .8em; font-size: 1.35rem; }
.postBody h3 { margin: 1.7em 0 .7em; font-size: 1.15rem; }
.postBody h4, .postBody h5, .postBody h6 { margin: 1.5em 0 .6em; font-size: 1rem; }

.postBody a {
  color: var(--brand);
  border-bottom: 1px solid rgba(126, 182, 224, .3);
  transition: color .2s, border-color .2s;
}
.postBody a:hover { color: var(--brand-hover); border-bottom-color: rgba(163, 205, 236, .6); }

.postBody ul, .postBody ol { margin: .9em 0; padding-left: 1.7em; }
.postBody li { margin: .3em 0; }

.postBody blockquote {
  margin: 1.4em 0;
  padding: 6px 0 6px 20px;
  border-left: 3px solid #2c3a52;
  color: var(--ink-mid);
}
.postBody blockquote p:last-child { margin-bottom: 0; }

.postBody hr { height: 1px; margin: 2.4em 0; border: 0; background: var(--line); }
.postBody img { margin: 8px 0; border-radius: 4px; }

.postBody table {
  width: 100%;
  margin: 1.4em 0;
  border-collapse: collapse;
  font-size: 15px;
}
.postBody th, .postBody td {
  padding: 10px 14px;
  border: 1px solid var(--line);
  text-align: left;
}
.postBody th { background: var(--surface-2); color: #e6ecf4; font-weight: 600; }

/* 代码 */
.postBody code {
  padding: 2px 6px;
  border-radius: 3px;
  background: #172234;
  color: #9ec5e5;
  font-family: "SF Mono", "JetBrains Mono", Consolas, Monaco, monospace;
  font-size: .87em;
}
.postBody pre,
.cnblogs_code,
.cnblogs_code pre {
  margin: 1.4em 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0b1220 !important;
  color: #b8c8db !important;
  font-family: "SF Mono", "JetBrains Mono", Consolas, Monaco, monospace;
  font-size: 13.5px;
  line-height: 1.75;
  overflow-x: auto;
}
.postBody pre code { padding: 0; background: none; color: inherit; font-size: inherit; }

.postDesc, .postfoot {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-dim);
  font-size: 13px;
  line-height: 1.9;
}
.postDesc a, .postfoot a { color: var(--ink-mid); }
.postDesc a:hover, .postfoot a:hover { color: var(--brand); }

/* 分页 */
.pager, #nav_next_page {
  margin: 28px 0 10px;
  text-align: center;
  color: var(--ink-dim);
  font-size: 14px;
}
.pager a, #nav_next_page a {
  display: inline-block;
  margin: 0 3px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink-mid);
  transition: border-color .2s, color .2s;
}
.pager a:hover, #nav_next_page a:hover { border-color: var(--brand); color: var(--brand); }

/* 评论 */
.commentList .comment {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px 24px;
  margin-bottom: 14px;
}
.commentList .comment .comment_text { color: var(--ink); }
.commentList .comment .comment_quote { color: var(--ink-dim); }

/* ==========================================================
   侧边栏公告
   ========================================================== */
#sidebar_postcategory,
#sidebar_postcategory .newsItem,
#blog-news,
#blog-news .newsItem,
#sidebar_news,
#sidebar_news .newsItem {
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  float: none !important;
}

.notice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px 22px 18px;
  width: 100%;
  box-sizing: border-box;
}

.notice-title {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
  color: #e6ecf4;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
}

.notice-body p {
  margin: 0 0 10px;
  color: var(--ink-mid);
  font-size: 13.5px;
  line-height: 1.8;
}
.notice-body p:last-child { margin-bottom: 0; }

.notice-sign {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  text-align: right;
  color: var(--ink-dim);
  font-size: 12px;
  letter-spacing: .08em;
}

/* 侧边栏其他模块统一风格 */
#sideBar .catListTitle,
#sideBar h3,
#sideBar .sidebar_title {
  margin: 0 0 12px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line-soft);
  color: #e6ecf4;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
}
#sideBar ul { margin: 0; padding: 0; list-style: none; }
#sideBar li {
  padding: 6px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 13.5px;
  line-height: 1.6;
}
#sideBar li:last-child { border-bottom: 0; }
#sideBar li a { color: var(--ink-mid); }
#sideBar li a:hover { color: var(--brand); }

/* ==========================================================
   页脚
   ========================================================== */
.site-foot {
  position: relative;
  z-index: 1;
  margin-top: 48px;
  padding: 40px 32px;
  border-top: 1px solid var(--line-soft);
  background: rgba(8, 11, 19, .55);
}
.site-foot-in { max-width: 1080px; margin: 0 auto; text-align: center; }
.site-foot-title {
  margin: 0 0 10px;
  color: #c8d3e0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .06em;
}
.site-foot-line { margin: 4px 0; color: var(--ink-dim); font-size: 13px; }
.site-foot-line span { margin: 0 3px; }
.site-foot-line a { color: var(--ink-mid); }
.site-foot-line a:hover { color: var(--brand); }

.to-top {
  position: fixed;
  right: 24px;
  bottom: 28px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(16, 23, 36, .9);
  color: var(--ink-mid);
  font-size: 15px;
  line-height: 1;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color .2s, color .2s;
}
.to-top:hover { border-color: var(--brand); color: var(--brand); }

/* ==========================================================
   响应式
   ========================================================== */
@media (max-width: 900px) {
  .site-menu-btn {
    display: flex; flex-direction: column; justify-content: center;
    gap: 5px; width: 34px; height: 34px; padding: 0 6px; cursor: pointer;
  }
  .site-menu-btn span {
    display: block; height: 1.5px; background: var(--ink-mid);
    border-radius: 1px; transition: transform .25s, opacity .25s;
  }
  .site-menu-btn span:nth-child(2) { width: 70%; }

  .site-menu {
    position: absolute;
    top: 64px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 24px 20px;
    background: rgba(8, 11, 19, .98);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .22s, transform .22s, visibility .22s;
  }
  .site-menu-check:checked ~ .site-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
  }
  .site-menu > a {
    padding: 12px 8px;
    border-bottom: 1px solid var(--line-soft);
    border-radius: 0;
    font-size: 15px;
  }
  .site-menu > a:last-of-type { border-bottom: 0; }
  .site-search { width: 100%; margin: 14px 0 0; }
  .site-search input { flex: 1; width: auto; }

  .site-menu-check:checked ~ .site-menu-btn span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }
  .site-menu-check:checked ~ .site-menu-btn span:nth-child(2) { opacity: 0; }
  .site-menu-check:checked ~ .site-menu-btn span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }

  #main { flex-direction: column; padding: 28px 20px 16px; gap: 24px; }
  #mainContent { width: 100%; }
  #sideBar { position: static; width: 100%; }

  .post, .day { padding: 26px 24px; margin-bottom: 18px; }
  .postTitle, .postTitle2 { font-size: 1.25rem; }
}

@media (max-width: 480px) {
  .site-head-in { padding: 0 20px; }
  .post, .day { padding: 22px 20px; }
}

/* 减弱动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
  .meteor { animation: none !important; opacity: 0 !important; }
  html { scroll-behavior: auto; }
}