:root {
  --color-bg: #f7f5f0;
  --color-card: #ffffff;
  --color-text: #2c3e50;
  --color-text-soft: #4a5b6e;
  --color-meta: #7f8c8d;
  --color-border: #e1e4e8;
  --color-border-soft: #eef0f2;
  --color-link: #2980b9;
  --color-link-hover: #1f5f8b;
  --color-tag-bg: #ecf0f1;
  --color-code-bg: #f8f8f2;
  --color-code-border: #e8e8e0;
  --color-blockquote-border: #bdc3c7;
  --color-blockquote-bg: #f5f5f0;
  --color-accent: #d35400;
  --max-width: 1200px;
  --max-width-post: 800px;
  --gap: 1.5rem;
  --radius: 8px;
  --radius-sm: 4px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  --font-serif: Georgia, "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "SimSun", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1a1d23;
    --color-card: #23272f;
    --color-text: #e0e3e8;
    --color-text-soft: #b8bdc5;
    --color-meta: #8a909a;
    --color-border: #2c3138;
    --color-border-soft: #262a30;
    --color-link: #5dade2;
    --color-link-hover: #85c1e9;
    --color-tag-bg: #2c3138;
    --color-code-bg: #1e2128;
    --color-code-border: #2c3138;
    --color-blockquote-border: #4a5b6e;
    --color-blockquote-bg: #23272f;
  }
}

* { box-sizing: border-box; }
html { font-size: 16px; }

body {
  margin: 0;
  background: var(--color-bg);
  background-image: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg) 100%);
  background-attachment: fixed;
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--color-link); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--color-link-hover); text-decoration: underline; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ===== Header ===== */
.site-header {
  padding: 2rem 0 1.5rem;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 2rem;
  background: var(--color-card);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.site-header .container {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.site-title {
  display: inline-block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
  letter-spacing: -0.01em;
}
.site-title:hover { color: var(--color-link); text-decoration: none; }
.site-desc {
  color: var(--color-meta);
  margin: 0;
  font-size: 0.85rem;
  font-style: italic;
}

/* ===== Main ===== */
.main-content { min-height: 70vh; padding-bottom: 3rem; }
.page-title {
  font-size: 1.5rem;
  margin: 0 0 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}


.post-card {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin: 0 0 var(--gap);
  padding: 1.2rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.post-card:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
  border-color: var(--color-link);
}

.post-card-title {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  line-height: 1.4;
  font-weight: 600;
}
.post-card-title a { color: var(--color-text); }
.post-card-title a:hover { color: var(--color-link); text-decoration: none; }

.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  color: var(--color-meta);
  font-size: 0.8rem;
  margin-bottom: 0.7rem;
}

.category-tag {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  background: var(--color-tag-bg);
  border-radius: 3px;
  font-size: 0.75rem;
  color: var(--color-text-soft);
}

.post-card-summary {
  color: var(--color-text-soft);
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0.5rem 0;
}

.post-card-more {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ===== Single post ===== */
.post-single {
  max-width: var(--max-width-post);
  margin: 0 auto;
  background: var(--color-card);
  padding: 2.5rem 3rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
@media (max-width: 600px) {
  .post-single { padding: 1.5rem 1.2rem; }
}

.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--color-border-soft);
}
.post-title {
  font-size: 2.1rem;
  line-height: 1.3;
  margin: 0 0 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
}
@media (max-width: 600px) {
  .post-title { font-size: 1.6rem; }
}

.post-meta {
  color: var(--color-meta);
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}
.post-cats { display: inline-flex; gap: 0.4rem; flex-wrap: wrap; }

.post-content {
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--color-text);
  font-family: var(--font-serif);
}
.post-content h1, .post-content h2, .post-content h3, .post-content h4 {
  font-family: var(--font-sans);
  margin-top: 2em;
  margin-bottom: 0.6em;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text);
}
.post-content h1 { font-size: 1.8rem; }
.post-content h2 {
  font-size: 1.45rem;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--color-border-soft);
}
.post-content h3 { font-size: 1.2rem; color: var(--color-text-soft); }
.post-content h4 { font-size: 1.05rem; }

.post-content p { margin: 1em 0; }
.post-content strong { color: var(--color-text); font-weight: 700; }
.post-content em { color: var(--color-text-soft); }

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

