/*! laoguanTX bundle: shell-sidebar-home */
/* source: normalize.css */
/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */

/* Document
   ========================================================================== */

/**
 * 1. Correct the line height in all browsers.
 * 2. Prevent adjustments of font size after orientation changes in iOS.
 */

 html {
  line-height: 1.15; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
}

/* Sections
   ========================================================================== */

/**
 * Remove the margin in all browsers.
 */

body {
  margin: 0;
}

/**
 * Correct the font size and margin on `h1` elements within `section` and
 * `article` contexts in Chrome, Firefox, and Safari.
 */

h1 {
  font-size: 2em;
  margin: 0.67em 0;
}

/* Grouping content
   ========================================================================== */

/**
 * 1. Add the correct box sizing in Firefox.
 * 2. Show the overflow in Edge and IE.
 */

hr {
  box-sizing: content-box; /* 1 */
  height: 0; /* 1 */
  overflow: visible; /* 2 */
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

pre {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

/* Text-level semantics
   ========================================================================== */

/**
 * Remove the gray background on active links in IE 10.
 */

a {
  background-color: transparent;
}

/**
 * 1. Remove the bottom border in Chrome 57-
 * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
 */

abbr[title] {
  border-bottom: none; /* 1 */
  text-decoration: underline; /* 2 */
  text-decoration: underline dotted; /* 2 */
}

/**
 * Add the correct font weight in Chrome, Edge, and Safari.
 */

b,
strong {
  font-weight: bolder;
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

code,
kbd,
samp {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

/**
 * Add the correct font size in all browsers.
 */

small {
  font-size: 80%;
}

/**
 * Prevent `sub` and `sup` elements from affecting the line height in
 * all browsers.
 */

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/* Embedded content
   ========================================================================== */

/**
 * Remove the border on images inside links in IE 10.
 */

img {
  border-style: none;
}

/* Forms
   ========================================================================== */

/**
 * 1. Change the font styles in all browsers.
 * 2. Remove the margin in Firefox and Safari.
 */

button,
input,
optgroup,
select,
textarea {
  font-family: inherit; /* 1 */
  font-size: 100%; /* 1 */
  line-height: 1.15; /* 1 */
  margin: 0; /* 2 */
}

/**
 * Show the overflow in IE.
 * 1. Show the overflow in Edge.
 */

button,
input { /* 1 */
  overflow: visible;
}

/**
 * Remove the inheritance of text transform in Edge, Firefox, and IE.
 * 1. Remove the inheritance of text transform in Firefox.
 */

button,
select { /* 1 */
  text-transform: none;
}

/**
 * Correct the inability to style clickable types in iOS and Safari.
 */

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
}

/**
 * Remove the inner border and padding in Firefox.
 */

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

/**
 * Restore the focus styles unset by the previous rule.
 */

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}

/**
 * Correct the padding in Firefox.
 */

fieldset {
  padding: 0.35em 0.75em 0.625em;
}

/**
 * 1. Correct the text wrapping in Edge and IE.
 * 2. Correct the color inheritance from `fieldset` elements in IE.
 * 3. Remove the padding so developers are not caught out when they zero out
 *    `fieldset` elements in all browsers.
 */

legend {
  box-sizing: border-box; /* 1 */
  color: inherit; /* 2 */
  display: table; /* 1 */
  max-width: 100%; /* 1 */
  padding: 0; /* 3 */
  white-space: normal; /* 1 */
}

/**
 * Add the correct vertical alignment in Chrome, Firefox, and Opera.
 */

progress {
  vertical-align: baseline;
}

/**
 * Remove the default vertical scrollbar in IE 10+.
 */

textarea {
  overflow: auto;
}

/**
 * 1. Add the correct box sizing in IE 10.
 * 2. Remove the padding in IE 10.
 */

[type="checkbox"],
[type="radio"] {
  box-sizing: border-box; /* 1 */
  padding: 0; /* 2 */
}

/**
 * Correct the cursor style of increment and decrement buttons in Chrome.
 */

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
  height: auto;
}

/**
 * 1. Correct the odd appearance in Chrome and Safari.
 * 2. Correct the outline style in Safari.
 */

[type="search"] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}

/**
 * Remove the inner padding in Chrome and Safari on macOS.
 */

[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

/**
 * 1. Correct the inability to style clickable types in iOS and Safari.
 * 2. Change font properties to `inherit` in Safari.
 */

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}

/* Interactive
   ========================================================================== */

/*
 * Add the correct display in Edge, IE 10+, and Firefox.
 */

details {
  display: block;
}

/*
 * Add the correct display in all browsers.
 */

summary {
  display: list-item;
}

/* Misc
   ========================================================================== */

/**
 * Add the correct display in IE 10+.
 */

template {
  display: none;
}

/**
 * Add the correct display in IE 10.
 */

[hidden] {
  display: none;
}

/* source: grid.css */
/*
 * Bento Grid System
 * Source: https://github.com/fenbox/bento
 * Version: 1.2.8
 * Update: 2013.11.25
 */
.container, .row > [class*="col-"] {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box; }

.container {
  margin-left: auto;
  margin-right: auto;
  padding-left: 10px;
  padding-right: 10px; }

.row {
  margin-right: -10px;
  margin-left: -10px; }

.row > [class*="col-"] {
  float: left;
  min-height: 1px;
  padding-right: 10px;
  padding-left: 10px; }

.row > [class*="-push-"],
.row > [class*="-pull-"] {
  position: relative; }

/*
 * Mobile and up
 */
.col-mb-1 {
  width: 8.33333%; }

.col-mb-2 {
  width: 16.66667%; }

.col-mb-3 {
  width: 25%; }

.col-mb-4 {
  width: 33.33333%; }

.col-mb-5 {
  width: 41.66667%; }

.col-mb-6 {
  width: 50%; }

.col-mb-7 {
  width: 58.33333%; }

.col-mb-8 {
  width: 66.66667%; }

.col-mb-9 {
  width: 75%; }

.col-mb-10 {
  width: 83.33333%; }

.col-mb-11 {
  width: 91.66667%; }

.col-mb-12 {
  width: 100%; }

/*
 * Tablet and up
 */
@media (min-width: 768px) {
  .container {
    max-width: 728px; }

  .col-tb-1 {
    width: 8.33333%; }

  .col-tb-2 {
    width: 16.66667%; }

  .col-tb-3 {
    width: 25%; }

  .col-tb-4 {
    width: 33.33333%; }

  .col-tb-5 {
    width: 41.66667%; }

  .col-tb-6 {
    width: 50%; }

  .col-tb-7 {
    width: 58.33333%; }

  .col-tb-8 {
    width: 66.66667%; }

  .col-tb-9 {
    width: 75%; }

  .col-tb-10 {
    width: 83.33333%; }

  .col-tb-11 {
    width: 91.66667%; }

  .col-tb-12 {
    width: 100%; }

  .col-tb-offset-0 {
    margin-left: 0%; }

  .col-tb-offset-1 {
    margin-left: 8.33333%; }

  .col-tb-offset-2 {
    margin-left: 16.66667%; }

  .col-tb-offset-3 {
    margin-left: 25%; }

  .col-tb-offset-4 {
    margin-left: 33.33333%; }

  .col-tb-offset-5 {
    margin-left: 41.66667%; }

  .col-tb-offset-6 {
    margin-left: 50%; }

  .col-tb-offset-7 {
    margin-left: 58.33333%; }

  .col-tb-offset-8 {
    margin-left: 66.66667%; }

  .col-tb-offset-9 {
    margin-left: 75%; }

  .col-tb-offset-10 {
    margin-left: 83.33333%; }

  .col-tb-offset-11 {
    margin-left: 91.66667%; }

  .col-tb-offset-12 {
    margin-left: 100%; }

  .col-tb-pull-0 {
    right: 0%; }

  .col-tb-pull-1 {
    right: 8.33333%; }

  .col-tb-pull-2 {
    right: 16.66667%; }

  .col-tb-pull-3 {
    right: 25%; }

  .col-tb-pull-4 {
    right: 33.33333%; }

  .col-tb-pull-5 {
    right: 41.66667%; }

  .col-tb-pull-6 {
    right: 50%; }

  .col-tb-pull-7 {
    right: 58.33333%; }

  .col-tb-pull-8 {
    right: 66.66667%; }

  .col-tb-pull-9 {
    right: 75%; }

  .col-tb-pull-10 {
    right: 83.33333%; }

  .col-tb-pull-11 {
    right: 91.66667%; }

  .col-tb-pull-12 {
    right: 100%; }

  .col-tb-push-0 {
    left: 0%; }

  .col-tb-push-1 {
    left: 8.33333%; }

  .col-tb-push-2 {
    left: 16.66667%; }

  .col-tb-push-3 {
    left: 25%; }

  .col-tb-push-4 {
    left: 33.33333%; }

  .col-tb-push-5 {
    left: 41.66667%; }

  .col-tb-push-6 {
    left: 50%; }

  .col-tb-push-7 {
    left: 58.33333%; }

  .col-tb-push-8 {
    left: 66.66667%; }

  .col-tb-push-9 {
    left: 75%; }

  .col-tb-push-10 {
    left: 83.33333%; }

  .col-tb-push-11 {
    left: 91.66667%; }

  .col-tb-push-12 {
    left: 100%; } }
/*
 * Desktop and up
 */
