/*
Theme Name: Hplayer Notes
Theme URI: https://hqplayer.cn/
Author: Hplayer
Description: 面向 Hplayer 数字音乐技术档案的轻量响应式主题。
Version: 2.0.3
Requires at least: 6.0
Requires PHP: 7.0
Text Domain: hqplayer-notes
*/

:root {
  --bg: oklch(1 0 0);
  --surface: oklch(0.9839 0.0025 228.78);
  --fg: oklch(0.3498 0.0199 257.27);
  --muted: oklch(0.5686 0.0157 248.10);
  --border: oklch(0.8879 0.0018 247.84);
  --accent: oklch(0.5252 0.1125 235.83);
  --accent-dark: oklch(0.4452 0.1125 235.83);
  --font-display: "Noto Serif SC", "Songti SC", STSong, serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --max: 1320px;
  --pad: clamp(20px, 4vw, 64px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
img { max-width: 100%; height: auto; }
svg { display: block; }
.wrap {
  width: min(100%, calc(var(--max) + var(--pad) * 2));
  margin-inline: auto;
  padding-inline: var(--pad);
}
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  width: auto;
  height: auto;
  padding: 10px 14px;
  clip: auto;
  color: var(--bg);
  background: var(--fg);
}

.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in oklch, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--fg);
  backdrop-filter: blur(14px);
}
.masthead-row {
  min-height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.wordmark {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}
.wordmark::before { content: ""; width: 8px; height: 22px; background: var(--accent); }
.main-nav ul { display: flex; align-items: center; gap: 30px; margin: 0; padding: 0; list-style: none; }
.main-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: .02em;
  border-bottom: 1px solid transparent;
}
.main-nav a:hover, .main-nav .current-menu-item > a { border-bottom-color: var(--fg); }
.head-actions { display: flex; justify-content: flex-end; gap: 8px; }
.square-button {
  min-width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
}
.square-button:hover { background: var(--surface); border-color: var(--fg); }
.menu-toggle { display: none; }
.mobile-nav {
  display: none;
  position: fixed;
  inset: 68px 0 0;
  z-index: 29;
  padding: 26px var(--pad);
  background: var(--bg);
}
.mobile-nav.open { display: block; }
.mobile-nav ul { margin: 0; padding: 0; list-style: none; }
.mobile-nav a {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 27px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  min-height: min(720px, calc(100svh - 68px));
  border-bottom: 1px solid var(--fg);
}
.hero-intro {
  grid-column: 1 / span 7;
  padding: clamp(72px, 9vw, 130px) clamp(34px, 5vw, 76px) clamp(62px, 8vw, 110px) max(var(--pad), calc((100vw - var(--max)) / 2 + var(--pad)));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--fg);
}
.kicker {
  margin: 0 0 26px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1, h2, h3 { margin-top: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: 0; }
.hero h1 {
  max-width: 8.8em;
  margin-bottom: 30px;
  font-size: clamp(51px, 6.8vw, 92px);
  line-height: 1.32;
}
.hero-copy { max-width: 36em; margin: 0; color: var(--muted); font-size: clamp(16px, 1.4vw, 19px); line-height: 1.8; }
.archive-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 64px; background: var(--border); border: 1px solid var(--border); }
.stat { padding: 16px; background: var(--bg); }
.stat strong { display: block; font-family: var(--font-mono); font-size: 18px; font-weight: 550; }
.stat span { color: var(--muted); font-size: 12px; }
.hero-index {
  grid-column: 8 / -1;
  padding: clamp(72px, 9vw, 130px) max(var(--pad), calc((100vw - var(--max)) / 2 + var(--pad))) clamp(62px, 8vw, 110px) clamp(34px, 5vw, 76px);
  background: var(--surface);
}
.index-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--fg); }
.index-head h2 { margin: 0; font-size: 25px; line-height: 1.35; }
.index-head span { color: var(--muted); font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.hero-note { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 16px; align-items: center; min-height: 92px; border-bottom: 1px solid var(--border); transition: padding .18s ease, background .18s ease; }
.hero-note:hover { padding-inline: 10px; background: var(--bg); }
.note-index, .note-date { color: var(--muted); font-family: var(--font-mono); font-size: 10px; }
.hero-note strong { font-family: var(--font-display); font-size: clamp(18px, 1.7vw, 24px); font-weight: 600; line-height: 1.45; }
.all-notes-link { min-height: 48px; margin-top: 24px; display: inline-flex; align-items: center; gap: 12px; font-weight: 550; border-bottom: 1px solid var(--fg); }

.signal-strip { color: var(--bg); background: var(--fg); border-bottom: 1px solid var(--fg); }
.signal-row { min-height: 64px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; }
.signal-label, .signal-value { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.signal-value { color: color-mix(in oklch, var(--bg) 62%, transparent); }
.meters { height: 20px; display: flex; align-items: center; gap: 4px; overflow: hidden; }
.meter { width: 3px; height: var(--height); flex: 0 0 3px; background: color-mix(in oklch, var(--bg) 50%, transparent); }

.section { padding-block: clamp(84px, 10vw, 140px); border-bottom: 1px solid var(--fg); }
.section-head { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(18px, 3vw, 36px); margin-bottom: clamp(42px, 6vw, 74px); }
.section-number { grid-column: 1 / span 2; color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; }
.section-head h2 { grid-column: 3 / span 6; margin-bottom: 0; font-size: clamp(36px, 4.4vw, 60px); line-height: 1.36; }
.section-head p { grid-column: 10 / -1; align-self: end; margin: 0; color: var(--muted); font-size: 14px; }
.systems { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--fg); border-left: 1px solid var(--border); }
.system-card { min-height: 320px; padding: 26px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.system-card:hover { color: var(--bg); background: var(--fg); }
.system-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .07em; }
.system-card h3 { margin-bottom: 12px; font-size: clamp(25px, 2.4vw, 34px); line-height: 1.36; }
.system-card p { margin: 0; color: inherit; opacity: .68; font-size: 13px; }

.archive-tools { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; margin-bottom: 22px; }
.search-form { position: relative; max-width: 620px; }
.search-form svg { position: absolute; left: 0; top: 50%; transform: translateY(-50%); }
.search-form input { width: 100%; min-height: 52px; padding: 0 10px 0 36px; color: var(--fg); background: transparent; border: 0; border-bottom: 1px solid var(--fg); border-radius: 0; }
.search-form input::placeholder { color: var(--muted); }
.archive-count { color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; }
.archive-list { border-top: 1px solid var(--fg); }
.archive-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) 150px 110px 22px; gap: 20px; align-items: center; min-height: 94px; border-bottom: 1px solid var(--border); transition: background .18s ease, padding .18s ease; }
.archive-item:hover { padding-inline: 10px; background: var(--surface); }
.archive-id, .archive-date { color: var(--muted); font-family: var(--font-mono); font-size: 10px; }
.archive-title { font-family: var(--font-display); font-size: clamp(20px, 2vw, 27px); font-weight: 600; line-height: 1.45; }
.archive-category { color: var(--muted); font-size: 12px; }
.archive-arrow { font-size: 18px; }

