/*
Theme Name: Zhangxu Editorial
Theme URI: https://www.zhangxu.work/
Author: Zhang Xu
Author URI: https://www.zhangxu.work/
Description: 张旭个人站主题 · 编辑型风格 · 致敬 Electro-Voice 但个人化。衬线 display + Inter body + mono accents，EV Red 作 dot/divider，暖白底 + 深炭灰 footer。
Version: 1.0.0
License: MIT
License URI: https://opensource.org/licenses/MIT
Text Domain: zhangxu-editorial
Tags: blog, one-column, custom-menu, featured-images, rtl-language-support, threaded-comments, translation-ready
*/

:root {
  --ink: #0a0a0a;
  --paper: #fafaf7;
  --paper-2: #f2f1ec;
  --rule: #e5e3dc;
  --mute: #6a6a64;
  --mute-2: #9a9a92;
  --red: #ed1c24;
  --red-deep: #be161d;
  /* 字体：跨平台优雅降级
     ─ Mac/iOS → 苹方 + SF Pro
     ─ Windows → 微软雅黑 + Segoe UI
     ─ Android → 思源黑体 + Roboto
     ─ Linux   → 系统 sans-serif 兜底 */
  --serif: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', 'Source Han Sans CN', 'Helvetica Neue', Arial, sans-serif;
  --sans:  -apple-system, BlinkMacSystemFont, 'SF Pro Text',    'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', 'Source Han Sans CN', 'Helvetica Neue', Arial, sans-serif;
  --mono:  ui-monospace, 'SF Mono', 'Menlo', 'Monaco', Consolas, 'Liberation Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--red); color: #fff; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ═════════════════════ TOPBAR ═════════════════════ */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(250,250,247,.85);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto;
  padding: 18px 32px;
  display: flex; align-items: baseline; justify-content: space-between;
}
.brand {
  font-family: var(--serif);
  font-weight: 600; font-size: 19px;
  letter-spacing: -.01em;
}
.brand i { font-style: normal; color: var(--mute); font-weight: 400; }
.nav { display: flex; gap: 36px; font-size: 14px; color: var(--mute); list-style: none; }
.nav a { position: relative; padding-bottom: 2px; transition: color .15s; }
.nav a:hover { color: var(--ink); }
.nav a:hover::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--red);
}
.nav .current-menu-item a { color: var(--ink); }

/* ═════════════════════ HERO ═════════════════════ */
.hero {
  max-width: 1180px; margin: 0 auto;
  padding: 96px 32px 80px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 80px;
  align-items: end;
  border-bottom: 1px solid var(--rule);
}
.hero-meta {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 32px;
  display: flex; gap: 24px; align-items: center;
}
.hero-meta .dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--red);
  margin-right: 6px;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: .35; transform: scale(.85); }
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(64px, 8vw, 112px);
  line-height: .96;
  letter-spacing: -.025em;
  margin-bottom: 36px;
  text-wrap: pretty;
}
.hero h1 .you-are {
  display: block;
  font-size: .22em;
  font-family: var(--mono);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .28em;
  color: var(--mute-2);
  margin-bottom: 24px;
}
.hero h1 em {
  font-style: normal;
  color: var(--mute);
  font-weight: 400;
}
.hero-tag {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.45;
  color: var(--ink);
  max-width: 620px;
  margin-bottom: 48px;
}
.hero-tag .accent { color: var(--red); font-style: normal; }
.hero-cta { display: flex; gap: 14px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  font-size: 13px; font-weight: 500;
  letter-spacing: .02em;
  border: 1px solid var(--ink);
  border-radius: 0;
  transition: all .18s;
  cursor: pointer;
  font-family: var(--sans);
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--red); border-color: var(--red); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--ink); }

.hero-status {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mute);
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  align-items: center;
}
.hero-status .dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--red);
  margin-right: 8px;
  animation: pulse 2.4s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: .35; transform: scale(.85); }
}
.hero-status .sep { color: var(--mute-2); opacity: .5; }

/* ═════════════════════ SIGNAL TOWER ═════════════════════ */
.signal-tower {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--mute);
  border-left: 1px solid var(--rule);
  padding: 0 0 0 24px;
  position: relative;
  min-height: 280px;
}
.signal-tower::before {
  content: ''; position: absolute;
  left: -1px; top: 0; width: 1px; height: 40px;
  background: var(--red);
}
.signal-tower h4 {
  font-family: var(--mono);
  font-size: 10px; font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--ink);
  margin-bottom: 14px;
}
.signal-tower .row {
  display: flex; justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px dotted var(--rule);
}
.signal-tower .row:last-child { border-bottom: none; }
.signal-tower .k { color: var(--mute-2); }
.signal-tower .v { color: var(--ink); }

