@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

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

:root {
  --c-black: #000000;
  --c-white: #ffffff;
  --c-accent: #000000;
  --c-grey-100: #f5f5f5;
  --c-grey-200: #e8e8e8;
  --c-grey-400: #999999;
  --c-grey-600: #555555;
  --c-grey-800: #222222;
  --font-sans: 'IBM Plex Sans', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --sidebar-w: 260px;
  --base: 8px;
  --radius-card: 28px;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

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

body {
  font-family: var(--font-sans);
  background: var(--c-white);
  color: var(--c-black);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ── 布局骨架 ────────────────────────────────── */
.site-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ── 侧边栏 ──────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--c-black);
  color: var(--c-white);
  display: flex;
  flex-direction: column;
  z-index: 100;
  border-right: 1px solid #111;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: calc(var(--base) * 4);
}

.brand-block {
  padding-bottom: calc(var(--base) * 4);
  border-bottom: 1px solid #333;
  margin-bottom: calc(var(--base) * 4);
}

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

.brand-text {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
  color: var(--c-white);
  line-height: 1.2;
}

.logo-img {
  max-width: 160px;
  height: auto;
}

.brand-tagline {
  margin-top: calc(var(--base) * 1.5);
  font-size: 0.72rem;
  color: var(--c-grey-400);
  font-family: var(--font-mono);
  line-height: 1.5;
  letter-spacing: 0.02em;
}

/* 导航 */
aside nav ul {
  display: flex;
  flex-direction: column;
  gap: calc(var(--base) * 0.5);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: calc(var(--base) * 1.5);
  padding: calc(var(--base) * 1.5) calc(var(--base) * 2);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c-grey-400);
  letter-spacing: 0.03em;
  transition: background var(--transition), color var(--transition);
  min-height: 44px;
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--c-white);
  transform: scaleY(0);
  transition: transform var(--transition);
}

.nav-link:hover,
.nav-link:focus-visible {
  background: #1a1a1a;
  color: var(--c-white);
  outline: none;
}

.nav-link:hover::before,
.nav-link:focus-visible::before {
  transform: scaleY(1);
}

.nav-num {
  display: none;
}

.nav-text {
  flex: 1;
}

/* 公告条 */
.sidebar-footer-note {
  margin-top: auto;
  padding-top: calc(var(--base) * 4);
  border-top: 1px solid #222;
  display: flex;
  flex-direction: column;
  gap: calc(var(--base));
}

.notice-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--c-grey-600);
  text-transform: uppercase;
}

.notice-text {
  font-size: 0.72rem;
  color: var(--c-grey-400);
  line-height: 1.5;
}

/* ── 内容区 ──────────────────────────────────── */
.content-area {
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Hero ─────────────────────────────────────── */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: calc(var(--base) * 8) calc(var(--base) * 6);
  background: var(--c-black);
  position: relative;
  overflow: hidden;
  scroll-margin-top: 0;
}

.hero-section::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 120px;
  background: var(--c-white);
  clip-path: polygon(0 60%, 100% 0, 100% 100%, 0 100%);
  z-index: 1;
}

/* 大字装饰背景 */
.hero-section::after {
  content: 'HANIME';
  position: absolute;
  top: 50%;
  left: -20px;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: clamp(80px, 18vw, 220px);
  font-weight: 700;
  color: #111;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  letter-spacing: -0.06em;
  white-space: nowrap;
  z-index: 0;
}

.hero-article {
  position: relative;
  z-index: 2;
  text-align: right;
  max-width: 700px;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--c-grey-600);
  text-transform: uppercase;
  margin-bottom: calc(var(--base) * 2);
}

.hero-article h1 {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-weight: 700;
  color: var(--c-white);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: calc(var(--base) * 3);
}

.hero-sub {
  font-size: 1rem;
  color: var(--c-grey-400);
  line-height: 1.7;
  max-width: 480px;
  margin-left: auto;
  margin-bottom: calc(var(--base) * 4);
}

.hero-divider {
  width: 48px;
  height: 2px;
  background: var(--c-white);
  margin-left: auto;
}

/* ── 正文内容区 ───────────────────────────────── */
.content-section {
  padding: calc(var(--base) * 10) calc(var(--base) * 6);
}

.prose {
  max-width: 900px;
  margin: 0 auto;
}

/* section 内容区间距 */
.prose section {
  scroll-margin-top: 80px;
  padding-top: calc(var(--base) * 6);
  padding-bottom: calc(var(--base) * 8);
  border-bottom: 1px solid var(--c-grey-200);
}

.prose section:last-child {
  border-bottom: none;
}

/* 正文排版 */
.prose h2 {
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: calc(var(--base) * 2);
  color: var(--c-black);
}

.prose h3 {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: calc(var(--base) * 4);
  margin-bottom: calc(var(--base) * 2);
  color: var(--c-grey-800);
}

.prose p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-grey-800);
  margin-bottom: calc(var(--base) * 2.5);
  max-width: 72ch;
}

.prose ul, .prose ol {
  list-style: disc;
  padding-left: calc(var(--base) * 3);
  margin-bottom: calc(var(--base) * 2.5);
}

.prose li {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--c-grey-800);
  margin-bottom: calc(var(--base));
}

.prose a {
  color: var(--c-black);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity var(--transition);
}

.prose a:hover { opacity: 0.6; }

.prose strong { font-weight: 600; }