@media (min-width: 992px) {
  .container {
    max-width: 952px; }

  .col-1 {
    width: 8.33333%; }

  .col-2 {
    width: 16.66667%; }

  .col-3 {
    width: 25%; }

  .col-4 {
    width: 33.33333%; }

  .col-5 {
    width: 41.66667%; }

  .col-6 {
    width: 50%; }

  .col-7 {
    width: 58.33333%; }

  .col-8 {
    width: 66.66667%; }

  .col-9 {
    width: 75%; }

  .col-10 {
    width: 83.33333%; }

  .col-11 {
    width: 91.66667%; }

  .col-12 {
    width: 100%; }

  .col-offset-0 {
    margin-left: 0%; }

  .col-offset-1 {
    margin-left: 8.33333%; }

  .col-offset-2 {
    margin-left: 16.66667%; }

  .col-offset-3 {
    margin-left: 25%; }

  .col-offset-4 {
    margin-left: 33.33333%; }

  .col-offset-5 {
    margin-left: 41.66667%; }

  .col-offset-6 {
    margin-left: 50%; }

  .col-offset-7 {
    margin-left: 58.33333%; }

  .col-offset-8 {
    margin-left: 66.66667%; }

  .col-offset-9 {
    margin-left: 75%; }

  .col-offset-10 {
    margin-left: 83.33333%; }

  .col-offset-11 {
    margin-left: 91.66667%; }

  .col-offset-12 {
    margin-left: 100%; }

  .col-pull-0 {
    right: 0%; }

  .col-pull-1 {
    right: 8.33333%; }

  .col-pull-2 {
    right: 16.66667%; }

  .col-pull-3 {
    right: 25%; }

  .col-pull-4 {
    right: 33.33333%; }

  .col-pull-5 {
    right: 41.66667%; }

  .col-pull-6 {
    right: 50%; }

  .col-pull-7 {
    right: 58.33333%; }

  .col-pull-8 {
    right: 66.66667%; }

  .col-pull-9 {
    right: 75%; }

  .col-pull-10 {
    right: 83.33333%; }

  .col-pull-11 {
    right: 91.66667%; }

  .col-pull-12 {
    right: 100%; }

  .col-push-0 {
    left: 0%; }

  .col-push-1 {
    left: 8.33333%; }

  .col-push-2 {
    left: 16.66667%; }

  .col-push-3 {
    left: 25%; }

  .col-push-4 {
    left: 33.33333%; }

  .col-push-5 {
    left: 41.66667%; }

  .col-push-6 {
    left: 50%; }

  .col-push-7 {
    left: 58.33333%; }

  .col-push-8 {
    left: 66.66667%; }

  .col-push-9 {
    left: 75%; }

  .col-push-10 {
    left: 83.33333%; }

  .col-push-11 {
    left: 91.66667%; }

  .col-push-12 {
    left: 100%; } }
/*
 * Widescreen and up
 */
@media (min-width: 1200px) {
  .container {
    max-width: 1160px; }

  .col-wd-1 {
    width: 8.33333%; }

  .col-wd-2 {
    width: 16.66667%; }

  .col-wd-3 {
    width: 25%; }

  .col-wd-4 {
    width: 33.33333%; }

  .col-wd-5 {
    width: 41.66667%; }

  .col-wd-6 {
    width: 50%; }

  .col-wd-7 {
    width: 58.33333%; }

  .col-wd-8 {
    width: 66.66667%; }

  .col-wd-9 {
    width: 75%; }

  .col-wd-10 {
    width: 83.33333%; }

  .col-wd-11 {
    width: 91.66667%; }

  .col-wd-12 {
    width: 100%; }

  .col-wd-offset-0 {
    margin-left: 0%; }

  .col-wd-offset-1 {
    margin-left: 8.33333%; }

  .col-wd-offset-2 {
    margin-left: 16.66667%; }

  .col-wd-offset-3 {
    margin-left: 25%; }

  .col-wd-offset-4 {
    margin-left: 33.33333%; }

  .col-wd-offset-5 {
    margin-left: 41.66667%; }

  .col-wd-offset-6 {
    margin-left: 50%; }

  .col-wd-offset-7 {
    margin-left: 58.33333%; }

  .col-wd-offset-8 {
    margin-left: 66.66667%; }

  .col-wd-offset-9 {
    margin-left: 75%; }

  .col-wd-offset-10 {
    margin-left: 83.33333%; }

  .col-wd-offset-11 {
    margin-left: 91.66667%; }

  .col-wd-offset-12 {
    margin-left: 100%; }

  .col-wd-pull-0 {
    right: 0%; }

  .col-wd-pull-1 {
    right: 8.33333%; }

  .col-wd-pull-2 {
    right: 16.66667%; }

  .col-wd-pull-3 {
    right: 25%; }

  .col-wd-pull-4 {
    right: 33.33333%; }

  .col-wd-pull-5 {
    right: 41.66667%; }

  .col-wd-pull-6 {
    right: 50%; }

  .col-wd-pull-7 {
    right: 58.33333%; }

  .col-wd-pull-8 {
    right: 66.66667%; }

  .col-wd-pull-9 {
    right: 75%; }

  .col-wd-pull-10 {
    right: 83.33333%; }

  .col-wd-pull-11 {
    right: 91.66667%; }

  .col-wd-pull-12 {
    right: 100%; }

  .col-wd-push-0 {
    left: 0%; }

  .col-wd-push-1 {
    left: 8.33333%; }

  .col-wd-push-2 {
    left: 16.66667%; }

  .col-wd-push-3 {
    left: 25%; }

  .col-wd-push-4 {
    left: 33.33333%; }

  .col-wd-push-5 {
    left: 41.66667%; }

  .col-wd-push-6 {
    left: 50%; }

  .col-wd-push-7 {
    left: 58.33333%; }

  .col-wd-push-8 {
    left: 66.66667%; }

  .col-wd-push-9 {
    left: 75%; }

  .col-wd-push-10 {
    left: 83.33333%; }

  .col-wd-push-11 {
    left: 91.66667%; }

  .col-wd-push-12 {
    left: 100%; } }
/*
 * Responsive kit
 */
@media (max-width: 767px) {
  .kit-hidden-mb {
    display: none; } }
@media (max-width: 991px) {
  .kit-hidden-tb {
    display: none; } }
@media (max-width: 1199px) {
  .kit-hidden {
    display: none; } }
/*
 * Clearfix
 */
.clearfix, .row {
  zoom: 1; }
  .clearfix:before, .row:before, .clearfix:after, .row:after {
    content: " ";
    display: table; }
  .clearfix:after, .row:after {
    clear: both; }

/* source: style.css */
/* ========================================
 * laoguanTX Theme — 全局主题层
 *
 * 本文件只装全局层：设计 tokens、暗色模式、base/reset、
 * 页面骨架容器、utility 工具类、全局响应式、reduced-motion、
 * ambiance 氛围色、print 打印样式。
 *
 * 组件 / 页面专属样式见 components/*.css 与 pages/*.css，
 * 由 components/header.php 的 render_styles() 集中加载；
 * 本文件始终排在最前，保证 tokens 优先就位。
 * ======================================== */

/* ========================================
 * 0. @FONT-FACE — HarmonyOS Sans SC
 * ======================================== */
