/* ===========================================================
   流明小站 · 样式表
   设计参考 Hexo-Butterfly：卡片式布局 + 大图首屏 + 双栏侧边栏
   =========================================================== */

/* ---------- 变量 ---------- */
:root {
  /* 主题色：取自封面插画文字的棕褐色 */
  --primary: #8a5a2b;
  --primary-deep: #6b4220;
  --primary-2: #b98a52;
  --primary-rgb: 138, 90, 43;
  --grad: linear-gradient(135deg, #a9743f, #c9a063);
  --bg: #eef3fa;
  --card: rgba(255, 255, 255, .60);
  --card-2: rgba(255, 255, 255, .55);
  --glass-line: rgba(255, 255, 255, .55);
  --text: #1f2d3d;
  --text-2: #5b6b7b;
  --text-3: #93a1b0;
  --line: rgba(31, 45, 61, .09);
  --shadow: 0 3px 8px 6px rgba(7, 17, 27, .04);
  --shadow-md: 0 8px 22px 4px rgba(7, 17, 27, .07);
  --shadow-lg: 0 16px 40px rgba(7, 17, 27, .16);
  --radius: 12px;
  --nav-h: 60px;
  --code-bg: #282c34;
  --ease: cubic-bezier(.22, .8, .28, 1);
}

[data-theme='dark'] {
  --bg: #0d0d0d;
  --card: rgba(23, 23, 25, .58);
  --card-2: rgba(255, 255, 255, .07);
  --glass-line: rgba(255, 255, 255, .09);
  --text: #e7e9eb;
  --text-2: #a8b1ba;
  --text-3: #78828c;
  --line: rgba(255, 255, 255, .09);
  --shadow: 0 3px 8px 6px rgba(0, 0, 0, .3);
  --shadow-md: 0 8px 22px 4px rgba(0, 0, 0, .38);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .5);
  --code-bg: #1b1b1f;
  --primary: #d3a978;
  --primary-deep: #e8c79e;
  --primary-rgb: 211, 169, 120;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.drawer-open, body.search-open { overflow: hidden; }

a { color: inherit; text-decoration: none; transition: color .25s; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
ul, ol { list-style: none; margin: 0; padding: 0; }

::selection { background: rgba(var(--primary-rgb), .28); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(120, 140, 160, .3); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(120, 140, 160, .5); }
::-webkit-scrollbar-track { background: transparent; }

.ico { width: 1em; height: 1em; flex: none; vertical-align: -.14em; }

/* ---------- 苹果式毛玻璃（frosted glass） ---------- */
.recent-post-item, .card-widget, .page-card, .post-card, .empty,
.post-nav a, .post-nav > span, .page-num, .page-prev, .page-next,
#search-dialog, #drawer, #rightside button, .friend-card, #footer {
  background: var(--card);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--glass-line);
}

/* 主题切换过渡 */
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition: background-color .24s ease, color .24s ease, border-color .24s ease, box-shadow .24s ease !important;
}

/* ---------- 背景 ---------- */
#web_bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 1;
  background-color: #ece7db;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-image:
    radial-gradient(900px 620px at 8% -8%, rgba(var(--primary-rgb), .20), transparent 62%),
    radial-gradient(760px 520px at 96% 4%, rgba(var(--primary-rgb), .16), transparent 60%),
    linear-gradient(180deg, #f7fafe 0%, #eef3fa 42%, #f6f3fd 100%);
}

/* 暗色模式下把背景图压暗，保证文字可读 */
[data-theme='dark'] #web_bg {
  filter: brightness(.34) saturate(.85);
}

/* ---------- 加载动画 ---------- */
#loading-box {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  transition: opacity .55s ease .15s, visibility .55s;
}

#loading-box.loaded { opacity: 0; visibility: hidden; }

.loading-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, #101b2d, #1d2b45 55%, #16202f);
  transition: transform .7s var(--ease);
}

#loading-box::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 400px at 50% 45%, rgba(var(--primary-rgb), .22), transparent 70%);
}

#loading-box.loaded .loading-bg { transform: scale(1.06); }

.spinner { position: relative; width: 66px; height: 66px; z-index: 2; }

.spinner i {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
}

