/* ─── Design Tokens ─── */
:root {
  --primary: #0f2b5c;
  --primary-light: #1a4480;
  --accent: #b8860b;
  --accent-light: #d4a017;
  --neutral-900: #1a1a1a;
  --neutral-700: #4a4a4a;
  --neutral-500: #8a8a8a;
  --neutral-300: #c8c8c8;
  --neutral-200: #e8e8e8;
  --neutral-100: #f5f5f0;
  --surface: #ffffff;
  --highlight-bg: #f0f3f8;
  --shadow-1: 0 1px 3px rgba(15, 43, 92, 0.06);
  --shadow-2: 0 4px 12px rgba(15, 43, 92, 0.10);
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --transition-fast: 200ms cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-normal: 400ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ─── Dark Mode ─── */
[data-theme="dark"] {
  --primary: #5b8ec7;
  --primary-light: #7aa8d7;
  --accent: #d4a017;
  --accent-light: #e0b830;
  --neutral-900: #e8e8e8;
  --neutral-700: #b8b8b8;
  --neutral-500: #888888;
  --neutral-300: #555555;
  --neutral-200: #3a3a3a;
  --neutral-100: #1e1e1e;
  --surface: #252525;
  --highlight-bg: #2a3040;
  --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .site-header,
[data-theme="dark"] .filter-bar,
[data-theme="dark"] .latest-card,
[data-theme="dark"] .timeline-content,
[data-theme="dark"] .tweaks-panel {
  background: var(--surface);
  border-color: var(--neutral-200);
}

[data-theme="dark"] .search-box input {
  background: #1e1e1e;
  color: var(--neutral-700);
  border-color: var(--neutral-200);
}

[data-theme="dark"] .search-box input:focus {
  box-shadow: 0 0 0 3px rgba(91, 142, 199, 0.15);
}

[data-theme="dark"] .filter-tag {
  background: var(--surface);
  border-color: var(--neutral-200);
  color: var(--neutral-500);
}

[data-theme="dark"] .filter-tag:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

[data-theme="dark"] .latest-date {
  background: #1e1e1e;
}

[data-theme="dark"] .tweak-btn {
  background: var(--surface);
  border-color: var(--neutral-200);
  color: var(--neutral-700);
}

/* ─── Density Variants ─── */
[data-density="compact"] .latest-card {
  padding: 20px;
  margin-bottom: 16px;
}

[data-density="compact"] .timeline-item {
  padding-bottom: 12px;
}

[data-density="compact"] .timeline-content {
  padding: 14px 16px;
}

[data-density="compact"] .section-title {
  margin-bottom: 10px;
}

[data-density="spacious"] .latest-card {
  padding: 40px;
  margin-bottom: 48px;
}

[data-density="spacious"] .timeline-item {
  padding-bottom: 32px;
}

[data-density="spacious"] .timeline-content {
  padding: 28px 32px;
}

[data-density="spacious"] .section-title {
  margin-bottom: 24px;
}

/* ─── Print Styles ─── */
@media print {
  .tweaks-toggle,
  .tweaks-panel,
  .filter-bar,
  .read-more {
display: none !important;
  }

  body {
background: #fff;
color: #000;
font-size: 12pt;
  }

  .site-header {
border-bottom: 1pt solid #ccc;
padding: 16pt 0;
margin-bottom: 16pt;
  }

  .latest-card,
  .timeline-content {
box-shadow: none;
border: 1pt solid #ccc;
break-inside: avoid;
  }

  .timeline::before {
background: #ccc;
  }

  .timeline-dot {
border-color: #999;
  }

  a {
color: #000;
text-decoration: none;
  }

  a[href]::after {
content: " (" attr(href) ")";
font-size: 10pt;
color: #666;
  }
}

/* ─── Reset & Base ─── */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--neutral-100);
  color: var(--neutral-700);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }

/* ─── Typography ─── */
h1, h2, h3, .brand-title {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  color: var(--neutral-900);
  text-wrap: pretty;
}

