/* 宠物玩具 · 基础样式与页面骨架 */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
svg { display: block; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--ink-invert);
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------------------------------------------------------- 顶栏 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: rgba(253, 245, 234, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }
.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}
.brand-mark {
  width: 30px;
  height: 30px;
  color: var(--accent);
}
.brand-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.5px;
}
.site-logo-text {
  display: inline-block;
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  flex: 1 1 auto;
}
.nav-item { position: relative; }
.nav-link {
  position: relative;
  display: inline-block;
  padding: 10px 9px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  white-space: nowrap;
  border-radius: var(--r-sm);
  transition: color 0.18s ease;
}
.nav-link:hover { color: var(--accent-dark); }
.nav-link.is-active { color: var(--accent-dark); font-weight: 600; }
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 70;
  min-width: 176px;
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}
.dropdown-menu li { display: block; }
.dropdown-menu a {
  display: block;
  padding: 8px 10px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  border-radius: var(--r-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropdown-menu a:hover { background: var(--accent-tint); color: var(--accent-dark); }
.nav .dropdown:hover > .dropdown-menu { display: block; }
.header-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  font-size: var(--fs-sm);
  color: var(--ink);
  background: var(--bg-soft);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.header-cta:hover { background: var(--accent-tint); border-color: var(--accent-soft); }
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
}
.nav-toggle svg { width: 20px; height: 20px; }

/* ---------------------------------------------------------- 页脚 */
.site-footer {
  margin-top: 26px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 16px 0 12px;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 26px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.footer-top > * { flex: 1 1 180px; min-width: 170px; }
.footer-brand { display: flex; flex-direction: column; gap: 5px; flex: 0 1 260px; }
.footer-brand .brand-name { font-size: 20px; }
.footer-tagline { font-size: var(--fs-sm); color: var(--ink-3); line-height: 1.7; }
.footer-title {
  font-size: var(--fs-xs);
  letter-spacing: 1.5px;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: var(--fs-sm);
}
.footer-links a { color: var(--ink-2); }
.footer-links a:hover { color: var(--accent-dark); }
.footer-note { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.7; }
.footer-links--meta { margin-top: 10px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 10px;
}
.footer-disclaimer { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.7; }
.footer-copy { font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; }

/* ---------------------------------------------------------- 响应式骨架 */
@media (max-width: 1180px) {
  :root { --fs-h1: 38px; --fs-h2: 23px; }
  .nav-link { padding: 10px 7px; font-size: 12.5px; }
}
@media (max-width: 980px) {
  .nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .header-actions .header-cta { display: none; }
  .site-header.is-open .nav {
    display: flex;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
    padding: 10px var(--gutter) 18px;
    margin: 0;
    box-shadow: var(--shadow-card);
  }
  .site-header.is-open .nav-link { padding: 12px 6px; font-size: 15px; }
  .site-header.is-open .nav-link.is-active::after { display: none; }
  .site-header.is-open .nav { max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
  .site-header.is-open .nav-item { position: static; }
  .site-header.is-open .dropdown-menu {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 6px;
    min-width: 0;
    max-height: none;
    overflow: visible;
    padding: 0 0 6px 8px;
    border: 0;
    box-shadow: none;
    background: transparent;
  }
  .site-header.is-open .dropdown-menu a { padding: 6px 8px; font-size: 13px; background: var(--accent-tint); }
  .footer-top { flex-direction: column; gap: 22px; }
  .footer-top > * { flex: 1 1 auto; min-width: 0; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 640px) {
  :root { --fs-h1: 30px; --fs-h2: 21px; --fs-body: 14px; --gutter: 18px; --header-h: 64px; }
  .brand-name { font-size: 20px; }
  .brand-mark { width: 26px; height: 26px; }
}

/* 锚点跳转避开粘性顶栏 */
[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