@font-face { font-family: "HarmonyOS Sans SC"; src: url("../src/fonts/woff2/HarmonyOS-Sans-SC-400-latin.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; unicode-range: U+0000-024F, U+2000-206F; }
@font-face { font-family: "HarmonyOS Sans SC"; src: url("../src/fonts/woff2/HarmonyOS-Sans-SC-400-symbols.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; unicode-range: U+2E80-33FF; }
@font-face { font-family: "HarmonyOS Sans SC"; src: url("../src/fonts/woff2/HarmonyOS-Sans-SC-400-exta.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; unicode-range: U+3400-4DBF; }
@font-face { font-family: "HarmonyOS Sans SC"; src: url("../src/fonts/woff2/HarmonyOS-Sans-SC-400-cjk1.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; unicode-range: U+4E00-62FF; }
@font-face { font-family: "HarmonyOS Sans SC"; src: url("../src/fonts/woff2/HarmonyOS-Sans-SC-400-cjk2.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; unicode-range: U+6300-77FF; }
@font-face { font-family: "HarmonyOS Sans SC"; src: url("../src/fonts/woff2/HarmonyOS-Sans-SC-400-cjk3.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; unicode-range: U+7800-8CFF; }
@font-face { font-family: "HarmonyOS Sans SC"; src: url("../src/fonts/woff2/HarmonyOS-Sans-SC-400-cjk4.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; unicode-range: U+8D00-9FFF; }
@font-face { font-family: "HarmonyOS Sans SC"; src: url("../src/fonts/woff2/HarmonyOS-Sans-SC-400-compat.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; unicode-range: U+F900-FAFF; }
@font-face { font-family: "HarmonyOS Sans SC"; src: url("../src/fonts/woff2/HarmonyOS-Sans-SC-700-latin.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0000-024F, U+2000-206F; }
@font-face { font-family: "HarmonyOS Sans SC"; src: url("../src/fonts/woff2/HarmonyOS-Sans-SC-700-symbols.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+2E80-33FF; }
@font-face { font-family: "HarmonyOS Sans SC"; src: url("../src/fonts/woff2/HarmonyOS-Sans-SC-700-exta.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+3400-4DBF; }
@font-face { font-family: "HarmonyOS Sans SC"; src: url("../src/fonts/woff2/HarmonyOS-Sans-SC-700-cjk1.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+4E00-62FF; }
@font-face { font-family: "HarmonyOS Sans SC"; src: url("../src/fonts/woff2/HarmonyOS-Sans-SC-700-cjk2.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+6300-77FF; }
@font-face { font-family: "HarmonyOS Sans SC"; src: url("../src/fonts/woff2/HarmonyOS-Sans-SC-700-cjk3.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+7800-8CFF; }
@font-face { font-family: "HarmonyOS Sans SC"; src: url("../src/fonts/woff2/HarmonyOS-Sans-SC-700-cjk4.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+8D00-9FFF; }
@font-face { font-family: "HarmonyOS Sans SC"; src: url("../src/fonts/woff2/HarmonyOS-Sans-SC-700-compat.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+F900-FAFF; }

/* ========================================
 * 1. DESIGN TOKENS (CSS Variables)
 * ======================================== */
:root {
  /* --- Color Palette: Light Theme (Default) --- */
  --color-primary:        #3b82f6;
  --color-primary-light:  color-mix(in srgb, var(--color-primary) 80%, #fff);
  --color-primary-dark:   color-mix(in srgb, var(--color-primary) 82%, #000);
  --color-text-primary:   #1e293b;
  --color-text-secondary: #475569;
  --color-text-muted:     #94a3b8;

  --color-bg:             #f8fafc;
  --color-bg-secondary:   #ffffff;
  --color-bg-tertiary:    #f1f5f9;
  --color-bg-hover:       #e2e8f0;

  --color-border:         #e2e8f0;
  --color-border-light:   #f1f5f9;
  --color-card-bg:        color-mix(in srgb, var(--color-bg-secondary) 90%, transparent);
  --color-image-fallback: #1e293b;

  --color-success:        #22c55e;
  --color-danger:         #ef4444;

  --color-code-header-text: #000000;

  /* --- Typography --- */
  --font-sans:  "Inter", "Helvetica Neue", Helvetica, Arial,
                "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono:  "JetBrains Mono", "Fira Code", Menlo, Monaco, Consolas,
                "Lucida Console", "Courier New", monospace;

  /* Type Scale (1.25 modular scale) */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */

  --leading-tight:   1.25;
  --leading-normal:  1.6;
  --leading-relaxed: 1.75;

  --font-normal:   400;
  --font-medium:   500;
  --font-semibold: 600;
  --font-bold:     700;

  /* --- Spacing (4px base) --- */
  --space-1:  0.25rem;  /* 4px  */
  --space-2:  0.5rem;   /* 8px  */
  --space-3:  0.75rem;  /* 12px */
  --space-4:  1rem;     /* 16px */
  --space-5:  1.25rem;  /* 20px */
  --space-6:  1.5rem;   /* 24px */
  --space-8:  2rem;     /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */

  /* --- Border Radius --- */
  --radius-sm:   0.25rem;  /* 4px  */
  --radius-md:   0.5rem;   /* 8px  */
  --radius-lg:   0.75rem;  /* 12px */
  --radius-xl:   1rem;     /* 16px */
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-sm:  0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:  0 4px 6px -1px rgba(0, 0, 0, 0.07),
                0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg:  0 10px 15px -3px rgba(0, 0, 0, 0.08),
                0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl:  0 20px 25px -5px rgba(0, 0, 0, 0.10),
                0 8px 10px -6px rgba(0, 0, 0, 0.05);

  /* --- Transitions --- */
  --transition-fast: 150ms;
  --transition-base: 250ms;
  --transition-slow: 350ms;
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:    cubic-bezier(0, 0, 0.2, 1);

  /* --- Layout --- */
  --header-height:     60px;
}

html[data-font="harmony"] {
  --font-sans: "HarmonyOS Sans SC", "Inter", "Helvetica Neue", Helvetica, Arial,
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

[data-theme="dark"] {
  --color-primary:        #60a5fa;
  --color-primary-light:  color-mix(in srgb, var(--color-primary) 80%, #fff);
  --color-primary-dark:   color-mix(in srgb, var(--color-primary) 82%, #000);
  --color-text-primary:   #f1f5f9;
  --color-text-secondary: #cbd5e1;
  --color-text-muted:     #64748b;

  --color-bg:             #0f172a;
  --color-bg-secondary:   #1e293b;
  --color-bg-tertiary:    #334155;
  --color-bg-hover:       #475569;

  --color-border:         #334155;
  --color-border-light:   #1e293b;

  --color-card-bg:        color-mix(in srgb, var(--color-bg-secondary) 90%, transparent);

  --shadow-sm:  0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md:  0 4px 6px -1px rgba(0, 0, 0, 0.4),
                0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg:  0 10px 15px -3px rgba(0, 0, 0, 0.5),
                0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-xl:  0 20px 25px -5px rgba(0, 0, 0, 0.6),
                0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --color-code-header-text: #ffffff;
}

/* ========================================
 * 2b. HIGH CONTRAST MODE
 * ======================================== */

/* High contrast — Light (default & manual) */
[data-contrast="high"] {
  --color-text-primary:   #000000;
  --color-text-secondary: #1e293b;
  --color-text-muted:     #475569;
}

/* High contrast — Dark (manual) */
[data-contrast="high"][data-theme="dark"] {
  --color-text-primary:   #ffffff;
  --color-text-secondary: #f1f5f9;
  --color-text-muted:     #cbd5e1;
}

/* ========================================
 * 3. BASE & RESET
 * ======================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  transition: background-color var(--transition-base) var(--ease-in-out),
              color var(--transition-base) var(--ease-in-out);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-top: 0;
  margin-bottom: var(--space-4);
}

/* --- Links --- */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast) var(--ease-in-out);
}

a:hover {
  color: var(--color-primary-dark);
}

/* --- Images --- */
img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* --- Code --- */
code {
  padding: 2px 6px;
  background: color-mix(in srgb, var(--color-bg-secondary) 92%, var(--color-primary) 8%);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 1em;
  color: var(--color-primary);
}

pre {
  overflow: auto;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  line-height: var(--leading-normal);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--color-primary) 30%, transparent) transparent;
}

pre::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
pre::-webkit-scrollbar-track {
  background: transparent;
}
pre::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--color-primary) 30%, transparent);
  border-radius: var(--radius-full);
}
pre::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--color-primary) 50%, transparent);
}
pre::-webkit-scrollbar-corner {
  background: transparent;
}

pre code {
  display: block;
  padding: var(--space-4);
  background: transparent;
  border: none;
  color: var(--color-text-primary);
}

/* --- Blockquote --- */
blockquote {
  position: relative;
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-4) var(--space-4) calc(var(--space-4) + 16px);
  background: color-mix(in srgb, var(--color-bg) 92%, var(--color-primary) 8%);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  overflow: hidden;
}

blockquote::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--color-primary);
}

/* --- Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: var(--text-sm);
}

table th,
table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

table th:not(:first-child)::before,
table td:not(:first-child)::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 40%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--color-border) 30%,
    var(--color-border) 70%,
    transparent 100%
  );
}

table th {
  background: color-mix(in srgb, var(--color-bg) 92%, var(--color-primary) 8%);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
}

/* Markdown table alignment */
table th[align="left"],
table td[align="left"] {
  text-align: left;
}

table th[align="center"],
table td[align="center"] {
  text-align: center;
}

table th[align="right"],
table td[align="right"] {
  text-align: right;
}

table tr:last-child td {
  border-bottom: none;
}

/* --- Horizontal Rule --- */
hr {
  margin: var(--space-8) auto;
  width: 80px;
  height: 3px;
  border: none;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  opacity: 0.5;
}

/* --- Forms --- */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
textarea {
  padding: var(--space-3) var(--space-4);
  width: 100%;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  transition: border-color var(--transition-fast) var(--ease-in-out),
              box-shadow var(--transition-fast) var(--ease-in-out),
              background var(--transition-fast) var(--ease-in-out);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-bg) 85%, var(--color-primary) 15%);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* --- Buttons --- */
button,
input[type="submit"],
button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-5);
  background: var(--color-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  line-height: 1.5;
  cursor: pointer;
  transition: background var(--transition-fast) var(--ease-in-out),
              box-shadow var(--transition-fast) var(--ease-in-out),
              transform var(--transition-fast) var(--ease-in-out);
}

button:hover,
input[type="submit"]:hover,
button[type="submit"]:hover {
  background: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
}

button:active,
input[type="submit"]:active,
button[type="submit"]:active {
  transform: scale(0.97);
}

/* --- Selection --- */
::selection {
  background: var(--color-primary);
  color: #ffffff;
}

/* --- Focus visible --- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ========================================
 * 4. HEADER (page skeleton container)
 * ======================================== */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0;
  /* Themed glass morphism (default) */
  background: var(--color-card-bg);
  /* border-bottom: 1px solid var(--color-border); */
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.5s ease,
              border-color 0.5s ease,
              box-shadow 0.5s ease;
}

#header .container {
  padding-top: var(--space-4);
  padding-bottom: 0;
}

/* --- Over banner: transparent glass + white text --- */
#header.over-banner {
  background: transparent;
  border-bottom: none;
  box-shadow: none;
}

/* --- Homepage & Single Post header specifics --- */
body.home #header .container,
body.single #header .container {
  padding-top: var(--space-3);
}

/* ========================================
 * 5. MAIN CONTENT SKELETON
 * ======================================== */
#body {
  padding-top: calc(var(--header-height) + var(--space-6));
  padding-bottom: var(--space-12);
}

/* --- Archive Title --- */
.archive-title {
  margin: 0 0 var(--space-6);
  padding: var(--space-4) var(--space-5);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  background: var(--color-card-bg);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-primary);
}

/* ========================================
 * 6. UTILITY CLASSES
 * ======================================== */
.aligncenter,
div.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.alignleft {
  float: left;
  margin-right: var(--space-4);
}

.alignright {
  float: right;
  margin-left: var(--space-4);
}

img.alignleft {
  margin: 0 var(--space-4) var(--space-2) 0;
}

img.alignright {
  margin: 0 0 var(--space-2) var(--space-4);
}

/* Screen reader only (from original) */
.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;
}

.sr-only.focusable:active,
.sr-only.focusable:focus {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

.hidden {
  display: none !important;
  visibility: hidden;
}

.invisible {
  visibility: hidden;
}

/* --- More link --- */
.more {
  text-align: center;
}

.more a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-weight: var(--font-medium);
  transition: all var(--transition-fast) var(--ease-in-out);
}

.more a:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-bg-secondary) 92%, var(--color-primary) 8%);
}

/* ========================================
 * 7. RESPONSIVE DESIGN (global only)
 * 组件 / 页面级响应式随各自 CSS。
 * ======================================== */
@media (max-width: 767px) {
  :root {
    --text-base: 0.9375rem;  /* 15px on mobile */
  }

  body {
    font-size: var(--text-base);
  }
}

@media (min-width: 768px) {
  #header .container {
    padding-top: var(--space-6);
  }
}

@media (min-width: 992px) {
  #body {
    padding-top: var(--space-10);
    padding-bottom: var(--space-16);
  }
}

/* ========================================
 * 8. REDUCED MOTION (A11y)
 * ======================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========================================
 * 9. AMBIANCE COLOR EFFECT
 *     html[data-ambiance="true"] 时生效
 *
 * 仅背景光效 — 多点光源叠加，营造空间沉浸感。
 * 不影响卡片、导航、底部等任何组件样式。
 * 随用户选择的 --color-primary 与亮/暗模式自动适配。
 */

/* --- 亮色模式：均匀底色染色 --- */
html[data-ambiance="true"] body {
  background-color: color-mix(in srgb, var(--color-bg) 95%, var(--color-primary) 5%);
}

/* --- 暗色模式：略微加深 --- */
html[data-ambiance="true"][data-theme="dark"] body {
  background-color: color-mix(in srgb, var(--color-bg) 93%, var(--color-primary) 7%);
}

/* ========================================
 * 10. PRINT STYLES
 * ======================================== */
@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.6;
  }

  #header,
  #sidebar-left,
  #sidebar-right,
  #footer,
  #comments,
  .page-navigator,
  .post-near,
  .theme-toggle,
  .skip-to-content {
    display: none !important;
  }

  .post {
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
  }

  a {
    text-decoration: underline;
  }

  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 80%;
    color: #666 !important;
  }

  a[href^="#"]:after,
  a[href^="javascript:"]:after {
    content: "";
  }

  .container {
    max-width: 100%;
  }

  #main {
    width: 100% !important;
  }
}

/* source: components/navbar.css */
/* ========================================
 * Navbar — Navigation Menu
 * Full-width bar inside #header
 * ======================================== */

/* ---- Main Nav Container ---- */
#nav-menu {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 52px;
  width: 100%;
}

/* ---- Brand / Logo (left 8%) ---- */
.navbar-brand {
  position: absolute;
  left: 8%;
  display: flex;
  align-items: center;
  text-decoration: none;
  z-index: 2;
}

.navbar-brand img {
  height: 36px;
  width: auto;
  display: block;
}

/* ---- Centered Nav Links — Pill Glass Capsule ---- */
.navbar-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
  padding: 5px;
  /* Pill-shaped glassmorphism backplate */
  background: color-mix(in srgb, var(--color-bg-secondary) 60%, transparent);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid color-mix(in srgb, var(--color-border) 65%, transparent);
  border-radius: var(--radius-full);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06),
              0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  transition: background 0.5s ease,
              border-color 0.5s ease,
              box-shadow 0.5s ease;
}

.navbar-links > a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: var(--space-1) var(--space-5);
  border: none;
  border-radius: var(--radius-full);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  line-height: var(--leading-normal);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.5s ease,
              background 0.25s ease,
              box-shadow 0.25s ease;
}

/* Icon inside nav links */
.navbar-links > a .nav-icon {
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity 0.25s ease,
              transform 0.25s ease;
}

.navbar-links > a:hover .nav-icon {
  opacity: 1;
  transform: translateY(-1px);
}

.navbar-links > a:hover {
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-bg-secondary) 85%, var(--color-primary) 15%);
}

