@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@300;400;500;600;700&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* ===== 基础变量 ===== */
:root {
  --ice: #c8e0f4;
  --rose: #f5e0e8;
  --ink: #171f26;
  --ice-dark: #a8c8e8;
  --ice-light: #e4f0fa;
  --rose-dark: #e8c8d8;
  --rose-light: #faeef3;
  --bg: #dde8f0;
  --bg2: #eaf0f6;
  --shadow-light: rgba(255, 255, 255, 0.85);
  --shadow-dark: rgba(100, 130, 160, 0.35);
  --ink-soft: rgba(23, 31, 38, 0.7);
  --ink-muted: rgba(23, 31, 38, 0.45);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 50px;
  --font-sans: 'Archivo', 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-alt: 'Space Grotesk', 'Archivo', system-ui, sans-serif;
  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, menu { list-style: none; }

/* ===== 公告条 ===== */
.announce-bar {
  background: linear-gradient(135deg, var(--ice-dark), var(--rose-dark));
  color: var(--ink);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.45rem 1rem;
  font-family: var(--font-alt);
}

/* ===== 导航 ===== */
.site-nav {
  background: var(--bg);
  padding: 0.75rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow:
    0 2px 8px var(--shadow-dark),
    0 -1px 0 var(--shadow-light) inset;
}

.nav-details {
  display: contents;
}

.nav-details > summary {
  display: none;
}

.nav-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.nav-left li,
.nav-right li {
  display: flex;
}

.nav-center-logo {
  margin: 0 0.75rem;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--font-alt);
  color: var(--ink-soft);
  background: var(--bg);
  min-height: 40px;
  box-shadow:
    -3px -3px 8px var(--shadow-light),
    3px 3px 8px var(--shadow-dark);
  transition: box-shadow var(--transition), transform var(--transition), color var(--transition);
  white-space: nowrap;
}

.nav-pill:hover {
  color: var(--ink);
  box-shadow:
    -4px -4px 12px var(--shadow-light),
    4px 4px 12px var(--shadow-dark);
}

.nav-pill:active {
  transform: scale(0.96);
  box-shadow:
    2px 2px 6px var(--shadow-dark) inset,
    -2px -2px 6px var(--shadow-light) inset;
}

.nav-home-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font-alt);
  color: var(--ink);
  min-height: 44px;
  background: linear-gradient(145deg, var(--ice-light), var(--ice));
  box-shadow:
    -4px -4px 12px var(--shadow-light),
    4px 4px 12px var(--shadow-dark);
  transition: box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.nav-home-pill:hover {
  box-shadow:
    -6px -6px 16px var(--shadow-light),
    6px 6px 16px var(--shadow-dark);
}

.nav-home-pill:active {
  transform: scale(0.96);
  box-shadow:
    3px 3px 8px var(--shadow-dark) inset,
    -3px -3px 8px var(--shadow-light) inset;
}

/* 移动端导航折叠 */
@media (max-width: 768px) {
  .site-nav {
    padding: 0.6rem 1rem;
  }

  .nav-details > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    list-style: none;
    padding: 0.5rem;
    min-height: 44px;
  }

  .nav-details > summary::-webkit-details-marker { display: none; }

  .nav-brand {
    width: 100%;
    background: linear-gradient(145deg, var(--ice-light), var(--ice));
    border-radius: var(--radius-sm);
    box-shadow:
      -3px -3px 8px var(--shadow-light),
      3px 3px 8px var(--shadow-dark);
  }

  .brand-text {
    font-weight: 700;
    font-family: var(--font-alt);
    font-size: 0.95rem;
    color: var(--ink);
  }

  .nav-details[open] > summary {
    box-shadow:
      2px 2px 6px var(--shadow-dark) inset,
      -2px -2px 6px var(--shadow-light) inset;
  }

  .nav-menu {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 0 0.25rem;
    gap: 0.4rem;
  }

  .nav-left,
  .nav-right {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    width: 100%;
  }

  .nav-left li,
  .nav-right li {
    width: 100%;
  }

  .nav-pill {
    width: 100%;
    justify-content: center;
    font-size: 0.9rem;
    padding: 0.65rem 1rem;
    min-height: 44px;
  }

  .nav-center-logo {
    margin: 0.2rem 0;
    display: flex;
    justify-content: center;
  }

  .nav-home-pill {
    padding: 0.65rem 1.4rem;
  }
}

