:root {
  --shell-bg: #0b1016;
  --shell-bg-2: #111923;
  --shell-text: #eef4ff;
  --shell-muted: #9fb0c4;
  --shell-line: rgba(226, 192, 126, 0.28);
  --shell-accent: #e2c07e;
}

* {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

/* Runtime config anti-flicker:
   hide shell regions until shell.js applies latest runtime config. */
html:not([data-runtime-ready="1"]) .shell-header,
html:not([data-runtime-ready="1"]) .site-topbar,
html:not([data-runtime-ready="1"]) .topbar,
html:not([data-runtime-ready="1"]) .shell-footer,
html:not([data-runtime-ready="1"]) .site-footer,
html:not([data-runtime-ready="1"]) .shell-main,
html:not([data-runtime-ready="1"]) .main-center,
html:not([data-runtime-ready="1"]) .main-content,
html:not([data-runtime-ready="1"]) .wrap,
html:not([data-runtime-ready="1"]) .layout {
  visibility: hidden !important;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "Segoe UI", sans-serif !important;
  color: var(--shell-text);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(226, 192, 126, 0.16), transparent 60%),
    radial-gradient(700px 400px at 8% 10%, rgba(140, 170, 205, 0.16), transparent 60%),
    linear-gradient(145deg, var(--shell-bg) 0%, var(--shell-bg-2) 100%) !important;
  background-color: var(--shell-bg) !important;
}

button,
input,
select,
textarea {
  font-family: inherit !important;
}

/* 广告位统一为文档流底部展示，禁止固定悬浮遮挡页面按钮 */
#ad-container,
.ad-container,
.ad-wrap,
[data-ad-wrapper] {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  z-index: auto !important;
  box-shadow: none !important;
  margin-top: 16px !important;
  margin-bottom: 0 !important;
}

.shell-header,
.site-topbar,
.topbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important;
  border-bottom: 1px solid var(--shell-line) !important;
  background: rgba(8, 14, 22, 0.9) !important;
  backdrop-filter: blur(8px) !important;
}

.shell-inner,
.site-topbar-inner,
.topbar-inner {
  width: min(1160px, 92vw) !important;
  margin: 0 auto !important;
  min-height: 52px !important;
  height: 52px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
}

.shell-brand,
.site-brand,
.brand {
  color: var(--shell-text) !important;
  text-decoration: none !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  letter-spacing: 0.03em;
  white-space: nowrap;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.shell-nav,
.site-nav,
.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.shell-nav a,
.site-nav a,
.topnav a {
  color: #ccdaeb !important;
  text-decoration: none !important;
  font-size: 0.82rem !important;
  border: 1px solid rgba(226, 192, 126, 0.3) !important;
  border-radius: 999px !important;
  padding: 6px 10px !important;
  background: rgba(255, 255, 255, 0.02) !important;
}

.shell-nav a.lang-switch,
.site-nav a.lang-switch,
.topnav a.lang-switch {
  border: none !important;
  padding: 1px 4px !important;
  border-radius: 999px !important;
  background: transparent !important;
  font-weight: 400 !important;
  letter-spacing: 0.03em !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 1.8em;
  line-height: 1.1;
  font-size: 0.68rem !important;
}

.shell-nav a.lang-switch.is-active,
.site-nav a.lang-switch.is-active,
.topnav a.lang-switch.is-active {
  color: #ffffff !important;
  text-decoration: none !important;
  border: none !important;
  border-radius: 999px !important;
  background: rgba(143, 170, 206, 0.16) !important;
  box-shadow: none !important;
  font-weight: 400 !important;
}

.shell-nav .lang-sep,
.site-nav .lang-sep,
.topnav .lang-sep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(170, 190, 210, 0.75);
  font-size: 0.66rem;
  line-height: 1;
  margin: 0 -6px;
  user-select: none;
  pointer-events: none;
}

.shell-menu-btn {
  display: none;
  border: 1px solid rgba(226, 192, 126, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #dbe7f5;
  min-width: 34px;
  height: 30px;
  padding: 0 8px;
  font-size: 1rem;
  line-height: 1;
}

.shell-menu-panel {
  display: none;
}

.shell-main {
  width: min(1160px, 92vw);
  margin: 0 auto;
  padding-top: 84px;
  padding-bottom: calc(58px + env(safe-area-inset-bottom));
}

.shell-footer,
.site-footer {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 1000 !important;
  border-top: 1px solid var(--shell-line) !important;
  background: rgba(8, 14, 22, 0.9) !important;
}

.shell-footer-inner,
.site-footer-inner,
.footer-inner {
  width: min(1160px, 92vw) !important;
  margin: 0 auto !important;
  min-height: 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--shell-muted) !important;
  font-size: 0.82rem !important;
}

@media (max-width: 768px) {
  .shell-inner,
  .site-topbar-inner,
  .topbar-inner {
    width: 100% !important;
    max-width: none !important;
    min-height: 44px !important;
    padding: 0 10px !important;
  }

  .shell-main {
    width: 100%;
    padding-top: 62px;
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: calc(46px + env(safe-area-inset-bottom));
  }

  .shell-nav,
  .site-nav,
  .topnav {
    display: none !important;
  }

  .shell-menu-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .shell-menu-panel {
    position: fixed;
    right: 10px;
    top: 52px;
    width: min(220px, calc(100vw - 20px));
    border: 1px solid rgba(226, 192, 126, 0.3);
    border-radius: 12px;
    background: rgba(8, 14, 22, 0.97);
    padding: 8px;
    z-index: 1200;
  }

  .shell-menu-panel.open {
    display: block;
  }

  .shell-menu-panel a {
    display: block;
    color: #dbe7f5;
    text-decoration: none;
    font-size: 0.86rem;
    padding: 8px 10px;
    border-radius: 8px;
  }

  .shell-menu-panel a:hover {
    background: rgba(226, 192, 126, 0.12);
  }

  .shell-footer-inner,
  .site-footer-inner,
  .footer-inner {
    width: 100% !important;
    max-width: none !important;
    min-height: 34px !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 0 8px !important;
  }
}
