/*
Theme Name: Youwen
Theme URI: https://youwen.sotawork.com/
Author: Youwen Editorial
Author URI: https://youwen.sotawork.com/about/
Description: 有闻 —— 每天值得知道的新闻与生活资源。轻量、语义化、面向搜索引擎与 AI 引用的 WordPress 主题。
Version: 1.1.4
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: youwen
Tags: news, blog, custom-menu, featured-images, translation-ready
*/

:root {
  --paper: #fbfaf7;
  --paper-strong: #f3efe7;
  --ink: #1b1a17;
  --ink-soft: #34312b;
  --muted: #6d685e;
  --line: #e4ddd1;
  --accent: #b23a2f;
  --accent-dark: #8d2a22;
  --jade: #2f5d50;
  --gold: #a97a3f;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --shadow: 0 16px 40px rgba(35, 30, 22, .08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

::selection { background: var(--accent); color: #fff; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1, h2 { text-wrap: balance; }
.entry-content p, .card-title { text-wrap: pretty; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: .01em;
}

p { margin: 0 0 1.1em; }

.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed; top: 12px; left: 12px; z-index: 999;
  width: auto; height: auto; clip: auto;
  padding: 10px 16px; background: var(--ink); color: #fff;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 250, 247, .94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex; align-items: center; gap: 32px;
  min-height: 82px;
}

.brand { flex: 0 0 auto; }
.brand-name {
  display: inline-block;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.1;
}
.brand-name:hover { color: var(--accent); }
.brand-tagline {
  margin: 4px 0 0;
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
}

.primary-nav { margin-left: auto; }
.primary-nav ul {
  display: flex; flex-wrap: wrap; gap: 22px;
  margin: 0; padding: 0; list-style: none;
}
.primary-nav a {
  color: var(--ink-soft);
  font-size: 14px;
  letter-spacing: .04em;
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.search-form { display: flex; gap: 0; flex: 0 0 auto; }
.search-form input[type="search"] {
  width: 150px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-right: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  outline: none;
}
.search-form input[type="search"]:focus { border-color: var(--accent); }
.search-form button {
  padding: 8px 14px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.search-form button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* Main */
.site-main { min-height: 60vh; }

.section { padding: 54px 0; border-top: 1px solid var(--line); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 26px;
}
.section-head h2 { margin: 0; font-size: 28px; }
.section-head .more { font-size: 13px; color: var(--muted); text-decoration: none; }
.section-head .more:hover { color: var(--accent); }

.kicker {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--accent);
  text-transform: uppercase;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 52px;
  align-items: center;
  padding: 66px 0 56px;
}
.hero-copy h1 {
  margin: 0 0 20px;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.14;
  letter-spacing: .02em;
}
.hero-copy .lead {
  max-width: 34em;
  font-size: 17px;
  color: var(--ink-soft);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.btn {
  display: inline-block;
  padding: 11px 18px;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
  letter-spacing: .04em;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}
.card-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-link { display: block; color: inherit; text-decoration: none; }

.card-cover {
  position: relative;
  min-height: 150px;
  background: linear-gradient(135deg, #2f3a45, #111820);
  overflow: hidden;
}
.card-cover.has-image { background-size: cover; background-position: center; }
.card-cover::after {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: .5;
}
.card-cover span {
  position: absolute; left: 16px; bottom: 14px;
  z-index: 1;
  color: #fff;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.cat-news .card-cover { background: linear-gradient(135deg, #2f3a45, #111820); }
.cat-travel .card-cover { background: linear-gradient(135deg, #2f5d50, #8fb39f); }
.cat-goods .card-cover { background: linear-gradient(135deg, #8c5a2b, #d9b47a); }
.cat-resources .card-cover { background: linear-gradient(135deg, #2f4f7a, #7aa0c8); }
.cat-industry .card-cover { background: linear-gradient(135deg, #5b3a5e, #a67fa8); }
.cat-culture .card-cover { background: linear-gradient(135deg, #7a2f2a, #c78a6a); }

.card-body { padding: 18px 18px 20px; }
.card-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--muted);
}
.card-title { margin: 0 0 10px; font-size: 20px; line-height: 1.4; }
.card-excerpt { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.7; }

.card.large .card-cover { min-height: 300px; }
.card.large .card-title { font-size: 30px; }
.card.large .card-body { padding: 24px; }

/* Hero lead */
.hero-lead { display: block; background: #fff; border: 1px solid var(--line); text-decoration: none; color: inherit; }
.hero-lead:hover { box-shadow: var(--shadow); }
.hero-lead .card-cover { min-height: 300px; }
.hero-lead .card-body { padding: 24px 26px 28px; }
.hero-lead h2 { margin: 0 0 10px; font-size: 28px; line-height: 1.35; }
.hero-lead p { margin: 0; color: var(--muted); font-size: 14px; }

/* Archive */
.archive-head { padding: 56px 0 30px; border-bottom: 1px solid var(--line); }
.archive-head h1 { margin: 0 0 12px; font-size: clamp(32px, 4vw, 46px); }
.archive-head p { max-width: 46em; margin: 0; color: var(--muted); }
.archive-list { padding: 40px 0 64px; }

/* Single */
.article { padding: 46px 0 72px; }
.article-inner { max-width: 780px; margin: 0 auto; }
.breadcrumb { margin-bottom: 26px; font-size: 12px; color: var(--muted); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 8px; }

.article-header { margin-bottom: 34px; }
.article-category {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: .16em;
  text-decoration: none;
  text-transform: uppercase;
}
.article-title { margin: 0 0 18px; font-size: clamp(34px, 5vw, 48px); line-height: 1.25; }
.article-dek { margin: 0 0 20px; font-size: 18px; color: var(--ink-soft); }
.article-meta {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.entry-content { font-size: 18px; line-height: 1.95; color: var(--ink-soft); }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2 { margin: 2.2em 0 .7em; font-size: 29px; color: var(--ink); }
.entry-content h3 { margin: 1.8em 0 .6em; font-size: 22px; color: var(--ink); }
.entry-content h4 { margin: 1.5em 0 .5em; font-size: 18px; color: var(--ink); }
.entry-content p { margin: 0 0 1.25em; }
.entry-content a { color: var(--accent-dark); }
.entry-content ul, .entry-content ol { margin: 0 0 1.3em; padding-left: 1.4em; }
.entry-content li { margin-bottom: .5em; }
.entry-content blockquote {
  margin: 1.8em 0;
  padding: 6px 0 6px 22px;
  border-left: 3px solid var(--accent);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
}
.entry-content table {
  width: 100%;
  margin: 1.8em 0;
  border-collapse: collapse;
  font-size: 14px;
}
.entry-content th, .entry-content td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.entry-content th { background: var(--paper-strong); font-weight: 600; }

@media (max-width: 700px) {
  .entry-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
.entry-content code {
  padding: 2px 5px;
  background: var(--paper-strong);
  font-size: .88em;
}
.entry-content pre {
  padding: 18px;
  overflow-x: auto;
  background: #201f1b;
  color: #f1ede5;
  font-size: 14px;
}
.entry-content img { margin: 1.8em 0; }
.entry-content figcaption { margin-top: -1em; color: var(--muted); font-size: 12px; text-align: center; }

.faq-block { margin: 46px 0 0; padding-top: 30px; border-top: 1px solid var(--line); }
.faq-block h2 { margin: 0 0 18px; font-size: 26px; }
.faq-block details {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.faq-block summary {
  cursor: pointer;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  list-style: none;
}
.faq-block summary::-webkit-details-marker { display: none; }
.faq-block summary::before { content: "Q "; color: var(--accent); font-family: var(--sans); font-size: 12px; letter-spacing: .1em; }
.faq-answer { padding: 10px 0 0 20px; color: var(--muted); font-size: 15px; }

.sources { margin: 40px 0 0; padding: 22px 24px; background: var(--paper-strong); border: 1px solid var(--line); }
.sources h2 { margin: 0 0 12px; font-size: 18px; }
.sources ol { margin: 0; padding-left: 1.3em; font-size: 13px; }
.sources li { margin-bottom: 6px; }
.sources a { word-break: break-all; }

.article-footer { margin-top: 46px; padding-top: 24px; border-top: 1px solid var(--line); }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.article-tags a {
  padding: 4px 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}
.article-tags a:hover { border-color: var(--accent); color: var(--accent); }
.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 26px; }
.article-nav a { display: block; padding: 16px 18px; border: 1px solid var(--line); text-decoration: none; }
.article-nav a:hover { border-color: var(--accent); }
.article-nav .label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.article-nav .title { color: var(--ink); font-family: var(--serif); font-size: 16px; }

.related { margin-top: 54px; }

/* Page */
.page-article { padding: 54px 0 72px; }
.page-article .article-inner { max-width: 820px; }

/* Pagination */
.pagination { margin-top: 44px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination .page-numbers {
  display: inline-block;
  padding: 8px 13px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  text-decoration: none;
}
.pagination .page-numbers:hover, .pagination .current {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

/* Footer */
.site-footer { margin-top: 30px; background: #1c1b18; color: #cfc9be; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  padding: 54px 0 38px;
}
.footer-brand { margin: 0 0 10px; color: #fff; font-family: var(--serif); font-size: 30px; letter-spacing: .12em; }
.footer-meta { font-size: 12px; color: #928c80; }
.footer-grid h2 { margin: 0 0 14px; color: #fff; font-family: var(--sans); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.footer-grid ul { margin: 0; padding: 0; list-style: none; }
.footer-grid li { margin-bottom: 9px; font-size: 13px; }
.footer-grid a { color: #cfc9be; text-decoration: none; }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding: 18px 0 24px;
  border-top: 1px solid #33312c;
  color: #928c80;
  font-size: 12px;
}
.footer-bottom p { margin: 0; }
.footer-bottom a { color: #cfc9be; text-decoration: none; }
.footer-bottom a:hover { color: #fff; }
.footer-sep { margin: 0 4px; color: #57534b; }

/* Search results */
.search-head { padding: 54px 0 26px; border-bottom: 1px solid var(--line); }
.search-head h1 { margin: 0 0 8px; font-size: 38px; }
.search-head p { margin: 0; color: var(--muted); }
.search-list { padding: 40px 0 64px; }

/* Empty state */
.empty-state { padding: 60px 0; text-align: center; color: var(--muted); }
.empty-state h2 { color: var(--ink); }
.empty-state .search-form { max-width: 420px; margin: 22px auto 26px; }
.empty-state .search-form input[type="search"] { flex: 1; width: auto; }

/* Responsive */
@media (max-width: 1000px) {
  .header-inner { flex-wrap: wrap; gap: 14px 24px; padding: 14px 0; }
  .primary-nav { order: 3; width: 100%; margin-left: 0; }
  .primary-nav ul { gap: 18px; }
  .search-form { margin-left: auto; }
  .hero { grid-template-columns: 1fr; gap: 34px; padding: 44px 0; }
  .hero-copy h1 { font-size: clamp(34px, 8vw, 48px); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .brand-name { font-size: 28px; }
  .brand-tagline { font-size: 10px; }
  .search-form { width: 100%; }
  .search-form input[type="search"] { flex: 1; width: auto; }
  .card-grid, .card-grid.two { grid-template-columns: 1fr; }
  .card.large .card-cover, .hero-lead .card-cover { min-height: 220px; }
  .article { padding-top: 30px; }
  .entry-content { font-size: 17px; }
  .article-nav { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; padding: 40px 0 30px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
