/* Extend the confirmed menu without replacing its layout or blur. */
/* Keep the return control outside the subpages' scrolling region. */
.menu-overlay { --menu-return-row: 52px; }
.menu-overlay.subpage-open .back-button {
  position: absolute;
  z-index: 2;
  top: calc(var(--site-header-size) - 36px);
  left: var(--site-inset-left);
  width: 48px;
  height: 48px;
  margin: 0;
  touch-action: manipulation;
}
.menu-overlay .back-button::before { top: calc(50% - 5px); }
.menu-overlay .back-button::after { top: calc(50% + 5px); }
.menu-overlay .back-button:active { opacity: .65; }
.menu-overlay .subpage { top: var(--menu-return-row); padding-top: clamp(12px, 2vh, 24px); }
.menu-notice-button { display: grid; place-items: center; width: 31px; height: 44px; flex: none; padding: 0; background: none; color: var(--text); cursor: pointer; transition: opacity 180ms ease; }
.menu-notice-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.menu-notice-button:hover { opacity: .65; }
.menu-actions { position: relative; }
.menu-announcement {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 4;
  width: max-content;
  max-width: min(380px, calc(100vw - 44px));
  padding: 18px 20px;
  border: 1px solid var(--theme-border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 180ms ease, transform 200ms ease, visibility 0s 200ms;
  pointer-events: none;
}
.menu-announcement::before {
  content: "";
  position: absolute;
  top: -7px;
  left: var(--notice-tail-x, 80%);
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--surface);
  border-left: 1px solid var(--theme-border);
  border-top: 1px solid var(--theme-border);
  border-top-left-radius: 2px;
}
.menu-announcement.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; pointer-events: auto; }
.menu-announcement p { margin: 0; overflow-wrap: anywhere; }
.menu-announcement-en { display: none; }
html[lang="en"] .menu-announcement-zh { display: none; }
html[lang="en"] .menu-announcement-en { display: inline; }
.menu-announcement-orbit { display: inline-block; height: 1.1em; width: auto; margin: 0 .06em; vertical-align: -.16em; object-fit: contain; }
:root[data-theme="light"] .menu-announcement-orbit { filter: invert(1); }
.menu-action-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.menu-legal-links { display: flex; align-items: center; gap: 22px; pointer-events: auto; }
.menu-build [data-private-preview-entry][href] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  pointer-events: auto;
  text-decoration: none;
}
.subpage-open .menu-build [data-private-preview-entry][href] { visibility: hidden; }
.menu-legal-links button { min-height: 44px; padding: 8px 0; border: 0; background: transparent; color: var(--secondary); font-size: 11px; letter-spacing: normal; cursor: pointer; transition: color 180ms ease; }
.menu-legal-links button:hover { color: var(--text); }
/* Padding alone let scrolled paragraphs pass behind the stationary legal
   links. End the reading viewport before the footer instead. */
