@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&family=Nunito:ital,wght@0,700;0,800;0,900;1,700&display=swap');

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

:root {
  --color-bg: #ffffff;
  --color-surface: #f5f5f5;
  --color-ink: #1f1f1f;
  --color-ink-soft: #4a4a4a;
  --color-ink-muted: #7a7a7a;
  --color-border: #e0e0e0;
  --color-accent: #1f1f1f;
  --color-accent-hover: #3a3a3a;
  --color-cta-bg: #1f1f1f;
  --color-cta-text: #ffffff;

  --shadow-sm: 0 2px 6px rgba(31,31,31,0.07);
  --shadow-md: 0 4px 14px rgba(31,31,31,0.10);
  --shadow-lg: 0 8px 28px rgba(31,31,31,0.13);
  --shadow-xl: 0 16px 48px rgba(31,31,31,0.16);

  --radius: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --nav-width: 240px;
  --font-body: 'DM Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-heading: 'Nunito', 'PingFang SC', 'Microsoft YaHei', sans-serif;

  --z-nav: 100;
  --z-hero: 1;
  --z-card-2: 2;
  --z-card-3: 3;
  --z-card-4: 4;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-ink);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--color-ink);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--color-ink-soft);
  opacity: 0.8;
}

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

ul, ol {
  list-style: none;
}

/* ── Site wrapper ── */
.site-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ── Side Nav ── */
.sidenav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100vh;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px 20px;
  gap: 20px;
  z-index: var(--z-nav);
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.sidenav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 0.85rem;
  line-height: 1.3;
  color: var(--color-ink);
  word-break: break-all;
}

.brand-name a {
  color: inherit;
}

.sidenav nav {
  flex: 1;
}

.sidenav nav p {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidenav nav p a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-ink-soft);
  transition: background 0.2s, color 0.2s, transform 0.15s;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.sidenav nav p a:hover,
.sidenav nav p a[aria-current="page"] {
  background: var(--color-bg);
  color: var(--color-ink);
  box-shadow: var(--shadow-sm);
  transform: translateX(3px);
}

.sidenav-cta {
  display: block;
  background: var(--color-cta-bg);
  color: var(--color-cta-text) !important;
  text-align: center;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.875rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s, transform 0.15s;
  opacity: 1 !important;
}

.sidenav-cta:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  opacity: 1 !important;
}

/* ── Main area ── */
.main-area {
  margin-left: var(--nav-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Hero (home) ── */
.hero-section {
  width: 100%;
  min-height: 45vh;
  background: linear-gradient(135deg, #1f1f1f 60%, #3a3a3a 100%);
  position: relative;
  z-index: var(--z-hero);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: 48px 40px;
  max-width: 680px;
}

.hero-h1 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  color: #ffffff;
  line-height: 1.25;
  margin-bottom: 16px;
}

.hero-desc {
  color: rgba(255,255,255,0.82);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 520px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  color: var(--color-ink) !important;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: var(--shadow-lg);
  transition: transform 0.2s, box-shadow 0.2s;
  opacity: 1 !important;
  min-height: 44px;
}

.hero-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

/* ── Page hero (inner pages) ── */
.page-hero {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 40px 40px 32px;
  position: relative;
  z-index: var(--z-hero);
}

.page-hero-inner {
  max-width: 700px;
}

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
  margin-bottom: 8px;
}

.page-hero h1 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  line-height: 1.25;
  color: var(--color-ink);
  margin-bottom: 8px;
}

/* ── main layout with sidebar ── */
main {
  display: flex;
  flex: 1;
  align-items: flex-start;
  gap: 24px;
  padding: 32px 32px 40px 40px;
  max-width: 1200px;
  width: 100%;
}

main > article {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

main > article > section {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

/* ── Sidebar ── */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 24px;
}

.sidebar-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: var(--z-card-2);
  transition: box-shadow 0.2s, transform 0.15s;
}

.sidebar-block:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.sidebar-block h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--color-ink);
  margin-bottom: 12px;
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-list li a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--color-ink-soft);
  transition: background 0.15s, color 0.15s;
  min-height: 34px;
  display: flex;
  align-items: center;
}

.sidebar-list li a:hover {
  background: var(--color-bg);
  color: var(--color-ink);
  opacity: 1;
}

.sidebar-text {
  font-size: 0.875rem;
  color: var(--color-ink-soft);
  line-height: 1.6;
}

/* ── Eyebrow / small ── */
small.eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
  margin-bottom: 6px;
}

/* ── Section headings ── */
section h2 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--color-ink);
  margin-bottom: 20px;
  line-height: 1.3;
}

section h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  color: var(--color-ink);
  margin-bottom: 14px;
}

/* ── Content body (prose) ── */
.content-body {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-ink-soft);
}

.content-body.prose h2,
.content-body.prose h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--color-ink);
  margin-top: 24px;
  margin-bottom: 10px;
}

.content-body.prose p {
  margin-bottom: 14px;
}

.content-body.prose ul,
.content-body.prose ol {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 14px;
}

.content-body.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Layer elevation ── */
.layer-1 {
  position: relative;
  z-index: 1;
}

.layer-2 {
  position: relative;
  z-index: var(--z-card-2);
  box-shadow: var(--shadow-md);
}

.layer-3 {
  position: relative;
  z-index: var(--z-card-3);
  box-shadow: var(--shadow-lg);
}

.layer-4 {
  position: relative;
  z-index: var(--z-card-4);
  box-shadow: var(--shadow-xl);
}

