@import url('https://fonts.googleapis.com/css2?family=Didact+Gothic&family=Poiret+One&display=swap');

/* ============================================
   CSS 变量 & 基础重置
   ============================================ */
:root {
  --clr-primary: #c8e0f4;
  --clr-rose: #f5e0e8;
  --clr-ink: #171f26;
  --clr-bg: #d4e8f5;
  --clr-bg-alt: #e8d8e8;
  --clr-surface: #cfe2f3;
  --clr-surface-rose: #f0d8e4;
  --clr-muted: #5a6a7a;
  --clr-accent: #9bb8d4;
  --clr-ink-light: #2e3e50;

  --shadow-out:
    -5px -5px 15px rgba(255,255,255,0.75),
    5px 5px 15px rgba(0,0,0,0.12);
  --shadow-in:
    inset -3px -3px 8px rgba(255,255,255,0.7),
    inset 3px 3px 8px rgba(0,0,0,0.1);
  --shadow-out-rose:
    -5px -5px 15px rgba(255,255,255,0.7),
    5px 5px 15px rgba(180,140,160,0.18);
  --shadow-card:
    -6px -6px 18px rgba(255,255,255,0.8),
    6px 6px 18px rgba(0,0,0,0.1);
  --shadow-card-hover:
    -8px -8px 22px rgba(255,255,255,0.85),
    8px 8px 22px rgba(0,0,0,0.16);

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --font-display: 'Poiret One', 'Didact Gothic', Georgia, serif;
  --font-body: 'Didact Gothic', 'Helvetica Neue', Arial, sans-serif;

  --sidebar-w: 240px;
  --ticker-h: 40px;
  --transition-std: 150ms ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--clr-bg);
  color: var(--clr-ink);
  line-height: 1.7;
  min-height: 100vh;
}

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

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ============================================
   页面骨架
   ============================================ */
.page-shell {
  display: flex;
  min-height: 100vh;
}

/* ============================================
   侧边导航 aside
   ============================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(160deg, var(--clr-primary) 0%, var(--clr-surface) 100%);
  box-shadow: 4px 0 20px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  padding: 28px 16px 20px;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  margin-bottom: 28px;
  text-align: left;
}

.brand-link {
  display: inline-block;
}

.brand-logo {
  width: 120px;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-out);
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--clr-ink);
  letter-spacing: 0.04em;
  display: block;
  padding: 8px 12px;
  background: linear-gradient(145deg, var(--clr-primary), #b4d2ec);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-out);
}

.sidebar-slogan {
  font-size: 0.72rem;
  color: var(--clr-muted);
  margin-top: 10px;
  line-height: 1.5;
  padding: 0 4px;
}

/* 药丸导航组 */
.sidebar-nav ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-pill {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: linear-gradient(145deg, var(--clr-primary), #b8d8f0);
  box-shadow: var(--shadow-out);
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--clr-ink);
  letter-spacing: 0.02em;
  transition: box-shadow var(--transition-std), transform var(--transition-std), background var(--transition-std);
  min-height: 44px;
}

.nav-pill span {
  display: block;
}

.nav-pill:hover {
  background: linear-gradient(145deg, var(--clr-rose), var(--clr-surface-rose));
  box-shadow: var(--shadow-out-rose);
  transform: translateX(4px);
}

.nav-pill:active {
  box-shadow: var(--shadow-in);
  transform: scale(0.97) translateX(2px);
}

.sidebar-footer-note {
  margin-top: auto;
  padding-top: 20px;
  font-size: 0.72rem;
  color: var(--clr-muted);
  text-align: center;
}

/* ============================================
   主内容区
   ============================================ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ============================================
   顶部公告条
   ============================================ */
.top-ticker {
  height: var(--ticker-h);
  background: linear-gradient(90deg, var(--clr-rose) 0%, var(--clr-surface-rose) 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--clr-ink-light);
  position: sticky;
  top: 0;
  z-index: 50;
}

.ticker-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  background: linear-gradient(145deg, #f0d8e4, #e4c8d8);
  border-radius: var(--radius-pill);
  padding: 3px 12px;
  box-shadow: var(--shadow-out-rose);
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}

.ticker-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   Hero
   ============================================ */
