/* 箱子 Frontend v3.8.5
 * iOS 18-inspired clean system style.
 * Stability-first for iOS/iPadOS Safari:
 * avoids costly layered visual effects, dynamic viewport units, and heavy motion.
 */
:root{
  --mtb-font:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display","Helvetica Neue",Arial,sans-serif;
  --mtb-bg:#f2f2f7;
  --mtb-card:#ffffff;
  --mtb-card-2:#f7f7fa;
  --mtb-card-3:#ededf2;
  --mtb-text:#111114;
  --mtb-muted:#6e6e73;
  --mtb-muted-2:#8e8e93;
  --mtb-line:#d9d9df;
  --mtb-line-soft:#ececf1;
  --mtb-blue:#007aff;
  --mtb-blue-pressed:#006bd6;
  --mtb-green:#34c759;
  --mtb-red:#d70015;
  --mtb-orange:#b25000;
  --mtb-radius-sm:12px;
  --mtb-radius:16px;
  --mtb-radius-lg:22px;
  --mtb-shadow:0 10px 24px rgba(0,0,0,.14);
}
*{box-sizing:border-box}
.mtb-launcher,.mtb-modal,.mtb-redeem-center,.mtb-protected-wrapper,.mtb-toast,.mtb-confirm-box{font-family:var(--mtb-font);color:var(--mtb-text)}
body.mtb-modal-open{overflow:hidden}
.mtb-launcher{margin:18px 0}

