:root {
  --primary: #2B4C7E;
  --primary-dark: #1E365C;
  --primary-soft: #EEF3FA;
  --accent: #D97706;
  --accent-soft: #FEF3C7;
  --bg: #FAF9F6;
  --surface: #FFFFFF;
  --surface-alt: #F4F2EC;
  --text: #1F2937;
  --muted: #4B5563;
  --subtle: #6B7280;
  --border: #E5E7EB;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(31, 41, 55, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image:
    radial-gradient(840px 360px at 88% -8%, rgba(43, 76, 126, 0.06), transparent 60%),
    radial-gradient(620px 280px at 10% 0%, rgba(217, 119, 6, 0.05), transparent 55%);
  color: var(--text);
  font: 16px/1.8 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary-dark);
}

.wrap {
  width: min(960px, calc(100% - 36px));
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 249, 246, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand:hover {
  color: var(--primary);
}

.brand img {
  display: block;
  flex-shrink: 0;
}

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

.nav a {
  padding: 7px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.nav a:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.nav a.active {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
}

/* Main */
main {
  flex: 1 0 auto;
  padding-bottom: 52px;
}

/* Hero */
.hero {
  padding: 56px 0 32px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  margin: 16px 0 0;
  font-size: clamp(28px, 4.2vw, 38px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 800;
  color: var(--text);
}

.hero .lede {
  max-width: 660px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16.5px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #FFFFFF;
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

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

/* Overview strip */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 12px;
}

.pillar-card {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.pillar-tag {
  display: inline-block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.pillar-card h3 {
  margin: 6px 0 6px;
  font-size: 17px;
  color: var(--text);
}

.pillar-card p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}

/* Section */
.section {
  padding-top: 40px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 750;
  color: var(--text);
}

.section-sub {
  color: var(--subtle);
  font-size: 14px;
}

/* Essay Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.essay-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.essay-card:hover {
  transform: translateY(-2px);
  border-color: #CBD5E1;
  box-shadow: 0 10px 28px rgba(43, 76, 126, 0.08);
}

.essay-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--subtle);
}

.essay-cat {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.essay-card h3 {
  margin: 14px 0 8px;
  font-size: 18px;
  line-height: 1.45;
  color: var(--text);
}

.essay-card p {
  margin: 0 0 16px;
  flex: 1 0 auto;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--muted);
}

.essay-more {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

/* Notice Panel */
.info-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.info-panel h2 {
  margin: 0 0 6px;
  font-size: 19px;
}

.info-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

/* Reading View */
.article-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding-top: 36px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--subtle);
}

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

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

.article-box {
  padding: 36px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.article-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.article-header h1 {
  margin: 12px 0 10px;
  font-size: clamp(24px, 3.2vw, 30px);
  line-height: 1.35;
  color: var(--text);
}

.article-info {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13.5px;
  color: var(--subtle);
}

.article-body {
  margin-top: 24px;
  color: var(--text);
}

.article-body h2 {
  margin: 28px 0 10px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
  font-size: 19.5px;
  line-height: 1.4;
  color: var(--text);
}

.article-body p {
  margin: 14px 0;
  color: var(--text);
}

.article-body ul,
.article-body ol {
  margin: 12px 0 16px;
  padding-left: 22px;
  color: var(--text);
}

.article-body li {
  margin: 7px 0;
}

.quote-box {
  margin: 20px 0;
  padding: 16px 20px;
  border: 1px solid #E2E8F0;
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  background: var(--primary-soft);
}

.quote-box p {
  margin: 0;
  color: var(--primary-dark);
  font-size: 15px;
}

.tip-box {
  margin: 20px 0;
  padding: 16px 20px;
  border: 1px solid #FDE68A;
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: #FFFBEB;
}

.tip-title {
  display: block;
  margin-bottom: 6px;
  color: #B45309;
  font-size: 13.5px;
  font-weight: 700;
}

.tip-box p {
  margin: 0;
  font-size: 15px;
  color: #451A03;
}

.article-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 14.5px;
}

/* Error 404 */
.empty-state {
  max-width: 540px;
  margin: 56px auto 0;
  padding: 40px 28px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.empty-code {
  margin: 0;
  font-size: 48px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}

.hero-actions-center {
  justify-content: center;
}

/* Footer (Centered for ICP compliance) */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  padding: 24px 0;
  text-align: center;
  color: var(--subtle);
  font-size: 13.5px;
  line-height: 1.85;
}

.footer-inner p {
  margin: 0;
}

.icp-link {
  color: var(--muted);
  font-weight: 500;
}

.icp-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

@media (max-width: 820px) {
  .pillars,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .info-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-box {
    padding: 24px 20px;
  }
}

@media (max-width: 560px) {
  .header-inner {
    min-height: 58px;
  }

  .nav a {
    padding: 6px 10px;
    font-size: 14px;
  }

  .hero {
    padding-top: 38px;
  }

  .article-nav {
    flex-direction: column;
    align-items: flex-start;
  }
}
