/* ===== MAIN WRAPPER ===== */
.main {
  position: relative;
  width: 100%;
  max-width: var(--page-max);
  margin: 24px auto 0;
  padding-left: var(--page-pad-x);
  padding-right: var(--page-pad-x);
  box-sizing: border-box;
}

.main > * {
  position: relative;
  z-index: 1;
}

/* Footer: always edge-to-edge (border/background full viewport); content uses --align-pad-x */
body > .footer {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  box-sizing: border-box;
}

/* ===== SITE HEADER WRAPPER (全宽 fixed) ===== */
.site-header-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  width: 100%;
}

/* ===== PREVIEW NOTICE (above nav) ===== */
html[data-preview-banner-dismissed] {
  --preview-banner-stack: 0px;
}

html[data-preview-banner-dismissed] .preview-banner {
  display: none;
}

.preview-banner {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  background: #080808;
  color: #fff;
  text-align: center;
  padding: 8px 44px 8px 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 24px;
  letter-spacing: 0;
  height: 44px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.preview-banner__inner {
  margin: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0px;
  max-width: 100%;
  text-align: center;
  height: 25px;
}
.preview-banner__close {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.preview-banner__close:hover {
  color: #fff;
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.06);
}
.preview-banner__close svg {
  width: 16px;
  height: 16px;
  display: block;
}
.preview-banner__badge {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 70px;
  margin-top: 1px;
  margin-right: 8px;
  background: transparent;
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  padding: 2px 8px;
  line-height: 16.5px;
  height: 23px;
  border-radius: 0;
  border: 1px dashed rgba(255, 255, 255, 0.45);
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-sizing: border-box;
}
.preview-banner__text {
  text-align: center;
  color: #e0e0e0;
  line-height: 21px;
  letter-spacing: 0.3px;
}

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* 与 .main 同列：viewport 居中 + --page-pad-x（见 base.css --align-pad-x） */
  padding: 16px var(--align-pad-x) 17px;
  background: rgba(8,8,8,0.8);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  width: 100%;
  gap: 16px;
}

.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.nav-toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: rgba(8,8,8,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 24px;
  flex-direction: column;
  gap: 20px;
  z-index: 99;
  width: 100%;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: var(--font-ui);
  font-size: var(--t-body);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  transition: color 0.15s;
}
.mobile-menu a:hover { color: var(--muted); }
.mobile-menu .btn-connect { align-self: flex-start; }

.logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}
.logo img {
  width: 132px;
  height: 22px;
  display: block;
  margin: 4px;
}

.nav {
  display: flex;
  gap: 32px;
  align-items: center;
  margin-left: auto;
  transform: translateX(-12px);
}
.nav a {
  font-family: var(--font-ui);
  font-size: var(--t-body);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  transition: color 0.15s;
}
.nav a:hover { color: var(--muted); }

.btn-connect {
  font-family: var(--font-ui);
  font-size: var(--t-body);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #000;
  border: 1px solid var(--border);
  padding: 7px 20px;
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-connect:hover { background: #f0f0f0; }

.lang-dropdown-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.lang-toggle {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.lang-toggle:hover,
.github-btn:hover,
.nav-toggle:hover {
  border-color: #333333;
  background: rgba(255, 255, 255, 0.06);
}
.lang-toggle svg,
.github-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.lang-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #1e1e1e;
  border: 1px solid var(--border);
  min-width: 140px;
  display: none;
  flex-direction: column;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.lang-dropdown-menu.show {
  display: flex;
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  transition: background 0.15s;
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.lang-option .check-icon {
  width: 16px;
  height: 16px;
  color: var(--blue); /* theme cyan color */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s;
}

.lang-option.active .check-icon {
  opacity: 1;
  visibility: visible;
}

.github-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  flex-shrink: 0;
  text-decoration: none;
}

