/*
Theme Name: YangXuan
Theme URI: https://yangxuan.ai
Author: Yang Xuan
Author URI: https://yangxuan.ai
Description: Personal site theme for yangxuan.ai. Warm editorial style with bilingual support.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: MIT
Text Domain: yangxuan
*/

/* ═══════════════════════════════════
   Design Tokens
   ═══════════════════════════════════ */
:root {
  --bg: #FAF8F4;
  --card: #FFFFFF;
  --text: #2C2A26;
  --soft: #6D6960;
  --muted: #B5AFA5;
  --accent: #C45D3E;
  --accent-soft: #F3E8E2;
  --border: #ECEAE4;
  --border-l: #F3F1EC;
  --warm: #F5F2EB;
  --warm-d: #EDE8DF;
  --tag-invest: #C45D3E;
  --tag-invest-bg: #F3E8E2;
  --tag-ai: #3D7AB5;
  --tag-ai-bg: #E8F0F8;
  --tag-essay: #8B7355;
  --tag-essay-bg: #F0EBE3;
  --font-serif-cn: 'Noto Serif SC', Georgia, serif;
  --font-sans-cn: 'Noto Sans SC', -apple-system, 'PingFang SC', sans-serif;
  --font-display: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Crimson Pro', Georgia, serif;
  --font-mono: 'DM Mono', 'SF Mono', monospace;
  --max-w: 860px;
  --gap: 28px;
}

/* ═══════════════════════════════════
   Reset & Base
   ═══════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans-cn);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
strong { color: var(--text); font-weight: 600; }
ul, ol { list-style: none; }

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.screen-reader-text {
  clip: rect(1px,1px,1px,1px);
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
}

/* ═══════════════════════════════════
   Navigation
   ═══════════════════════════════════ */
.site-nav {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 244, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.nav-logo {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #2C2A26, #5A5549);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif-cn);
  font-size: 14px; color: var(--bg); font-weight: 700;
}

.nav-name {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600;
  color: var(--text); letter-spacing: 0.8px;
}

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-sans-cn);
  font-size: 13px; font-weight: 500;
  padding: 6px 11px; border-radius: 6px;
  color: var(--muted);
  transition: all 0.15s;
}

.nav-links a:hover,
.nav-links a.current {
  color: var(--text);
  background: var(--warm);
}

.nav-lang {
  margin-left: 10px !important;
  font-family: var(--font-display) !important;
  font-size: 11px !important; font-weight: 600 !important;
  padding: 4px 8px !important;
  border-radius: 5px !important;
  border: 1px solid var(--border) !important;
  color: var(--soft) !important;
  background: var(--card) !important;
}

/* ═══════════════════════════════════
   Hero (Homepage)
   ═══════════════════════════════════ */