.spinner i::before {
  content: '';
  position: absolute;
  inset: -2px;
  border: 2px solid transparent;
  border-top-color: var(--primary);
  border-radius: 8px;
  animation: spin 1.1s linear infinite;
}

.spinner i:nth-child(2) { inset: 14px; }
.spinner i:nth-child(2)::before { border-top-color: #a99cff; animation-duration: .85s; animation-direction: reverse; }

.loading-word {
  position: absolute;
  top: calc(50% + 56px);
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, .6);
  font-size: 12px;
  letter-spacing: .3em;
  text-transform: uppercase;
  z-index: 2;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 导航 ---------- */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(14px, 3vw, 34px);
  color: #fff;
  transition: background .35s, box-shadow .35s, color .35s, backdrop-filter .35s;
}

.nav-site-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}

.nav-site-title img { width: 26px; height: 26px; border-radius: 7px; }

#menus { display: flex; align-items: center; gap: 4px; }

.menus_items { display: flex; align-items: center; gap: 2px; }

.menus_items a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
  opacity: .92;
}

.menus_items a .ico { font-size: 1rem; opacity: .85; }
.menus_items a:hover { background: rgba(255, 255, 255, .16); opacity: 1; }
.menus_items a.active { opacity: 1; }

.nav-tools { display: flex; align-items: center; gap: 2px; margin-left: 6px; }

.nav-tools button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.05rem;
  transition: background .25s, transform .25s;
}

.nav-tools button:hover { background: rgba(255, 255, 255, .18); transform: translateY(-1px); }
#menu-toggle { display: none; }

/* 吸顶状态 */
#nav.nav-fixed {
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  color: var(--text);
  box-shadow: 0 2px 14px rgba(7, 17, 27, .08);
}

[data-theme='dark'] #nav.nav-fixed { background: rgba(18, 18, 19, .85); box-shadow: 0 2px 14px rgba(0, 0, 0, .4); }

#nav.nav-fixed .nav-site-title { text-shadow: none; }
#nav.nav-fixed .menus_items a:hover { background: rgba(var(--primary-rgb), .12); color: var(--primary-deep); }
#nav.nav-fixed .menus_items a.active { color: var(--primary); }
#nav.nav-fixed .nav-tools button:hover { background: rgba(var(--primary-rgb), .12); }

/* ---------- 首屏 ---------- */
#page-header {
  position: relative;
  height: 100vh;
  min-height: 560px;
  background-color: #14213a;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
}

#page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(64, 42, 22, .42) 0%, rgba(64, 42, 22, .28) 42%, rgba(64, 42, 22, .52) 100%);
}

#page-header.full_page { height: 100vh; }
#page-header.short_page { height: 56vh; min-height: 380px; }

#site-info {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 20px;
  transform: translateY(-4vh);
}

/* 首页大图文字：衬线字体，与插画原字一致 */
#site-title,
#site-subtitle {
  font-family: Georgia, 'Times New Roman', 'STZhongsong', 'SimSun', serif;
}

#site-title {
  margin: 0;
  font-size: clamp(2rem, 5.2vw, 3.5rem);
  font-weight: 800;
  letter-spacing: 2px;
  text-shadow: 0 6px 30px rgba(0, 0, 0, .35);
  animation: fadeUp .9s var(--ease) both;
}

#site-subtitle {
  margin-top: 14px;
  min-height: 1.7em;
  font-size: clamp(.92rem, 1.5vw, 1.1rem);
  font-weight: 400;
  color: rgba(255, 255, 255, .92);
  letter-spacing: .06em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
  animation: fadeUp .9s var(--ease) .12s both;
}

#subtitle::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 3px;
  background: currentColor;
  vertical-align: -.16em;
  animation: blink 1s step-end infinite;
}

#subtitle.static::after { display: none; }

/* 浅色插画横幅：文字改用深棕色 */
#page-header.banner-light { color: #54371f; background-color: #f6eeda; }

#page-header.banner-light::before {
  background: linear-gradient(180deg, rgba(255, 250, 238, 0) 0%, rgba(170, 115, 60, .10) 100%);
}