/* Current / active page — solid highlight inside the pill */
.navbar-links > a.current,
.navbar-links .current {
  color: #ffffff;
  background: var(--color-primary);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--color-primary) 50%, transparent);
  font-weight: var(--font-semibold);
}

.navbar-links > a.current .nav-icon,
.navbar-links .current .nav-icon {
  opacity: 1;
}

.navbar-links > a.current:hover,
.navbar-links .current:hover {
  color: #ffffff;
  background: var(--color-primary-dark);
  box-shadow: 0 2px 12px color-mix(in srgb, var(--color-primary) 60%, transparent);
}

/* ---- Right Actions (right 8%) ---- */
.navbar-actions {
  position: absolute;
  right: 8%;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  z-index: 2;
}

/* ================================
 * Category Dropdown — 内嵌在 navbar-links 中
 * ================================ */

.nav-cat-inline {
  position: relative;
  display: inline-flex;
}

.nav-cat-inline-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: var(--space-1) var(--space-5);
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  font-family: inherit;
  line-height: var(--leading-normal);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.5s ease,
              background 0.25s ease,
              box-shadow 0.25s ease;
}

.nav-cat-inline-btn:hover {
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-bg-secondary) 85%, var(--color-primary) 15%);
}

.nav-cat-inline-btn:focus-visible,
.nav-cat-link:focus-visible,
.nav-cat-sublink:focus-visible,
.nav-cat-subtoggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.nav-cat-inline-btn .nav-icon {
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity 0.25s ease,
              transform 0.25s ease;
}

.nav-cat-inline-btn:hover .nav-icon {
  opacity: 1;
  transform: translateY(-1px);
}

/* Dropdown panel */
.nav-cat-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px) scale(0.98);
  transform-origin: top center;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: max-content;
  min-width: 280px;
  max-width: min(340px, calc(100vw - var(--space-6)));
  max-height: min(68vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: var(--space-2);
  background: color-mix(in srgb, var(--color-bg-secondary) 94%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-border) 78%, var(--color-primary) 22%);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl),
              0 0 0 1px color-mix(in srgb, #ffffff 45%, transparent) inset;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-fast) var(--ease-in-out),
              visibility var(--transition-fast) var(--ease-in-out),
              transform var(--transition-fast) var(--ease-in-out);
  z-index: 20;
}

/* 保留滚轮和触摸滚动，同时隐藏会挤占卡片宽度的原生滚动条 */
.nav-cat-dropdown::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.nav-cat-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.nav-cat-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  margin-bottom: var(--space-1);
  background: linear-gradient(135deg,
              color-mix(in srgb, var(--color-primary) 12%, var(--color-bg-secondary)),
              color-mix(in srgb, var(--color-primary) 4%, var(--color-bg-secondary)));
  border: 1px solid color-mix(in srgb, var(--color-primary) 16%, transparent);
  border-radius: var(--radius-lg);
  color: var(--color-text-primary);
}

.nav-cat-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 5px 12px color-mix(in srgb, var(--color-primary) 28%, transparent);
}

.nav-cat-header-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
  line-height: var(--leading-normal);
}

.nav-cat-header-copy strong {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
}

.nav-cat-header-copy small {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--font-normal);
}

.nav-cat-trigger-chevron {
  margin-left: 1px;
  color: currentColor;
  opacity: 0.55;
  transition: transform var(--transition-base) var(--ease-in-out),
              opacity var(--transition-fast) var(--ease-in-out);
}

.nav-cat-inline-btn.is-open .nav-cat-trigger-chevron {
  opacity: 0.9;
  transform: rotate(180deg);
}

.nav-cat-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  padding: 7px 8px;
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: background var(--transition-fast) var(--ease-in-out),
              color var(--transition-fast) var(--ease-in-out),
              transform var(--transition-fast) var(--ease-in-out);
}

.nav-cat-link:hover {
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  color: var(--color-primary);
}

.nav-cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-primary) 11%, transparent);
  color: var(--color-primary);
  transition: background var(--transition-fast) var(--ease-in-out),
              transform var(--transition-fast) var(--ease-in-out);
}

.nav-cat-link:hover .nav-cat-icon,
.nav-cat-item.is-expanded .nav-cat-icon {
  background: color-mix(in srgb, var(--color-primary) 18%, transparent);
  transform: translateY(-1px);
}

.nav-cat-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Category row: link + toggle */
.nav-cat-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  transition: background var(--transition-base) var(--ease-in-out),
              border-color var(--transition-base) var(--ease-in-out),
              box-shadow var(--transition-base) var(--ease-in-out);
}

.nav-cat-item.is-expanded {
  background: color-mix(in srgb, var(--color-primary) 5%, transparent);
  border-color: color-mix(in srgb, var(--color-primary) 18%, transparent);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--color-primary) 7%, transparent);
}

.nav-cat-item.is-expanded > .nav-cat-link {
  color: var(--color-primary);
}

/* Expand/collapse toggle for subcategories */
.nav-cat-subtoggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--color-border) 75%, transparent);
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-bg-tertiary) 72%, transparent);
  color: var(--color-text-muted);
  box-shadow: none;
  cursor: pointer;
  transition: background var(--transition-fast) var(--ease-in-out),
              color var(--transition-fast) var(--ease-in-out),
              transform var(--transition-fast) var(--ease-in-out);
}

.nav-cat-subtoggle:hover {
  border-color: color-mix(in srgb, var(--color-primary) 35%, transparent);
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  color: var(--color-primary);
  box-shadow: none;
}

.nav-cat-subtoggle.is-open {
  border-color: color-mix(in srgb, var(--color-primary) 38%, transparent);
  background: var(--color-primary);
  color: #ffffff;
  transform: rotate(180deg);
}

/* Subcategory container */
.nav-cat-sub {
  display: grid;
  grid-column: 1 / -1;
  grid-template-rows: 0fr;
  width: 100%;
  opacity: 0;
  transition: grid-template-rows var(--transition-base) var(--ease-in-out),
              opacity var(--transition-fast) var(--ease-in-out);
}

.nav-cat-sub.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.nav-cat-sublist {
  position: relative;
  min-height: 0;
  margin: 0 8px 0 23px;
  padding: 0 0 0 19px;
  overflow: hidden;
  visibility: hidden;
  transition: padding-bottom var(--transition-base) var(--ease-in-out),
              visibility 0s linear var(--transition-base);
}

.nav-cat-sub.is-open .nav-cat-sublist {
  padding-bottom: 8px;
  visibility: visible;
  transition-delay: 0s;
}

.nav-cat-sublist::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 15px;
  left: 5px;
  width: 1px;
  background: linear-gradient(to bottom,
              color-mix(in srgb, var(--color-primary) 48%, transparent),
              color-mix(in srgb, var(--color-primary) 12%, transparent));
}

/* Subcategory link */
.nav-cat-sublink {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  padding: 5px 7px;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  text-decoration: none;
  transition: background var(--transition-fast) var(--ease-in-out),
              color var(--transition-fast) var(--ease-in-out),
              transform var(--transition-fast) var(--ease-in-out);
}

.nav-cat-sublink:hover {
  background: color-mix(in srgb, var(--color-primary) 9%, transparent);
  color: var(--color-primary);
  transform: translateX(2px);
}

.nav-cat-branch {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border: 2px solid color-mix(in srgb, var(--color-primary) 48%, var(--color-bg-secondary));
  border-radius: var(--radius-full);
  background: var(--color-bg-secondary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 6%, transparent);
  transition: border-color var(--transition-fast) var(--ease-in-out),
              background var(--transition-fast) var(--ease-in-out),
              transform var(--transition-fast) var(--ease-in-out);
}

.nav-cat-sublink:hover .nav-cat-branch {
  border-color: var(--color-primary);
  background: var(--color-primary);
  transform: scale(1.08);
}

.nav-cat-sublink .nav-cat-count {
  font-size: 0.6875rem;
  background: transparent;
}

.nav-cat-count {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-bg-tertiary) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-border) 72%, transparent);
  min-width: 20px;
  text-align: center;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.nav-cat-empty {
  padding: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
}

/* Over banner — light text for button */
#header.over-banner .nav-cat-inline-btn {
  color: #ffffff;
}

#header.over-banner .nav-cat-inline-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

#header.over-banner .nav-cat-inline-btn .nav-icon {
  opacity: 1;
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
  .nav-cat-inline-btn {
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    gap: 5px;
  }

  .nav-cat-dropdown {
    left: 0;
    transform: translateX(0) translateY(-8px) scale(0.98);
    transform-origin: top left;
  }

  .nav-cat-dropdown.is-open {
    transform: translateX(0) translateY(0) scale(1);
  }
}

