@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&display=swap');

/* ===== 设计令牌 ===== */
:root {
  --c-primary: #eb879c;
  --c-secondary: #ffb6c1;
  --c-dark: #26171a;
  --c-bg: #fff5f7;
  --c-bg-card: #ffffff;
  --c-text: #2d1a1f;
  --c-text-muted: #6b4552;
  --c-border: #f0cdd4;
  --c-accent-line: #eb879c;
  --c-aside-bg: #26171a;
  --c-aside-text: #fde8ed;
  --c-aside-link: #ffb6c1;
  --c-aside-active: #eb879c;
  --c-announce: #eb879c;
  --radius-card: 10px;
  --radius-btn: 8px;
  --shadow-card: 0 2px 8px rgba(235,135,156,.13), 0 1px 3px rgba(38,23,26,.07);
  --shadow-card-hover: 0 6px 20px rgba(235,135,156,.22), 0 2px 6px rgba(38,23,26,.10);
  --aside-w: 220px;
  --font-main: 'Atkinson Hyperlegible', system-ui, -apple-system, sans-serif;
  --transition: 220ms ease;
}

/* ===== 重置与基础 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 17px;
  line-height: 1.65;
  font-family: var(--font-main);
  color: var(--c-text);
  background: var(--c-bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--c-primary);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}
a:hover { color: var(--c-dark); }
a:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 3px;
  border-radius: 3px;
}

img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* ===== 公告条 ===== */
.announce-bar {
  background: var(--c-dark);
  color: var(--c-secondary);
  font-size: 0.82rem;
  text-align: center;
  padding: 6px 16px;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 200;
}

/* ===== 侧边栏（aside > nav > ul > li > a） ===== */
.site-aside {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--aside-w);
  height: 100vh;
  background: var(--c-aside-bg);
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 100;
  overflow-y: auto;
  padding-bottom: 24px;
}

.aside__brand {
  padding: 20px 16px 12px;
  border-bottom: 1px solid rgba(255,182,193,.15);
}

.aside__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--c-primary);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  transition: opacity var(--transition);
}
.aside__logo:hover { opacity: .85; }
.aside__logo .nav__logo-img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.aside__logo .nav__logo-text { color: #fff; font-size: 1rem; font-weight: 700; line-height: 1; }

.aside__nav {
  padding: 16px 12px 0;
  flex: 1;
}

.aside__nav ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.aside__nav li {}

.aside__nav li a {
  display: block;
  padding: 10px 12px;
  min-height: 42px;
  border-radius: 8px;
  color: var(--c-aside-link);
  font-size: 0.88rem;
  line-height: 1.4;
  transition: background var(--transition), color var(--transition);
}
.aside__nav li a:hover {
  background: rgba(255,182,193,.12);
  color: #fff;
}
.aside__nav li a[aria-current="page"] {
  background: var(--c-primary);
  color: #fff;
  font-weight: 700;
}
.aside__nav li a:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.aside__related,
.aside__topics {
  padding: 16px 12px 0;
}

.aside__related .eyebrow,
.aside__topics .eyebrow {
  display: block;
  color: rgba(255,182,193,.6);
  font-size: 0.72rem;
  letter-spacing: .08em;
  margin-bottom: 8px;
  text-transform: none;
}

.aside__related-list li a,
.aside__topic-list li a {
  display: block;
  padding: 7px 10px;
  min-height: 38px;
  border-radius: 6px;
  color: var(--c-aside-link);
  font-size: 0.82rem;
  transition: background var(--transition), color var(--transition);
}
.aside__related-list li a:hover,
.aside__topic-list li a:hover {
  background: rgba(255,182,193,.10);
  color: #fff;
}

/* ===== 页面包装 ===== */
.page-wrap {
  margin-left: var(--aside-w);
  flex: 1;
  min-width: 0;
}

/* ===== main > article > div 结构 ===== */
main {
  width: 100%;
}

main > article {
  width: 100%;
}

main > article > div {
  width: 100%;
}

/* ===== 公告/日期 ===== */
.page-date {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--c-text-muted);
  margin-bottom: 12px;
}