#page-header.banner-light #site-title { color: #4c3018; text-shadow: 0 1px 0 rgba(255, 255, 255, .45); }
#page-header.banner-light #site-subtitle { color: #7a5230; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); }
#page-header.banner-light #scroll-down { color: rgba(90, 60, 35, .7); }

#page-header.banner-light #nav:not(.nav-fixed) { color: #54371f; }
#page-header.banner-light #nav:not(.nav-fixed) .nav-site-title { text-shadow: none; }
#page-header.banner-light #nav:not(.nav-fixed) .menus_items a:hover,
#page-header.banner-light #nav:not(.nav-fixed) .nav-tools button:hover {
  background: rgba(90, 60, 35, .09);
  color: #54371f;
}

@keyframes blink { 50% { opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

#scroll-down {
  position: absolute;
  left: 50%;
  bottom: 34px;
  z-index: 2;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .8);
  font-size: 1.5rem;
  animation: bounceDown 1.8s ease-in-out infinite;
}

@keyframes bounceDown {
  0%, 100% { transform: translate(-50%, 0); opacity: .55; }
  50% { transform: translate(-50%, 10px); opacity: 1; }
}

/* ---------- 布局 ---------- */
#content-inner {
  position: relative;
  z-index: 3;
  max-width: 1440px;
  margin: 0 auto;
  padding: 26px clamp(14px, 3vw, 26px) 0;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

#main-content { flex: 1; min-width: 0; }

#aside-content {
  width: 300px;
  flex: none;
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  max-height: calc(100vh - var(--nav-h) - 30px);
  overflow-y: auto;
  scrollbar-width: none;
  padding-bottom: 10px;
}

#aside-content::-webkit-scrollbar { display: none; }

.aside-inner { display: flex; flex-direction: column; gap: 18px; }
.sticky { display: flex; flex-direction: column; gap: 18px; }

body.aside-collapsed #aside-content { display: none; }

/* ---------- 文章卡片 ---------- */
.recent-post-items { display: flex; flex-direction: column; gap: 20px; }

.recent-post-item {
  display: flex;
  height: 262px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}

.recent-post-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.recent-post-item:nth-child(even) { flex-direction: row-reverse; }

.post_cover {
  position: relative;
  flex: 0 0 42%;
  overflow: hidden;
  background: linear-gradient(135deg, #dbe7f5, #eae4f8);
  display: block;
}

.post_cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease);
}

.recent-post-item:hover .post_cover img { transform: scale(1.07); }

.post_cover .pin {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 2px 9px;
  font-size: .7rem;
  font-style: normal;
  color: #fff;
  background: rgba(var(--primary-rgb), .92);
  border-radius: 20px;
  letter-spacing: .05em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.recent-post-info {
  flex: 1;
  min-width: 0;
  padding: 22px 26px 18px;
  display: flex;
  flex-direction: column;
}

.article-title {
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .25s;
}

.recent-post-item:hover .article-title { color: var(--primary); }

.article-meta-wrap {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 12px;
  font-size: .79rem;
  color: var(--text-3);
}

.article-meta-wrap.center { justify-content: center; }

.article-meta-wrap .meta { display: inline-flex; align-items: center; gap: 4px; }
.article-meta-wrap .meta a { color: var(--text-2); }
.article-meta-wrap .meta a:hover { color: var(--primary); }
.article-meta-wrap .meta a + a::before { content: '·'; margin-right: 5px; color: var(--text-3); }

.content {
  flex: 1;
  margin: 11px 0 0;
  color: var(--text-2);
  font-size: .885rem;
  line-height: 1.85;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: .76rem;
  color: var(--text-3);
}

.post-foot > span { display: inline-flex; align-items: center; gap: 4px; }

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--primary);
  font-weight: 600;
}

.read-more .ico { transition: transform .25s; }
.read-more:hover .ico { transform: translateX(3px); }

