/**
 * Rico Portfolio
 *
 * @package RicoPortfolio
 * @author Rico
 * @version 2.0
 * @link https://ricoui.com
 * @description 设计师作品集主题，基于 Typecho 开发，兼容 typerenew
 */

/* ========================================
   Fonts
   ======================================== */
/* 本地字体（原 Google Fonts / chinese-fonts-cdn.deno.dev，国内不可达已本地化）
   中文字体 Noto Sans SC 体积过大，使用系统字体回退 */
@font-face {
  font-family: 'Inconsolata';
  font-style: normal;
  font-weight: 200 900;
  font-stretch: 100%;
  font-display: swap;
  src: url(static/fonts/inconsolata-latin-ext-0.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inconsolata';
  font-style: normal;
  font-weight: 200 900;
  font-stretch: 100%;
  font-display: swap;
  src: url(static/fonts/inconsolata-latin-1.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(static/fonts/inter-latin-ext-2.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(static/fonts/inter-latin-3.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Special Elite';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(static/fonts/specialelite-latin-ext-4.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Special Elite';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(static/fonts/specialelite-latin-5.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ========================================
   CSS Variables (Light mode default)
   ======================================== */
:root {
  /* Gradients */
  --gradient-stop-1: var(--accent-light);
  --gradient-stop-2: var(--accent-regular);
  --gradient-stop-3: var(--accent-dark);
  --gradient-subtle: linear-gradient(150deg, var(--color-900) 19%, var(--color-999) 150%);
  --gradient-accent: linear-gradient(150deg, var(--gradient-stop-1), var(--gradient-stop-2), var(--gradient-stop-3));
  --gradient-accent-orange: linear-gradient(150deg, #ca7879, var(--accent-regular), var(--accent-dark));
  --gradient-stroke: linear-gradient(180deg, var(--color-900), var(--color-700));

  /* Shadows */
  --shadow-sm: 0px 6px 3px rgba(9, 11, 17, 0.01), 0px 4px 2px rgba(9, 11, 17, 0.01), 0px 2px 2px rgba(9, 11, 17, 0.02), 0px 0px 1px rgba(9, 11, 17, 0.03);
  --shadow-md: 0px 28px 11px rgba(9, 11, 17, 0.01), 0px 16px 10px rgba(9, 11, 17, 0.03), 0px 7px 7px rgba(9, 11, 17, 0.05), 0px 2px 4px rgba(9, 11, 17, 0.06);
  --shadow-lg: 0px 62px 25px rgba(9, 11, 17, 0.01), 0px 35px 21px rgba(9, 11, 17, 0.05), 0px 16px 16px rgba(9, 11, 17, 0.1), 0px 4px 9px rgba(9, 11, 17, 0.12);

  /* Light mode colors */
  --color-0: #000;
  --color-50: #0a0a0a;
  --color-100: #101010;
  --color-200: #303030;
  --color-300: #505050;
  --color-400: #707070;
  --color-500: #909090;
  --color-600: #c0c0c0;
  --color-700: #e0e0e0;
  --color-800: #f3f4f7;
  --color-900: #f9f8f7;
  --color-999-basis: 0, 0%, 100%;
  --color-999_40: hsla(var(--color-999-basis), 0.4);
  --color-999: #f9f8f7;
  --color-999-rgb: 249, 248, 247;

  /* Accent */
  --accent-light: #808080;
  --accent-regular: #404040;
  --accent-dark: #202020;
  --accent-overlay: hsla(0, 0%, 0%, 0.35);
  --accent-subtle-overlay: var(--accent-overlay);
  --accent-text-over: var(--color-999);
  --link-color: var(--accent-regular);

  --color-selected: #B1CBFF;
  --color-actived: #B1CBFF;
  --color-link: #222;
  --color-white: #fff;
  --color-white-rgb: 255, 255, 255;
  --color-primary-lighter: #e0ecfd;
  --color-primary-light: #73abf9;
  --color-primary-main: #499ad5;
  --color-purple: #6127ff;
  --color-blue: #499ad5;
  --color-cyan: #00d0ff;
  --color-pink: #ff419c;
  --color-yellow: #f7d252;
  --color-green: #1bc47d;
  --color-orange: #ff5a19;
  --color-errors: #ff2c60;
  --color-featured: #f8f0ee;
  --color-underlined: 48, 48, 48;
  --color-divider: #272f3f;
  --border: #ececec;
  --border-color: rgb(49, 48, 53);
  --card-color: rgba(40, 80, 120, 0.15);
  --card-color-selected: rgba(60, 90, 125, 0.3);

  /* Width */
  --max-width: 90%;
  --size-top: 64px;
  --size-bottom: 64px;

  /* Sidebar */
  --sidebar-width: 280px;
  --gutter: 20px;
  --gap: 16px;
  --cell: 8px;

  /* Radius */
  --radius-small: 4px;
  --radius: 6px;
  --radius-normal: 8px;
  --radius-large: 12px;

  /* Post region frames（单篇文章各区域的虚线框） */
  --post-frame: 1px dashed var(--color-700);
  --post-frame-soft: 1px dashed var(--border);
  --post-frame-radius: var(--radius-large);
  --post-accent-body: var(--color-blue);
  --post-accent-foot: var(--color-green);
  --post-accent-comments: var(--color-orange);

  /* Fonts */
  --font-system: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Lantinghei SC", "Microsoft YaHei", "HanHei SC", "Helvetica Neue", "Open Sans", "Hiragino Sans GB", "微软雅黑", STHeiti, "WenQuanYi Micro Hei", Arial, SimSun, sans-serif;
  --font-body: "Inter", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "MiSans", "Lantinghei SC", "Noto Sans SC", "Microsoft YaHei", "HanHei SC", "Helvetica Neue", "Open Sans", "Hiragino Sans GB", "微软雅黑", STHeiti, "WenQuanYi Micro Hei", Arial, SimSun, sans-serif;
  --font-brand: "Inter", "Noto Sans SC", var(--font-system);
  --font-type: 'Special Elite', var(--font-system);

  /* Transitions */
  --theme-transition: 0.25s ease-in-out;
  --text-size: 16px;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text: 1rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.5rem;
  --text-xl: 2rem;
  --text-2xl: 2.25rem;
  --text-3xl: 3rem;
  --text-4xl: 4rem;
  --text-5xl: 4.5rem;

  /* Aspect ratio */
  --img-resizing-site: 12 / 9;
  --img-resizing-post: 10 / 6;
  --img-resizing-paronamic: 2 / 1;
  --img-resizing-desktop: 19 / 10;

  /* Button */
  --button-rounded: 8px;
  --button-rounded-full: 72px;
  --button-height: 48px;
  --button-pad: 24px;
  --button-bg: var(--color-primary);
  --button-color: var(--color-white);
  --button-color-border: var(--bg-1);

  /* Background blend */
  --bg-svg-blend-mode: overlay;
  --bg-blend-mode: darken;

  --pad-inner: 108px;
}

@media(max-width: 1440px) {
  :root { --pad-inner: 108px; --max-width: 90%; }
}
@media(max-width: 1280px) {
  :root { --pad-inner: 96px; --max-width: 1024px; }
}
@media(max-width: 1023px) {
  :root { --pad-inner: 48px; --max-width: 960px; }
}
@media(max-width: 811px) {
  :root { --pad-inner: 24px; --max-width: calc(100% - 32px); }
}
@media(max-width: 576px) {
  :root { --pad-inner: 16px; --max-width: calc(100% - 32px); }
}

/* Dark mode */
:root.theme-dark {
  --color-0: #f7f5f3;
  --color-50: #f7f5f3;
  --color-100: #f7f5f3;
  --color-200: #e4e5e6;
  --color-300: #d6d5d4;
  --color-400: #c0c0c0;
  --color-500: #909090;
  --color-600: #707070;
  --color-700: #505050;
  --color-800: #303030;
  --color-900: #19191b;
  --color-999-basis: 225, 31%, 5%;
  --color-999: #19191b;
  --color-999-rgb: 25, 25, 27;
  --border: #323232;
  --color-underlined: 68, 211, 141;

  --accent-light: #ececec;
  --accent-regular: #606060;
  --accent-dark: #ececec;
  --accent-overlay: hsla(0, 0%, 64%, 0.75);
  --accent-subtle-overlay: hsla(0, 0%, 9%, 0.33);
  --accent-text-over: var(--color-0);
  --link-color: var(--accent-dark);

  --gradient-stop-1: #4c11c6;
  --gradient-subtle: linear-gradient(150deg, var(--color-900) 19%, var(--color-999) 81%);
  --gradient-accent-orange: linear-gradient(150deg, #ca7879, var(--accent-regular), var(--accent-light));
  --gradient-stroke: linear-gradient(180deg, var(--color-600), var(--color-800));

  --shadow-sm: 0px 6px 3px rgba(255, 255, 255, 0.01), 0px 4px 2px rgba(255, 255, 255, 0.01), 0px 2px 2px rgba(255, 255, 255, 0.02), 0px 0px 1px rgba(255, 255, 255, 0.03);
  --shadow-md: 0px 28px 11px rgba(255, 255, 255, 0.01), 0px 16px 10px rgba(255, 255, 255, 0.03), 0px 7px 7px rgba(255, 255, 255, 0.05), 0px 2px 4px rgba(255, 255, 255, 0.06);
  --shadow-lg: 0px 62px 25px rgba(255, 255, 255, 0.01), 0px 35px 21px rgba(255, 255, 255, 0.05), 0px 16px 16px rgba(255, 255, 255, 0.1), 0px 4px 9px rgba(255, 255, 255, 0.12);

  --bg-svg-blend-mode: darken;
  --bg-blend-mode: lighten;
}

/* ========================================
   Reset & Base
   ======================================== */
html, body {
  height: 100%;
  overflow-x: hidden;
  background-color: var(--color-999);
  color: var(--color-100);
  font-family: var(--font-body) !important;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  font-size: var(--text-size);
  font-weight: 400;
  letter-spacing: 0.2px;
}

*, *::after, *::before {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  border: none;
  height: auto;
  pointer-events: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

/* 需要点击的图片（如 UP 甄选头像）用这个类把指针事件打开 */
img.is-clickable { pointer-events: auto; cursor: pointer; }
.is-clickable { cursor: pointer; }

ul, li, ol, p {
  padding: 0;
}

a {
  color: var(--link-color);
  text-decoration: none;
}

h1, h2, h3, h4, h5 {
  line-height: 1.1;
  font-family: var(--font-brand);
  font-weight: 600;
  color: var(--color-0);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }

p { margin-bottom: 1em; }

figure img { display: block; }

input, select, textarea, button {
  font-size: var(--text-base);
  border: 0;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Special fonts */
.font-huiwen {
  font-family: 'Huiwen-mincho', 'Songti SC', 'STSong', 'Source Han Serif SC', 'Noto Serif CJK SC', 'SimSun', serif !important;
  font-weight: 400 !important;
}
.font-type {
  font-family: var(--font-type) !important;
}

/* Code */
pre, code {
  font-size: 14px;
  font-family: 'Inconsolata', 'monospace', 'system-ui', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;
}
.content pre {
  padding: 1em 1em;
  border-radius: 6px;
}
p code {
  background-color: var(--color-800);
  padding: 2px 6px;
  margin: 0 2px;
  border-radius: 3px;
}
mark { background-color: var(--color-yellow); }
mark code { background: none !important; }

/* ========================================
   Scrollbar
   ======================================== */
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 6px !important; }
html::-webkit-scrollbar-track, body::-webkit-scrollbar-track {
  background: var(--color-800) !important;
  border-radius: 6px !important;
}
html::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb {
  background: var(--color-yellow) !important;
  border-radius: 6px !important;
}
html::-webkit-scrollbar-thumb:hover, body::-webkit-scrollbar-thumb:hover { background: var(--color-blue) !important; }
html::-webkit-scrollbar-thumb:active, body::-webkit-scrollbar-thumb:active { background: var(--color-green) !important; }

*::-webkit-scrollbar { width: 6px; }
*::-webkit-scrollbar-track { background: var(--color-800); border-radius: 6px; }
*::-webkit-scrollbar-thumb { background: var(--color-yellow); border-radius: 6px; }
*::-webkit-scrollbar-thumb:hover { background: var(--color-blue); }
*::-webkit-scrollbar-thumb:active { background: var(--color-green); }

@media (max-width: 767px) {
  html::-webkit-scrollbar, body::-webkit-scrollbar { width: 3px !important; }
  *::-webkit-scrollbar { width: 3px; }
}

/* ========================================
   Utility Classes
   ======================================== */
:focus { outline: 2px solid var(--accent-regular, #4a90d9); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: 0; }
:focus-visible { outline: 2px solid var(--accent-regular, #4a90d9); outline-offset: 2px; }
.block { display: block; }
.flex { display: flex; }
.relative { position: relative; }
.absolute { position: absolute; top: 0; left: 0; }
.text-center { text-align: center; }

.border-top { border-top: 1px dashed var(--border); }
.border-bottom { border-bottom: 1px dashed var(--border); }

.overflow-hidden { overflow: hidden; }

/* ========================================
   Grid System
   ======================================== */
.row { display: flex; flex-wrap: wrap; }

.col-1a, .col-xs-1a, .col-md-2a, .col-lg-3a, .col-xxl-4a {
  position: relative;
  width: 100%;
  padding-right: 16px;
  padding-left: 16px;
}
.col-1a { flex: 0 0 100%; max-width: 100%; }

/* 卡片栅格：< 768px 单列，其后按断点 2 / 3 / 4 列 */
@media (max-width: 575.98px) { .col-xs-1a { flex: 0 0 100%; max-width: 100%; } }
@media (min-width: 768px) { .col-md-2a { flex: 0 0 50%; max-width: 50%; } }
@media (min-width: 992px) { .col-lg-3a { flex: 0 0 33.333333%; max-width: 33.333333%; } }
@media (min-width: 1400px) { .col-xxl-4a { flex: 0 0 25%; max-width: 25%; } }

/* ========================================
   Navigation (Nav.astro)
   ======================================== */
nav.site-nav {
  z-index: 9999;
  position: sticky;
  top: 0;
  -webkit-backdrop-filter: saturate(300%) blur(5px);
  backdrop-filter: saturate(300%) blur(5px);
  background-color: rgba(var(--color-999-rgb), 0.65);
  font-family: var(--font-brand);
  font-weight: 500;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max-width);
  margin: 0 auto;
  /* 上下留白：导航不再紧贴视口上沿 */
  padding: 14px 1rem;
}

.menu-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0;
}

.site-title {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-start;
  align-items: center;
  line-height: 1.1;
  color: var(--color-0);
  font-weight: 400;
  text-decoration: none;
  font-size: 1.5rem;
  letter-spacing: 0.1px;
}
.site-title:hover { color: rgb(236, 72, 113); }

.avatar {
  display: inline-block;
  position: relative;
  line-height: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.avatar__img { display: block; border-radius: 50%; }

#menu-content { display: flex; align-items: center; }

.menu-footer.pc-nav {
  display: none;
  justify-content: space-between;
  gap: 0.75rem;
  padding: .35rem 0rem;
}
@media (min-width: 767px) {
  .menu-footer.pc-nav { display: flex; }
}

.nav-items {
  margin: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  font-size: 1rem;
  font-weight: normal;
  line-height: 1;
  list-style: none;
  padding: 0;
  position: relative;
  border: 0;
  gap: calc(var(--gap) * 1.5);
}
.nav-items li { margin: 0; }

.link {
  display: inline-block;
  color: var(--color-300);
  text-decoration: none;
}
.link.active { color: var(--color-100); font-weight: bold; }

.theme-toggle-wrap {
  display: flex;
  align-items: center;
  transform: scale(0.75);
}

@media (max-width: 576px) {
  .nav-wrapper { display: flex; align-items: center; gap: 0rem; }
  .menu-header { padding: 8px 0; }
  .menu-footer { padding: 0; }
}

/* ========================================
   Theme Toggle
   ======================================== */
theme-toggle button {
  display: flex;
  border: 0;
  border-radius: 999rem;
  padding: 0;
  background-color: var(--color-999);
  box-shadow: inset 0 0 0 1px var(--accent-overlay);
  color: var(--color-100);
  cursor: pointer;
}
theme-toggle .icon {
  z-index: 1;
  position: relative;
  display: flex;
  padding: 0.5rem;
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
  color: var(--accent-overlay);
  /* 下方全局 .icon（文章/项目图标）带 border、border-radius、固定 svg 尺寸，
     会泄漏到主题切换按钮上，导致图标偏移、出现多余描边，这里显式还原 */
  border: 0;
  border-radius: 0;
  margin: 0;
}
theme-toggle .icon svg {
  width: 1em;
  height: 1em;
}
theme-toggle .icon.light::before {
  content: '';
  z-index: -1;
  position: absolute;
  inset: 0;
  background-color: var(--accent-regular);
  border-radius: 999rem;
}
:root.theme-dark theme-toggle .icon.light::before { transform: translateX(100%); }
:root.theme-dark theme-toggle .icon.dark,
:root:not(.theme-dark) theme-toggle .icon.light {
  color: var(--accent-text-over);
}
@media (prefers-reduced-motion: no-preference) {
  theme-toggle .icon, theme-toggle .icon.light::before {
    transition: transform var(--theme-transition), color var(--theme-transition);
  }
}

/* ========================================
   GitHub Stars
   ======================================== */
.github-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 4rem;
  height: 32px;
  padding: 0 0.65rem;
  border-radius: 999px;
  color: var(--color-400);
  text-decoration: none;
  border: 1px solid var(--color-700);
  line-height: 1;
  transform: translateY(-1px);
  transition: color var(--theme-transition), background-color var(--theme-transition);
  flex: none;
}
.github-stars:hover, .github-stars:focus-visible {
  color: var(--color-100);
  background: rgba(var(--color-100-rgb, 16,16,16), 0.06);
}
.github-stars__count {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
}
.github-stars svg { width: 1.25rem; height: 1.25rem; fill: currentColor; stroke: currentColor; }

/* ========================================
   Mobile Nav (NavMobile.astro)
   ======================================== */
.mobile-header { display: block; }
.hamburger { position: relative; z-index: 9999; }
.hamburger-toggle {
  transition: all .3s;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.hamburger-toggle span {
  width: 18px;
  height: 2px;
  display: block;
  position: relative;
  background: var(--color-100);
  transition: all .2s ease-out;
}
.hamburger-toggle span:before, .hamburger-toggle span:after {
  transition: all .3s ease-out;
  content: "";
  width: 26px;
  height: 2px;
  position: absolute;
  left: 0;
  background: var(--color-100);
}
.hamburger-toggle span::before { top: -9px; }
.hamburger-toggle span::after { top: 9px; }

.hamburger-toggle.close-line span { width: 0px; transform: translateX(-12px); }
.hamburger-toggle.close-line span::before {
  transform: rotate(45deg);
  top: 0 !important;
  width: 36px !important;
}
.hamburger-toggle.close-line span::after {
  transform: rotate(-45deg);
  top: 0 !important;
  width: 36px !important;
}

.m-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--color-999);
  transition: all .75s ease-in-out;
  transform: translateX(100%);
  z-index: 999;
  overflow: hidden;
}
.m-nav.is-active { transform: translateX(10%); }
.m-nav-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  z-index: 99999;
  margin-left: -20vw;
}
.m-nav-mask {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  opacity: 0;
  background-color: var(--accent-overlay);
  z-index: 990;
  transition: all 0.5s ease-in-out;
  transition-delay: 0.15s;
  width: 0%;
}
.m-nav-mask.is-active { opacity: 1; width: 100%; }
.m-menu {
  position: relative;
  margin-top: 120px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  list-style: none;
}
@media (max-height: 600px) { .m-menu { margin-top: 8vh; } }
.m-menu-li {
  position: relative;
  text-align: left;
  padding: 2vh 0;
  vertical-align: middle;
}
.m-menu-li a.m-menu__link {
  position: relative;
  display: inline-block;
  font-size: 1.5rem;
  color: var(--color-100);
}
.m-menu-li--github { padding-top: 1vh; padding-bottom: 1vh; }

@media (min-width: 767px) {
  .hamburger { display: none; }
  .m-nav { display: none; }
  .m-nav-mask { display: none; }
}

/* ========================================
   Section Header (SectionHeader.astro)
   ======================================== */
.section-header { margin: 24px 0 32px; }
.section-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--color-100);
}
.section-title {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.section-title h1 {
  font-size: 72px;
  font-size: 4rem;
  line-height: 1.2;
  font-weight: 500;
}
.section-desc {
  max-width: 480px;
  margin: 24px auto 24px;
  text-align: center;
}
.section-saying {
  font-size: 1rem;
  line-height: 160%;
  font-weight: 400;
  text-align: center;
  color: var(--color-300);
}
.section-saying strong {
  display: block;
  font-weight: 600;
  margin-bottom: 1em;
  color: var(--color-100);
}
.section-saying p {
  font-size: 0.875rem;
  margin-bottom: 0.5em;
  text-align: center;
}
.section-saying a:link { color: #11A371; }
.section-saying a:hover { opacity: 0.75; }

.title-tag {
  display: inline-block;
  font-size: 13px;
  line-height: 1;
  margin: 16px auto 24px;
  border: 1px solid var(--color-700);
  border-radius: 36px;
  padding: 8px 22px 4px;
  color: var(--color-300);
  text-align: center;
  font-family: var(--font-type);
  text-transform: uppercase;
  letter-spacing: 1px;
}

@media(max-width: 1023px) { .section-title h1 { font-size: 3.75rem; } }
@media(max-width: 767px) {
  .section-content { align-items: center; }
  .section-title h1 { font-size: 3rem; }
}

/* ========================================
   Social Links
   ======================================== */
.author.border-bottom {
  border-bottom: 1px dashed var(--border);
  padding-bottom: 8px;
}
.social {
  margin: 0px auto;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  padding-bottom: 8px;
}
.social a { opacity: 0.75; }
.social a:hover { opacity: 1; }
.social-link svg {
  fill: var(--color-400);
  width: auto;
  height: 20px;
  color: var(--color-400);
}
.ic-social { fill: var(--color-100); width: auto; height: 22px; }
.social .ic-github:hover { fill: var(--color-200); }
.social .ic-rss:hover { fill: #ee802f !important; }
.social .ic-xiaohongshu { width: 26px; height: 26px; }
.social .ic-xiaohongshu:hover { fill: #ff2742 !important; }
.social .ic-weibo:hover { fill: #E6162D !important; }

/* ========================================
   Filter (Filter.astro)
   ======================================== */
:root {
  --filter-bg: #fff;
  --filter-bg-active: #0a0a0a;
  --filter-bg-hover: rgba(10, 10, 10, .08);
  --filter-color: #101010;
  --filter-color-active: #f4f3f0;
  --filter-border: 1px solid #d0d0d0;
}
:root.theme-dark {
  --filter-bg: #19191b;
  --filter-color: #d6d5d4;
  --filter-color-active: #19191b;
  --filter-border: 1px solid #696765;
  --filter-bg-active: #f4f3f0;
  --filter-bg-hover: rgba(243, 244, 247, .08);
}

.section.filter { margin-top: 1rem; }
.filter-wrapper {
  margin: 1rem 0 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.filter-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin: auto;
  list-style: none;
}
.filter-item { display: inline-flex; }
.filter-tag {
  border-radius: 32px;
  background-color: var(--filter-bg);
  padding: 10px 24px;
  font-size: 15px;
  font-family: var(--font-body);
  border: var(--filter-border);
  line-height: 1;
  letter-spacing: 0.25px;
  color: var(--filter-color);
  text-align: center;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.075, 0.82, 0.165, 1);
}
.filter-tag span {
  font-size: 12px;
  font-weight: 300;
  padding: 0px 0px 0 3px;
  vertical-align: text-bottom;
  opacity: 0.75;
  line-height: 16px;
  letter-spacing: -0.25px;
}
.filter-tag:hover {
  background-color: var(--filter-bg-hover);
  color: var(--filter-color);
}
.filter-tag.active {
  font-weight: 500;
  background: var(--filter-bg-active);
  color: var(--filter-color-active);
}

/* ========================================
   Cards Grid (Cards.astro)
   ======================================== */
.type { display: flex; justify-content: flex-start; align-items: center; gap: 12px; }
.type-tag {
  display: inline-block;
  height: 20px;
  padding: 0 10px;
  line-height: 20px;
  font-size: 12px;
  font-weight: 400;
  border-radius: 4px;
  vertical-align: middle;
  color: var(--color-100);
  letter-spacing: 1px;
  white-space: nowrap;
}
/* 评论数属于次要信息，颜色压低一档 */
.type-tag--num { color: var(--color-400); }

.section.card { padding-bottom: 0; }
.card-list {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  margin: 32px auto 0;
}
.card-item {
  float: left;
  margin-bottom: 1.5rem;
  padding: 0 12px;
}
.card-header {
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-body { font-size: 0; }
.card-figure {
  width: 100%;
  height: auto;
  max-width: 100%;
  background-color: rgba(0, 0, 0, .02);
  border-radius: var(--radius);
  padding-bottom: calc(2 * 100% / 3);
  display: inline-block;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}
.card-figure__img {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  object-fit: cover;
  transition: all 0.5s;
}
.card-figure:hover .card-figure__img { transform: scale(1.05); }
.card-figure-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-100) 0%, var(--color-200) 100%);
  color: var(--color-500);
  font-size: 0.9rem;
  padding: 1rem;
  text-align: center;
}
.card-figure-placeholder span {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.theme-dark .card-figure-placeholder {
  background: linear-gradient(135deg, var(--color-900) 0%, var(--color-800) 100%);
}
.card-footer {
  width: 100%;
  margin-top: 12px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.card-detail {
  flex: 1;
  min-width: 0;
  padding-right: 8px;
}
.card-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-200);
  /* 标题统一占两行（超出省略）：卡片等高，列表每行才能顶部对齐 */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  line-height: 1.4;
  min-height: 2.8em;
  word-break: break-word;
  overflow-wrap: break-word;
}
.card-link__go {
  background-repeat: no-repeat;
  background-position: 6px center;
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 15L15 5M15 5H7.5M15 5V12.5' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  width: 32px;
  height: 32px;
  text-decoration: none;
  display: block;
  position: relative;
  transition: all 0.35s ease-in-out;
}
.card-link__go:hover { transform: rotate(45deg); }

/* ========================================
   Post Preview List (PostPreview.astro)
   ======================================== */
.post-item {
  align-content: center;
  align-items: center;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 24px;
  height: min-content;
  justify-content: space-between;
  padding: 2rem 12px;
  position: relative;
  text-decoration: none;
  width: 100%;
  transition: all 0.25s ease-in-out;
}
.post-item:nth-child(n):hover { background: var(--color-yellow); }
.post-item:nth-child(2n):hover { background: var(--color-blue); }
.post-item:nth-child(3n):hover { background: var(--color-green); }
.post-item:hover .post-icon .icon {
  transform: rotate(-45deg);
  border: 1px solid var(--color-900);
  background: var(--color-900);
}

.post-title {
  height: auto;
  position: relative;
  word-break: break-word;
  word-wrap: break-word;
}
.post-title h3 {
  line-height: 1.3em;
  text-align: left;
  color: var(--color-100);
}
.post-icon {
  align-content: center;
  align-items: center;
  display: flex;
  flex: none;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0px;
  height: min-content;
  justify-content: center;
  overflow: hidden;
  position: relative;
  width: min-content;
}
.post-icon .icon { transition: all 0.25s ease-in-out; }
.post-icon svg { transition: all 0.25s ease-in-out; }

.icon {
  padding: 10px;
  border-radius: 36px;
  border: 1px solid var(--color-700);
  display: inline-block;
  margin: 0;
  font-size: 0;
}
.icon svg { height: 20px; width: 20px; }

.publish-date {
  font-size: 0.875rem;
  color: var(--color-500);
  margin: 0.5rem 0 0;
  font-weight: 400;
}

/* ========================================
   Project List (ProjectList.astro)
   ======================================== */
.project-item {
  cursor: pointer;
  display: block;
  height: min-content;
  padding: 24px 12px 12px;
  position: relative;
  text-decoration: none;
  width: 100%;
  margin-bottom: 24px;
  overflow: hidden;
  transition: all 0.25s ease-in-out;
}
.project-item:nth-child(n):hover { background: var(--color-yellow); }
.project-item:nth-child(2n):hover { background: var(--color-blue); }
.project-item:nth-child(3n):hover { background: var(--color-green); }
.project-item:hover .project-icon .icon {
  transform: rotate(-45deg);
  border: 1px solid var(--color-900);
  background: var(--color-900);
}
.project-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 32px;
}
.project-title {
  height: auto;
  position: relative;
  word-break: break-word;
  word-wrap: break-word;
  max-width: 85%;
}
.project-title h3 {
  line-height: 1.3em;
  text-align: left;
  color: var(--color-100);
  display: flex;
  align-items: center;
}
.project-title p {
  display: block;
  margin: 8px 0;
  color: var(--color-300);
  padding-left: 4px;
}
.project-icon {
  align-content: center;
  align-items: center;
  display: flex;
  flex: none;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0px;
  height: min-content;
  justify-content: center;
  overflow: hidden;
  position: relative;
  width: min-content;
}
.project-icon .icon { transition: all 0.25s ease-in-out; }
.project-body { position: relative; margin-top: 24px; margin-bottom: 16px; }
.project-cover {
  position: relative;
  width: auto;
  overflow: hidden;
  display: flex;
  justify-content: flex-start;
  flex-wrap: nowrap;
}
.project-figure {
  position: relative;
  border-radius: 5px;
  overflow: hidden;
  width: auto;
  height: 128px;
  margin: 0 6px;
  display: inline-block;
}
.project-figure:hover { opacity: 0.75; }
.project-figure:first-child { margin-left: 0; }
.project-figure:last-child { margin-right: 0; }
.project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.project-tags { display: flex; justify-content: flex-start; gap: 8px; }
.project-tags .tag {
  font-size: 0.75rem;
  border: 1px solid var(--color-700);
  background: var(--color-999);
  border-radius: 36px;
  padding: 4px 16px;
  text-transform: uppercase;
  transition: all 0.25s ease-in-out;
}
.project-tags .tag:hover { border: 1px solid var(--color-300); }
.project-date { font-size: 1.75rem; font-weight: 600; }
.project-title-pre-icon {
  width: 18px;
  height: 18px;
  margin-right: 6px;
  color: var(--color-100);
}

@media (max-width: 1000px) {
  .project-body { height: 132px; }
  .project-cover { position: absolute; left: 0; bottom: 0; }
  .project-figure { width: 180px; height: 120px; }
}

/* ========================================
   Post / Detail Layout
   ======================================== */
.section.post, .section.detail {
  display: block;
  max-width: 1020px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}
.section.detail {
  display: flex;
  flex-direction: column;
  padding-bottom: 36px;
}

.post-wrapper section {
  position: relative;
  margin: 0 auto 36px;
  width: 100%;
  font-size: 16px;
}
.post-wrapper p {
  line-height: 1.6;
  margin-bottom: 0.875em;
  text-align: left;
}
.post-wrapper strong { font-weight: bold; }
.post-wrapper ul { padding-left: 2em; margin: 2em 0; }
.post-wrapper ul ul { padding-left: 1em; margin: .75em 0 2em; }
.post-wrapper ul li { margin: 0.5em 0 .75em; }

.post-wrapper h1 {
  font-size: 2.25rem;
  font-weight: bold;
  color: var(--color-100);
  text-align: center;
  line-height: 1.333;
  margin: 1rem auto 0.5rem;
}
.post-wrapper h2 { font-size: 2rem; font-weight: bold; color: var(--color-100); }
.post-wrapper h3 { font-size: 1.5rem; font-weight: bold; color: var(--color-100); }
.post-wrapper a:hover { text-decoration: underline; }
.post-wrapper a:link { color: var(--color-blue); }

.post-wrapper .post-title {
  grid-column-start: 1;
  font-size: 1.5rem;
  color: var(--color-100);
}
.post-wrapper .content {
  margin-top: 20px;
  color: var(--color-200);
  font-size: 1rem;
}

@media(max-width: 576px) {
  .post-wrapper h1 { font-size: 1.75rem; margin-top: 2rem; }
  .post-wrapper h2 { font-size: 1.5rem; }
  .post-wrapper h3 { font-size: 1.25rem; }
  .post-wrapper .post-title { font-size: 1.25rem; }
  .post-wrapper p, .post-wrapper ul, .post-wrapper li { font-size: 0.875rem; }
}

/* ========================================
   Article (blog post)
   —— 题头区无框；「正文 / 附记 / 评论」为虚线框区域
   ======================================== */
.article .section-content { text-align: center; }

/* ---------- 区域框 ---------- */
.article .post-region {
  position: relative;
  margin: 0 auto 32px;
  padding: clamp(24px, 3vw, 34px) clamp(16px, 3.4vw, 36px);
  border: var(--post-frame);
  border-radius: var(--post-frame-radius);
  background-color: var(--color-999);
}
/* 区域标签：骑在上边框上，像图纸的分区标注 */
.article .post-region__label {
  position: absolute;
  top: 0;
  left: clamp(18px, 3.4vw, 36px);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transform: translateY(-50%);
  padding: 0 10px;
  background-color: var(--color-999);
  color: var(--color-400);
  font-family: var(--font-type);
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
}
.article .post-region__label::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 2px;
  background-color: var(--post-accent);
}
.article .post-region--body { --post-accent: var(--post-accent-body); }
.article .post-region--foot { --post-accent: var(--post-accent-foot); }
.article .post-region--comments { --post-accent: var(--post-accent-comments); }

/* 区域内部：相邻区块之间用虚线细分（每区域的第一个区块不分隔） */
.article .post-head .article-lead,
.article .post-region--foot .post-tags,
.article .post-region--foot .post-cta,
.article .post-region--foot .post-near {
  margin-top: 22px;
  padding-top: 22px;
  border-top: var(--post-frame);
}

/* ---------- 正文前：题头（无框，只留内容与内边距对齐） ---------- */
.article .post-head {
  position: relative;
  margin: 0 auto 14px;
  padding: 26px clamp(16px, 3.4vw, 36px) 0;
  text-align: center;
}
.article .post-head .section-header { margin: 0; }
.article .title-tag {
  display: inline-block;
  font-size: 13px;
  line-height: 1;
  margin: 10px auto 20px;
  border: 1px solid var(--color-700);
  border-radius: 36px;
  padding: 8px 22px 4px;
  color: var(--color-300);
  text-align: center;
  font-family: var(--font-type);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.article .title {
  line-height: 1.2;
  margin: 0.5rem 0;
  color: var(--color-100);
  text-align: center;
}
/* 元信息（日期 / 分类）做成小虚线胶囊 */
.article .post-line-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-bottom: 0;
  padding-bottom: 0;
  margin: 22px 0 0;
  font-size: .75rem;
  color: var(--color-500);
  white-space: normal;
}
.article .post-line-bottom > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: var(--post-frame);
  border-radius: 36px;
  padding: 4px 14px 3px;
  color: var(--color-300);
  font-family: var(--font-type);
  letter-spacing: 1px;
}
.article .post-line-bottom span[datetime]::before,
.article .post-line-bottom span[itemprop="articleSection"]::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  flex: none;
  background: no-repeat center / contain;
}
.article .post-line-bottom span[datetime]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23909090' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
}
.article .post-line-bottom span[itemprop="articleSection"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23909090' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.59 13.41l-7.17 7.17a2 2 0 01-2.83 0L2 12V2h10l8.59 8.59a2 2 0 010 2.82z'/%3E%3Cline x1='7' y1='7' x2='7.01' y2='7'/%3E%3C/svg%3E");
}
.article .post-line-bottom a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted var(--color-500);
}
.article .post-line-bottom a:hover { color: var(--color-100); border-bottom-color: var(--color-100); }

/* ---------- 正文 ---------- */
.article .content {
  position: relative;
  color: var(--color-200);
  margin: 0;
  overflow-wrap: break-word;
}
.article .content > * + * { margin-top: 1rem; }
.article .content h1, .article .content h2, .article .content h3, .article .content h4, .article .content h5 {
  margin: 1.75em 0 1em;
  color: var(--color-100);
  line-height: 1.45;
}
.article .content h2 {
  font-size: 1.75rem;
  color: var(--color-100);
  margin-top: 2.25em;
  margin-bottom: .85em;
  padding-bottom: .45em;
  border-bottom: var(--post-frame);
}
.article .content h3 { font-size: 1.5rem; color: var(--color-100); margin-top: 2em; margin-bottom: .75em; }
.article .content h4 { font-size: 1.25rem; color: var(--color-200); }
.article .content h5 { font-size: 1rem; color: var(--color-300); }
.article .content img { border-radius: 8px; }
.article .content p { margin: 16px 0; line-height: 1.85; }
.article .content ol { padding-left: 2em; margin: 2em 0; }
.article .content ul { padding-left: 1.6em; margin: 1.5em 0; }
.article .content li { margin: .5em 0; line-height: 1.8; }
.article .content hr {
  height: 0;
  border: none;
  border-top: var(--post-frame);
  margin: 2.25rem 0;
}
.article .content blockquote {
  margin: 1.75rem 0;
  padding: 1rem 1.25rem;
  border: var(--post-frame);
  border-left: 3px solid var(--color-blue);
  background: var(--color-900);
  border-radius: var(--radius);
  color: var(--color-300);
}
.article .content blockquote p { margin: .5em 0; }
.article .content table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  font-size: .9375rem;
}
.article .content th,
.article .content td {
  border: var(--post-frame-soft);
  padding: 10px 12px;
  text-align: left;
  line-height: 1.6;
}
.article .content th {
  background: var(--color-900);
  color: var(--color-100);
  font-weight: 600;
}
.article .content pre {
  margin: 1.5rem 0;
  border: var(--post-frame);
  border-radius: var(--radius);
  overflow-x: auto;
}
.article a:link { color: var(--color-blue); }

/* 正文内图片：虚线取景框 + 居中 + 放大光标 */
.article .content a.fancybox {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 1.75rem auto;
  padding: 10px;
  border: var(--post-frame);
  border-radius: 14px;
  background-color: var(--color-900);
  color: inherit;
  text-decoration: none;
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.article .content a.fancybox img {
  display: block;
  margin: 0;
  border-radius: 8px;
  cursor: zoom-in;
}
.article .content a.fancybox:hover,
.article .content a.fancybox:focus-visible {
  border-color: var(--color-blue);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .08);
  transform: translateY(-2px);
}
/* 悬停时给出「点击放大」提示 */
.article .content a.fancybox::after {
  content: "点击放大 ↗";
  display: block;
  margin-top: 8px;
  font-family: var(--font-type);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 1px;
  text-align: center;
  color: var(--color-500);
  opacity: 0;
  transition: opacity .25s ease;
}
.article .content a.fancybox:hover::after,
.article .content a.fancybox:focus-visible::after { opacity: 1; }
@media (hover: none) {
  .article .content a.fancybox::after { opacity: .6; }
}
:root.theme-dark .article .content a.fancybox:hover,
:root.theme-dark .article .content a.fancybox:focus-visible { box-shadow: 0 6px 22px rgba(0, 0, 0, .5); }

/* ---------- 正文后：附记 ---------- */
.article .post-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ========================================
   Call To Action Button
   ======================================== */
.post-btn {
  --btn-color: #101010;
  --color--yellow: #f7d252;
  --color--dark-yellow: #ecba0e;
  position: relative;
  display: inline-flex;
  place-content: center;
  text-align: center;
  padding: 1.125em 2em;
  color: var(--btn-color) !important;
  text-decoration: none;
  line-height: 1.1;
  border-radius: 36px;
  overflow: hidden;
  background: var(--color--yellow);
  white-space: nowrap;
  font-size: var(--text-sm);
  font-weight: 600;
  margin: 0;
  transition: all 0.35s;
  min-width: 144px;
}
.post-btn:hover {
  background-color: var(--color--dark-yellow);
  box-shadow: 0 0 24px 11px rgba(247, 210, 82, .75);
}
.post-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: background-color var(--theme-transition);
  mix-blend-mode: overlay;
}
.post-btn:focus::after, .post-btn:hover::after {
  background-color: hsla(var(--color-999-basis), 0.3);
}

/* About page */
.about { display: flex; flex-direction: column; margin: 0 auto; }
.about p { margin: 0.75rem 0; }
.about .portrait {
  border-radius: 100px;
  margin: 12px 0 12px;
  overflow: hidden;
  text-align: left;
  width: 88px;
  height: 88px;
}
.about a, .about a:link { color: var(--color-blue); }

/* ========================================
   Footer
   ======================================== */
footer.site-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1.5rem 2rem 1.5rem;
  text-align: center;
  color: var(--color-400);
  font-size: var(--text-sm);
}
footer.site-footer a {
  color: var(--color-400);
  text-decoration: 1px solid underline transparent;
  text-underline-offset: 0.25em;
  transition: text-decoration-color var(--theme-transition);
}
footer.site-footer a:hover, footer.site-footer a:focus {
  text-decoration-color: currentColor;
}
footer.site-footer .group { display: block; width: 100%; text-align: center; }
footer.site-footer .group p { text-align: center; margin: 0; }
/* CleanTools 底部“优化提示”由插件注入，收紧它与版权文字的间距 */
.site-footer + div[style*="margin-top"] {
  margin-top: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* ========================================
   Mouse-following Effect (Effect.astro)
   ======================================== */
.train-1 {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.effects {
  grid-area: content;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 100;
}
.effects__img {
  width: 90px;
  aspect-ratio: 1/1;
  border-radius: 8px;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  overflow: hidden;
  will-change: transform, filter;
}
.effects__img-inner {
  background-position: 50% 50%;
  width: 100%;
  height: 100%;
  background-size: contain !important;
  object-fit: contain !important;
  position: absolute;
  top: 0;
  left: 0;
}
@media (max-width: 768px) {
  .train-1 { display: none !important; }
}

/* Effect Switch (EffectSwitch.astro) */
.train-switch { position: relative; display: block; }
.train-switch button {
  display: block;
  background-color: unset;
  border-radius: 36px;
  border: 1px solid var(--train-color);
  background-color: rgba(0, 0, 0, .3);
  color: var(--color-100);
  font-size: 12px;
  line-height: 22px;
  padding: 0;
  width: 75px;
  text-align: center;
  cursor: pointer;
  background-color: var(--train-color);
  border-color: var(--train-color);
  box-shadow: 0 0 12px 6px rgba(var(--train-color-rgb), .3);
  transition: all 0.25s ease-in-out;
}
.train-switch button:hover {
  color: var(--color-900);
  background-color: var(--train-color);
  border-color: var(--train-color);
  box-shadow: 0 0 12px 6px rgba(var(--train-color-rgb), .75);
}
.train-switch button span { padding-top: 3px; display: inline-block; }
.train-switch button { display: none; }
.train-yellow { --train-color: #f7d252; --train-color-rgb: 247, 210, 82; }
.train-blue { --train-color: #4da7e8; --train-color-rgb: 77, 167, 232; }
.train-green { --train-color: #1bc47d; --train-color-rgb: 27, 196, 125; }
.train-white { --train-color: #dedede; --train-color-rgb: 200, 200, 200; }

@media (max-width: 768px) {
  .train-switch { display: none !important; }
}

/* ========================================
   Comments
   ======================================== */
#comments {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px dashed var(--border);
}
#comments h3 {
  font-size: 1.25rem;
  margin-bottom: 20px;
  color: var(--color-100);
}
.comment-list {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}
.comment-list .comment-list {
  margin-bottom: 0;
}
.comment-item {
  padding: 20px 0;
  border-bottom: 1px dashed var(--border);
  list-style: none;
}
.comment-list > .comment-item:last-child { border-bottom: none; padding-bottom: 4px; }
.comment-children {
  margin-top: 16px;
  padding-left: 20px;
  border-left: 2px dashed var(--border);
}
.comment-children .comment-list {
  margin-bottom: 0;
}
.comment-children .comment-item {
  padding: 12px 0;
  border-bottom: none;
}
.comment-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.comment-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 40px;
  background: var(--color-800);
  border: 1px solid var(--border);
}
.comment-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.comment-avatar .avatar-letter {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  color: var(--color-300);
}
.comment-meta-info {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  min-width: 0;
}
.comment-author { font-weight: 600; color: var(--color-100); }
.comment-author a { color: inherit; text-decoration: none; }
.comment-author a:hover { text-decoration: underline; }
.comment-meta { font-size: 0.8125rem; color: var(--color-500); }
.comment-content { color: var(--color-200); line-height: 1.75; }
.comment-content p { margin: 8px 0; }
.comment-content p:last-child { margin-bottom: 0; }
.comment-header .comment-reply { margin-left: auto; margin-top: 0; }
.comment-reply {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--color-blue);
}
.comment-reply a { color: inherit; text-decoration: none; }
.comment-reply a:hover { text-decoration: underline; }
.comment-by-author .comment-author::after {
  content: "博主";
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  font-size: 0.6875rem;
  line-height: 1.6;
  border-radius: var(--radius);
  background: var(--color-yellow);
  color: #101010;
}
.cancel-comment-reply { text-align: right; }
.cancel-comment-reply a { font-size: 0.875rem; color: var(--color-500); }
.cancel-comment-reply a:hover { color: var(--color-blue); }
#comments > .page-navigator { margin-top: 24px; }
#comment-form { margin-top: 28px; }
#comment-form p { margin-bottom: 14px; }
#comment-form label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--color-200); }
.comment-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.comment-fields p { margin-bottom: 14px; }
@media (max-width: 767px) {
  .comment-fields { grid-template-columns: 1fr; gap: 0; }
}
#comment-form .text, #comment-form .textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--color-900);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--color-100);
  transition: border-color 0.2s;
}
#comment-form .text:focus, #comment-form .textarea:focus {
  outline: none;
  border-color: var(--color-blue);
}
#comment-form .textarea { min-height: 120px; resize: vertical; }
#comment-form .submit {
  padding: 12px 32px;
  background: var(--color-yellow);
  color: #101010;
  border-radius: 36px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}