.post-content a {
  border-bottom: 1px dotted var(--color-link);
}
.post-content a:hover {
  border-bottom-style: solid;
  text-decoration: none;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: block;
  margin: 1.2em auto;
}

.post-content code {
  background: var(--color-code-bg);
  padding: 0.12rem 0.42rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--color-accent);
  border: 1px solid var(--color-code-border);
}

.post-content pre {
  background: var(--color-code-bg);
  padding: 1.1rem 1.3rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  line-height: 1.55;
  margin: 1.4em 0;
  border: 1px solid var(--color-code-border);
  border-left: 4px solid var(--color-accent);
}
.post-content pre code {
  background: none;
  padding: 0;
  border: none;
  color: inherit;
  font-size: 0.88em;
}

.post-content blockquote {
  border-left: 4px solid var(--color-blockquote-border);
  margin: 1.4em 0;
  padding: 0.6em 1.2em;
  color: var(--color-text-soft);
  background: var(--color-blockquote-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
}
.post-content blockquote p { margin: 0.4em 0; }

.post-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.4em 0;
  font-size: 0.92em;
}
.post-content th, .post-content td {
  padding: 0.55em 0.9em;
  border: 1px solid var(--color-border);
  text-align: left;
}
.post-content th {
  background: var(--color-tag-bg);
  font-weight: 700;
}

.post-content hr {
  border: none;
  border-top: 1px dashed var(--color-border);
  margin: 2.5em 0;
}

/* ===== Comments ===== */
.comments {
  max-width: var(--max-width-post);
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border-soft);
}
.comments h2 {
  font-size: 1.3rem;
  margin: 0 0 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.comments h2::before {
  content: "💬";
  font-size: 1.2rem;
}
.comments-notice {
  background: var(--color-blockquote-bg);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.9rem 1.2rem;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  color: var(--color-text-soft);
  line-height: 1.6;
}
.comments-notice strong {
  color: var(--color-text);
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 700;
}
.comments-notice a {
  font-weight: 500;
}
.comments-disabled .comments-hint {
  color: var(--color-meta);
  font-size: 0.9rem;
  padding: 1rem;
  background: var(--color-code-bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-meta);
}
.comments-disabled code {
  background: var(--color-bg);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 2px solid var(--color-border);
  padding: 2rem 0;
  color: var(--color-meta);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 3rem;
  background: var(--color-card);
  box-shadow: 0 -1px 3px rgba(0,0,0,0.04);
}
/* Comments meta notice (小字提示, 非正文强调) */
.comments-meta {
  color: var(--color-meta);
  font-size: 0.82rem;
  line-height: 1.6;
  margin: 0 0 1.2rem;
  font-style: normal;
  font-weight: 400;
  opacity: 0.85;
}

/* ===== Theme Switcher ===== */
.theme-switcher {
  position: relative;
  font-size: 0.85rem;
}
.theme-btn {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.15s ease;
}
.theme-btn:hover {
  border-color: var(--color-link);
  background: var(--color-tag-bg);
}
.theme-options {
  position: absolute;
  top: calc(100% + 0.3rem);
  right: 0;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  display: none;
  z-index: 100;
  min-width: 160px;
  overflow: hidden;
}
.theme-options.open {
  display: block;
}
.theme-option {
  display: block;
  width: 100%;
  padding: 0.55rem 0.95rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--color-text);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  transition: background 0.1s ease;
}
.theme-option:hover {
  background: var(--color-tag-bg);
}
.theme-option.active {
  background: var(--color-tag-bg);
  font-weight: 700;
  color: var(--color-link);
}
/* ===== Blog Banner (top of every page) ===== */
.blog-banner img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center 30%;
}

/* ===== Blog Hero (homepage only, between site-header and post list) ===== */
.blog-hero-image {
  display: block;
  width: 100%;
  height: 100%;
}
.blog-hero-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.blog-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.0) 0%, rgba(0,0,0,0.45) 100%);
  pointer-events: none;
}
.blog-hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.5rem 2rem 2rem;
  color: #ffffff;
  text-align: left;
}
.blog-hero-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
  color: #ffffff;
}
.blog-hero-desc {
  font-size: 1rem;
  margin: 0;
  opacity: 0.92;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
  color: #ffffff;
}