.hero-section {
  scroll-margin-top: calc(var(--ticker-h) + 8px);
  min-height: 70vh;
  display: flex;
  align-items: stretch;
  padding: 40px 36px;
  background: linear-gradient(135deg, var(--clr-bg) 0%, #deedf8 50%, var(--clr-rose) 100%);
  position: relative;
  overflow: hidden;
}

.hero-article {
  display: flex;
  width: 100%;
  gap: 40px;
  align-items: center;
}

/* 左侧：错位拼贴 */
.hero-media {
  flex: 1 1 45%;
  position: relative;
}

.hero-collage {
  position: relative;
  width: 100%;
  min-height: 380px;
}

.hero-grid-bg {
  position: absolute;
  inset: -10px;
  background-image:
    repeating-linear-gradient(0deg, rgba(23,31,38,0.05) 0px, rgba(23,31,38,0.05) 1px, transparent 1px, transparent 32px),
    repeating-linear-gradient(90deg, rgba(23,31,38,0.05) 0px, rgba(23,31,38,0.05) 1px, transparent 1px, transparent 32px);
  border-radius: var(--radius-md);
  z-index: 0;
  pointer-events: none;
}

.hero-img {
  position: absolute;
  border-radius: var(--radius-lg);
  object-fit: cover;
}

.hero-img-a {
  width: 62%;
  aspect-ratio: 3/4;
  top: 0;
  left: 0;
  z-index: 2;
  box-shadow: var(--shadow-card);
  transform: rotate(-2deg);
}

.hero-img-b {
  width: 55%;
  aspect-ratio: 3/4;
  bottom: 0;
  right: 0;
  z-index: 3;
  box-shadow: var(--shadow-card);
  transform: rotate(2.5deg) translateY(20px);
}

.hero-placeholder-a,
.hero-placeholder-b {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.hero-placeholder-a {
  position: absolute;
  width: 62%;
  aspect-ratio: 3/4;
  top: 0;
  left: 0;
  z-index: 2;
  background: linear-gradient(145deg, var(--clr-primary), #a8c8e8);
  transform: rotate(-2deg);
}

.hero-placeholder-b {
  position: absolute;
  width: 55%;
  aspect-ratio: 3/4;
  bottom: 0;
  right: 0;
  z-index: 3;
  background: linear-gradient(145deg, var(--clr-rose), #e0c0d0);
  transform: rotate(2.5deg) translateY(20px);
}

/* 右侧：文案右对齐 */
.hero-copy {
  flex: 1 1 50%;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  z-index: 4;
  position: relative;
}

.hero-eyebrow {
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  color: var(--clr-muted);
  background: linear-gradient(145deg, var(--clr-rose), #e8d0dc);
  border-radius: var(--radius-pill);
  padding: 4px 16px;
  box-shadow: var(--shadow-out-rose);
  display: inline-block;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.2;
  color: var(--clr-ink);
  letter-spacing: 0.06em;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.6);
  max-width: 520px;
}

.hero-desc {
  font-size: 1rem;
  color: var(--clr-ink-light);
  max-width: 420px;
  line-height: 1.7;
}

.hero-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--clr-ink);
  background: linear-gradient(145deg, var(--clr-primary), #aacce8);
  box-shadow: var(--shadow-out);
  transition: box-shadow var(--transition-std), transform var(--transition-std);
  min-height: 48px;
}

.hero-cta-btn:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.hero-cta-btn:active {
  box-shadow: var(--shadow-in);
  transform: scale(0.97);
}

/* ============================================
   主内容区 main > div.wrap > article > section
   ============================================ */
.content-main {
  flex: 1;
  padding: 48px 36px;
}

.wrap {
  max-width: 1000px;
  width: 100%;
}

.content-section {
  margin-top: 0;
  scroll-margin-top: calc(var(--ticker-h) + 8px);
}

.prose-article {
  width: 100%;
}

/* ============================================
   正文内容样式（prose）
   ============================================ */
.prose-article h2,
.prose-article h3 {
  font-family: var(--font-display);
  color: var(--clr-ink);
  letter-spacing: 0.04em;
  margin-top: 2.4em;
  margin-bottom: 0.6em;
}

.prose-article h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  line-height: 1.3;
}

.prose-article h3 {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
}

/* h2/h3 后 hr — 结构抽签要求 */
.prose-article h2 + hr,
.prose-article h3 + hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, var(--clr-accent), transparent);
  border-radius: 2px;
  margin-bottom: 1.2em;
}

.prose-article p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--clr-ink-light);
  margin-bottom: 1.1em;
  max-width: 72ch;
}

.prose-article ul,
.prose-article ol {
  padding-left: 1.4em;
  margin-bottom: 1.1em;
}

.prose-article li {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--clr-ink-light);
  margin-bottom: 0.4em;
  list-style: disc;
}

.prose-article ol li {
  list-style: decimal;
}

.prose-article a {
  color: var(--clr-ink);
  border-bottom: 1px solid var(--clr-accent);
  transition: color var(--transition-std), border-color var(--transition-std);
}

.prose-article a:hover {
  color: var(--clr-muted);
  border-color: var(--clr-muted);
}

.prose-article strong {
  color: var(--clr-ink);
  font-weight: 700;
}