#comment-form .submit:hover {
  background: #ecba0e;
  box-shadow: 0 0 24px 11px rgba(247, 210, 82, .5);
}

/* ---------- 评论：单篇文章内作为独立虚线框区域 ---------- */
.article #comments.post-region--comments {
  margin: 0;
  padding: 32px clamp(16px, 3.4vw, 36px) clamp(22px, 3vw, 32px);
  border: var(--post-frame);
  border-radius: var(--post-frame-radius);
}
.article #comments h3 {
  font-size: 1.125rem;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: var(--post-frame);
  color: var(--color-100);
}
/* 每条评论独立成框 */
.article .comment-list .comment-item {
  margin-bottom: 12px;
  padding: 16px 18px;
  border: var(--post-frame);
  border-radius: var(--radius-normal);
  background-color: var(--color-999);
  list-style: none;
  transition: border-color var(--theme-transition), background-color var(--theme-transition);
}
.article .comment-list .comment-item:hover { border-color: var(--color-600); }
.article .comment-list > .comment-item:last-child {
  margin-bottom: 0;
  padding-bottom: 16px;
  border-bottom: var(--post-frame);
}
.article .comment-children {
  margin-top: 12px;
  padding-left: 18px;
  border-left: 2px dashed var(--border);
}
.article .comment-children .comment-item {
  margin: 10px 0 0;
  padding: 12px 14px;
  background-color: var(--color-800);
}
.article .comment-avatar { border: var(--post-frame); }
/* 评论表单作为区域内的子框 */
.article .respond {
  margin-top: 24px;
  padding: 22px clamp(14px, 2.4vw, 22px);
  border: var(--post-frame);
  border-radius: var(--radius-normal);
  background-color: var(--color-900);
}
.article .respond h3#response {
  margin: 0 0 18px;
  padding: 0 0 10px;
  border-top: 0;
}
.article #comment-form { margin-top: 0; }
.article #comment-form p:last-child { margin-bottom: 0; }
.article #comment-form .text,
.article #comment-form .textarea {
  background: var(--color-999);
  border: var(--post-frame);
}
.article #comment-form .text:focus,
.article #comment-form .textarea:focus {
  outline: none;
  border-style: solid;
  border-color: var(--color-blue);
}