.hero {
  padding: 52px 0 40px;
  max-width: 660px;
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.hero-photo {
  width: 68px; height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.hero h1 {
  font-family: var(--font-serif-cn);
  font-size: 30px; font-weight: 700; line-height: 1.2;
}

.hero-loc {
  font-family: var(--font-display);
  font-size: 12px; color: var(--muted); margin-top: 3px;
}

.hero-bio {
  font-size: 15px; color: var(--soft); line-height: 2;
}

.hero-bio p { margin-bottom: 10px; }

/* ═══════════════════════════════════
   Identity Cards
   ═══════════════════════════════════ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 22px;
}

.card-mini {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
}

.card-mini-icon { font-size: 15px; margin-bottom: 3px; }
.card-mini h4 { font-size: 12px; font-weight: 600; }
.card-mini p { font-size: 11px; color: var(--muted); margin: 0; }

/* ═══════════════════════════════════
   Sections
   ═══════════════════════════════════ */
.section {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

.section-eyebrow {
  font-family: var(--font-display);
  font-size: 11px; font-weight: 600;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px;
}

.section-title {
  font-family: var(--font-serif-cn);
  font-size: 20px; font-weight: 600; margin-bottom: 4px;
}

.section-desc {
  font-size: 13px; color: var(--muted); margin-bottom: 16px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.view-all {
  font-family: var(--font-display);
  font-size: 12px; color: var(--accent); font-weight: 500;
}

.view-all:hover { text-decoration: underline; }

/* ═══════════════════════════════════
   Featured Cards
   ═══════════════════════════════════ */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.featured-card {
  padding: 18px; border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  transition: border-color 0.15s;
}

.featured-card:hover { border-color: var(--muted); }

.featured-card .eyebrow {
  font-family: var(--font-display);
  font-size: 10px; font-weight: 500;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 6px;
}

.featured-card h3 {
  font-family: var(--font-serif-cn);
  font-size: 15px; font-weight: 600;
  line-height: 1.5; margin-bottom: 6px;
}

.featured-card p {
  font-size: 12px; color: var(--soft); line-height: 1.6;
}

/* ═══════════════════════════════════
   Post List Items
   ═══════════════════════════════════ */
.post-item {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-l);
  transition: padding-left 0.15s;
}

.post-item:hover { padding-left: 4px; }

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.post-date {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--muted);
}

.post-tag {
  font-size: 10px; padding: 2px 7px;
  border-radius: 3px; font-weight: 500;
  display: inline-block;
}

.tag-投资, .tag-investing { background: var(--tag-invest-bg); color: var(--tag-invest); }
.tag-ai, .tag-AI { background: var(--tag-ai-bg); color: var(--tag-ai); }
.tag-随笔, .tag-essay, .tag-essays { background: var(--tag-essay-bg); color: var(--tag-essay); }

.post-title {
  font-family: var(--font-serif-cn);
  font-size: 15px; font-weight: 600;
  line-height: 1.5; margin-bottom: 2px;
}

.post-en {
  font-family: var(--font-body);
  font-size: 13px; font-style: italic; color: var(--muted);
}

.post-summary {
  font-size: 12px; color: var(--soft); line-height: 1.5; margin-top: 3px;
}

/* Post Card (archive page) */
.post-card {
  display: block;
  padding: 18px 20px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card);
  margin-bottom: 8px;
  transition: border-color 0.15s;
}

.post-card:hover { border-color: var(--muted); }
.post-card .post-title { font-size: 16px; margin-top: 4px; }

/* ═══════════════════════════════════
   Now Box
   ═══════════════════════════════════ */
.now-box {
  background: var(--warm);
  border-radius: 10px;
  padding: 18px 22px;
  border: 1px solid var(--border);
}

.now-title {
  font-size: 13px; font-weight: 600;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}

.now-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #6DBE6D;
  display: inline-block;
}

.now-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.now-item {
  font-size: 12px; color: var(--soft);
  padding: 7px 10px;
  background: rgba(255,255,255,0.6);
  border-radius: 6px; line-height: 1.5;
}

/* ═══════════════════════════════════
   Subscribe
   ═══════════════════════════════════ */
.subscribe-box {
  padding: 24px 28px; border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  text-align: center;
  margin: 28px 0;
}

.subscribe-box h3 {
  font-family: var(--font-serif-cn);
  font-size: 15px; font-weight: 600; margin-bottom: 3px;
}

.subscribe-box > p {
  font-family: var(--font-body);
  font-size: 13px; font-style: italic;
  color: var(--muted); margin-bottom: 12px;
}

.subscribe-form {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.subscribe-input {
  padding: 9px 14px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--bg);
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text); width: 220px; outline: none;
}

.subscribe-input:focus { border-color: var(--accent); }

.subscribe-btn {
  padding: 9px 20px; border-radius: 7px; border: none;
  background: var(--text); color: var(--bg);
  font-family: var(--font-display);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: opacity 0.15s;
}

.subscribe-btn:hover { opacity: 0.85; }

/* ═══════════════════════════════════
   Article Single
   ═══════════════════════════════════ */
.article-single {
  padding: 44px 0 56px;
  max-width: 660px;
}