.menu-reading.subpage { bottom: calc(var(--site-footer-size) + 12px); padding-right: 16px; padding-bottom: 24px; overscroll-behavior-y: contain; }
.menu-reading .subpage-title { line-height: 1.12; margin-bottom: 30px; }
.home-preferences .home-theme-settings { max-width: 650px; }
.home-preferences .home-theme-settings + .home-theme-settings { margin-top: 26px; }
.home-preferences .home-theme-settings legend { color: var(--text); font-size: 16px; }
.home-preferences-reset {
  min-height: 44px;
  margin-top: 28px;
  padding: 0 12px;
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.menu-reading-intro, .menu-reading-section { max-width: 920px; }
.menu-reading-intro { margin-bottom: 38px; color: var(--secondary); font-size: 15px; line-height: 1.9; }
.menu-reading-section { margin-bottom: 38px; }
.menu-reading-section h2 { margin: 0 0 16px; color: var(--text); font-size: 21px; line-height: 1.5; font-weight: 500; }
.menu-reading-section p { margin: 0 0 14px; color: var(--theme-copy); font-size: 15px; line-height: 1.95; overflow-wrap: anywhere; }
.menu-reading-section a { display: block; width: fit-content; padding: 6px 0; color: var(--text); font-size: 13px; line-height: 1.8; text-decoration: underline; text-underline-offset: 4px; overflow-wrap: anywhere; }
.menu-notice-button:focus-visible, .menu-legal-links button:focus-visible { outline: 2px solid var(--secondary); outline-offset: 4px; }
@media (max-width: 650px), (hover: none) and (pointer: coarse) {
  .menu-overlay {
    --menu-edge-height: 34px;
    background-image:
      linear-gradient(to bottom, var(--home-menu-edge-top, var(--bg)), transparent),
      linear-gradient(to top, var(--home-menu-edge-bottom, var(--bg)), transparent);
    background-position: center top, center bottom;
    background-repeat: no-repeat;
    background-size: 100% max(var(--menu-edge-height), env(safe-area-inset-top, 0px)),
      100% max(var(--menu-edge-height), env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 650px) {
  .menu-legal-links { gap: 16px; }
  .menu-legal-links button { font-size: 10px; }
  .menu-reading-intro, .menu-reading-section p { font-size: 14px; }
  .menu-reading-section h2 { font-size: 18px; }
}
@media (max-width: 650px) {
  .menu-announcement { width: max-content; max-width: min(320px, calc(100vw - 44px)); padding: 14px 16px; font-size: 13px; border-radius: 12px; }
  .menu-announcement-orbit { height: 1em; }
}
@media (prefers-reduced-motion: reduce) {
  .menu-notice-button, .menu-legal-links button { transition: none; }
  .menu-announcement { transition: none; }
}

.home-preferences-about{display:grid;gap:10px;margin:0 0 28px;max-width:64ch}
.home-preferences-about h3{margin:0;font-size:18px;font-weight:600;letter-spacing:-.01em}
.home-preferences-about p{margin:0;color:#b9b9c2;font-size:14px;line-height:1.85}
.menu-withdraw{margin-top:28px;display:grid;gap:8px;max-width:52ch}
.menu-withdraw-button{justify-self:start;padding:8px 12px;border:1px solid #34343c;border-radius:10px;background:#141418;color:#d7d7de;font:inherit;font-size:14px;cursor:pointer}
.menu-withdraw-button:hover{color:#fff;border-color:#55555f}
.menu-withdraw-note{margin:0;font-size:12px;line-height:1.6;color:#ff9a9a}


.main-menu .menu-withdraw-item{position:relative}
.main-menu .menu-withdraw-note{order:2;margin:0 18px 0 14px;max-width:52%;font-size:13px;line-height:1.5;color:#ff9a9a;text-align:left}
.main-menu .menu-withdraw-note[hidden]{display:none}
.main-menu .menu-withdraw-item .menu-index{order:3;margin-left:auto}
@media(max-width:650px){
  .main-menu .menu-withdraw-note{position:absolute;left:0;right:0;top:calc(100% + 4px);margin:0;max-width:none;text-align:left;font-size:12px;padding:2px 0 6px;background:#0d0d0f}
  .main-menu .menu-withdraw-item .menu-index{order:2;margin-left:auto}
}
body.menu-open .menu-item:nth-child(5){transition-delay:.22s}


.manual-list{display:grid;gap:24px;max-width:74ch}
.manual-item{display:grid;grid-template-columns:44px minmax(0,1fr);gap:18px;align-items:start}
.manual-item svg{width:40px;height:40px;margin-top:2px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;color:#9a9aa6}
.manual-item p{margin:0;font-size:17px;line-height:1.95;color:#c9c9d2}
@media(max-width:650px){.manual-item{grid-template-columns:32px minmax(0,1fr);gap:12px}.manual-item svg{width:28px;height:28px}.manual-item p{font-size:16px;line-height:1.85}}

@media(max-width:650px){.main-menu .menu-item{font-size:clamp(22px,7vw,28px);padding:13px 0}.main-menu .menu-item .menu-index{font-size:12px}}
.main-menu .menu-item{align-items:center;padding-block:0;min-height:clamp(58px,9vh,100px)}
.main-menu .menu-item>span:first-child{line-height:1.2}
.main-menu .menu-index{align-self:center}
@media(max-width:650px){.main-menu .menu-item{min-height:52px}}
.main-menu .menu-item{color:#fff}
.main-menu .menu-item .menu-index{color:rgba(255,255,255,.55)}
[data-subpage="about"] .home-preferences-about,[data-subpage="manual"] .manual-list{color:#fff}
[data-subpage="about"] .home-preferences-about p,[data-subpage="manual"] .manual-item p{color:#fff}

[data-subpage="about"] .home-preferences-about p.about-disclaimer{color:#ffb454;border-left:2px solid #ffb454;padding-left:12px;font-weight:500}
.main-menu .menu-item{color:var(--text)}
.main-menu .menu-item .menu-index{color:color-mix(in srgb,var(--text) 55%,transparent)}
[data-subpage="about"] .home-preferences-about p,[data-subpage="manual"] .manual-item p{color:var(--text)}
[data-subpage="about"] .about-disclaimer{color:#ffb454}
:root[data-theme="light"] [data-subpage="about"] .about-disclaimer{color:#c62828;border-left-color:#c62828}
.withdraw-dialog{width:100%;max-width:min(420px,86vw);padding:0;border:1px solid var(--theme-border);border-radius:16px;background:var(--bg);color:var(--text)}
.withdraw-dialog::backdrop{background:rgba(0,0,0,.58)}
.withdraw-dialog-body{display:grid;gap:20px;padding:22px 22px 18px}
.withdraw-dialog h2{margin:0;font-size:17px;line-height:1.65;font-weight:600;letter-spacing:-.01em}
.withdraw-dialog-actions{display:flex;justify-content:flex-end;gap:10px}
.withdraw-dialog-actions button{min-width:72px;padding:8px 18px;border:1px solid var(--theme-border);border-radius:9px;background:transparent;color:var(--text);font:inherit;font-size:13px;cursor:pointer}
.withdraw-dialog-actions button:hover{background:var(--theme-hover)}
.withdraw-dialog-actions [data-withdraw-confirm]{border-color:var(--text);background:var(--text);color:var(--bg)}
.withdraw-dialog,.withdraw-dialog::backdrop{animation:none!important;transition:none!important}
.withdraw-dialog{position:fixed;inset:0;margin:auto;max-height:calc(100vh - 40px)}
.manual-modules{display:grid;max-width:74ch;border-top:1px solid var(--theme-border)}
.manual-module{border-bottom:1px solid var(--theme-border)}
.manual-module summary{display:grid;grid-template-columns:24px minmax(0,1fr) 18px;align-items:center;gap:14px;padding:18px 0;cursor:pointer;font-size:18px;font-weight:500;list-style:none;color:var(--text)}
.manual-module summary svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.manual-module summary::-webkit-details-marker{display:none}
.manual-module summary::after{content:'+';font-size:22px;font-weight:300;line-height:1}
.manual-module[open] summary::after{content:'−'}
.manual-module p{margin:0 0 22px 38px;font-size:16px;line-height:1.9;color:color-mix(in srgb, var(--text) 82%, transparent)}
@media (min-width: 900px) {
  .manual-modules { max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 56px; }
}

.manual-module p { position: relative; padding-left: 28px; }
.manual-module p::before { content: ''; position: absolute; left: 0; top: .62em; width: 14px; height: 14px; border: 1.5px solid currentColor; border-radius: 4px; opacity: .55; }
.manual-module p + p { margin-top: 14px; }
.manual-module p { font-variant-emoji: text; }
.manual-module p::before { width: 15px; height: 15px; border-width: 1.4px; border-radius: 3px; }
.manual-modules { align-items: start; }
.manual-module p::before { display: none; }
.manual-module p { padding-left: 0; }
.manual-inline { width: 1em; height: 1em; display: inline-block; vertical-align: -.14em; margin: 0 .12em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.manual-mobile-only { display: none; }
@media (max-width: 767px), (pointer: coarse) and (max-height: 480px) and (orientation: landscape) {
  .manual-mobile-only { display: block; }
  .manual-module p.manual-desktop-only { display: none; }
}