.prose blockquote {
  border-left: 3px solid var(--c-black);
  margin-left: 0;
  padding-left: calc(var(--base) * 3);
  color: var(--c-grey-600);
  font-style: italic;
  margin-bottom: calc(var(--base) * 2.5);
}

/* p.subtitle, p.subhead, p.desc, p.lead */
.prose h2 + p.subtitle,
.prose h2 + p.subhead,
.prose h2 + p.desc,
.prose h2 + p.lead,
p.subtitle, p.subhead, p.desc, p.lead {
  font-size: 1rem;
  color: var(--c-grey-600);
  margin-bottom: calc(var(--base) * 3);
  line-height: 1.7;
  font-style: italic;
  max-width: 60ch;
}

/* 卡片样式（正文内如有） */
.prose .card {
  border: 1px solid var(--c-grey-200);
  border-radius: var(--radius-card);
  padding: calc(var(--base) * 3);
  margin-bottom: calc(var(--base) * 3);
  transition: border-color var(--transition), transform var(--transition);
}

.prose .card:hover {
  border-color: var(--c-black);
  transform: translateY(-2px);
}

/* ── 页脚 ─────────────────────────────────────── */
.site-footer {
  background: var(--c-black);
  color: var(--c-white);
  padding: calc(var(--base) * 8) calc(var(--base) * 6) calc(var(--base) * 4);
}

.footer-brand-block {
  padding-bottom: calc(var(--base) * 4);
  border-bottom: 1px solid #222;
  margin-bottom: calc(var(--base) * 6);
  overflow: hidden;
}

.footer-brand-name {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 0.9;
  color: var(--c-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.footer-cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: calc(var(--base) * 6);
  margin-bottom: calc(var(--base) * 6);
}

.footer-col dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--c-grey-600);
  text-transform: uppercase;
  margin-bottom: calc(var(--base) * 2);
  padding-bottom: calc(var(--base));
  border-bottom: 1px solid #222;
}

.footer-col dd {
  font-size: 0.85rem;
  color: var(--c-grey-400);
  line-height: 1.6;
  margin-bottom: calc(var(--base));
}

.footer-col dd a {
  color: var(--c-grey-400);
  transition: color var(--transition);
  display: inline-block;
  min-height: 40px;
  padding-top: 4px;
  padding-bottom: 4px;
  line-height: 2;
}

.footer-col dd a:hover { color: var(--c-white); }

.footer-disclaimer {
  font-size: 0.72rem !important;
  color: var(--c-grey-600) !important;
  margin-top: calc(var(--base) * 2);
  line-height: 1.5 !important;
}

.footer-bottom {
  border-top: 1px solid #222;
  padding-top: calc(var(--base) * 3);
}

.copyright {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--c-grey-600);
  letter-spacing: 0.04em;
}

/* ── Scroll Reveal 动效 ───────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.6s cubic-bezier(0.4,0,0.2,1), transform 0.6s cubic-bezier(0.4,0,0.2,1);
  }
  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
  .reveal-delay-1 { transition-delay: 0.1s; }
  .reveal-delay-2 { transition-delay: 0.2s; }
  .reveal-delay-3 { transition-delay: 0.3s; }

  /* Hover micro-interactions */
  .nav-link {
    position: relative;
    overflow: hidden;
  }
  .nav-link .nav-text {
    transition: transform var(--transition);
  }
  .nav-link:hover .nav-text {
    transform: translateX(4px);
  }

  .footer-col dd a {
    position: relative;
  }
  .footer-col dd a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--c-white);
    transition: width var(--transition);
  }
  .footer-col dd a:hover::after {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ── 响应式 ───────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }

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

  .footer-cols .footer-col:last-child {
    grid-column: 1 / -1;
  }
}

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

  .site-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    transition: left var(--transition);
    z-index: 200;
  }

  .sidebar.open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }

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

  /* 移动端顶部导航条 */
  .content-area::before {
    content: '';
    display: block;
    height: 56px;
  }

  .mobile-header {
    display: flex;
  }

  .hero-section {
    padding: calc(var(--base) * 12) calc(var(--base) * 3) calc(var(--base) * 8);
    align-items: flex-end;
    justify-content: flex-end;
    min-height: 100svh;
  }

  .hero-section::after {
    font-size: 22vw;
    left: -8px;
  }

  .hero-article h1 {
    font-size: clamp(1.6rem, 8vw, 3rem);
  }

  .content-section {
    padding: calc(var(--base) * 6) calc(var(--base) * 3);
  }

  .footer-cols {
    grid-template-columns: 1fr;
    gap: calc(var(--base) * 4);
  }

  .footer-cols .footer-col:last-child {
    grid-column: auto;
  }

  .site-footer {
    padding: calc(var(--base) * 6) calc(var(--base) * 3) calc(var(--base) * 4);
  }
}

/* 移动端顶栏 */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--c-black);
  z-index: 150;
  align-items: center;
  justify-content: space-between;
  padding: 0 calc(var(--base) * 2);
  border-bottom: 1px solid #222;
}

.mobile-brand {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--c-white);
  letter-spacing: -0.02em;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  border-radius: 4px;
  transition: background var(--transition);
}

.menu-toggle:hover { background: #1a1a1a; }

.menu-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--c-white);
  transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 190;
}

.overlay.show { display: block; }

/* section scroll offset */
section[id] {
  scroll-margin-top: 56px;
}

@media (min-width: 769px) {
  section[id] {
    scroll-margin-top: 24px;
  }
  .mobile-header { display: none !important; }
}
