/* ============================================================
   QQ 验证码登录 · iOS 风格（适配自 otp-login，全部样式置于 .otp-app 下避免与站点冲突）
   ============================================================ */
.otp-app {
  --o-bg: #f5f5f7;
  --o-card: #ffffff;
  --o-text: #1d1d1f;
  --o-text-2: #6e6e73;
  --o-text-3: #aeaeb2;
  --o-line: #e5e5ea;
  --o-fill: #f2f2f7;
  --o-blue: #007aff;
  --o-blue-press: #0066d6;
  --o-blue-soft: rgba(0, 122, 255, .12);
  --o-green: #34c759;
  --o-red: #ff3b30;
  --o-red-soft: rgba(255, 59, 48, .10);
  --o-disabled: #d1d1d6;
  --o-radius-card: 28px;
  --o-radius-control: 14px;
  --o-ease-ios: cubic-bezier(.32, .72, 0, 1);
  --o-ease-spring: cubic-bezier(.17, .9, .24, 1.18);
  --o-shadow-card: 0 24px 60px -20px rgba(0, 0, 0, .14), 0 8px 24px -12px rgba(0, 0, 0, .08);
  position: fixed; inset: 0; z-index: 300;
  background: var(--o-bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--o-text);
  -webkit-font-smoothing: antialiased;
  overflow: auto;
}
.otp-app *, .otp-app *::before, .otp-app *::after { box-sizing: border-box; margin: 0; padding: 0; }
.otp-app [hidden] { display: none !important; }
.otp-app button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.otp-app input { font: inherit; }

.otp-stage { min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; gap: 18px; align-content: center; justify-items: center; }
.otp-card { position: relative; width: 100%; max-width: 390px; min-width: 0; background: var(--o-card); border-radius: var(--o-radius-card); box-shadow: var(--o-shadow-card); overflow: hidden; overflow: clip; isolation: isolate; }
.otp-back-home { position: fixed; top: 20px; left: 20px; z-index: 310; font-size: 14px; color: var(--o-text-2); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.7); backdrop-filter: blur(8px); }
.otp-back-home:hover { color: var(--o-blue); }

.otp-views { display: flex; width: 100%; transform: translateX(0); transition: transform .55s var(--o-ease-ios); will-change: transform; }
.otp-views.step-otp { transform: translateX(-100%); }
.otp-view { flex: 0 0 100%; min-width: 100%; padding: 44px 30px 38px; display: flex; flex-direction: column; }
.otp-view-otp { padding-top: 18px; }

.otp-app h1 { font-size: 26px; font-weight: 700; letter-spacing: -.4px; margin-top: 22px; }
.otp-subtitle { margin-top: 10px; font-size: 14px; line-height: 1.55; color: var(--o-text-2); }
.otp-subtitle b { color: var(--o-text); font-weight: 600; }

.otp-badge { width: 64px; height: 64px; border-radius: 18px; background: var(--o-blue-soft); display: grid; place-items: center; animation: otp-badge-in .6s var(--o-ease-spring) both; }
@keyframes otp-badge-in { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: scale(1); } }
.otp-badge svg { width: 30px; height: 30px; }

