:root {
  color-scheme: light;
  --bg: #f7f4ef;
  --surface: #fffaf3;
  --surface-strong: #ffffff;
  --text: #171514;
  --muted: #6f675d;
  --line: #ded4c8;
  --accent: #c84f31;
  --accent-strong: #84321f;
  --accent-soft: #f1d8ca;
  --shadow: 0 24px 70px rgba(68, 46, 29, 0.14);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #111319;
  --surface: #191d26;
  --surface-strong: #222735;
  --text: #f6f1e8;
  --muted: #b7b0a5;
  --line: #343b4d;
  --accent: #e0b55f;
  --accent-strong: #ffd27c;
  --accent-soft: #3b3324;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

[data-theme="fresh"] {
  --bg: #eef7f1;
  --surface: #fbfffc;
  --surface-strong: #ffffff;
  --text: #12221a;
  --muted: #5f7068;
  --line: #cee2d5;
  --accent: #23885d;
  --accent-strong: #146140;
  --accent-soft: #d8efe4;
  --shadow: 0 24px 70px rgba(31, 91, 63, 0.14);
}

[data-theme="magazine"] {
  --bg: #f2f3f7;
  --surface: #ffffff;
  --surface-strong: #fff;
  --text: #171820;
  --muted: #606476;
  --line: #d9dce8;
  --accent: #4d63d8;
  --accent-strong: #2f3ea0;
  --accent-soft: #dfe4ff;
  --shadow: 0 24px 70px rgba(46, 57, 112, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  transition: background 180ms ease, color 180ms ease;
}

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

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

button,
input {
  font: inherit;
}

.site-header,
main,
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 18px;
}

.brand,
.header-actions,
.main-nav,
.hero-actions {
  display: flex;
  align-items: center;
}

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

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--text);
  color: var(--surface);
}

.main-nav {
  gap: 28px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
}

.main-nav a:hover {
  color: var(--accent);
}

.main-nav .is-current {
  color: var(--text);
}

.nav-theme-trigger.is-current {
  color: var(--text);
}

.nav-theme {
  position: relative;
}

.nav-theme-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 650;
}

.nav-theme-trigger::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.nav-theme:hover .nav-theme-trigger,
.nav-theme:focus-within .nav-theme-trigger {
  color: var(--accent);
}

.nav-theme-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  z-index: 10;
  display: none;
  grid-template-columns: 1fr;
  min-width: 172px;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.nav-theme-menu::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: 16px;
}

/* 桌面端：hover 显示 */
.nav-theme:hover .nav-theme-menu,
.nav-theme:focus-within .nav-theme-menu {
  display: grid;
}

/* 移动端：JS 切换 is-open 强制显示 */
.nav-theme.is-open .nav-theme-menu {
  display: grid !important;
}

.nav-theme-menu button,
.nav-theme-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 9px 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 800;
  text-align: left;
}

.nav-theme-menu button:hover,
.nav-theme-menu button.is-active,
.nav-theme-menu a:hover,
.nav-theme-menu a.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

/* ==========================================
   主页风格选择栏（独立区块）
   ========================================== */
.theme-picker {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 48px;
  text-align: center;
}

.theme-picker-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.theme-picker-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.theme-picker-options button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 9px 22px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.theme-picker-options button:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.theme-picker-options button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.theme-picker-options button.is-active .swatch {
  border-color: rgba(255, 255, 255, 0.6);
}

.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.swatch-editorial {
  background: #c84f31;
}

.swatch-midnight {
  background: #e0b55f;
}

.swatch-fresh {
  background: #23885d;
}

.swatch-magazine {
  background: #4d63d8;
}

.header-actions {
  position: relative;
  gap: 10px;
}

.site-search {
  position: absolute;
  top: calc(100% + 10px);
  right: 58px;
  z-index: 12;
  width: min(300px, calc(100vw - 32px));
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.site-search.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.site-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  outline: none;
}

.site-search input:focus {
  border-color: var(--accent);
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.button-small {
  min-height: 42px;
  padding-inline: 18px;
}

.button-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.button-ghost:hover {
  color: #fff;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(340px, 0.96fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  min-height: calc(100vh - 102px);
  padding: 28px 0 74px;
}

.hero-copy {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 12ch;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 4.2vw, 3.4rem);
  line-height: 1.41;
  letter-spacing: 0;
}