/* ---------- 分页 ---------- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 26px 0 6px; }

.page-num, .page-prev, .page-next {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--text-2);
  font-size: .86rem;
  transition: transform .25s, box-shadow .25s, background .25s, color .25s;
}

.page-num:hover, .page-prev:hover, .page-next:hover { transform: translateY(-2px); color: var(--primary); }

.page-num.current {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 16px rgba(var(--primary-rgb), .35);
}

.dots { color: var(--text-3); padding: 0 2px; }

.empty {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-3);
  font-size: .9rem;
}

.empty code { background: var(--card-2); padding: 2px 6px; border-radius: 5px; color: var(--primary-deep); }
.empty a { color: var(--primary); }

/* ---------- 侧边栏卡片 ---------- */
.card-widget {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.card-info { text-align: center; padding: 24px 20px 20px; }

.avatar-img { display: inline-block; }

.avatar-img img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--card);
  box-shadow: 0 0 0 1px var(--line), 0 6px 18px rgba(7, 17, 27, .12);
  transition: transform .5s var(--ease);
}

.card-info:hover .avatar-img img { transform: rotate(6deg) scale(1.04); }

.author-info-name { margin-top: 12px; font-size: 1.15rem; font-weight: 700; letter-spacing: .04em; }

.author-info-description {
  margin-top: 4px;
  font-size: .78rem;
  color: var(--text-3);
  line-height: 1.7;
}

.site-data {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 16px 0 4px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.site-data a { display: block; }
.site-data b { display: block; font-size: 1.1rem; font-weight: 700; color: var(--primary); line-height: 1.3; }
.site-data i { font-style: normal; font-size: .72rem; color: var(--text-3); }
.site-data a:hover b { color: var(--primary); }

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 10px 4px 0;
  padding: 6px 13px;
  font-size: .78rem;
  border-radius: 20px;
  background: var(--card-2);
  color: var(--text-2);
  transition: background .25s, color .25s, transform .25s;
}

.social-btn:hover { background: rgba(var(--primary-rgb), .14); color: var(--primary-deep); transform: translateY(-2px); }

.item-headline {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
}

.item-headline .ico { color: var(--primary); font-size: 1.02rem; }
.item-headline .more { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: .72rem; font-weight: 400; color: var(--text-3); }
.item-headline .more:hover { color: var(--primary); }

.aside-list-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.aside-list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.aside-list-item:first-child { padding-top: 0; }

.aside-list-item .thumb {
  width: 62px;
  height: 46px;
  flex: none;
  border-radius: 7px;
  overflow: hidden;
  background: var(--card-2);
}

.aside-list-item .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.aside-list-item:hover .thumb img { transform: scale(1.1); }

.aside-list-item .text { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; }

.aside-list-item .title {
  font-size: .82rem;
  line-height: 1.5;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.aside-list-item:hover .title { color: var(--primary); }
.aside-list-item time { font-size: .7rem; color: var(--text-3); }

.cat-list li a, .archive-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: .82rem;
  color: var(--text-2);
  transition: background .25s, color .25s, padding .25s;
}

.cat-list li a:hover, .archive-list li a:hover { background: var(--card-2); color: var(--primary); padding-left: 14px; }

.cat-list em, .archive-list em {
  font-style: normal;
  font-size: .7rem;
  min-width: 20px;
  text-align: center;
  padding: 1px 6px;
  border-radius: 20px;
  background: rgba(var(--primary-rgb), .12);
  color: var(--primary-deep);
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }

.tag-cloud a {
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--card-2);
  color: var(--text-2);
  line-height: 1.7;
  transition: background .25s, color .25s, transform .25s;
}

.tag-cloud a:hover { background: rgba(var(--primary-rgb), .14); color: var(--primary-deep); transform: translateY(-2px); }

.webinfo .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: .8rem;
  border-bottom: 1px dashed var(--line);
}

.webinfo .row:last-child { border-bottom: 0; }
.webinfo .row span { color: var(--text-3); }
.webinfo .row b { font-weight: 600; font-size: .82rem; color: var(--primary); }

/* 目录 */
.card-toc .toc ul { border-left: 1px solid var(--line); }

.card-toc .toc a {
  display: block;
  padding: 5px 10px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: .79rem;
  line-height: 1.55;
  color: var(--text-2);
  transition: color .2s, border-color .2s, background .2s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-toc .toc a:hover { color: var(--primary); }
.card-toc .toc a.active { color: var(--primary); border-left-color: var(--primary); background: rgba(var(--primary-rgb), .08); font-weight: 600; }
.card-toc .toc .lv3 a { padding-left: 24px; font-size: .75rem; }

/* ---------- 页脚 ---------- */
#footer {
  position: relative;
  z-index: 3;
  margin-top: 26px;
  background: var(--card);
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: .8rem;
}

