/* otakufuns/shared/base.css —— 主页面共享样式（设计 Token、重置、导航、页脚、印章等）。
   由各页内联 <style> 中完全一致的规则抽出；页面专属与略有差异的规则仍留在各页。
   引入次序：wafu-core.css → base.css → 页内 <style>（保持原层叠次序，勿调换）。 */

/* ─── CSS 自定义属性 ─────────────────────────────────────────────── */
:root {
  --washi:       #F7F3EC;   /* 和纸米白 */
  --sumi:        #1A1A1A;   /* 墨黑 */
  --sumi-light:  #3A3A3A;
  --sumi-muted:  #5F584F;
  --beni:        #C8102E;   /* 朱红 */
  --beni-dark:   #A00D24;
  --kin:         #B08D57;   /* 金茶 */
  --kin-light:   #D4AA6F;
  --kabe:        #EDE8DF;   /* 壁色 - 区块背景 */
  --sen:         #D8D0C0;   /* 細線色 */
  --sen-light:   #EAE4D8;
  --white:       #FFFFFF;
  --on-accent:   #FFFFFF;   /* 彩底/图上文字：昼夜恒白 */

  /* Typography */
  --font-mincho:  'Shippori Mincho', 'Noto Serif JP', 'Noto Serif SC', 'Source Han Serif SC', 'Noto Serif CJK SC', 'Songti SC', 'STSong', 'Georgia', serif;
  --font-serif-sc:'Noto Serif SC', 'Noto Serif JP', 'Source Han Serif SC', 'Noto Serif CJK SC', 'Songti SC', 'STSong', 'Georgia', serif;
  --font-body:    'Noto Sans JP', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Hiragino Sans', 'Yu Gothic', system-ui, sans-serif;

  /* Spacing (8pt grid) */
  --sp1: 4px; --sp2: 8px; --sp3: 12px; --sp4: 16px;
  --sp5: 20px; --sp6: 24px; --sp8: 32px; --sp10: 40px;
  --sp12: 48px; --sp16: 64px; --sp20: 80px; --sp24: 96px;

  /* Easing */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-ink:   cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast:   150ms;
  --dur-base:   250ms;
  --dur-slow:   450ms;
}

/* ─── 和纸 Noise 纹理（SVG data-URI）─────────────────────────────── */
/* subtle grain overlay via pseudo-element on body */

