/*
Theme Name: 我的学习笔记
Theme URI: https://example.com/my-study-notes
Author: 个人博客
Author URI: https://example.com
Description: 面向 AI 算法与音频工程师的程序员博客主题，支持首页 AI 预告区、侧边栏、社交链接、备案信息与代码友好排版。
Version: 1.3.1
Requires at least: 5.9
Tested up to: 6.8
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: my-study-notes
Tags: blog, two-columns, custom-menu, custom-logo, featured-images, translation-ready, one-column
*/

:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface-dark: #0f172a;
  --text: #1a1a1a;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-green: #059669;
  --border: #e8e6e3;
  --tag-bg: #f1f5f9;
  --max-width: 720px;
  --layout-width: 1120px;
  --sidebar-width: 300px;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-serif: "Songti SC", "Noto Serif SC", Georgia, serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", ui-monospace, Menlo, monospace;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --admin-bar-height: 0px;
  --header-sticky-height: 7.5rem;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* WordPress 后台登录时的顶栏高度 */
body.admin-bar {
  --admin-bar-height: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar {
    --admin-bar-height: 46px;
  }
}

/* 顶部栏 + 主导航整体 sticky，滚动时留在管理栏下方 */
.site-header-wrap {
  position: sticky;
  top: var(--admin-bar-height);
  z-index: 100;
}

/* ── Top bar (Blogsy-style utility strip) ── */
.top-bar {
  background: var(--surface-dark);
  color: #94a3b8;
  font-size: 0.8rem;
}