/* ===== 面包屑 ===== */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--c-text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.breadcrumb a { color: var(--c-primary); }
.breadcrumb span { color: var(--c-text-muted); }

/* ===== eyebrow 小标签 ===== */
.eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--c-primary);
  margin-bottom: 6px;
  text-transform: none;
}

/* ===== Hero（首页） ===== */
.hero {
  position: relative;
  min-height: 45vh;
  background: var(--c-dark);
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0;
}

.hero__dot-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(235,135,156,.25) 1px, transparent 1px);
  background-size: 22px 22px;
  z-index: 0;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 48px 48px 48px 48px;
  max-width: 960px;
  width: 100%;
}

.hero__text {
  flex: 1;
  min-width: 0;
}

.hero__text h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 16px;
}

.hero__sub {
  color: var(--c-secondary);
  font-size: 1rem;
  margin-bottom: 28px;
  max-width: 460px;
}

.hero__tiles {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 140px;
}

.hero__tile {
  border-radius: 10px;
  height: 80px;
}
.hero__tile--1 {
  background: linear-gradient(135deg, var(--c-primary), var(--c-secondary));
  transform: rotate(-3deg);
  box-shadow: 0 4px 16px rgba(235,135,156,.35);
}
.hero__tile--2 {
  background: linear-gradient(135deg, var(--c-secondary), #fff0f3);
  transform: rotate(3deg) translateY(-8px);
  box-shadow: 0 4px 16px rgba(255,182,193,.3);
}

/* ===== 按钮 ===== */
.btn {
  display: inline-block;
  padding: 11px 24px;
  min-height: 44px;
  background: var(--c-primary);
  color: #fff;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 0.95rem;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  box-shadow: 0 2px 8px rgba(235,135,156,.35);
  line-height: 1.4;
  text-align: center;
}
.btn:hover {
  background: #d96f89;
  color: #fff;
  box-shadow: 0 4px 16px rgba(235,135,156,.45);
  transform: translateY(-1px);
}
.btn:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 3px;
}

/* ===== 卡片网格 ===== */
.topic-grid,
.article-grid {
  display: grid;
  gap: 20px;
  margin-top: 16px;
}

.topic-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.article-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* div > article×n 结构（栏目页子页列表） */
.topic-children {
  padding: 40px 48px;
}

.topic-children > article,
.topic-grid > article,
.article-grid > article {
  /* 直接子 article 满足契约 */
}

/* ===== 卡片（底部强调线 + 10px 圆角） ===== */
.card {
  background: var(--c-bg-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.card__accent {
  height: 3px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-secondary));
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}

.card__body {
  padding: 20px 20px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card__body h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}
.card__body h3 a {
  color: var(--c-dark);
}
.card__body h3 a:hover { color: var(--c-primary); }

.card__body p {
  font-size: 0.88rem;
  color: var(--c-text-muted);
  line-height: 1.55;
  flex: 1;
}

.card__date {
  font-size: 0.77rem;
  color: var(--c-primary);
  font-weight: 700;
}

.card__link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--c-primary);
  margin-top: 4px;
  align-self: flex-start;
}
.card__link:hover { color: var(--c-dark); }

/* ===== 首页区块 ===== */
.home-content,
.home-topics,
.home-articles {
  padding: 48px 48px;
}

.home-topics { background: #fff0f3; }
.home-articles { background: var(--c-bg); }

.home-topics h2,
.home-articles h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-dark);
  margin-bottom: 4px;
}

/* ===== 页面头部 ===== */
.page-header {
  padding: 40px 48px 32px;
  background: linear-gradient(135deg, #fff5f7 0%, #ffe8ed 100%);
  border-bottom: 1px solid var(--c-border);
}

.page-header h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--c-dark);
  margin-bottom: 10px;
  line-height: 1.25;
}

.page-desc {
  color: var(--c-text-muted);
  font-size: 1rem;
  margin-top: 8px;
  max-width: 600px;
}