@media (max-width: 767px) {
  .nav-cat-inline-btn {
    font-size: 10px;
    padding: var(--space-1) var(--space-2);
    gap: 4px;
  }

  .nav-cat-dropdown {
    width: 100%;
    min-width: 0;
  }
}
.nav-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast) var(--ease-in-out),
              color var(--transition-fast) var(--ease-in-out);
}

.nav-action-btn:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-primary);
  box-shadow: none;
  transform: none;
}

.nav-action-btn svg {
  display: block;
}

/* ================================
 * Search — 弹窗搜索（按钮仅保留布局）
 * ================================ */

.nav-search {
  position: relative;
  display: flex;
  align-items: center;
}

/* ================================
 * Dark / Light Toggle
 * ================================
 *
 * data-theme 始终由 JS 在页面加载时设置，
 * 图标显示"点击后将切换到的模式"：
 *   亮色 → 显示月亮（点击变暗）
 *   暗色 → 显示太阳（点击变亮）
 */

/* Default (light mode): show moon (click → dark) */
.nav-theme-btn .icon-moon { display: inline-flex; }
.nav-theme-btn .icon-sun { display: none; }

/* Dark mode: show sun (click → light) */
[data-theme="dark"] .nav-theme-btn .icon-moon { display: none; }
[data-theme="dark"] .nav-theme-btn .icon-sun { display: inline-flex; }

/* ================================
 * Theme Color Switcher
 * ================================ */

.nav-color-switcher {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-color-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  min-width: 150px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--transition-fast) var(--ease-in-out),
              visibility var(--transition-fast) var(--ease-in-out),
              transform var(--transition-fast) var(--ease-in-out);
  z-index: 20;
}

.nav-color-switcher:hover .nav-color-dropdown,
.nav-color-switcher:focus-within .nav-color-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.color-preset {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color var(--transition-fast) var(--ease-in-out),
              transform var(--transition-fast) var(--ease-in-out);
  flex-shrink: 0;
}

.color-preset:hover {
  border-color: var(--color-text-muted);
  transform: scale(1.25);
}

.color-preset.active {
  border-color: var(--color-text-primary);
  box-shadow: 0 0 0 1px var(--color-bg-secondary);
}

/* --- Dropdown Extras (toggles) --- */
.nav-color-dropdown {
  flex-direction: column;
  gap: 0;
  padding: 0;
  min-width: 150px;
}

.dropdown-colors {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  padding: var(--space-2) var(--space-3);
}

.dropdown-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0 var(--space-3);
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  gap: var(--space-3);
  cursor: pointer;
  transition: background var(--transition-fast) var(--ease-in-out);
  user-select: none;
}

.dropdown-toggle:hover {
  background: var(--color-bg-hover);
}

.dropdown-toggle:last-child {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.dropdown-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

/* ---- Toggle Switch ---- */
.switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  transition: background var(--transition-fast) var(--ease-in-out),
              border-color var(--transition-fast) var(--ease-in-out);
}

.switch-slider::before {
  content: "";
  position: absolute;
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background: var(--color-text-muted);
  border-radius: 50%;
  transition: transform var(--transition-fast) var(--ease-in-out),
              background var(--transition-fast) var(--ease-in-out);
}

.switch input:checked + .switch-slider {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(14px);
  background: #ffffff;
}

.switch input:focus-visible + .switch-slider {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.switch input:disabled + .switch-slider {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ---- Font Size Slider ---- */
.dropdown-font-size {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  gap: var(--space-2);
}

.dropdown-font-size:last-child {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.font-size-slider-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Range input base styling */
#font-size-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 70px;
  height: 4px;
  border-radius: 2px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  outline: none;
  cursor: pointer;
  transition: background var(--transition-fast) var(--ease-in-out);
}

/* Thumb — WebKit */
#font-size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--color-primary);
  cursor: pointer;
  transition: transform var(--transition-fast) var(--ease-in-out);
}

#font-size-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

/* Thumb — Firefox */
#font-size-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--color-primary);
  cursor: pointer;
}

/* Track — Firefox */
#font-size-slider::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
}

.font-size-value {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  min-width: 30px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ================================
 * Over Banner (hero transparent)
 * ================================ */

/* ---- Pill turns translucent white ---- */
#header.over-banner .navbar-links {
  background: color-mix(in srgb, rgba(255, 255, 255, 0.08) 90%, #000000 10%);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12),
              0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

#header.over-banner .navbar-links > a {
  color: #ffffff;
}

/* Icons fully opaque white over banner */
#header.over-banner .navbar-links > a .nav-icon {
  opacity: 1;
}

#header.over-banner .navbar-links > a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

#header.over-banner .navbar-links > a.current,
#header.over-banner .navbar-links .current {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#header.over-banner .navbar-links > a.current:hover,
#header.over-banner .navbar-links .current:hover {
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* Logo 始终保持原色，不随 banner 反色 */
#header.over-banner .navbar-brand img {
  filter: none;
}

#header.over-banner .nav-action-btn {
  color: #ffffff;
}

#header.over-banner .nav-action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}


/* ================================
 * Responsive — Tablet
 * ================================ */

@media (max-width: 991px) {
  #nav-menu {
    flex-wrap: wrap;
    justify-content: space-between;
    padding: var(--space-2) var(--space-4);
    min-height: auto;
  }

  .navbar-brand {
    position: relative;
    left: auto;
  }

  .navbar-links {
    order: 3;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 4px;
    margin-top: var(--space-2);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
  }

  .navbar-links > a {
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    gap: 5px;
    border-radius: var(--radius-full);
  }

  .navbar-links > a .nav-icon {
    width: 14px;
    height: 14px;
  }

  .navbar-links > a.current {
    box-shadow: 0 1px 4px color-mix(in srgb, var(--color-primary) 40%, transparent);
    background: var(--color-primary);
    color: #ffffff;
  }

  .navbar-actions {
    position: relative;
    right: auto;
    gap: var(--space-1);
  }


  .nav-color-dropdown {
    right: auto;
    left: 0;
  }

  .color-preset {
    width: 20px;
    height: 20px;
  }
}

/* ================================
 * Responsive — Mobile
 * ================================ */

@media (max-width: 767px) {
  #nav-menu {
    padding: var(--space-2) var(--space-3);
    gap: var(--space-2);
  }

  .navbar-brand img {
    height: 30px;
  }

  .navbar-links {
    padding: 3px;
    gap: 1px;
    backdrop-filter: blur(14px) saturate(130%);
    -webkit-backdrop-filter: blur(14px) saturate(130%);
  }

  .navbar-links > a {
    font-size: 10px;
    padding: var(--space-1) var(--space-2);
    gap: 4px;
  }

  .navbar-links > a .nav-icon {
    width: 13px;
    height: 13px;
  }

  .nav-action-btn {
    width: 32px;
    height: 32px;
  }


  .nav-color-dropdown {
    left: auto;
    right: -8px;
  }

  .color-preset {
    width: 18px;
    height: 18px;
  }
}

/* Default (light mode): show sun? */
.theme-toggle .icon-sun { display: inline; }
.theme-toggle .icon-moon { display: none; }

/* Dark mode: show moon? */
[data-theme="dark"] .theme-toggle .icon-moon { display: inline; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

/* ========================================
 * Hamburger Button (visible < 1200px)
 * ======================================== */
.nav-hamburger {
  display: none;
}

/* ========================================
 * Mobile Dropdown — < 1200px
 * ======================================== */
@media (max-width: 1199px) {
  /* Hide centered nav pills by default */
  .navbar-links {
    display: flex;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    width: 90%;
    max-width: 400px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: var(--space-2);
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) translateY(-6px);
    transition: opacity var(--transition-fast) var(--ease-in-out),
                visibility var(--transition-fast) var(--ease-in-out),
                transform var(--transition-fast) var(--ease-in-out);
  }

  /* Show dropdown when nav-open */
  #nav-menu.nav-open .navbar-links {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }

  /* Override over-banner — 与调色盘弹出菜单保持一致 */
  #header.over-banner .navbar-links {
    background: var(--color-card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
  }

  #header.over-banner .navbar-links > a,
  #header.over-banner .navbar-links > a:hover,
  #header.over-banner .navbar-links > a.current,
  #header.over-banner .navbar-links > a.current:hover,
  #header.over-banner .nav-cat-inline-btn,
  #header.over-banner .nav-cat-inline-btn:hover {
    color: var(--color-text-primary);
    background: transparent;
    box-shadow: none;
  }

  #header.over-banner .navbar-links > a:hover,
  #header.over-banner .nav-cat-inline-btn:hover {
    background: var(--color-bg-hover);
  }

  #header.over-banner .navbar-links > a.current,
  #header.over-banner .navbar-links .current {
    color: #ffffff;
    background: var(--color-primary);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--color-primary) 50%, transparent);
  }

  .navbar-links > a,
  .nav-cat-inline-btn {
    justify-content: center;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    width: 100%;
  }

  /* Category sub-dropdown above mobile menu panel */
  .nav-cat-dropdown {
    z-index: 110;
  }

  /* Show hamburger */
  .nav-hamburger {
    display: inline-flex;
  }

  /* Tweak navbar-actions so hamburger sits inline with other buttons */
  .navbar-actions {
    gap: 2px;
  }
}

@media (max-width: 767px) {
  .navbar-links {
    top: calc(100% + 6px);
  }

  .navbar-links > a,
  .nav-cat-inline-btn {
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-3);
  }
}

/* source: components/search-modal.css */
/* ========================================
 * Search Modal — 屏幕中央弹窗搜索
 * 配对组件: components/search-modal.php
 * ======================================== */

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.search-modal.is-active {
  opacity: 1;
  pointer-events: auto;
}

.search-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: backdrop-filter 0.25s ease;
}

.search-modal.is-active .search-modal-overlay {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.search-modal-box {
  position: relative;
  width: 90%;
  max-width: 520px;
  padding: var(--space-8);
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: search-modal-in 0.2s ease;
}

@keyframes search-modal-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.search-modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  cursor: pointer;
  transition: background var(--transition-fast) var(--ease-in-out),
              color var(--transition-fast) var(--ease-in-out);
}

.search-modal-close:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

.search-modal-box form {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.search-modal-box input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-tertiary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: var(--text-lg);
  line-height: 1.5;
  outline: none;
  transition: border-color var(--transition-fast) var(--ease-in-out),
              box-shadow var(--transition-fast) var(--ease-in-out);
}

.search-modal-box input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-modal-box input::placeholder {
  color: var(--color-text-muted);
}