/* article 内部区块卡片化 */
.prose-article article {
  background: linear-gradient(145deg, var(--clr-surface), #c2dcf0);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 32px 36px;
  margin-bottom: 36px;
  transition: box-shadow var(--transition-std), transform var(--transition-std);
}

.prose-article article:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

/* 带玫瑰色调的交替卡片 */
.prose-article article:nth-child(even) {
  background: linear-gradient(145deg, var(--clr-surface-rose), #ecd4e0);
  box-shadow: var(--shadow-out-rose);
}

.prose-article article h2:first-child,
.prose-article article h3:first-child {
  margin-top: 0;
}

/* stagger 动画 */
@keyframes stagger-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.prose-article article {
  animation: stagger-in 0.45s ease both;
}

.prose-article article:nth-child(1) { animation-delay: 0.05s; }
.prose-article article:nth-child(2) { animation-delay: 0.12s; }
.prose-article article:nth-child(3) { animation-delay: 0.19s; }
.prose-article article:nth-child(4) { animation-delay: 0.26s; }
.prose-article article:nth-child(5) { animation-delay: 0.33s; }
.prose-article article:nth-child(6) { animation-delay: 0.40s; }
.prose-article article:nth-child(7) { animation-delay: 0.47s; }

@media (prefers-reduced-motion: reduce) {
  .prose-article article {
    animation: none;
  }
}

/* article scroll-margin */
.prose-article article[id],
article[id] {
  scroll-margin-top: calc(var(--ticker-h) + 16px);
}

/* ============================================
   页脚 footer
   ============================================ */
.site-footer {
  background: linear-gradient(160deg, var(--clr-primary) 0%, var(--clr-rose) 100%);
  padding: 48px 36px 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  max-width: 1000px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(23,31,38,0.1);
}

.footer-col dt {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--clr-ink);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(23,31,38,0.15);
}

.footer-col dd {
  font-size: 0.82rem;
  color: var(--clr-muted);
  line-height: 1.6;
  margin-bottom: 6px;
}

.footer-col dd a {
  color: var(--clr-muted);
  transition: color var(--transition-std);
  display: inline-flex;
  align-items: center;
  padding: 6px 0;
  min-height: 40px;
  line-height: 1.5;
}

.footer-col dd a:hover {
  color: var(--clr-ink);
}

.footer-bottom {
  padding: 16px 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--clr-muted);
}

/* ============================================
   响应式 — 平板
   ============================================ */
@media (max-width: 900px) {
  :root {
    --sidebar-w: 200px;
  }

  .hero-section {
    min-height: 60vh;
    padding: 28px 20px;
  }

  .hero-article {
    gap: 24px;
  }

  .content-main {
    padding: 32px 20px;
  }

  .footer-inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   响应式 — 手机 (≤ 768px)
   ============================================ */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
  }

  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 8px 12px;
    z-index: 200;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
  }

  .sidebar-brand {
    display: none;
  }

  .sidebar-footer-note {
    display: none;
  }

  .sidebar-nav {
    width: 100%;
  }

  .sidebar-nav ul {
    flex-direction: row;
    gap: 6px;
    white-space: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .sidebar-nav ul li {
    flex-shrink: 0;
  }

  .nav-pill {
    font-size: 0.82rem;
    padding: 8px 14px;
    min-height: 44px;
    white-space: nowrap;
  }

  .nav-pill:hover {
    transform: none;
  }

  .main-wrapper {
    margin-left: 0;
    padding-bottom: 70px;
  }

  .hero-section {
    min-height: auto;
    padding: 24px 16px 32px;
  }

  .hero-article {
    flex-direction: column;
    gap: 24px;
  }

  .hero-media {
    flex: none;
    width: 100%;
  }

  .hero-collage {
    min-height: 260px;
  }

  .hero-copy {
    flex: none;
    width: 100%;
    text-align: left;
    align-items: flex-start;
  }

  .hero-copy h1 {
    font-size: 1.8rem;
  }

  .content-main {
    padding: 24px 16px;
  }

  .prose-article article {
    padding: 20px 18px;
    margin-bottom: 20px;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 28px 0;
  }

  .site-footer {
    padding: 28px 16px 0;
    margin-bottom: 70px;
  }

  .top-ticker {
    font-size: 0.76rem;
    padding: 0 12px;
    gap: 8px;
  }
}

/* ============================================
   手机极小宽 375px 保障
   ============================================ */
@media (max-width: 400px) {
  .hero-copy h1 {
    font-size: 1.5rem;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .hero-cta-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   微交互 — hover 卡片浮起
   ============================================ */
.footer-col {
  background: linear-gradient(145deg, rgba(255,255,255,0.25), rgba(255,255,255,0.05));
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-out);
  transition: box-shadow var(--transition-std), transform var(--transition-std);
}

.footer-col:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}

/* ============================================
   辅助
   ============================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   滚动条美化（非 Firefox）
   ============================================ */
.sidebar::-webkit-scrollbar,
.sidebar-nav ul::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
.sidebar::-webkit-scrollbar-track,
.sidebar-nav ul::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb,
.sidebar-nav ul::-webkit-scrollbar-thumb {
  background: rgba(23,31,38,0.15);
  border-radius: 4px;
}