@media (max-width: 700px) {
  .blog-banner img { height: 140px; }
  .blog-hero { height: 280px; }
  .blog-hero-title { font-size: 1.4rem; }
  .blog-hero-content { padding: 1rem 1.2rem 1.2rem; }
}
/* ===== Sticky Header (滚动冻结的标题栏) ===== */
.sticky-header.visible {
  top: 0;
}
.sticky-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: nowrap;
}
.sticky-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sticky-title:hover {
  color: var(--color-link);
  text-decoration: none;
}

/* LoveIt 主题：sticky 用蓝色 header 风格 */
body[data-theme="loveit"] .sticky-header {
  background: linear-gradient(135deg, rgba(66, 153, 225, 0.97) 0%, rgba(49, 130, 206, 0.97) 100%);
  border-bottom-color: rgba(255, 255, 255, 0.25);
}
body[data-theme="loveit"] .sticky-title {
  color: #ffffff;
}
body[data-theme="loveit"] .sticky-title:hover {
  color: rgba(255, 255, 255, 0.85);
}

/* PaperMod 主题：sticky 更简洁 */
body[data-theme="papermod"] .sticky-header {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid #e5e7eb;
}

/* 切到 LoveIt 主题时，sticky header 内的切换器按钮变白底友好色 */
body[data-theme="loveit"] .sticky-header .theme-btn {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.45);
  color: #ffffff;
}
body[data-theme="loveit"] .sticky-header .theme-btn:hover {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.7);
}
body[data-theme="loveit"] .sticky-header .theme-options {
  background: rgba(255, 255, 255, 0.98);
}
body[data-theme="loveit"] .sticky-header .theme-option {
  color: #2c3e50;
}
body[data-theme="loveit"] .sticky-header .theme-option.active {
  background: #e6fffa;
  color: #234e52;
}

/* ===== Hero 微调：去掉之前的 .blog-banner strip ==== */
/* ===== Blog Hero：full-bleed 全屏宽度（突破 container 约束）===== */
.blog-hero {
  position: relative;
  left: 50%;
  right: 50%;
  width: 100vw;
  margin-left: -50vw;
  margin-right: -50vw;
  height: 60vh;
  min-height: 380px;
  max-height: 560px;
  overflow: hidden;
  background: var(--color-card);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.blog-hero-image {
  display: block;
  width: 100%;
  height: 100%;
}
.blog-hero-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}
.blog-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.0) 0%, rgba(0,0,0,0.45) 100%);
  pointer-events: none;
}
.blog-hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.5rem 2rem 2rem;
  color: #ffffff;
  text-align: left;
}
.blog-hero-title {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 700;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
  color: #ffffff;
}
.blog-hero-desc {
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  margin: 0;
  opacity: 0.92;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
  color: #ffffff;
}

/* ===== Post Grid：CSS Grid masonry（行排，左右流）===== */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: masonry;
  gap: var(--gap);
}
@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .post-grid { grid-template-columns: 1fr; }
}

/* grid 模式下卡片不需要 column 特定规则 */
.post-card {
  break-inside: auto;
  -webkit-column-break-inside: auto;
  page-break-inside: auto;
  display: block;
  width: auto;
  margin: 0;
}

/* ===== 移除旧的 .blog-banner 死代码（清理）===== */
.blog-banner { display: none !important; }
/* ===== Hero：高度减半（30vh + 中心裁剪）===== */
.blog-hero {
  position: relative;
  left: 50%;
  right: 50%;
  width: 100vw;
  margin-left: -50vw;
  margin-right: -50vw;
  height: 30vh;
  min-height: 180px;
  max-height: 280px;
  overflow: hidden;
  background: var(--color-card);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.blog-hero-image {
  display: block;
  width: 100%;
  height: 100%;
}
.blog-hero-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}
.blog-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.0) 0%, rgba(0,0,0,0.5) 100%);
  pointer-events: none;
}
.blog-hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem 1.5rem 1.4rem;
  color: #ffffff;
  text-align: left;
}
.blog-hero-title {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 700;
  margin: 0 0 0.3rem;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
  color: #ffffff;
}
.blog-hero-desc {
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  margin: 0;
  opacity: 0.92;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
  color: #ffffff;
}

/* ===== Sticky Header：固定高度 + 安全尺寸 ===== */
.sticky-header {
  position: fixed;
  top: -60px;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 56px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: top 0.35s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
}
.sticky-header.visible {
  top: 0;
}
.sticky-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: nowrap;
  height: 100%;
}
.sticky-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}
.sticky-title:hover {
  color: var(--color-link);
  text-decoration: none;
}