/* ─── Layout ─── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 768px) {
  .container { padding: 0 40px; }
}

/* ─── Header ─── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--neutral-200);
  padding: 32px 0 24px;
  margin-bottom: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: "Noto Serif SC", serif;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.brand-title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.02em;
}

.brand-subtitle {
  font-size: 14px;
  color: var(--neutral-500);
  margin-left: 60px;
  font-family: "PingFang SC", sans-serif;
}

/* ─── Filter Bar ─── */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow-1);
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--neutral-700);
  background: var(--neutral-100);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(15, 43, 92, 0.08);
}

.search-box::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

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

.filter-tag {
  padding: 6px 14px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--neutral-500);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.filter-tag:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

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

/* ─── Section Title ─── */
.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--neutral-900);
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
  font-family: "Noto Serif SC", serif;
}

/* ─── Latest Card ─── */
.latest-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 32px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-1);
  border: 1px solid var(--neutral-200);
  transition: box-shadow var(--transition-fast);
}

.latest-card:hover {
  box-shadow: var(--shadow-2);
}

.latest-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.latest-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--primary);
  font-family: "Noto Serif SC", serif;
}

.latest-date {
  font-size: 13px;
  color: var(--neutral-500);
  background: var(--neutral-100);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.latest-summary {
  font-size: 15px;
  color: var(--neutral-700);
  line-height: 1.8;
  margin-bottom: 20px;
}

.latest-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--neutral-500);
}

.latest-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-top: 16px;
  transition: color var(--transition-fast);
}

.read-more:hover {
  color: var(--accent);
}

/* ─── Archive Timeline ─── */
.archive-section {
  margin-bottom: 48px;
}

.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--neutral-200);
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -24px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  transition: all var(--transition-fast);
}

.timeline-item:hover .timeline-dot {
  background: var(--accent);
  transform: scale(1.2);
}

.timeline-content {
  background: var(--surface);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  transition: all var(--transition-fast);
}

.timeline-content:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-2);
}

.timeline-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
  font-family: "Noto Serif SC", serif;
}

.timeline-title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

.timeline-date {
  font-size: 13px;
  color: var(--neutral-500);
  margin-bottom: 8px;
}

.timeline-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--highlight-bg);
  color: var(--primary-light);
}

/* ─── Priority Colors ─── */
.tag-china { background: #fce4ec; color: #c2185b; }
.tag-sep { background: #fff3e0; color: #e65100; }
.tag-tech { background: #e8f5e9; color: #2e7d32; }
.tag-legal { background: #e3f2fd; color: #1565c0; }
.tag-upc { background: #f3e5f5; color: #6a1b9a; }

/* ─── Footer ─── */
.site-footer {
  border-top: 1px solid var(--neutral-200);
  padding: 32px 0;
  text-align: center;
  margin-top: 48px;
}

.footer-brand {
  font-family: "Noto Serif SC", serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.footer-copy {
  font-size: 13px;
  color: var(--neutral-500);
}

/* ─── Loading State ─── */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--neutral-500);
}

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--neutral-500);
}

/* ─── Animations ─── */
@keyframes fadeInUp {
  from {
opacity: 0;
transform: translateY(12px);
  }
  to {
opacity: 1;
transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 400ms cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

/* ─── Tweaks Panel ─── */
.tweaks-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-2);
  transition: all var(--transition-fast);
  z-index: 1000;
  font-size: 18px;
}

.tweaks-toggle:hover {
  background: var(--primary-light);
  transform: scale(1.05);
}

.tweaks-panel {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  padding: 20px;
  z-index: 1000;
  display: none;
}

.tweaks-panel.open {
  display: block;
  animation: fadeInUp 200ms ease forwards;
}

.tweaks-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--neutral-900);
  margin-bottom: 16px;
  font-family: "Noto Serif SC", serif;
}

.tweak-item {
  margin-bottom: 16px;
}

.tweak-label {
  font-size: 13px;
  color: var(--neutral-500);
  margin-bottom: 6px;
  display: block;
}

.tweak-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tweak-btn {
  padding: 6px 12px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--neutral-700);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.tweak-btn:hover {
  border-color: var(--primary-light);
}

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

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .brand { flex-direction: column; align-items: flex-start; gap: 8px; }
  .brand-subtitle { margin-left: 0; }
  .latest-card { padding: 20px; }
  .latest-header { flex-direction: column; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .timeline { padding-left: 16px; }
  .timeline-dot { left: -16px; width: 10px; height: 10px; }
}