@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&family=Noto+Serif+SC:wght@600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #e8e6df;
  --paper: #faf9f6;
  --paper-hover: #f5f3ee;
  --border: #d8d6cf;
  --border-light: #eae9e4;
  --text: #1a1a1a;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.05), 0 4px 16px rgba(0,0,0,0.04);
  --font-serif: "Noto Serif SC", "Source Serif 4", "Songti SC", Georgia, serif;
  --font-sans: "Noto Sans SC", "PingFang SC", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--text-secondary); }

/* ── Container ── */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

/* ── Site Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}

.header-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
}

.brand-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
}

.brand-slogan {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  border-left: 1px solid var(--border);
  padding-left: 0.5rem;
  margin-left: 0.25rem;
}

.header-links {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.header-links a {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.header-links a:hover { color: var(--text); }

/* ── Home Page — Two-column layout ── */
.home-layout {
  max-width: 1060px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.home-main {
  flex: 1;
  min-width: 0;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.article-card {
  background: var(--paper);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
  transition: box-shadow 0.2s;
  display: block;
  color: var(--text);
}

.article-card:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06);
}

.article-card h2 {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 0.4rem;
}

.article-card .meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 500;
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}

.tag-deep { border-color: #93c5fd; color: #2563eb; }
.tag-news { border-color: #86efac; color: #16a34a; }
.tag-paper { border-color: #fca5a5; color: #dc2626; }

.article-card .excerpt {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Home Sidebar (Article Directory) ── */
.home-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .home-sidebar {
    display: block;
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 3.5rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
  }
}

.home-sidebar nav {
  background: var(--paper);
  box-shadow: var(--shadow-card);
  padding: 1rem;
}

.home-sidebar .sidebar-title {
  font-family: var(--font-serif);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-light);
}

.home-sidebar .sidebar-date {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  margin-bottom: 0.25rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid var(--border-light);
}

.home-sidebar .sidebar-date:first-of-type {
  margin-top: 0;
}

.home-sidebar ul {
  list-style: none;
}

.home-sidebar li {
  margin-bottom: 0.15rem;
}

.home-sidebar li a {
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--text-secondary);
  display: block;
  padding: 0.15rem 0;
  transition: color 0.2s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-sidebar li a:hover {
  color: var(--text);
}

/* ── Article Full Page ── */
.breadcrumb {
  padding: 1rem 0 0.5rem;
  font-size: 0.75rem;
}

.breadcrumb a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.breadcrumb a:hover { color: var(--text); }

/* ── Article Content ── */
.article-full header {
  margin-bottom: 1.25rem;
}

.article-full h1 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.article-full .meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.article-full .meta a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-full .meta a:hover { color: var(--text); }

.hero-image {
  width: 100%;
  margin: 1rem 0;
  display: block;
}

.hero-image img {
  width: 100%;
  display: block;
}

.article-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.article-images img {
  max-width: 100%;
  height: auto;
  display: block;
}

.article-images.multi img {
  max-width: calc(50% - 0.375rem);
}

/* ── Article Body ── */
.article-body {
  margin-top: 0.75rem;
}

.paragraph-group {
  margin-bottom: 1.25rem;
}

.paragraph-group p {
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* Rich content (from RSS with preserved HTML) */
.article-body h2 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.5rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-light);
}

.article-body h3 {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
}

.article-body h4 {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  margin: 1rem 0 0.4rem;
}

.article-body p {
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.article-body ul, .article-body ol {
  margin: 0.5rem 0 0.75rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.8;
}

.article-body li {
  margin-bottom: 0.35rem;
}

.article-body blockquote {
  border-left: 3px solid var(--border);
  padding: 0.5rem 0.75rem;
  margin: 0.75rem 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.article-body a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body a:hover { color: #1d4ed8; }

.article-body strong {
  font-weight: 700;
  color: var(--text);
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 1rem 0;
}

/* ── Source Attribution Footer ── */
.article-sources {
  margin-top: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.article-sources .sources-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.article-sources ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-sources li {
  font-size: 0.7rem;
  line-height: 1.5;
  margin-bottom: 0.2rem;
}

.article-sources a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-sources a:hover { color: var(--text); }

/* ── English Original Section ── */
.en-section {
  margin-top: 1.5rem;
}

.en-section summary {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  padding: 0.6rem 0;
  border-top: 1px solid var(--border-light);
  transition: color 0.2s;
}

.en-section summary::-webkit-details-marker { display: none; }

.en-section summary::before { content: "▸ "; }
.en-section[open] summary::before { content: "▾ "; }
.en-section summary:hover { color: var(--text); }

.en-section .en-body {
  border-left: 2px solid var(--border);
  padding-left: 0.75rem;
  margin-top: 0.5rem;
}

.en-section .en-body p {
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* ── QR Code Modal ── */
.qr-trigger {
  cursor: pointer;
  position: relative;
}

.qr-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.qr-modal-overlay.active { display: flex; }

.qr-modal {
  background: var(--paper);
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  text-align: center;
  max-width: 280px;
}

.qr-modal img {
  width: 200px;
  height: 200px;
  display: block;
  margin: 0 auto 0.5rem;
}

.qr-modal p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Disclaimer ── */
.disclaimer {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.disclaimer h1 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.disclaimer p {
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.disclaimer a {
  color: #2563eb;
  text-decoration: underline;
}

/* ── Footer ── */
.site-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
}

.site-footer a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--text); }

.site-footer .footer-links {
  margin-top: 0.3rem;
}

.site-footer .footer-links a {
  margin: 0 0.3rem;
}

/* ── Responsive ── */
@media (min-width: 768px) {
  .container { padding: 0 1.5rem 2rem; }
  .header-inner { padding: 0.6rem 1.5rem; }
  .home-layout { padding: 1.25rem 1.5rem 2rem; }
  .article-card { padding: 1.5rem; }
  .article-full h1 { font-size: 1.4rem; }
}