.principle { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(18px, 3vw, 36px); padding-block: clamp(90px, 12vw, 170px); color: var(--bg); background: var(--fg); }
.principle-inner { grid-column: 2 / span 10; }
.principle .kicker { color: color-mix(in oklch, var(--bg) 55%, transparent); }
.principle blockquote { max-width: 18em; margin: 0 0 46px; font-family: var(--font-display); font-size: clamp(36px, 5vw, 68px); line-height: 1.4; }
.principle-foot { display: grid; grid-template-columns: 1fr auto; gap: 30px; padding-top: 24px; border-top: 1px solid color-mix(in oklch, var(--bg) 18%, transparent); }
.principle-foot p { max-width: 48em; margin: 0; color: color-mix(in oklch, var(--bg) 68%, transparent); }
.principle-foot span { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

.page-head { padding-block: clamp(72px, 9vw, 120px); border-bottom: 1px solid var(--fg); }
.page-head .kicker { margin-bottom: 20px; }
.page-title { max-width: 17em; margin-bottom: 18px; font-size: clamp(42px, 6vw, 78px); line-height: 1.34; }
.page-description { max-width: 48em; margin: 0; color: var(--muted); }
.content-layout { display: grid; grid-template-columns: minmax(0, 8fr) minmax(220px, 3fr); gap: clamp(40px, 7vw, 100px); padding-block: clamp(64px, 8vw, 110px); }
.article-content { min-width: 0; }
.article-content > * { max-width: 72ch; }
.article-content h2 { margin-top: 2.2em; font-size: clamp(28px, 3vw, 40px); line-height: 1.4; }
.article-content h3 { margin-top: 2em; font-size: 24px; line-height: 1.45; }
.article-content p, .article-content li { line-height: 1.85; }
.article-content a { text-decoration: underline; text-underline-offset: 3px; }
.article-content pre { max-width: 100%; padding: 20px; overflow: auto; color: var(--bg); background: var(--fg); font-family: var(--font-mono); font-size: 13px; }
.article-content code { font-family: var(--font-mono); }
.article-content blockquote { max-width: 64ch; margin: 2em 0; padding: 1.4em 0; border-block: 1px solid var(--fg); font-family: var(--font-display); font-size: 22px; }
.article-content table { width: 100%; border-collapse: collapse; }
.article-content th, .article-content td { padding: 12px; border: 1px solid var(--border); text-align: left; }
.article-aside { align-self: start; position: sticky; top: 100px; }
.meta-block { padding-block: 16px; border-top: 1px solid var(--fg); }
.meta-block:last-child { border-bottom: 1px solid var(--border); }
.meta-block span { display: block; color: var(--muted); font-family: var(--font-mono); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.meta-block strong { display: block; margin-top: 5px; font-size: 13px; font-weight: 550; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--fg); }
.post-nav a { min-height: 130px; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--border); }
.post-nav a:hover { background: var(--surface); }
.post-nav a:last-child { border-right: 0; text-align: right; }
.post-nav span { color: var(--muted); font-family: var(--font-mono); font-size: 10px; letter-spacing: .07em; }