/* ========================================
   Pagination
   ======================================== */
.page-navigator {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
}
.page-navigator a, .page-navigator span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  background: var(--color-900);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  color: var(--color-100);
  transition: all 0.2s;
}
.page-navigator a:hover, .page-navigator li.current a {
  background: var(--color-100);
  color: var(--color-900);
}
.page-navigator li {
  margin: 0;
  list-style: none;
}
.page-navigator li span {
  color: var(--color-500);
}
.page-navigator li.disabled a,
.page-navigator li.disabled span {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ========================================
   Post Near (prev/next)
   ======================================== */
.post-near {
  display: flex;
  justify-content: space-between;
  padding: 20px 0;
  border-top: 1px dashed var(--border);
  margin-top: 28px;
  list-style: none;
  gap: 16px;
  flex-wrap: wrap;
}
.post-near li { flex: 1; min-width: 200px; list-style: none; font-size: 0.875rem; color: var(--color-300); }
.post-near li:last-child { text-align: right; }
.post-near a {
  color: var(--color-blue);
  text-decoration: none;
  transition: opacity .2s;
}
.post-near a:hover { opacity: .75; text-decoration: underline; }

/* ========================================
   Tags
   ======================================== */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px dashed var(--border);
}
.tags a {
  font-size: 0.75rem;
  border: 1px solid var(--color-700);
  background: var(--color-999);
  border-radius: 36px;
  padding: 4px 16px;
  text-transform: uppercase;
  transition: all 0.25s ease-in-out;
  color: var(--color-300);
}
.tags a:hover { border: 1px solid var(--color-300); color: var(--color-100); }