.search-modal-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-5);
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-lg);
  color: #fff;
  font-size: var(--text-lg);
  cursor: pointer;
  transition: opacity var(--transition-fast) var(--ease-in-out);
}

.search-modal-submit:hover {
  opacity: 0.85;
}

.search-modal-title {
  margin: 0 0 var(--space-1);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text-primary);
}

.search-modal-hint {
  margin: var(--space-2) 0 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
}

/* 移动端适配 */
@media (max-width: 480px) {
  .search-modal-box {
    width: 92%;
    padding: var(--space-6) var(--space-4);
  }

  .search-modal-box form {
    flex-direction: column;
  }

  .search-modal-submit {
    width: 100%;
  }
}

/* source: components/banner-home.css */
/* ========================================
 * Banner — Homepage Hero
 * ======================================== */

#hero-banner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  min-height: 480px;
  padding: var(--space-8);
  background: var(--color-image-fallback) var(--home-banner-image, none) center / cover no-repeat;
  text-align: center;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  padding: var(--space-8) var(--space-10);
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.10),
    0 20px 48px rgba(0, 0, 0, 0.14);
  transform: translateY(0);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.hero-content:hover {
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.08),
    0 12px 32px rgba(0, 0, 0, 0.12),
    0 28px 56px rgba(0, 0, 0, 0.18);
  transform: translateY(-2px);
}

.hero-title {
  margin: 0 0 var(--space-5);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: var(--font-bold);
  letter-spacing: -0.03em;
  color: #ffffff;
  line-height: var(--leading-tight);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
               0 1px 3px rgba(0, 0, 0, 0.2);
  transition: color 0.5s ease;
}

.hero-description {
  margin: 0;
  transition: color 0.5s ease;
}

#poem_sentence {
  margin: 0 0 var(--space-1);
  font-size: var(--text-2xl);
  color: #ffffff;
  line-height: 1.4;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

#poem_info {
  margin: 0;
  font-size: var(--text-lg);
  color: #ffffff;
  text-align: right;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Banner scroll-down indicator — 圆形毛玻璃容器 */
.hero-scroll-indicator {
  position: absolute;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.scroll-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.15),
    0 1px 4px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition:
    background 0.3s ease,
    box-shadow 0.3s ease;
}

.hero-scroll-indicator:hover .scroll-btn {
  background: rgba(255, 255, 255, 0.16);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.22),
    0 2px 6px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Homepage body padding eliminated (banner fills top) */
body.home #body {
  padding-top: 0;
}

/* Spacing between banner bottom and content area */
body.home #main {
  padding-top: var(--space-12);
}
body.home #sidebar-left,
body.home #sidebar-right {
  padding-top: var(--space-12);
}

/* Responsive */
@media (max-width: 767px) {
  #hero-banner {
    min-height: 420px;
    padding: var(--space-6);
  }

  .hero-content {
    padding: var(--space-5) var(--space-6);
  }

  .hero-title {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
  }

  #poem_sentence {
    font-size: var(--text-base);
  }

}

/* source: components/wave.css */
/* ========================================
 * Wave — SVG 波浪装饰
 * 配对组件: components/banner-home.php、components/banner.php
 * ========================================
 *
 * 位于 Banner 底部，衔接内容区。
 * fill 使用 --color-bg 变量，自动适配
 * 亮/暗模式及氛围色背景。
 * 4 层波浪叠加 + 动画营造平滑过渡。
 */

.main-hero-waves-area {
  width: 100%;
  position: absolute;
  left: 0;
  bottom: -1px;
  z-index: 5;
  pointer-events: none;
  line-height: 0;
}

.waves-area .waves-svg {
  width: 100%;
  height: 5rem;
  display: block;
}

/* ---- 4 层波浪：从透明渐变到背景色 ---- */
.parallax > use {
  animation: move-forever 25s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite;
}

.parallax > use:nth-child(1) {
  animation-delay: -2s;
  animation-duration: 7s;
  fill: color-mix(in srgb, var(--color-bg) 15%, transparent);
}

.parallax > use:nth-child(2) {
  animation-delay: -3s;
  animation-duration: 10s;
  fill: color-mix(in srgb, var(--color-bg) 40%, transparent);
}

.parallax > use:nth-child(3) {
  animation-delay: -4s;
  animation-duration: 13s;
  fill: color-mix(in srgb, var(--color-bg) 70%, transparent);
}

.parallax > use:nth-child(4) {
  animation-delay: -5s;
  animation-duration: 20s;
  fill: var(--color-bg);
}

/* ---- 氛围色模式：波浪底部融合染色背景 ---- */
html[data-ambiance="true"] .parallax > use:nth-child(1) {
  fill: color-mix(in srgb, var(--color-bg) 15%, transparent);
}

html[data-ambiance="true"] .parallax > use:nth-child(2) {
  fill: color-mix(in srgb, var(--color-bg) 40%, transparent);
}

html[data-ambiance="true"] .parallax > use:nth-child(3) {
  fill: color-mix(in srgb, var(--color-bg) 73%, var(--color-primary) 2%);
}

html[data-ambiance="true"] .parallax > use:nth-child(4) {
  fill: color-mix(in srgb, var(--color-bg) 95%, var(--color-primary) 5%);
}

html[data-ambiance="true"][data-theme="dark"] .parallax > use:nth-child(3) {
  fill: color-mix(in srgb, var(--color-bg) 73%, var(--color-primary) 4%);
}

html[data-ambiance="true"][data-theme="dark"] .parallax > use:nth-child(4) {
  fill: color-mix(in srgb, var(--color-bg) 93%, var(--color-primary) 7%);
}

/* ---- 图片来源标签 ---- */
.banner-source-pill {
  position: absolute;
  bottom: 5rem;
  right: 2rem;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  font-size: var(--text-xs);
  color: #ffffff;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  letter-spacing: 0.04em;
  user-select: none;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.banner-source-pill iconify-icon {
  font-size: 13px;
  flex-shrink: 0;
}

.banner-source-pill:hover {
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.22);
}

/* ---- 动画 ---- */
@keyframes move-forever {
  0%   { transform: translate3d(-90px, 0, 0); }
  100% { transform: translate3d(85px, 0, 0); }
}

/* ---- 移动端缩小 ---- */
@media (max-width: 768px) {
  .waves-area .waves-svg {
    height: 40px;
    min-height: 40px;
  }

  .banner-source-pill {
    bottom: 2rem;
    right: 1.25rem;
    padding: 3px 10px;
    font-size: 0.7rem;
  }
}

/* source: components/sidebar-left.css */
/* ========================================
 * Sidebar — Left
 * ======================================== */

#sidebar-left {
  padding-top: var(--space-4);
  word-wrap: break-word;
}

#sidebar-left .widget {
  margin-bottom: var(--space-5);
  padding: var(--space-5);
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: box-shadow var(--transition-base) var(--ease-in-out),
              border-color var(--transition-base) var(--ease-in-out),
              transform var(--transition-base) var(--ease-in-out);
}

#sidebar-left .widget:hover {
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--color-border) 85%, var(--color-primary) 15%);
}


/* ========================================
 * 1. Profile Card (博主信息卡片)
 * ======================================== */

.widget-profile {
  position: relative;
  overflow: hidden;
  padding: var(--space-5) 10px;
}

/* Top decorative accent */
.widget-profile::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--space-5);
  right: var(--space-5);
  height: 3px;
  background: var(--color-primary);
  border-radius: 0 0 var(--radius-full) var(--radius-full);
  opacity: 0.6;
}

.widget-profile .widget-title {
  display: none;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* --- Square Avatar (方形头像, 与下方统计等宽) --- */
.profile-avatar-wrap {
  width: 100%;
  padding: 0 var(--space-3);
  margin-bottom: var(--space-4);
  box-sizing: border-box;
}

.profile-avatar {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  border: 3px solid var(--color-border);
  object-fit: cover;
  cursor: pointer;
  transition: border-color var(--transition-fast) var(--ease-in-out),
              transform var(--transition-fast) var(--ease-in-out),
              box-shadow var(--transition-fast) var(--ease-in-out);
}

.profile-avatar:hover {
  border-color: var(--color-primary);
  transform: scale(1.04);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 15%, transparent);
}

/* --- Name (博主名称) --- */
.profile-name {
  margin: 0 0 var(--space-3);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.profile-ename {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-normal);
  color: var(--color-text-secondary);
  letter-spacing: 0.04em;
  margin-top: var(--space-1);
}

/* --- Hitokoto (每日一言) --- */
.profile-quote {
  width: 100%;
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  min-height: 2.8em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hitokoto-text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  font-style: italic;
  text-decoration: none;
  transition: color var(--transition-fast) var(--ease-in-out);
}

.hitokoto-text:hover {
  color: var(--color-primary);
  text-decoration: none;
}

/* --- Stats (统计信息) --- */
.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  width: 100%;
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-1) 0;
  position: relative;
}

/* Subtle vertical dividers between stat items */
.stat-item + .stat-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: var(--color-border);
}

.stat-num {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--color-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* --- Links (相关链接) --- */
.profile-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
}

.profile-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  text-decoration: none;
  transition: all var(--transition-fast) var(--ease-in-out);
}

.profile-link:hover {
  background: var(--color-primary);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--color-primary) 30%, transparent);
}

/* Login button — more prominent in the links row */
.profile-link-login {
  background: var(--color-primary);
  color: #ffffff;
  font-weight: var(--font-semibold);
}

.profile-link-login:hover {
  background: color-mix(in srgb, var(--color-primary) 80%, #000000);
  color: #ffffff;
  box-shadow: 0 2px 12px color-mix(in srgb, var(--color-primary) 45%, transparent);
}

/* Admin button subtle highlight */
.profile-link-admin {
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
}

.profile-link-admin:hover {
  color: #ffffff;
}

.profile-link svg {
  flex-shrink: 0;
}


/* ========================================
 * 2. Tag Cloud (标签云)
 * ======================================== */

.widget-tags .widget-title {
  margin-bottom: var(--space-3);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
}

.tag-cloud .tag-item {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border: none;
  border-radius: var(--radius-full);
  color: #ffffff;
  font-weight: var(--font-medium);
  font-size: var(--text-sm);
  line-height: 1.6;
  text-decoration: none;
  transition: filter var(--transition-fast) var(--ease-in-out),
              transform var(--transition-fast) var(--ease-in-out),
              box-shadow var(--transition-fast) var(--ease-in-out);
}

.tag-cloud .tag-item:hover {
  color: #ffffff;
  filter: brightness(1.1) saturate(1.2);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}

.tag-empty {
  margin: 0;
  padding: var(--space-3) 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  text-align: center;
}


/* ========================================
 * 3. Category List (分类列表)
 * ======================================== */

.widget-categories .widget-title {
  margin-bottom: var(--space-3);
}

.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

/* --- Each category row --- */
.category-item {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast) var(--ease-in-out),
              transform var(--transition-fast) var(--ease-in-out),
              box-shadow var(--transition-fast) var(--ease-in-out);
}

