:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #142033;
  --muted: #667085;
  --line: #dde5ef;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --blue: #2457c5;
  --amber: #b76e00;
  --shadow: 0 18px 50px rgba(31, 44, 71, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button,
.secondary-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

button:hover,
.secondary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  background: #e7eef8;
  color: #183153;
}

.secondary-button:hover {
  background: #d7e2f0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 248, 251, 0.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.nav-shell,
.hero,
.layout,
.footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.nav-shell {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand,
.nav-actions,
.hero-controls,
.status-pill,
.section-head,
.footer,
.admin-topbar,
.topbar-actions,
.admin-section-head {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  letter-spacing: 0;
}

.nav-actions {
  gap: 10px;
}

.nav-link {
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 8px;
}

.nav-link:hover {
  background: #e7edf5;
  color: var(--text);
}

.language-switch {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 8px;
  color: var(--muted);
}

.language-switch select {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
  cursor: pointer;
}

.hero {
  min-height: 420px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: center;
  padding: 54px 0 30px;
}

.hero h1 {
  margin: 10px 0 14px;
  max-width: 780px;
  font-size: clamp(40px, 7vw, 82px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero p {
  max-width: 700px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
}

.hero-controls {
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.search-box {
  width: min(520px, 100%);
  height: 54px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.search-box span {
  color: var(--muted);
  font-size: 14px;
}

.search-box input,
.admin-card input,
.admin-card select,
.admin-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

.search-box input {
  border: 0;
  padding: 0;
}

.status-pill {
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1fa972;
  box-shadow: 0 0 0 6px rgba(31, 169, 114, 0.14);
}

.hero-panel {
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel div {
  padding: 16px;
  border-radius: 8px;
  background: #f4f7fb;
}

.hero-media {
  display: none;
  margin: 0;
  min-height: 360px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}

.hero-media img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: block;
  object-fit: cover;
}

.metric {
  display: block;
  font-size: 34px;
  font-weight: 850;
}

.metric-label {
  color: var(--muted);
}

.ad-band,
.side-ad {
  min-height: 96px;
  display: grid;
  place-items: center;
  border: 1px dashed #b8c3d4;
  border-radius: 8px;
  background: #f9fbfe;
  color: var(--muted);
  font-size: 14px;
}

.ad-band {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 26px;
}

.ad-band.inline {
  width: 100%;
  margin: 24px 0 0;
}

.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.insight-section,
.related-section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 28px;
}

.editorial-band {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(31, 44, 71, 0.06);
}

.research-grid,
.article-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.research-grid article,
.article-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 18px;
}

.research-grid h3,
.article-card h2,
.article-card h3 {
  margin: 0 0 10px;
  line-height: 1.3;
}

.research-grid p,
.article-card p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.7;
}

.article-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: 0 10px 26px rgba(31, 44, 71, 0.06);
}

.article-card span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
}

.article-card .visit-link {
  margin-top: auto;
}

.article-library {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wide-shell {
  width: min(1180px, calc(100% - 32px));
}

.prose-body {
  max-width: 760px;
}

.prose-body p {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 17px;
}

.article-title h1 {
  font-size: clamp(34px, 5vw, 60px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.insight-section .section-head {
  display: block;
  margin-bottom: 14px;
}

.insight-section .section-head h2,
.insight-section .section-head p {
  max-width: 760px;
  text-align: left;
}

.topic-grid,
.compact-case-grid {
  display: grid;
  gap: 14px;
}

.topic-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.topic-card {
  min-height: 150px;
  display: grid;
  align-content: start;
  gap: 8px;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  box-shadow: 0 10px 26px rgba(31, 44, 71, 0.06);
}

.topic-card:hover {
  border-color: #9ab4d0;
  background: #f9fbfe;
}

.topic-card span {
  font-size: 18px;
  font-weight: 850;
}

.topic-card strong {
  color: var(--accent);
  font-size: 28px;
}

.topic-card small {
  color: var(--muted);
  line-height: 1.55;
}

.compact-case-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-case-card {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 10px 26px rgba(31, 44, 71, 0.06);
}

.compact-case-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.compact-case-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.compact-case-card .visit-link {
  margin-top: auto;
}

.video-tag {
  background: #fff1ef;
  color: #b42318;
}

.sidebar,
.tool-section {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 88px;
}

.sidebar h2,
.section-head h2,
.admin-card h2 {
  margin: 0;
}

.category-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 18px;
}

.category-button {
  width: 100%;
  min-height: 44px;
  justify-content: flex-start;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.category-button.active {
  background: #10233d;
  color: #fff;
}

.section-head {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.section-head select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tool-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(31, 44, 71, 0.07);
}

.case-thumb {
  width: 100%;
  height: 112px;
  display: block;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.case-thumb.wide {
  height: 150px;
  object-fit: contain;
}

.case-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 22px;
  align-items: center;
}

.case-cover {
  margin: 0;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f7fafc;
}

.case-cover img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: block;
  object-fit: contain;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fact-grid div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}

.fact-grid span,
.source-note {
  color: var(--muted);
  font-size: 13px;
}

.fact-grid strong {
  line-height: 1.5;
}

.case-evidence .section-head {
  margin-bottom: 12px;
}

.evidence-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.evidence-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 8px 12px;
  font-weight: 800;
}

.ranking-link-grid,
.ranking-grid {
  display: grid;
  gap: 14px;
}

.ranking-link-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ranking-link-grid a {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 10px 26px rgba(31, 44, 71, 0.06);
}

.ranking-link-grid strong {
  color: var(--accent);
}

.ranking-link-grid span,
.ranking-card p,
.ranking-note p {
  color: var(--muted);
  line-height: 1.7;
}

.ranking-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ranking-card,
.ranking-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
  box-shadow: 0 10px 26px rgba(31, 44, 71, 0.06);
}

.ranking-card {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ranking-card span:first-child {
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
}

.ranking-card h2,
.ranking-note h2 {
  margin: 0;
}

.ranking-card p,
.ranking-note p {
  margin: 0;
}

.ranking-card .visit-link {
  margin-top: auto;
}

.ranking-note {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.ranking-caution {
  border-left: 3px solid var(--accent);
  background: #f7fbff;
  padding: 10px 12px;
}

.tool-card:hover {
  border-color: #9ab4d0;
  transform: translateY(-2px);
  transition: 160ms ease;
}

.tool-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.tool-title {
  margin: 0;
  font-size: 18px;
}

.badge {
  align-self: flex-start;
  border-radius: 999px;
  background: #fff3d8;
  color: var(--amber);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.tag {
  border-radius: 999px;
  background: #edf3fa;
  color: #315273;
  padding: 5px 8px;
  font-size: 12px;
}

.visit-link {
  color: var(--blue);
  font-weight: 800;
}

.tool-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.visit-link.external {
  color: var(--accent);
}

.visit-link.video {
  color: #b42318;
}

.content-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--blue);
  font-weight: 800;
}

.content-hero {
  padding: 28px 0 18px;
}

.content-hero h1 {
  margin: 8px 0 14px;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1;
  letter-spacing: 0;
}

.content-hero p,
.article-body p,
.article-body li {
  color: var(--muted);
  line-height: 1.75;
}

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
}

.article-body,
.article-aside,
.legal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 24px;
  box-shadow: 0 10px 26px rgba(31, 44, 71, 0.07);
}