/* Buttons */
.mtb-start-button,.mtb-btn-primary,.mtb-next,.mtb-redeem-form button,.mtb-protected-auth-form button,.mtb-flow-install,.mtb-copy-btn{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 18px;border:0;border-radius:999px;background:var(--mtb-blue);color:#fff;font-size:16px;font-weight:700;line-height:1.2;text-align:center;text-decoration:none!important;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:background-color .12s ease,opacity .12s ease}
.mtb-start-button{width:100%;padding:12px 20px}
.mtb-btn-primary,.mtb-next,.mtb-redeem-form button,.mtb-protected-auth-form button{min-width:104px}
.mtb-flow-install{min-height:36px;padding:0 14px;font-size:14px;white-space:nowrap}
.mtb-start-button:active,.mtb-btn-primary:active,.mtb-next:active,.mtb-redeem-form button:active,.mtb-protected-auth-form button:active,.mtb-flow-install:active,.mtb-copy-btn:active{background:var(--mtb-blue-pressed);opacity:.86}
.mtb-prev,.mtb-btn-secondary{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 18px;border:0;border-radius:999px;background:#e5e5ea;color:var(--mtb-text);font-size:16px;font-weight:700;line-height:1.2;text-align:center;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:background-color .12s ease,opacity .12s ease}
.mtb-prev:active,.mtb-btn-secondary:active{background:#d8d8de}
button:disabled,.mtb-prev:disabled,.mtb-next:disabled,.mtb-btn-primary:disabled,.mtb-btn-secondary:disabled,button.is-processing{opacity:.48;cursor:not-allowed}

/* Flow modal */
.mtb-modal-overlay{position:fixed;top:var(--mtb-visual-top,0);left:var(--mtb-visual-left,0);right:auto;bottom:auto;width:var(--mtb-visual-width,100vw);height:var(--mtb-visual-height,100vh);z-index:9998;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(0,0,0,.42);overflow:hidden}
.mtb-modal{position:relative;width:min(960px,100%);max-height:min(calc(var(--mtb-visual-height,100vh) - 32px),860px);display:flex;flex-direction:column;overflow:hidden;background:var(--mtb-card);border:1px solid var(--mtb-line);border-radius:var(--mtb-radius-lg);box-shadow:var(--mtb-shadow)}
.mtb-modal-header{flex:0 0 auto;display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:18px 18px 14px;background:var(--mtb-card);border-bottom:1px solid var(--mtb-line-soft)}
.mtb-modal-title{margin:0 0 5px;font-size:22px;font-weight:800;line-height:1.18;letter-spacing:-.02em;color:var(--mtb-text)}
.mtb-modal-meta{font-size:13px;font-weight:600;line-height:1.4;color:var(--mtb-muted)}
.mtb-progress{flex:0 0 auto;height:4px;background:#e5e5ea}
.mtb-progress-bar{display:block;height:100%;width:0;background:var(--mtb-blue)}
.mtb-modal-body{flex:1 1 auto;min-height:0;display:grid;grid-template-columns:280px minmax(0,1fr);background:var(--mtb-card)}
.mtb-sidebar{display:none;min-height:0;overflow:auto;padding:14px;background:var(--mtb-bg);border-right:1px solid var(--mtb-line-soft);-webkit-overflow-scrolling:touch}
.mtb-modal.has-sidebar .mtb-sidebar{display:block}
.mtb-side-item{appearance:none;-webkit-appearance:none;display:flex;align-items:flex-start;gap:12px;width:100%;margin:0 0 10px;padding:12px;border:1px solid var(--mtb-line-soft);border-radius:var(--mtb-radius);background:var(--mtb-card);color:var(--mtb-text);text-align:left;cursor:pointer}
.mtb-side-item span{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:28px;height:28px;border-radius:999px;background:#e8f1ff;color:var(--mtb-blue);font-size:14px;font-weight:800}
.mtb-side-item strong{font-size:14px;font-weight:700;line-height:1.45}
.mtb-side-item.active{background:var(--mtb-blue);border-color:var(--mtb-blue);color:#fff}
.mtb-side-item.active span{background:rgba(255,255,255,.24);color:#fff}
.mtb-step-panel{position:relative;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:var(--mtb-card)}
.mtb-step-content{position:relative;flex:1 1 auto;min-height:0;overflow:auto;padding:22px;background:var(--mtb-card);-webkit-overflow-scrolling:touch;touch-action:pan-y;overscroll-behavior:contain}
.mtb-step-title{margin:0 0 14px;font-size:23px;font-weight:800;line-height:1.22;letter-spacing:-.02em;color:var(--mtb-text)}
.mtb-step-body{font-size:16px;line-height:1.72;color:var(--mtb-text)}
.mtb-step-body>*:first-child{margin-top:0}
.mtb-step-body p{margin:0 0 14px;line-height:1.72}
.mtb-step-body h1,.mtb-step-body h2,.mtb-step-body h3,.mtb-step-body h4,.mtb-step-body h5,.mtb-step-body h6{margin:20px 0 10px;color:var(--mtb-text);font-weight:800;line-height:1.28;letter-spacing:-.015em}
.mtb-step-body h1{font-size:26px}.mtb-step-body h2{font-size:23px}.mtb-step-body h3{font-size:20px}.mtb-step-body h4{font-size:18px}.mtb-step-body h5{font-size:17px}.mtb-step-body h6{font-size:16px}
.mtb-step-body ul,.mtb-step-body ol{margin:0 0 16px;padding-left:1.35em}
.mtb-step-body li{margin:6px 0}
.mtb-step-body a{color:var(--mtb-blue);font-weight:650;text-decoration:none}
.mtb-step-body a:active{opacity:.72}
.mtb-step-body img{display:block;max-width:100%;height:auto;max-height:70vh;object-fit:contain;border:1px solid var(--mtb-line-soft);border-radius:var(--mtb-radius-sm);background:var(--mtb-card-2)}
.mtb-step-body .mtb-flow-tip,.mtb-step-body .mtb-flow-action,.mtb-step-body .mtb-flow-condition{
  --mtb-flow-card-color:var(--mtb-blue);
  --mtb-flow-card-bg:rgba(0,122,255,.08);
  --mtb-flow-card-border:rgba(0,122,255,.22);
  --mtb-flow-icon-bg:rgba(0,122,255,.14);
  display:grid;
  grid-template-columns:22px minmax(0,1fr);
  column-gap:10px;
  align-items:center;
  margin:16px 0 12px;
  padding:12px 14px;
  border:1px solid var(--mtb-flow-card-border);
  border-radius:var(--mtb-radius-sm);
  background:var(--mtb-flow-card-bg);
  color:var(--mtb-flow-card-color);
  font-size:15px;
  line-height:1.6;
  font-weight:750;
  box-sizing:border-box;
}
.mtb-step-body .mtb-flow-tip::before,.mtb-step-body .mtb-flow-action::before,.mtb-step-body .mtb-flow-condition::before{
  display:inline-grid;
  place-items:center;
  width:22px;
  height:22px;
  border-radius:999px;
  background:var(--mtb-flow-icon-bg);
  color:var(--mtb-flow-card-color);
  font-family:Arial,"Helvetica Neue",sans-serif;
  font-size:14px;
  font-weight:900;
  line-height:1;
  text-align:center;
}
.mtb-step-body .mtb-flow-tip{--mtb-flow-card-color:var(--mtb-red);--mtb-flow-card-bg:rgba(255,59,48,.08);--mtb-flow-card-border:rgba(255,59,48,.22);--mtb-flow-icon-bg:rgba(255,59,48,.14);margin-top:0;font-weight:700;line-height:1.65}
.mtb-step-body .mtb-flow-tip::before{content:"!"}
.mtb-step-body .mtb-flow-action{--mtb-flow-card-color:var(--mtb-blue);--mtb-flow-card-bg:rgba(0,122,255,.08);--mtb-flow-card-border:rgba(0,122,255,.22);--mtb-flow-icon-bg:rgba(0,122,255,.14)}
.mtb-step-body .mtb-flow-action::before{content:"→";font-size:13px}
.mtb-step-body .mtb-flow-condition{--mtb-flow-card-color:#008f5f;--mtb-flow-card-bg:rgba(0,208,136,.10);--mtb-flow-card-border:rgba(0,208,136,.24);--mtb-flow-icon-bg:rgba(0,208,136,.16)}
.mtb-step-body .mtb-flow-condition::before{content:"✓"}

.mtb-step-nav{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin:22px 0 0;padding-top:16px;border-top:1px solid var(--mtb-line-soft)}
.mtb-step-nav .mtb-prev:first-child{margin-right:auto}

/* Lightweight scroll hint. Plain gradient only. */
.mtb-scroll-hint{position:absolute;left:0;right:0;bottom:0;z-index:6;min-height:76px;display:flex;align-items:flex-end;justify-content:center;padding:34px 16px 10px;pointer-events:none;opacity:0;background:linear-gradient(to bottom,rgba(255,255,255,0),rgba(255,255,255,.92) 56%,#fff);transition:opacity .12s ease}
.mtb-scroll-hint.is-visible{opacity:1}
.mtb-scroll-hint span{display:inline-flex;align-items:center;min-height:32px;padding:0 13px;border-radius:999px;background:#2c2c2e;color:#fff;font-size:13px;font-weight:700;line-height:1.2}
.mtb-scroll-hint span::before{content:"↑";margin-right:6px;font-weight:900}

/* Center / protected cards */
.mtb-redeem-center,.mtb-protected-wrapper{width:100%;max-width:720px;margin:18px auto;padding:18px;border:1px solid var(--mtb-line);border-radius:var(--mtb-radius-lg);background:var(--mtb-card);box-shadow:0 4px 14px rgba(0,0,0,.06);overflow-wrap:break-word;word-break:break-word}
.mtb-redeem-title,.mtb-protected-header strong{display:block;margin:0 0 14px;text-align:center;font-size:22px;font-weight:800;line-height:1.25;letter-spacing:-.02em;color:var(--mtb-text)}
.mtb-redeem-desc{margin:0 0 14px;color:var(--mtb-muted);font-size:15px;line-height:1.65}
.mtb-redeem-form,.mtb-protected-auth-form{display:flex;align-items:center;gap:10px;margin:0}
.mtb-redeem-form input,.mtb-protected-auth-form input{appearance:none;-webkit-appearance:none;flex:1;width:100%;min-width:0;min-height:48px;padding:0 14px;border:1px solid var(--mtb-line);border-radius:var(--mtb-radius);background:var(--mtb-card-2);color:var(--mtb-text);font-size:16px;line-height:1.2;outline:none}
.mtb-redeem-form input:focus,.mtb-protected-auth-form input:focus{border-color:var(--mtb-blue);background:var(--mtb-card);box-shadow:0 0 0 3px rgba(0,122,255,.14)}
.mtb-redeem-status,.mtb-redeem-list,.mtb-protected-result{margin-top:14px}
.mtb-license-box{margin:14px 0 0;padding:14px;border:1px solid var(--mtb-line-soft);border-radius:var(--mtb-radius);background:var(--mtb-card-2)}
.mtb-license-meta{margin:0!important;color:var(--mtb-muted);font-size:15px;line-height:1.55}
.mtb-license-meta+.mtb-license-meta{margin-top:6px!important}
.mtb-error-message{margin:14px 0 0;padding:13px 14px;border:1px solid #ffd1cf;border-radius:var(--mtb-radius);background:#fff1f0;color:var(--mtb-red);font-size:15px;font-weight:700;line-height:1.6;text-align:center}
.mtb-loading{display:block;margin:0;color:var(--mtb-muted);font-size:15px;font-weight:700;line-height:1.6;text-align:center}
.mtb-note{margin:10px 0 0;padding:12px 14px;border:1px solid #ffe0a3;border-radius:var(--mtb-radius-sm);background:#fff7e6;color:var(--mtb-orange);font-size:14px;line-height:1.6}
.mtb-protected-wrapper.mtb-is-auto-checking .mtb-protected-header,.mtb-protected-wrapper.mtb-is-auto-checking .mtb-protected-auth-form{display:none}
.mtb-protected-wrapper.mtb-is-auto-checking .mtb-protected-result{margin-top:0}

/* App / install list */
.mtb-appstore-group{margin-top:16px}
.mtb-appstore-group h4{margin:0 0 10px;font-size:17px;font-weight:800;color:var(--mtb-muted)}
.mtb-appstore-list{overflow:hidden;border:1px solid var(--mtb-line);border-radius:var(--mtb-radius-lg);background:var(--mtb-card)}
.mtb-appstore-item{display:grid;grid-template-columns:56px minmax(0,1fr) auto;align-items:center;gap:12px;min-height:76px;padding:10px 14px;border-bottom:1px solid var(--mtb-line-soft)}
.mtb-appstore-item:last-child{border-bottom:0}
.mtb-appstore-icon{width:56px;height:56px;border-radius:14px;overflow:hidden;background:var(--mtb-card-3);display:flex;align-items:center;justify-content:center;color:var(--mtb-blue);font-weight:900}
.mtb-appstore-icon img{width:100%;height:100%;object-fit:cover}
.mtb-appstore-main{min-width:0}
.mtb-appstore-main strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:16px;font-weight:800;line-height:1.3;color:var(--mtb-text)}
/* Install resource row */
.mtb-install-row{display:grid;grid-template-columns:64px minmax(0,1fr) 52px;align-items:center;gap:14px;width:100%;min-height:92px;margin:-1px 0 0;padding:12px 0;border-top:1px solid var(--mtb-line-soft);border-bottom:1px solid var(--mtb-line-soft);color:var(--mtb-text)!important;text-decoration:none!important;background:transparent;-webkit-tap-highlight-color:transparent}
.mtb-install-row:first-child{margin-top:0}
.mtb-install-row:active{opacity:.68}
.mtb-install-icon{width:64px;height:64px;border:1px solid var(--mtb-line-soft);border-radius:18px;overflow:hidden;background:var(--mtb-card-3);display:flex;align-items:center;justify-content:center;flex:0 0 auto;color:var(--mtb-muted);font-size:13px;font-weight:800}
.mtb-install-icon img{display:block;width:100%;height:100%;object-fit:cover;border:0;border-radius:0;max-height:none;background:transparent}
.mtb-install-main{display:block;min-width:0;color:var(--mtb-text)}
.mtb-install-main strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;color:var(--mtb-text);font-size:18px;font-weight:500;line-height:1.28;letter-spacing:-.01em;word-break:normal;overflow-wrap:break-word}
.mtb-install-subtitle{display:block;margin-top:4px;color:var(--mtb-muted-2);font-size:18px;font-weight:400;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mtb-install-action{width:52px;height:52px;display:flex;align-items:center;justify-content:center;color:var(--mtb-blue)}
.mtb-install-action svg{display:block;width:30px;height:30px}
.mtb-install-spinner{display:none;width:30px;height:30px;border:3px solid rgba(0,122,255,.22);border-top-color:var(--mtb-blue);border-radius:999px;animation:mtb-install-spin .8s linear infinite}
.mtb-install-row.is-installing .mtb-install-cloud{display:none}
.mtb-install-row.is-installing .mtb-install-spinner{display:block}
.mtb-manifest-expired{opacity:.72}
@keyframes mtb-install-spin{to{transform:rotate(360deg)}}

/* Protected result blocks */
.mtb-account-result{padding:16px;border:1px solid var(--mtb-line-soft);border-radius:var(--mtb-radius);background:var(--mtb-card-2);display:flex;flex-direction:column;gap:10px}
.mtb-content-result{width:100%;padding:0;border:0;background:transparent}
.mtb-protected-wrapper[data-protected-type="content"][data-loaded="1"]{max-width:none;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}
.mtb-account-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:40px}
.mtb-account-value{min-width:0;display:flex;align-items:center;gap:4px;color:var(--mtb-text);line-height:1.45}
.mtb-account-value span{min-width:0;overflow-wrap:anywhere}
.mtb-copy-btn{flex:0 0 auto;width:auto;min-width:86px;min-height:34px;padding:0 13px;font-size:14px;line-height:1;background:var(--mtb-blue)}
.mtb-once-viewed-at{font-weight:700;color:var(--mtb-muted)}

/* Toast / confirm */
.mtb-toast{position:fixed;left:16px;right:16px;bottom:calc(20px + env(safe-area-inset-bottom));z-index:10080;max-width:420px;margin:0 auto;padding:12px 16px;border-radius:var(--mtb-radius);background:#2c2c2e;color:#fff;font-size:14px;line-height:1.5;text-align:center;opacity:0;pointer-events:none;transition:opacity .12s ease}
.mtb-toast.is-visible{opacity:1}
.mtb-confirm-overlay{position:fixed;inset:0;z-index:10001;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(0,0,0,.48)}
.mtb-confirm-box{width:min(420px,100%);padding:20px;border:1px solid var(--mtb-line);border-radius:20px;background:var(--mtb-card);box-shadow:var(--mtb-shadow)}
.mtb-confirm-content{margin:0 0 18px;color:var(--mtb-text);font-size:16px;line-height:1.7}
.mtb-confirm-buttons{display:flex;justify-content:flex-end;gap:12px;flex-wrap:wrap}

@media(max-width:900px){
  .mtb-modal{width:100%;max-height:calc(var(--mtb-visual-height,100vh) - 28px)}
  .mtb-modal-body{grid-template-columns:1fr}
  .mtb-sidebar{display:none!important}
  .mtb-step-content{padding:18px}
  .mtb-redeem-center,.mtb-protected-wrapper{max-width:calc(100% - 24px)}
}
@media(max-width:768px){
  .mtb-modal-overlay{align-items:flex-end;padding:0;background:rgba(0,0,0,.38)}
  .mtb-modal{width:100%;max-height:calc(var(--mtb-visual-height,100vh) - 8px);border-radius:24px 24px 0 0;border-left:0;border-right:0;border-bottom:0}
  .mtb-modal-header{padding:16px 16px 12px}
  .mtb-modal-title{font-size:20px}
  .mtb-step-title{font-size:20px}
  .mtb-step-content{padding:16px 16px calc(96px + env(safe-area-inset-bottom))}
  .mtb-step-nav{flex-direction:column;align-items:stretch}
  .mtb-step-nav .mtb-prev:first-child{margin-right:0}
  .mtb-step-nav button{width:100%}
  .mtb-redeem-form,.mtb-protected-auth-form{flex-direction:column;align-items:stretch}
  .mtb-redeem-form button,.mtb-protected-auth-form button{width:100%}
  .mtb-appstore-item{grid-template-columns:54px minmax(0,1fr) auto;gap:10px;padding:10px 12px}
  .mtb-appstore-icon{width:54px;height:54px;border-radius:13px}
  .mtb-scroll-hint{min-height:70px;padding:30px 14px calc(28px + env(safe-area-inset-bottom))}
}
@media(max-width:520px){
  .mtb-account-row{align-items:stretch;flex-direction:column}
  .mtb-account-row .mtb-copy-btn{width:100%;min-height:40px}
  .mtb-flow-install{padding:0 13px}
  .mtb-confirm-buttons{flex-direction:column-reverse;align-items:stretch}
  .mtb-confirm-buttons button{width:100%}
}
@media(prefers-color-scheme:dark){
  :root{--mtb-bg:#101014;--mtb-card:#1c1c1e;--mtb-card-2:#252529;--mtb-card-3:#2c2c31;--mtb-text:#f5f5f7;--mtb-muted:#a7a7ad;--mtb-muted-2:#8e8e93;--mtb-line:#3a3a40;--mtb-line-soft:#303036;--mtb-shadow:0 10px 24px rgba(0,0,0,.34)}
  .mtb-modal-overlay{background:rgba(0,0,0,.56)}
  .mtb-prev,.mtb-btn-secondary{background:#2c2c31;color:var(--mtb-text)}
  .mtb-redeem-form input,.mtb-protected-auth-form input,.mtb-side-item,.mtb-appstore-list{background:#1f1f23;color:var(--mtb-text)}
  .mtb-install-icon{background:#2c2c31;border-color:var(--mtb-line-soft)}
  .mtb-install-spinner{border-color:rgba(10,132,255,.24);border-top-color:var(--mtb-blue)}
  .mtb-step-body h1,.mtb-step-body h2,.mtb-step-body h3,.mtb-step-body h4,.mtb-step-body h5,.mtb-step-body h6{color:#fff}
  .mtb-step-body .mtb-flow-tip{--mtb-flow-card-color:#ff6961;--mtb-flow-card-bg:rgba(255,69,58,.13);--mtb-flow-card-border:rgba(255,69,58,.30);--mtb-flow-icon-bg:rgba(255,69,58,.18)}
  .mtb-step-body .mtb-flow-action{--mtb-flow-card-color:#0a84ff;--mtb-flow-card-bg:rgba(10,132,255,.14);--mtb-flow-card-border:rgba(10,132,255,.30);--mtb-flow-icon-bg:rgba(10,132,255,.18)}
  .mtb-step-body .mtb-flow-condition{--mtb-flow-card-color:#30d158;--mtb-flow-card-bg:rgba(48,209,88,.14);--mtb-flow-card-border:rgba(48,209,88,.28);--mtb-flow-icon-bg:rgba(48,209,88,.18)}
  .mtb-side-item.active{background:var(--mtb-blue)}
  .mtb-error-message{background:#391b1c;border-color:#5b2628;color:#ffb8b8}
  .mtb-note{background:#3a2a12;border-color:#5b431a;color:#ffd89b}
  .mtb-scroll-hint{background:linear-gradient(to bottom,rgba(28,28,30,0),rgba(28,28,30,.92) 56%,#1c1c1e)}
  .mtb-scroll-hint span,.mtb-toast{background:#3a3a40}
  .mtb-confirm-overlay{background:rgba(0,0,0,.62)}
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{transition:none!important;animation:none!important}
}

.mtb-step-body a.mtb-install-row,.mtb-content-result a.mtb-install-row,a.mtb-install-row{color:var(--mtb-text)!important;text-decoration:none!important}
.mtb-step-body a.mtb-install-row .mtb-install-action,.mtb-content-result a.mtb-install-row .mtb-install-action{color:var(--mtb-blue)!important}