.footer-inner { max-width: 1440px; margin: 0 auto; padding: 26px 24px 30px; text-align: center; }

.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-bottom: 12px; }
.footer-links a { color: var(--text-2); font-size: .82rem; }
.footer-links a:hover { color: var(--primary); }

.footer-copy { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.footer-copy .icp { color: var(--text-3); }
.footer-copy .icp:hover { color: var(--primary); }

.footer-meta { margin-top: 8px; color: var(--text-3); opacity: .85; }
.footer-meta span { color: var(--text-2); }

/* ---------- 悬浮按钮 ---------- */
#rightside {
  position: fixed;
  right: 20px;
  bottom: 84px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#rightside button {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--card);
  color: var(--text-2);
  box-shadow: 0 2px 10px rgba(7, 17, 27, .12);
  font-size: 1rem;
  transition: color .25s, transform .25s, box-shadow .25s;
}

#rightside button:hover { color: var(--primary); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(var(--primary-rgb), .28); }

#rs-top .progress-ring { position: absolute; inset: -2px; width: 42px; height: 42px; transform: rotate(-90deg); }

#rs-top .progress-ring circle { fill: none; stroke: var(--line); stroke-width: 2.5; }

#rs-top .progress-ring .bar { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset .12s linear; }

#rs-top .percent { position: absolute; font-size: 9px; font-weight: 700; color: var(--text-3); }
#rs-top:hover .percent { color: var(--primary); }

/* ---------- 搜索 ---------- */
#search-mask {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(8, 14, 24, .48);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}

#search-dialog {
  position: fixed;
  z-index: 301;
  top: 10vh;
  left: 50%;
  width: min(680px, 92vw);
  max-height: 74vh;
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, -14px) scale(.98);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s, transform .3s var(--ease);
}

body.search-open #search-mask, body.search-open #search-dialog { opacity: 1; visibility: visible; }
body.search-open #search-dialog { transform: translate(-50%, 0) scale(1); }

.search-head { display: flex; align-items: center; justify-content: space-between; }

.search-head .title { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .95rem; }
.search-head .title .ico { color: var(--primary); }

.search-close { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--text-3); }
.search-close:hover { background: var(--card-2); color: var(--text); }

#search-input {
  width: 100%;
  margin-top: 14px;
  padding: 11px 14px;
  font-size: .92rem;
  color: var(--text);
  background: var(--card-2);
  border: 1px solid transparent;
  border-radius: 10px;
  outline: none;
  transition: border-color .25s, background .25s;
}

#search-input:focus { border-color: var(--primary); background: var(--card); }

#search-results { margin-top: 12px; overflow-y: auto; }

.search-hit {
  display: block;
  padding: 11px 12px;
  border-radius: 10px;
  transition: background .2s;
}

.search-hit:hover { background: var(--card-2); }
.hit-title { font-size: .92rem; font-weight: 600; color: var(--text); }
.hit-meta { margin-top: 2px; font-size: .72rem; color: var(--text-3); }
.hit-body { margin-top: 5px; font-size: .8rem; color: var(--text-2); line-height: 1.6; }

mark { background: rgba(var(--primary-rgb), .28); color: inherit; padding: 0 1px; border-radius: 3px; }

.search-empty { padding: 26px 10px; text-align: center; color: var(--text-3); font-size: .85rem; }

.search-tip { margin-top: 10px; font-size: .72rem; color: var(--text-3); text-align: right; }
kbd { padding: 1px 5px; border-radius: 4px; background: var(--card-2); border: 1px solid var(--line); font-size: .7rem; }

/* ---------- 移动端抽屉 ---------- */
#drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 14, 24, .5);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}

#drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 201;
  width: 268px;
  padding: 34px 20px;
  background: var(--card);
  box-shadow: 4px 0 24px rgba(0, 0, 0, .16);
  transform: translateX(-102%);
  transition: transform .34s var(--ease);
  overflow-y: auto;
}

body.drawer-open #drawer { transform: none; }
body.drawer-open #drawer-mask { opacity: 1; visibility: visible; }

