/* ==========================================================================
   樱花部落 Cherry Hub — 基础样式
   视觉：Minecraft Wiki 式拟态（skeuomorphic）——
   淡暖白纸面底 + 实心浅色面板 + 1px 深描边 + 3px 小圆角 +
   内嵌亮线 + 实色硬阴影做厚度。全站统一纸面质感，无玻璃、无模糊滤镜。
   ========================================================================== */

/* ---- 设计变量 ---- */
:root {
  /* 纸面 / 面板 */
  --page: #fbf7f5;
  --page-2: #f6efec;
  --surface: #fffdfc;
  --surface-2: #f8f1f2;

  /* 品牌樱粉：只做色块、标签、按钮 */
  --pink: #E58BA9;
  --pink-deep: #D9748F;
  --pink-soft: #FBE0E9;
  --pink-tint: #FDF0F4;
  --pink-ink: #9C4860;

  /* 描边与分线 */
  --line: rgba(90, 60, 70, 0.35);        /* 面板 / 按钮 1px 深描边 */
  --line-2: rgba(90, 60, 70, 0.18);      /* 分隔线 */
  --line-3: rgba(90, 60, 70, 0.10);      /* 极浅分线 */

  /* 文字 */
  --ink: #362A31;
  --ink-2: #5D4C55;
  --ink-3: rgba(60, 40, 50, 0.66);

  /* 圆角：全站 ≤ 4px */
  --r: 3px;
  --r-sm: 2px;
  --r-lg: 4px;

  /* 拟态：内嵌亮线 / 凹槽 / 实色硬厚度 */
  --inset: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -1px 0 rgba(0, 0, 0, 0.04);
  --groove: inset 0 1px 2px rgba(90, 60, 70, 0.22), 0 1px 0 rgba(255, 255, 255, 0.9);

  --t: 100ms ease;
  --nav-h: 64px;
  --maxw: 1100px;
  --font-sans: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Segoe UI Mono", Consolas, "Courier New", monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto;
}

body {
  margin: 0;
  padding-top: calc(var(--nav-h) + 26px);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.72;
  color: var(--ink);
  background: var(--page);
  position: relative;
  min-height: 100vh;
}

/* ==========================================================================
   淡底图纹理（photo-as-texture）
   bg.jpg 只当"纸纹"用，不当照片展示：固定铺满 + 模糊 + 去饱和，
   再叠一层米色蒙版压到 86%~94%，只在卡片之间的空白处若有若无。
   卡片保持实心，不加任何透明度；不引入玻璃/滤镜面板。
   ========================================================================== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url(../img/ui/bg.jpg) center top / cover no-repeat;
  filter: blur(1px) saturate(0.76) contrast(1.02) brightness(0.98);
  transform: scale(1.04); /* 避免 blur 在边缘透出白边 */
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* 蒙版法：米色越往下越厚，上松下紧 */
  background: linear-gradient(
    180deg,
    rgba(251,247,245,0.52) 0%,
    rgba(251,247,245,0.58) 45%,
    rgba(251,247,245,0.65) 100%
  );
}

@media (max-width: 640px) {
  /* 手机上更轻，避免小屏里纹理抢字 */
  body::before { filter: blur(0.8px) saturate(0.76) contrast(1.02) brightness(0.98); }
}

::selection {
  background: #F7D6E1;
  color: #4A1B2A;
}

/* hidden 属性优先于各区块的 display 设定（相册筛选依赖它） */
[hidden] { display: none !important; }

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; }

h1, h2, h3 { margin: 0; line-height: 1.4; }

p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0; padding: 0; }

/* 键盘焦点：深色硬描边，浅底深边都清楚 */
:focus-visible {
  outline: 2px solid #8A4A60;
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- 跳过导航（仅键盘聚焦时出现） ---- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 rgba(90, 60, 70, 0.3);
  font-size: 14px;
  font-weight: 700;
  transform: translateY(-240%);
}
.skip-link:focus { transform: none; }

