/* Keep the standalone draw page aligned with the Debater shell. */
/* The theme menu's moon and sun are decorative emoji; theme names carry the choice. */
nav.debater-global-nav[aria-label="主导航"] .theme-picker-container button > span.opacity-60 {
  display: none;
}

body.draw-page {
  --canvas: #0b0b0e;
  --canvas-glow: rgba(161, 43, 45, 0.1);
  --surface: #1a1b21;
  --surface-strong: #24242c;
  --surface-soft: #2b2a32;
  --text: #f5efe3;
  --muted: #b7aa99;
  --border: rgba(230, 208, 176, 0.18);
  --accent: #f0645a;
  --accent-strong: #c1272d;
}

html.light-mode body.draw-page {
  --canvas: #f7f1e4;
  --canvas-glow: rgba(193, 39, 45, 0.07);
  --surface: #fffaf1;
  --surface-strong: #f6eee0;
  --surface-soft: #efe4d3;
  --text: #25282f;
  --muted: #665f56;
  --border: rgba(91, 69, 45, 0.18);
  --accent: #b63239;
  --accent-strong: #c1272d;
}

.draw-page .site-header.draw-unified-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--canvas) 94%, transparent);
  backdrop-filter: blur(16px);
}

.draw-global-nav { position: relative; }
.draw-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 70px;
  padding-inline: 24px;
}
.draw-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 44px;
  color: var(--text);
}
.draw-brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 5px;
  background: linear-gradient(135deg, #d84a49, #9e252d);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}
.draw-brand-name {
  display: block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
}
.draw-brand-name > span { color: #f0645a; }
.draw-brand-name > small {
  display: block;
  width: fit-content;
  margin-top: 4px;
  padding: 3px 6px;
  border: 1px solid rgba(228, 188, 109, 0.25);
  border-radius: 3px;
  background: rgba(228, 188, 109, 0.12);
  color: #e4bc6d;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0;
}
html.light-mode .draw-brand-name > small { color: #85611e; }
.draw-desktop-nav { display: flex; align-items: center; justify-content: center; gap: 16px; min-width: 0; }
.draw-nav-link, .draw-nav-control, .draw-return {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 44px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.draw-nav-link { position: relative; padding-inline: 7.2px; }
.draw-nav-link:hover, .draw-menu-link:hover, .draw-mobile-link:hover { color: #f0645a; }
.draw-nav-link.active, .draw-menu-link.active, .draw-mobile-link.active { color: #f0645a; }
.draw-nav-link.active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: #f0645a;
  content: '';
}
.draw-tools-menu { position: relative; }
.draw-nav-control {
  gap: 5px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}
.draw-page .draw-nav-control { font-size: 14px; font-weight: 600; }
.draw-nav-control:hover { border-color: #c1272d; background: rgba(193, 39, 45, 0.16); }
.draw-page .draw-theme-button { font-size: 0; }
.draw-theme-button::before { content: '主题'; font-size: 13px; }
.draw-theme-button::after { content: '⌄'; font-size: 14px; }
.draw-tools-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: 190px;
  padding: 8px 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #30271e;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}
html.light-mode .draw-tools-list { background: #fffaf1; }
.draw-menu-link { display: flex; align-items: center; min-height: 44px; padding: 8px 16px; color: var(--text); font-size: 14px; }
.draw-menu-link:hover, .draw-mobile-link:hover { background: rgba(193, 39, 45, 0.1); }
.draw-return {
  min-width: 94px;
  padding-inline: 14px;
  border: 1px solid rgba(193, 39, 45, 0.35);
  border-radius: 999px;
  color: #ed7773;
}
html:not(.light-mode) .draw-page .draw-return { color: #ed7773; }
html.light-mode .draw-return { color: #af292f; }
.draw-return:hover { background: rgba(193, 39, 45, 0.14); }
.draw-mobile-toggle, .draw-mobile-menu { display: none; }
.draw-page .draw-global-nav :focus-visible { outline: 2px solid #c1272d; outline-offset: 3px; }

@media (max-width: 1279px) {
  .draw-desktop-nav, .draw-return { display: none; }
  .draw-mobile-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
  }
  .draw-mobile-menu:not([hidden]) {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: calc(100dvh - 70px);
    overflow-y: auto;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--canvas);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.18);
  }
  .draw-mobile-link { display: flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 8px; color: var(--text); font-size: 14px; }
  .draw-mobile-menu .global-mobile-theme { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; padding: 8px 0; }
  .draw-mobile-menu .global-mobile-theme button { min-height: 44px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--muted); font-weight: 700; }
  .draw-mobile-menu .global-mobile-theme button[aria-checked="true"] { border-color: #c1272d; background: rgba(193, 39, 45, 0.14); color: var(--text); }
}

@media (max-width: 390px) {
  .draw-nav-inner { padding-inline: 14px; }
  .draw-brand-name { font-size: 15px; max-width: 154px; }
  .draw-brand-name > small { font-size: 8px; }
}