.article-body h2 {
  margin: 30px 0 10px;
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-aside {
  position: sticky;
  top: 88px;
}

.article-aside dl {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
}

.article-aside dt {
  color: var(--muted);
  font-size: 13px;
}

.article-aside dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.video-qr {
  display: block;
  width: 138px;
  height: 138px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px 14px;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 850;
}

.related-section {
  width: 100%;
  margin-top: 28px;
}

.legal-card {
  margin-top: 18px;
}

.legal-card h2 {
  margin-top: 26px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links a {
  color: var(--blue);
}

.footer {
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  padding: 36px 0;
  font-size: 14px;
}

body[data-home-style="fresh"] {
  --bg: #f3faf7;
  --text: #12312c;
  --muted: #55716b;
  --line: #cfe6dc;
  --accent: #14835f;
  --accent-strong: #0f6d4f;
  --blue: #1e6f9f;
  --amber: #bd6a1f;
}

body[data-home-style="fresh"] .hero {
  min-height: 390px;
}

body[data-home-style="fresh"] .brand-mark,
body[data-home-style="fresh"] .category-button.active {
  background: #0f3d35;
}

body[data-home-style="fresh"] .hero-panel,
body[data-home-style="fresh"] .tool-card,
body[data-home-style="fresh"] .compact-case-card,
body[data-home-style="fresh"] .topic-card {
  box-shadow: 0 14px 34px rgba(20, 131, 95, 0.11);
}

body[data-home-style="fresh"] .tag {
  background: #e8f6ef;
  color: #23634f;
}

body[data-home-style="magazine"] {
  --bg: #fbfaf7;
  --text: #171717;
  --muted: #625f59;
  --line: #ded8cb;
  --accent: #9a4f19;
  --accent-strong: #71370f;
  --blue: #2f5f9e;
  --amber: #9a4f19;
}

body[data-home-style="magazine"] .hero {
  min-height: 360px;
  grid-template-columns: 1fr;
  align-items: end;
  border-bottom: 1px solid var(--line);
}

body[data-home-style="magazine"] .hero h1 {
  max-width: 980px;
  font-size: clamp(44px, 8vw, 96px);
}

body[data-home-style="magazine"] .hero-panel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-home-style="magazine"] .layout {
  grid-template-columns: 220px minmax(0, 1fr);
}

body[data-home-style="magazine"] .tool-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-home-style="magazine"] .tool-card {
  min-height: 250px;
  border-top: 4px solid var(--accent);
}

