:root {
  --bg-primary: #faf9f7;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8888a0;
  --accent: #e85d3a;
  --accent-hover: #d14a28;
  --accent-light: rgba(232, 93, 58, 0.08);
  --border: #e8e6e1;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
  --radius: 12px;
  --font-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --max-width: 1100px;
  --article-width: 760px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card: #1e1e35;
  --text-primary: #e8e6e1;
  --text-secondary: #b0afc4;
  --text-muted: #6e6e8a;
  --accent: #ff6f4a;
  --accent-hover: #ff8a6a;
  --accent-light: rgba(255, 111, 74, 0.1);
  --border: #2a2a45;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  min-height: 100vh;
  transition: background-color var(--transition), color var(--transition);
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; }

/* ============ HEADER ============ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(250,249,247,0.9);
  transition: background var(--transition), border-color var(--transition);
}

[data-theme="dark"] .site-header {
  background: rgba(15,15,26,0.9);
}

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

.site-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-logo:hover { color: var(--accent); }

.logo-icon { font-size: 1.4rem; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 0;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.nav-active { color: var(--text-primary); }
.nav-links a:hover::after,
.nav-links a.nav-active::after { width: 100%; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============ HERO ============ */

.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 72px 24px 56px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.9;
}

.hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 32px;
  box-shadow: var(--shadow-sm);
}

.stat-item { text-align: center; }

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* ============ FILTER BAR ============ */

.filter-bar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 28px;
}

.filter-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.search-box {
  position: relative;
  flex-shrink: 0;
}

.search-box input {
  width: 200px;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all var(--transition);
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
  width: 260px;
}

.search-box input::placeholder { color: var(--text-muted); }

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ============ ARTICLE GRID ============ */

.article-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.article-card.hidden { display: none; }

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #ff9a76);
  opacity: 0;
  transition: opacity var(--transition);
}

.article-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.article-card:hover::before { opacity: 1; }

.card-cover {
  display: block;
  overflow: hidden;
  line-height: 0;
}

.card-cover img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--transition);
}

.article-card:hover .card-cover img { transform: scale(1.03); }

.card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }

.card-tags-row {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 3px 8px;
  border-radius: 5px;
}

.tag-secondary {
  color: var(--text-muted);
  background: rgba(136,136,160,0.08);
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 10px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-title a { color: inherit; }
.card-title a:hover { color: var(--accent); }

.card-excerpt {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 18px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.card-source {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(136,136,160,0.08);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

/* ============ PAGINATION ============ */

.pagination-bar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 60px;
  text-align: center;
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.load-more-btn {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 36px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
}

.load-more-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.load-more-btn:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.pagination-bar.all-loaded .load-more-btn { display: none; }

/* No results */
.no-results {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
  text-align: center;
  color: var(--text-muted);
}

.no-results p { margin-bottom: 16px; font-size: 1rem; }

/* ============ ARTICLE COVER HERO ============ */

.article-cover-hero {
  max-width: var(--article-width);
  margin: 0 auto;
  padding: 20px 24px 0;
  line-height: 0;
}

.article-cover-hero img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

/* ============ ARTICLE PAGE ============ */

.article-header {
  max-width: var(--article-width);
  margin: 0 auto;
  padding: 48px 24px 36px;
  text-align: center;
}

.article-header .card-tag { margin: 0 auto 20px; }

.article-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.article-meta-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-wrap: wrap;
}

.article-meta-line span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.article-body {
  max-width: var(--article-width);
  margin: 0 auto;
  padding: 0 24px 60px;
}

.article-content {
  font-size: 1.05rem;
  line-height: 2;
  color: var(--text-primary);
}

.article-content h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 44px 0 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-light);
}

.article-content h3 { font-size: 1.2rem; font-weight: 600; margin: 32px 0 14px; }
.article-content p { margin-bottom: 18px; }
.article-content strong { color: var(--text-primary); font-weight: 700; }

.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 14px 22px;
  margin: 24px 0;
  background: var(--accent-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.article-content ul, .article-content ol { padding-left: 24px; margin-bottom: 18px; }
.article-content li { margin-bottom: 6px; }
.article-content hr { border: none; height: 1px; background: var(--border); margin: 36px 0; }
.article-content em { color: var(--text-muted); }

.highlight-box {
  background: linear-gradient(135deg, var(--accent-light), rgba(255,154,118,0.06));
  border: 1px solid rgba(232,93,58,0.15);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 24px 0;
}

/* ============ BACK LINK ============ */

.back-link {
  max-width: var(--article-width);
  margin: 0 auto;
  padding: 20px 24px 0;
}

.back-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.back-link a:hover { color: var(--accent); }

/* ============ ABOUT SECTION ============ */

.about-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.about-inner {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.about-content {
  flex: 1;
  min-width: 0;
}

.about-card {
  flex-shrink: 0;
  width: 300px;
}

.about-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.about-text {
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.about-text strong { color: var(--text-primary); }

.about-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 24px;
}

.source-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 6px;
  letter-spacing: 0.01em;
}

.wechat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.wechat-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.wechat-icon { font-size: 1.1rem; }

.wechat-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.wechat-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}

.wechat-search-hint {
  display: inline-block;
  background: #07c160;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 8px;
  letter-spacing: 0.02em;
}

/* ============ FOOTER ============ */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.83rem;
}

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

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
  list-style: none;
}

.footer-links a { color: var(--text-muted); font-size: 0.83rem; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { font-size: 0.8rem; }

/* ============ READING PROGRESS ============ */

.reading-progress {
  position: fixed;
  top: 64px;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #ff9a76);
  z-index: 99;
  transition: width 0.1s linear;
  width: 0%;
}

/* ============ ANIMATIONS ============ */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeInUp 0.5s ease forwards; opacity: 0; }
.fade-in:nth-child(1) { animation-delay: 0.05s; }
.fade-in:nth-child(2) { animation-delay: 0.15s; }
.fade-in:nth-child(3) { animation-delay: 0.25s; }
.fade-in:nth-child(4) { animation-delay: 0.35s; }

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
  .hero { padding: 48px 20px 36px; }
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 0.95rem; }
  .hero-stats { flex-direction: row; gap: 16px; padding: 14px 20px; }
  .stat-number { font-size: 1.2rem; }
  .stat-divider { width: 1px; height: 24px; }
  .filter-inner { flex-direction: column; align-items: stretch; }
  .filter-tags { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .search-box input { width: 100%; }
  .search-box input:focus { width: 100%; }
  .article-grid { grid-template-columns: 1fr; padding: 0 16px 40px; }
  .article-title { font-size: 1.6rem; }
  .article-content { font-size: 1rem; }
  .article-content h2 { font-size: 1.25rem; }
  .about-inner { flex-direction: column; }
  .about-card { width: 100%; order: -1; }
  .nav-inner { padding: 0 16px; }
  .nav-links { display: none; }
  .menu-toggle { display: flex; }
  .nav-links.show {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 12px;
    box-shadow: var(--shadow-md);
  }
  [data-theme="dark"] .nav-links.show { background: var(--bg-secondary); }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.7rem; }
  .hero-badge { font-size: 0.7rem; }
  .card-title { font-size: 1.1rem; }
  .hero-stats { gap: 12px; padding: 12px 16px; }
}