.drawer-avatar { text-align: center; }
.drawer-avatar img { width: 86px; height: 86px; border-radius: 50%; margin: 0 auto; box-shadow: 0 0 0 3px var(--card), 0 0 0 4px var(--line); }
.drawer-name { margin-top: 12px; text-align: center; font-weight: 700; font-size: 1.05rem; }

#drawer .site-data { margin: 16px 0 20px; }

.drawer-menus { display: flex; flex-direction: column; gap: 2px; }

.drawer-menus a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 9px;
  font-size: .9rem;
  color: var(--text-2);
}

.drawer-menus a:hover, .drawer-menus a.active { background: rgba(var(--primary-rgb), .1); color: var(--primary-deep); }

/* ---------- 内页通用 ---------- */
.page-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px clamp(18px, 3vw, 36px);
}

.page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: .02em;
}

.page-title .ico { color: var(--primary); font-size: 1.5rem; }

.page-desc { margin: 0 0 22px; color: var(--text-3); font-size: .85rem; }

/* 阅读进度条 */
#read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 200;
  background: var(--grad);
  box-shadow: 0 0 10px rgba(var(--primary-rgb), .6);
}

/* ---------- 文章页 ---------- */
.post-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(22px, 3vw, 40px) clamp(18px, 4vw, 46px) clamp(26px, 3vw, 38px);
}

.post-title {
  margin: 0 0 16px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: .01em;
  text-align: center;
}

.post-card .article-meta-wrap { justify-content: center; padding-bottom: 18px; border-bottom: 1px dashed var(--line); margin-bottom: 26px; }

.post-content { font-size: .96rem; line-height: 1.95; color: var(--text); word-wrap: break-word; }

.post-content > *:first-child { margin-top: 0; }

.post-content h2, .post-content h3, .post-content h4, .post-content h5 { position: relative; margin: 1.9em 0 .75em; line-height: 1.45; font-weight: 700; scroll-margin-top: 84px; }

.post-content h2 {
  font-size: 1.32rem;
  padding-left: 13px;
  border-left: 4px solid var(--primary);
}

.post-content h3 { font-size: 1.12rem; color: var(--text); }
.post-content h4 { font-size: 1rem; }

.post-content h3::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--primary);
  vertical-align: .18em;
}

.header-anchor {
  margin-left: 8px;
  color: var(--primary);
  opacity: 0;
  font-weight: 400;
  transition: opacity .2s;
}

.post-content h2:hover .header-anchor,
.post-content h3:hover .header-anchor { opacity: .8; }

.post-content p { margin: 1em 0; }

.post-content a {
  color: var(--primary-deep);
  border-bottom: 1px solid rgba(var(--primary-rgb), .35);
  transition: color .2s, border-color .2s;
}

.post-content a:hover { color: var(--primary); border-bottom-color: var(--primary); }

.post-content strong { font-weight: 700; color: var(--text); }

.post-content ul, .post-content ol { margin: 1em 0; padding-left: 1.4em; }

.post-content ul li { list-style: none; position: relative; margin: .45em 0; }
.post-content ul li::before {
  content: '';
  position: absolute;
  left: -1.05em;
  top: .72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

.post-content ol { list-style: decimal; }
.post-content ol li { margin: .45em 0; padding-left: .2em; }
.post-content ol li::marker { color: var(--primary); font-weight: 600; }

.post-content blockquote {
  margin: 1.4em 0;
  padding: 14px 18px;
  background: rgba(var(--primary-rgb), .07);
  border-left: 4px solid var(--primary);
  border-radius: 0 8px 8px 0;
  color: var(--text-2);
  font-size: .92rem;
}

.post-content blockquote p { margin: .35em 0; }

.post-content hr {
  margin: 2em 0;
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent);
}

.post-content img {
  margin: 1.4em auto;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(7, 17, 27, .14);
  cursor: zoom-in;
}

.post-content code {
  padding: 2px 6px;
  margin: 0 1px;
  font-size: .86em;
  font-family: 'JetBrains Mono', 'Cascadia Code', Consolas, Menlo, monospace;
  color: var(--primary-deep);
  background: rgba(var(--primary-rgb), .12);
  border-radius: 5px;
}

