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

/* ============================
   CSS 自定义属性
   ============================ */
:root {
  --c-white: #ffffff;
  --c-light: #f5f5f5;
  --c-ink: #1f1f1f;
  --c-ink-60: rgba(31,31,31,0.6);
  --c-ink-15: rgba(31,31,31,0.15);
  --c-ink-06: rgba(31,31,31,0.06);
  --c-accent: #1f1f1f;
  --c-accent-hover: #3a3a3a;
  --radius-card: 28px;
  --radius-pill: 999px;
  --radius-sm: 12px;
  --sidebar-w: 240px;
  --gap: 16px;
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
  --font-serif: 'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --font-sans: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', system-ui, sans-serif;
}

/* ============================
   重置
   ============================ */
*, *::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(--c-light);
  color: var(--c-ink);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, menu { list-style: none; }

/* ============================
   布局外壳
   ============================ */
.layout-shell {
  display: flex;
  min-height: 100vh;
}

/* ============================
   左侧固定导航
   ============================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--c-white);
  border-right: 1.5px solid var(--c-ink-15);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0;
}

.sidebar-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sidebar-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 20px 20px;
  cursor: pointer;
  list-style: none;
  border-bottom: 1px solid var(--c-ink-15);
  user-select: none;
}
.sidebar-summary::-webkit-details-marker { display: none; }

.sidebar-brand-mark {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--c-ink);
  line-height: 1.3;
  word-break: break-all;
}

.sidebar-toggle-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  position: relative;
}
.sidebar-toggle-icon::before,
.sidebar-toggle-icon::after {
  content: '';
  position: absolute;
  left: 3px;
  width: 12px;
  height: 2px;
  background: var(--c-ink);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.sidebar-toggle-icon::before { top: 6px; }
.sidebar-toggle-icon::after { top: 10px; }
.sidebar-details[open] .sidebar-toggle-icon::before { transform: rotate(45deg) translate(2px, 2px); }
.sidebar-details[open] .sidebar-toggle-icon::after { transform: rotate(-45deg) translate(2px, -2px); }

.sidebar-menu {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-pill {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--c-ink-60);
  transition: background var(--transition), color var(--transition);
  line-height: 1.4;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.nav-pill:hover {
  background: var(--c-light);
  color: var(--c-ink);
}
.nav-pill--active {
  background: var(--c-ink);
  color: var(--c-white);
  font-weight: 700;
}
.nav-pill--active:hover {
  background: var(--c-accent-hover);
  color: var(--c-white);
}

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

/* ============================
   公告栏/面包屑
   ============================ */
.page-announce {
  background: var(--c-ink);
  color: var(--c-white);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 10px 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}
.breadcrumb-link {
  color: rgba(255,255,255,0.7);
  transition: color var(--transition);
}
.breadcrumb-link:hover { color: var(--c-white); }

/* ============================
   Hero（首页专用）
   ============================ */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 480px;
  background: var(--c-ink);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  overflow: hidden;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(31,31,31,0.92) 0%, rgba(31,31,31,0.6) 60%, rgba(31,31,31,0.3) 100%);
  z-index: 1;
}
.hero__content {
  position: relative;
  z-index: 2;
  text-align: right;
  padding: 64px 56px;
  max-width: 640px;
}
.hero__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 700;
  color: var(--c-white);
  line-height: 1.25;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}
.hero__sub {
  font-size: 16px;
  color: rgba(255,255,255,0.75);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 480px;
  margin-left: auto;
}
.hero__cta {
  display: inline-flex;
  align-items: center;
  padding: 14px 28px;
  background: var(--c-white);
  color: var(--c-ink);
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: background var(--transition), transform var(--transition);
  min-height: 48px;
}
.hero__cta:hover {
  background: var(--c-light);
  transform: translateY(-2px);
}

/* ============================
   内容主区（两栏）
   ============================ */
.content-main {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  padding: 40px 32px;
  flex: 1;
  align-items: start;
}
.content-main--entry {
  grid-template-columns: 1fr 260px;
}
.content-main--narrow {
  grid-template-columns: 1fr 240px;
  max-width: 1100px;
}

/* ============================
   Bento 网格
   ============================ */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 200px;
  gap: var(--gap);
  margin-top: 24px;
}
.bento-grid--cat {
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 180px;
}
.bento-grid--tag {
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 180px;
}