.category-item:hover {
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  transform: translateX(4px);
  box-shadow: 2px 2px 8px color-mix(in srgb, var(--color-primary) 15%, transparent);
}

/* --- Color accent dot (top-level only) --- */
.category-list > .category-item::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  margin-right: var(--space-2);
  transition: transform var(--transition-fast) var(--ease-in-out);
}

.category-list > .category-item:hover::before {
  transform: scale(1.4);
}

/* 6-color cycle for category dots */
.category-list > .category-item:nth-child(6n+1)::before { background: #3b82f6; }  /* blue */
.category-list > .category-item:nth-child(6n+2)::before { background: #f59e0b; }  /* amber */
.category-list > .category-item:nth-child(6n+3)::before { background: #10b981; }  /* emerald */
.category-list > .category-item:nth-child(6n+4)::before { background: #ef4444; }  /* red */
.category-list > .category-item:nth-child(6n+5)::before { background: #8b5cf6; }  /* violet */
.category-list > .category-item:nth-child(6n+6)::before { background: #ec4899; }  /* pink */

/* --- Toggle chevron --- */
.category-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: var(--space-1);
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: transform 0.25s ease,
              color var(--transition-fast) var(--ease-in-out),
              background var(--transition-fast) var(--ease-in-out);
  user-select: none;
}

.category-toggle:hover {
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
}

.category-toggle.open {
  transform: rotate(90deg);
  color: var(--color-primary);
}

/* --- Category link --- */
.category-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-secondary);
  text-decoration: none;
  flex: 1;
  min-width: 0;
  padding: var(--space-1) 0;
  transition: color var(--transition-fast) var(--ease-in-out);
}

/* Top-level links are bolder + larger */
.category-list > .category-item > .category-link {
  font-weight: var(--font-medium);
  font-size: var(--text-base);
}

.category-link:hover {
  color: var(--color-primary);
  text-decoration: none;
}

/* Align items without toggle (no children) — compensate for missing chevron */
.category-list > .category-item:not(.has-children) > .category-link {
  margin-left: calc(20px + var(--space-1));
}

/* --- Count pill badge --- */
.category-count {
  font-size: 12px;
  font-weight: var(--font-medium);
  color: var(--color-text-muted);
  background: var(--color-bg-hover);
  min-width: 22px;
  height: 15px;
  line-height: 15px;
  text-align: center;
  padding: 0 7px;
  border-radius: var(--radius-full);
  margin-left: auto;
  transition: background var(--transition-fast) var(--ease-in-out),
              color var(--transition-fast) var(--ease-in-out),
              transform var(--transition-fast) var(--ease-in-out);
}

.category-link:hover .category-count {
  background: color-mix(in srgb, var(--color-primary) 15%, transparent);
  color: var(--color-primary);
  transform: scale(1.08);
}

/* --- Subcategory children --- */
.category-children {
  max-height: 0;
  overflow: hidden;
  width: 100%;
  list-style: none;
  padding: 0;
  margin: 0;
  transition: max-height 0.35s ease;
}

.category-children.open {
  max-height: 400px;
}

.category-children .category-item {
  padding: var(--space-1) var(--space-3) var(--space-1) calc(20px + var(--space-4));
}

.category-children .category-link {
  font-size: var(--text-sm);
  font-weight: var(--font-normal);
  padding: 2px 0 2px var(--space-3);
  border-left: 2px solid var(--color-border);
  transition: border-color var(--transition-fast) var(--ease-in-out),
              color var(--transition-fast) var(--ease-in-out);
}

.category-children .category-link:hover {
  border-left-color: var(--color-primary);
}

.category-children .category-count {
  font-size: 11px;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  padding: 0 6px;
}

/* Empty state */
.category-empty {
  margin: 0;
  padding: var(--space-3) 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  text-align: center;
}


/* ========================================
 * Responsive
 * ======================================== */
@media (max-width: 991px) {
  #sidebar-left {
    padding-top: var(--space-6);
  }

  .profile-stats {
    gap: var(--space-1);
    padding: var(--space-2);
  }

  .stat-num {
    font-size: var(--text-base);
  }
}

/* source: components/widget.css */
/* ========================================
 * Widget — 侧边栏 widget 共享样式（左右 sidebar 都用）
 * 配对组件: components/sidebar-left.php、components/sidebar-right.php
 * ======================================== */

.widget {
    margin-bottom: var(--space-6);
    padding: var(--space-5);
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: box-shadow var(--transition-base) var(--ease-in-out),
        border-color var(--transition-base) var(--ease-in-out);
}

.widget-title {
    position: relative;
    margin: 0 0 var(--space-4);
    padding: 0 0 var(--space-3);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-border);
}

/* Short accent bar under widget title */
.widget-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 1.75rem;
    height: 2px;
    background: var(--color-primary);
    border-radius: var(--radius-full);
}

/* Icon inside widget title */
.widget-title iconify-icon {
    color: var(--color-primary);
    vertical-align: -0.2em;
    margin-right: var(--space-2);
}

.widget-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget-list li {
    margin: var(--space-1) 0;
    padding: var(--space-2) 0;
    line-height: var(--leading-normal);
    transition: padding-left var(--transition-fast) var(--ease-in-out);
}

.widget-list li:hover {
    padding-left: var(--space-1);
}

.widget-list li+li {
    border-top: 1px solid var(--color-border-light);
}

.widget-list a {
    display: block;
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    transition: color var(--transition-fast) var(--ease-in-out);
}

.widget-list a:hover {
    color: var(--color-primary);
}

.widget-list li ul {
    margin-left: var(--space-4);
    margin-top: var(--space-1);
    list-style: none;
    padding: 0;
}

/* --- 响应式 (移动) --- */
@media (max-width: 767px) {

    #sidebar-left,
    #sidebar-right {
        padding-top: var(--space-6);
    }
}

/* ========================================
 * Recent Comments — 最近回复卡片（左栏）
 * ======================================== */
.recent-comment-item {
    padding: 0 !important;
    border: none !important;
    transition: none !important;
}

.recent-comment-item:hover {
    padding-left: 0 !important;
}

.recent-comment-link {
    display: flex !important;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-3);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast) var(--ease-in-out);
    text-decoration: none;
}

.recent-comment-link:hover {
    background: color-mix(in srgb, var(--color-card-bg) 88%, var(--color-primary) 12%);
}

.recent-comment-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    margin-top: 2px;
}

.recent-comment-avatar img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--color-border);
}

.recent-comment-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.recent-comment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.recent-comment-author {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-comment-date {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.recent-comment-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
    word-break: break-all;
}

.recent-comment-from {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.recent-comment-from iconify-icon {
    flex-shrink: 0;
    color: var(--color-primary);
}

.recent-comment-from:hover {
    color: var(--color-primary);
}

/* source: components/widget-calendar.css */
/* ========================================
 * Calendar Widget for Left Sidebar
 * 替代原有按月归档列表的交互式日历组件
 * ======================================== */

/* --- Calendar Container --- */
.calendar-root {
  --calendar-cell-min: 28px;
  --calendar-dot-size: 5px;
  position: relative;
  user-select: none;
}

/* --- Navigation Bar (← 2026年7月 →) --- */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  padding: 0 var(--space-1);
}

.calendar-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--text-base);
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-fast) var(--ease-in-out);
}

.calendar-nav-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-primary);
}

.calendar-nav-btn:active {
  transform: scale(0.92);
}

.calendar-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  line-height: 1;
}

/* --- Weekday Header (一 二 三 四 五 六 日) --- */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: var(--space-1);
  text-align: center;
}

.calendar-weekday {
  padding: var(--space-1) 0;
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--color-text-muted);
  line-height: 1;
}

.calendar-weekday:nth-child(6),
.calendar-weekday:nth-child(7) {
  color: color-mix(in srgb, var(--color-text-muted) 70%, var(--color-primary) 30%);
}

/* --- Calendar Grid (7 columns) --- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: var(--space-3);
}

/* --- Day Cell --- */
.calendar-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: var(--calendar-cell-min);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  cursor: default;
  transition: background var(--transition-fast) var(--ease-in-out);
}

/* Anchor that fills the clickable area for dates with posts */
.calendar-day-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: var(--space-1) 0;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast) var(--ease-in-out);
}

/* Empty placeholder cells (days before first of month) */
.calendar-day.empty {
  visibility: hidden;
}

/* Non-empty days get a clickable appearance */
.calendar-day.no-posts {
  cursor: default;
  color: var(--color-text-muted);
}

.calendar-day.has-posts {
  cursor: pointer;
  color: var(--color-text-primary);
  font-weight: var(--font-medium);
}

.calendar-day.has-posts:hover {
  background: var(--color-bg-hover);
  color: var(--color-primary);
}

/* --- Today Highlight --- */
.calendar-day.today {
  box-shadow: inset 0 0 0 1.5px var(--color-primary);
  font-weight: var(--font-bold);
  color: var(--color-primary);
}

/* --- Weekend Dimming --- */
.calendar-day.weekend {
  opacity: 0.7;
}

/* --- Post Count Dot Indicator --- */
.calendar-dot {
  display: block;
  width: var(--calendar-dot-size);
  height: var(--calendar-dot-size);
  margin-top: 1px;
  border-radius: 50%;
  background: var(--color-primary);
  opacity: 0.8;
  transition: opacity var(--transition-fast) var(--ease-in-out);
}

.calendar-day.has-posts:hover .calendar-dot {
  opacity: 1;
}

/* --- Post Count Badge (for 2+ posts on same day) --- */
.calendar-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 12px;
  height: 12px;
  padding: 0 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #ffffff;
  font-size: 9px;
  font-weight: var(--font-bold);
  line-height: 1;
  border-radius: var(--radius-full);
  pointer-events: none;
}

