@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');

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

:root {
  --c-paper: #fafaf8;
  --c-mid: #4a4a4a;
  --c-ink: #1a1a1a;
  --c-accent: #2e2e2e;
  --c-rule: #c8c4bc;
  --c-light: #f0ede8;
  --c-shadow: rgba(26,26,26,0.12);
  --ff-serif: 'Noto Serif JP', 'Georgia', serif;
  --ff-sans: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Meiryo', system-ui, sans-serif;
  --nav-h: 80px;
  --topbar-h: 36px;
  --radius: 0;
}

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

html, body {
  background: var(--c-paper);
  color: var(--c-ink);
  font-family: var(--ff-sans);
  line-height: 1.7;
  min-height: 100%;
}

body.raw-texture {
  background-color: var(--c-paper);
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(26,26,26,0.015) 2px,
      rgba(26,26,26,0.015) 3px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 40px,
      rgba(26,26,26,0.008) 40px,
      rgba(26,26,26,0.008) 41px
    );
}

a { color: var(--c-ink); text-decoration: underline; text-underline-offset: 3px; }
a:hover { opacity: 0.7; }
img { display: block; max-width: 100%; height: auto; }
ul, menu { list-style: none; }
button { cursor: pointer; font-family: var(--ff-sans); }
h1,h2,h3,h4 { font-family: var(--ff-serif); line-height: 1.3; }

/* ===== 滚动补偿 ===== */
div[id] { scroll-margin-top: calc(var(--topbar-h) + var(--nav-h) + 16px); }

/* ===== 整体包裹 ===== */
.site-wrap { min-height: 100vh; display: flex; flex-direction: column; }

/* ===== 公告条 ===== */
.topbar-announce {
  height: var(--topbar-h);
  background: var(--c-ink);
  color: var(--c-paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-family: var(--ff-sans);
  letter-spacing: 0.05em;
  padding: 0 16px;
  text-align: center;
  border-bottom: 2px solid var(--c-mid);
}

/* ===== 页头 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--c-paper);
  border-bottom: 2px solid var(--c-ink);
  box-shadow: 0 2px 0 var(--c-rule), 0 4px 12px var(--c-shadow);
}

.header-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--c-rule);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo-img { width: 40px; height: 40px; object-fit: contain; }

.brand-name {
  font-family: var(--ff-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-ink);
  letter-spacing: -0.02em;
  transform: rotate(-0.5deg);
  display: inline-block;
}

/* 汉堡按钮 */
.hamburger-btn {
  background: none;
  border: 2px solid var(--c-ink);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
}

.ham-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-ink);
  transition: none;
}

.hamburger-btn[aria-expanded="true"] .ham-line:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger-btn[aria-expanded="true"] .ham-line:nth-child(2) { opacity: 0; }
.hamburger-btn[aria-expanded="true"] .ham-line:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* 头部第二行：details 导航 */
.header-nav-row {
  padding: 0 24px;
  background: var(--c-light);
  border-top: 1px solid var(--c-rule);
}

.nav-details {
  border: none;
  outline: none;
}

.nav-details[open] {}

.nav-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  font-family: var(--ff-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--c-mid);
  letter-spacing: 0.08em;
  cursor: pointer;
  list-style: none;
  min-height: 44px;
}

.nav-summary::-webkit-details-marker { display: none; }
.nav-label { text-transform: none; }
.nav-arrow { font-size: 11px; }

.nav-menu-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 8px 0 12px;
}

.nav-menu-inline li a {
  font-size: 13px;
  font-family: var(--ff-sans);
  color: var(--c-ink);
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid var(--c-rule);
  display: block;
  min-height: 40px;
  display: flex;
  align-items: center;
  background: var(--c-paper);
  transform: rotate(-0.3deg);
}

.nav-menu-inline li:nth-child(even) a { transform: rotate(0.4deg); }
.nav-menu-inline li a:hover { background: var(--c-ink); color: var(--c-paper); }

/* ===== 全屏遮罩菜单 ===== */
.fullscreen-nav {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: var(--c-ink);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 40px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.fullscreen-nav.is-open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.fullscreen-nav-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: 2px solid var(--c-paper);
  color: var(--c-paper);
  font-size: 20px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-nav-close:hover { background: var(--c-paper); color: var(--c-ink); }

.fullscreen-nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fullscreen-nav-list li a {
  font-family: var(--ff-serif);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 600;
  color: var(--c-paper);
  text-decoration: none;
  letter-spacing: -0.01em;
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid rgba(250,250,248,0.15);
  min-height: 48px;
  display: flex;
  align-items: center;
}

.fullscreen-nav-list li a:hover { color: var(--c-rule); padding-left: 12px; }

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 850;
  background: rgba(26,26,26,0.5);
}
.nav-overlay.is-active { display: block; }