.pagination { margin-top: 42px; display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers { min-width: 44px; min-height: 44px; display: grid; place-items: center; border: 1px solid var(--border); }
.pagination .current, .pagination a:hover { color: var(--bg); background: var(--fg); border-color: var(--fg); }
.not-found { min-height: 65vh; display: grid; place-items: center; text-align: center; }
.not-found .page-title { margin-inline: auto; }

footer { padding-block: 34px; }
.footer-row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.icp-link { min-height: 44px; display: inline-flex; align-items: center; border-bottom: 1px solid transparent; }
.icp-link:hover { color: var(--fg); border-bottom-color: var(--fg); }
.search-dialog { width: min(720px, calc(100% - 32px)); padding: 0; color: var(--fg); background: var(--bg); border: 1px solid var(--fg); box-shadow: 0 30px 90px color-mix(in oklch, var(--fg) 22%, transparent); }
.search-dialog::backdrop { background: color-mix(in oklch, var(--fg) 48%, transparent); backdrop-filter: blur(4px); }
.dialog-top { display: grid; grid-template-columns: 24px 1fr auto; gap: 14px; align-items: center; padding: 18px; border-bottom: 1px solid var(--border); }
.dialog-top input { min-height: 44px; color: var(--fg); background: transparent; border: 0; outline: 0; font-size: 18px; }
.dialog-close { min-width: 44px; min-height: 44px; color: var(--fg); background: var(--surface); border: 1px solid var(--border); cursor: pointer; }
.dialog-body { padding: 26px; }
.dialog-body p { margin-top: 0; color: var(--muted); }
.shortcuts { display: grid; border-top: 1px solid var(--fg); }
.shortcuts a { min-height: 56px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.shortcuts a:hover { padding-inline: 10px; background: var(--surface); }

@media (max-width: 980px) {
  .masthead-row { grid-template-columns: 1fr auto; }
  .main-nav { display: none; }
  .menu-toggle { display: inline-grid; }
  .hero { min-height: auto; }
  .hero-intro { grid-column: 1 / span 7; }
  .hero-index { grid-column: 8 / -1; }
  .archive-stats { grid-template-columns: 1fr; }
  .stat { display: flex; align-items: baseline; justify-content: space-between; }
  .section-head h2 { grid-column: 3 / -1; }
  .section-head p { grid-column: 3 / span 7; margin-top: 8px; }
  .systems { grid-template-columns: repeat(2, 1fr); }
  .system-card { min-height: 260px; }
  .archive-item { grid-template-columns: 52px minmax(0, 1fr) 120px 22px; }
  .archive-date { display: none; }
}

@media (max-width: 700px) {
  .wrap { padding-inline: 20px; }
  .hero { display: block; }
  .hero-intro, .hero-index { padding: 64px 20px; border-right: 0; }
  .hero-intro { min-height: calc(100svh - 68px); }
  .hero h1 { font-size: clamp(50px, 15vw, 68px); }
  .archive-stats { grid-template-columns: repeat(3, 1fr); margin-top: 48px; }
  .stat { display: block; padding: 12px; }
  .stat span { font-size: 10px; }
  .hero-index { border-top: 1px solid var(--fg); }
  .hero-note { grid-template-columns: 30px minmax(0, 1fr); min-height: 96px; }
  .note-date { display: none; }
  .signal-row { grid-template-columns: auto 1fr; }
  .signal-value { display: none; }
  .section { padding-block: 80px; }
  .section-head { display: block; margin-bottom: 42px; }
  .section-number { display: block; margin-bottom: 18px; }
  .section-head h2 { font-size: 39px; }
  .section-head p { margin-top: 18px; }
  .systems { display: block; border-left: 0; }
  .system-card { min-height: 220px; padding-inline: 20px; }
  .archive-tools { grid-template-columns: 1fr; }
  .archive-item { grid-template-columns: 34px minmax(0, 1fr) 20px; gap: 12px; min-height: 116px; }
  .archive-category { grid-column: 2; grid-row: 2; margin-top: -28px; }
  .archive-title { font-size: 21px; }
  .principle { display: block; padding: 84px 20px; }
  .principle-foot, .footer-row { grid-template-columns: 1fr; flex-direction: column; }
  .content-layout { grid-template-columns: 1fr; padding-block: 56px; }
  .article-aside { position: static; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav a, .post-nav a:last-child { border-right: 0; border-bottom: 1px solid var(--border); text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