/* sticky 高度让位给内容（避免被遮） */
body.sticky-active .main-content {
  padding-top: 56px;
  transition: padding-top 0.3s ease;
}

/* LoveIt 主题：sticky 蓝色 + 内容区底色让出 */
body[data-theme="loveit"] .sticky-header {
  background: linear-gradient(135deg, rgba(66, 153, 225, 0.97) 0%, rgba(49, 130, 206, 0.97) 100%);
  border-bottom-color: rgba(255, 255, 255, 0.25);
}
body[data-theme="loveit"] .sticky-title {
  color: #ffffff;
}
body[data-theme="loveit"] .sticky-title:hover {
  color: rgba(255, 255, 255, 0.85);
}
body[data-theme="loveit"] .sticky-header .theme-btn {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.45);
  color: #ffffff;
}
body[data-theme="loveit"] .sticky-header .theme-btn:hover {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.7);
}
body[data-theme="loveit"] .sticky-header .theme-options {
  background: rgba(255, 255, 255, 0.98);
}
body[data-theme="loveit"] .sticky-header .theme-option {
  color: #2c3e50;
}
body[data-theme="loveit"] .sticky-header .theme-option.active {
  background: #e6fffa;
  color: #234e52;
}

/* PaperMod 主题：sticky 极致简洁 */
body[data-theme="papermod"] .sticky-header {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid #e5e7eb;
}
/* ===== Header：logo + 品牌名 ===== */
.sticky-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--color-text);
  white-space: nowrap;
}
.sticky-brand:hover { text-decoration: none; }
.sticky-logo {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}
.sticky-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}
.sticky-brand:hover .sticky-title {
  color: var(--color-link);
}

/* ===== Header Nav：主站 / /games/ 按钮 ===== */
.sticky-nav {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
}
.sticky-nav-link {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 5px;
  color: var(--color-text-soft);
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1.2;
}
.sticky-nav-link:hover {
  background: var(--color-tag-bg);
  color: var(--color-link);
  text-decoration: none;
}
.sticky-nav-link.active {
  background: var(--color-link);
  color: #ffffff;
  font-weight: 600;
}

/* LoveIt 主题：nav 链接适配蓝底 */
body[data-theme="loveit"] .sticky-nav-link {
  color: rgba(255, 255, 255, 0.88);
}
body[data-theme="loveit"] .sticky-nav-link:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}
body[data-theme="loveit"] .sticky-nav-link.active {
  background: #ffffff;
  color: #2b6cb0;
  font-weight: 700;
}

/* PaperMod 主题：极简灰按钮 */
body[data-theme="papermod"] .sticky-nav-link.active {
  background: #2563eb;
  color: #ffffff;
}

/* ===== 移动端：标题隐 + nav 保留 ===== */
@media (max-width: 600px) {
  .sticky-title { display: none; }
  .sticky-nav-link { padding: 0.4rem 0.6rem; font-size: 0.8rem; }
  .theme-btn { font-size: 0.8rem; padding: 0.35rem 0.6rem; }
}

/* ===== Sticky Nav 下拉菜单（贝塔实验室）· V3 ===== */
.sticky-nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.sticky-nav-dropdown .dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
  border-radius: 5px;
  color: var(--color-text-soft);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}
.sticky-nav-dropdown .dropdown-toggle:hover,
.sticky-nav-dropdown:hover .dropdown-toggle {
  background: var(--color-tag-bg);
  color: var(--color-link);
}
.sticky-nav-dropdown .caret {
  font-size: 0.7em;
  opacity: 0.7;
  transition: transform 0.2s;
  display: inline-block;
}
.sticky-nav-dropdown:hover .caret { transform: rotate(180deg); }

.dropdown-menu {
  position: absolute;
  top: 100%; padding-top: 16px;
  left: 0;
  min-width: 140px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 200;
}

.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
  background: transparent;
}
.sticky-nav-dropdown:hover .dropdown-menu,
.sticky-nav-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.dropdown-item {
  display: block;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--color-text-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s;
}
.dropdown-item:hover {
  background: var(--color-tag-bg);
  color: var(--color-link);
  text-decoration: none;
}
body[data-theme=loveit] .sticky-nav-dropdown .dropdown-toggle:hover,
body[data-theme=loveit] .sticky-nav-dropdown:hover .dropdown-toggle {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}