/* ===== 主容器布局 ===== */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-areas:
    "hero  hero"
    "aside content"
    "aside cards1"
    "aside cards2"
    "aside cards3"
    "aside cards4";
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .wrap {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hero"
      "aside"
      "content"
      "cards1"
      "cards2"
      "cards3"
      "cards4";
    padding: 1.5rem 1rem;
    gap: 1.5rem;
  }
}

/* ===== Neumorphism 卡片基础 ===== */
.nm-card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow:
    -6px -6px 16px var(--shadow-light),
    6px 6px 16px var(--shadow-dark);
}

.nm-card-inset {
  background: var(--bg2);
  border-radius: var(--radius);
  box-shadow:
    4px 4px 10px var(--shadow-dark) inset,
    -4px -4px 10px var(--shadow-light) inset;
}

/* ===== Hero 区域 ===== */
.hero-section,
.page-hero-section {
  grid-area: hero;
}

.hero-article,
.page-hero-article {
  background: linear-gradient(145deg, var(--ice-light), var(--bg));
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  box-shadow:
    -8px -8px 20px var(--shadow-light),
    8px 8px 20px var(--shadow-dark);
  position: relative;
  overflow: hidden;
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
}

.hero-article::before,
.page-hero-article::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 60%;
  height: 120%;
  background: radial-gradient(ellipse, rgba(245, 224, 232, 0.5) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge,
.page-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-alt);
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, var(--rose-light), var(--rose));
  color: var(--ink);
  box-shadow:
    -2px -2px 6px var(--shadow-light),
    2px 2px 6px var(--shadow-dark);
}

.hero-h1,
.page-h1 {
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  font-family: var(--font-alt);
  letter-spacing: -0.01em;
  max-width: 720px;
}

.hero-sub {
  font-size: 1rem;
  color: var(--ink-soft);
  max-width: 560px;
  line-height: 1.7;
}

.meta-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.pub-date,
.mod-date {
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-family: var(--font-alt);
}

.hero-media,
.review-hero-media {
  margin-top: 1rem;
  width: 100%;
  max-width: 600px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow:
    -4px -4px 12px var(--shadow-light),
    4px 4px 12px var(--shadow-dark);
}

.hero-img,
.review-hero-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

@media (max-width: 600px) {
  .hero-article,
  .page-hero-article {
    padding: 2rem 1.25rem;
    min-height: 35vh;
  }

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

/* ===== 侧边栏 ===== */
.sidebar {
  grid-area: aside;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  box-shadow:
    -5px -5px 14px var(--shadow-light),
    5px 5px 14px var(--shadow-dark);
  position: sticky;
  top: 80px;
}

.sidebar small {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  font-family: var(--font-alt);
  margin-bottom: 0.3rem;
}

.sidebar h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  font-family: var(--font-alt);
  margin-bottom: 1rem;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-link {
  display: block;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--bg);
  box-shadow:
    -3px -3px 8px var(--shadow-light),
    3px 3px 8px var(--shadow-dark);
  transition: box-shadow var(--transition), color var(--transition), transform var(--transition);
  min-height: 40px;
  line-height: 1.5;
}

.sidebar-link:hover {
  color: var(--ink);
  box-shadow:
    -4px -4px 10px var(--shadow-light),
    4px 4px 10px var(--shadow-dark);
}

.sidebar-link:active {
  transform: scale(0.97);
  box-shadow:
    2px 2px 5px var(--shadow-dark) inset,
    -2px -2px 5px var(--shadow-light) inset;
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
  }
}

/* ===== 内容区 ===== */
.content-section {
  grid-area: content;
}

.prose-article {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  box-shadow:
    -6px -6px 16px var(--shadow-light),
    6px 6px 16px var(--shadow-dark);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink);
}

