/* ==========================================================================
   赫曼陆龟养护知识 · 基础与首页版式（依据 03-ui/home-ui-desktop.png）
   ========================================================================== */

/* 设计变量统一在 css/tokens.css（环节 5 抽取），本文件只写版式与组件样式 */


*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

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

body.is-locked { overflow: hidden; }

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

::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.container {
  width: min(var(--container), 100% - var(--gutter) * 2);
  margin-inline: auto;
}
.container-narrow {
  width: min(820px, 100% - var(--gutter) * 2);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--footer-text);
  font-size: var(--fs-sm);
  border-radius: var(--radius-sm);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ------------------------------------------------------------ 页头 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.site-header[data-header] { backdrop-filter: saturate(120%) blur(6px); }
.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 26px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--ink);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--accent-deep);
}
.brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.site-nav { margin-left: auto; }
.nav-list {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 15px;
  color: var(--ink-soft);
}
.nav-list a {
  position: relative;
  display: inline-block;
  padding: 6px 0;
  white-space: nowrap;
  transition: color 0.18s var(--ease);
}
.nav-list a:hover { color: var(--accent-deep); }
.nav-list a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav-list a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.header-cta {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-deep);
}
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  margin-left: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  align-items: center;
  justify-content: center;
}
.menu-toggle .bar {
  position: relative;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
}
.menu-toggle .bar::before,
.menu-toggle .bar::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s var(--ease);
}
.menu-toggle .bar::before { top: -5px; }
.menu-toggle .bar::after { top: 5px; }
.menu-toggle[aria-expanded="true"] .bar { background: transparent; }
.menu-toggle[aria-expanded="true"] .bar::before { transform: translateY(5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bar::after { transform: translateY(-5px) rotate(-45deg); }

/* ------------------------------------------------------------ 首屏 */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 406px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #3c4a23;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 50%;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(24, 34, 16, 0.82) 0%, rgba(28, 38, 18, 0.62) 38%, rgba(30, 40, 20, 0.18) 62%, rgba(30, 40, 20, 0) 78%);
}
.hero-inner {
  padding-block: 46px 52px;
  max-width: 660px;
  color: #fff;
}
.hero h1 {
  font-size: var(--fs-hero);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 18px rgba(20, 26, 12, 0.35);
}
.hero-lead {
  margin-top: 16px;
  font-size: 17px;
  line-height: 1.65;
  max-width: 33em;
  color: rgba(255, 255, 255, 0.95);
}
.hero-sub {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.7;
  max-width: 32em;
  color: rgba(255, 255, 255, 0.88);
}
.hero-actions {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease);
}
.btn--primary {
  background: var(--c-sand);
  color: #2c3318;
  box-shadow: 0 6px 18px rgba(20, 26, 12, 0.18);
}
.btn--primary:hover { background: #f0d49a; transform: translateY(-1px); }
.btn--text {
  color: #fff;
  padding: 0;
  min-height: auto;
  font-weight: 500;
}
.btn--text:hover { color: #f7e6bf; }
.btn svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------ 区块与标题 */
.section { padding-block: 22px; }
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.section-head::before {
  content: "";
  width: 4px;
  height: 22px;
  border-radius: 2px;
  background: var(--accent);
  flex: none;
}
.section-head .section-note {
  margin-left: auto;
  font-size: var(--fs-sm);
  color: var(--ink-dim);
}

/* ------------------------------------------------------------ 七个分类 */
.category-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}
.category-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 190px;
  padding: 18px 13px 18px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.category-card:hover {
  background: #f8f3e4;
  border-color: rgba(74, 98, 52, 0.32);
  transform: translateY(-2px);
}
.category-icon { color: var(--accent); width: 23px; height: 23px; }
.category-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.category-desc {
  font-size: 12px;
  line-height: 1.66;
  color: var(--ink-dim);
}
.category-count {
  margin-top: auto;
  padding-top: 8px;
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent);
}

/* ------------------------------------------------------------ 编辑精选 */
.editor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.card:hover { border-color: rgba(74, 98, 52, 0.34); transform: translateY(-2px); }
.card-media {
  aspect-ratio: 2.95 / 1;
  overflow: hidden;
  background: var(--bg-soft);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.card:hover .card-media img { transform: scale(1.03); }
.card-body { padding: 7px 11px 9px; }
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.card-title {
  margin-top: 3px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-desc {
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-dim);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ------------------------------------------------------------ 最近更新 + 参数 */
.latest-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.92fr) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
.latest-list { border-top: 1px solid var(--line); }
.latest-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line-strong);
  align-items: start;
}
.latest-thumb {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: var(--bg-soft);
}
.latest-thumb img { width: 100%; height: 100%; object-fit: cover; }
.latest-row h3 {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
}
.latest-row .tag { font-size: 11.5px; margin-right: 8px; }
.latest-row p {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-dim);
}

