:root{--bg:#f6f7f9;--surface:#ffffff;--text:#0b1220;--muted:#6b7280;--hairline:rgba(12,18,32,.08);--primary:#0a84ff;--success:#1db954;--danger:#ff453a;--warning:#ff9f0a;--glass:rgba(255,255,255,.55);--glass-blur:12px;--radius:16px;--radius-lg:20px;--shadow-1:0 1px 2px rgba(12,18,32,.06);--shadow-2:0 10px 30px rgba(12,18,32,.06)}[data-theme=dark]{--bg:#0b0f14;--surface:#0f141a;--text:#e7ebf0;--muted:#9aa4b2;--hairline:rgba(231,235,240,.12);--primary:#0a84ff;--glass:rgba(20,24,30,.5);--shadow-1:0 1px 2px rgba(0,0,0,.35);--shadow-2:0 20px 40px rgba(0,0,0,.35)}*{box-sizing:border-box}body{margin:0;height:100vh;height:100dvh;width:100vw;overflow:hidden;font-family:ui-sans-serif,-apple-system,SF Pro Text,Segoe UI,Noto Sans TC,PingFang TC,Microsoft JhengHei,system-ui,Helvetica,Arial,sans-serif;background:var(--bg);color:var(--text)}.container{max-width:920px;height:100dvh;margin:0 auto;padding:6px 16px;padding-bottom:env(safe-area-inset-bottom,16px);display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box}.topbar{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:48px;padding:4px 8px;margin-bottom:6px;border:1px solid var(--hairline);border-radius:12px;background:var(--glass);-webkit-backdrop-filter:saturate(150%) blur(var(--glass-blur));backdrop-filter:saturate(150%) blur(var(--glass-blur));box-shadow:var(--shadow-1)}.icon-btn{background:transparent;border:none;font-size:1.4rem;padding:8px;cursor:pointer;color:var(--primary);border-radius:8px;display:flex;align-items:center;justify-content:center;transition:background .2s}.icon-btn:active{background:var(--hairline);opacity:.7}.status-container{flex:1;display:flex;justify-content:center;cursor:pointer}.status{font-weight:500;display:inline-flex;gap:6px;align-items:center;padding:4px 8px;border-radius:8px;border:1px solid var(--hairline);color:var(--muted);background:transparent;font-size:clamp(.5rem,5vh,1.5rem);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.status.ok:before,.status.err:before,.status.load:before{content:"";width:6px;height:6px;border-radius:50%;display:inline-block}.status.ok:before{background:var(--success)}.status.err:before{background:var(--danger)}.status.load:before{background:var(--warning)}.dropdown-menu{position:absolute;top:60px;right:12px;width:200px;background:var(--surface);border:1px solid var(--hairline);border-radius:12px;box-shadow:var(--shadow-2);display:none;flex-direction:column;z-index:100;padding:6px;transform-origin:top right;animation:scaleIn .2s ease-out}.dropdown-menu.show{display:flex}@keyframes scaleIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.dropdown-item{background:transparent;border:none;color:var(--text);padding:12px 16px;text-align:left;font-size:1rem;border-radius:8px;cursor:pointer;display:flex;align-items:center;gap:8px}.dropdown-item:active{background:var(--bg)}.divider{height:1px;background:var(--hairline);margin:4px 8px}.meta{opacity:.9;font-size:.8rem;color:var(--muted)}:root{--card-padding-vertical: clamp(4px, 1vh, 12px);--card-padding-horizontal: 16px;--cards-gap: clamp(4px, .6vh, 8px);--cards-margin: 4px 0;--flag-width: clamp(42px, 2vh + 24px, 50px);--flag-height: calc(var(--flag-width) * .7);--flag-border-radius: 4px;--currency-code-size: clamp(1.1rem, 1.05rem + .4vh, 1.3rem);--currency-value-size: clamp(2rem, 1.8rem + 1vh, 2.6rem);--currency-symbol-size: calc(var(--currency-value-size) * .6);--currency-line-height: 1.1;--left-content-gap: 8px;--handle-margin-right: 2px;--handle-color: #8e8e93;--handle-font-size: clamp(1.4rem, 2vh + .5rem, 1.6rem)}.cards{flex:1 1 auto;display:flex;flex-direction:column;overflow-y:hidden;min-height:0;gap:var(--cards-gap);margin:var(--cards-margin)}.card{flex:1;min-height:0;display:flex;align-items:center;justify-content:space-between;background:var(--surface);border:1px solid var(--hairline);border-radius:14px;padding:var(--card-padding-vertical) var(--card-padding-horizontal);position:relative;box-shadow:var(--shadow-1);height:auto}.card.skeleton{min-height:44px}.card .left{display:flex;align-items:center;gap:var(--left-content-gap);margin:0;padding:0}.flag{width:var(--flag-width);height:var(--flag-height);border-radius:var(--flag-border-radius);object-fit:cover}.flag-sm{width:20px;height:14px;border-radius:3px;object-fit:cover;border:1px solid var(--hairline)}.cards .flag{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none;-webkit-tap-highlight-color:rgba(0,0,0,0);touch-action:manipulation}.handle{cursor:grab;color:var(--handle-color);margin-right:var(--handle-margin-right);font-size:var(--handle-font-size);line-height:var(--currency-line-height)}.base{outline:2px solid var(--primary);outline-offset:-2px;background:#0a84ff0f}.code{opacity:.85;font-size:var(--currency-code-size);font-weight:500;line-height:var(--currency-line-height)}.value{font-weight:700;font-size:var(--currency-value-size);line-height:var(--currency-line-height)}.symbol{opacity:.9;margin-right:4px;font-size:var(--currency-symbol-size)}.value{font-variant-numeric:tabular-nums;white-space:nowrap;text-align:right;margin:0;padding:0}.reference-mode{opacity:.6!important;font-weight:400!important;color:var(--muted)!important}.keypad{flex:0 0 auto;position:relative;z-index:5;background:var(--surface);border-top:1px solid var(--hairline);border-radius:12px 12px 0 0;margin-top:clamp(4px,1vh,18px);box-shadow:var(--shadow-1)}.display{padding:clamp(2px,1.5vh,6px) 14px;font-size:clamp(1.4rem,3vh + .2rem,1.8rem);font-weight:700;border-bottom:1px solid var(--hairline);text-align:right}.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:clamp(4px,.8vh,8px);padding:clamp(6px,1vh,10px)}.keypad,.keypad button{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.grid button{padding:clamp(8px,1.5vh,14px) 0;border-radius:12px;border:1px solid var(--hairline);background:var(--surface);color:var(--text);font-size:clamp(1.25rem,2.5vh + .4rem,1.6rem);font-weight:700;box-shadow:var(--shadow-1);line-height:1;display:flex;align-items:center;justify-content:center}.grid button.op{background:transparent}.grid button.primary{background:var(--primary);border-color:var(--primary);color:#fff}.grid button.muted{opacity:.8}.grid button.zero,.grid button.wide{grid-column:span 2}@media(min-width:800px){.display{font-size:2rem;padding:12px 20px}.grid{gap:12px;padding:16px}.grid button{padding:16px 0;font-size:2.2rem}}@media(min-width:800px){.display{font-size:1.85rem;padding:2px 16px}.grid{gap:12px;padding:14px}.grid button{padding:18px 14px;font-size:2.2rem}.cards{gap:var(--cards-gap)}.card{padding:20px;min-height:62px}.flag{width:60px;height:42px}.code{font-size:1.15rem}.value{font-size:3rem}.symbol{font-size:1.2rem}}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.grid button{font-weight:600}}@media(min-height:840px)and (max-height:850px){:root{--card-padding-vertical: 5px;--cards-gap: 4px}}.skeleton{position:relative;overflow:hidden}.skeleton:before{content:"";position:absolute;inset:0;transform:translate(-100%);background:linear-gradient(90deg,transparent,rgba(0,0,0,.06),transparent);animation:sk 1.1s linear infinite}@keyframes sk{to{transform:translate(100%)}}@media(max-width:640px){.container{padding:0 12px}.topbar{margin-bottom:4px;padding:4px 8px;gap:6px}.status{padding:3px 6px;font-size:.8rem;gap:4px}.meta{font-size:.75rem}.status.ok:before,.status.err:before,.status.load:before{width:5px;height:5px}.cards{gap:var(--cards-gap);margin:var(--cards-margin)}.keypad{margin-top:6px}}#rotateOverlay{position:fixed;top:0;left:0;width:100%;height:100%;background:#000000e6;display:none;align-items:center;justify-content:center;z-index:10000;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.rotate-content{text-align:center;color:#fff;padding:20px}.rotate-icon{font-size:6rem;margin-bottom:24px;animation:rotateAnimation 2s ease-in-out infinite}.rotate-text{font-size:2rem;font-weight:600;line-height:1.4;max-width:620px}@keyframes rotateAnimation{0%,to{transform:rotate(0)}25%{transform:rotate(-15deg)}75%{transform:rotate(15deg)}}.modal{position:fixed;inset:0;background:#00000073;display:none;align-items:flex-end;z-index:1000}.modal.show{display:flex}.modal-content{background:var(--surface);border-top-left-radius:16px;border-top-right-radius:16px;border:1px solid var(--hairline);width:100%;max-width:720px;margin:0 auto;max-height:85vh;display:flex;flex-direction:column;box-shadow:var(--shadow-2)}.modal-header{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid var(--hairline)}.modal-close{background:transparent;border:0;color:var(--text);font-size:20px;cursor:pointer}.tabs{display:flex;gap:8px;padding:8px 10px;border-bottom:1px solid #2a3040;overflow:auto}.tab-btn{background:var(--surface);border:1px solid var(--hairline);color:var(--text);border-radius:10px;padding:8px 10px;white-space:nowrap}.tab-btn.active{background:var(--primary);border-color:var(--primary);color:#fff}#helpModal .tab-panels{padding:12px 14px}#helpModal .field{margin:12px 0}#helpModal .field label{display:block;font-weight:700;letter-spacing:.2px;margin-bottom:6px;color:var(--text)}#helpModal .field .hint{line-height:1.6;color:var(--muted)}#helpModal .actions{display:flex;gap:8px;flex-wrap:wrap}.tab-panels{padding:12px 14px;overflow:auto}.tab-panel{display:none}.tab-panel.active{display:block}.field{display:flex;flex-direction:column;gap:6px;margin-bottom:12px}.field .hint{opacity:.8;font-size:.9rem}.actions{display:flex;gap:8px}.danger{background:var(--danger);color:#fff;border:0;border-radius:10px;padding:8px 12px}.modal-footer{display:flex;justify-content:flex-end;padding:10px;border-top:1px solid var(--hairline)}.modal-footer .primary{background:var(--primary);color:#fff;border:0;border-radius:10px;padding:8px 12px}.disclaimer{flex:0 0 auto;font-size:.8rem;color:#868585;text-align:center;margin-top:6px;padding:4px 0;border-top:1px solid #eee}*:focus-visible{outline:2px solid var(--primary);outline-offset:2px;border-radius:10px}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}.error-dialog-overlay{position:fixed;inset:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:10000;padding:20px}.error-dialog{background:var(--surface);border-radius:16px;max-width:500px;width:100%;max-height:80vh;overflow:hidden;box-shadow:var(--shadow-2);border:1px solid var(--hairline)}.error-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--hairline);background:var(--bg)}.error-header h3{margin:0;color:var(--text);font-size:1.1rem}.error-close{background:none;border:none;font-size:1.5rem;color:var(--muted);cursor:pointer;padding:4px;border-radius:4px}.error-close:hover{background:var(--hairline)}.error-content{padding:20px;overflow-y:auto;max-height:50vh}.error-content p{margin:8px 0;color:var(--text);font-size:.9rem;line-height:1.4}.error-content strong{color:var(--text);font-weight:600}.error-details{margin:16px 0}.error-details summary{cursor:pointer;color:var(--primary);font-weight:500;padding:8px 0}.error-details summary:hover{text-decoration:underline}.error-tech{background:var(--bg);padding:12px;border-radius:8px;margin-top:8px;border:1px solid var(--hairline)}.error-tech p{margin:6px 0;font-size:.8rem;font-family:monospace;color:var(--muted)}.error-actions{display:flex;gap:8px;padding:16px 20px;border-top:1px solid var(--hairline);background:var(--bg)}.error-actions button{flex:1;padding:10px 12px;border-radius:8px;border:1px solid var(--hairline);background:var(--surface);color:var(--text);cursor:pointer;font-size:.9rem;font-weight:500}.error-actions button:hover{background:var(--bg);transform:translateY(-1px)}.btn-copy{background:var(--primary)!important;color:#fff!important;border-color:var(--primary)!important}.btn-share{background:var(--success)!important;color:#fff!important;border-color:var(--success)!important}.btn-retry{background:var(--warning)!important;color:#fff!important;border-color:var(--warning)!important}@media(max-width:640px){.error-dialog{margin:10px;max-width:none}.error-actions{flex-direction:column}.error-actions button{margin:4px 0}}.test-btn{background:var(--warning);color:#fff;border:1px solid var(--warning);padding:6px 12px;border-radius:6px;font-size:.8rem;cursor:pointer;margin:2px}.test-btn:hover{background:var(--danger);border-color:var(--danger);transform:translateY(-1px)}.link-btn{background:none;border:none;color:var(--primary);text-decoration:underline;cursor:pointer;font-size:.9rem;padding:0}.link-btn:hover{color:var(--text);text-decoration:none}.version-history-overlay{position:fixed;inset:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:10001;padding:20px}.version-history-modal{background:var(--surface);border-radius:16px;max-width:800px;width:100%;max-height:90vh;overflow:hidden;box-shadow:var(--shadow-2);border:1px solid var(--hairline)}.version-history-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--hairline);background:var(--bg)}.version-history-header h3{margin:0;color:var(--text);font-size:1.2rem}.version-history-close{background:none;border:none;font-size:1.5rem;color:var(--muted);cursor:pointer;padding:4px;border-radius:4px}.version-history-close:hover{background:var(--hairline)}.version-history-content{padding:0;overflow-y:auto;max-height:80vh}.version-history-content iframe{width:100%;height:80vh;border:none;background:var(--bg)}@media(max-width:640px){.version-history-modal{margin:10px;max-width:none;max-height:90vh}.version-history-content iframe{height:70vh}}.grid button.active{transform:translateY(1px);box-shadow:none;background:var(--hairline);transition:all .05s}@media(max-height:700px){.container{padding-top:4px;padding-bottom:4px}.topbar{margin-bottom:2px;padding:2px 8px}.keypad button{padding:8px 0;font-size:1.2rem}.display{padding:2px 12px;font-size:1.2rem}.card{min-height:40px}.disclaimer{display:none}}@media(max-height:580px){.topbar .status{font-size:.75rem}}@media(max-height:600px){.disclaimer{display:none}.grid button{padding:8px 0}}