body[data-home-style="compact"] .hero {
  min-height: 260px;
  grid-template-columns: minmax(0, 1fr);
  padding: 30px 0 22px;
}

body[data-home-style="compact"] .hero h1 {
  font-size: clamp(32px, 5vw, 56px);
}

body[data-home-style="compact"] .hero p {
  font-size: 16px;
}

body[data-home-style="compact"] .hero-panel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 12px;
}

body[data-home-style="compact"] .hero-panel div,
body[data-home-style="compact"] .tool-card,
body[data-home-style="compact"] .compact-case-card,
body[data-home-style="compact"] .topic-card {
  padding: 12px;
}

body[data-home-style="compact"] .tool-grid,
body[data-home-style="compact"] .compact-case-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body[data-home-style="compact"] .tool-card,
body[data-home-style="compact"] .compact-case-card {
  min-height: 190px;
  gap: 10px;
}

body[data-home-style="compact"] .tool-card p,
body[data-home-style="compact"] .compact-case-card p {
  font-size: 13px;
}

body[data-home-style="portrait"] {
  --bg: #f7fbf8;
  --text: #14241f;
  --muted: #5f706b;
  --line: #d6e7df;
  --accent: #267a55;
  --accent-strong: #1d6043;
  --blue: #2867a4;
}

body[data-home-style="portrait"] .hero {
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.75fr) 220px;
  min-height: 520px;
}

body[data-home-style="portrait"] .hero-media {
  display: block;
}

body[data-home-style="portrait"] .hero-media img {
  content: url("/fengge/portrait/hero.jpg");
}

body[data-home-style="portrait"] .hero-panel {
  align-self: stretch;
}

body[data-home-style="family"] {
  --bg: #fff8f2;
  --text: #241713;
  --muted: #755f57;
  --line: #ead5c6;
  --accent: #b45d34;
  --accent-strong: #8d4222;
  --blue: #275f9b;
  background:
    linear-gradient(90deg, rgba(255, 248, 242, 0.94) 0%, rgba(255, 248, 242, 0.78) 45%, rgba(255, 248, 242, 0.18) 100%),
    url("/fengge/family/hero.jpg") center top / cover fixed;
}

body[data-home-style="family"] .site-header {
  background: rgba(255, 248, 242, 0.84);
}

body[data-home-style="family"] .hero {
  min-height: 560px;
  grid-template-columns: minmax(0, 1fr) 280px;
}

body[data-home-style="family"] .hero-copy {
  padding: 24px 0;
}

body[data-home-style="family"] .hero-panel,
body[data-home-style="family"] .search-box,
body[data-home-style="family"] .status-pill {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
}

body[data-home-style="gallery"] {
  --bg: #f6f7fb;
  --text: #151a2d;
  --muted: #666b7e;
  --line: #dce1ef;
  --accent: #7256c8;
  --accent-strong: #583fa6;
  --blue: #2069b3;
}

body[data-home-style="gallery"] .hero {
  grid-template-columns: minmax(0, 0.92fr) minmax(390px, 0.88fr);
  min-height: 540px;
}

body[data-home-style="gallery"] .hero-panel {
  display: none;
}