.hero-text {
  max-width: 620px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(1.03rem, 2vw, 1.25rem);
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero-card,
.newsletter,
.topic-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.hero-card {
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-card img {
  width: 100%;
  aspect-ratio: auto;
  object-fit: contain;
}

.hero-card-body {
  padding: 24px;
}

.tag {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 900;
}

.hero-card h2,
.section-heading h2,
.newsletter h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.05;
}

.hero-card h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.hero-card p,
.meta {
  color: var(--muted);
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.14);
}

.swatch-editorial {
  background: #c84f31;
}

.swatch-midnight {
  background: #111319;
}

.swatch-fresh {
  background: #23885d;
}

.swatch-magazine {
  background: #4d63d8;
}

.section {
  padding: 84px 0 0;
}

.section-heading {
  margin-bottom: 26px;
}

.page-intro {
  max-width: 760px;
  padding: 68px 0 28px;
}

.page-intro h1 {
  max-width: none;
}

.page-intro p:last-child {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.03rem, 2vw, 1.25rem);
}

.section-heading h2,
.newsletter h2 {
  font-size: clamp(1.0rem, 2vw, 1.8rem);
}

.newsletter h2 {
  font-size: clamp(0.7rem, 1.4vw, 1.26rem);
}

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

.topic-card {
  display: flex;
  min-height: 138px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}

.topic-card span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 800;
}

.topic-card strong {
  color: var(--muted);
  font-size: 0.88rem;
}

.masonry-gallery {
  column-count: 3;
  column-gap: 18px;
}

.search-summary {
  min-height: 24px;
  margin: -30px 0 20px;
  color: var(--muted);
  font-weight: 750;
}

.masonry-item {
  display: inline-block;
  width: 100%;
  margin: 0 0 18px;
  overflow: hidden;
  break-inside: avoid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: zoom-in;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.masonry-item:hover,
.masonry-item:focus {
  box-shadow: var(--shadow);
  outline: none;
  transform: translateY(-2px);
}

.masonry-item img {
  width: 100%;
  object-fit: cover;
}

.masonry-item.is-text-only {
  min-height: 180px;
}

.masonry-item.is-text-only .masonry-caption {
  display: flex;
  min-height: 180px;
  flex-direction: column;
  justify-content: center;
}

.masonry-caption {
  padding: 18px;
}

.masonry-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.masonry-meta .tag {
  margin-bottom: 0;
}

.like-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface-strong);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 850;
  white-space: nowrap;
}

.like-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.masonry-caption h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.22rem, 2vw, 1.7rem);
  line-height: 1.15;
}

.masonry-caption p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.has-lightbox {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(12, 12, 12, 0.72);
  cursor: zoom-out;
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: min(86vh, 880px);
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.lightbox-panel img {
  width: 100%;
  max-height: 66vh;
  object-fit: contain;
  background: #111;
}

.lightbox-panel figcaption {
  padding: 20px;
}

.lightbox-panel h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 3vw, 2.4rem);
  line-height: 1.1;
}

.lightbox-panel p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
}

.newsletter {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 0.64fr);
  gap: 34px;
  align-items: end;
  margin-top: 84px;
  padding: clamp(28px, 5vw, 52px);
  background: var(--text);
  color: var(--surface);
}

.newsletter .eyebrow {
  color: var(--accent);
}

.subscribe-form {
  display: flex;
  gap: 10px;
}

.subscribe-form .button {
  flex: 0 0 auto;
  min-width: 88px;
  padding-inline: 18px;
  font-size: 0.95rem;
  white-space: nowrap;
}

.subscribe-form input {
  width: 100%;
  min-height: 50px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 18px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.subscribe-form input:focus {
  border-color: var(--accent);
}

.subscribe-status {
  grid-column: 1 / -1;
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--accent);
  font-weight: 800;
}

.contact-page {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(340px, 0.78fr);
  gap: clamp(30px, 6vw, 84px);
  align-items: start;
  min-height: calc(100vh - 178px);
  padding: 72px 0 64px;
}

.contact-copy h1 {
  max-width: 11ch;
}

.contact-copy p {
  max-width: 620px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 2vw, 1.24rem);
}