/* ===== 正文区域 ===== */
.prose {
  padding: 40px 48px;
  max-width: 780px;
}

.prose h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--c-dark);
  margin: 2em 0 .6em;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--c-border);
}
.prose h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-dark);
  margin: 1.5em 0 .5em;
}
.prose p {
  margin-bottom: 1em;
  line-height: 1.75;
}
.prose ul, .prose ol {
  margin: .8em 0 1em 1.5em;
  list-style: disc;
}
.prose ol { list-style: decimal; }
.prose li { margin-bottom: .4em; line-height: 1.65; }
.prose a { color: var(--c-primary); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--c-dark); }
.prose strong { color: var(--c-dark); }
.prose blockquote {
  border-left: 3px solid var(--c-primary);
  padding: 10px 16px;
  margin: 1.2em 0;
  background: #fff0f3;
  border-radius: 0 8px 8px 0;
  color: var(--c-text-muted);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.9rem;
}
.prose th, .prose td {
  padding: 8px 12px;
  border: 1px solid var(--c-border);
  text-align: left;
}
.prose th { background: #fff0f3; font-weight: 700; }
.prose code {
  background: #fff0f3;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
}
.prose pre {
  background: var(--c-dark);
  color: var(--c-secondary);
  padding: 16px 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.2em 0;
  font-size: 0.85em;
  line-height: 1.6;
}

/* ===== 栏目页子页（div > article×n） ===== */
.topic-children {
  max-width: 900px;
  padding: 40px 48px;
}

.topic-children h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--c-dark);
}

.topic-content {
  max-width: 780px;
}

/* ===== 文章页 ===== */
.article-hero {
  margin-bottom: 20px;
  border-radius: var(--radius-card);
  overflow: hidden;
}
.article-hero__img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
}

.article-header {
  padding: 36px 48px 24px;
  background: linear-gradient(135deg, #fff5f7 0%, #ffe8ed 100%);
  border-bottom: 1px solid var(--c-border);
}

.article-header h1 {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--c-dark);
  margin-bottom: 10px;
  line-height: 1.28;
}

.article-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.article-date {
  font-size: 0.82rem;
  color: var(--c-text-muted);
}

.article-content {
  max-width: 780px;
}

.article-footer-nav {
  padding: 32px 48px 40px;
  background: #fff0f3;
  border-top: 1px solid var(--c-border);
}

.article-footer-nav h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--c-dark);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tag-list li a {
  display: inline-block;
  padding: 7px 16px;
  min-height: 36px;
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--c-primary);
  transition: background var(--transition), border-color var(--transition);
}
.tag-list li a:hover {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}

/* ===== about 页 ===== */
.about-links {
  padding: 32px 48px 40px;
  background: #fff0f3;
  border-top: 1px solid var(--c-border);
  max-width: 780px;
}
.about-links h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--c-dark);
}
.about-nav-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.about-nav-list li {
  font-size: 0.95rem;
  color: var(--c-text-muted);
  line-height: 1.5;
}
.about-nav-list li a {
  color: var(--c-primary);
  font-weight: 700;
}

/* ===== privacy 页 ===== */
.privacy-content {
  max-width: 780px;
}
.privacy-links {
  padding: 32px 48px 40px;
  max-width: 780px;
}
.privacy-links h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--c-dark);
}
.plain-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plain-list li a {
  color: var(--c-primary);
  font-size: 0.95rem;
}

/* ===== 页脚（footer 单行 logo + nav + copyright） ===== */
.site-footer {
  background: var(--c-dark);
  color: var(--c-aside-text);
  margin-left: var(--aside-w);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 48px;
}

.footer__left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer__brand {
  color: var(--c-primary);
  font-weight: 700;
  font-size: 0.92rem;
}
.footer__brand:hover { color: var(--c-secondary); }

.footer__copy {
  font-size: 0.8rem;
  color: rgba(253,232,237,.55);
}

