/* 贯日翻译博客 · TranslationChina Blog — editorial stylesheet
   Brand tokens shared with the /m/ landing site. */

:root {
  --bg: #F5F1EC;
  --bg-soft: #FBF8F4;
  --card: #FFFFFF;
  --ink: #111827;
  --ink-soft: #374151;
  --muted: #6B7280;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --rust: #C94B16;
  --border: #E5DED4;
  --shadow: 0 10px 30px rgba(17, 24, 39, .07);
  --shadow-lg: 0 24px 60px rgba(17, 24, 39, .12);
  --radius: 18px;
  --font-display: "Fraunces", "Songti SC", "STSong", "Noto Serif SC", "SimSun", Georgia, serif;
  --font-sans: "Manrope", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; height: auto; }
::selection { background: rgba(37, 99, 235, .18); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(245, 241, 236, .86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand .brand-cn { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: .02em; }
.brand .brand-en {
  font-size: 11px; font-weight: 700; letter-spacing: .22em;
  text-transform: uppercase; color: var(--rust);
}
.site-nav { display: flex; align-items: center; gap: 22px; font-size: 14px; font-weight: 600; }
.site-nav a { color: var(--ink-soft); }
.site-nav a:hover { color: var(--accent); }
.nav-cta {
  background: var(--ink); color: #fff !important;
  padding: 9px 18px; border-radius: 999px; box-shadow: var(--shadow);
  transition: transform .15s ease, background .15s ease;
}
.nav-cta:hover { background: var(--accent-dark); transform: translateY(-1px); }
.lang-switch {
  display: inline-flex; border: 1px solid var(--border); border-radius: 999px;
  overflow: hidden; font-size: 12px; font-weight: 700; background: var(--card);
}
.lang-switch a, .lang-switch span { padding: 5px 12px; color: var(--muted); }
.lang-switch .on { background: var(--ink); color: #fff; }
@media (max-width: 720px) {
  .site-nav .nav-link { display: none; }
  .brand .brand-en { display: none; }
}

/* ---------- index hero ---------- */
.hero { padding: 56px 0 40px; }
.kicker {
  font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  color: var(--rust); margin: 0 0 14px;
}
.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center;
}
.hero h1, .hero .hero-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(32px, 4.6vw, 52px); line-height: 1.18; margin: 0 0 18px;
  letter-spacing: .01em;
}
.hero .hero-title a { color: var(--ink); }
.hero .hero-title a:hover { color: var(--accent-dark); }
.hero-summary { font-size: 17px; color: var(--ink-soft); margin: 0 0 22px; max-width: 34em; }
.hero-cover {
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg);
  aspect-ratio: 1200 / 630; background: var(--card);
}
.hero-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 860px) {
  .hero { padding: 36px 0 24px; }
  .hero-grid { grid-template-columns: 1fr; gap: 26px; }
}

/* ---------- meta / byline ---------- */
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.byline .dot::before { content: "·"; margin: 0 2px; }
.byline .author { font-weight: 700; color: var(--ink-soft); }
.byline .brand-dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--rust));
  color: #fff; font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
/* invisible view counter — same colour as page background, revealed on text selection */
.views { color: var(--bg); }
.views::selection { color: var(--ink); background: #FFE9A8; }
.byline-card .views { color: var(--card); }
.byline-card .views::selection { color: var(--ink); background: #FFE9A8; }

/* ---------- tag chips ---------- */
.tags-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 0 34px; }
.tag-chip {
  font-size: 13px; font-weight: 700; color: var(--ink-soft);
  background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 14px; transition: all .15s ease;
}
.tag-chip:hover { border-color: var(--accent); color: var(--accent); }
.tag-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- article cards ---------- */
.section-title {
  font-family: var(--font-display); font-size: 24px; font-weight: 600;
  margin: 8px 0 22px; display: flex; align-items: center; gap: 14px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; padding-bottom: 26px; }
@media (max-width: 960px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .card-grid { grid-template-columns: 1fr; } }
.post-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.post-card .card-cover { aspect-ratio: 1200 / 630; background: var(--bg-soft); overflow: hidden; }
.post-card .card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card .card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card .card-kicker { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--rust); }
.post-card h3 { font-family: var(--font-display); font-size: 19px; line-height: 1.4; margin: 0; font-weight: 600; }
.post-card h3 a { color: var(--ink); }
.post-card h3 a:hover { color: var(--accent-dark); }
.post-card .card-summary {
  font-size: 14px; color: var(--muted); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card .card-meta { margin-top: auto; font-size: 12.5px; color: var(--muted); }

/* ---------- pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 10px; padding: 10px 0 56px; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid var(--border); background: var(--card);
  font-size: 14px; font-weight: 700; color: var(--ink-soft);
}
.pagination .on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- article page ---------- */
.article-shell { display: grid; grid-template-columns: minmax(0, 720px) 300px; gap: 56px; justify-content: center; padding: 44px 0 30px; }
@media (max-width: 1060px) { .article-shell { grid-template-columns: minmax(0, 720px); } .article-aside { display: none; } }
.breadcrumbs { font-size: 13px; color: var(--muted); padding-top: 26px; max-width: 1076px; margin: 0 auto; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 7px; color: var(--border); }

.article-head h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(30px, 4.2vw, 44px); line-height: 1.22; margin: 10px 0 16px;
}
.article-lead { font-size: 18px; line-height: 1.75; color: var(--ink-soft); margin: 0 0 20px; }
.article-head .byline { padding-bottom: 22px; border-bottom: 1px solid var(--border); margin-bottom: 26px; }
.article-cover { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 34px; }
.article-cover img { display: block; width: 100%; }