/* ==========================================================================
   顶部栏：整幅贴顶，底边一道 1px 分线，导航页签像 Wiki 的 active tab
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--nav-h);
  background: linear-gradient(180deg, #fffdfc 0%, #fcf5f5 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.site-header .inner {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: var(--maxw);
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  min-width: 0;
}

.brand-logo {
  height: 28px;
  width: auto;
  image-rendering: pixelated;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 15px;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.brand-text small {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.9px;
  color: var(--ink-3);
  white-space: nowrap;
}

/* 导航：页签贴住底边，active 页签用 -1px 盖住分线 */
.nav {
  display: flex;
  align-items: stretch;
  gap: 3px;
  align-self: flex-end;
  height: 46px;
  margin: 0 auto 0 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  margin-bottom: -1px;
  padding: 0 13px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom-color: transparent;
  border-radius: var(--r) var(--r) 0 0;
  color: var(--ink-2);
  transition: background-color 100ms ease, border-color 100ms ease, color 100ms ease;
}

.nav-link:hover {
  background: rgba(229, 139, 169, 0.10);
  border-color: rgba(90, 60, 70, 0.14);
  border-bottom-color: transparent;
  color: var(--ink);
}

.nav-link[aria-current="page"] {
  background: linear-gradient(180deg, #fffdfc 0%, #fdf5f7 100%);
  border-color: var(--line);
  border-bottom-color: transparent;      /* 盖住下面那条 1px 分隔线 */
  color: #4A1B2A;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.nav-link[aria-current="page"]:hover {
  background: linear-gradient(180deg, #fffdfc 0%, #fdf1f5 100%);
}

/* 图标槽位：凹陷小方块 */
.nav-ico {
  width: 22px;
  height: 22px;
  padding: 2px;
  flex: 0 0 auto;
  color: inherit;
  background: #f2e8ea;
  border: 1px solid rgba(90, 60, 70, 0.22);
  border-radius: 2px;
  box-shadow: inset 0 1px 2px rgba(90, 60, 70, 0.22), 0 1px 0 rgba(255, 255, 255, 0.9);
}

.nav-link[aria-current="page"] .nav-ico {
  background: #fdf3f6;
  border-color: rgba(90, 60, 70, 0.28);
}

.nav-text { display: flex; flex-direction: column; line-height: 1.12; }

.nav-zh { font-size: 14.5px; font-weight: 600; white-space: nowrap; }

.nav-en {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.1px;
  color: var(--ink-3);
  text-transform: uppercase;
}

.nav-link[aria-current="page"] .nav-en { color: var(--pink-ink); }

/* 右侧小字：用左侧细线跟页签分开 */
.nav-meta {
  flex: 0 0 auto;
  margin: 0;
  padding-left: 12px;
  border-left: 1px solid var(--line-2);
  font-size: 11.5px;
  letter-spacing: 0.3px;
  color: var(--ink-3);
  white-space: nowrap;
}

/* 静音开关：灰白拟态小按钮，同套高光与厚度 */
.sound-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  margin-left: 2px;
  padding: 0;
  background: linear-gradient(180deg, #f7f7f7 0%, #ededed 52%, #e2e2e2 100%);
  border: 1px solid rgba(120, 120, 130, 0.45);
  border-radius: var(--r);
  color: #4A4650;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 0 rgba(120, 120, 130, 0.22),
    0 2px 0 rgba(120, 120, 130, 0.55),
    0 1px 2px rgba(90, 60, 70, 0.14);
  cursor: pointer;
  transition: transform 60ms ease, box-shadow 60ms ease, filter 60ms ease;
}

.sound-toggle:hover { filter: brightness(1.04); }

.sound-toggle:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 2px 3px rgba(120, 60, 80, 0.30),
    inset 0 -1px 0 rgba(255, 255, 255, 0.5),
    0 0 0 rgba(0, 0, 0, 0),
    0 1px 1px rgba(90, 60, 70, 0.12);
}

.sound-toggle .snd-off { display: none; }
.sound-toggle.is-muted .snd-on { display: none; }
.sound-toggle.is-muted .snd-off { display: inline; }
.sound-toggle.is-muted { color: #8E4257; }

/* 汉堡按钮（<768px 显示） */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 0;
  background: linear-gradient(180deg, #f7f7f7 0%, #ededed 52%, #e2e2e2 100%);
  border: 1px solid rgba(120, 120, 130, 0.45);
  border-radius: var(--r);
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 0 rgba(120, 120, 130, 0.22),
    0 2px 0 rgba(120, 120, 130, 0.55),
    0 1px 2px rgba(90, 60, 70, 0.14);
  cursor: pointer;
  transition: transform 60ms ease, box-shadow 60ms ease, filter 60ms ease;
}
.nav-toggle:hover { filter: brightness(1.04); }
.nav-toggle:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 2px 3px rgba(120, 60, 80, 0.30),
    inset 0 -1px 0 rgba(255, 255, 255, 0.5),
    0 0 0 rgba(0, 0, 0, 0),
    0 1px 1px rgba(90, 60, 70, 0.12);
}
.nav-toggle svg { width: 18px; height: 18px; }

/* ==========================================================================
   版心 / 面板 / 标题 / 按钮
   ========================================================================== */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}

