/*
Theme Name: aiqwang Pro
Theme URI: https://www.aiqwang.com/
Author: 爱Q网
Author URI: https://www.aiqwang.com/
Description: 分类杂志风格 WordPress 主题：首页按「分类分区」展示文章卡片网格，配大图轮播、热门排行、侧边栏小工具与完整的响应式布局，适合软件下载站、资讯站与多分类博客。
Version: 1.0.2
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: aiqwang-mag
Tags: blog, news, grid-layout, right-sidebar, custom-menu, featured-images, custom-logo, translation-ready
*/

/* ==========================================================================
   0. 变量与基础
   ========================================================================== */
:root {
  --c-primary: #1e5aa8;
  --c-primary-dark: #16437d;
  --c-primary-soft: #eaf1fb;
  --c-accent: #e8452c;
  --c-accent-soft: #fdecea;
  --c-text: #1f2733;
  --c-text-2: #4a5563;
  --c-muted: #8a93a1;
  --c-bg: #f1f3f7;
  --c-card: #ffffff;
  --c-line: #e6eaf0;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(20, 36, 60, .05);
  --shadow-md: 0 6px 18px rgba(20, 36, 60, .10);
  --shadow-lg: 0 14px 40px rgba(20, 36, 60, .16);
  --container: 1200px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; border: 0; vertical-align: middle; }
a { color: var(--c-text); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--c-accent); }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; line-height: 1.35; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.clear::after { content: ""; display: block; clear: both; }

.container { width: min(var(--container), 100% - 32px); margin-inline: auto; }

/* ==========================================================================
   1. 头部 / 导航
   ========================================================================== */
.custom-logo-link { display: block; flex: none; }
.custom-logo { display: block; width: auto; max-height: 54px; }
.brand-logo { display: block; flex: none; line-height: 0; }
.brand-logo img { display: block; width: auto; max-height: 54px; }