/* prose */
.prose { font-size: 16.5px; line-height: 1.95; color: var(--ink-soft); }
.prose > :first-child { margin-top: 0; }
.prose h2 {
  font-family: var(--font-display); color: var(--ink); font-weight: 600;
  font-size: 26px; line-height: 1.35; margin: 2.2em 0 .8em; padding-top: .3em;
}
.prose h2::before {
  content: ""; display: block; width: 44px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--rust), var(--accent)); margin-bottom: 14px;
}
.prose h3 { font-family: var(--font-display); color: var(--ink); font-size: 20px; margin: 1.8em 0 .6em; font-weight: 600; }
.prose p { margin: 0 0 1.25em; }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.25em; }
.prose li { margin-bottom: .45em; }
.prose blockquote {
  margin: 1.6em 0; padding: 16px 22px;
  background: var(--bg-soft); border-left: 4px solid var(--rust);
  border-radius: 0 12px 12px 0; color: var(--ink-soft);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img { border-radius: 14px; box-shadow: var(--shadow); margin: 1.4em 0; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2.4em 0; }
.prose code {
  background: #EFEAE2; border-radius: 6px; padding: 2px 7px;
  font-size: .9em; color: var(--rust);
}
.prose pre { background: var(--ink); color: #F3F4F6; border-radius: 14px; padding: 18px 22px; overflow-x: auto; }
.prose pre code { background: none; color: inherit; padding: 0; }
.prose .table-wrap {
  margin: 1.6em 0; background: var(--card); border-radius: 14px;
  box-shadow: var(--shadow); overflow-x: auto;
}
.prose table {
  width: 100%; border-collapse: collapse; font-size: 14.5px;
}
.prose table thead th {
  background: var(--ink); color: #fff; text-align: left;
  padding: 11px 16px; font-weight: 700; white-space: nowrap;
}
.prose table td { padding: 10px 16px; border-top: 1px solid var(--border); }
.prose table tbody tr:nth-child(even) { background: var(--bg-soft); }

/* aside: TOC + CTA */
.article-aside { position: relative; }
.aside-sticky { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 22px; }
.toc-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; font-size: 13.5px;
}
.toc-card .toc-title {
  font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 10px;
}
.toc-card ul { list-style: none; margin: 0; padding: 0; }
.toc-card ul ul { padding-left: 14px; }
.toc-card li { margin: 0; }
.toc-card a {
  display: block; padding: 5px 0; color: var(--ink-soft); line-height: 1.45;
  border-left: 2px solid transparent; padding-left: 10px; margin-left: -10px;
}
.toc-card a:hover { color: var(--accent); border-left-color: var(--accent); }
details.toc-mobile { display: none; }
@media (max-width: 1060px) {
  details.toc-mobile {
    display: block; background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 12px 18px; margin-bottom: 26px; font-size: 14px;
  }
  details.toc-mobile summary { font-weight: 700; cursor: pointer; color: var(--ink); }
  details.toc-mobile ul { list-style: none; padding: 8px 0 0 4px; margin: 0; }
  details.toc-mobile ul ul { padding-left: 14px; }
  details.toc-mobile a { display: block; padding: 4px 0; color: var(--ink-soft); }
}

/* CTA card */
.cta-card {
  background: linear-gradient(150deg, #10203f 0%, #1d3a75 55%, #1d4ed8 100%);
  color: #E5EAF5; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-lg);
}
.cta-card .cta-kicker { font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: #F5C6A5; margin: 0 0 10px; }
.cta-card h4 { font-family: var(--font-display); color: #fff; font-size: 19px; margin: 0 0 8px; line-height: 1.4; font-weight: 600; }
.cta-card p { font-size: 13.5px; line-height: 1.7; margin: 0 0 16px; color: #C7D2E8; }
.cta-card .cta-btn {
  display: inline-block; background: #fff; color: var(--ink); font-weight: 800; font-size: 14px;
  padding: 10px 20px; border-radius: 999px; transition: transform .15s ease;
}
.cta-card .cta-btn:hover { transform: translateY(-1px); color: var(--accent-dark); }
.cta-inline { margin: 2.6em 0; }

/* article footer: tags, prev/next, related */
.article-tags { display: flex; flex-wrap: wrap; gap: 10px; padding: 30px 0 6px; }
.pn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 26px 0; }
@media (max-width: 640px) { .pn-row { grid-template-columns: 1fr; } }
.pn-link {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 18px; font-size: 14px; color: var(--ink-soft); display: block;
}
.pn-link:hover { border-color: var(--accent); }
.pn-link .pn-label { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 4px; }
.pn-link.next { text-align: right; }
.related-wrap { padding: 20px 0 50px; }

/* ---------- site footer ---------- */
.site-footer { background: var(--ink); color: #9CA3AF; margin-top: 40px; }
.site-footer .wrap { padding: 44px 24px 34px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 34px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer .f-brand { font-family: var(--font-display); color: #fff; font-size: 20px; margin: 0 0 10px; }
.site-footer p { font-size: 13.5px; line-height: 1.8; margin: 0; }
.site-footer h5 { color: #E5E7EB; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #9CA3AF; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1F2937; margin-top: 30px; padding-top: 20px; font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