body[data-home-style="gallery"] .hero-media {
  display: grid;
  grid-template-columns: 1fr 0.82fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body[data-home-style="gallery"] .hero-media::before,
body[data-home-style="gallery"] .hero-media::after {
  content: "";
  display: block;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
}

body[data-home-style="gallery"] .hero-media img {
  grid-row: 1 / 3;
  border-radius: 8px;
  box-shadow: var(--shadow);
  content: url("/fengge/gallery/hero-main.jpg");
}

body[data-home-style="gallery"] .hero-media::before {
  background-image: url("/fengge/gallery/hero-side-cat.jpg");
}

body[data-home-style="gallery"] .hero-media::after {
  background-image: url("/fengge/gallery/hero-side-person.jpg");
}

body[data-home-style="outdoor"] {
  --bg: #f5f8f2;
  --text: #14210f;
  --muted: #5f6f58;
  --line: #d5e2ca;
  --accent: #4f772d;
  --accent-strong: #36591c;
  --blue: #2f6690;
  background:
    linear-gradient(180deg, rgba(245, 248, 242, 0.78), rgba(245, 248, 242, 1) 620px),
    url("/fengge/outdoor/hero.jpg") center top / cover no-repeat;
}

body[data-home-style="outdoor"] .hero {
  min-height: 520px;
  align-items: end;
}

body[data-home-style="outdoor"] .hero h1,
body[data-home-style="outdoor"] .hero p,
body[data-home-style="outdoor"] .eyebrow {
  text-shadow: 0 1px 18px rgba(255, 255, 255, 0.7);
}

body[data-home-style="outdoor"] .hero-panel,
body[data-home-style="outdoor"] .search-box,
body[data-home-style="outdoor"] .status-pill {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}

body[data-home-style="storybook"] {
  --bg: #fff8df;
  --text: #26351f;
  --muted: #6a7353;
  --line: #e5d9aa;
  --accent: #7c8f2d;
  --accent-strong: #5f7120;
  --blue: #326f98;
  --amber: #bc7a21;
  background:
    linear-gradient(180deg, rgba(255, 248, 223, 0.9) 0%, rgba(255, 248, 223, 0.72) 380px, #fff8df 760px),
    url("/fengge/storybook/background.jpg") center top / cover no-repeat;
}

body[data-home-style="storybook"] .site-header {
  background: rgba(255, 248, 223, 0.78);
  border-bottom-color: rgba(124, 143, 45, 0.25);
}

body[data-home-style="storybook"] .brand-mark,
body[data-home-style="storybook"] .category-button.active {
  background: #3d5f3a;
}

body[data-home-style="storybook"] .hero {
  min-height: 620px;
  grid-template-columns: minmax(0, 0.86fr) minmax(340px, 0.74fr) 210px;
  gap: 22px;
  align-items: center;
  padding-top: 34px;
}

body[data-home-style="storybook"] .hero-copy {
  transform: rotate(-1deg);
  padding: 28px 0;
}

body[data-home-style="storybook"] .hero h1 {
  max-width: 760px;
  font-size: clamp(42px, 7.2vw, 88px);
  line-height: 1.04;
  color: #25361f;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.55);
}

body[data-home-style="storybook"] .hero p {
  color: #4f5c3d;
}

body[data-home-style="storybook"] .eyebrow {
  color: #5f7120;
}

body[data-home-style="storybook"] .search-box,
body[data-home-style="storybook"] .status-pill,
body[data-home-style="storybook"] .hero-panel,
body[data-home-style="storybook"] .topic-card,
body[data-home-style="storybook"] .compact-case-card,
body[data-home-style="storybook"] .tool-card {
  border: 2px solid rgba(94, 112, 36, 0.22);
  background: rgba(255, 255, 246, 0.92);
  box-shadow: 0 18px 0 rgba(94, 112, 36, 0.08), 0 18px 46px rgba(70, 89, 48, 0.16);
}

body[data-home-style="storybook"] .hero-media {
  display: block;
  min-height: 430px;
  border: 8px solid rgba(255, 255, 246, 0.92);
  border-radius: 22px 8px 24px 10px;
  transform: rotate(2.3deg);
  box-shadow: 0 22px 0 rgba(124, 143, 45, 0.12), 0 32px 70px rgba(49, 67, 31, 0.24);
}

body[data-home-style="storybook"] .hero-media img {
  content: url("/fengge/storybook/hero.jpg");
  filter: saturate(1.12) contrast(0.96) sepia(0.08);
}

body[data-home-style="storybook"] .hero-panel {
  transform: rotate(1.4deg) translateY(28px);
  align-self: center;
}

body[data-home-style="storybook"] .hero-panel div {
  background: #fff5cf;
}

body[data-home-style="storybook"] .ad-band,
body[data-home-style="storybook"] .side-ad {
  background: rgba(255, 255, 246, 0.82);
}

body[data-home-style="storybook"] .topic-grid {
  grid-template-columns: 1.15fr 0.92fr 1fr;
  align-items: stretch;
}

body[data-home-style="storybook"] .topic-card:nth-child(2n) {
  transform: translateY(16px) rotate(1deg);
}

body[data-home-style="storybook"] .topic-card:nth-child(3n) {
  transform: translateY(-8px) rotate(-1deg);
}

body[data-home-style="storybook"] .compact-case-grid {
  grid-template-columns: 1.1fr 0.9fr 1fr 0.95fr;
}

body[data-home-style="storybook"] .tool-card:hover,
body[data-home-style="storybook"] .compact-case-card:hover,
body[data-home-style="storybook"] .topic-card:hover {
  transform: translateY(-5px) rotate(-0.4deg);
}

body[data-home-style="storybook"] .tag {
  background: #eef0c2;
  color: #526122;
}

.storybook-pet {
  position: absolute;
  z-index: 0;
  width: var(--pet-size, 118px);
  height: var(--pet-size, 118px);
  pointer-events: none;
  background: var(--pet-image) center / contain no-repeat;
  filter: drop-shadow(0 12px 10px rgba(55, 67, 36, 0.14));
  opacity: 0.9;
}

body[data-home-style="storybook"] .site-header,
body[data-home-style="storybook"] main,
body[data-home-style="storybook"] .footer {
  position: relative;
  z-index: 2;
}

.storybook-pet-1 {
  --pet-size: 96px;
  top: 112px;
  left: max(8px, calc((100vw - 1180px) / 2 - 122px));
  transform: rotate(-8deg);
}

.storybook-pet-2 {
  --pet-size: 86px;
  top: 350px;
  right: max(8px, calc((100vw - 1180px) / 2 - 118px));
  transform: rotate(9deg);
}

.storybook-pet-3 {
  --pet-size: 104px;
  top: 650px;
  left: max(8px, calc((100vw - 1180px) / 2 - 112px));
  transform: rotate(4deg);
}

.storybook-pet-4 {
  --pet-size: 104px;
  top: 880px;
  right: max(8px, calc((100vw - 1180px) / 2 - 116px));
  transform: rotate(-5deg);
}

.storybook-pet-5 {
  --pet-size: 110px;
  top: 1210px;
  left: max(8px, calc((100vw - 1180px) / 2 - 122px));
  transform: rotate(7deg);
}

.storybook-pet-6 {
  --pet-size: 96px;
  top: 1490px;
  right: max(8px, calc((100vw - 1180px) / 2 - 120px));
  transform: rotate(-10deg);
}

.storybook-pet-7 {
  --pet-size: 106px;
  top: 1820px;
  left: max(8px, calc((100vw - 1180px) / 2 - 118px));
  transform: rotate(-3deg);
}

.storybook-pet-8 {
  display: none;
  --pet-size: 96px;
  top: 2100px;
  right: max(8px, calc((100vw - 1180px) / 2 - 118px));
  transform: rotate(8deg);
}

.admin-body {
  background: #eef3f8;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 60px;
}

.admin-login {
  min-height: 80vh;
  display: grid;
  place-items: center;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
  box-shadow: 0 12px 38px rgba(31, 44, 71, 0.08);
}

.admin-card h1,
.admin-card h2,
.admin-topbar h1 {
  margin: 6px 0 12px;
}

.admin-card p {
  color: var(--muted);
  line-height: 1.6;
}

.stack {
  display: grid;
  gap: 14px;
}

.stack label {
  display: grid;
  gap: 7px;
  color: #40516a;
  font-size: 14px;
  font-weight: 700;
}

.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
}

.check-row input {
  width: auto;
}

.form-message {
  min-height: 22px;
  color: var(--muted);
  font-size: 14px;
}

.hidden {
  display: none !important;
}

.admin-topbar {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.topbar-actions {
  gap: 10px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-dashboard {
  display: grid;
  gap: 16px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 10px 26px rgba(31, 44, 71, 0.06);
}

.admin-tab {
  min-height: 38px;
  background: #eef3f8;
  color: #334155;
  padding: 0 14px;
}

a.admin-tab {
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.admin-tab.active {
  background: #10233d;
  color: #fff;
}

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: grid;
  gap: 16px;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-stat {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 16px;
}

.admin-stat span {
  color: var(--muted);
  font-size: 13px;
}

.admin-stat strong {
  font-size: 24px;
}

.admin-section-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
}

td input,
td select,
td textarea {
  min-width: 130px;
}

td textarea {
  min-height: 74px;
  resize: vertical;
}

.tool-table {
  min-width: 1080px;
}

.analysis-row td {
  background: #f8fbff;
  padding-top: 0;
}

.analysis-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.analysis-editor summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 800;
}

.admin-fact-preview {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}

.admin-fact-preview img {
  width: 100%;
  height: 110px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-fact-preview p {
  margin: 6px 0;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.analysis-grid label {
  display: grid;
  gap: 6px;
  color: #40516a;
  font-size: 13px;
  font-weight: 800;
}

.analysis-grid textarea {
  min-height: 110px;
}

.analysis-wide {
  grid-column: 1 / -1;
}

.page-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.page-editor {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 14px;
}

.page-editor h3 {
  margin: 0;
}

.page-editor label {
  display: grid;
  gap: 6px;
  color: #40516a;
  font-size: 13px;
  font-weight: 800;
}

.page-editor textarea {
  min-height: 180px;
}

.article-editor-list {
  display: grid;
  gap: 14px;
}

.article-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 14px;
}

.article-editor h3 {
  margin: 0;
}

.article-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.article-editor-grid label {
  display: grid;
  gap: 6px;
  color: #40516a;
  font-size: 13px;
  font-weight: 800;
}

.article-editor-grid textarea[data-article-field="body"] {
  min-height: 320px;
}

.danger-button {
  background: #fff0f0;
  color: #b42318;
}

.danger-button:hover {
  background: #ffe1e1;
}

@media (max-width: 920px) {
  .hero,
  .layout,
  .case-hero,
  .ranking-link-grid,
  .ranking-grid,
  .topic-grid,
  .compact-case-grid,
  .research-grid,
  .article-card-grid,
  .article-library,
  .admin-grid,
  .article-grid {
    grid-template-columns: 1fr;
  }

  .fact-grid {
    grid-template-columns: 1fr;
  }

  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .admin-fact-preview {
    grid-template-columns: 1fr;
  }

  .page-editor-grid {
    grid-template-columns: 1fr;
  }

  .article-editor-grid {
    grid-template-columns: 1fr;
  }

  .admin-stat-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .article-aside {
    position: static;
  }

  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-home-style="magazine"] .hero-panel,
  body[data-home-style="compact"] .hero-panel,
  body[data-home-style="compact"] .tool-grid,
  body[data-home-style="compact"] .compact-case-grid,
  body[data-home-style="portrait"] .hero,
  body[data-home-style="gallery"] .hero,
  body[data-home-style="storybook"] .hero,
  body[data-home-style="storybook"] .topic-grid,
  body[data-home-style="storybook"] .compact-case-grid {
    grid-template-columns: 1fr;
  }

  body[data-home-style="portrait"] .hero-media,
  body[data-home-style="gallery"] .hero-media,
  body[data-home-style="storybook"] .hero-media {
    min-height: 300px;
  }

  body[data-home-style="storybook"] .hero-copy,
  body[data-home-style="storybook"] .hero-media,
  body[data-home-style="storybook"] .hero-panel,
  body[data-home-style="storybook"] .topic-card:nth-child(n) {
    transform: none;
  }

  .storybook-pet {
    display: none;
    opacity: 0;
    width: 0;
    height: 0;
  }

  .storybook-pet-1,
  .storybook-pet-3,
  .storybook-pet-5,
  .storybook-pet-7 {
    left: 4px;
  }

  .storybook-pet-2,
  .storybook-pet-4,
  .storybook-pet-6,
  .storybook-pet-8 {
    right: 4px;
  }
}

@media (max-width: 620px) {
  .hero {
    padding-top: 34px;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .section-head,
  .admin-topbar,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions a,
  .topbar-actions button {
    flex: 1;
  }
}