.bento-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  background: var(--c-white);
  border: 1.5px solid var(--c-ink-15);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  overflow: hidden;
  position: relative;
}
.bento-card:hover {
  transform: scale(1.02);
  border-color: var(--c-ink-60);
  box-shadow: 0 8px 24px var(--c-ink-06);
}
.bento-card--wide {
  grid-column: span 2;
}
.bento-card--tall {
  grid-row: span 2;
}
.bento-card__title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1.35;
  display: block;
  margin-bottom: 8px;
}
.bento-card__desc {
  font-size: 13px;
  color: var(--c-ink-60);
  line-height: 1.5;
  display: block;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bento-card__arrow {
  font-size: 18px;
  color: var(--c-ink-60);
  transition: transform var(--transition), color var(--transition);
  align-self: flex-end;
}
.bento-card:hover .bento-card__arrow {
  transform: translateX(4px);
  color: var(--c-ink);
}
.card-date {
  font-size: 11px;
  color: var(--c-ink-60);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  display: block;
}

/* ============================
   侧边栏右侧
   ============================ */
.sidebar-right {
  background: var(--c-white);
  border: 1.5px solid var(--c-ink-15);
  border-radius: var(--radius-card);
  padding: 24px 20px;
  position: sticky;
  top: 24px;
}
.sidebar-right h2 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  margin-top: 20px;
}
.sidebar-right h2:first-child { margin-top: 0; }
.sidebar-right .subtitle {
  font-size: 12px;
  color: var(--c-ink-60);
  margin-bottom: 12px;
}

.quick-links { display: flex; flex-direction: column; gap: 4px; }
.quick-link-item {
  display: block;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--c-ink-60);
  transition: background var(--transition), color var(--transition);
  min-height: 40px;
  display: flex;
  align-items: center;
  line-height: 1.4;
}
.quick-link-item:hover {
  background: var(--c-light);
  color: var(--c-ink);
}
.aside-cat-link {
  color: var(--c-ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================
   h2 + .subtitle 装饰结构
   ============================ */
h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1.35;
  margin-bottom: 6px;
}
.subtitle {
  font-size: 14px;
  color: var(--c-ink-60);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ============================
   正文 prose
   ============================ */
.prose {
  font-size: 16px;
  line-height: 1.8;
  color: var(--c-ink);
  margin-top: 40px;
}
.prose h2 { margin-top: 36px; margin-bottom: 8px; }
.prose h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 8px;
}
.prose p { margin-bottom: 16px; }
.prose ul, .prose ol { margin-left: 20px; margin-bottom: 16px; }
.prose li { margin-bottom: 6px; }
.prose a {
  color: var(--c-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--c-ink-60);
  transition: text-decoration-color var(--transition);
}
.prose a:hover { text-decoration-color: var(--c-ink); }
.prose strong { font-weight: 700; }
.prose blockquote {
  border-left: 3px solid var(--c-ink-15);
  padding-left: 16px;
  color: var(--c-ink-60);
  margin: 20px 0;
}

/* ============================
   H1 样式（各页面类型）
   ============================ */
.cat-h1, .entry-h1, .tag-h1, .about-h1, .privacy-h1 {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

/* ============================
   页面段落
   ============================ */
.cat-header-section, .entry-header-section, .tag-header-section,
.about-header-section, .privacy-header-section {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--c-ink-15);
  margin-bottom: 32px;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}
.page-date {
  font-size: 12px;
  color: var(--c-ink-60);
  letter-spacing: 0.04em;
}

/* ============================
   Hero 图（entry 页）
   ============================ */
.entry-hero {
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: 24px;
  max-height: 360px;
}
.entry-hero-img {
  width: 100%;
  height: 360px;
  object-fit: cover;
}

/* ============================
   About 页面 Bento 统计
   ============================ */
.stats-bento {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--gap);
  margin-top: 20px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--c-white);
  border: 1.5px solid var(--c-ink-15);
  border-radius: var(--radius-card);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 120px;
}
.stat-card--wide { grid-column: span 1; }
.stat-num {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1;
  margin-bottom: 8px;
}
.stat-label {
  font-size: 13px;
  color: var(--c-ink-60);
  font-weight: 500;
}

/* ============================
   Privacy 提示卡
   ============================ */