/* ═════════════════════ 通用 SECTION ═════════════════════ */
section.block {
  max-width: 1180px; margin: 0 auto;
  padding: 88px 32px;
  border-bottom: 1px solid var(--rule);
}
.block-head {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 56px;
  margin-bottom: 48px;
  align-items: baseline;
}
.block-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mute);
}
.block-num .red { color: var(--red); }
.block-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: -.015em;
}
.block-title em { font-style: normal; color: var(--mute); font-weight: 400; }

/* ═════════════════════ ABOUT ═════════════════════ */
.about-body {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 56px;
}
.about-body .side {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mute-2);
  line-height: 2;
}
.about-body .side .line {
  padding: 6px 0;
  border-bottom: 1px solid var(--paper-2);
}
.about-prose {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.68;
  max-width: 680px;
  color: #1a1a1a;
}
.about-prose p { margin-bottom: 28px; text-wrap: pretty; }
.about-prose p:last-child { margin-bottom: 0; }
.about-prose em { color: var(--mute); }
.about-prose strong { font-weight: 600; color: var(--red); }
.about-prose .placeholder {
  display: inline-block;
  color: var(--mute-2);
  font-family: var(--mono);
  font-size: 14px;
  font-style: normal;
  border-bottom: 1px dashed var(--mute-2);
  padding: 0 2px 1px;
}
.about-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: start;
}
.about-photo {
  width: 280px;
  flex-shrink: 0;
}
.about-photo img {
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  display: block;
}

/* ═════════════════════ WRITING / POST LIST ═════════════════════ */
.writing-list { display: flex; flex-direction: column; }
.post-row {
  display: grid;
  grid-template-columns: 160px 1fr 120px;
  gap: 56px;
  padding: 32px 0;
  border-top: 1px solid var(--rule);
  align-items: baseline;
  cursor: pointer;
  position: relative;
}
.post-row::before {
  content: '';
  position: absolute;
  left: 0; top: -1px; height: 1px;
  width: 0;
  background: var(--red);
  transition: width .3s ease;
}
.post-row:hover::before { width: 100%; }
.post-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--mute-2);
  text-transform: uppercase;
}
.post-meta .cat {
  display: inline-block;
  margin-right: 12px;
  color: var(--red);
  font-weight: 500;
}
.post-title-row {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.01em;
  text-wrap: pretty;
}
.post-title-row em { font-style: normal; color: var(--mute); font-weight: 400; }
.post-row:hover .post-title-row { color: var(--red); }
.post-date {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--mute-2);
  text-align: right;
}
.empty-hint {
  margin-top: 32px;
  font-family: var(--serif);
  font-style: normal;
  color: var(--mute);
  font-size: 16px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}

/* ═════════════════════ NOW ═════════════════════ */
.now-grid {
  display: grid;
  grid-template-columns: 160px 1fr 1fr 1fr;
  gap: 56px;
}
.now-col h5 {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .22em;
  color: var(--ink);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ink);
}
.now-col ul { list-style: none; }
.now-col li {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
  padding: 10px 0;
  color: #1a1a1a;
  border-bottom: 1px solid var(--paper-2);
}
.now-col li:last-child { border-bottom: none; }
.now-col li em {
  font-style: normal; color: var(--mute-2); font-size: 12px;
  display: block; margin-top: 2px;
  font-family: var(--mono); letter-spacing: .1em;
}
.now-col li .placeholder {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--mute-2);
  border-bottom: 1px dashed var(--mute-2);
  padding: 0 2px 1px;
}

/* ═════════════════════ SINGLE POST / PAGE 内容 ═════════════════════ */
.single-wrap, .page-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 96px 32px 64px;
}
.single-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 24px;
}
.single-meta .cat { color: var(--red); margin-right: 12px; font-weight: 500; }
.single-meta .sep { color: var(--mute-2); margin: 0 8px; }

.single-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -.02em;
  margin-bottom: 32px;
  text-wrap: pretty;
}
.single-title em { font-style: normal; color: var(--mute); font-weight: 400; }

.single-content {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.72;
  color: #1a1a1a;
}
.single-content p { margin-bottom: 22px; text-wrap: pretty; }
.single-content h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  margin: 56px 0 18px;
  letter-spacing: -.01em;
}
.single-content h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  margin: 40px 0 14px;
}
.single-content em { color: var(--mute); }
.single-content strong { color: var(--red); font-weight: 600; }
.single-content a { color: var(--red); border-bottom: 1px solid var(--rule); padding-bottom: 1px; }
.single-content a:hover { border-bottom-color: var(--red); }
.single-content blockquote {
  border-left: 2px solid var(--red);
  padding: 8px 0 8px 28px;
  margin: 32px 0;
  font-style: normal;
  color: var(--mute);
  font-size: 22px;
}
.single-content code {
  font-family: var(--mono);
  font-size: 14px;
  background: var(--paper-2);
  padding: 2px 6px;
  border-radius: 3px;
}
.single-content pre {
  background: #141413;
  color: var(--paper);
  padding: 24px;
  margin: 32px 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  border-left: 2px solid var(--red);
}
.single-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.single-content ul, .single-content ol {
  margin: 0 0 22px 28px;
}
.single-content li { margin-bottom: 6px; }
.single-content img {
  margin: 32px 0;
  border: 1px solid var(--rule);
}
.single-content hr {
  margin: 48px auto;
  width: 60px;
  border: 0; border-top: 1px solid var(--red);
}