/* ===== Hero ===== */
.hero-section {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: flex-start;
  padding: clamp(48px, 8vw, 100px) clamp(20px, 5vw, 80px) clamp(40px, 6vw, 80px);
  overflow: hidden;
  border-bottom: 3px solid var(--c-ink);
  background: var(--c-paper);
}

/* 点阵底纹 */
.hero-dotgrid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--c-rule) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.45;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
}

.hero-h1 {
  font-family: var(--ff-serif);
  font-size: clamp(2rem, 6vw, 3.8rem);
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  transform: rotate(-0.8deg);
}

.hero-sub {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--c-mid);
  margin-bottom: 32px;
  max-width: 480px;
  line-height: 1.7;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  padding: 14px 28px;
  background: var(--c-ink);
  color: var(--c-paper);
  font-family: var(--ff-sans);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border: 2px solid var(--c-ink);
  min-height: 48px;
  letter-spacing: 0.03em;
  transform: rotate(0.5deg);
}

.hero-cta:hover { background: transparent; color: var(--c-ink); opacity: 1; }

/* 胶带装饰 */
.hero-tape {
  position: absolute;
  width: 80px;
  height: 22px;
  background: rgba(200,196,188,0.55);
  border: 1px solid var(--c-rule);
  pointer-events: none;
  z-index: 3;
}

.hero-tape-1 { top: 30px; right: 60px; transform: rotate(8deg); }
.hero-tape-2 { bottom: 40px; right: 120px; transform: rotate(-5deg); width: 56px; }

/* ===== 主内容区 ===== */
.site-main { flex: 1; }

/* 结构抽签：main > div > figure/aside 交错 */
.content-section {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--c-ink);
}

.content-with-sidebar {
  align-items: flex-start;
}

/* aside 在内容左侧 */
.content-aside {
  width: 220px;
  min-width: 220px;
  border-right: 2px solid var(--c-ink);
  padding: 32px 20px;
  background: var(--c-light);
  position: sticky;
  top: calc(var(--topbar-h) + var(--nav-h) + 0px);
  max-height: calc(100vh - var(--topbar-h) - var(--nav-h));
  overflow-y: auto;
  align-self: flex-start;
}

.aside-inner {}

.aside-title {
  font-family: var(--ff-serif);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--c-mid);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--c-rule);
  transform: rotate(-0.5deg);
  display: block;
}

.aside-title span { display: inline; }

.aside-toc { display: flex; flex-direction: column; gap: 4px; margin-bottom: 20px; }

.aside-toc li a {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--c-ink);
  text-decoration: none;
  padding: 6px 8px;
  border-left: 2px solid transparent;
  min-height: 40px;
  line-height: 1.4;
}

.aside-toc li a:hover { border-left-color: var(--c-ink); background: rgba(26,26,26,0.04); }

.aside-note {
  font-size: 11px;
  color: var(--c-mid);
  padding: 8px;
  border: 1px dashed var(--c-rule);
  line-height: 1.6;
  transform: rotate(0.4deg);
}

.content-main-col {
  flex: 1;
  min-width: 0;
  padding: 40px clamp(20px, 4vw, 60px);
}

/* 结构抽签：figure */
.content-figure {
  margin-bottom: 32px;
  border-top: 2px solid var(--c-rule);
  border-bottom: 1px solid var(--c-rule);
  padding: 12px 0;
}

.figure-scrawl {
  width: 100%;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    var(--c-rule) 0px,
    var(--c-rule) 4px,
    transparent 4px,
    transparent 12px
  );
  opacity: 0.6;
}

/* ===== page.content 正文样式 ===== */
.page-content-body { max-width: 720px; }

.page-content-body h2 {
  font-family: var(--ff-serif);
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  font-weight: 700;
  color: var(--c-ink);
  margin: 2.5em 0 0.8em;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--c-ink);
  transform: rotate(-0.3deg);
}

.page-content-body h2 span { display: inline; }

.page-content-body h3 {
  font-family: var(--ff-serif);
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  font-weight: 600;
  color: var(--c-ink);
  margin: 1.8em 0 0.6em;
}

.page-content-body h3 span { display: inline; }

.page-content-body p {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.2em;
  color: var(--c-ink);
}

.page-content-body ul, .page-content-body ol {
  margin: 0 0 1.2em 1.4em;
  list-style: disc;
}

.page-content-body ol { list-style: decimal; }

.page-content-body li {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 0.4em;
}

.page-content-body a { color: var(--c-ink); font-weight: 500; }

.page-content-body strong { font-weight: 700; }

.page-content-body blockquote {
  border-left: 3px solid var(--c-ink);
  padding: 12px 20px;
  margin: 1.5em 0;
  background: var(--c-light);
  font-style: italic;
  transform: rotate(-0.3deg);
}

.page-content-body div {
  margin-bottom: 3em;
  padding-bottom: 2em;
  border-bottom: 1px dashed var(--c-rule);
}