/* ─── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  /* 内容不满一屏时，页脚下方露出的画布与页脚同色（body 自带底色，不受影响） */
  background: #1A1A1A;
}
:root[data-theme="dark"] { background: #07070A; }

/* 和纸噪点纹理 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.6;
}

a { color: inherit; text-decoration: none; }

/* 整卡可点（见 wafu-core.js「整卡可点」）：标题链接聚焦时焦点环画在整卡上 */
[data-card] { cursor: pointer; }
[data-card] .card-link:focus-visible { outline: none; }
[data-card]:has(.card-link:focus-visible) { outline: 2px solid var(--beni); outline-offset: 2px; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }

ul { list-style: none; }

img { display: block; max-width: 100%; }

/* ─── 墨染入场动效 ─────────────────────────────────────────────────── */
@keyframes ink-fade-in {
  from { opacity: 0; transform: translateY(12px); filter: blur(2px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

@keyframes stamp-appear {
  from { opacity: 0; transform: scale(0.8) rotate(-5deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

.anim-fade { opacity: 0; animation: ink-fade-in var(--dur-slow) var(--ease-out) forwards; }

/* ─── 容器（全站唯一版心：导航、正文、页脚左右边界一致，换页不跳）────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--sp8); }

@media (max-width: 768px) { .container { padding: 0 var(--sp4); } }

/* ─── 细线分隔 ─────────────────────────────────────────────────────── */
.sen { border: none; border-top: 1px solid var(--sen); margin: 0; }

.sen--kin { border-top-color: var(--kin); opacity: 0.4; }

/* ═══════════════════════════════════════════════════════════════════ */
/* 二级页面包屑 + 档案式页头（速报 / 片库 / 美图 / 手办 / 销量榜共用）    */
/* ═══════════════════════════════════════════════════════════════════ */
.breadcrumb {
  padding: var(--sp5) 0 var(--sp2);
}
.crumb {
  display: flex; align-items: center; gap: var(--sp3);
  font-family: var(--font-mincho); font-size: 0.75rem;
  letter-spacing: 0.08em; color: var(--sumi-muted);
}
.crumb a {
  color: var(--sumi-muted);
  transition: color var(--dur-fast) var(--ease-out);
}
.crumb a:hover { color: var(--beni); }
.crumb .sep { color: var(--sen); user-select: none; }
.crumb .current { color: var(--sumi); }

.archive-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp6); flex-wrap: wrap;
  padding: var(--sp6) 0 var(--sp8);
  border-bottom: 1px solid var(--sen);
  position: relative;
  margin-bottom: var(--sp10);
}
.archive-head::after {
  content: '';
  position: absolute; bottom: -1px; left: 0;
  width: 64px; height: 2px; background: var(--beni);
}
.archive-head__titles { display: flex; align-items: baseline; gap: var(--sp4); }
.archive-head__tate {
  writing-mode: vertical-rl; text-orientation: mixed;
  font-family: var(--font-mincho); font-size: 0.8rem; font-weight: 500;
  letter-spacing: 0.2em; color: var(--sumi-muted);
  margin-right: var(--sp1);
  align-self: stretch;
  border-right: 1px solid var(--sen);
  padding-right: var(--sp3);
}
.archive-head__title {
  font-family: var(--font-mincho); font-size: 2.6rem; font-weight: 800;
  letter-spacing: 0.06em; color: var(--sumi); line-height: 1;
}
.archive-head__en {
  font-family: var(--font-mincho); font-size: 0.85rem; font-weight: 400;
  letter-spacing: 0.3em; color: var(--sumi-muted);
  margin-top: var(--sp3); text-transform: uppercase;
}
.archive-head__count {
  font-family: var(--font-mincho); font-size: 0.85rem;
  color: var(--sumi-muted); letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.archive-head__count strong {
  color: var(--beni); font-size: 1.5rem; font-weight: 800;
  margin: 0 4px;
}
.archive-head__deck {
  max-width: 560px; margin-top: var(--sp4);
  font-family: var(--font-serif-sc); font-size: 0.88rem; line-height: 1.8;
  color: var(--sumi-light); text-wrap: pretty;
}
@media (max-width: 640px) {
  .archive-head__title { font-size: 1.9rem; }
  .archive-head__tate { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════ */
/* 1. 顶部导航                                                         */
/* ═══════════════════════════════════════════════════════════════════ */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 243, 236, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--sen);
  transition: box-shadow var(--dur-base) var(--ease-out);
}

.nav.scrolled { box-shadow: 0 1px 8px rgba(26,26,26,0.06); }

.nav__inner {
  display: flex; align-items: center; gap: var(--sp6);
  height: 60px;
}

/* Wordmark */
.wordmark {
  display: flex; align-items: center; gap: var(--sp3);
  flex-shrink: 0; cursor: pointer;
}

.wordmark__text-group {
  display: flex; flex-direction: column; line-height: 1;
}

.wordmark__en {
  font-family: var(--font-mincho); font-size: 1.25rem; font-weight: 700;
  letter-spacing: 0.04em; color: var(--sumi);
}

.wordmark__sub {
  font-family: var(--font-serif-sc); font-size: 0.75rem; font-weight: 400;
  letter-spacing: 0.3em; color: var(--sumi-muted); margin-top: 3px;
}

.wordmark__hanko {
  width: 32px; height: 32px;
  background: var(--beni); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif-sc); font-size: 20px; font-weight: 700; line-height: 1;
  flex-shrink: 0;
  animation: stamp-appear 600ms var(--ease-out) 200ms both;
}

/* Nav links */
.nav__links {
  display: flex; align-items: center; gap: var(--sp6);
  margin-left: var(--sp6);
}

.nav__link {
  font-family: var(--font-mincho); font-size: 0.85rem; font-weight: 500;
  letter-spacing: 0.1em; color: var(--sumi-muted);
  padding: 2px 0;
  position: relative; cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out);
}

.nav__link::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
  height: 1px; background: var(--beni);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
}

.nav__link:hover { color: var(--beni); }

.nav__link:hover::after { transform: scaleX(1); }

.nav__link.active { color: var(--sumi); }

.nav__link.active::after { transform: scaleX(1); }

/* Nav right */
.nav__right { margin-left: auto; display: flex; align-items: center; gap: var(--sp4); }

/* Search input */
.nav__search {
  display: flex; align-items: center; gap: var(--sp2);
  border-bottom: 1px solid var(--sen);
  padding: 2px var(--sp2);
  transition: border-color var(--dur-fast) var(--ease-out);
}

.nav__search:focus-within { border-bottom-color: var(--sumi); }

.nav__search input::placeholder { color: var(--sumi-muted); font-size: 0.75rem; }

.nav__search svg { color: var(--sumi-muted); flex-shrink: 0; }

/* Mobile hamburger */
.nav__burger {
  display: none; flex-direction: column; gap: 5px;
  width: 24px; cursor: pointer; padding: 4px;
}

.nav__burger span {
  display: block; height: 1px; background: var(--sumi);
  transition: transform var(--dur-base) var(--ease-out),
              opacity var(--dur-base) var(--ease-out);
}

@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav__search { display: none; }
  .nav__burger { display: flex; }
}

/* Mobile nav drawer */
.nav__drawer {
  display: none; position: fixed; top: 60px; left: 0; right: 0;
  background: var(--washi); border-bottom: 1px solid var(--sen);
  padding: var(--sp6) var(--sp4); z-index: 99;
  flex-direction: column; gap: var(--sp4);
}

.nav__drawer.open { display: flex; }

.nav__drawer .nav__link { font-size: 1rem; padding: var(--sp3) 0; border-bottom: 1px solid var(--sen-light); }

/* ═══════════════════════════════════════════════════════════════════ */
/* 8. 页脚                                                              */
/* ═══════════════════════════════════════════════════════════════════ */
.footer {
  background: var(--sumi); color: var(--washi);
  padding: var(--sp16) 0 var(--sp8);
  position: relative; overflow: hidden;
}

/* 麻叶纹 SVG 装饰 */
.footer__asanoha {
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--beni) 0, var(--beni) 24px,
    var(--sumi) 24px, var(--sumi) 48px
  );
  opacity: 0.4;
}