/* 代码块 */
.code-block {
  margin: 1.5em 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--code-bg);
  box-shadow: 0 8px 22px rgba(7, 17, 27, .16);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255, 255, 255, .05);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.code-lang { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .5); }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  font-size: .72rem;
  color: rgba(255, 255, 255, .6);
  border-radius: 6px;
  transition: color .2s, background .2s;
}

.copy-btn:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.copy-btn.done { color: #7ee2a8; }

.code-block pre { margin: 0; padding: 14px 16px; overflow-x: auto; }

.code-block code {
  padding: 0;
  background: none;
  color: #d7dae0;
  font-size: .84rem;
  line-height: 1.75;
  font-family: 'JetBrains Mono', 'Cascadia Code', Consolas, Menlo, monospace;
  border: 0;
}

.tok-com { color: #7f8c98; font-style: italic; }
.tok-str { color: #9ecb7c; }
.tok-num { color: #e2a76f; }
.tok-kw { color: #c792ea; }

/* 表格 */
.table-wrap { margin: 1.5em 0; overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); }

.table-wrap table { width: 100%; border-collapse: collapse; font-size: .88rem; }

.table-wrap th, .table-wrap td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }

.table-wrap th { background: var(--card-2); font-weight: 600; color: var(--text); white-space: nowrap; }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr:hover { background: rgba(var(--primary-rgb), .05); }

/* 版权 */
.post-copyright {
  margin-top: 34px;
  padding: 16px 20px;
  border-radius: 10px;
  background: var(--card-2);
  border-left: 4px solid var(--primary);
  font-size: .8rem;
  line-height: 1.95;
  color: var(--text-2);
  word-break: break-all;
}

.post-copyright p { margin: 0; }
.post-copyright strong { color: var(--text); font-weight: 600; }
.post-copyright a { color: var(--primary-deep); }

/* 上一篇 / 下一篇 */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }

.post-nav a, .post-nav > span {
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform .3s var(--ease), box-shadow .3s;
  min-width: 0;
}

.post-nav a:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.post-nav i { display: block; font-style: normal; font-size: .72rem; color: var(--text-3); margin-bottom: 3px; }
.post-nav span span, .post-nav a span {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-nav .next { text-align: right; }
.post-nav .disabled { opacity: .55; }

/* 图片放大 */
.img-zoom {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 5vh 5vw;
  background: rgba(6, 10, 18, .88);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
  cursor: zoom-out;
}

.img-zoom img { max-width: 100%; max-height: 90vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.img-zoom.show { opacity: 1; visibility: visible; }

/* ---------- 归档 ---------- */
.archive-year { margin-bottom: 34px; }

.year-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: .04em;
}

.year-title sup {
  font-size: .72rem;
  font-weight: 600;
  color: #fff;
  background: rgba(var(--primary-rgb), .85);
  padding: 2px 8px;
  border-radius: 20px;
  vertical-align: super;
}

.archive-month { position: relative; padding-left: 24px; margin-bottom: 8px; border-radius: 8px; transition: background .3s; }

.archive-month::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 12px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, rgba(var(--primary-rgb), .5), var(--line));
}

.archive-month.hl { background: rgba(var(--primary-rgb), .07); }

.archive-month h3 {
  position: relative;
  margin: 0 0 4px;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
}

.archive-month h3::before {
  content: '';
  position: absolute;
  left: -24px;
  top: .45em;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .15);
}

.archive-month h3 em { font-style: normal; font-size: .72rem; font-weight: 400; color: var(--primary); margin-left: 6px; }

.archive-month li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: .87rem;
  color: var(--text-2);
  transition: background .25s, color .25s, transform .25s;
}