/* --- Stats Summary --- */
.calendar-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-1) 0;
  border-top: 1px solid var(--color-border-light);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1;
}

.calendar-total-count {
  font-weight: var(--font-semibold);
  color: var(--color-text-secondary);
}

.calendar-month-count span {
  font-weight: var(--font-semibold);
  color: var(--color-primary);
}

/* ========================================
 * Responsive
 * ======================================== */
@media (max-width: 1199px) {
  .calendar-root {
    --calendar-cell-min: 26px;
  }
}

@media (max-width: 991px) {
  .calendar-root {
    --calendar-cell-min: 32px;
  }

  .calendar-day {
    min-height: 32px;
  }

  .calendar-day.has-posts {
    font-weight: var(--font-semibold);
  }
}

/* source: pages/footer.css */
/* ========================================
 * Footer — 页脚（GitHub Badge 风格 + 运行时间 + 备案）
 * 配对页面: pages/footer.php
 *
 * 结构：元信息行（运行时间 + 加载耗时）→ 徽章行 → 备案号
 * ======================================== */

/* --- 页脚容器 --- */
#footer {
  padding: var(--space-12, 2.5rem) 0 var(--space-10, 2rem);
  border-top: 1px solid var(--color-border);
  text-align: center;
  background: var(--color-bg-secondary);
}

/* --- 元信息行：运行时间 + 加载耗时（同行） --- */
.footer-meta {
  margin: 0 0 var(--space-5, 1.25rem);
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: var(--leading-relaxed, 1.75);
}

.footer-meta strong {
  color: var(--color-primary);
  font-weight: 600;
}

/* --- 徽章行 --- */
.footer-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 0 var(--space-4, 1rem);
}

/* --- 单个徽章 --- */
.footer-badge {
  display: inline-flex;
  align-items: stretch;
  border-radius: 4px;
  overflow: hidden;
  font-size: var(--text-xs);          /* 12px */
  line-height: 1;
  text-decoration: none;
  font-weight: var(--font-normal, 400);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
  vertical-align: middle;
}

a.footer-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  opacity: 1;
}

a.footer-badge:active {
  transform: translateY(0);
}

/* --- 徽章左半 — 标签（各徽章固定不同颜色） --- */
.badge-key {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  color: #fff;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  user-select: none;
}

/* © 年份 → 蓝色 */
.footer-badge:nth-child(1) .badge-key {
  background: #3b82f6;
}

/* Powered by → 绿色 */
.footer-badge:nth-child(2) .badge-key {
  background: #10b981;
}

/* Theme → 紫色 */
.footer-badge:nth-child(3) .badge-key {
  background: #8b5cf6;
}

/* Server → 橙色 */
.footer-badge:nth-child(4) .badge-key {
  background: #f59e0b;
}

/* --- 徽章右半 — 值 --- */
.badge-val {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  background: var(--color-bg);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  border-left: none;
  font-weight: var(--font-medium, 500);
  white-space: nowrap;
}

/* --- 徽章行 --- */
.footer-beian {
  margin: var(--space-2, 0.5rem) 0 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.footer-beian a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-beian a:hover {
  color: var(--color-primary);
}

.beian-sep {
  margin: 0 8px;
  color: var(--color-text-muted);
  user-select: none;
}

/* 萌ICP（非链接静态展示） */
.beian-moe {
  color: var(--color-text-muted);
}

/* --- Footer 内 Iconify 图标对齐 --- */
#footer iconify-icon {
  vertical-align: -0.15em;
  margin-right: 3px;
}

/* 徽章标签内的图标继承白色 */
.badge-key iconify-icon {
  vertical-align: -0.125em;
  margin-right: 4px;
  color: inherit;
}

/* --- 暗色模式 --- */
[data-theme="dark"] .badge-val {
  background: color-mix(in srgb, var(--color-bg) 80%, var(--color-bg-secondary) 20%);
}

/* --- 小屏适配 --- */
@media (max-width: 480px) {
  .footer-badges {
    gap: 6px;
  }

  .badge-key,
  .badge-val {
    padding: 4px 7px;
    font-size: 10px;
  }
}

/* source: components/scroll-to-top.css */
/* ========================================
 * Scroll-to-Top / Floating Catalog
 * 配对组件: components/scroll-to-top.php
 * 配对脚本: js/scroll-to-top.js
 *
 * 右下角按钮组（回到顶部 + 目录）+ 目录浮窗
 * ======================================== */

/* ========================================
 * 按钮组容器
 * ======================================== */
.stt-btn-group {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none; /* 容器不阻挡点击，按钮自身恢复 */
}

/* ========================================
 * 共享按钮样式
 * ======================================== */
.stt-btn {
  --stt-size: 44px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--stt-size);
  height: var(--stt-size);
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--color-border) 65%, transparent);
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-bg-secondary) 70%, transparent);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08),
              0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  color: var(--color-text-secondary);
  font-size: 18px;
  cursor: pointer;
  pointer-events: auto; /* 恢复点击 */

  /* 初始隐藏 */
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.92);
  transition:
    opacity var(--transition-base) var(--ease-out),
    visibility var(--transition-base) var(--ease-out),
    transform var(--transition-base) var(--ease-out),
    background var(--transition-base) ease,
    border-color var(--transition-base) ease,
    box-shadow var(--transition-base) ease,
    color var(--transition-base) ease;

  user-select: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

/* --- 显示状态 --- */
.stt-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* --- Hover / Focus --- */
.stt-btn:hover {
  background: color-mix(in srgb, var(--color-primary) 15%, var(--color-bg-secondary) 80%);
  border-color: color-mix(in srgb, var(--color-primary) 40%, transparent);
  color: var(--color-primary);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

.stt-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* --- 按下反馈 --- */
.stt-btn:active {
  transform: scale(0.92);
  transition-duration: 80ms;
}

/* --- Iconify 图标居中 --- */
.stt-btn iconify-icon {
  display: inline-flex;
  vertical-align: middle;
  line-height: 1;
}

/* ========================================
 * 回到顶部按钮专属（叠加 scroll 逻辑）
 * ======================================== */
/* 在 .stt-btn 基础上，仅调整 active 不冲突 */
.stt-btn-top:active {
  transform: scale(0.92);
}

/* ========================================
 * 目录按钮专属
 * ======================================== */
/* 默认隐藏，仅在有目录 + 窄屏时由 JS 添加 .is-visible */
.stt-btn-catalog {
  /* 所有样式继承自 .stt-btn */
}

/* ========================================
 * 暗色模式 — 按钮
 * ======================================== */
[data-theme="dark"] .stt-btn {
  background: color-mix(in srgb, var(--color-bg-secondary) 60%, transparent);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3),
              0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

[data-theme="dark"] .stt-btn:hover {
  background: color-mix(in srgb, var(--color-primary) 20%, var(--color-bg-secondary) 70%);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--color-primary) 30%, transparent);
}

/* ========================================
 * 目录浮窗
 * ======================================== */

/* --- 浮窗根容器（固定全屏，不可见时 pointer-events: none） --- */
.catalog-panel {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-base) var(--ease-out);
  /* 仅用 opacity 控制显隐，visibility 参与 transition 会与双向动画冲突 */
}

/* --- 打开状态 --- */
.catalog-panel.is-open {
  pointer-events: auto;
  opacity: 1;
}

/* --- 半透明遮罩 --- */
.catalog-panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--transition-base) var(--ease-out);
}

.catalog-panel.is-open .catalog-panel-backdrop {
  opacity: 1;
}

/* --- 浮窗内容卡片 --- */
.catalog-panel-content {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 60vh;
  margin: 0 auto;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--transition-base) var(--ease-out);
  overflow: hidden;
}

.catalog-panel.is-open .catalog-panel-content {
  transform: translateY(0);
}

/* --- 浮窗标题栏 --- */
.catalog-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.catalog-panel-header h3 {
  margin: 0;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.catalog-panel-header h3 iconify-icon {
  color: var(--color-primary);
}

.catalog-panel-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 18px;
  cursor: pointer;
  transition:
    background var(--transition-fast) ease,
    color var(--transition-fast) ease;
}

.catalog-panel-close:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.catalog-panel-close:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* --- 浮窗目录列表区 --- */
.catalog-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-3) var(--space-5) var(--space-5);
  -webkit-overflow-scrolling: touch;
}

/* 隐藏滚动条但保留功能 */
.catalog-panel-body::-webkit-scrollbar {
  width: 3px;
}
.catalog-panel-body::-webkit-scrollbar-track {
  background: transparent;
}
.catalog-panel-body::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

/* 复用侧边栏目录原有样式（引用于此） */
.catalog-panel-body .cl-wrapper ul {
  margin: 0;
  padding-left: 8px;
  list-style: none;
}

.catalog-panel-body .cl-wrapper ul ul {
  padding-left: 12px;
}

.catalog-panel-body .cl-wrapper .cl-link {
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 700;
  transition: all .3s cubic-bezier(.23, 1, .32, 1);
  display: block;
  border-radius: 4px;
  padding: 5px 0 5px 12px;
  margin: 2px 0;
  position: relative;
}

.catalog-panel-body .cl-wrapper .cl-link:hover {
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  transform: translate(2px);
}

.catalog-panel-body .cl-wrapper .cl-link-active {
  color: var(--color-primary);
  font-weight: 700;
}

/* ========================================
 * 暗色模式 — 浮窗
 * ======================================== */
[data-theme="dark"] .catalog-panel-content {
  background: var(--color-bg-secondary);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .catalog-panel-backdrop {
  background: rgba(0, 0, 0, 0.6);
}

/* ========================================
 * 小屏适配
 * ======================================== */
@media (max-width: 480px) {
  .stt-btn-group {
    right: 16px;
    bottom: 16px;
    gap: 6px;
  }

  .stt-btn {
    --stt-size: 38px;
    font-size: 16px;
  }

  .catalog-panel-content {
    max-width: 100%;
    max-height: 75vh;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }

  .catalog-panel-header {
    padding: var(--space-3) var(--space-4);
  }

  .catalog-panel-body {
    padding: var(--space-2) var(--space-4) var(--space-4);
  }
}

/* ========================================
 * Respect user preference: reduced motion
 * ======================================== */
@media (prefers-reduced-motion: reduce) {
  .stt-btn,
  .catalog-panel,
  .catalog-panel-backdrop,
  .catalog-panel-content {
    transition: none;
  }

  .stt-btn:active {
    transform: none;
  }
}