.top-bar-inner {
  max-width: var(--layout-width);
  margin: 0 auto;
  padding: 0.55rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.top-bar-text {
  margin: 0;
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: #94a3b8;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.social-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

/* ── Header ── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.98);
}

.site-header-inner {
  max-width: var(--layout-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-branding {
  flex-shrink: 0;
}

.site-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.site-title a {
  color: var(--text);
  text-decoration: none;
}

.site-title a:hover {
  color: var(--accent);
}

.site-tagline {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-nav a {
  font-size: 0.92rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

.site-nav a:hover,
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a {
  color: var(--accent);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
}

.header-search label {
  margin: 0;
}

.header-search .search-field {
  width: 160px;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  font: inherit;
  font-size: 0.85rem;
  background: var(--bg);
  transition: width 0.2s, border-color 0.15s;
}

.header-search .search-field:focus {
  outline: none;
  border-color: var(--accent);
  width: 200px;
}

.header-search .search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 0 8px 8px 0;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}

.header-search .search-submit:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.35rem;
  border: none;
  background: none;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* ── Layout ── */
.site-container {
  max-width: var(--layout-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.site-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  gap: 2.5rem;
  align-items: start;
}

.site-layout-full {
  grid-template-columns: minmax(0, 1fr);
}

.site-layout-full .site-content {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

/* ── Hero ── */
.hero {
  margin-bottom: 2rem;
  background: linear-gradient(135deg, var(--surface) 0%, var(--accent-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
}

.hero h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 600;
  line-height: 1.35;
}

.hero-desc {
  margin: 0;
  color: var(--text-muted);
  max-width: 38em;
}

.hero-stats {
  margin: 1rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
}

.hero-compact {
  padding: 1.25rem 1.5rem;
}

.hero-compact h2 {
  font-size: 1.35rem;
}

/* ── Post list & cards ── */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}

.post-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow);
}

.post-card-featured {
  padding: 1.75rem;
  border-color: #bfdbfe;
  background: linear-gradient(180deg, var(--surface) 0%, #f8fbff 100%);
}

.post-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.category-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  background: #ecfdf5;
  color: var(--accent-green);
  border-radius: 999px;
  text-decoration: none;
}

.category-badge:hover {
  background: #d1fae5;
  color: #047857;
  text-decoration: none;
}

.post-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.post-card-thumb {
  display: block;
  margin: 0 0 1rem;
  border-radius: 8px;
  overflow: hidden;
}

.post-card-thumb img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.3s;
}

.post-card:hover .post-card-thumb img {
  transform: scale(1.02);
}

.post-card-thumb-sm img {
  max-height: 200px;
}

.post-card h2,
.post-card h3,
.post-card .entry-title {
  margin: 0 0 0.65rem;
  font-size: 1.2rem;
  line-height: 1.4;
}

.post-card-featured .entry-title {
  font-size: 1.45rem;
  font-family: var(--font-serif);
}

.post-card h2 a,
.post-card .entry-title a {
  color: var(--text);
  text-decoration: none;
}

.post-card h2 a:hover,
.post-card .entry-title a:hover {
  color: var(--accent);
}

.post-card-meta,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.post-author {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.post-author a {
  color: var(--text-muted);
  text-decoration: none;
}

.post-author a:hover {
  color: var(--accent);
}

.author-avatar-sm {
  border-radius: 50%;
  width: 24px;
  height: 24px;
}

.meta-sep {
  opacity: 0.5;
}

.read-time {
  font-family: var(--font-mono);
}

.post-excerpt {
  margin: 0 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag,
.tags a {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.18rem 0.5rem;
  background: var(--tag-bg);
  color: var(--text-muted);
  border-radius: 6px;
  text-decoration: none;
}

.tags a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.read-more {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
}

/* ── Article (single) ── */
.article {
  max-width: var(--max-width);
}

.article-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-header h1 {
  margin: 0.65rem 0 0.75rem;
  font-family: var(--font-serif);
  font-size: 2rem;
  line-height: 1.35;
  font-weight: 600;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
}

.article-featured-image {
  margin: 0 0 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
}

.article-featured-image img {
  width: 100%;
  display: block;
}

.article-body h2,
.entry-content h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.article-body h3,
.entry-content h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.article-body p,
.entry-content p {
  margin: 0 0 1rem;
}

.article-body ul,
.article-body ol,
.entry-content ul,
.entry-content ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

.article-body li,
.entry-content li {
  margin-bottom: 0.35rem;
}

.article-body blockquote,
.entry-content blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.article-body code,
.entry-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: #f1f5f9;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.article-body pre,
.entry-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 1rem 0;
}

.article-body pre code,
.entry-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.diagram {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin: 1.25rem 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

/* ── Related posts (Blogsy "您可能错过了") ── */
.related-posts {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-posts-title {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.related-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.related-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow);
}

.related-card h3 {
  margin: 0.5rem 0 0.35rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

.related-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.related-card h3 a:hover {
  color: var(--accent);
}

.related-card .post-meta {
  margin: 0;
  font-size: 0.75rem;
}

/* ── Sidebar ── */
.site-sidebar {
  position: sticky;
  top: calc(var(--header-sticky-height) + var(--admin-bar-height) + 0.75rem);
}

.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.25rem;
}

.widget-title {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.author-card {
  text-align: center;
}

.author-avatar {
  border-radius: 50%;
  margin-bottom: 0.65rem;
}

.author-name {
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.author-bio {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.author-github {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
}

.recent-posts,
.category-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent-posts li,
.category-list li {
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.recent-posts li:last-child,
.category-list li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.recent-posts a {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
  text-decoration: none;
}

.recent-posts a:hover {
  color: var(--accent);
}

.recent-date {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.category-list a {
  color: var(--text);
  font-size: 0.9rem;
  text-decoration: none;
}

.category-list a:hover {
  color: var(--accent);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-cloud a {
  font-family: var(--font-mono);
  font-size: 0.72rem !important;
  padding: 0.18rem 0.5rem;
  background: var(--tag-bg);
  color: var(--text-muted) !important;
  border-radius: 6px;
  text-decoration: none;
}

.tag-cloud a:hover {
  background: var(--accent-soft);
  color: var(--accent) !important;
}

/* ── Footer ── */
.site-footer {
  background: var(--surface-dark);
  color: #94a3b8;
  margin-top: 1rem;
}

.site-footer-inner {
  max-width: var(--layout-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.footer-main {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f1f5f9;
}

.footer-text {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
}

.footer-social {
  justify-content: center;
}

.footer-bottom {
  text-align: center;
  font-size: 0.82rem;
}

.footer-copyright {
  margin: 0 0 0.5rem;
}

.footer-beian {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem 1rem;
  margin: 0;
}

.footer-beian a {
  color: #94a3b8;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.footer-beian a:hover {
  color: #e2e8f0;
}

/* ── Pagination & search ── */
.pagination,
.posts-navigation,
.nav-links {
  margin-top: 2rem;
}

.pagination .nav-links,
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.pagination .page-numbers,
.page-numbers {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.pagination .page-numbers.current,
.page-numbers.current,
.page-numbers:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.search-form:not(.header-search) {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.search-form:not(.header-search) input[type="search"] {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

.search-form:not(.header-search) input[type="submit"] {
  padding: 0.55rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.no-posts {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .site-layout {
    grid-template-columns: 1fr;
  }

  .site-sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .top-bar-inner {
    flex-direction: column;
    text-align: center;
  }

  .nav-toggle {
    display: flex;
  }

  .header-right {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem 1.5rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  body.nav-open .header-right {
    display: flex;
  }

  .site-header-inner {
    position: relative;
    flex-wrap: wrap;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }

  .header-search .search-field {
    width: 100%;
    border-right: 1px solid var(--border);
    border-radius: 8px;
  }

  .header-search .search-submit {
    display: none;
  }

  .header-search {
    width: 100%;
  }

  .hero h2 {
    font-size: 1.45rem;
  }

  .article-header h1 {
    font-size: 1.55rem;
  }
}

/* ─────────────────────────────────────────────
 * AI Algorithm Engineer visual refresh (v1.3.0)
 * 保留原主题结构与备案逻辑，仅增强首页预告区与整体技术博客氛围。
 * ───────────────────────────────────────────── */
:root {
  --bg: #070b14;
  --surface: rgba(15, 23, 42, 0.88);
  --surface-dark: #020617;
  --text: #e5f0ff;
  --text-muted: #8aa4c7;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --accent-green: #34d399;
  --border: rgba(148, 163, 184, 0.18);
  --tag-bg: rgba(15, 23, 42, 0.9);
  --shadow: 0 20px 80px rgba(0, 0, 0, 0.36);
}

body {
  background:
    radial-gradient(circle at 12% 0%, rgba(56, 189, 248, 0.16), transparent 30rem),
    radial-gradient(circle at 88% 10%, rgba(52, 211, 153, 0.12), transparent 28rem),
    linear-gradient(180deg, #070b14 0%, #0b1220 46%, #070b14 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 80%);
  pointer-events: none;
}

.site-header-wrap {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
}

.top-bar {
  background: rgba(2, 6, 23, 0.96);
  border-bottom: 1px solid rgba(56, 189, 248, 0.16);
  color: #93c5fd;
}

.top-bar-text::before {
  content: "// ";
  color: var(--accent-green);
}

.site-header {
  background: rgba(7, 11, 20, 0.82);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  backdrop-filter: blur(18px);
}

.site-title a,
.post-card h2 a,
.post-card .entry-title a {
  color: var(--text);
}

.site-title a::after {
  content: "_";
  color: var(--accent-green);
  animation: ai-cursor 1.1s steps(2, start) infinite;
}

@keyframes ai-cursor {
  50% { opacity: 0; }
}

.site-tagline,
.site-nav a,
.header-search .search-submit,
.post-excerpt,
.article-meta,
.post-card-meta,
.post-date,
.widget,
.footer-text,
.footer-copyright,
.footer-beian {
  color: var(--text-muted);
}

.site-nav a {
  font-family: var(--font-mono);
}

.site-nav a:hover,
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a {
  color: var(--accent-hover);
}

.header-search .search-field,
.header-search .search-submit {
  background: rgba(15, 23, 42, 0.78);
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.22);
}

.header-search .search-field::placeholder {
  color: rgba(138, 164, 199, 0.72);
}

/* AI Hero */
.hero-ai {
  margin-bottom: 2.5rem;
  padding: clamp(2rem, 5vw, 4rem);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(8, 47, 73, 0.82)),
    radial-gradient(circle at 12% 18%, rgba(56, 189, 248, 0.28), transparent 22rem),
    radial-gradient(circle at 82% 16%, rgba(52, 211, 153, 0.2), transparent 20rem);
  border: 1px solid rgba(125, 211, 252, 0.25);
  border-radius: 28px;
  box-shadow: 0 24px 100px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  isolation: isolate;
}

.hero-ai::before {
  opacity: 0.8;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.08) 1px, transparent 1px);
  background-size: 26px 26px;
}

.hero-ai::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: 27px;
  background: linear-gradient(120deg, rgba(56, 189, 248, 0.12), transparent 35%, rgba(52, 211, 153, 0.1));
  pointer-events: none;
}

.hero-ai-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 999px;
  background: rgba(8, 47, 73, 0.5);
  color: #bae6fd;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-eyebrow::before {
  content: "";
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 999px;
  background: var(--accent-green);
  box-shadow: 0 0 16px var(--accent-green);
}

.hero-ai h2 {
  max-width: 12em;
  margin: 0 0 0.9rem;
  font-family: var(--font-sans);
  font-size: clamp(2.35rem, 7vw, 5.4rem);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.07em;
  color: #f8fbff;
}

.hero-ai .hero-desc {
  max-width: 42rem;
  color: #b7c9e5;
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 1.6rem 0 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.button:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.button-primary {
  background: linear-gradient(135deg, #38bdf8, #34d399);
  color: #02111f;
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.22);
}

.button-primary:hover {
  color: #02111f;
}

.button-ghost {
  border: 1px solid rgba(125, 211, 252, 0.4);
  background: rgba(15, 23, 42, 0.45);
  color: #dff7ff;
}

.button-ghost:hover {
  border-color: rgba(52, 211, 153, 0.72);
  color: #ffffff;
}

.hero-ai .hero-stats {
  margin-top: 1.2rem;
  color: #7dd3fc;
}

.hero-console {
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 20px;
  background: rgba(2, 6, 23, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 26px 80px rgba(0, 0, 0, 0.34);
  transform: perspective(900px) rotateY(-4deg) rotateX(2deg);
}

.console-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.74);
}

.console-top span {
  width: 0.68rem;
  height: 0.68rem;
  border-radius: 999px;
  background: #38bdf8;
  opacity: 0.9;
}

.console-top span:nth-child(2) { background: #34d399; }
.console-top span:nth-child(3) { background: #f59e0b; }

.console-top strong {
  margin-left: 0.35rem;
  color: #b7c9e5;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
}

.console-body {
  padding: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: #c8e6ff;
}

.console-body p {
  margin: 0 0 0.75rem;
}

.prompt {
  color: var(--accent-green);
}

.ok {
  color: var(--accent-green);
}

.console-answer {
  margin-top: 0.9rem;
  padding: 1rem;
  border: 1px solid rgba(52, 211, 153, 0.22);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(6, 78, 59, 0.26), rgba(8, 47, 73, 0.18));
  color: #d1fae5;
  line-height: 1.7;
}

.hero-orbit {
  position: absolute;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 999px;
  pointer-events: none;
}

.hero-orbit-one {
  right: -6rem;
  top: -7rem;
  width: 18rem;
  height: 18rem;
}

.hero-orbit-two {
  right: 6rem;
  bottom: -10rem;
  width: 24rem;
  height: 24rem;
  border-color: rgba(52, 211, 153, 0.18);
}

.post-card,
.widget,
.article,
.page-content,
.comments-area,
.author-box,
.related-posts,
.no-posts {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(148, 163, 184, 0.16);
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.16);
}

.post-card:hover {
  border-color: rgba(125, 211, 252, 0.42);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.26);
  transform: translateY(-2px);
}

.post-card-featured {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(8, 47, 73, 0.42));
  border-color: rgba(56, 189, 248, 0.3);
}

.category-badge,
.tag,
.tags a {
  background: rgba(6, 78, 59, 0.35);
  color: #a7f3d0;
  border: 1px solid rgba(52, 211, 153, 0.22);
}

.category-badge:hover,
.tag:hover,
.tags a:hover {
  background: rgba(8, 145, 178, 0.32);
  color: #e0f2fe;
}

.article-content,
.entry-content {
  color: #d8e6f7;
}

.article-content code,
.entry-content code,
pre {
  border: 1px solid rgba(56, 189, 248, 0.18);
  background: rgba(2, 6, 23, 0.72);
}

.site-footer {
  background: rgba(2, 6, 23, 0.9);
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.footer-brand {
  color: var(--text);
}

.footer-beian a {
  color: var(--text-muted);
}

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

@media (max-width: 900px) {
  .hero-ai-inner {
    grid-template-columns: 1fr;
  }

  .hero-console {
    transform: none;
  }
}

@media (max-width: 768px) {
  .header-right {
    background: rgba(7, 11, 20, 0.97);
  }

  .hero-ai {
    border-radius: 22px;
    padding: 1.6rem;
  }

  .hero-ai h2 {
    font-size: clamp(2.2rem, 16vw, 3.6rem);
  }

  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}

/* Layout refinement: keep homepage hero as a standalone full-width row above content + sidebar */
.hero-ai {
  max-width: var(--layout-width);
  width: calc(100% - 3rem);
  margin: 2rem auto 2.5rem;
}

.hero-actions {
  flex-wrap: nowrap;
  align-items: center;
}

.hero-actions .button {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .hero-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.55rem;
  }

  .hero-actions .button {
    width: auto;
    flex: 1 1 0;
    min-width: 0;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    font-size: 0.76rem;
  }
}

/* Hero copy layering: multiline subtitle from Customizer */
.hero-ai .hero-desc span {
  display: block;
  line-height: 1.75;
}

.hero-ai .hero-desc span:first-child {
  color: #e5f6ff;
  font-weight: 700;
}

.hero-ai .hero-desc span:nth-child(2) {
  color: #5eead4;
}

.hero-ai .hero-desc span:nth-child(3) {
  color: #94a3b8;
}