.section { margin-top: 30px; }

/* 实心浅色面板：1px 深描边 + 3px 圆角 + 内嵌亮线 */
.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px 24px;
  box-shadow: var(--inset), 0 1px 0 rgba(90, 60, 70, 0.10);
}

.sec-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

h1, h2, h3 { font-weight: 700; }

h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 16.5px; }

/* 标题左侧实色樱粉色块（3~4px，无柔光） */
.sec-title {
  position: relative;
  padding-left: 14px;
  letter-spacing: 0.3px;
}

.sec-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 0.78em;
  transform: translateY(-50%);
  border-radius: 0;
  background: var(--pink);
}

.sec-en {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 1.8px;
  color: var(--ink-3);
  text-transform: uppercase;
}

.page-en {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 2.2px;
  color: var(--ink-3);
  text-transform: uppercase;
}

/* ---- 主按钮：粉面拟态，硬厚度 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border-radius: 3px;
  border: 1px solid rgba(90, 60, 70, 0.45);
  background: linear-gradient(180deg, #fdf0f4 0%, #f6d5e0 52%, #eebccd 100%);
  color: #4a1b2a;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 0 rgba(140, 70, 95, 0.28),
    0 2px 0 rgba(140, 70, 95, 0.55),
    0 1px 2px rgba(90, 60, 70, 0.18);
  cursor: pointer;
  transition: transform 60ms ease, box-shadow 60ms ease, filter 60ms ease;
}

.btn:hover { filter: brightness(1.04); }

.btn:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 2px 3px rgba(120, 60, 80, 0.35),
    inset 0 -1px 0 rgba(255, 255, 255, 0.5),
    0 0 0 rgba(0, 0, 0, 0),
    0 1px 1px rgba(90, 60, 70, 0.12);
}

/* 次要按钮：灰白拟态，同一套高光 / 厚度 */
.btn--ghost {
  background: linear-gradient(180deg, #f7f7f7 0%, #ededed 52%, #e0e0e0 100%);
  border-color: rgba(120, 120, 130, 0.45);
  color: #3F3A42;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 0 rgba(120, 120, 130, 0.22),
    0 2px 0 rgba(120, 120, 130, 0.55),
    0 1px 2px rgba(90, 60, 70, 0.14);
}

.btn--ghost:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 2px 3px rgba(120, 120, 130, 0.30),
    inset 0 -1px 0 rgba(255, 255, 255, 0.55),
    0 0 0 rgba(0, 0, 0, 0),
    0 1px 1px rgba(90, 60, 70, 0.12);
}

.btn--lg { height: 46px; padding: 0 24px; font-size: 15.5px; }

.btn-arrow { font-family: var(--font-mono); font-size: 15px; }