/* 文章详情页尾部：标签行 */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px dashed var(--border);
}
.post-tags a {
  font-size: 0.75rem;
  line-height: 1.6;
  border: 1px solid var(--color-700);
  background: var(--color-999);
  border-radius: 36px;
  padding: 3px 14px;
  color: var(--color-300);
  transition: all 0.25s ease-in-out;
}
.post-tags a::before { content: "# "; color: var(--color-500); }
.post-tags a:hover { border-color: var(--color-300); color: var(--color-100); }

/* ========================================
   Animations
   ======================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.6s ease-out forwards; }

/* ========================================
   Hidden utilities
   ======================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========================================
   Post detail: 附属信息框（系列推荐 / 历史上的今天）
   ======================================== */
.article .article-lead,
.article .article-extra { text-align: left; }
.article .series-box,
.article .history-box {
  padding: 16px 18px;
  border: var(--post-frame);
  border-radius: var(--radius-normal);
  background: var(--color-900);
  color: var(--color-300);
  font-size: 0.8125rem;
  line-height: 1.7;
  text-align: left;
}
.article .article-lead > * + *,
.article .article-extra > * + * { margin-top: 14px; }
.article .series-box__intro,
.article .history-box__title {
  color: var(--color-200);
  font-weight: 600;
}
.article .series-box__list,
.article .history-box__list {
  list-style: none;
  padding-left: 0;
  margin: 8px 0 0;
}
.article .series-box__item,
.article .history-box__item {
  margin: 0;
  padding: 6px 0;
  border-top: var(--post-frame-soft);
  line-height: 1.6;
}
.article .series-box__index {
  display: inline-block;
  min-width: 1.6em;
  color: var(--color-500);
  font-family: var(--font-type);
}
.article .history-box__head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-blue);
}
.article .history-box__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}
.article .history-box__date {
  display: inline-block;
  min-width: 86px;
  color: var(--color-blue);
  font-family: var(--font-type);
  font-weight: 400;
  white-space: nowrap;
}
.article .history-box__num { color: var(--color-500); font-size: 0.75rem; }
.article .series-box a,
.article .history-box a { color: var(--color-blue); text-decoration: none; }
.article .series-box a:hover,
.article .history-box a:hover { text-decoration: underline; }
.article .series-box__more { margin: 10px 0 0; }
:root.theme-dark .article .series-box,
:root.theme-dark .article .history-box { color: var(--color-300); }
:root.theme-dark .article .history-box__head { color: var(--color-primary-light); }
:root.theme-dark .article .history-box__date { color: var(--color-primary-light); }

/* 正文里的「相关文章卡片」由内联浅色样式生成，暗色模式下需要覆盖 */
:root.theme-dark .article .content .post-card {
  background: var(--color-800) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}
:root.theme-dark .article .content .post-card-title-desktop,
:root.theme-dark .article .content .post-card-title-mobile a { color: var(--color-100) !important; }
:root.theme-dark .article .content .post-card-meta span,
:root.theme-dark .article .content .post-card-meta-mobile span { color: var(--color-400) !important; }
:root.theme-dark .article .content .post-card-meta a,
:root.theme-dark .article .content .post-card-meta-mobile a { color: var(--color-blue) !important; }
:root.theme-dark .article .content .post-card-btn { color: var(--color-200) !important; border-color: var(--border) !important; }
:root.theme-dark .article .content .post-card-btn:hover { border-color: var(--color-300) !important; }
:root.theme-dark .article .content .post-card-thumb { background-color: var(--color-700) !important; }
:root.theme-dark .article .content .post-card-btn svg { color: var(--color-200); }