.prose-article h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--ink);
  font-family: var(--font-alt);
}

.prose-article h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.5rem 0 0.6rem;
  color: var(--ink);
  font-family: var(--font-alt);
}

.prose-article p {
  margin-bottom: 1rem;
}

.prose-article ul,
.prose-article ol {
  margin: 0.75rem 0 1rem 1.5rem;
}

.prose-article li {
  margin-bottom: 0.4rem;
}

.prose-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow:
    -3px -3px 8px var(--shadow-light),
    3px 3px 8px var(--shadow-dark);
}

.prose-article th,
.prose-article td {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(200, 224, 244, 0.4);
}

.prose-article th {
  background: linear-gradient(135deg, var(--ice), var(--ice-dark));
  font-weight: 600;
  font-family: var(--font-alt);
}

.prose-article tr:nth-child(even) td {
  background: var(--bg2);
}

.prose-article a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--ice-dark);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--transition);
}

.prose-article a:hover {
  text-decoration-color: var(--rose-dark);
}

.prose-article blockquote {
  margin: 1.25rem 0;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, var(--ice-light), var(--bg2));
  box-shadow:
    3px 3px 8px var(--shadow-dark) inset,
    -3px -3px 8px var(--shadow-light) inset;
  font-style: italic;
  color: var(--ink-soft);
}

@media (max-width: 600px) {
  .prose-article {
    padding: 1.5rem 1.1rem;
  }

  .prose-article table {
    display: block;
    overflow-x: auto;
  }
}

/* ===== 小标签（眉题） ===== */
small + h2,
small + h3 {
  margin-top: 0.25rem;
}

section > small,
.cards-section > small {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  font-family: var(--font-alt);
  margin-bottom: 0.25rem;
}

/* ===== 卡片区 ===== */
.cards-section {
  padding: 1.5rem 0 0;
}

.cards-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  font-family: var(--font-alt);
  margin-bottom: 1.25rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.child-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem 1.4rem;
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--ice-light), var(--bg));
  box-shadow:
    -5px -5px 14px var(--shadow-light),
    5px 5px 14px var(--shadow-dark);
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
}

.child-card:hover {
  box-shadow:
    -7px -7px 18px var(--shadow-light),
    7px 7px 18px var(--shadow-dark);
  transform: translateY(-2px);
}

.child-card:active {
  transform: scale(0.97);
  box-shadow:
    3px 3px 8px var(--shadow-dark) inset,
    -3px -3px 8px var(--shadow-light) inset;
}

.child-card > strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-alt);
  color: var(--ink);
  line-height: 1.4;
}

.child-card > span {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

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

/* ===== 页脚 ===== */
.site-footer {
  background: linear-gradient(135deg, var(--bg), var(--bg2));
  border-top: 1px solid rgba(200, 224, 244, 0.5);
  padding: 2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

.footer-address {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-style: normal;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-weight: 500;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-sep {
  color: var(--ice-dark);
  font-weight: 300;
}

.footer-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links li {
  display: flex;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-soft);
  min-height: 40px;
  background: var(--bg);
  box-shadow:
    -2px -2px 6px var(--shadow-light),
    2px 2px 6px var(--shadow-dark);
  transition: box-shadow var(--transition), color var(--transition);
}

.footer-links a:hover {
  color: var(--ink);
  box-shadow:
    -3px -3px 8px var(--shadow-light),
    3px 3px 8px var(--shadow-dark);
}

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

/* ===== 动效 ===== */
@media (prefers-reduced-motion: no-preference) {
  .child-card {
    animation: fadeUp 0.4s ease both;
  }

  .child-card:nth-child(2) { animation-delay: 0.06s; }
  .child-card:nth-child(3) { animation-delay: 0.12s; }
  .child-card:nth-child(4) { animation-delay: 0.18s; }

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

  .hero-article,
  .page-hero-article {
    animation: heroIn 0.5s ease both;
  }

  @keyframes heroIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ===== 焦点可访问性 ===== */
:focus-visible {
  outline: 2.5px solid var(--ice-dark);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===== 工具类 ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
