/* 唯一的栏目顶部样式：不依赖归档页或漫剧页的 header 类名。 */
.shared-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: #080807;
  color: #e0ddd3;
  border-bottom: 1px solid #f3c94f29;
  font: 500 14px/1.4 "Space-Grotesk", Arial, sans-serif;
  color-scheme: dark;
}
.shared-site-header *, .shared-site-header *::before, .shared-site-header *::after { box-sizing: border-box; }
.shared-header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  width: min(1280px, calc(100% - 48px));
  min-height: 72px;
  margin: 0 auto;
}
.shared-header-logo { display: flex; flex: 0 0 108px; }
.shared-header-logo img { display: block; width: 108px; height: 56px; object-fit: contain; }
.shared-header-nav { display: flex; align-self: stretch; align-items: stretch; gap: 22px; }
.shared-header-nav a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  color: #d5d1c5;
  text-decoration: none;
  white-space: nowrap;
  font: inherit;
  font-weight: 700;
}
.shared-header-nav a[hidden] { display: none !important; }
.shared-header-nav svg { flex: 0 0 22px; width: 22px; height: 22px; color: #f3c94f; }
.shared-header-nav a[data-nav-key="ai-drama"] svg {
  width: 27px;
  height: 27px;
  padding: 4px;
  overflow: visible;
  border: 1px solid #ffe991;
  border-radius: 9px;
  background: linear-gradient(145deg,#ff4fa7,#7e36ff);
  color: #fff;
  filter: drop-shadow(0 0 8px #ff4fa799);
}
.shared-header-nav a[data-nav-key="ai-drama"][data-age-locked="true"]::before {
  content: "18+";
  position: absolute;
  top: 7px;
  left: 17px;
  z-index: 1;
  min-width: 25px;
  padding: 2px 4px;
  border: 1px solid #080807;
  border-radius: 999px;
  background: #ffdb26;
  color: #171713;
  font: 950 8px/1 system-ui,sans-serif;
  text-align: center;
  box-shadow: 0 2px 8px #0008;
}
.shared-header-nav a:hover, .shared-header-nav a[aria-current="page"] { color: #f3c94f; }
.shared-header-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #f3c94f;
}
.shared-site-header a:focus-visible, .shared-site-header button:focus-visible,
.shared-site-header select:focus-visible { outline: 2px solid #f3c94f; outline-offset: 3px; }
.shared-header-search {
  display: flex;
  align-items: center;
  flex: 1 1 220px;
  min-width: 100px;
  height: 40px;
  margin: 0 0 0 auto;
  padding: 0 10px 0 2px;
  border: 1px solid #49463a;
  border-radius: 24px;
  background: #1a1a16;
}
.shared-header-search:focus-within { border-color: #f3c94f; }
.shared-header-search button {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #aaa69b;
  cursor: pointer;
}
.shared-header-search svg { width: 17px; height: 17px; }
.shared-header-search input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
  color: #f4f1e9;
  font: inherit;
  font-size: 12px;
}
.shared-header-search input::placeholder { color: #aaa69b; }
.shared-header-actions { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 10px; margin-left: auto; }
.shared-header-locale {
  width: 83px;
  height: 40px;
  margin: 0;
  padding: 0 7px;
  border: 1px solid #49463a;
  border-radius: 8px;
  background: #1a1a16;
  color: #e8dba9;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.shared-site-header .offline-language-control { display: inline-flex; align-items: center; }
.shared-site-header .offline-language-control select {
  width: 104px;
  height: 40px;
  margin: 0;
  padding: 0 7px;
  border: 1px solid #49463a;
  border-radius: 8px;
  background: #1a1a16;
  color: #e8dba9;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.shared-site-header .shared-header-actions #member-widget-button {
  position: static !important;
  inset: auto !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 6px;
  width: auto !important;
  max-width: 140px;
  height: 40px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  border: 1px solid #e5c361 !important;
  border-radius: 24px !important;
  box-shadow: none !important;
  background: linear-gradient(135deg, #ffe97a, #f3c94f 58%, #d7a51e);
  color: #171713;
  font: inherit;
  font-size: 12px;
  z-index: auto !important;
}
.shared-site-header .member-widget-label { position: static; width: auto; height: auto; clip-path: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shared-site-header .member-widget-avatar { width: 22px; height: 22px; background: transparent; color: #171713; }
.shared-site-header .member-widget-avatar svg { width: 22px; height: 22px; }
.shared-site-header .restorer-age-switch-wrap {
  position: static !important;
  inset: auto !important;
  order: 0;
  width: 64px;
  height: 36px;
  margin: 0 !important;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  z-index: auto !important;
}
.shared-site-header .restorer-age-switch-wrap .restorer-age-toggle { width: 64px !important; height: 34px !important; }
.shared-site-header .restorer-age-switch-wrap .restorer-age-color::before { left: 0 !important; top: 0 !important; width: 26px !important; height: 26px !important; font-size: 10px !important; }
.shared-site-header .restorer-age-switch-wrap .restorer-age-toggle[aria-checked="true"] .restorer-age-color::before { transform: translateX(30px) !important; }
html[data-shared-header] .mobile-discover-nav { display: none !important; }
html[data-shared-header] body.generated-site-page { padding-top: 0; }
/* 首页与三个栏目共用布局；AI 入口始终显示，18- 模式点击时由年龄确认组件接管。 */
@media (max-width: 1200px) and (min-width: 1101px) {
  .shared-header-inner { gap: 14px; }
  .shared-header-nav { gap: 14px; }
  .shared-header-nav a { font-size: 12px; gap: 6px; }
}
@media (max-width: 1100px) {
  .shared-header-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "logo actions" "nav nav" "search search";
    gap: 6px 12px;
    padding: 6px 0 10px;
  }
  .shared-header-logo { grid-area: logo; }
  .shared-header-logo img { width: 86px; height: 44px; }
  .shared-header-actions { grid-area: actions; min-width: 0; margin-left: auto; }
  .shared-header-nav { grid-area: nav; gap: 12px; width: 100%; }
  .shared-header-nav a { flex: 1; min-width: 0; min-height: 44px; }
  .shared-header-search { grid-area: search; width: 100%; margin: 0; }
}
@media (max-width: 650px) {
  .shared-header-inner { width: calc(100% - 24px); gap: 4px 8px; }
  .shared-header-logo img { width: 74px; height: 40px; }
  .shared-header-nav { gap: 6px; }
  .shared-header-nav a { gap: 5px; font-size: 11px; white-space: normal; text-align: center; overflow-wrap: anywhere; }
  .shared-header-nav svg { flex-basis: 19px; width: 19px; height: 19px; }
  .shared-header-nav a[data-nav-key="ai-drama"] svg { flex-basis: 24px; width: 24px; height: 24px; }
  .shared-header-nav a[data-nav-key="ai-drama"][data-age-locked="true"]::before { top: 5px; left: 12px; }
  .shared-header-actions { gap: 7px; }
  .shared-header-locale { width: 74px; height: 36px; padding: 0 4px; font-size: 11px; }
  .shared-site-header .offline-language-control select { width: 74px; height: 36px; padding: 0 4px; font-size: 11px; }
  .shared-site-header .shared-header-actions #member-widget-button { width: 36px !important; height: 36px !important; padding: 0 !important; }
  .shared-site-header .member-widget-label { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); }
  .shared-header-search { height: 38px; }
}

/* 后台“JS 嵌入模块”：导航区下方的 iframe 广告位。 */
.shared-site-embed { width: 100%; max-width: 1200px; margin: 8px auto 0; padding: 0 12px; box-sizing: border-box; }
.shared-site-embed iframe { display: block; width: 100%; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.04); overflow: hidden; }
