* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { display: flex; flex-direction: column; background: #dce1ea; color: var(--brand-blue); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, a { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 3px; }
[hidden] { display: none !important; }
#stage { flex: 1; min-height: 0; display: grid; justify-items: center; overflow: hidden; }
iframe { display: block; width: 100%; max-width: 100%; height: 100%; min-height: 0; border: 0; background: white; }
#stage[data-size=tablet] iframe { width: 768px; }
#stage[data-size=mobile] iframe { width: 390px; }
#dock { flex: none; display: flex; align-items: center; justify-content: space-between; gap: clamp(14px, 2vw, 40px); padding: 6px clamp(13px, 3vw, 50px); background: #f9fafc; border-top: 1px solid var(--blue-line); box-shadow: 0 -2px 14px #30405d12; z-index: 2; }
.dock-title, .tools, .widths { display: flex; align-items: center; }
.dock-title { gap: 10px; white-space: nowrap; font-size: .95rem; }
.editions { width: clamp(315px, 36vw, 530px); }
.edition-labels { display: flex; justify-content: space-between; }
#dock button, #dock a { border: 0; background: transparent; text-decoration: none; font-size: .875rem; }
.edition-labels button { color: var(--blue-muted); padding: 0 0 2px; min-height: 28px; }
.edition-labels button[aria-pressed=true] { color: var(--brand-red); font-weight: 700; }
#slider { appearance: none; background: transparent; width: 100%; accent-color: var(--brand-red); display: block; height: 19px; padding: 0; margin: -2px 0 1px; cursor: ew-resize; }
#slider::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: var(--blue-line); }
#slider::-webkit-slider-thumb { appearance: none; width: 14px; height: 14px; margin-top: -5.5px; border: 0; border-radius: 50%; background: var(--brand-red); }
#slider::-moz-range-track { height: 3px; border-radius: 2px; background: var(--blue-line); }
#slider::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--brand-red); }
.tools { gap: clamp(8px, 1vw, 19px); white-space: nowrap; }
.tools button, .tools a { padding: 6px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }
.widths { background: var(--blue-pale); padding: 3px; border-radius: 5px; }
#dock .widths button { min-height: 29px; padding: 3px 9px; color: var(--blue-muted); }
#dock .widths button[aria-pressed=true] { background: white; color: var(--brand-blue); border-radius: 3px; box-shadow: 0 1px 4px #30405d20; }
#dock #hide { font-size: 1.15rem; width: 36px; }
#dock .tools > a:hover, #dock .tools > button:hover { text-decoration: underline; }
#restore { position: fixed; bottom: 12px; right: 14px; padding: 9px 18px; border-radius: 24px; border: 1px solid #a4adbe; background: white; color: var(--brand-blue); }
#notes { width: min(660px, 92vw); max-height: 84dvh; padding: clamp(20px, 3vw, 38px); border: 0; border-radius: 8px; color: var(--brand-blue); }
#notes::backdrop { background: #202c43d9; }
#notes header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
#notes h1 { margin: 0; font-size: 1.55rem; }
#notes p, #notes dd { line-height: 1.8; }
#close-notes { border: 1px solid var(--blue-line); border-radius: 50%; width: 42px; height: 42px; background: white; font-size: 1.35rem; }
#notes dt { border-top: 1px solid var(--blue-line); padding-top: 12px; font-weight: 700; }
#notes dd { margin: 6px 0 16px; }
#notes .integration-note { padding: 14px 17px; background: var(--blue-wash); border-inline-start: 3px solid #30405d; border-radius: 0 5px 5px 0; }
.integration-note strong { display: block; margin-bottom: 3px; }
.guide-link { font-size: .88rem; text-underline-offset: 3px; }
#notes a { color: var(--brand-blue); }
@media(max-width: 980px) {
  .dock-title { display: none; }
}
@media(max-width: 785px) {
  #dock { flex-direction: column; gap: 2px; padding: 4px 12px max(4px, env(safe-area-inset-bottom)); }
  .editions { width: min(100%, 420px); }
  .tools { width: min(100%, 430px); justify-content: space-between; gap: 1px; }
  .tools button, .tools a { padding-inline: 3px; }
  #dock .widths button { padding: 3px 6px; }
}

@media (max-width: 410px) { #dock .edition-labels button { font-size: .75rem; min-height: 29px; } }