.archive-month li a:hover { background: var(--card-2); color: var(--primary); transform: translateX(4px); }
.archive-month li time { flex: none; font-size: .75rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.archive-month li .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archive-month li .c { flex: none; font-size: .7rem; padding: 1px 8px; border-radius: 20px; background: rgba(var(--primary-rgb), .1); color: var(--primary-deep); }

/* ---------- 分类 / 标签 ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }

.cat-box {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 10px;
  background: var(--card-2);
  transition: background .25s, transform .25s, box-shadow .25s;
}

.cat-box:hover, .cat-box.active { background: var(--grad); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(var(--primary-rgb), .28); }
.cat-box .n { font-size: 1.35rem; font-weight: 800; color: var(--primary); transition: color .25s; }
.cat-box .name { font-size: .86rem; color: var(--text-2); transition: color .25s; }
.cat-box:hover .n, .cat-box.active .n, .cat-box:hover .name, .cat-box.active .name { color: #fff; }

.tag-cloud.big { gap: 10px; padding: 6px 0 18px; }

.tag-cloud.big a {
  padding: 5px 13px;
  border-radius: 22px;
  background: var(--card-2);
  font-weight: 500;
}

.tag-cloud.big a sup { font-size: .62em; margin-left: 3px; color: var(--primary); }
.tag-cloud.big a.active, .tag-cloud.big a:hover { background: var(--grad); color: #fff; }
.tag-cloud.big a.active sup, .tag-cloud.big a:hover sup { color: rgba(255, 255, 255, .85); }

.filter-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 18px;
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--card-2);
  font-size: .85rem;
  color: var(--text-2);
}

.filter-head b { color: var(--primary); }
.filter-head span { color: var(--text-3); font-size: .78rem; }
.filter-head .clear { margin-left: auto; font-size: .78rem; color: var(--text-3); border-bottom: 1px dashed var(--text-3); }
.filter-head .clear:hover { color: var(--primary); border-color: var(--primary); }

/* ---------- 友链 ---------- */
.friend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }

.friend-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 12px;
  background: var(--card-2);
  transition: transform .3s var(--ease), box-shadow .3s, background .3s;
}

.friend-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); background: var(--card); }
.friend-card img { width: 52px; height: 52px; border-radius: 50%; flex: none; object-fit: cover; }
.friend-card .name { font-weight: 700; font-size: .92rem; }
.friend-card .desc { margin-top: 3px; font-size: .76rem; color: var(--text-3); line-height: 1.6; }
.friend-card:hover .name { color: var(--primary); }

/* ---------- 出现动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .65s var(--ease) var(--d, 0ms), transform .65s var(--ease) var(--d, 0ms);
  will-change: opacity, transform;
}

.reveal.in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  #aside-content { width: 270px; }
  .recent-post-item { height: 250px; }
}

@media (max-width: 992px) {
  #aside-content { display: none; }
  .menus_items { display: none; }
  #menu-toggle { display: grid; }
  #page-header { background-attachment: scroll; }
  #content-inner { padding-top: 20px; }
}

@media (max-width: 768px) {
  :root { --nav-h: 54px; }
  #page-header { height: 82vh; min-height: 460px; }
  #site-info { transform: translateY(-3vh); }
  .nav-site-title { font-size: 1.1rem; }
  .recent-post-item { flex-direction: column !important; height: auto; }
  .post_cover { flex: none; width: 100%; height: 190px; }
  .recent-post-info { padding: 18px 18px 16px; }
  .article-title { font-size: 1.12rem; }
  .content { -webkit-line-clamp: 3; font-size: .85rem; }
  .post-card { padding: 22px 18px 24px; }
  .post-content { font-size: .92rem; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  #rightside { right: 12px; bottom: 70px; gap: 8px; }
  #rightside button { width: 34px; height: 34px; font-size: .9rem; }
  #rs-top .progress-ring { width: 38px; height: 38px; }
  .footer-links { gap: 4px 14px; }
  .year-title { font-size: 1.6rem; }
  .archive-month { padding-left: 20px; }
  .archive-month li .c { display: none; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .post-title { font-size: 1.35rem; }
}

@media (max-width: 480px) {
  #site-title { letter-spacing: 1px; }
  .recent-post-item .post-foot { font-size: .72rem; }
  .post_cover { height: 165px; }
  .page-card { padding: 22px 16px; }
  .pagination { gap: 6px; }
  .page-num, .page-prev, .page-next { min-width: 32px; height: 32px; font-size: .8rem; }
}

/* 减少动态 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* 打印 */
@media print {
  #nav, #rightside, #aside-content, #footer, #loading-box, #web_bg { display: none !important; }
  #page-header { display: none; }
  .post-card { box-shadow: none; padding: 0; }
}