.page-content-body div:last-child { border-bottom: none; }

.page-content-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
  font-size: 0.9rem;
}

.page-content-body th, .page-content-body td {
  border: 1px solid var(--c-rule);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}

.page-content-body th {
  background: var(--c-light);
  font-weight: 700;
  font-family: var(--ff-serif);
}

/* ===== 页脚 ===== */
.site-footer {
  background: var(--c-ink);
  color: var(--c-paper);
  border-top: 3px solid var(--c-mid);
  padding: 0;
}

.footer-top-block {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-bottom: 1px solid rgba(250,250,248,0.15);
}

.footer-contact-block,
.footer-nav-block,
.footer-notice-block,
.footer-subscribe-block {
  padding: 36px 24px;
  border-right: 1px solid rgba(250,250,248,0.12);
}

.footer-subscribe-block { border-right: none; }

.footer-block-title {
  font-family: var(--ff-serif);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--c-paper);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(250,250,248,0.2);
}

.footer-block-title span { display: inline; }

.footer-address {
  font-style: normal;
  font-size: 13px;
  color: rgba(250,250,248,0.7);
  margin-bottom: 12px;
}

.footer-address a { color: rgba(250,250,248,0.8); }

.footer-links-list { display: flex; flex-direction: column; gap: 6px; }

.footer-links-list li a {
  font-size: 13px;
  color: rgba(250,250,248,0.7);
  text-decoration: none;
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(250,250,248,0.08);
}

.footer-links-list li a:hover { color: var(--c-paper); opacity: 1; }

.footer-notice-text {
  font-size: 12px;
  color: rgba(250,250,248,0.55);
  line-height: 1.7;
  margin-bottom: 8px;
}

.footer-sub-hint {
  font-size: 13px;
  color: rgba(250,250,248,0.65);
  margin-bottom: 16px;
  line-height: 1.6;
}

.footer-bookmark-btn {
  background: none;
  border: 1px solid rgba(250,250,248,0.4);
  color: var(--c-paper);
  font-size: 13px;
  padding: 10px 20px;
  min-height: 44px;
  letter-spacing: 0.05em;
  width: 100%;
}

.footer-bookmark-btn:hover { background: rgba(250,250,248,0.1); }

.footer-bottom-bar {
  text-align: center;
  padding: 20px 24px;
  border-top: 1px solid rgba(250,250,248,0.12);
}

.footer-copyright {
  font-size: 12px;
  color: rgba(250,250,248,0.5);
  margin-bottom: 4px;
  font-family: var(--ff-sans);
}

.footer-disclaimer {
  font-size: 11px;
  color: rgba(250,250,248,0.35);
}

/* ===== 卡片（通用） ===== */
.card {
  background: var(--c-paper);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--c-rule);
  padding: 20px;
}

.card:hover { box-shadow: 5px 5px 0 var(--c-mid); transform: translate(-1px, -1px); }

/* ===== 视差 ===== */
@media (prefers-reduced-motion: no-preference) {
  .hero-dotgrid { will-change: transform; }
}

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

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .footer-top-block { grid-template-columns: repeat(2, 1fr); }
  .footer-notice-block, .footer-subscribe-block { border-top: 1px solid rgba(250,250,248,0.12); }
}

@media (max-width: 768px) {
  :root {
    --nav-h: 60px;
    --topbar-h: 32px;
  }

  .topbar-announce { font-size: 11px; height: var(--topbar-h); }

  .header-brand-row { padding: 10px 16px; }

  .brand-name { font-size: 1.1rem; }

  .header-nav-row { padding: 0 16px; }

  .nav-menu-inline { gap: 4px 8px; }
  .nav-menu-inline li a { font-size: 12px; padding: 5px 8px; }

  .hero-section { min-height: 60vh; padding: 36px 16px 40px; }

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

  .hero-tape-1, .hero-tape-2 { display: none; }

  .content-section { flex-direction: column; }

  .content-aside {
    width: 100%;
    min-width: unset;
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 2px solid var(--c-ink);
    padding: 20px 16px;
  }

  .aside-toc { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .aside-toc li a { min-height: 40px; padding: 6px 10px; border-left: none; border: 1px solid var(--c-rule); }

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

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

  .fullscreen-nav { padding: 48px 24px; }

  .fullscreen-nav-list li a { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .footer-top-block { grid-template-columns: 1fr; }
  .footer-contact-block,
  .footer-nav-block,
  .footer-notice-block,
  .footer-subscribe-block {
    border-right: none;
    border-bottom: 1px solid rgba(250,250,248,0.12);
    padding: 24px 16px;
  }

  .hero-h1 { font-size: 1.5rem; }

  .page-content-body h2 { font-size: 1.15rem; }
}

/* ===== 不横向滚动保险 ===== */
body, .site-wrap { overflow-x: hidden; }

button[aria-expanded]{min-width:44px;min-height:44px}