.article-back {
  font-family: var(--font-display);
  font-size: 12px; color: var(--accent);
  font-weight: 500;
  display: inline-block; margin-bottom: 20px;
}

.article-back:hover { text-decoration: underline; }

.article-single > h1 {
  font-family: var(--font-serif-cn);
  font-size: 26px; font-weight: 700;
  line-height: 1.4; margin-bottom: 6px;
}

.article-subtitle {
  font-family: var(--font-body);
  font-size: 15px; font-style: italic;
  color: var(--muted); margin-bottom: 28px;
}

/* Article content */
.article-content { font-size: 15px; color: var(--soft); line-height: 2.2; }
.article-content p { margin-bottom: 16px; }
.article-content h2 {
  font-family: var(--font-serif-cn);
  font-size: 20px; font-weight: 600;
  color: var(--text); margin: 32px 0 12px;
}
.article-content h3 {
  font-family: var(--font-serif-cn);
  font-size: 17px; font-weight: 600;
  color: var(--text); margin: 24px 0 8px;
}
.article-content blockquote {
  padding: 16px 20px;
  background: var(--warm); border-radius: 8px;
  border-left: 3px solid var(--accent);
  font-size: 14px; line-height: 1.8;
  margin: 20px 0; color: var(--text);
}
.article-content blockquote p:last-child { margin-bottom: 0; }
.article-content code {
  font-family: var(--font-mono); font-size: 13px;
  background: var(--warm); padding: 2px 6px; border-radius: 4px;
}
.article-content pre {
  background: #2C2A26; color: #E8E8E0;
  padding: 20px; border-radius: 10px;
  overflow-x: auto; margin: 16px 0;
  font-size: 13px; line-height: 1.6;
}
.article-content pre code { background: none; padding: 0; color: inherit; }
.article-content img { border-radius: 8px; margin: 16px 0; }
.article-content ul, .article-content ol { padding-left: 24px; margin-bottom: 16px; list-style: revert; }
.article-content li { margin-bottom: 4px; }
.article-content a { color: var(--accent); }
.article-content a:hover { text-decoration: underline; }

.article-author {
  margin-top: 36px; padding: 20px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--warm);
  display: flex; gap: 14px; align-items: center;
}
.article-author img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.article-author-name { font-size: 14px; font-weight: 600; }
.article-author-desc { font-size: 12px; color: var(--muted); }

/* ═══════════════════════════════════
   Page Content (About, Books, Links)
   ═══════════════════════════════════ */
.page-content {
  padding: 40px 0 56px;
  max-width: 660px;
}

.page-content h1 {
  font-family: var(--font-serif-cn);
  font-size: 22px; font-weight: 600;
  margin-bottom: 24px;
}

/* Books */
.book-card {
  padding: 24px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card);
  margin-bottom: 10px;
  display: flex; gap: 20px;
}
.book-cover {
  width: 68px; min-height: 94px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 3px 5px 20px rgba(0,0,0,0.06);
  color: #fff; font-family: var(--font-serif-cn);
  font-size: 11px; font-weight: 700;
  text-align: center; padding: 6px; line-height: 1.3;
}
.book-status {
  font-size: 10px; padding: 1px 7px;
  border-radius: 3px; font-weight: 500;
  display: inline-block; margin-left: 8px;
}
.book-en { font-family: var(--font-body); font-size: 13px; font-style: italic; color: var(--muted); }
.book-pub { font-size: 11px; color: var(--muted); }
.book-desc { font-size: 13px; color: var(--soft); line-height: 1.7; margin-top: 4px; }

/* Links */
.links-group { margin-bottom: 24px; }
.links-group h3 {
  font-size: 13px; font-weight: 600;
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.links-group h3::before {
  content: ''; width: 3px; height: 13px;
  border-radius: 2px; background: var(--accent);
}
.links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.link-card {
  display: block; padding: 12px 16px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card);
  transition: border-color 0.15s;
}
.link-card:hover { border-color: var(--muted); }
.link-card h4 { font-size: 13px; font-weight: 600; color: var(--text); }
.link-card p { font-size: 12px; color: var(--muted); margin: 0; }

