/* 主题切换按钮 */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-strong, rgba(255,255,255,.5));
  background: var(--bg-card, rgba(255,255,255,.82));
  color: var(--ink-700, #343A42);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.12));
  transition: all .24s var(--ease, ease);
  flex-shrink: 0;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.theme-toggle-btn svg { width: 14px; height: 14px; }
.theme-toggle-btn:hover {
  color: var(--mi-orange-deep, #E55A00);
  border-color: var(--mi-orange-border, #FFD9C2);
  box-shadow: 0 4px 14px -4px rgba(255, 105, 0, .35);
}

/* 面板顶栏的灵动/简约分段切换 */
.theme-switch-panel {
  padding: 3px;
  border-radius: 999px;
  gap: 2px;
  background: var(--bg-subtle, #F1F3F5);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.08));
}
.theme-switch-panel .theme-option {
  border: 0;
  background: transparent;
  color: var(--ink-500, #6E7683);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .22s var(--ease, ease);
}
.theme-switch-panel .theme-option:hover { color: var(--mi-orange-deep, #E55A00); }
.theme-switch-panel .theme-option.active {
  background: linear-gradient(135deg, var(--mi-orange-soft, #FF8A33), var(--mi-orange-deep, #E55A00));
  color: #fff;
  box-shadow: 0 3px 10px -3px rgba(255, 105, 0, .55);
}
.theme-switch-panel svg { display: none; }

/* 侧栏底部主题切换（登录后使用，两套主题都协调） */
.sidebar-theme-switch {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm, 10px);
  background: var(--bg-subtle, #F1F3F5);
  border: 1px solid var(--border-color, #E5E8EC);
  box-shadow: none;
}
.sidebar-theme-switch .sidebar-theme-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-400, #9BA3AF);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.sidebar-theme-switch .sidebar-theme-options {
  display: flex;
  gap: 6px;
}
.sidebar-theme-switch .theme-option {
  flex: 1;
  border: 1px solid var(--border-color, #E5E8EC);
  background: var(--bg-card, #FFFFFF);
  color: var(--ink-600, #475467);
  font-size: 12.5px;
  font-weight: 500;
  font-family: var(--font-sans);
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s var(--ease, ease);
  text-align: center;
}
.sidebar-theme-switch .theme-option:hover {
  border-color: var(--mi-orange-border, #FFD9C2);
  color: var(--mi-orange-deep, #E55A00);
}
.sidebar-theme-switch .theme-option.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--mi-orange-soft, #FF8A33), var(--mi-orange-deep, #E55A00));
  color: #fff;
  box-shadow: 0 3px 10px -3px rgba(255, 105, 0, .5);
}

/* 移动端：登录页切换按钮缩小，不挡内容 */
@media (max-width: 640px) {
  body.auth-stage .theme-toggle-btn {
    top: 12px;
    right: 12px;
    padding: 6px 10px;
    font-size: 11px;
  }
  body.auth-stage .theme-toggle-btn svg {
    width: 12px;
    height: 12px;
  }
}

/* 登录页：右上角固定 */
body.auth-stage .theme-toggle-btn {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 4000;
}

/* 面板页：放在右上角用户信息前 */
.header-right .theme-toggle-btn { margin-right: 10px; }

/* 深色玻璃背景（灵动主题登录页）下保持可读 */
body.auth-stage[data-theme="dynamic"] .theme-toggle-btn {
  border-color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.82);
}

/* 单通道展示（创建授权弹窗） */
.channel-lock {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--mi-orange-border, #FFD9C2);
  border-radius: var(--radius-sm, 10px);
  background: var(--mi-orange-bg, #FFF4EC);
}
.channel-lock .channel-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--mi-orange, #FF6900);
  box-shadow: 0 0 0 4px rgba(255, 105, 0, 0.12);
}
.channel-lock-main { flex: 1; min-width: 0; }
.channel-lock-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-800, #1F242B);
}
.channel-lock-desc {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-500, #6E7683);
}

/* ============ 本地简易验证码（兜底） ============ */
.local-captcha { width: 100%; display: flex; justify-content: center; }
.lc-click-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  max-width: 280px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #E5E8EC);
  background: var(--bg-card, #FFFFFF);
  color: var(--ink-700, #343A42);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.08));
  transition: all .2s var(--ease, ease);
}
.lc-click-btn:hover {
  border-color: var(--mi-orange-border, #FFD9C2);
  color: var(--mi-orange-deep, #E55A00);
}
.lc-click-box {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border-strong, #DCE0E6);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  flex-shrink: 0;
}
.lc-click-box svg { width: 12px; height: 12px; }
.lc-click-btn.lc-ok {
  border-color: var(--success-border, #BAEBCF);
  background: var(--success-bg, #E7F8EF);
  color: var(--success, #17B26A);
}
.lc-click-btn.lc-ok .lc-click-box {
  border-color: var(--success, #17B26A);
  background: var(--success, #17B26A);
  color: #fff;
}
.lc-click-btn.lc-busy {
  opacity: .75;
  cursor: wait;
}

/* ============ 账号安全设置 ============ */
.security-block {
  padding: 18px 0;
  border-bottom: 1px solid var(--border-color, #E5E8EC);
}
.security-block:first-child { padding-top: 4px; }
.security-block:last-child { border-bottom: none; }
.security-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.security-block-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-900, #111418);
}
.security-block-desc {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--ink-500, #6E7683);
}
.security-bound-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.security-bound-row .form-input { flex: 1; }
.security-form { display: flex; flex-direction: column; gap: 10px; }
.security-form-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.security-form-row .form-input { flex: 1; }
.security-hint {
  display: block;
  font-size: 12px;
  color: var(--mi-orange-deep, #E55A00);
  margin-top: 2px;
}
.security-prompt-body p {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-700, #343A42);
  margin: 0;
}

/* 开关 */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--border-strong, #DCE0E6);
  transition: all .22s var(--ease, ease);
  cursor: pointer;
}
.switch-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(16,24,40,.25);
  transition: all .22s var(--ease, ease);
}
.switch input:checked + .switch-slider {
  background: linear-gradient(135deg, var(--mi-orange-soft, #FF8A33), var(--mi-orange-deep, #E55A00));
}
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.switch input:disabled + .switch-slider { opacity: .45; cursor: not-allowed; }

/* 登录页邮箱验证码步骤 */
.email-code-step { margin-top: 16px; text-align: center; }
.email-code-step .email-code-title { font-size: 15px; font-weight: 600; color: var(--ink-900, #111418); }
.email-code-step .email-code-desc { font-size: 12.5px; color: var(--ink-500, #6E7683); margin: 6px 0 12px; }
.email-code-step input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong, #DCE0E6);
  font-size: 16px;
  text-align: center;
  letter-spacing: 6px;
  font-family: var(--font-mono, Consolas, monospace);
}
.email-code-step input:focus {
  outline: none;
  border-color: var(--mi-orange, #FF6900);
  box-shadow: 0 0 0 3px rgba(255,105,0,.12);
}
.email-code-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.email-code-actions .btn { flex: 1; }
#email-code-demo-hint {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--mi-orange-deep, #E55A00);
  background: var(--mi-orange-bg, #FFF4EC);
  border: 1px dashed var(--mi-orange-border, #FFD9C2);
  border-radius: 8px;
  padding: 7px 10px;
}
.email-code-back {
  margin-top: 10px;
  width: 100%;
}

/* ============================================================
   创建授权弹窗（灵动 / 简约共用）
   ============================================================ */

/* 去掉标题左侧那根竖条，改成更精致的整体设计 */
.modal-header h3 .accent {
  display: none;
}

.license-modal {
  position: relative;
  overflow-x: hidden;
}
.license-modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, #FF6900, #FFB37A 45%, #14B8A6);
  z-index: 2;
}
.license-modal::after {
  content: "";
  position: absolute;
  top: -70px;
  right: -70px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,105,0,.10), transparent 68%);
  pointer-events: none;
  z-index: 0;
}
.license-modal > * {
  position: relative;
  z-index: 1;
}

.modal-tag {
  margin-left: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  color: #B64B00;
  background: rgba(255,105,0,.09);
  border: 1px solid rgba(255,105,0,.18);
  white-space: nowrap;
}

/* 服务卡片：图标 + 文字 + 右侧勾选 */
.service-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 42px;
}
.service-option .so-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--mi-orange-deep, #E55A00);
  background: linear-gradient(145deg, #FFF4EC, #FFE4CF);
  border: 1px solid rgba(255,105,0,.14);
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
}
.service-option .so-icon svg {
  width: 20px;
  height: 20px;
}
.service-option:hover .so-icon {
  transform: translateY(-1px) scale(1.06);
}
.service-option.selected .so-icon {
  color: #fff;
  background: linear-gradient(135deg, #FF8A33, #E55A00);
  border-color: transparent;
  box-shadow: 0 8px 18px -8px rgba(255,105,0,.7);
}
.service-option .so-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.service-option .so-price {
  margin-top: 4px;
}

/* 简约主题：勾选圈固定到右上角，去掉原来的左侧圆点占位 */
html[data-theme="official"] .service-option .so-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--ink-300, #DCE0E6);
  background: #fff;
  flex-shrink: 0;
}
html[data-theme="official"] .service-option.selected .so-check {
  border-color: var(--mi-orange, #FF6900);
  background: var(--mi-orange, #FF6900);
}
html[data-theme="official"] .service-option .so-check::after {
  content: "";
  position: absolute;
  left: 5.5px;
  top: 2.5px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* 简约主题弹窗头部徽标（与灵动主题保持一致） */
html[data-theme="official"] .modal-header::before {
  content: "Mi";
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  background: linear-gradient(135deg, #ff9d4d, #ff6900);
  box-shadow: 0 10px 20px -12px rgba(255,105,0,.8);
  flex-shrink: 0;
}
html[data-theme="official"] .modal-header h3 {
  flex: 1;
}

/* ============ 计算 Sig 动画 ============ */
.calc-loading {
  text-align: center;
  padding: 26px 12px 18px;
}
.calc-loading.hidden {
  display: none;
}
.calc-visual {
  position: relative;
  width: 86px;
  height: 86px;
  margin: 0 auto 18px;
}
.calc-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255,105,0,.14);
  border-top-color: #FF6900;
  animation: calcSpin 1s linear infinite;
}
.calc-ring::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px dashed rgba(255,105,0,.28);
  animation: calcSpin 7s linear infinite reverse;
}
.calc-core {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF8A33, #E55A00);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px -12px rgba(255,105,0,.75);
  animation: calcPulse 1.6s ease-in-out infinite;
}
.calc-core svg {
  width: 26px;
  height: 26px;
}
.calc-loading h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-900, #111418);
  margin: 0 0 6px;
}
.calc-loading p {
  font-size: 12.5px;
  color: var(--ink-500, #6E7683);
  margin: 0 0 18px;
}
.calc-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--ink-100, #F1F3F5);
  overflow: hidden;
  margin: 0 auto 20px;
  max-width: 360px;
}
.calc-progress i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #FF8A33, #FF6900, #14B8A6);
  background-size: 200% 100%;
  animation: calcSheen 1.2s linear infinite;
}
.calc-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.calc-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--ink-50, #F8F9FA);
  border: 1px solid var(--border-color, #E5E8EC);
  color: var(--ink-400, #9BA3AF);
  font-size: 11.5px;
  font-weight: 600;
  transition: all .3s var(--ease, ease);
}
.calc-step i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-200, #DCE0E6);
  transition: all .3s var(--ease, ease);
}
.calc-step.active {
  color: var(--mi-orange-deep, #E55A00);
  border-color: rgba(255,105,0,.28);
  background: var(--mi-orange-bg, #FFF4EC);
}
.calc-step.active i {
  background: #FF6900;
  box-shadow: 0 0 0 4px rgba(255,105,0,.15);
}
.calc-step.done {
  color: var(--success, #17B26A);
  border-color: var(--success-border, #BAEBCF);
  background: var(--success-bg, #E7F8EF);
}
.calc-step.done i {
  background: var(--success, #17B26A);
  box-shadow: 0 0 0 4px rgba(23,178,106,.15);
}
@keyframes calcSpin {
  to { transform: rotate(360deg); }
}
@keyframes calcPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes calcSheen {
  to { background-position: -200% 0; }
}

/* ============ Sig 结果弹出 ============ */
.sig-panel {
  animation: sigPop .5s cubic-bezier(.22,1,.36,1);
}
@keyframes sigPop {
  0% { opacity: 0; transform: translateY(16px) scale(.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.sig-panel .sig-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22C55E, #17B26A);
  box-shadow: 0 6px 14px -6px rgba(23,178,106,.65);
  position: relative;
  flex-shrink: 0;
}
.sig-panel .sig-dot::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.sig-panel.is-error {
  border-color: var(--danger, #EF4444) !important;
}
.sig-panel.is-error .sig-dot {
  background: linear-gradient(135deg, #F87171, #EF4444);
  box-shadow: 0 6px 14px -6px rgba(239,68,68,.65);
}
.sig-panel.is-warning .sig-dot {
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  box-shadow: 0 6px 14px -6px rgba(245,158,11,.65);
}

@media (max-width: 640px) {
  .license-modal {
    padding: 20px 18px;
  }
  .modal-tag {
    display: none;
  }
  .calc-steps {
    gap: 6px;
  }
  .calc-step {
    padding: 4px 9px;
    font-size: 10.5px;
  }
  .service-option {
    padding: 13px 38px 13px 13px;
  }
}

/* ============ 主题切换动效 ============ */
html.theme-out body {
  animation: themeFadeOut .19s ease forwards;
}
html.theme-in body {
  animation: themeFadeIn .48s cubic-bezier(.22,1,.36,1);
}
@keyframes themeFadeOut {
  to { opacity: .25; transform: scale(.992); filter: blur(3px); }
}
@keyframes themeFadeIn {
  from { opacity: .25; transform: scale(.992); filter: blur(3px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}

/* 简约主题（深色门户）下的主题切换控件 */
html[data-theme="official"] .theme-toggle-btn,
body.theme-official .theme-toggle-btn {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.14);
  color: #e7ecf3;
  box-shadow: 0 8px 20px -10px rgba(0,0,0,.5);
}
html[data-theme="official"] .theme-toggle-btn:hover,
body.theme-official .theme-toggle-btn:hover {
  border-color: rgba(99,102,241,.55);
  color: #a5b4fc;
}
html[data-theme="official"] .theme-switch-panel,
body.theme-official .theme-switch-panel {
  background: rgba(255,255,255,.06);
}
html[data-theme="official"] .theme-switch-panel .theme-option,
body.theme-official .theme-switch-panel .theme-option {
  color: rgba(255,255,255,.62);
}
html[data-theme="official"] .theme-switch-panel .theme-option.active,
body.theme-official .theme-switch-panel .theme-option.active {
  background: linear-gradient(135deg, #818cf8, #6366f1 55%, #7c3aed);
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(99,102,241,.6);
}
html[data-theme="official"] .sidebar-theme-switch,
body.theme-official .sidebar-theme-switch {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.09);
}
html[data-theme="official"] .sidebar-theme-switch .sidebar-theme-label,
body.theme-official .sidebar-theme-switch .sidebar-theme-label {
  color: rgba(255,255,255,.42);
}
html[data-theme="official"] .sidebar-theme-switch .theme-option,
body.theme-official .sidebar-theme-switch .theme-option {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
  color: rgba(255,255,255,.7);
}
html[data-theme="official"] .sidebar-theme-switch .theme-option.active,
body.theme-official .sidebar-theme-switch .theme-option.active {
  background: linear-gradient(135deg, #818cf8, #6366f1 55%, #7c3aed);
  color: #fff;
}