.notice-card {
  background: var(--c-light);
  border: 1.5px solid var(--c-ink-15);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.7;
}

/* ============================
   页脚
   ============================ */
.site-footer {
  background: var(--c-ink);
  color: var(--c-white);
  padding: 40px 32px 28px;
  margin-top: auto;
}
.footer-address {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  font-style: normal;
}
.footer-brand {
  font-family: var(--font-serif);
  font-size: clamp(24px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--c-white);
  line-height: 1;
}
.footer-tagline {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  line-height: 1.5;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-bottom: 20px;
  list-style: none;
}
.footer-links li a {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  transition: background var(--transition), color var(--transition);
  min-height: 40px;
}
.footer-links li a:hover {
  background: rgba(255,255,255,0.1);
  color: var(--c-white);
}
.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  text-align: center;
  line-height: 1.6;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  margin-top: 8px;
}

/* ============================
   子页列表（块状 a > strong 结构）
   ============================ */
.block-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.block-link-list > a {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--c-white);
  border: 1.5px solid var(--c-ink-15);
  border-radius: var(--radius-card);
  min-width: 180px;
  transition: border-color var(--transition), transform var(--transition);
}
.block-link-list > a:hover {
  border-color: var(--c-ink);
  transform: translateY(-2px);
}
.block-link-list > a > strong {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--c-ink);
  margin-bottom: 6px;
  display: block;
}
.block-link-list > a > span {
  font-size: 12px;
  color: var(--c-ink-60);
  line-height: 1.5;
}

/* ============================
   滚动视差 & Stagger 动效
   ============================ */
@media (prefers-reduced-motion: no-preference) {
  .bento-card {
    animation: fadeUp 0.5s ease both;
  }
  .bento-card:nth-child(1) { animation-delay: 0.05s; }
  .bento-card:nth-child(2) { animation-delay: 0.1s; }
  .bento-card:nth-child(3) { animation-delay: 0.15s; }
  .bento-card:nth-child(4) { animation-delay: 0.2s; }
  .bento-card:nth-child(5) { animation-delay: 0.25s; }
  .bento-card:nth-child(6) { animation-delay: 0.3s; }
  .stat-card {
    animation: fadeUp 0.5s ease both;
  }
  .stat-card:nth-child(1) { animation-delay: 0.05s; }
  .stat-card:nth-child(2) { animation-delay: 0.1s; }
  .stat-card:nth-child(3) { animation-delay: 0.15s; }
  .hero__content {
    animation: fadeRight 0.8s ease both;
  }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes fadeRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================
   响应式 — tablet
   ============================ */
@media (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .content-main { grid-template-columns: 1fr 220px; gap: 20px; padding: 28px 20px; }
  .stats-bento { grid-template-columns: 1fr 1fr; }
  .stat-card--wide { grid-column: span 2; }
}

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

  .layout-shell { flex-direction: column; }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1.5px solid var(--c-ink-15);
    z-index: 100;
  }

  .sidebar-details {
    flex-direction: column;
  }

  .sidebar-menu {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 10px 12px 14px;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-brand-mark {
    font-size: 12px;
  }

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

  .hero {
    height: 100vh;
    min-height: 480px;
  }
  .hero__content {
    padding: 32px 20px 40px;
    max-width: 100%;
    text-align: right;
  }

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

  .sidebar-right {
    margin-top: 32px;
    position: static;
  }

  .bento-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
  .bento-grid--cat, .bento-grid--tag {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
  .bento-card {
    min-height: 140px;
  }
  .bento-card--wide, .bento-card--tall {
    grid-column: span 1;
    grid-row: span 1;
  }

  .stats-bento {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-card--wide { grid-column: span 2; }

  .site-footer { padding: 28px 16px 20px; }
  .footer-links { gap: 4px; }
  .footer-brand { font-size: 28px; }

  .page-announce { padding: 10px 16px; }

  h2 { font-size: 19px; }
  .cat-h1, .entry-h1, .tag-h1, .about-h1, .privacy-h1 { font-size: 24px; }
}

@media (max-width: 480px) {
  .hero__title { font-size: 26px; }
  .hero__cta { width: 100%; justify-content: center; }
  .block-link-list { flex-direction: column; }
  .block-link-list > a { min-width: 0; }
}