.otp-field { margin-top: 30px; height: 54px; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: var(--o-fill); border-radius: var(--o-radius-control); border: 1.5px solid transparent; transition: border-color .25s var(--o-ease-ios), box-shadow .25s var(--o-ease-ios), background .25s var(--o-ease-ios); }
.otp-field:focus-within { background: #fff; border-color: var(--o-blue); box-shadow: 0 0 0 4px var(--o-blue-soft); }
.otp-field.is-success { background: #fff; border-color: var(--o-green); box-shadow: 0 0 0 4px rgba(52, 199, 89, .12); }
.otp-view .otp-field.is-error { background: #fff; border-color: var(--o-red); box-shadow: 0 0 0 4px var(--o-red-soft); animation: otp-shake .5s var(--o-ease-ios); }
.otp-field-prefix { font-size: 16px; font-weight: 600; color: var(--o-text); letter-spacing: .3px; }
.otp-field-divider { width: 1px; height: 22px; background: var(--o-line); }
.otp-field-input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 17px; letter-spacing: .5px; color: var(--o-text); }
.otp-field-input::placeholder { color: var(--o-text-3); }
.otp-field-clear { width: 24px; height: 24px; display: grid; place-items: center; color: var(--o-text-3); border-radius: 50%; transition: color .2s, transform .2s var(--o-ease-spring); }
.otp-field-clear:active { transform: scale(.82); }
.otp-field-clear:hover { color: var(--o-text-2); }
.otp-field-clear svg { width: 18px; height: 18px; }

.otp-btn-primary { position: relative; margin-top: 20px; height: 52px; border-radius: var(--o-radius-control); background: var(--o-blue); color: #fff; font-size: 17px; font-weight: 600; letter-spacing: .3px; display: flex; align-items: center; justify-content: center; gap: 8px; overflow: hidden; transition: transform .18s var(--o-ease-ios), background .25s, opacity .25s, box-shadow .25s; box-shadow: 0 10px 22px -10px rgba(0, 122, 255, .65); }
.otp-btn-primary:hover:not(:disabled):not(.is-loading) { background: var(--o-blue-press); }
.otp-btn-primary:active:not(:disabled):not(.is-loading) { transform: scale(.97); }
.otp-btn-primary:disabled { background: var(--o-disabled); box-shadow: none; cursor: not-allowed; }
.otp-btn-label { position: relative; z-index: 1; }
.otp-btn-spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: otp-btn-spin .7s linear infinite; }
.otp-btn-primary.is-loading:not(.is-result) .otp-btn-spinner { display: block; }
@keyframes otp-btn-spin { to { transform: rotate(360deg); } }
.otp-btn-primary.is-loading { background: #c7c7cc; box-shadow: none; cursor: default; }

.otp-btn-link { margin-top: 16px; align-self: center; font-size: 14px; color: var(--o-blue); padding: 8px 10px; border-radius: 8px; transition: opacity .2s, transform .2s var(--o-ease-ios); }
.otp-btn-link:active { transform: scale(.95); opacity: .7; }

.otp-nav { display: flex; align-items: center; height: 32px; }
.otp-nav-back { margin-left: -8px; width: 36px; height: 36px; border-radius: 50%; color: var(--o-blue); display: grid; place-items: center; transition: background .2s, transform .2s var(--o-ease-ios); }
.otp-nav-back:hover { background: var(--o-fill); }
.otp-nav-back:active { transform: scale(.88); }
.otp-nav-back svg { width: 26px; height: 26px; }

.otp-box { position: relative; margin-top: 30px; }
.otp-cells { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp-cell { position: relative; aspect-ratio: 1 / 1.18; border-radius: 12px; background: #fff; border: 1.5px solid var(--o-line); display: grid; place-items: center; transition: background-color .26s var(--o-ease-ios), border-color .26s var(--o-ease-ios), box-shadow .26s var(--o-ease-ios), transform .3s var(--o-ease-spring); }
.otp-cell-digit { font-size: 22px; font-weight: 700; color: var(--o-text); line-height: 1; }
.otp-cell.is-filled { border-color: #c7dfff; background: #f7faff; }
.otp-cell.is-active { border-color: var(--o-blue); box-shadow: 0 0 0 4px var(--o-blue-soft); }
.otp-cell.is-active::after { content: ""; position: absolute; width: 2px; height: 22px; border-radius: 2px; background: var(--o-blue); animation: otp-cursor-blink 1.05s steps(1) infinite; }
@keyframes otp-cursor-blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }
.otp-cell.is-filled .otp-cell-digit { animation: otp-digit-pop .3s var(--o-ease-spring); }
@keyframes otp-digit-pop { 0% { transform: scale(.4); opacity: .2; } 60% { transform: scale(1.18); } 100% { transform: scale(1); opacity: 1; } }
.otp-cell.is-blue { border-color: var(--o-blue); transform: scale(1.1); z-index: 1; box-shadow: 0 0 0 4px rgba(0, 122, 255, .14); }
.otp-cell.is-red { border-color: var(--o-red); transform: scale(1.1); z-index: 1; box-shadow: 0 0 0 4px rgba(255, 59, 48, .12); transition-duration: .14s; }
.otp-cell.is-green { border-color: var(--o-green); transform: scale(1.1); z-index: 1; box-shadow: 0 0 0 4px rgba(52, 199, 89, .14); transition-duration: .14s; }
.otp-cells.is-shaking { animation: otp-shake .5s var(--o-ease-ios); }
@keyframes otp-shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); } }

.otp-input { position: absolute; inset: 0; width: 100%; font-size: 16px; opacity: 0; border: 0; outline: 0; background: none; caret-color: transparent; cursor: text; -webkit-tap-highlight-color: transparent; }
.otp-input:disabled { cursor: default; }
.otp-msg { margin-top: 14px; min-height: 20px; font-size: 14px; color: var(--o-red); transition: color .2s; }
.otp-msg.is-info { color: var(--o-text-2); }
.otp-foot { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.otp-resend { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 14px; color: var(--o-text-3); padding: 6px 10px; border-radius: 10px; transition: color .2s, transform .2s var(--o-ease-ios); }
.otp-resend:not(:disabled) { color: var(--o-blue); }
.otp-resend:not(:disabled):active { transform: scale(.94); }
.otp-resend:disabled { cursor: default; }
.otp-resend svg { width: 15px; height: 15px; }

.otp-view-success { position: absolute; inset: 0; z-index: 3; background: var(--o-card); border-radius: var(--o-radius-card); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; opacity: 0; transform: scale(.94); pointer-events: none; transition: opacity .45s var(--o-ease-ios), transform .45s var(--o-ease-spring); }
.otp-view-success.is-show { opacity: 1; transform: scale(1); pointer-events: auto; }
.otp-view-success h1 { margin-top: 26px; }
.otp-view-success .otp-btn-link { margin-top: 26px; }
.otp-success-mark { width: 92px; height: 92px; }
.otp-success-circle { stroke: var(--o-green); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 132; stroke-dashoffset: 132; }
.otp-success-check { stroke: var(--o-green); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; }
.otp-view-success.is-show .otp-success-circle { animation: otp-draw .55s var(--o-ease-ios) forwards; }
.otp-view-success.is-show .otp-success-check { animation: otp-draw .35s var(--o-ease-ios) .42s forwards; }
@keyframes otp-draw { to { stroke-dashoffset: 0; } }

.otp-app .otp-view [data-stagger] { animation: otp-rise-in .55s var(--o-ease-ios) both; }
.otp-app .otp-view [data-stagger]:nth-child(1) { animation-delay: .05s; }
.otp-app .otp-view [data-stagger]:nth-child(2) { animation-delay: .10s; }
.otp-app .otp-view [data-stagger]:nth-child(3) { animation-delay: .15s; }
.otp-app .otp-view [data-stagger]:nth-child(4) { animation-delay: .20s; }
.otp-app .otp-view [data-stagger]:nth-child(5) { animation-delay: .25s; }
@keyframes otp-rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.otp-views:not(.step-otp) .otp-view-otp [data-stagger] { animation: none; }

.otp-toast { position: fixed; top: max(20px, env(safe-area-inset-top)); left: 50%; transform: translate(-50%, -16px); background: rgba(29, 29, 31, .88); color: #fff; font-size: 14px; font-weight: 500; padding: 11px 20px; border-radius: 999px; backdrop-filter: blur(10px); opacity: 0; pointer-events: none; transition: opacity .3s var(--o-ease-ios), transform .3s var(--o-ease-spring); z-index: 50; max-width: 86vw; text-align: center; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .35); }
.otp-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 440px) {
  .otp-stage { padding: 0; gap: 0; align-content: stretch; }
  .otp-card { max-width: none; min-height: 100dvh; border-radius: 0; box-shadow: none; display: flex; flex-direction: column; }
  .otp-views { flex: 1; min-width: 0; max-width: 100%; }
  .otp-view { padding: 56px 24px 32px; justify-content: flex-start; }
  .otp-view-success { border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .otp-app *, .otp-app *::before, .otp-app *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