/* ── Category grid ── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.cat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.cat-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px) translateZ(0);
}

.cat-card-header {
  margin-bottom: 8px;
}

.cat-card-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1rem;
  color: var(--color-ink);
}

.cat-card-desc {
  font-size: 0.875rem;
  color: var(--color-ink-muted);
  line-height: 1.55;
  margin-bottom: 12px;
}

.cat-entry-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-entry-link {
  font-size: 0.8rem;
  color: var(--color-ink-soft);
  padding: 4px 0;
  border-bottom: 1px solid var(--color-border);
  transition: color 0.15s;
}

.cat-entry-link:last-child {
  border-bottom: none;
}

.cat-entry-link:hover {
  color: var(--color-ink);
  opacity: 1;
}

/* ── Entry grid ── */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.entry-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.entry-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px) translateZ(0);
}

.card-date {
  font-size: 0.75rem;
  color: var(--color-ink-muted);
}

.entry-card-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--color-ink);
  line-height: 1.35;
}

.entry-card-desc {
  font-size: 0.825rem;
  color: var(--color-ink-soft);
  line-height: 1.55;
}

/* ── Tag cloud ── */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-ink-soft);
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.tag-pill:hover {
  background: var(--color-ink);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  opacity: 1;
}

/* ── DL entry list ── */
.entry-dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.entry-dl dt {
  padding: 12px 0 4px;
  border-top: 1px solid var(--color-border);
}

.entry-dl dt:first-of-type {
  border-top: none;
  padding-top: 0;
}

.entry-dl dt a {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--color-ink);
  transition: color 0.15s;
}

.entry-dl dt a:hover {
  color: var(--color-ink-soft);
  opacity: 1;
}

.entry-dl dd {
  font-size: 0.85rem;
  color: var(--color-ink-muted);
  padding-bottom: 12px;
  line-height: 1.55;
}

/* ── Page date ── */
.page-date {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--color-ink-muted);
  margin-top: 6px;
  margin-right: 10px;
}

/* ── Breadcrumb ── */
.breadcrumb-link {
  font-size: 0.8rem;
  color: var(--color-ink-muted);
  transition: color 0.15s;
}

.breadcrumb-link:hover {
  color: var(--color-ink);
  opacity: 1;
}

/* ── Entry article ── */
.entry-article {
  gap: 24px;
}

.entry-header-section {
  background: var(--color-surface) !important;
}

.entry-hero-img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.entry-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.entry-dates {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.entry-h1 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  color: var(--color-ink);
  line-height: 1.28;
  margin-bottom: 10px;
}

.entry-desc {
  font-size: 1rem;
  color: var(--color-ink-soft);
  line-height: 1.65;
}

/* ── Flat article (about/privacy) ── */
.flat-article {
  gap: 24px;
}

.flat-header-section {
  background: var(--color-surface) !important;
}

.flat-header-section h1 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  color: var(--color-ink);
  line-height: 1.28;
  margin-top: 8px;
  margin-bottom: 6px;
}

/* ── Footer ── */
footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

footer > section {
  padding: 24px 40px;
}

.footer-cta {
  background: var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 40px !important;
}

.footer-cta-btn {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  color: var(--color-ink) !important;
  padding: 14px 36px;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1rem;
  box-shadow: var(--shadow-lg);
  transition: transform 0.2s, box-shadow 0.2s;
  opacity: 1 !important;
  min-height: 44px;
}

.footer-cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
  opacity: 1 !important;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--color-ink-muted);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--color-ink-soft);
  transition: color 0.15s;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.footer-links a:hover {
  color: var(--color-ink);
  opacity: 1;
}

/* ── Animations ── */
@media (prefers-reduced-motion: no-preference) {
  .cat-card,
  .entry-card,
  .sidebar-block {
    transition: box-shadow 0.25s cubic-bezier(0.4,0,0.2,1),
                transform 0.25s cubic-bezier(0.4,0,0.2,1);
  }

  .sidenav nav p a {
    transition: background 0.2s, color 0.2s, transform 0.2s cubic-bezier(0.4,0,0.2,1), box-shadow 0.2s;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  :root {
    --nav-width: 200px;
  }

  .hero-inner {
    padding: 36px 28px;
  }

  main {
    padding: 24px 24px 32px 28px;
    gap: 20px;
  }

  .sidebar {
    width: 220px;
  }

  footer > section {
    padding: 20px 28px;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-width: 0px;
  }

  .site-wrapper {
    flex-direction: column;
  }

  .sidenav {
    position: relative;
    width: 100%;
    height: auto;
    flex-direction: column;
    padding: 16px;
    gap: 12px;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
  }

  .sidenav nav p {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .sidenav nav p a {
    padding: 8px 12px;
    font-size: 0.8rem;
    min-height: 40px;
  }

  .main-area {
    margin-left: 0;
  }

  .hero-section {
    min-height: 38vh;
  }

  .hero-inner {
    padding: 28px 20px;
  }

  .page-hero {
    padding: 28px 20px 22px;
  }

  main {
    flex-direction: column;
    padding: 20px 16px 28px;
    gap: 16px;
  }

  .sidebar {
    width: 100%;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-block {
    flex: 1;
    min-width: 240px;
  }

  .cat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .entry-grid {
    grid-template-columns: 1fr 1fr;
  }

  footer > section {
    padding: 16px 20px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .cat-grid {
    grid-template-columns: 1fr;
  }

  .entry-grid {
    grid-template-columns: 1fr;
  }

  .hero-h1 {
    font-size: 1.4rem;
  }

  .sidenav nav p {
    flex-direction: column;
  }

  .sidebar {
    flex-direction: column;
  }

  .sidebar-block {
    min-width: 0;
  }
}