.footer__nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.footer__nav a {
  color: var(--c-aside-link);
  font-size: 0.85rem;
  padding: 6px 0;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  transition: color var(--transition);
}
.footer__nav a:hover { color: #fff; }
.footer__nav a:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===== 点阵底纹（点缀） ===== */
.home-topics {
  background-image: radial-gradient(circle, rgba(235,135,156,.15) 1px, transparent 1px);
  background-size: 20px 20px;
  background-color: #fff0f3;
}

/* ===== 动效 ===== */
@media (prefers-reduced-motion: no-preference) {
  .card {
    animation: fadeUp 280ms ease both;
  }
  .topic-grid .card:nth-child(1) { animation-delay: 0ms; }
  .topic-grid .card:nth-child(2) { animation-delay: 60ms; }
  .topic-grid .card:nth-child(3) { animation-delay: 120ms; }
  .topic-grid .card:nth-child(4) { animation-delay: 180ms; }
  .article-grid .card:nth-child(1) { animation-delay: 0ms; }
  .article-grid .card:nth-child(2) { animation-delay: 60ms; }
  .article-grid .card:nth-child(3) { animation-delay: 120ms; }
  .article-grid .card:nth-child(4) { animation-delay: 180ms; }
  .article-grid .card:nth-child(5) { animation-delay: 240ms; }
  .article-grid .card:nth-child(6) { animation-delay: 300ms; }

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

  .hero__tile--1 {
    animation: tileFloat 4s ease-in-out infinite alternate;
  }
  .hero__tile--2 {
    animation: tileFloat 4s ease-in-out 1s infinite alternate-reverse;
  }
  @keyframes tileFloat {
    from { transform: rotate(-3deg) translateY(0); }
    to   { transform: rotate(-3deg) translateY(-6px); }
  }
}

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

/* ===== 响应式 ===== */

/* 平板 */
@media (max-width: 900px) {
  :root { --aside-w: 180px; }
  .hero__inner { padding: 36px 32px; gap: 24px; }
  .home-content, .home-topics, .home-articles { padding: 36px 32px; }
  .page-header, .article-header { padding: 28px 32px 20px; }
  .prose { padding: 32px 32px; }
  .topic-children { padding: 32px 32px; }
  .article-footer-nav { padding: 24px 32px 32px; }
  .about-links { padding: 24px 32px 32px; }
  .footer__inner { padding: 16px 32px; }
}

/* 移动端 */
@media (max-width: 640px) {
  :root { --aside-w: 0px; }

  .site-aside {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    overflow: visible;
    padding: 0;
  }

  .aside__brand {
    padding: 12px 16px;
    border-bottom: none;
    border-right: 1px solid rgba(255,182,193,.15);
  }

  .aside__nav {
    flex: 1;
    padding: 8px 12px;
    overflow-x: auto;
  }

  .aside__nav ul {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    padding-bottom: 4px;
  }

  .aside__nav li a {
    white-space: nowrap;
    padding: 10px 12px;
    font-size: 0.82rem;
    min-height: 42px;
  }

  .aside__related,
  .aside__topics {
    display: none;
  }

  .page-wrap {
    margin-left: 0;
  }

  .site-footer {
    margin-left: 0;
  }

  .hero { min-height: auto; }
  .hero__inner {
    padding: 32px 20px;
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
  }
  .hero__tiles {
    width: 100%;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .hero__tile { height: 60px; }

  .home-content, .home-topics, .home-articles { padding: 28px 20px; }
  .page-header, .article-header { padding: 24px 20px 16px; }
  .prose { padding: 24px 20px; }
  .topic-children { padding: 24px 20px; }
  .article-footer-nav { padding: 20px 20px 28px; }
  .about-links { padding: 20px 20px 28px; }
  .privacy-links { padding: 20px 20px 28px; }

  .footer__inner {
    padding: 16px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .footer__nav {
    gap: 14px;
  }

  .topic-grid,
  .article-grid {
    grid-template-columns: 1fr;
  }

  .tag-list { gap: 8px; }
}

@media (max-width: 400px) {
  html { font-size: 16px; }
  .aside__nav li a { font-size: 0.78rem; padding: 10px 10px; }
}