.site-head { background: #fff; border-bottom: 1px solid var(--c-line); }
.site-head .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 18px 0;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.brand-mark {
  flex: none; width: 46px; height: 46px; border-radius: 10px;
  background: linear-gradient(135deg, var(--c-primary), #3a86e0);
  color: #fff; font-weight: 800; font-size: 20px; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(30, 90, 168, .28);
}
.brand-text { min-width: 0; }
.site-title { font-size: 22px; font-weight: 800; letter-spacing: .3px; line-height: 1.2; }
.site-title a { color: var(--c-text); }
.site-title a:hover { color: var(--c-primary); }
.site-desc { margin: 3px 0 0; font-size: 12.5px; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.head-right { display: flex; align-items: center; gap: 14px; flex: none; min-width: 0; }

.search-form { position: relative; display: flex; width: 320px; max-width: 40vw; min-width: 0; }
.search-form input[type="search"] {
  width: 100%; height: 40px; padding: 0 46px 0 14px;
  min-width: 0; border: 1px solid var(--c-line); border-radius: 20px; background: #f7f9fc;
  font-size: 13px; outline: none; transition: border-color .18s, background .18s;
}
.search-form input[type="search"]:focus { border-color: var(--c-primary); background: #fff; }
.search-form button {
  position: absolute; right: 4px; top: 4px; width: 32px; height: 32px;
  border: 0; border-radius: 50%; background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; transition: background .18s;
}
.search-form button:hover { background: var(--c-primary-dark); }
.search-form svg { width: 16px; height: 16px; fill: currentColor; }

.nav-wrap { background: #fff; border-bottom: 1px solid var(--c-line); box-shadow: 0 1px 4px rgba(20, 36, 60, .04); }
.nav-wrap .container { display: flex; align-items: stretch; position: relative; }
.main-nav { display: flex; align-items: stretch; flex: 1; min-width: 0; }
.main-nav > li { position: relative; }
.main-nav > li > a {
  display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 18px;
  color: var(--c-text-2); font-size: 15px; font-weight: 600; transition: color .18s, background .18s;
}
.main-nav > li > a:hover,
.main-nav > li.current-menu-item > a,
.main-nav > li.current-menu-parent > a,
.main-nav > li.current_page_item > a { background: var(--c-primary-soft); opacity: 1; color: var(--c-primary); }
.main-nav .menu-item-has-children > a::after {
  content: ""; width: 0; height: 0; margin-left: 2px;
  border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px);
}
.main-nav .sub-menu {
  position: absolute; left: 0; top: 100%; z-index: 60; min-width: 168px;
  padding: 6px 0; background: #fff; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.main-nav li:hover > .sub-menu,
.main-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.main-nav .sub-menu a {
  display: block; padding: 9px 16px; color: var(--c-text-2); font-size: 13.5px; font-weight: 400;
}
.main-nav .sub-menu a:hover { background: var(--c-primary-soft); color: var(--c-primary); }
.main-nav .sub-menu .sub-menu { left: 100%; top: 0; border-radius: var(--radius-sm); }

.nav-toggle {
  display: none; width: 46px; height: 46px; border: 0; background: transparent; color: var(--c-text);
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; fill: currentColor; }
.nav-extra { margin-left: auto; display: flex; align-items: center; }
.nav-extra a {
  display: flex; align-items: center; height: 46px; padding: 0 16px; color: var(--c-text-2); font-size: 13px;
}
.nav-extra a:hover { color: var(--c-primary); background: var(--c-primary-soft); }

/* ==========================================================================
   2. 轮播 + 热门推荐
   ========================================================================== */
.hero { margin-top: 22px; }
.hero .container { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; }

.hero-slider {
  position: relative; overflow: hidden; border-radius: var(--radius);
  background: #dbe3ee; box-shadow: var(--shadow-md); aspect-ratio: 16 / 8.2;
}
.hero-slider .slide { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease; }
.hero-slider .slide.is-active { opacity: 1; z-index: 1; }
.hero-slider .slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-slider .slide::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8, 16, 28, .82) 0%, rgba(8, 16, 28, .25) 46%, transparent 72%);
  pointer-events: none; /* 让渐变层不拦截点击，轮播图可直接跳转文章 */
}
.slide-cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 22px 24px;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
}
.slide-cap .chip { background: var(--c-accent); color: #fff; }
.slide-cap .chip { align-self: flex-start; }
.slide-cap h2 { align-self: stretch; font-size: 22px; line-height: 1.4; }
.slide-cap h2 a { color: #fff; text-shadow: 0 1px 10px rgba(0, 0, 0, .35); }
.slide-cap h2 a:hover { color: #ffd9cf; }

.hero-prev, .hero-next {
  position: absolute; top: 50%; z-index: 3; width: 38px; height: 38px; margin-top: -19px;
  border: 0; border-radius: 50%; background: rgba(10, 18, 30, .42); color: #fff;
  font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s, background .2s;
}
.hero-slider:hover .hero-prev, .hero-slider:hover .hero-next { opacity: 1; }
.hero-prev { left: 14px; }
.hero-next { right: 14px; }
.hero-prev:hover, .hero-next:hover { background: rgba(10, 18, 30, .72); }

.hero-dots {
  position: absolute; right: 18px; bottom: 18px; z-index: 3; display: flex; gap: 7px;
}
.hero-dots button {
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .45); transition: width .2s, background .2s;
}
.hero-dots button.is-active { width: 20px; border-radius: 4px; background: #fff; }

.hero-side {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 14px 16px 8px; display: flex; flex-direction: column;
}
.hero-side-head {
  display: flex; align-items: center; gap: 8px; padding-bottom: 10px;
  border-bottom: 1px solid var(--c-line); font-size: 15px; font-weight: 700;
}
.hero-side-head::before { content: ""; width: 3px; height: 15px; border-radius: 2px; background: var(--c-accent); }

.mini-list { display: flex; flex-direction: column; }
.mini-list li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--c-line); }
.mini-list li:last-child { border-bottom: 0; }
.mini-thumb {
  position: relative; flex: none; width: 92px; height: 62px; border-radius: var(--radius-sm); overflow: hidden; background: #e9edf4;
}
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.mini-list li:hover .mini-thumb img { transform: scale(1.06); }
.mini-body { min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.mini-title {
  font-size: 13.5px; font-weight: 600; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mini-meta { font-size: 12px; color: var(--c-muted); }

/* 标签条 */
.tagbar {
  margin-top: 18px; padding: 12px 16px; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.tagbar-label {
  flex: none; padding-right: 12px; border-right: 1px solid var(--c-line);
  font-size: 13px; font-weight: 700; color: var(--c-primary);
}
.chip {
  display: inline-flex; align-items: center; height: 26px; padding: 0 11px;
  border-radius: 13px; background: #f0f3f8; color: var(--c-text-2);
  font-size: 12.5px; line-height: 1; white-space: nowrap; transition: background .18s, color .18s;
}
.chip:hover { background: var(--c-primary); color: #fff; }

/* ==========================================================================
   3. 主区域布局
   ========================================================================== */
.layout-wrap { margin-top: 22px; padding-bottom: 30px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
.content { min-width: 0; }

/* 编辑推荐 */
.pick-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 26px; }
.pick {
  display: flex; flex-direction: column; background: #fff; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .22s, transform .22s;
}
.pick:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.pick-thumb { position: relative; display: block; aspect-ratio: 16 / 7.6; overflow: hidden; background: #e9edf4; }
.pick-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.pick:hover .pick-thumb img { transform: scale(1.05); }
.pick-body { padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 8px; }
.pick-body .chip { align-self: flex-start; background: var(--c-accent-soft); color: var(--c-accent); font-weight: 600; }
.pick-body h3 { font-size: 16px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick-body p {
  margin: 0; font-size: 13px; color: var(--c-muted); line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pick-body .card-meta { margin-top: auto; }

/* 分类区块 */
.cat-block { margin-bottom: 30px; }
.cat-head {
  display: flex; align-items: center; gap: 14px; padding-bottom: 10px; margin-bottom: 16px;
  border-bottom: 2px solid var(--c-primary);
}
.cat-title { display: flex; align-items: center; gap: 9px; font-size: 19px; }
.cat-bar { width: 4px; height: 18px; border-radius: 2px; background: var(--c-primary); }
.cat-title a { color: var(--c-text); }
.cat-title a:hover { color: var(--c-primary); }
.cat-sub { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; }
.cat-sub a { color: var(--c-muted); }
.cat-sub a:hover { color: var(--c-accent); }
.cat-more { margin-left: auto; flex: none; font-size: 12.5px; color: var(--c-muted); display: flex; align-items: center; gap: 2px; }
.cat-more:hover { color: var(--c-accent); }
.cat-more i { font-style: normal; transform: translateY(-1px); }

/* 文章卡片 */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.cards.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column; background: #fff;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-thumb { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #e9edf4; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s ease; }
.card:hover .card-thumb img { transform: scale(1.06); }
.card-cat {
  position: absolute; left: 8px; top: 8px; z-index: 2; padding: 2px 8px;
  border-radius: 4px; background: rgba(16, 28, 46, .62); color: #fff; font-size: 11.5px; line-height: 18px;
  backdrop-filter: blur(2px);
}
.card-body { padding: 11px 13px 12px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card-title {
  font-size: 14.5px; font-weight: 600; line-height: 1.55; min-height: 2.6em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--c-muted); }
.card-meta .dot { color: #c6cdd8; }

/* 占位图（无特色图片时） */
.thumb-ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #dfe7f3, #c9d6e9);
  color: #7d8ca3; font-size: 26px; font-weight: 800; letter-spacing: 1px;
}
.thumb-ph.c1 { background: linear-gradient(135deg, #dbe7fb, #bcd3f4); color: #4a76ad; }
.thumb-ph.c2 { background: linear-gradient(135deg, #fde6dc, #f7c6b3); color: #b4643f; }
.thumb-ph.c3 { background: linear-gradient(135deg, #dcf3e8, #b7e2cd); color: #3f8062; }
.thumb-ph.c4 { background: linear-gradient(135deg, #ece2fb, #d4c2f2); color: #6b50a3; }
.thumb-ph.c5 { background: linear-gradient(135deg, #fbe9f2, #f3c6dd); color: #a3527c; }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 26px 0 6px; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: var(--radius-sm);
  background: #fff; box-shadow: var(--shadow-sm); color: var(--c-text-2); font-size: 13px;
}
.pagination .page-numbers:hover { background: var(--c-primary-soft); color: var(--c-primary); }
.pagination .page-numbers.current { background: var(--c-primary); color: #fff; }
.pagination .page-numbers.dots { background: transparent; box-shadow: none; }

/* ==========================================================================
   4. 侧边栏
   ========================================================================== */
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 16px; }
.widget { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.widget-title {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px 16px 12px;
  font-size: 15px; border-bottom: 1px solid var(--c-line);
}
.widget-title::before { content: ""; width: 3px; height: 15px; border-radius: 2px; background: var(--c-primary); }
.widget-title span { font-size: 12px; font-weight: 400; color: var(--c-muted); }
.widget > *:not(.widget-title) { padding: 6px 16px 12px; }
.widget > ul:not(.rank-list):not(.thumb-list) { padding: 8px 16px 14px; }
.widget li { border-bottom: 1px dashed var(--c-line); }
.widget li:last-child { border-bottom: 0; }
.widget ul a { color: var(--c-text-2); font-size: 13.5px; }
.widget ul a:hover { color: var(--c-accent); }

.rank-list { counter-reset: rank; padding: 8px 16px 12px; }
.rank-list li {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; counter-increment: rank;
}
.rank-no {
  flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 5px;
  background: #eef1f6; color: var(--c-muted); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.rank-list li:nth-child(1) .rank-no { background: var(--c-accent); color: #fff; }
.rank-list li:nth-child(2) .rank-no { background: #f28b30; color: #fff; }
.rank-list li:nth-child(3) .rank-no { background: #f5b544; color: #fff; }
.rank-list a { line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.thumb-list { padding: 8px 16px 12px; }
.thumb-list li { display: flex; gap: 10px; padding: 10px 0; }
.tl-thumb { position: relative; flex: none; width: 84px; height: 56px; border-radius: var(--radius-sm); overflow: hidden; background: #e9edf4; }
.tl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tl-body { min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.tl-title { font-size: 13px; font-weight: 600; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tl-meta { font-size: 11.5px; color: var(--c-muted); }

.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px 16px !important; }
.tagcloud a {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px;
  border-radius: 14px; background: #f2f5fa; color: var(--c-text-2); font-size: 12.5px !important;
}
.tagcloud a:hover { background: var(--c-primary); color: #fff; }

.widget-ad { position: relative; display: block; border-radius: var(--radius-sm); overflow: hidden; }
.widget-ad img { display: block; width: 100%; }

/* ==========================================================================
   5. 文章页 / 页面 / 归档
   ========================================================================== */
.crumb { margin: 18px 0 0; font-size: 12.5px; color: var(--c-muted); }
.crumb a { color: var(--c-muted); }
.crumb a:hover { color: var(--c-primary); }
.crumb .sep { margin: 0 7px; color: #c6cdd8; }

.article {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 28px 34px 34px; margin-top: 14px;
}
.entry-header { padding-bottom: 18px; border-bottom: 1px solid var(--c-line); margin-bottom: 22px; }
.entry-title { font-size: 28px; line-height: 1.4; letter-spacing: .2px; }
.entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 14px; font-size: 12.5px; color: var(--c-muted); }
.entry-meta a { color: var(--c-muted); }
.entry-meta a:hover { color: var(--c-primary); }
.entry-meta .sep { color: #d4dae3; }

.entry-content { font-size: 16px; line-height: 1.95; color: #2a323d; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2 { margin: 1.6em 0 .7em; padding-left: 12px; border-left: 4px solid var(--c-primary); font-size: 21px; }
.entry-content h3 { margin: 1.4em 0 .6em; font-size: 18px; }
.entry-content h4 { margin: 1.2em 0 .5em; font-size: 16px; }
.entry-content p { margin: 0 0 1.1em; }
.entry-content a { color: var(--c-primary); text-decoration: underline; text-underline-offset: 3px; }
.entry-content a:hover { color: var(--c-accent); }
.entry-content img { border-radius: var(--radius-sm); }
.entry-content ul, .entry-content ol { margin: 0 0 1.2em; padding-left: 1.6em; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li { margin-bottom: .4em; }
.entry-content blockquote {
  margin: 1.4em 0; padding: 14px 18px; border-left: 4px solid var(--c-primary);
  background: var(--c-primary-soft); color: var(--c-text-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content pre {
  margin: 1.3em 0; padding: 16px 18px; overflow: auto; border-radius: var(--radius-sm);
  background: #1e2635; color: #e6edf7; font-size: 13px; line-height: 1.7;
}
.entry-content code { padding: 2px 6px; border-radius: 4px; background: #eef1f6; color: #c0392b; font-size: .9em; }
.entry-content pre code { padding: 0; background: none; color: inherit; }
.entry-content table { width: 100%; margin: 1.3em 0; border-collapse: collapse; font-size: 14px; }
.entry-content th, .entry-content td { padding: 9px 12px; border: 1px solid var(--c-line); text-align: left; }
.entry-content th { background: #f6f8fb; font-weight: 600; }
.entry-content .wp-caption, .entry-content figure { max-width: 100%; }
.entry-content figcaption { margin-top: 6px; font-size: 12.5px; color: var(--c-muted); text-align: center; }

.entry-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--c-line); font-size: 12.5px; color: var(--c-muted); }
.entry-tags a { padding: 3px 10px; border-radius: 12px; background: #f2f5fa; color: var(--c-text-2); font-size: 12px; }
.entry-tags a:hover { background: var(--c-primary); color: #fff; }

.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.post-nav a {
  display: block; padding: 14px 16px; border-radius: var(--radius-sm); background: #fff;
  box-shadow: var(--shadow-sm); font-size: 13.5px; color: var(--c-text-2); line-height: 1.6;
}
.post-nav a:hover { background: var(--c-primary-soft); color: var(--c-primary); }
.post-nav .label { display: block; margin-bottom: 4px; font-size: 11.5px; color: var(--c-muted); }
.post-nav .next { text-align: right; }

.related { margin-top: 26px; }
.related h2, .block-title {
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 17px;
}
.related h2::before, .block-title::before { content: ""; width: 3px; height: 16px; border-radius: 2px; background: var(--c-accent); }

/* 归档页头 */
.archive-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin: 16px 0 20px; padding: 20px 24px; background: #fff;
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--c-primary);
}
.archive-head h1 { font-size: 24px; }
.archive-head .desc { margin: 6px 0 0; font-size: 13px; color: var(--c-muted); }
.archive-head .count { flex: none; font-size: 12.5px; color: var(--c-muted); }

/* 空状态 / 404 */
.empty-box { padding: 60px 20px; text-align: center; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.empty-box h1 { font-size: 26px; margin-bottom: 10px; }
.empty-box p { color: var(--c-muted); }
.empty-box .btn { margin-top: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 22px; border: 0; border-radius: 20px;
  background: var(--c-primary); color: #fff; font-size: 14px; font-weight: 600;
  transition: background .18s, transform .18s;
}
.btn:hover { background: var(--c-primary-dark); color: #fff; transform: translateY(-1px); }

/* 评论 */
.comments-area { margin-top: 26px; padding: 24px 28px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.comments-title, .comment-reply-title { font-size: 17px; margin-bottom: 16px; }
.comment-list > li { padding: 16px 0; border-top: 1px solid var(--c-line); }
.comment-list .children { margin-left: 46px; }
.comment-author { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; }
.comment-author img { border-radius: 50%; }
.comment-meta { margin: 6px 0 8px; font-size: 12px; color: var(--c-muted); }
.comment-text { font-size: 14px; color: var(--c-text-2); }
.reply a { font-size: 12px; color: var(--c-primary); }
.comment-form p { margin-bottom: 14px; }
.comment-form label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--c-text-2); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"],
.comment-form textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  background: #f9fafc; font-size: 14px; outline: none; transition: border-color .18s, background .18s;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--c-primary); background: #fff; }
.comment-form .submit {
  height: 42px; padding: 0 28px; border: 0; border-radius: 21px;
  background: var(--c-primary); color: #fff; font-weight: 600;
}
.comment-form .submit:hover { background: var(--c-primary-dark); }

/* ==========================================================================
   6. 页脚
   ========================================================================== */
.site-footer {
  position: relative;
  margin-top: 10px;
  background: #fff;
  color: var(--c-text-2);
  font-size: 13px;
}
/* 顶部彩虹分隔条（参考爱Q网官网底部彩条，纯 CSS 渐变流动动画，无图片请求） */
.site-footer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    #f94144 0%, #f8961e 14%, #f9c74f 29%, #90be6d 43%,
    #43aa8b 57%, #4d96ff 71%, #9b5de5 86%, #f15bb5 100%);
  background-size: 200% 100%;
  animation: aiqwang-rainbow 5s linear infinite;
}
@keyframes aiqwang-rainbow {
  0%   { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .site-footer::before { animation: none; }
}
.footer-main {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 30px;
  padding: 40px 0 30px; border-bottom: 1px solid var(--c-line);
}
.site-footer h3 { margin-bottom: 14px; color: var(--c-text); font-size: 15px; }
.site-footer a { color: var(--c-text-2); }
.site-footer a:hover { color: var(--c-primary); }
.footer-brand .brand-mark { width: 40px; height: 40px; font-size: 17px; border-radius: 8px; }
.footer-brand .site-title { color: var(--c-text); font-size: 19px; }
.footer-desc { margin: 12px 0 0; line-height: 1.85; color: var(--c-muted); }
.footer-links li { margin-bottom: 9px; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 0; font-size: 12.5px; color: var(--c-muted); }
.footer-bottom a { color: var(--c-muted); }
.footer-bottom a:hover { color: var(--c-primary); }

.backtop {
  position: fixed; right: 26px; bottom: 26px; z-index: 90; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: var(--c-primary); color: #fff;
  box-shadow: 0 6px 18px rgba(30, 90, 168, .35); display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: all .25s;
}
.backtop.is-on { opacity: 1; visibility: visible; transform: none; }
.backtop:hover { background: var(--c-primary-dark); }
.backtop svg { width: 18px; height: 18px; fill: currentColor; }

/* ==========================================================================
   6.5 文章页 / 评论 / 细节补充
   ========================================================================== */
.slide > a { position: absolute; inset: 0; display: block; }
.entry-cover { margin: 0 0 24px; }
.entry-cover img { display: block; width: 100%; border-radius: var(--radius-sm); }
.page-links { margin-top: 24px; font-size: 13px; color: var(--c-muted); }
.page-links .post-page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 9px; margin: 0 4px 4px 0;
  border-radius: var(--radius-sm); background: #f2f5fa; color: var(--c-text-2);
}
.page-links .post-page-numbers.current { background: var(--c-primary); color: #fff; }
.page-links .post-page-numbers:hover { background: var(--c-primary-soft); color: var(--c-primary); }

.cat-chips { margin: 0 0 18px; }
.related { margin-top: 30px; }
.related .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.empty-box .search-form { width: 100%; max-width: none; }

.comment-list { margin: 0; padding: 0; list-style: none; }
.comment-body { position: relative; padding: 18px 0; border-top: 1px solid var(--c-line); }
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12.5px; color: var(--c-muted); }
.comment-author { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.comment-author .avatar { border-radius: 50%; }
.comment-author .fn { font-style: normal; }
.comment-metadata { font-size: 12px; }
.comment-metadata a { color: var(--c-muted); }
.comment-content { font-size: 14px; color: var(--c-text-2); }
.comment-content p { margin: 0 0 8px; }
.comment-list .children { margin-left: 46px; padding: 0; }
.comment-list .reply { position: absolute; top: 16px; right: 0; }
.comment-list .reply a { font-size: 12px; color: var(--c-primary); }
.comment-respond { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--c-line); }
.comment-notes, .no-comments { margin-bottom: 14px; font-size: 12.5px; color: var(--c-muted); }
.comment-form p { margin-bottom: 14px; }
.comment-form label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--c-text-2); }
.comment-form-cookies-consent { display: flex; align-items: center; gap: 8px; }
.comment-form-cookies-consent label { margin: 0; }
/* ==========================================================================
   7. 响应式
   ========================================================================== */
@media (max-width: 1240px) {
  :root { --container: 100%; }
  .container { width: calc(100% - 32px); }
  .hero .container { grid-template-columns: minmax(0, 1fr) 300px; }
  .layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
  .cards.cols-5 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .cards, .cards.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search-form { width: 250px; }
}

@media (max-width: 1024px) {
  .cards, .cards.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search-form { width: 220px; }
  .main-nav > li > a { padding: 0 13px; font-size: 14px; }
}

@media (max-width: 960px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-side { display: none; }
  .hero-slider { aspect-ratio: 16 / 8; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .footer-main { grid-template-columns: 1fr 1fr; }
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 70;
    flex-direction: column; background: #fff; box-shadow: var(--shadow-lg);
    display: none; padding: 6px 0;
  }
  .main-nav.is-open { display: flex; }
  .main-nav > li > a { color: var(--c-text); height: 44px; }
  .main-nav > li > a:hover, .main-nav > li.current-menu-item > a { background: var(--c-primary-soft); color: var(--c-primary); }
  .main-nav .sub-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border-radius: 0; padding: 0 0 0 16px; display: none;
  }
  .main-nav li.is-open > .sub-menu { display: block; }
  .nav-wrap { position: relative; }
  .nav-extra { display: none; }
}

@media (max-width: 760px) {
  .site-head .container { padding: 14px 0; gap: 12px; }
  .brand-mark { width: 40px; height: 40px; font-size: 17px; }
  .brand-logo img, .custom-logo { max-height: 44px; }
  .site-title { font-size: 19px; }
  .site-desc { display: none; }
  .site-title { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-text { max-width: 42vw; }
  .search-form { width: 100%; max-width: none; }
  .head-right { flex: 1 1 auto; justify-content: flex-end; min-width: 0; }
  .cards, .cards.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .related .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pick-row { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: 1fr; }
  .cat-sub { display: none; }
  .entry-title { font-size: 22px; }
  .article { padding: 20px 18px 24px; }
  .entry-content { font-size: 15.5px; }
  .post-nav { grid-template-columns: 1fr; }
  .footer-main { grid-template-columns: 1fr; gap: 22px; padding: 28px 0 20px; }
  .footer-bottom { justify-content: center; text-align: center; }
  .slide-cap { padding: 16px; }
  .slide-cap h2 { font-size: 17px; }
}

@media (max-width: 480px) {
  .container { width: calc(100% - 24px); }
  .cards, .cards.cols-5 { gap: 12px; }
  .brand-text { max-width: none; }
  .site-title { font-size: 17px; }
  .head-right { flex: 0 0 132px; }
  .search-form { width: 132px; }
  .search-form input[type="search"] { padding-left: 10px; font-size: 12px; }
  .card-title { font-size: 13.5px; }
  .card-body { padding: 9px 10px 10px; }
  .hero-slider { aspect-ratio: 16 / 9.6; }
  .archive-head { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   6.7 友情链接
   ========================================================================== */
.footer-friends {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 0; border-bottom: 1px solid var(--c-line);
  flex-wrap: wrap;
}
.friends-label {
  flex: none; color: var(--c-text); font-size: 13.5px; font-weight: 700;
  padding-top: 1px;
}
.friends-list { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.friends-list a {
  color: var(--c-muted); font-size: 12.5px; transition: color .18s;
}
.friends-list a:hover { color: var(--c-primary); }
.footer-brand .brand-logo img { max-height: 40px; }

/* ==========================================================================
   6.8 代码高亮 + 一键复制
   ========================================================================== */
.entry-content pre { margin: 1.3em 0 0; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.entry-content .code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 1.3em; padding: 7px 12px;
  background: #151b28; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 12px; line-height: 1.6;
}
.code-lang { color: #8b98ae; text-transform: lowercase; }
.code-copy {
  display: inline-flex; align-items: center; height: 24px; padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 12px;
  background: rgba(255, 255, 255, .06); color: #cdd7e6; font-size: 12px;
  transition: background .18s, color .18s;
}
.code-copy:hover { background: rgba(255, 255, 255, .14); color: #fff; }

/* Prism 代码块细节：工具条 + 代码块整体贴合，不被 Prism 自身样式顶开 */
.entry-content pre[class*="language-"] {
  margin: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.entry-content .code-head + pre,
.entry-content .code-head + pre[class*="language-"] {
  margin: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: #1e2635;
}

/* 打印与无障碍 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ==========================================================================
   6.9 广告位
   ========================================================================== */
.aiqwang-ad { margin: 20px 0; text-align: center; }
.aiqwang-ad iframe, .aiqwang-ad img, .aiqwang-ad a img { max-width: 100%; }
.sidebar .aiqwang-ad { margin: 0 0 18px; }

