/* Static-site supplement to AeroCorePro main.min.css.
   The cartoon face is embedded (SIL OFL 1.1), so it renders identically on
   desktop and mobile with no external font request. */

@font-face {
  font-family: "ChenguoyiCartoon";
  src: url("/assets/fonts/cartoon-round.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --st-accent: #ff6b6b;
  --st-border: #e8eaed;
  --st-muted: #7b828c;
  --st-card: #fff;
  --st-font: "ChenguoyiCartoon", "Yuanti SC", "圆体-简", "YouYuan", "幼圆",
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
html[data-theme="dark"] {
  --st-border: #30343b;
  --st-muted: #98a0aa;
  --st-card: #1c1f24;
}
html, body, button, input, select, textarea,
.site-header, .nav-list, .site-footer,
.article-item, .article-item__title, .article-item__excerpt,
.single-post, .widget, .widget-title, .breadcrumb,
.search-page, .related-gallery, .static-pagination, .charity-card {
  font-family: var(--st-font);
}
/* a rounded face reads better with slightly more air */
.single-post__content, .article-item__excerpt, .static-widget__text { letter-spacing: .02em; }
.single-post__content { line-height: 2; }
h1, h2, h3, .article-item__title, .widget-title { letter-spacing: .01em; }

.page-container { padding-top: 18px; }
.layout-grid { max-width: 1200px; margin: 0 auto; }
/* waterfall: keep natural image ratios so card heights differ (theme uses column-width:240px) */
.article-item__thumb img { width: 100%; height: auto; display: block; }
.article-item__excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-item__cat { margin-left: 10px; color: var(--st-accent); text-decoration: none; }
.article-item__date { color: var(--st-muted); font-size: 12px; }

/* ---------- sidebar ---------- */
.widget-area .static-widget { padding: 18px; border: 1px solid var(--st-border);
  border-radius: 12px; background: var(--st-card); margin-bottom: 16px; }
.widget-title { font-size: 15px; font-weight: 700; margin: 0 0 12px; padding-left: 10px;
  border-left: 3px solid var(--st-accent); }
.static-widget__text { font-size: 13px; line-height: 1.8; color: var(--st-muted); margin: 0; }
.static-widget__list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.static-widget__list li { padding: 7px 0; border-bottom: 1px dashed var(--st-border); }
.static-widget__list li:last-child { border-bottom: 0; }
.static-widget__list a { color: inherit; text-decoration: none; display: flex;
  justify-content: space-between; gap: 8px; }
.static-widget__list a:hover { color: var(--st-accent); }
.static-widget__list span { color: var(--st-muted); }
.cat-tree__row { display: flex; align-items: center; gap: 4px; }
.cat-tree__row a { flex: 1; min-width: 0; }
.cat-tree__toggle { width: 24px; height: 24px; flex: none; border: 0; border-radius: 5px;
  background: transparent; color: var(--st-muted); cursor: pointer; font-size: 13px; line-height: 1; }
.cat-tree__toggle:hover { background: var(--st-border); color: var(--st-accent); }
.cat-tree__children { list-style: none; padding: 2px 0 4px 12px; margin: 0 0 4px 6px;
  border-left: 1px solid var(--st-border); }
.cat-tree__children[hidden] { display: none; }
.cat-tree__children li { padding: 4px 0; border-bottom: 0; }
.cat-tree__children a { font-size: 12px; color: var(--st-muted); }
.cat-tree__children a:hover, .cat-tree__children a.is-current { color: var(--st-accent); }
.cat-tree__row { display: flex; align-items: center; gap: 4px; }
.cat-tree__row a { flex: 1; min-width: 0; }
.cat-tree__toggle { width: 24px; height: 24px; flex: none; border: 0; border-radius: 5px;
  background: transparent; color: var(--st-muted); cursor: pointer; font-size: 13px; line-height: 1; }
.cat-tree__toggle:hover { background: var(--st-border); color: var(--st-accent); }
.cat-tree__children { list-style: none; padding: 2px 0 4px 12px; margin: 0 0 4px 6px;
  border-left: 1px solid var(--st-border); }
.cat-tree__children[hidden] { display: none; }
.cat-tree__children li { padding: 4px 0; border-bottom: 0; }
.cat-tree__children a { font-size: 12px; color: var(--st-muted); }
.cat-tree__children a:hover, .cat-tree__children a.is-current { color: var(--st-accent); }

/* ---------- pagination ---------- */
.static-pagination { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  padding: 24px 0 8px; }
.static-pagination__link, .static-pagination__current { display: inline-flex; align-items: center;
  justify-content: center; min-width: 36px; height: 36px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--st-border); background: var(--st-card); color: inherit;
  text-decoration: none; font-size: 13px; }
.static-pagination__link:hover { border-color: var(--st-accent); color: var(--st-accent); }
.static-pagination__current { background: var(--st-accent); border-color: var(--st-accent); color: #fff; }

/* ---------- single post ---------- */
.breadcrumb { font-size: 13px; color: var(--st-muted); margin-bottom: 14px; }
.breadcrumb a { color: inherit; text-decoration: none; }
.breadcrumb a:hover { color: var(--st-accent); }
.single-post { background: var(--st-card); border: 1px solid var(--st-border);
  border-radius: 14px; padding: 26px; }
.single-post__title { font-size: 26px; line-height: 1.45; margin: 0 0 12px; }
.single-post__meta { font-size: 13px; color: var(--st-muted); display: flex; gap: 14px;
  flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--st-border); }
.single-post__cats a { color: var(--st-accent); text-decoration: none; margin-right: 8px; }
.single-post__content { padding: 20px 0; font-size: 15px; line-height: 1.9; }
.single-post__content img { max-width: 100%; height: auto; border-radius: 8px; }
.single-post__content audio { width: 100%; margin: 8px 0; }
.single-post__footer { border-top: 1px solid var(--st-border); padding-top: 16px; }
.single-post__nav { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.single-post__nav a { color: inherit; text-decoration: none; }
.single-post__nav a:hover { color: var(--st-accent); }

/* ---------- video player ---------- */
.video-player { position: relative; width: 100%; margin: 6px 0 18px; }
.video-player video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  background: #000; border-radius: 10px; }
.video-player__hint { font-size: 12px; color: var(--st-muted); margin: 6px 0 0; }
.video-player--error .video-player__hint { color: var(--st-accent); }

/* ---------- search ---------- */
.search-page { background: var(--st-card); border: 1px solid var(--st-border);
  border-radius: 14px; padding: 26px; }
.search-page__title { font-size: 24px; margin: 0 0 18px; }
.search-page__form { display: flex; gap: 10px; margin-bottom: 14px; }
.search-page__form input { flex: 1; min-width: 0; height: 44px; padding: 0 14px;
  border: 1px solid var(--st-border); border-radius: 9px; background: transparent;
  color: inherit; font-size: 15px; outline: none; }
.search-page__form input:focus { border-color: var(--st-accent); }
.search-page__form button { height: 44px; padding: 0 22px; border: 0; border-radius: 9px;
  background: var(--st-accent); color: #fff; font-size: 14px; cursor: pointer; }
.search-page__status { font-size: 13px; color: var(--st-muted); margin: 0 0 16px; }
.search-page__empty { color: var(--st-muted); font-size: 14px; padding: 20px 0; }
#search-results mark { background: #ffe9a8; color: #5a3d00; border-radius: 3px; padding: 0 2px; }
.not-found { padding: 60px 20px; text-align: center; }
.not-found a { color: var(--st-accent); }

/* ---------- header modal / mobile nav ---------- */
/* search modal: keep the theme's native centered absolute positioning */
.search-modal.is-open { display: block; }
body.modal-open { overflow: hidden; }
.mobile-nav.is-open { display: block !important; }

@media (max-width: 900px) {
  .layout-grid { grid-template-columns: 1fr !important; }
  .layout-col--sidebar { order: 2; }
  .single-post { padding: 18px; }
  .single-post__title { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- related gallery + lightbox ---------- */
.related-gallery { margin-top: 22px; padding: 20px; background: var(--st-card);
  border: 1px solid var(--st-border); border-radius: 14px; }
.related-gallery__title { font-size: 16px; font-weight: 700; margin: 0 0 16px;
  padding-left: 10px; border-left: 3px solid var(--st-accent); }
.related-gallery__grid { display: grid; gap: 12px; }
.related-card { min-width: 0; }
.related-card__thumb { display: block; width: 100%; padding: 0; border: 0;
  border-radius: 8px; overflow: hidden; background: #000; cursor: zoom-in; line-height: 0; }
.related-card__thumb img { width: 100%; height: auto; aspect-ratio: 16 / 9;
  object-fit: cover; display: block; transition: transform .25s; }
.related-card__thumb:hover img { transform: scale(1.06); }
.related-card__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-top: 7px; font-size: 12px; line-height: 1.5; color: inherit;
  text-decoration: none; }
.related-card__title:hover { color: var(--st-accent); }
.lightbox { position: fixed; inset: 0; z-index: 10000; display: flex;
  align-items: center; justify-content: center; background: rgba(6, 8, 12, .92); }
.lightbox[hidden] { display: none; }
.lightbox__stage { margin: 0; max-width: min(88vw, 1100px); text-align: center; }
.lightbox__img { max-width: 100%; max-height: 76vh; border-radius: 8px; }
.lightbox__caption { display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  justify-content: center; margin-top: 14px; color: #f2f4f8; font-size: 14px; }
.lightbox__link { color: #ffb3b3; text-decoration: none; }
.lightbox__close, .lightbox__prev, .lightbox__next { position: absolute; border: 0;
  background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; border-radius: 50%;
  width: 42px; height: 42px; font-size: 24px; line-height: 1; }
.lightbox__close { top: 18px; right: 22px; }
.lightbox__prev { left: 3vw; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 3vw; top: 50%; transform: translateY(-50%); }
.lightbox__close:hover, .lightbox__prev:hover, .lightbox__next:hover { background: rgba(255,255,255,.26); }

/* ---------- light-mode contrast fix (theme sets nav links white for dark headers) ---------- */
html:not([data-theme="dark"]) .site-header { color: #1e293b; }
html:not([data-theme="dark"]) .site-header .nav-list li a { color: rgba(0,0,0,.72) !important; }
html:not([data-theme="dark"]) .site-header .nav-list li a:hover {
  color: #000 !important; background: rgba(0,0,0,.06) !important; }
html:not([data-theme="dark"]) .site-header__search-input { color: #1e293b !important; }
html:not([data-theme="dark"]) .site-header__search-input::placeholder { color: #8a929c !important; }
html:not([data-theme="dark"]) .article-item__title,
html:not([data-theme="dark"]) .article-item__title a,
html:not([data-theme="dark"]) .single-post__title,
html:not([data-theme="dark"]) .widget-title,
html:not([data-theme="dark"]) .search-page__title,
html:not([data-theme="dark"]) .related-gallery__title { color: #1e293b !important; }
.search-page { max-width: 900px; margin: 0 auto; }

/* charity card: last item INSIDE the sidebar column, sticky while scrolling */
.charity-card { position: sticky; top: 16px; z-index: 20; width: 100%; max-width: none;
  margin: 14px 0 0; padding: 10px; background: #fff; border: 1px solid #f2dadd;
  border-radius: 16px; box-shadow: 0 8px 28px rgba(0, 0, 0, .14); }
.charity-card[hidden] { display: none; }
.charity-card__head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
  font-size: 12px; font-weight: 600; color: #333; }
.charity-card__dots { display: inline-flex; gap: 3px; flex: none; }
.charity-card__dots i { display: block; width: 8px; height: 8px; border-radius: 50%; background: #f7a823; }
.charity-card__label { flex: 1; min-width: 0; }
.charity-card__close { border: 0; background: transparent; cursor: pointer; color: #999;
  font-size: 16px; line-height: 1; padding: 0 2px; }
.charity-card__close:hover { color: #e55; }
.charity-card__link { display: block; border-radius: 10px; overflow: hidden; }
.charity-card__link img { width: 100%; height: auto; display: block; }
/* keep the sidebar column tall enough for sticky to work over the whole page */
.layout-col--sidebar { align-self: stretch; }
@media (max-width: 900px) {
  .charity-card { padding: 7px; }
  .charity-card__head { font-size: 10px; gap: 4px; }
}

/* ---------- grid paper background (from the original site) ---------- */
html {
  background-color: #f0f2f5;
  background-image:
    linear-gradient(90deg, rgba(200, 200, 200, .3) 1px, transparent 1px),
    linear-gradient(rgba(200, 200, 200, .3) 1px, transparent 1px);
  background-size: 30px 30px;
}
body { background: transparent !important; }
html[data-theme="dark"] {
  background-color: #15181d;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px);
}
/* colorful click particles */
.click-particle { position: absolute; width: 8px; height: 8px; border-radius: 50%;
  pointer-events: none; animation: explode .8s ease-out forwards; }
@keyframes explode {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

/* ---------- mobile interaction fixes ---------- */
/* 手机端：文章列表之后直接到 footer，不再追加作者信息 / 视频分类 /
   文章列表 / 公益卡片等侧栏模块。主题原生在 <=768px 已隐藏侧栏，
   这里不再强行恢复；桌面端侧栏保持原样。 */
@media (max-width: 768px) {
  .layout-col--sidebar,
  .layout-col--sidebar .widget-area,
  .charity-card { display: none !important; }
  .site-header__search-btn, .nav-toggle {
    min-width: 44px; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
  }
}
/* theme opens the panel with `.open`; JS sets both class names for compatibility */
.site-nav--mobile.open, .site-nav--mobile.is-open { transform: translateX(0); }
html.mobile-nav-open, html.mobile-nav-open body { overflow: hidden; }
.search-modal.is-open, .search-modal.open { display: block !important; z-index: 10050; }
/* flex 子项 input 默认 min-width:auto（约 20 字符宽）会撑破窄屏弹层，
   把「搜索」与关闭按钮挤到视口外，故显式归零。 */
.search-modal__input { min-width: 0; }
.search-modal__submit { flex: none; margin-left: 8px; height: 40px; padding: 0 16px;
  border: 0; border-radius: 8px; background: var(--st-accent); color: #fff;
  font-size: 14px; cursor: pointer; }

/* ---------- mobile search bar: everything fits in one row ---------- */
@media (max-width: 768px) {
  .search-modal__content {
    top: 72px; left: 12px;
    width: calc(100% - 24px); max-width: none;
    transform: none;
  }
  .search-modal__form {
    box-sizing: border-box; width: 100%; height: 52px;
    padding: 0 10px; gap: 0;
  }
  .search-modal__icon { flex: none; margin-right: 6px; }
  .search-modal__input {
    flex: 1 1 auto; width: 0; min-width: 0;
    font-size: 16px; /* no iOS zoom-on-focus */
  }
  .search-modal__submit {
    flex: none; box-sizing: border-box; white-space: nowrap;
    min-width: 0; min-height: 0; height: 36px;
    margin-left: 6px; padding: 0 12px; font-size: 13px;
  }
  .search-modal__close {
    flex: none; width: 30px; height: 30px; margin-left: 2px;
  }
  #search-input, .search-page__form input { font-size: 16px; }
}

/* ---------- category archives: compact, uniform thumbnails ----------
   The generator pins `column-count` from the post count (1 column for <=3
   posts), which stretches one thumbnail across the whole content width.
   A responsive grid of 16:9 cards keeps every archive looking like the
   31-post "音乐大师课" page. Homepage waterfall is intentionally untouched. */
body.archive.category .article-list--waterfall {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  align-items: start;
  column-count: initial !important;   /* beats the inline style="column-count:N" */
}
body.archive.category .article-list--waterfall .article-item {
  display: block;
  width: auto;
  margin-bottom: 0;
  break-inside: auto;
}
body.archive.category .article-list--waterfall .article-item__thumb {
  display: block;
  position: relative;
  width: 100%;
  height: 0;
  padding-top: 56.25%;               /* 16:9 box, works on old WebViews */
  overflow: hidden;
}
body.archive.category .article-list--waterfall .article-item__thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 560px) {
  body.archive.category .article-list--waterfall {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
}


/* ---------- fix_v3: 底部色带与屏幕同宽 ----------
   两个 footer 现已由 fix_v3.py 搬到 body 直属层，不再被
   .page-container{max-width:1200px} 限制；内容仍居中约束在 1200px。 */
body > .custom-html-block {
  display: block; width: 100%; max-width: none; margin: auto 0 0;
  background: var(--st-card); border-top: 1px solid var(--st-border);
}
body > .custom-html-block > footer {
  max-width: 1200px; margin: 0 auto !important; border-top: 0 !important;
  padding: 22px 16px !important;
}
body > .site-footer { display: block; width: 100%; max-width: none; margin: 0; }
html[data-theme="dark"] body > .custom-html-block span,
html[data-theme="dark"] body > .custom-html-block div {
  color: #c3cbd5 !important;
}
body > .custom-html-block img { max-height: 28px; }
@media (max-width: 560px) {
  body > .custom-html-block > footer { padding: 18px 12px !important; }
}