.contact-direct {
  display: grid;
  gap: 6px;
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.contact-direct span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.contact-direct a {
  width: fit-content;
  color: var(--accent-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.6rem, 4vw, 2.7rem);
  line-height: 1.1;
}

.contact-form {
  display: grid;
  gap: 16px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.contact-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  background: var(--surface-strong);
  color: var(--text);
  outline: none;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
}

.admin-page {
  display: grid;
  gap: 34px;
  padding: 64px 0;
}

.admin-heading {
  max-width: 760px;
}

.admin-heading h1 {
  max-width: none;
}

.admin-heading p {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(1.03rem, 2vw, 1.2rem);
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

.admin-form input,
.admin-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  background: var(--surface-strong);
  color: var(--text);
  outline: none;
}

.admin-form textarea {
  resize: vertical;
}

.admin-form input:focus,
.admin-form textarea:focus {
  border-color: var(--accent);
}

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

.admin-actions,
.admin-list-heading,
.admin-item-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-actions {
  grid-column: 1 / -1;
  flex-wrap: wrap;
}

.admin-list-section {
  display: grid;
  gap: 18px;
}

.admin-list-heading {
  justify-content: space-between;
}

.admin-list-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.text-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 850;
}

.text-button.danger {
  color: #b0382a;
}

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

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

.admin-stats article {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-stats span,
.subscriber-item span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

.admin-stats strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.1;
}

.subscriber-list {
  display: grid;
  gap: 12px;
}

.subscriber-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.subscriber-item div {
  display: grid;
  gap: 4px;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

.admin-item {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  object-fit: cover;
}

.admin-text-thumb {
  display: grid;
  width: 100%;
  aspect-ratio: 1 / 1;
  place-items: center;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 900;
}

.admin-item h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  line-height: 1.16;
}

.admin-item p {
  margin: 8px 0 12px;
  color: var(--muted);
}

.admin-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.admin-item-meta .tag {
  margin-bottom: 0;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 36px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer span:first-child {
  color: var(--text);
  font-weight: 900;
}

.secret-admin-link {
  color: var(--text);
  font-weight: 900;
}

.secret-admin-link:hover {
  color: var(--accent);
}

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

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent-strong, #222);
  color: #fff;
  padding: 12px 28px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 9999;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 920px) {
  .site-header {
    flex-wrap: wrap;
  }

  .main-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 2em;
    padding-top: 4px;
  }

  .main-nav a {
    padding: 6px 14px;
    margin: 0;
  }

  /* 取消之前单独给画廊加的右边距 */
  .main-nav a:nth-child(2) {
    margin-right: 0;
  }

  /* 移动端：风格选择改为全宽横向二级菜单栏 */
  .nav-theme-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding: 12px 16px;
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
    z-index: 9;
    transform: none;
    border-radius: 0;
    min-width: auto;
    grid-template-columns: none;
  }

  .nav-theme-menu::before {
    display: none;
  }

  /* 移动端禁用 hover 显示，完全由 JS 的 is-open 控制 */
  .nav-theme:hover .nav-theme-menu {
    display: none;
  }

  .nav-theme.is-open .nav-theme-menu {
    display: flex !important;
  }

  /* 横向按钮样式：紧凑 pill */
  .nav-theme-menu button {
    flex-shrink: 0;
    width: auto;
    white-space: nowrap;
    padding: 8px 16px;
    font-size: 0.82rem;
    border-radius: 20px;
  }

  .nav-theme-menu button:hover,
  .nav-theme-menu button.is-active {
    background: var(--accent-soft);
    color: var(--accent-strong);
  }

  .hero,
  .contact-page,
  .newsletter {
    grid-template-columns: 1fr;
  }

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

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

  .hero {
    min-height: auto;
    padding-top: 34px;
  }

  h1 {
    max-width: 13ch;
  }

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

  .masonry-gallery {
    column-count: 2;
  }
}

@media (max-width: 640px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 24px, 1180px);
  }

  .header-actions .button {
    display: none;
  }

  .hero {
    gap: 30px;
    padding-bottom: 52px;
  }

  h1 {
    font-size: clamp(1.33rem, 8.5vw, 2.1rem);
  }

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

  .masonry-gallery {
    column-count: 1;
  }

  .subscribe-form,
  .site-footer {
    flex-direction: column;
  }

  .subscribe-form .button {
    width: 100%;
  }

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