.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--mute);
}
.post-nav a:hover { color: var(--red); }
.post-nav .label { color: var(--mute-2); display: block; margin-bottom: 4px; }

/* ═════════════════════ ARCHIVE ═════════════════════ */
.archive-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 96px 32px 64px;
}
.archive-head {
  margin-bottom: 64px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--rule);
}
.archive-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
}
.archive-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -.02em;
}

.pagination {
  margin: 64px 0 0;
  display: flex;
  gap: 16px;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.pagination a, .pagination span {
  padding: 8px 14px;
  border: 1px solid var(--rule);
  color: var(--mute);
}
.pagination a:hover { border-color: var(--ink); color: var(--ink); }
.pagination .current { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ═════════════════════ FOOTER ═════════════════════ */
footer.site-footer {
  background: #141413;
  color: var(--paper);
  padding: 96px 32px 32px;
  margin-top: 0;
}
.footer-inner {
  max-width: 1180px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 64px;
  padding-bottom: 64px;
  border-bottom: 1px solid #2a2a28;
}
.footer-block h6 {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .25em;
  color: #6e6e68;
  margin-bottom: 20px;
  padding-bottom: 8px;
  position: relative;
  border-bottom: 1px solid #2a2a28;
}
.footer-block h6::before {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 24px; height: 1px;
  background: var(--red);
}
.footer-block p, .footer-block a {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  color: var(--paper);
  display: block;
  padding: 4px 0;
}
.footer-block a { transition: color .15s; }
.footer-block a:hover { color: var(--red); }
.footer-block .placeholder {
  font-family: var(--mono);
  font-size: 13px;
  color: #6e6e68;
  border-bottom: 1px dashed #4a4a45;
  padding-bottom: 2px;
}
.footer-block .hint {
  font-family: var(--sans);
  font-size: 13px;
  color: #6e6e68;
  font-style: normal;
  margin-top: 8px;
  padding: 0;
}
.footer-bottom {
  max-width: 1180px; margin: 0 auto;
  padding-top: 32px;
  display: flex; justify-content: center;
  gap: 24px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #6e6e68;
}
.footer-bottom .red { color: var(--red); }
.footer-bottom .sep { opacity: .4; }

/* ═════════════════════ COMMENTS ═════════════════════ */
.comments-area {
  max-width: 760px;
  margin: 64px auto 0;
  padding: 0 32px 64px;
}
.comments-title {
  font-family: var(--serif);
  font-size: 28px;
  margin-bottom: 32px;
  font-weight: 500;
}
.comment-list { list-style: none; }
.comment {
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
}
.comment-author {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 8px;
}
.comment-author .cite { color: var(--ink); margin-right: 12px; }
.comment-content {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  color: #1a1a1a;
}

/* ═════════════════════ RESPONSIVE ═════════════════════ */
@media (max-width: 880px) {
  .hero { padding: 64px 24px 48px; grid-template-columns: 1fr; gap: 48px; }
  .about-content { grid-template-columns: 1fr; gap: 32px; }
  .about-photo { width: 100%; max-width: 400px; }
  .block-head, .about-body, .now-grid { grid-template-columns: 1fr; gap: 28px; }
  .post-row { grid-template-columns: 1fr; gap: 12px; }
  .post-date { text-align: left; }
  section.block { padding: 56px 24px; }
  .footer-inner { grid-template-columns: 1fr; gap: 36px; }
  .topbar-inner { padding: 14px 24px; }
  .nav { gap: 20px; flex-wrap: wrap; }
  .single-wrap, .page-wrap, .archive-wrap, .comments-area { padding: 56px 24px; }
  .single-title { font-size: clamp(36px, 8vw, 48px); }
  .footer-bottom { flex-direction: column; gap: 12px; }
}

/* ═════════════════════ WP-specific overrides ═════════════════════ */
.alignleft { float: left; margin: 8px 24px 8px 0; }
.alignright { float: right; margin: 8px 0 8px 24px; }
.aligncenter { display: block; margin: 16px auto; }
.wp-caption {
  max-width: 100%;
  margin: 16px 0;
}
.wp-caption-text {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  text-align: center;
  margin-top: 8px;
  letter-spacing: .05em;
}
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}