/* ---- 标签 / 徽章：小拟态块，2px 圆角，不是胶囊 ---- */
.tag,
.badge {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid rgba(120, 120, 130, 0.4);
  border-radius: 2px;
  background: linear-gradient(180deg, #f7f7f7 0%, #e7e7e7 100%);
  color: #4A4650;
  font-size: 12px;
  line-height: 1.7;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(0, 0, 0, 0.05),
    0 1px 0 rgba(120, 120, 130, 0.35);
}

.badge--open {
  background: linear-gradient(180deg, #fdf0f4 0%, #f6d5e0 52%, #eebccd 100%);
  border-color: rgba(90, 60, 70, 0.4);
  color: #8E4257;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(140, 70, 95, 0.18),
    0 1px 0 rgba(140, 70, 95, 0.4);
}

.badge--open::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 1px;
  background: #C9647F;
  vertical-align: 1px;
}

.badge--closed {
  background: linear-gradient(180deg, #f7f7f7 0%, #e7e7e7 100%);
  border-color: rgba(120, 120, 130, 0.32);
  color: var(--ink-2);
}

/* ==========================================================================
   页脚：实心卡，品牌 / 友会链接 / 声明
   ========================================================================== */
.site-footer {
  max-width: var(--maxw);
  margin: 40px auto 28px;
  padding: 0 16px;
}

.footer-card {
  position: relative;
  padding: 26px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--inset), 0 1px 0 rgba(90, 60, 70, 0.10);
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px 40px;
  align-items: start;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.footer-logo {
  height: 28px;
  width: auto;
  image-rendering: pixelated;
}

.footer-name {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.footer-sub {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
}

.footer-links-title {
  margin: 0 0 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line-2);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--ink-2);
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 9px;
  list-style: none;
}

.footer-links li {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.footer-link {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(217, 116, 143, 0.6);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--pink-ink);
  text-decoration-color: var(--pink-deep);
  text-decoration-thickness: 2px;
}

.footer-link-arrow {
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--pink-deep);
}

.footer-link-url {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.2px;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}

/* 双线凹槽：1px 深线 + 1px 亮线 */
.footer-disclaimer {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  max-width: 92ch;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--ink-3);
}

.footer-copy {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ==========================================================================
   响应式：<768px 导航折叠
   ========================================================================== */
@media (max-width: 1179px) {
  .nav-meta { display: none; }
}

@media (max-width: 767px) {
  :root { --nav-h: 56px; }

  body { padding-top: calc(56px + 20px); }

  .site-header .inner { gap: 10px; padding: 0 12px; }

  .brand-logo { height: 24px; }

  .brand-text small { display: none; }

  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 8px;
    right: 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    height: auto;
    margin: 0;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.9),
      0 3px 0 rgba(90, 60, 70, 0.28),
      0 1px 2px rgba(90, 60, 70, 0.16);
    z-index: 5;
  }

  .nav.is-open { display: flex; }

  .nav-link,
  .nav-link[aria-current="page"] {
    height: 42px;
    margin-bottom: 0;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    background: transparent;
    box-shadow: none;
  }

  .nav-link:hover { background: rgba(229, 139, 169, 0.10); }

  .nav-link[aria-current="page"] {
    background: var(--pink-tint);
    border-color: var(--line);
    color: #4A1B2A;
  }

  .nav-toggle { display: inline-flex; margin-left: 0; }

  /* 手机上静音开关与汉堡一起靠右 */
  .sound-toggle { order: 2; margin-left: auto; }
  .nav-toggle { order: 3; }

  .wrap { padding: 0 14px; }

  .panel { padding: 18px 15px; }

  .section { margin-top: 24px; }

  .site-footer { margin: 30px auto 20px; padding: 0 14px; }

  .footer-card { padding: 20px 16px; }

  .footer-top { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 420px) {
  .brand-logo { height: 22px; }
  .brand-text strong { font-size: 13.5px; }
  .sound-toggle { width: 32px; height: 32px; }
}

/* 尊重「减少动态效果」：所有位移与过渡全关 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }

  .btn:active,
  .btn--ghost:active,
  .sound-toggle:active,
  .nav-toggle:active,
  .filter:active,
  .lb-btn:active {
    transform: none;
  }
}