.params {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.params-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
}
.params-head h2 { font-size: 17px; font-weight: 700; letter-spacing: 0.02em; }
.params-head svg { width: 18px; height: 18px; }
.params-table {
  margin: 0;
  padding: 2px 16px 4px;
}
.params-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.params-row:last-child { border-bottom: 0; }
.params-row dt { font-size: 13px; color: var(--ink-soft); }
.params-row dd {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  letter-spacing: 0.01em;
}
.params-note {
  margin: 6px 12px 12px;
  padding: 9px 11px;
  background: var(--c-amber);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.65;
  color: #5b4a2c;
}

/* ------------------------------------------------------------ 清单 + FAQ */
.guides-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
.panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 15px 13px;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.panel-head h2 { font-size: 16px; font-weight: 700; }
.panel-head svg { width: 20px; height: 20px; color: var(--accent); }
.checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
}
.checklist li {
  position: relative;
  padding-left: 22px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 15px;
  height: 15px;
  border-radius: 3px;
  border: 1.5px solid var(--accent);
  background:
    linear-gradient(var(--accent), var(--accent)) 4px 7px / 4px 1.6px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 7px 9.5px / 6px 1.6px no-repeat;
}
.faq-list { display: grid; gap: 2px; }
.faq-item { border-bottom: 1px dashed var(--line-strong); }
.faq-item:last-child { border-bottom: 0; }
.faq-item summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: rotate(-45deg);
  transition: transform 0.2s var(--ease);
}
.faq-item[open] summary::before { transform: rotate(45deg); }
.faq-item p {
  padding: 0 0 10px 16px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-dim);
}

/* ------------------------------------------------------------ 说明条 */
.notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 13px 18px;
  background: var(--c-amber);
  border-radius: var(--radius-md);
}
.notice-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #8a6a2e;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
}
.notice h2 { font-size: 13.5px; font-weight: 700; color: #5b4a2c; }
.notice p { margin-top: 2px; font-size: 12.5px; line-height: 1.6; color: #6a5836; }

/* ------------------------------------------------------------ 页脚 */
.site-footer {
  margin-top: 0;
  padding-block: 14px 8px;
  background: var(--footer);
  color: var(--footer-text);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.footer-brand .brand-mark { color: #cfd8c6; width: 34px; height: 34px; }
.footer-brand .brand-name { color: #fff; font-size: 19px; font-weight: 800; }
.footer-brand p {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--footer-dim);
}
.footer-right { display: grid; gap: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 7px 18px; }
.footer-links h2 {
  width: 100%;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.footer-links a {
  font-size: 12.5px;
  color: var(--footer-dim);
  transition: color 0.18s var(--ease);
}
.footer-links a:hover { color: #fff; }
.footer-about { font-size: 12.5px; line-height: 1.65; color: var(--footer-dim); }
.footer-about h2 { font-size: 12.5px; font-weight: 600; color: #fff; margin-bottom: 6px; }
.footer-bottom {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(233, 227, 210, 0.62);
}

/* ------------------------------------------------------------ 响应式 */
@media (max-width: 1180px) {
  :root { --gutter: 26px; --fs-hero: 40px; }
  .nav-list { gap: 18px; font-size: 14px; }
  .category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .latest-layout { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
}

@media (max-width: 900px) {
  :root { --header-h: 64px; --fs-hero: 34px; --fs-xl: 22px; }
  .menu-toggle { display: inline-flex; }
  .header-cta { display: none; }
  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 10px var(--gutter) 18px;
    display: none;
  }
  .site-nav.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; font-size: 15px; }
  .nav-list a { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .nav-list a[aria-current="page"]::after { display: none; }
  .hero { min-height: 360px; }
  .hero-inner { max-width: 100%; padding-block: 38px 42px; }
  .hero::before { background: linear-gradient(180deg, rgba(24, 34, 16, 0.78), rgba(24, 34, 16, 0.55)); }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .latest-layout, .guides-layout { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
}

@media (max-width: 560px) {
  :root { --gutter: 18px; --fs-hero: 29px; --fs-xl: 20px; --fs-2xl: 26px; }
  .brand-name { font-size: 17px; }
  .hero-lead { font-size: 15px; }
  .hero-sub { font-size: 14px; }
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .checklist { grid-template-columns: minmax(0, 1fr); }
  .latest-row { grid-template-columns: 72px minmax(0, 1fr); }
  .params-row dt { font-size: 13px; }
  .params-row dd { font-size: 13px; }
}
