:root {
  color-scheme: dark;
  --bg: #0b101b;
  --header: #111827;
  --border: #30394a;
  --muted: #a1abc0;
  --text: #f1f5ff;
  --primary: #78c3fe;
  --panel: #151d2b;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden; }
body { background: var(--bg); color: var(--text); overscroll-behavior: none; }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible, input:focus-visible, .splitter:focus-visible { outline: 2px solid #71cfff; outline-offset: -2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.app { height: 100vh; height: 100dvh; width: 100%; display: flex; flex-direction: column; overflow: hidden; padding-top: var(--safe-top); padding-bottom: var(--safe-bottom); background: var(--bg); }
.masthead { height: 54px; min-height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; gap: 12px; background: var(--header); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mark { display: flex; width: 27px; height: 29px; flex-direction: column; gap: 3px; padding: 5px; border-radius: 8px; background: #283f59; box-shadow: inset 0 0 0 1px #3b6c8a; }
.brand-mark i { flex: 1; background: #86cdfa; border-radius: 2px; }
.brand-mark i:last-child { background: #86e2bd; }
.brand-title { display: flex; flex-direction: column; gap: 1px; }
.brand-title strong { font-size: 15px; font-weight: 760; letter-spacing: .02em; }
.brand-title span { font-size: 10px; color: var(--muted); }
.head-actions { display: flex; gap: 5px; align-items: center; }
.header-button { border: 1px solid #364357; background: #1c2737; color: #d5e2f8; padding: 7px 10px; border-radius: 9px; font-size: 12px; }
.help-button { width: 30px; height: 30px; padding: 0; font-size: 17px; font-weight: 750; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-rows: minmax(0, 50fr) 23px minmax(0, 50fr); overflow: hidden; }
.pane { display: flex; flex-direction: column; min-height: 0; background: #fcfdff; }
.address-bar { flex: 0 0 45px; height: 45px; display: flex; align-items: center; gap: 5px; padding: 5px 7px; background: var(--panel); border-bottom: 1px solid #3c4557; min-width: 0; }
.pane-tag { width: 27px; height: 29px; display: flex; align-items: center; justify-content: center; flex: 0 0 27px; border-radius: 7px; background: #25476b; color: #bfe7ff; font-size: 12px; font-weight: 750; }
.bottom-tag { background: #245347; color: #bef8dd; }
.address-bar input { width: 0; min-width: 0; flex: 1; height: 32px; border: 1px solid #3d495c; border-radius: 8px; background: #0e1724; color: #fff; padding: 0 8px; font-size: 16px; outline: none; }
.address-bar input::placeholder { color: #8491a7; }
.go-button, .small-button { height: 31px; flex-shrink: 0; border-radius: 7px; border: 1px solid #42536a; background: #263449; color: white; }
.go-button { font-size: 12px; font-weight: 720; background: #35638e; border-color: #447aaa; padding: 0 9px; }
.small-button { width: 29px; font-size: 22px; line-height: 1; padding: 0; }
.external-button { font-size: 22px; font-weight: 600; }
.web-area { flex: 1; min-height: 0; position: relative; overflow: hidden; background: #fff; }
.web-area iframe { display: block; width: 100%; height: 100%; border: 0; background: white; }
.splitter { min-height: 23px; height: 23px; display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #233043; border-top: 1px solid #46556b; border-bottom: 1px solid #46556b; padding: 0 9px; touch-action: none; cursor: row-resize; user-select: none; -webkit-user-select: none; }
.drag-zone { height: 100%; flex: 1; display: flex; align-items: center; justify-content: center; }
.grip { width: 46px; height: 5px; border-radius: 999px; background: #a2b5d0; box-shadow: 0 1px 0 #3b4758; }
.swap-button { background: #394f6c; border: 1px solid #657b98; border-radius: 5px; color: #f9fcff; font-size: 11px; padding: 2px 8px; height: 19px; white-space: nowrap; }
.swap-button span { font-size: 16px; line-height: .5; vertical-align: -.06em; }
.divider-percent { flex: 1; text-align: right; min-width: 55px; font-size: 10px; font-variant-numeric: tabular-nums; color: #d0d9e5; }
.app.is-resizing iframe { pointer-events: none; }
.toast { position: fixed; left: 50%; transform: translateX(-50%) translateY(10px); bottom: calc(23px + var(--safe-bottom)); width: max-content; max-width: calc(100vw - 26px); text-align: center; border: 1px solid #4b6782; background: rgba(17, 33, 52, .97); box-shadow: 0 5px 23px rgba(0,0,0,.27); padding: 10px 13px; border-radius: 11px; color: #e5f6ff; font-size: 12px; line-height: 1.55; pointer-events: none; opacity: 0; z-index: 20; transition: opacity .15s, transform .15s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.help-dialog { width: min(430px, calc(100vw - 24px)); max-height: min(80dvh, 720px); border: 1px solid #51617a; border-radius: 17px; color: #f0f6ff; background: #192439; padding: 0; box-shadow: 0 18px 50px rgba(0,0,0,.5); }
.help-dialog::backdrop { background: rgba(0,0,0,.68); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 17px 18px; border-bottom: 1px solid #36465d; }
.dialog-head h2 { font-size: 19px; margin: 0; }
.close-button { background: transparent; color: #eff6ff; border: 0; font-size: 19px; padding: 4px; }
.dialog-content { padding: 5px 18px 14px; max-height: calc(80dvh - 135px); overflow: auto; color: #d4dfef; line-height: 1.7; font-size: 14px; }
.dialog-content p { margin: 12px 0; }
.dialog-content strong { color: #fff; }
.dialog-done { margin: 0 18px 17px; width: calc(100% - 36px); height: 40px; border: 0; border-radius: 11px; font-size: 15px; font-weight: 750; background: #7ec9fa; color: #10283e; }
@media (max-width: 370px) { .masthead { height: 49px; min-height: 49px; } .address-bar { padding: 4px; gap: 4px; } .pane-tag { width: 22px; flex-basis: 22px; } .go-button { padding: 0 6px; } .small-button { width: 26px; } }
@media (max-height: 520px) { .masthead { height: 43px; min-height: 43px; } .address-bar { height: 36px; flex-basis: 36px; } .address-bar input { height: 28px; } .small-button, .go-button, .pane-tag { height: 27px; } }