.footer__inner {
  display: grid; grid-template-columns: 1fr 2fr 1fr; gap: var(--sp12);
  align-items: start; margin-bottom: var(--sp12);
}

@media (max-width: 768px) {
  .footer__inner { grid-template-columns: 1fr; gap: var(--sp8); }
}

.footer__wordmark {
  display: flex; align-items: center; gap: var(--sp3);
  margin-bottom: var(--sp4);
}

.footer__wordmark-en {
  font-family: var(--font-mincho); font-size: 1.1rem; font-weight: 700;
  letter-spacing: 0.04em; color: var(--washi);
}

.footer__hanko {
  width: 28px; height: 28px; background: var(--beni);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif-sc); font-size: 17px; font-weight: 700; line-height: 1;
  color: var(--on-accent);
}

.footer__tagline {
  font-family: var(--font-mincho); font-size: 0.75rem; color: rgba(247,243,236,0.5);
  letter-spacing: 0.12em; line-height: 1.8;
}

.footer__nav {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp6);
}

@media (max-width: 640px) { .footer__nav { grid-template-columns: 1fr 1fr; } }

.footer__nav-title {
  font-family: var(--font-mincho); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.18em; color: rgba(247,243,236,0.4);
  text-transform: uppercase; margin-bottom: var(--sp3);
}

.footer__nav-links { display: flex; flex-direction: column; gap: var(--sp2); }

.footer__nav-link {
  font-family: var(--font-mincho); font-size: 0.8rem; color: rgba(247,243,236,0.65);
  letter-spacing: 0.06em; cursor: pointer;
  transition: color var(--dur-fast);
}

.footer__nav-link:hover { color: var(--washi); }

/* 当季徽章（文字由 wafu-core.js 按北京时间填入） */
.footer__season-badge {
  display: inline-flex; flex-direction: column; align-items: center;
  border: 1px solid rgba(247,243,236,0.2); padding: var(--sp4) var(--sp5);
}

.footer__season-label {
  font-family: var(--font-mincho); font-size: 0.75rem; letter-spacing: 0.2em;
  color: rgba(247,243,236,0.4); margin-bottom: 3px;
}

.footer__season-text {
  font-family: var(--font-mincho); font-size: 1rem; font-weight: 700;
  color: var(--washi); letter-spacing: 0.1em;
}

.footer__bottom {
  border-top: 1px solid rgba(247,243,236,0.1);
  padding-top: var(--sp6);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--sp4);
}

.footer__copy {
  font-family: var(--font-mincho); font-size: 0.75rem; color: rgba(247,243,236,0.3);
  letter-spacing: 0.1em;
}

.footer__links {
  display: flex; gap: var(--sp6);
}

.footer__link {
  font-family: var(--font-mincho); font-size: 0.75rem; color: rgba(247,243,236,0.3);
  letter-spacing: 0.08em; cursor: pointer;
  transition: color var(--dur-fast);
}

.footer__link:hover { color: rgba(247,243,236,0.7); }

.footer__icp {
  font-family: var(--font-mincho); font-size: 0.75rem; color: rgba(247,243,236,0.3);
  letter-spacing: 0.08em; text-decoration: none;
  transition: color var(--dur-fast);
}

.footer__icp:hover { color: rgba(247,243,236,0.7); }

/* ─── 通用 Focus ──────────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--beni); outline-offset: 2px; }

/* 跳到正文（键盘用户）：聚焦前移出视口，Tab 聚焦时滑入 */
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  transform: translateY(-250%);
  background: var(--sumi); color: var(--washi);
  font-family: var(--font-mincho); font-size: 0.85rem;
  letter-spacing: 0.1em; padding: 12px 20px;
  transition: transform 150ms;
}

.skip-link:focus { transform: none; }