/* About specifics */
.about-bio { font-size: 15px; color: var(--soft); line-height: 2.2; }
.about-bio p { margin-bottom: 12px; }
.about-en {
  border-left: 2px solid var(--border);
  padding-left: 18px; margin-top: 16px;
  font-family: var(--font-body); font-style: italic;
  color: var(--muted); font-size: 14px; line-height: 1.8;
}
.principles {
  background: var(--card); border-radius: 10px;
  padding: 20px 24px; margin-top: 28px;
  border: 1px solid var(--border);
}
.principle-item {
  display: flex; gap: 8px; margin-bottom: 6px;
  font-size: 13px; color: var(--soft); line-height: 1.7;
}
.principle-dot { color: var(--accent); margin-top: 2px; }

.timeline { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.timeline-item { display: flex; gap: 12px; margin-bottom: 14px; }
.timeline-year {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--accent); min-width: 48px;
}
.timeline-dot {
  width: 6px; height: 6px; border-radius: 50%;
  border: 2px solid var(--border);
  margin-top: 6px; flex-shrink: 0;
}
.timeline-text { font-size: 13px; color: var(--soft); line-height: 1.5; }

/* ═══════════════════════════════════
   Footer
   ═══════════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--warm);
  margin-top: 20px;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 28px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.contact-card {
  display: flex; align-items: center;
  gap: 8px; padding: 9px 12px;
  border-radius: 7px;
  background: var(--card);
  border: 1px solid var(--border);
  transition: border-color 0.15s;
}

.contact-card:hover { border-color: var(--muted); }

.contact-icon {
  font-size: 14px; width: 24px; height: 24px;
  border-radius: 5px; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.contact-platform { font-size: 10px; color: var(--muted); }
.contact-handle {
  font-family: var(--font-display);
  font-size: 12px; color: var(--text); font-weight: 500;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap; gap: 6px;
}

.footer-copy {
  font-family: var(--font-display);
  font-size: 11px; color: var(--muted);
}

.footer-built {
  font-family: var(--font-body);
  font-size: 11px; font-style: italic;
  color: var(--muted);
}

/* ═══════════════════════════════════
   Archive page filters
   ═══════════════════════════════════ */
.filters {
  display: flex; gap: 5px;
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.filter-btn {
  padding: 5px 14px; border-radius: 18px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--card);
  font-family: var(--font-sans-cn);
  font-size: 12px; font-weight: 500;
  color: var(--soft);
  text-decoration: none;
  transition: all 0.15s;
}

.filter-btn:hover { border-color: var(--muted); }
.filter-btn.active {
  background: var(--text); color: var(--bg);
  border-color: var(--text);
}

/* ═══════════════════════════════════
   Responsive
   ═══════════════════════════════════ */
@media (max-width: 700px) {
  :root { --gap: 16px; }

  .nav-name { display: none; }
  .nav-links a { font-size: 12px; padding: 5px 7px; }
  .nav-lang { margin-left: 4px !important; }

  .hero { padding: 36px 0 32px; }
  .hero-photo { width: 56px; height: 56px; }
  .hero h1 { font-size: 26px; }
  .hero-bio { font-size: 14px; }
  .hero-top { gap: 14px; }

  .cards-grid { grid-template-columns: 1fr 1fr; }
  .featured-grid { grid-template-columns: 1fr; }
  .now-grid { grid-template-columns: 1fr; }
  .links-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr 1fr; }

  .subscribe-input, .subscribe-btn { width: 100%; }

  .article-single > h1 { font-size: 22px; }
  .article-content { font-size: 14px; }

  .book-card { gap: 14px; }
  .book-cover { width: 52px; min-height: 70px; }

  .footer-inner { padding: 24px var(--gap); }
}
