/* ===== 企业浅色主题 ===== */
:root {
  --glass: #ffffff;
  --glass-strong: #ffffff;
  --glass-border: #ece9f8;
  --primary: #7c6cf6;
  --primary-dark: #6553e8;
  --primary-soft: #f2efff;
  --green: #16a34a;
  --amber: #d97706;
  --red: #e11d48;
  --cyan: #0891b2;
  --violet: #7c3aed;
  --text: #1f2937;
  --text-2: #4b5563;
  --text-3: #8a94a6;
  --shadow: 0 2px 6px rgba(139, 92, 246, .06), 0 6px 20px rgba(139, 92, 246, .07);
  --radius: 14px;
}

* { box-sizing: border-box; }

body.modal-open { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(160deg, #fdf4fb 0%, #f4f3fe 45%, #eef4ff 100%) fixed;
  color: var(--text);
  font-family: "Inter", -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ===== 布局 ===== */
.layout { display: flex; min-height: 100vh; }

.sidebar, .sidebar.px-panel {
  width: 220px; flex-shrink: 0;
  display: flex; flex-direction: column; padding: 0 12px 14px;
  position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, #fdf6fd 0%, #f3f0ff 60%, #eef2ff 100%);
  border: 0; border-right: 1px solid #ece7fa;
  border-radius: 0; box-shadow: none;
}
.logo {
  display: flex; gap: 11px; align-items: center;
  margin: 14px 4px 16px; padding: 12px 6px 18px;
  border-bottom: 1px solid #ece7fa;
}
.logo-icon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f472b6, #8b5cf6 55%, #6366f1);
  box-shadow: 0 4px 14px rgba(139, 92, 246, .45);
  color: #fff; font-weight: 800; font-size: 17px;
}
.logo-copy {
  display: flex; flex-direction: column; justify-content: center;
  min-width: 0; gap: 2px;
}
.logo-text {
  font-weight: 800; font-size: 16px; letter-spacing: .6px; line-height: 1.25;
  background: linear-gradient(90deg, #ec4899, #8b5cf6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo-text span { display: none; }
.logo-version {
  min-height: 13px; color: #9589b6;
  font-size: 11px; font-weight: 600; line-height: 1.15; letter-spacing: 0;
}
.menu-group {
  margin: 2px 10px 8px; font-size: 11px; letter-spacing: 2px;
  color: #b3a8d9; user-select: none;
}

#menu { display: flex; flex-direction: column; gap: 7px; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 9px; cursor: pointer;
  text-decoration: none;
  color: #6d6490; border-radius: 13px; user-select: none;
  font-size: 13.5px; font-weight: 500; letter-spacing: .3px;
  transition: background .18s, color .18s, transform .18s, box-shadow .18s;
}
.menu-item svg {
  width: 30px; height: 30px; padding: 7px; flex-shrink: 0;
  border-radius: 10px; fill: currentColor;
  background: #fff; box-shadow: 0 1px 4px rgba(139, 92, 246, .15);
  transition: background .18s, fill .18s, transform .18s;
}
#menu .menu-item:nth-of-type(1) svg { fill: #0284c7; background: #e0f2fe; }
#menu .menu-item:nth-of-type(2) svg { fill: #db2777; background: #fce7f3; }
#menu .menu-item:nth-of-type(3) svg { fill: #7c3aed; background: #ede9fe; }
#menu .menu-item:nth-of-type(4) svg { fill: #d97706; background: #fef3c7; }
#menu .menu-item:nth-of-type(5) svg { fill: #16a34a; background: #dcfce7; }
.menu-item:hover:not(.active) {
  background: rgba(255, 255, 255, .85);
  color: var(--primary);
  transform: translateX(3px);
  box-shadow: 0 2px 10px rgba(139, 92, 246, .12);
}
.menu-item:hover:not(.active) svg { transform: scale(1.08); }
.menu-item.active {
  position: relative; overflow: hidden;
  background: linear-gradient(115deg, #f472b6, #c084fc 35%, #818cf8 70%, #f472b6);
  background-size: 280% 100%;
  animation: menu-flow 7s linear infinite;
  color: #fff; font-weight: 600;
  box-shadow: 0 8px 20px rgba(167, 139, 250, .55), inset 0 1px 0 rgba(255, 255, 255, .45);
}
@keyframes menu-flow {
  0% { background-position: 0% 0; }
  100% { background-position: 280% 0; }
}
.menu-item.active::before {
  content: ""; position: absolute; top: 0; left: -70%;
  width: 45%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: skewX(-20deg);
  animation: menu-shine 3.2s ease-in-out infinite;
}
@keyframes menu-shine {
  0%, 55% { left: -70%; }
  85%, 100% { left: 130%; }
}
.menu-item.active::after {
  content: ""; position: absolute; right: 13px; top: 50%;
  width: 6px; height: 6px; margin-top: -3px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, .9);
  animation: menu-dot 1.6s ease-in-out infinite;
}
@keyframes menu-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: .6; }
}
#menu .menu-item.active svg,
.menu-item.active svg {
  fill: #fff !important; background: rgba(255, 255, 255, .24) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
  animation: icon-pop .4s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes icon-pop {
  0% { transform: scale(.6); }
  100% { transform: scale(1); }
}
.sidebar-foot { margin-top: auto; color: #b3a8d9; font-size: 11px; text-align: center; letter-spacing: .5px; }

.main { flex: 1; padding: 24px 28px 28px; min-width: 0; }
.page-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 19px; margin: 0 0 20px; font-weight: 700; letter-spacing: .2px;
}
.page-title::before {
  content: ""; width: 4px; height: 18px; border-radius: 2px;
  background: linear-gradient(180deg, #f472b6, #8b5cf6);
}

.blink { display: none; }

/* ===== 面板 ===== */
.px-panel {
  background: #fff;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dash-recent { padding: 20px 22px; margin-top: 10px; }
.dash-recent h2 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }

/* 旧的 settings-panel 已由 settings-card 取代 */

/* ===== 统计卡片 ===== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-box {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow .15s, border-color .15s;
}
.stat-box:hover { border-color: #cdd8ef; box-shadow: 0 4px 18px rgba(23, 43, 99, .1); }
.stat-num { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.stat-label { margin-top: 4px; color: var(--text-3); font-size: 12.5px; }
.stat-ico {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.stat-box.blue   .stat-num { color: var(--primary); }
.stat-box.blue   .stat-ico { background: rgba(79, 110, 247, .14); color: var(--primary); }
.stat-box.amber  .stat-num { color: var(--amber); }
.stat-box.amber  .stat-ico { background: rgba(217, 119, 6, .13); color: var(--amber); }
.stat-box.green  .stat-num { color: var(--green); }
.stat-box.green  .stat-ico { background: rgba(22, 163, 74, .13); color: var(--green); }
.stat-box.red    .stat-num { color: var(--red); }
.stat-box.red    .stat-ico { background: rgba(225, 29, 72, .12); color: var(--red); }
.stat-box.cyan   .stat-num { color: var(--cyan); }
.stat-box.cyan   .stat-ico { background: rgba(8, 145, 178, .13); color: var(--cyan); }
.stat-box.violet .stat-num { color: var(--violet); }
.stat-box.violet .stat-ico { background: rgba(124, 58, 237, .13); color: var(--violet); }

/* ===== 工具栏 ===== */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .search { flex: 1; min-width: 220px; }

.px-input {
  padding: 9px 13px; color: var(--text);
  background: #fff;
  border: 1px solid #d7deea; border-radius: 8px;
  outline: none; font-family: inherit; font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
.px-input::placeholder { color: var(--text-3); }
input.px-input, select.px-input { height: 36px; padding-top: 0; padding-bottom: 0; }
.px-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124, 108, 246, .16); }
select.px-input option { background: #fff; }

/* ===== 自定义下拉框 ===== */
.px-select { position: relative; display: inline-block; min-width: 128px; }
.px-select > select { display: none; }
.px-select-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  height: 36px; padding: 0 13px 0 14px; cursor: pointer;
  font-family: inherit; font-size: 13.5px; color: var(--text);
  background: #fff; border: 1px solid #d7deea; border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
}
.px-select-btn:hover { border-color: #b9c6e0; }
.px-select.open .px-select-btn { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124, 108, 246, .16); }
.px-select-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-select-arrow { width: 16px; height: 16px; fill: var(--text-3); flex-shrink: 0; transition: transform .18s; }
.px-select.open .px-select-arrow { transform: rotate(180deg); }
.px-select-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  display: none; padding: 5px; max-height: 300px; overflow-y: auto;
  background: #fff;
  border: 1px solid var(--glass-border); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(23, 43, 99, .12);
}
.px-select.open .px-select-menu { display: block; }
.px-select-opt {
  padding: 8px 12px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--text-2); white-space: nowrap;
}
.px-select-opt:hover { background: #f2f5fa; color: var(--primary); }
.px-select-opt.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.px-btn {
  height: 36px; padding: 0 15px; cursor: pointer; color: var(--text-2);
  background: #fff;
  border: 1px solid #d7deea; border-radius: 8px;
  font-family: inherit; font-size: 13.5px; font-weight: 500; user-select: none;
  transition: all .15s;
}
.px-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.px-btn.primary {
  background: linear-gradient(135deg, #d8b4fe, #a78bfa 55%, #818cf8);
  border-color: transparent; color: #fff;
  box-shadow: 0 3px 10px rgba(167, 139, 250, .4);
}
.px-btn.primary:hover { background: linear-gradient(135deg, #c084fc, #8b5cf6 55%, #6366f1); border-color: transparent; color: #fff; }
.px-btn.danger { color: var(--red); }
.px-btn.danger:hover { border-color: rgba(225, 29, 72, .45); background: rgba(255, 240, 244, .8); color: var(--red); }
.px-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.view-switch {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 11px 0 7px; color: #62568a; text-decoration: none; white-space: nowrap;
  border-color: rgba(118, 96, 184, .2);
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(248,245,255,.94));
  box-shadow: 0 2px 7px rgba(57, 43, 99, .07);
}
.view-switch:hover {
  color: #6d4ed6; border-color: rgba(124, 91, 219, .38);
  background: linear-gradient(135deg, #fff, #f3edff);
  box-shadow: 0 4px 12px rgba(101, 76, 170, .13); transform: translateY(-1px);
}
.view-switch:focus-visible { outline: 3px solid rgba(139,92,246,.2); outline-offset: 2px; }
.view-switch-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 7px;
}
.view-switch svg {
  width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.view-switch .view-switch-arrow { width: 13px; height: 13px; color: #aaa1c3; transition: transform .15s, color .15s; }
.view-switch:hover .view-switch-arrow { color: currentColor; transform: translateX(2px); }
.mailbox-view-switch .view-switch-icon { color: #7457db; background: rgba(124,92,246,.12); }
.account-view-switch .view-switch-icon { color: #16865b; background: rgba(22,134,91,.11); }
.account-kind.gmail { color: #b42318; background: rgba(234,67,53,.1); border-color: rgba(234,67,53,.2); }

.gmail-mailbox-table .gmail-api-link {
  display: block; max-width: 340px; padding: 0; border: 0; background: transparent;
  color: var(--primary); font: inherit; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
}
.gmail-mailbox-table .switch-row.compact { min-height: 24px; margin: 0; }
.gmail-mailbox-table .switch-row.compact .switch-ui { margin: 0; }
.gmail-import-modal { width: min(680px, 94vw); }
.gmail-import-formats { display: grid; gap: 6px; margin: 14px 0; }
.gmail-import-formats code { display: block; overflow-wrap: anywhere; }

.page-command { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.page-command svg, .page-nav-link svg {
  width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.page-nav-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px;
  color: var(--text-3); font-size: 12.5px; font-weight: 500; text-decoration: none;
  transition: color .15s;
}
.page-nav-link:hover { color: var(--primary); }

.task-filter-bar {
  display: flex; align-items: center; gap: 10px; min-height: 46px; margin: 2px 0 10px;
}
.task-filter-search { position: relative; display: block; flex: 1 1 360px; max-width: 520px; }
.task-filter-search svg {
  position: absolute; z-index: 1; left: 12px; top: 50%; width: 16px; height: 16px;
  fill: none; stroke: var(--text-3); stroke-width: 1.8; stroke-linecap: round;
  stroke-linejoin: round; transform: translateY(-50%); pointer-events: none;
}
.task-filter-search .px-input { width: 100%; padding-left: 37px; }
.task-status-filter { min-width: 140px; }
.task-filter-bar .px-select { min-width: 140px; }
.task-filter-count { margin-left: auto; color: var(--text-3); font-size: 12px; white-space: nowrap; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
.px-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: #fff;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.dash-recent .px-table { box-shadow: none; }
.px-table th, .px-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid #edf1f7; }
.px-table th {
  background: #faf8ff; color: #7d739f; font-weight: 600;
  font-size: 12.5px;
}
.px-table td { color: var(--text-2); }
.px-table td:first-child { color: var(--text-3); }
.px-table tbody tr:last-child td { border-bottom: none; }
.px-table tbody tr { transition: background .12s; }
.px-table tbody tr:hover td { background: #faf8ff; }
.account-table { min-width: 1300px; }
.account-table .badge, .account-table .account-kind,
.account-table .credential-badge, .account-table .plan-toggle { white-space: nowrap; }

/* ===== 状态徽章 ===== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: 99px; font-size: 12px; font-weight: 500;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success  { color: var(--green);  background: rgba(22, 163, 74, .13); }
.badge.failed   { color: var(--red);    background: rgba(225, 29, 72, .12); }
.badge.unused   { color: var(--cyan);   background: rgba(8, 145, 178, .13); }
.badge.used     { color: var(--green);  background: rgba(22, 163, 74, .13); }
.badge.banned   { color: var(--red);    background: rgba(225, 29, 72, .12); }
.badge.credited { color: var(--green);  background: rgba(22, 163, 74, .13); }
.badge.invalid  { color: var(--red);    background: rgba(225, 29, 72, .12); }
.badge.account-normal, .badge.trial-eligible { color: #15803d; background: #ecfdf3; }
.badge.account-credential_invalid, .badge.account-deactivated { color: #b91c1c; background: #fef2f2; }
.badge.account-error, .badge.trial-error { color: #b45309; background: #fffbeb; }
.badge.account-unchecked, .badge.trial-unchecked, .badge.trial-not_eligible { color: #64748b; background: #f1f5f9; }
.trial-empty { color: var(--text-3); }

/* ===== 分页 ===== */
.pager { display: flex; align-items: center; gap: 6px; justify-content: center; margin: 18px 0; }
.pg-btn {
  min-width: 32px; height: 32px; padding: 0 8px; cursor: pointer;
  font-family: inherit; font-size: 13px; color: var(--text-2);
  background: #fff; border: 1px solid #d7deea; border-radius: 7px;
  transition: border-color .15s, color .15s, background .15s;
}
.pg-btn:hover:not([disabled]):not(.active) { border-color: var(--primary); color: var(--primary); }
.pg-btn.active {
  background: var(--primary);
  border-color: var(--primary); color: #fff; font-weight: 700; cursor: default;
}
.pg-btn[disabled] { opacity: .4; cursor: default; }
.pg-dots { color: var(--text-3); padding: 0 2px; font-size: 12px; letter-spacing: 1px; }

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(23, 32, 60, .4);
  display: flex; align-items: center; justify-content: center; z-index: 10;
}
.modal {
  width: 480px; max-width: 92vw; padding: 28px 32px 26px; max-height: 90vh; overflow-y: auto;
  background: #fff;
  border: 1px solid var(--glass-border); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(23, 43, 99, .2);
}
.modal h2 { margin: 0 0 22px; font-size: 18px; font-weight: 700; letter-spacing: .2px; }
.modal label {
  display: block; margin: 15px 0 7px; color: var(--text-2);
  font-size: 12.5px; font-weight: 600; letter-spacing: .3px;
}
.modal label:first-of-type { margin-top: 0; }
.modal .px-input { width: 100%; }
.modal .px-select { display: block; width: 100%; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }
.modal-actions .px-btn { padding: 0 22px; }

.app-dialog-mask { z-index: 1000; padding: 18px; }
.app-dialog {
  width: 430px; max-width: 100%; padding: 24px 26px 22px;
  border-radius: 10px; box-shadow: 0 24px 70px rgba(23, 43, 99, .24);
}
.app-dialog-head { display: flex; align-items: flex-start; gap: 14px; }
.app-dialog-head > div { min-width: 0; flex: 1; }
.app-dialog-head h2 { margin: 1px 0 7px; font-size: 17px; letter-spacing: 0; }
.app-dialog-head p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.app-dialog-icon {
  display: inline-flex; width: 38px; height: 38px; flex: 0 0 38px; align-items: center; justify-content: center;
  color: var(--primary); background: rgba(79, 110, 247, .1); border-radius: 8px;
}
.app-dialog-icon svg { width: 20px; height: 20px; }
.app-dialog.danger .app-dialog-icon { color: var(--red); background: rgba(225, 29, 72, .1); }
.app-dialog-icon.export { color: #16866f; background: rgba(22, 134, 111, .1); }
.app-dialog .modal-actions { margin-top: 22px; }
.rt-export-dialog { width: 460px; }
.rt-format-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.rt-format-option {
  display: flex !important; align-items: center; gap: 10px; min-height: 62px; margin: 0 !important; padding: 11px 13px;
  border: 1px solid #dce2ec; border-radius: 8px; background: #fff; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.rt-format-option:has(input:checked) { border-color: var(--primary); background: rgba(79, 110, 247, .045); }
.rt-format-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.rt-format-option > span { display: flex; flex-direction: column; gap: 2px; }
.totp-rebind-dialog { width: 470px; }
.totp-rebind-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.totp-rebind-modes label {
  display: block; min-width: 0; margin: 0 !important; padding: 0;
  border: 1px solid #dce2ec; border-radius: 8px; background: #fff; cursor: pointer;
}
.totp-rebind-modes label:has(input:checked) { border-color: var(--primary); background: rgba(79, 110, 247, .045); }
.totp-rebind-modes input { position: absolute; opacity: 0; pointer-events: none; }
.totp-rebind-modes label > span { display: flex; min-height: 86px; flex-direction: column; justify-content: center; padding: 13px; }
.totp-rebind-modes strong { color: var(--text-1); font-size: 13px; }
.totp-rebind-modes small { margin-top: 5px; color: var(--text-3); font-size: 11px; font-weight: 400; line-height: 1.5; }
.totp-rebind-modes input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: -2px; border-radius: 7px; }
@media (max-width: 520px) { .totp-rebind-modes { grid-template-columns: 1fr; } }
.rt-format-option strong { color: var(--text); font-size: 13px; }
.rt-format-option small { color: var(--text-3); font-size: 11px; text-transform: lowercase; }
.account-export-dialog { width: 470px; }
.account-export-options { display: grid; gap: 9px; margin-top: 20px; }
.account-export-option {
  display: flex !important; align-items: center; gap: 11px; min-height: 58px; margin: 0 !important; padding: 10px 13px;
  border: 1px solid #dce2ec; border-radius: 8px; background: #fff; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.account-export-option:has(input:checked) { border-color: var(--primary); background: rgba(79, 110, 247, .045); }
.account-export-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.account-export-option > span { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.account-export-option strong { color: var(--text); font-size: 13px; }
.account-export-option small { color: var(--text-3); font-size: 11px; white-space: nowrap; }
.account-export-option b { color: var(--text-2); font-weight: 700; }
.account-export-note { margin: 12px 0 0; color: var(--text-2); font-size: 12px; line-height: 1.6; }
.totp-secret-dialog { width: min(590px, calc(100vw - 32px)); }
.totp-secret-fields { display: grid; gap: 13px; margin-top: 20px; }
.totp-secret-fields label { margin: 0 !important; }
.totp-secret-fields label > span { display: block; margin-bottom: 6px; }
.totp-secret-fields label > div { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 8px; align-items: start; }
.totp-secret-fields .icon-btn { width: 38px; height: 38px; margin: 0; border: 1px solid var(--glass-border); border-radius: 6px; color: var(--text-2); }
.totp-secret-fields .icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.totp-secret-fields textarea { min-height: 70px; resize: vertical; overflow-wrap: anywhere; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.totp-secret-fields input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.totp-secret-fields .totp-code { font-size: 20px; font-weight: 700; letter-spacing: 0; }
#account-export-totp-scope { gap: 9px; }
#account-export-totp-scope .account-export-note { margin: 2px 0 0; }
.app-dialog-error { min-height: 18px; margin-top: 8px; color: var(--red); font-size: 12px; }
.gcash-token-result-dialog { width: min(680px, calc(100vw - 32px)); }
.gcash-token-result-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; margin-top: 20px; align-items: start; }
.gcash-token-result-body img { width: 220px; height: 220px; border: 1px solid var(--border); background: #fff; }
.gcash-token-result-data { min-width: 0; }
.gcash-token-result-data > label { display: block; margin-bottom: 8px; color: var(--text-2); font-size: 12px; }
.gcash-token-result-data textarea { width: 100%; min-height: 126px; resize: none; overflow-wrap: anywhere; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.gcash-token-result-downloads { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.gcash-token-result-downloads .px-btn { text-decoration: none; }
@media (max-width: 620px) {
  .gcash-token-result-body { grid-template-columns: 1fr; }
  .gcash-token-result-body img { width: min(220px, 100%); height: auto; aspect-ratio: 1; justify-self: center; }
}

@media (max-width: 480px) {
  .app-dialog { padding: 21px 19px 18px; }
  .rt-format-list { grid-template-columns: 1fr; }
  .app-dialog .modal-actions .px-btn { flex: 1; }
}

.import-sub { margin: -14px 0 14px; font-size: 12.5px; color: var(--text-3); }
.import-sub code, .import-formats code {
  font-family: Consolas, Menlo, monospace; font-size: 12px;
  color: var(--primary); background: rgba(79, 110, 247, .1);
  padding: 1px 7px; border-radius: 6px;
}
.import-formats {
  display: flex; flex-direction: column; gap: 7px; align-items: flex-start;
  margin: 0 0 14px; padding: 13px 15px; border-radius: 10px;
  background: #f7f9fc; border: 1px solid #edf1f7;
}
.import-textarea {
  font-family: Consolas, Menlo, monospace; font-size: 12.5px; line-height: 1.7;
  resize: none;
}
.import-count { margin-right: auto; font-size: 12.5px; color: var(--text-3); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; margin-right: 2px;
  border: none; border-radius: 9px; cursor: pointer;
  color: var(--text-3); background: transparent;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(79, 110, 247, .12); color: #4f6ef7; }
.icon-btn.danger:hover { background: rgba(240, 80, 90, .12); color: #f0505a; }
.icon-btn:disabled { opacity: .28; cursor: default; pointer-events: none; }
.icon-btn.is-loading svg { animation: icon-btn-spin .8s linear infinite; }
@keyframes icon-btn-spin { to { transform: rotate(360deg); } }
.account-actions { white-space: nowrap; min-width: 182px; }
.email-copy { display: flex; align-items: center; gap: 5px; min-width: 220px; }
.email-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-copy-btn { flex: 0 0 28px; width: 28px; height: 28px; margin: 0; }
.paylink-account-identity { display: flex; align-items: center; gap: 8px; min-width: 290px; }
.paylink-account-identity .email-copy { flex: 1 1 auto; min-width: 0; }
.paylink-plan-stack { flex: 0 0 50px; display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.paylink-account-identity .plan-toggle { width: 100%; }
.checkout-type {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 17px; padding: 1px 5px; border: 1px solid transparent; border-radius: 4px;
  font-size: 10px; font-weight: 700; line-height: 1.2;
}
.checkout-type.oaics { color: #075985; background: #e0f2fe; border-color: #bae6fd; }
.checkout-type.cs { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.account-kind {
  display: inline-flex; align-items: center; min-width: 40px; justify-content: center;
  padding: 3px 8px; border-radius: 5px; font-size: 12px; font-weight: 600;
}
.account-kind.mother { color: #2563eb; background: rgba(37, 99, 235, .1); }
.account-kind.fission { color: #7c3aed; background: rgba(124, 58, 237, .1); }
.account-kind.icloud { color: #0e7490; background: rgba(8, 145, 178, .11); }
.plan-toggle {
  min-width: 50px; height: 27px; padding: 0 9px;
  border: 1px solid transparent; border-radius: 5px; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 700;
  transition: background .15s, border-color .15s, color .15s;
}
.plan-toggle.free { color: #64748b; background: #f1f5f9; border-color: #dbe3ec; }
.plan-toggle.free:hover { color: #2563eb; background: #eff6ff; border-color: #bfdbfe; }
.plan-toggle.plus { color: #15803d; background: #ecfdf3; border-color: #bbf7d0; }
.plan-toggle.plus:hover { color: #166534; background: #dcfce7; border-color: #86efac; }
.plan-toggle:disabled { opacity: .55; cursor: wait; }
.plan-empty { color: var(--text-3); }

.col-check { width: 46px; text-align: center; padding-left: 16px; }
.col-check input {
  -webkit-appearance: none; appearance: none; margin: 0;
  width: 18px; height: 18px; cursor: pointer; vertical-align: middle;
  border: 1.5px solid #c3cddf; border-radius: 5px;
  background: #fff;
  transition: all .15s; position: relative;
}
.col-check input:hover { border-color: var(--primary); }
.col-check input:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.col-check input:checked::after {
  content: ''; position: absolute; left: 5px; top: 1.5px;
  width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.px-table tr.row-sel td { background: var(--primary-soft); }

.provider-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.6;
  color: #2563eb; background: rgba(79, 110, 247, .12);
  border: 1px solid rgba(79, 110, 247, .18);
}
.provider-tag::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #4f6ef7;
}

.batch-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; padding: 10px 12px 10px 18px;
  background: var(--primary-soft);
  border: 1px solid #d4e0f7;
  border-radius: 10px;
  animation: batch-in .18s ease;
}
@keyframes batch-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.batch-bar #mb-batch-count, .batch-bar #acc-batch-count {
  margin-right: auto; font-weight: 600; font-size: 13.5px; color: var(--primary);
  display: inline-flex; align-items: center; gap: 7px;
}
.batch-bar #mb-batch-count::before, .batch-bar #acc-batch-count::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
}
.batch-bar .px-btn {
  height: 32px; padding: 0 16px; border: 0; border-radius: 8px; font-size: 13px; font-weight: 500;
}
.batch-bar .px-btn:not(.primary):not(.danger):not(.ghost) {
  background: var(--primary);
  color: #fff;
}
.batch-bar .px-btn:not(.primary):not(.danger):not(.ghost):hover {
  filter: brightness(1.06); color: #fff;
}
.batch-bar .px-btn.danger {
  background: rgba(240, 80, 90, .12); color: #e11d48; box-shadow: none;
}
.batch-bar .px-btn.danger:hover { background: rgba(240, 80, 90, .2); color: #e11d48; }
.batch-bar .px-btn.ghost {
  background: transparent; color: var(--text-3); box-shadow: none;
}
.batch-bar .px-btn.ghost:hover { background: rgba(120, 130, 160, .14); color: var(--text-2); }
.px-btn.ghost { background: transparent; color: var(--text-2); }
.import-textarea.drag {
  background: rgba(79, 110, 247, .08);
  box-shadow: 0 0 0 3.5px rgba(79, 110, 247, .2);
}

/* ===== Toast ===== */
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: #fff;
  border: 1px solid rgba(22, 163, 74, .4); color: var(--green);
  padding: 11px 22px; border-radius: 10px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(23, 43, 99, .15); z-index: 20;
}
.toast.err { border-color: rgba(225, 29, 72, .4); color: var(--red); }

/* ===== 邮箱七态徽章 ===== */
.badge.unverified      { color: var(--amber);  background: rgba(217, 119, 6, .13); }
.badge.verifying       { color: var(--cyan);   background: rgba(8, 145, 178, .13); }
.badge.verify_failed   { color: var(--red);    background: rgba(225, 29, 72, .12); }
.badge.verified        { color: var(--green);  background: rgba(22, 163, 74, .13); }

/* ===== 账户生产态徽章 ===== */
.badge.pending         { color: var(--amber);  background: rgba(217, 119, 6, .13); }
.badge.registering     { color: var(--cyan);   background: rgba(8, 145, 178, .13); }
.badge.registered      { color: var(--green);  background: rgba(22, 163, 74, .13); }
.badge.register_failed { color: var(--red);    background: rgba(225, 29, 72, .12); }
.badge.already_registered { color: var(--amber); background: rgba(217, 119, 6, .13); }
.badge.alive-alive { color: var(--green); background: rgba(22, 163, 74, .13); }
.badge.alive-dead { color: var(--red); background: rgba(225, 29, 72, .12); }
.badge.alive-forbidden { color: var(--amber); background: rgba(217, 119, 6, .13); }
.badge.alive-retry, .badge.alive-unknown { color: var(--cyan); background: rgba(8, 145, 178, .13); }
.badge.push-not_pushed { color: var(--text-3); background: rgba(120, 130, 160, .12); }
.badge.push-pushed { color: var(--green); background: rgba(22, 163, 74, .13); }
.badge.push-push_failed { color: var(--red); background: rgba(225, 29, 72, .12); }
.badge.alive-alive small, .badge.alive-dead small, .badge.alive-forbidden small,
.badge.alive-retry small, .badge.alive-unknown small { display: block; margin-top: 2px; font-size: 9px; opacity: .75; }

/* ===== 生产进度条 ===== */
.produce-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 18px; margin-bottom: 16px; border-radius: 14px;
  background: var(--panel, #fff); border: 1px solid var(--border, #e6e8ef);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.produce-stat { display: flex; align-items: baseline; gap: 6px; }
.produce-num { font-size: 22px; font-weight: 700; color: var(--text-1, #1f2430); line-height: 1; }
.produce-num.running { color: var(--cyan); }
.produce-num.ok { color: var(--green); }
.produce-num.bad { color: var(--red); }
.produce-lbl { font-size: 13px; color: var(--text-3, #8a90a2); }
.produce-dot { color: var(--text-3, #c4c9d6); font-weight: 700; }
.produce-msg { flex: 1; min-width: 120px; font-size: 12.5px; color: var(--text-3, #8a90a2); }
.produce-actions { display: flex; gap: 8px; margin-left: auto; }

/* ===== 生产数量输入 ===== */
.produce-modal { width: min(680px, 94vw); padding: 28px 32px 24px; }
.produce-field { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.produce-field > span { font-size: 13.5px; color: var(--text-2, #4a5266); font-weight: 500; }
.produce-field > small { color: var(--text-3); line-height: 1.45; }
.produce-provider-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.produce-provider-heading > span:first-child { color: var(--text-2, #4a5266); font-size: 13.5px; font-weight: 500; }
.produce-provider-count {
  flex: 0 0 auto; padding: 3px 8px; border-radius: 6px;
  color: var(--primary); background: rgba(64,105,225,.08); font-size: 11.5px; font-weight: 650;
}
.provider-check-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  min-height: 56px; padding: 10px; border: 1px solid var(--glass-border);
  border-radius: 8px; background: #f8fafc;
}
.modal .provider-check-option {
  display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px;
  margin: 0; padding: 9px 12px; border: 1px solid #dce3ee; border-radius: 6px;
  background: #fff; color: var(--text-2); font-size: 12.5px; font-weight: 600;
  letter-spacing: 0; cursor: pointer; transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.modal .provider-check-option:hover { border-color: #bdc9df; background: #fbfcff; }
.modal .provider-check-option:has(input:checked) { border-color: var(--primary); color: var(--primary); background: rgba(64,105,225,.07); }
.provider-check-option input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.provider-check-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-check-empty { grid-column: 1 / -1; align-self: center; padding: 8px 4px; color: var(--text-3); font-size: 12px; }
#produce-headed-field .switch-row,
#produce-totp-field .switch-row,
#produce-oaics-field .switch-row,
#icloud-concurrent-family-field .switch-row {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; min-width: 0;
  margin: 0; letter-spacing: 0;
}
#produce-headed-field .switch-ui,
#produce-totp-field .switch-ui,
#produce-oaics-field .switch-ui,
#icloud-concurrent-family-field .switch-ui {
  flex: 0 0 40px; width: 40px; height: 22px; margin-top: 1px;
}
#produce-headed-field .switch-label,
#produce-totp-field .switch-label,
#produce-oaics-field .switch-label,
#icloud-concurrent-family-field .switch-label {
  min-width: 0; flex: 1 1 auto; line-height: 1.45; overflow-wrap: anywhere;
}
#produce-oaics-field .switch-row + small { margin-bottom: 2px; }
.produce-scope-segment,
.produce-mode-segment {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border: 1px solid var(--glass-border); border-radius: 6px; overflow: hidden;
  background: #f7f8fb;
}
.produce-scope-segment label,
.produce-mode-segment label {
  display: block; min-width: 0; height: 100%; margin: 0;
  cursor: pointer; letter-spacing: 0;
}
.produce-scope-segment label + label,
.produce-mode-segment label + label { border-left: 1px solid var(--glass-border); }
.produce-scope-segment input,
.produce-mode-segment input { position: absolute; opacity: 0; pointer-events: none; }
.produce-scope-segment span,
.produce-mode-segment span {
  display: grid; place-items: center; min-height: 42px; height: 100%; padding: 6px 10px;
  color: var(--text-2); font-size: 12.5px; line-height: 1.3; text-align: center;
}
.produce-scope-segment input:checked + span,
.produce-mode-segment input:checked + span { color: #fff; background: var(--primary); font-weight: 650; }
.produce-scope-segment input:focus-visible + span,
.produce-mode-segment input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: -2px; }
.produce-mode-segment input:disabled + span { cursor: not-allowed; opacity: .62; }

/* ===== 日志弹窗 ===== */
.log-body {
  max-height: 60vh; overflow: auto; margin: 12px 0 0;
  padding: 14px 16px; border-radius: 10px;
  background: #0f1420; color: #d6dbe6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-all;
}
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ===== 浏览器下载横幅 ===== */
.browser-banner {
  background: linear-gradient(90deg, #eef2ff, #f5f3ff);
  border: 1px solid #dfe3ff; border-radius: 12px;
  padding: 14px 18px; margin-bottom: 18px;
}
.browser-banner.err { background: #fef2f2; border-color: #fecaca; }
.bb-row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #4338ca; font-weight: 600; }
.browser-banner.err .bb-row { color: #b91c1c; }
.bb-ico { font-size: 16px; }
.bb-msg { flex: 1; }
.bb-pct { font-variant-numeric: tabular-nums; }
.bb-progress { height: 8px; border-radius: 999px; background: #e0e3f5; overflow: hidden; margin-top: 10px; }
.bb-progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #818cf8); transition: width .4s ease; }
.browser-banner.err .bb-progress { display: none; }

/* ===== 仪表盘 ===== */
.dash-panel-title, .dash-produce h2, .dash-grid .px-panel h2, .dash-recent h2 {
  margin: 0 0 16px; font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: .2px;
}

/* 生产任务 */
.dash-produce { padding: 20px 22px; margin-bottom: 16px; }
.dash-produce-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.dash-produce-head h2 { margin: 0; }
.dash-produce-state {
  font-size: 12px; font-weight: 600; padding: 4px 13px; border-radius: 999px;
  color: var(--text-3); background: rgba(138, 144, 162, .12);
}
.dash-produce-state.on { color: var(--green); background: rgba(22, 163, 74, .14); }
.dash-produce-body { display: flex; align-items: center; gap: 24px; }
@media (max-width: 760px) { .dash-produce-body { flex-direction: column; align-items: stretch; gap: 16px; } }

.dp-main { flex: 0 0 auto; text-align: center; padding-right: 22px; border-right: 1px solid var(--glass-border); }
.dp-main-num { display: flex; align-items: baseline; gap: 4px; justify-content: center; }
.dp-main-num b { font-size: 34px; font-weight: 800; color: var(--green); letter-spacing: -1px; line-height: 1; }
.dp-main-num i { font-size: 18px; font-style: normal; color: var(--text-3); }
.dp-main-lbl { margin-top: 6px; font-size: 12px; color: var(--text-3); }

.dash-progress-wrap { flex: 1; min-width: 0; }
.dash-progress { height: 10px; border-radius: 999px; background: #eef0f5; overflow: hidden; }
.dash-progress-bar { height: 100%; border-radius: 999px; transition: width .5s ease; background: linear-gradient(90deg, #16a34a, #34d399); }
.dash-produce-msg { margin-top: 10px; font-size: 12.5px; color: var(--text-3); min-height: 16px; }

.dp-pills { display: flex; gap: 10px; flex: 0 0 auto; }
.dp-pill {
  min-width: 66px; padding: 10px 12px; border-radius: 12px; text-align: center;
  background: #f6f7fb; border: 1px solid var(--glass-border);
}
.dp-pill b { display: block; font-size: 20px; font-weight: 700; line-height: 1.1; }
.dp-pill span { font-size: 11px; color: var(--text-3); }
.dp-pill.amber b { color: var(--amber); }
.dp-pill.amber { background: rgba(217, 119, 6, .07); border-color: rgba(217, 119, 6, .18); }
.dp-pill.cyan b { color: var(--cyan); }
.dp-pill.cyan { background: rgba(8, 145, 178, .07); border-color: rgba(8, 145, 178, .18); }
.dp-pill.red b { color: var(--red); }
.dp-pill.red { background: rgba(225, 29, 72, .06); border-color: rgba(225, 29, 72, .16); }

.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
@media (max-width: 980px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-grid .px-panel { padding: 20px 22px; }

/* 环形图 */
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut {
  width: 132px; height: 132px; border-radius: 50%; flex: 0 0 auto;
  background: conic-gradient(#eef0f5 0 100%); display: grid; place-items: center;
}
.donut-hole { width: 90px; height: 90px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; box-shadow: inset 0 0 0 1px #f0f2f7; }
.donut-total { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.donut-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.lg-item { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); }
.lg-dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.lg-item b { margin-left: auto; color: var(--text); font-weight: 600; }
.lg-pct { color: var(--text-3); width: 36px; text-align: right; font-size: 12px; }

/* 柱状图 */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; }
.bar-val { font-size: 12px; font-weight: 700; color: var(--text-2); }
.bar { width: 66%; max-width: 32px; border-radius: 7px 7px 0 0; background: linear-gradient(180deg, #818cf8, #6366f1); min-height: 4px; transition: height .4s ease; }
.bar-lbl { font-size: 11px; color: var(--text-3); }

/* 小列表 */
.mini-rows { display: flex; flex-direction: column; }
.mini-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 2px; border-bottom: 1px solid #f0f2f7; font-size: 13.5px; color: var(--text-2); }
.mini-row:last-child { border-bottom: none; }
.mini-row b { color: var(--text); font-weight: 700; }
.mini-title { font-size: 12.5px; color: var(--text-3); margin: 18px 0 4px; font-weight: 700; letter-spacing: .3px; }
.mini-empty { font-size: 13px; color: var(--text-3); padding: 10px 2px; }
.dash-recent .px-table { margin-top: 2px; }
/* ===== 登录页 ===== */
.login-body {
  display: block; overflow: hidden; position: relative;
  background: radial-gradient(1200px 600px at 15% -10%, #efeaff 0%, transparent 55%),
              radial-gradient(1000px 620px at 100% 110%, #e6f0ff 0%, transparent 55%),
              linear-gradient(160deg, #f7f5ff 0%, #f1f4fb 50%, #eef4ff 100%);
}
/* 背景柔光装饰 */
.login-body::before, .login-body::after {
  content: ""; position: fixed; border-radius: 50%; filter: blur(20px);
  pointer-events: none; z-index: 0;
}
.login-body::before {
  width: 420px; height: 420px; top: -120px; left: -120px;
  background: radial-gradient(circle, rgba(124, 108, 246, .28), transparent 70%);
}
.login-body::after {
  width: 460px; height: 460px; right: -140px; bottom: -160px;
  background: radial-gradient(circle, rgba(8, 145, 178, .20), transparent 70%);
}
.login-wrap {
  position: relative; z-index: 1;
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px;
}
.login-card {
  width: 400px; max-width: 92vw;
  padding: 40px 40px 36px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 20px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset,
              0 18px 48px rgba(79, 70, 160, .16),
              0 6px 16px rgba(79, 70, 160, .08);
}
.login-head {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 14px; padding-bottom: 26px;
}
.login-logo {
  width: 58px; height: 58px; border-radius: 16px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; color: #fff; letter-spacing: .5px;
  background: linear-gradient(135deg, #8b7bff 0%, #6553e8 100%);
  box-shadow: 0 10px 22px rgba(101, 83, 232, .38);
}
.login-title { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: .2px; }
.login-desc { margin-top: 5px; font-size: 13px; color: var(--text-3); }
.login-form { margin-top: 4px; text-align: left; }
.login-label {
  display: block; margin: 0 0 8px; color: var(--text-2);
  font-size: 13px; font-weight: 600;
}
.login-input {
  width: 100%; height: 46px; font-size: 14px;
  border-radius: 12px; background: #fff;
}
.login-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(124, 108, 246, .18);
}
.login-btn {
  width: 100%; margin-top: 24px; padding: 13px 0; font-size: 15px; font-weight: 600;
  color: #fff; border: none; border-radius: 12px; cursor: pointer;
  font-family: inherit; letter-spacing: .5px;
  background: linear-gradient(135deg, #8b7bff 0%, #6553e8 100%);
  box-shadow: 0 10px 24px rgba(101, 83, 232, .32);
  transition: transform .12s ease, box-shadow .18s ease, filter .18s ease;
}
.login-btn:hover { filter: brightness(1.05); box-shadow: 0 14px 30px rgba(101, 83, 232, .42); transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); box-shadow: 0 6px 16px rgba(101, 83, 232, .3); }
.login-copyright { color: var(--text-3); font-size: 12px; }
.login-hint { margin-top: 20px; color: var(--text-3); font-size: 12px; }

/* ===== 侧边栏退出 ===== */
.logout-item { margin-top: auto; }

/* ===== 系统设置页 ===== */
.page-sub { margin: -6px 0 22px; color: var(--text-3); font-size: 13.5px; }
.settings-grid { display: flex; flex-direction: column; gap: 20px; }
.settings-card { padding: 24px 26px 20px; }
.settings-head { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; }
.settings-head h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--text-1); }
.settings-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-3); }
.settings-icon {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.settings-icon svg { width: 20px; height: 20px; }
.settings-icon.blue { background: var(--primary); }
.settings-icon.violet { background: #8b5cf6; }
.settings-icon.amber { background: #f59e0b; }
.settings-icon.cyan { background: #0891b2; }
.settings-icon.green { background: #16865b; }

.field { margin-bottom: 16px; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.field-label-row > label { margin-bottom: 0; }
.count-badge {
  font-size: 11.5px; font-weight: 600; color: var(--primary); line-height: 1;
  background: rgba(79, 110, 247, .1); padding: 5px 10px; border-radius: 999px;
}
.field > label { display: block; margin-bottom: 6px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.field-hint { display: block; margin: -2px 0 9px; color: var(--text-3); font-size: 11.5px; line-height: 1.5; }
.settings-card .px-input { width: 100%; }
.settings-card textarea.px-input { resize: none; font-family: inherit; line-height: 1.6; }
.proxy-textarea { font-weight: 700; font-size: 12.5px; }
.input-suffix { position: relative; }
.input-suffix .suffix {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-size: 13px; pointer-events: none;
}
.input-suffix .px-input { padding-right: 34px; }

.settings-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* 自定义开关 */
.switch-row {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  margin-bottom: 18px; user-select: none;
}
.switch-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-ui {
  position: relative; width: 40px; height: 22px; border-radius: 999px;
  background: rgba(120,130,160,.28); transition: background .2s ease; flex: none;
}
.switch-ui::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.2);
  transition: transform .2s ease;
}
.switch-row input:checked + .switch-ui { background: var(--primary); }
.switch-row input:checked + .switch-ui::after { transform: translateX(18px); }
.switch-label { font-size: 13.5px; color: var(--text-2); font-weight: 500; }
/* 表格出库列：开关垂直/水平居中 */
.ship-cell { text-align: center; }
.ship-cell .switch-row { margin-bottom: 0; vertical-align: middle; }

/* 代理测试结果 */
.proxy-result {
  display: flex; align-items: center; gap: 8px;
  margin-top: 4px; padding: 10px 14px; border-radius: 10px; font-size: 13px;
}
.proxy-result.testing { background: rgba(120,130,160,.1); color: var(--text-2); }
.proxy-result.ok { background: rgba(34,197,94,.12); color: #16a34a; }
.proxy-result.ok b { color: #15803d; }
.proxy-result.fail { background: rgba(240,80,90,.1); color: #e11d48; word-break: break-all; }
.proxy-result .spinner {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  border: 2px solid rgba(120,130,160,.3); border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .layout { display: block; }
  .sidebar, .sidebar.px-panel {
    position: relative; top: auto; width: 100%; height: auto;
    padding: 8px 10px 10px; border-right: 0; border-bottom: 1px solid #ece7fa;
  }
  .logo { margin: 0 44px 6px 0; padding: 4px 4px 9px; }
  .logo-icon { width: 32px; height: 32px; border-radius: 8px; font-size: 14px; }
  .logo-text { font-size: 14px; }
  .logo-version { font-size: 10px; }
  .menu-group { display: none; }
  #menu { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  #menu .menu-item {
    justify-content: center; gap: 4px; min-width: 0; padding: 6px 2px;
    border-radius: 8px; font-size: 10px; white-space: normal; line-height: 1.15;
  }
  #menu .menu-item svg { width: 25px; height: 25px; padding: 6px; border-radius: 7px; }
  .menu-item.active::after { display: none; }
  .logout-item {
    position: absolute; top: 10px; right: 10px; width: 34px; height: 34px;
    margin: 0; padding: 2px; justify-content: center; font-size: 0;
  }
  .logout-item svg { width: 28px; height: 28px; padding: 6px; }
  .main { width: 100%; padding: 18px 12px 24px; }
  .page-title { margin-bottom: 16px; }
  .produce-bar { gap: 10px; padding: 12px 14px; }
  .produce-num { font-size: 19px; }
  .produce-dot { display: none; }
  .toolbar .search { min-width: 100%; }
  .batch-bar { flex-wrap: wrap; padding: 12px; }
  .batch-bar #mb-batch-count, .batch-bar #acc-batch-count {
    order: -1; width: 100%; margin-right: 0;
  }
  .batch-bar .px-btn {
    flex: 1 1 calc(50% - 5px); min-width: 120px; padding: 0 10px; white-space: nowrap;
  }
  .produce-modal-actions {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .produce-modal-actions .px-btn { width: 100%; padding: 0 10px; }
  .produce-modal-actions .produce-push-btn { grid-column: 1 / -1; grid-row: 1; }
  .produce-modal-actions .produce-cancel { grid-column: 1; grid-row: 2; }
  .produce-modal-actions .produce-start { grid-column: 2; grid-row: 2; }
  .table-wrap { width: 100%; overflow-x: auto; }
  .px-table { min-width: 900px; }
  .settings-card { padding: 20px 18px 18px; }
}

@media (max-width: 560px) {
  .produce-modal { width: calc(100vw - 24px); max-width: none; padding: 24px 18px 20px; }
  .provider-check-grid { grid-template-columns: 1fr; }
}

/* ===== 取件弹窗 ===== */
.mail-modal {
  width: 980px; max-width: 96vw; height: 660px; max-height: 92vh;
  display: flex; flex-direction: column; padding: 0; overflow: hidden;
  background: #fff;
}
.mail-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px;
  background: #fff; border-bottom: 1px solid var(--glass-border);
  color: var(--text);
}
.mail-head h2 { margin: 0; font-size: 16px; color: var(--text); }
.mail-sub { color: var(--text-3); font-size: 12px; margin-top: 3px; }
.mail-body { flex: 1; display: flex; min-height: 0; }
.mail-list {
  width: 310px; flex-shrink: 0; overflow-y: auto;
  scrollbar-width: none;
  border-right: 1px solid rgba(31, 38, 90, .08);
  background: #f6f7fb; padding: 10px;
}
.mail-list::-webkit-scrollbar { width: 0; height: 0; }
.mail-item {
  padding: 11px 13px; border-radius: 10px; cursor: pointer; margin-bottom: 7px;
  background: #fff; border: 1px solid rgba(31, 38, 90, .07);
  box-shadow: 0 1px 3px rgba(31, 38, 90, .05);
  transition: border-color .15s, box-shadow .15s;
}
.mail-item:hover { border-color: rgba(79, 110, 247, .4); }
.mail-item.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.mail-item-from { font-weight: 600; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item-subject { font-size: 12px; color: var(--text-2); margin: 3px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item-time { font-size: 11px; color: var(--text-3); }
.mail-otp {
  display: inline-block; padding: 1px 7px; border-radius: 6px;
  background: rgba(22, 163, 74, .12); color: var(--green); font-weight: 700;
}
.mail-empty { color: var(--text-3); font-size: 13px; text-align: center; padding: 34px 10px; }
.mail-empty.err { color: var(--red); }
.mail-detail { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #fff; }
.mail-meta { padding: 14px 20px; border-bottom: 1px solid rgba(31, 38, 90, .08); background: #fbfcfe; }
.mail-meta:empty { display: none; }
.mail-subject { font-weight: 700; font-size: 15px; color: var(--text); }
.mail-from { font-size: 12px; color: var(--text-2); margin-top: 5px; }
.mail-time { font-size: 11px; color: var(--text-3); margin-top: 2px; }
#mail-frame, #account-mail-frame, #icloud-mail-frame {
  display: block; flex: 1; min-height: 0; width: 100%; border: 0; background: #fff;
}

@media (max-width: 760px) {
  .mail-modal { width: 96vw; height: 86vh; }
  .mail-head { padding: 12px 14px; }
  .mail-body { flex-direction: column; }
  .mail-list {
    width: 100%; height: 34%; flex: 0 0 34%;
    border-right: 0; border-bottom: 1px solid rgba(31, 38, 90, .08);
  }
  .mail-detail { min-height: 0; }
}

/* ===== 模式2：自动接码 OAuth ===== */
.credential-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 24px; padding: 0 9px; border-radius: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: 0;
}
.credential-badge.at { color: #9a6700; background: #fff4cc; border: 1px solid #f0d678; }
.credential-badge.rt { color: #087443; background: #dff7ea; border: 1px solid #9dd9ba; }
.credential-stack { display: inline-grid; justify-items: center; gap: 3px; }
.credential-stack small { color: var(--text-3); font-size: 10px; white-space: nowrap; }
.mode2-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 18px; }
.mode2-title-row .page-title { margin-bottom: 4px; }
.mode2-run-meta { display: flex; align-items: center; gap: 7px; min-height: 19px; color: var(--text-3); font-size: 12px; }
.mode2-run-meta::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: #98a2b3; }
.mode2-run-meta[data-status="ready"]::before,
.mode2-run-meta[data-status="paused"]::before,
.mode2-run-meta[data-status="recoverable"]::before { background: #8b5cf6; }
.mode2-run-meta[data-status="queued"]::before,
.mode2-run-meta[data-status="running"]::before { background: var(--cyan); }
.mode2-run-meta[data-status="completed"]::before { background: var(--green); }
.mode2-run-meta[data-status="failed"]::before,
.mode2-run-meta[data-status="stopped"]::before,
.mode2-run-meta[data-status="canceled"]::before { background: var(--red); }
.mode2-title-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.mode2-config-workspace {
  margin-bottom: 18px; padding: 15px 0 13px;
  border-top: 1px solid rgba(31,38,90,.1); border-bottom: 1px solid rgba(31,38,90,.1);
}
.mode2-config-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.mode2-config-heading { display: flex; align-items: center; gap: 9px; }
.mode2-config-heading h2 { margin: 0; color: var(--text-1); font-size: 15px; line-height: 1.3; }
.mode2-config-state {
  padding: 2px 7px; border: 1px solid rgba(31,38,90,.1); border-radius: 5px;
  color: var(--text-3); background: rgba(255,255,255,.55); font-size: 11px;
}
.mode2-config-state.dirty { color: #9a6700; border-color: rgba(217,119,6,.28); background: rgba(217,119,6,.07); }
.mode2-config-state.saved { color: #087443; border-color: rgba(8,116,67,.22); background: rgba(8,116,67,.07); }
.mode2-infra-link { display: inline-block; margin-top: 4px; color: var(--text-3); font-size: 11.5px; text-decoration: none; }
.mode2-infra-link.ready { color: #087443; }
.mode2-infra-link.pending { color: #b45309; }
.mode2-config-toggles { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px 18px; }
.mode2-inline-switch { margin: 0; }
.mode2-inline-switch .switch-label { font-size: 12.5px; }
.mode2-config-grid {
  display: grid; grid-template-columns: repeat(2,minmax(180px,1.2fr)) repeat(3,minmax(105px,.7fr)) minmax(220px,1.35fr);
  gap: 12px; align-items: start;
}
.mode2-config-grid .field { min-width: 0; margin: 0; }
.mode2-config-grid .px-input { width: 100%; }
.mode2-config-grid .px-select { display: block; width: 100%; }
.mode2-country-summary { display: flex; align-items: center; min-width: 0; gap: 0; margin-top: 6px; color: var(--text-3); font-size: 10.5px; }
.mode2-country-summary strong { max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-weight: 600; }
.mode2-country-summary span { margin-left: 8px; padding-left: 8px; border-left: 1px solid rgba(31,38,90,.12); white-space: nowrap; }
.mode2-price-range { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 8px; }
.mode2-price-range span { color: var(--text-3); font-size: 12px; }
.mode2-config-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; margin-top: 12px; padding-top: 11px; border-top: 1px solid rgba(31,38,90,.07); }
.mode2-config-lock { color: var(--text-3); font-size: 11.5px; }
.mode2-run-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.mode2-task-control:disabled { opacity: .55; cursor: not-allowed; }
.mode2-stats {
  display: grid; grid-template-columns: repeat(4, minmax(110px, 1fr));
  border-top: 1px solid rgba(31,38,90,.1); border-bottom: 1px solid rgba(31,38,90,.1);
  margin-bottom: 18px; background: rgba(255,255,255,.45);
}
.mode2-stat { min-width: 0; padding: 15px 18px; border-right: 1px solid rgba(31,38,90,.08); }
.mode2-stat:nth-child(4n) { border-right: 0; }
.mode2-stat:nth-child(-n+4) { border-bottom: 1px solid rgba(31,38,90,.08); }
.mode2-stat span { display: block; color: var(--text-1); font-size: 24px; font-weight: 800; line-height: 1.1; }
.mode2-stat small { display: block; margin-top: 4px; color: var(--text-3); font-size: 11px; }
.mode2-stat.ok span { color: var(--green); }
.mode2-stat.bad span { color: var(--red); }
.badge.m2-queued { color: var(--amber); background: rgba(217,119,6,.13); }
.badge.m2-running { color: var(--cyan); background: rgba(8,145,178,.13); }
.badge.m2-success { color: var(--green); background: rgba(22,163,74,.13); }
.badge.m2-failed { color: var(--red); background: rgba(225,29,72,.12); }
.badge.m2-interrupted { color: #667085; background: rgba(102,112,133,.12); }
.badge.m2-ready, .badge.m2-paused { color: #6d4fd1; background: rgba(109,79,209,.12); }
.badge.m2-retry, .badge.m2-recoverable { color: #9a6700; background: rgba(217,119,6,.13); }
.badge.m2-review { color: #b54708; background: rgba(247,144,9,.14); }
.badge.m2-stopped, .badge.m2-canceled { color: #667085; background: rgba(102,112,133,.12); }
.mode2-step { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.mode2-table { min-width: 1260px; }
.mode2-failure-band {
  display: flex; align-items: flex-start; gap: 16px; margin: -4px 0 18px;
  padding: 11px 2px; border-bottom: 1px solid rgba(31,38,90,.08);
}
.mode2-failure-band strong { flex: none; font-size: 12px; color: var(--text-2); }
.mode2-failure-list { display: flex; flex-wrap: wrap; gap: 7px 14px; color: var(--text-3); font-size: 12px; }
.mode2-failure-item b { color: var(--text-1); }
.table-empty { padding: 42px 12px !important; text-align: center; color: var(--text-3); }
.shot-frame { max-height: 70vh; overflow: auto; background: #111; }
.shot-frame img { display: block; width: 100%; }
.mode2-setting-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
.mode2-setting-grid .field { min-width: 0; }
.mode2-field-wide { grid-column: 1 / -1; }
.mode2-switch-wide { margin: 2px 0 17px; }
.readonly-input { color: var(--text-2); background: rgba(120,130,160,.06); cursor: default; }
.proxy-template-preview {
  margin-top: 7px; padding: 8px 10px; border: 1px solid rgba(31,38,90,.08); border-radius: 6px;
  color: var(--text-3); background: rgba(255,255,255,.55); font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (max-width: 900px) {
  .mode2-config-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode2-country-field, .mode2-price-field { grid-column: span 2; }
  .mode2-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode2-stat { border-bottom: 1px solid rgba(31,38,90,.08); }
  .mode2-stat:nth-child(2n) { border-right: 0; }
  .mode2-stat:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 760px) {
  .mode2-title-row { display: block; }
  .mode2-title-actions { justify-content: flex-start; margin-top: 14px; }
  .mode2-title-actions .px-btn { flex: 1 1 calc(50% - 5px); min-width: 130px; }
  .mode2-config-head { display: block; }
  .mode2-config-toggles { justify-content: flex-start; margin-top: 12px; }
  .mode2-config-grid { grid-template-columns: 1fr; }
  .mode2-country-field, .mode2-price-field { grid-column: auto; }
  .mode2-config-foot { align-items: flex-start; flex-direction: column; }
  .mode2-run-actions { width: 100%; justify-content: flex-start; }
  .mode2-run-actions .px-btn { flex: 1 1 calc(50% - 4px); }
  .mode2-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode2-stat { padding: 12px; }
  .mode2-stat span { font-size: 20px; }
  .mode2-failure-band { display: block; }
  .mode2-failure-list { margin-top: 8px; }
  .mode2-setting-grid { grid-template-columns: 1fr; }
  .mode2-field-wide { grid-column: auto; }
}

/* ===== Unified proxy center ===== */
.proxy-center-card { grid-column: 1 / -1; }
.proxy-center-card .settings-head > .px-btn { margin-left: auto; }
.proxy-binding-grid { display: grid; gap: 8px; margin: 4px 0 18px; }
.proxy-binding-row {
  display: grid; grid-template-columns: minmax(180px, 220px) minmax(220px, 1fr) minmax(150px, 210px) 100px;
  align-items: center; gap: 12px; min-height: 48px; padding: 7px 10px;
  border: 1px solid var(--glass-border); background: rgba(0,0,0,.018); border-radius: 6px;
}
.proxy-binding-row .switch-row { margin: 0; }
.proxy-binding-row > span:last-child { color: var(--text-3); font-size: 12px; }
.proxy-rule-value { min-height: 38px; display: flex; align-items: center; color: var(--text-2); font-size: 13px; }
.proxy-provider-table-wrap { overflow-x: auto; border-top: 1px solid var(--glass-border); }
.proxy-provider-table { min-width: 760px; }
.proxy-provider-table td:first-child strong, .proxy-provider-table td:first-child small { display: block; }
.proxy-provider-table td:first-child small { margin-top: 3px; color: var(--text-3); font-size: 11px; }
.px-btn.mini { min-height: 30px; padding: 4px 9px; font-size: 12px; }
.proxy-provider-modal { width: min(760px, 94vw); max-height: 90vh; overflow: auto; }
.modal-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.modal-title-row h2 { margin: 0; }
.proxy-provider-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 14px; margin-top: 20px; }
.proxy-provider-form .field { min-width: 0; margin: 0; }
.proxy-provider-form label.switch-row {
  display: inline-flex; align-items: center; gap: 10px; margin: 0;
  color: var(--text-2); letter-spacing: 0;
}
.proxy-field-label {
  display: block; margin-bottom: 6px; color: var(--text-2);
  font-size: 13px; font-weight: 600;
}
.proxy-switch-field .switch-row { min-height: 38px; }
.proxy-inline-option { display: flex; align-items: center; min-height: 24px; }
.proxy-provider-ttl-field .px-input { max-width: calc((100% - 14px) / 2); }
.proxy-provider-wide { grid-column: 1 / -1; }

/* ===== Paylink workspace ===== */
.paylink-title-row, .paylink-config-head, .paylink-config-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.paylink-title-row .page-title { margin-bottom: 0; }
.paylink-run-meta { margin-top: 5px; color: var(--text-3); font-size: 13px; }
.paylink-workspace { margin-top: 18px; padding: 18px 20px; border: 1px solid var(--glass-border); border-radius: 7px; background: #fff; }
.paylink-config-head h2 { margin: 0 0 4px; font-size: 17px; letter-spacing: 0; }
.paylink-config-head span, .paylink-config-foot > span { color: var(--text-3); font-size: 12px; }
.paylink-head-actions { display: flex; align-items: center; gap: 12px; }
.paylink-head-actions .px-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; }
.paylink-head-actions .px-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.paylink-settings-link { color: var(--primary); font-size: 13px; text-decoration: none; }
.paylink-config-grid { display: grid; grid-template-columns: minmax(290px, 1.35fr) minmax(170px, 1fr) minmax(80px, .45fr) minmax(95px, .55fr) minmax(180px, 1.2fr); gap: 14px; align-items: end; margin: 16px 0; }
.paylink-config-grid.has-approve-concurrency { grid-template-columns: minmax(290px, 1.35fr) minmax(170px, 1fr) minmax(80px, .45fr) minmax(95px, .5fr) minmax(95px, .55fr) minmax(180px, 1.2fr); }
.paylink-config-grid > [hidden] { display: none; }
.paylink-token-pools { grid-column: 2 / span 2; display: grid; grid-template-columns: repeat(2, minmax(140px, 1fr)); gap: 12px; align-items: start; }
.paylink-token-only-oaics { grid-column: 1 / -1; margin: 0; min-height: 32px; }
.paylink-provider-pools { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(240px, 1fr)); gap: 12px; }
.paylink-token-pools .field small { display: block; margin-top: 5px; color: var(--text-3); font-size: 10.5px; line-height: 1.35; }
.paylink-engine-switch { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); height: 76px; border: 1px solid var(--glass-border); border-radius: 6px; overflow: hidden; background: #f7f8fa; }
.paylink-engine-switch button { min-width: 0; padding: 0 4px; border: 0; border-right: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border); background: transparent; color: var(--text-2); font: inherit; font-size: 11px; line-height: 1.2; cursor: pointer; }
.paylink-engine-switch button:nth-child(4n) { border-right: 0; }
.paylink-engine-switch button:nth-child(n+5) { border-bottom: 0; }
.paylink-engine-switch button:last-child { border-right: 0; }
.paylink-engine-switch button.active { background: #1f2937; color: #fff; }
.paylink-engine-switch button:disabled { cursor: not-allowed; opacity: .55; }
.paylink-card-fields { display: grid; grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(90px, .6fr)); gap: 14px; padding: 14px 0; border-top: 1px solid var(--glass-border); }
.paylink-card-fields[hidden] { display: none; }
.paylink-card-fields .field { min-width: 0; margin: 0; }
.paylink-card-fields .px-input { width: 100%; }
.card-batch-workbench { padding-top: 16px; border-top: 1px solid var(--glass-border); }
.card-batch-workbench[hidden] { display: none; }
.card-flow-rail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 18px; padding: 0; list-style: none; }
.card-flow-rail li { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text-3); font-size: 12px; }
.card-flow-rail li:not(:last-child)::after { content: ""; height: 1px; flex: 1; margin-right: 8px; background: var(--glass-border); }
.card-flow-rail b { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 24px; border: 1px solid var(--glass-border); border-radius: 50%; color: var(--text-2); background: #fff; }
.card-flow-rail .active b { border-color: #1f2937; background: #1f2937; color: #fff; }
.card-flow-rail span { white-space: nowrap; }
.card-batch-grid { display: grid; grid-template-columns: minmax(480px, 1.15fr) minmax(360px, .85fr); gap: 24px; }
.card-batch-pane { min-width: 0; }
.card-batch-pane + .card-batch-pane { padding-left: 24px; border-left: 1px solid var(--glass-border); }
.card-pane-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-pane-head h3 { margin: 0; font-size: 14px; letter-spacing: 0; }
.card-pane-head p { margin: 3px 0 0; color: var(--text-3); font-size: 12px; }
.card-pane-head .icon-btn { width: 32px; height: 32px; font-size: 20px; line-height: 1; }
.card-count-chip { min-width: 56px; padding: 4px 8px; border: 1px solid var(--glass-border); border-radius: 5px; color: var(--text-2); font-size: 11px; text-align: center; }
.stripe-card-grid { display: grid; grid-template-columns: minmax(220px, 2fr) minmax(100px, .7fr) minmax(90px, .6fr); gap: 8px; }
.stripe-card-grid label { min-width: 0; }
.stripe-card-grid label > span { display: block; margin-bottom: 5px; color: var(--text-3); font-size: 11px; }
.stripe-card-element { height: 38px; padding: 10px 11px; border: 1px solid var(--glass-border); border-radius: 6px; background: #fff; }
.stripe-card-element.StripeElement--focus { border-color: #586b91; box-shadow: 0 0 0 2px rgba(88,107,145,.12); }
.stripe-card-element.StripeElement--invalid { border-color: var(--red); }
.stripe-card-element.is-locked { display: flex; align-items: center; color: var(--text-3); background: #f7f8fa; cursor: pointer; }
.stripe-card-placeholder { overflow: hidden; font-size: 11px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.card-save-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.card-save-row > span { color: var(--text-3); font-size: 11px; }
.card-save-row .px-btn { min-width: 104px; }
.card-account-picker { transition: opacity .18s ease; }
.card-account-picker.is-disabled { opacity: .58; }
.paylink-account-picker { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--glass-border); }
.paylink-account-picker[hidden] { display: none; }
.paylink-account-picker.is-disabled { opacity: .58; }
.card-account-tools { display: grid; grid-template-columns: minmax(140px, 1fr) 74px auto auto; gap: 8px; margin-bottom: 8px; }
.paylink-account-picker .card-account-tools { grid-template-columns: minmax(140px, 1fr) auto 74px auto auto; }
.card-account-tools .px-input { min-width: 0; }
.card-account-latest-count { width: 74px; text-align: center; }
.card-account-range { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 12px; white-space: nowrap; }
.card-account-range .px-input { width: 58px; text-align: center; }
.card-account-list { min-height: 112px; max-height: 178px; overflow: auto; border: 1px solid var(--glass-border); border-radius: 6px; background: #fafbfc; }
.card-account-option { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 10px; border-bottom: 1px solid var(--glass-border); cursor: pointer; }
.card-account-option:last-child { border-bottom: 0; }
.card-account-option.selected { background: rgba(53,89,183,.07); }
.card-account-option input { flex: 0 0 auto; }
.card-account-option > span { min-width: 0; }
.card-account-option b, .card-account-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-account-option b { color: var(--text-1); font-size: 12px; }
.card-account-option small { margin-top: 2px; color: var(--text-3); font-size: 10px; }
.card-account-empty { display: grid; place-items: center; min-height: 110px; color: var(--text-3); font-size: 12px; }
.card-external-source { margin-top: 9px; color: var(--text-3); font-size: 11px; }
.card-external-source summary { cursor: pointer; }
.card-external-source .card-at-textarea { min-height: 76px; margin-top: 8px; }
.card-external-source > span { display: block; margin-top: 4px; text-align: right; }
.card-pool-list { display: grid; gap: 8px; }
.card-pool-row { display: grid; grid-template-columns: minmax(190px, 2fr) 58px 76px 68px 32px; gap: 8px; }
.card-pool-row .px-input { width: 100%; min-width: 0; }
.card-pool-row .card-remove { width: 32px; height: 38px; font-size: 18px; }
.card-route-strip { display: flex; align-items: center; gap: 7px; margin-top: 12px; min-height: 28px; color: var(--text-3); font-size: 11px; overflow-x: auto; }
.card-route-strip span { padding: 3px 6px; border: 1px solid var(--glass-border); border-radius: 4px; color: var(--text-1); font-weight: 700; }
.card-route-strip i { font-style: normal; white-space: nowrap; }
.card-route-strip b { color: var(--text-3); }
.card-at-textarea { width: 100%; min-height: 112px; max-height: 220px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; line-height: 1.5; }
.card-command-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--glass-border); }
.card-command-status { display: flex; align-items: baseline; gap: 6px; margin-right: auto; }
.card-command-status b { color: #3559b7; font-size: 22px; }
.card-command-status span { color: var(--text-3); font-size: 12px; }
.card-flow-error { margin-top: 12px; padding: 12px 14px; border: 1px solid rgba(225,29,72,.28); border-radius: 7px; background: rgba(225,29,72,.055); }
.card-flow-error[hidden] { display: none; }
.card-flow-error-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-flow-error-head b { display: block; color: var(--red); font-size: 13px; }
.card-flow-error-head span { display: block; margin-top: 2px; color: var(--text-3); font-size: 11px; }
.card-flow-error pre { margin: 10px 0 0; color: #7f1d1d; font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.paylink-route-preview { min-height: 38px; display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--glass-border); border-radius: 6px; color: var(--text-2); font-size: 12px; overflow-wrap: anywhere; }
.paylink-actions { display: flex; align-items: center; gap: 8px; }
.pl-qr-auto-control { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 5px 4px 10px; border: 1px solid var(--glass-border); border-radius: 6px; background: #f7f8fa; }
.pl-qr-auto-control[hidden] { display: none; }
.pl-qr-auto-control > span { max-width: 360px; color: var(--text-2); font-size: 11px; line-height: 1.35; }
.pl-qr-upload-state { display: inline-flex; align-items: center; min-height: 24px; margin-left: 3px; padding: 2px 6px; border-radius: 4px; background: rgba(8,145,178,.11); color: var(--cyan); font-size: 10px; vertical-align: middle; }
.pl-qr-upload-state.uploaded { background: rgba(22,163,74,.12); color: var(--green); }
.pl-qr-upload-state.failed { background: rgba(225,29,72,.11); color: var(--red); }
.paylink-stats { display: grid; grid-template-columns: repeat(7, minmax(88px, 1fr)); margin: 16px 0; border: 1px solid var(--glass-border); border-radius: 7px; overflow: hidden; }
.paylink-stats > div { min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 1px solid var(--glass-border); background: #fff; }
.paylink-stats > div:last-child { border-right: 0; }
.paylink-stats span { font-size: 22px; font-weight: 700; }
.paylink-stats small { margin-top: 4px; color: var(--text-3); }
.paylink-stats .ok span { color: var(--green); }
.paylink-stats .ready span { color: #3559b7; }
.paylink-stats .bad span { color: var(--red); }
.paylink-table { min-width: 1040px; }
.paylink-step { display: flex; justify-content: space-between; gap: 8px; min-width: 120px; }
.paylink-step small { color: var(--text-3); }
.paylink-at-import-dialog { width: 600px; }
.paylink-at-import-dialog > label { margin-top: 20px; }
.paylink-at-import-textarea { min-height: 230px; max-height: 42vh; resize: vertical; }
.paylink-at-import-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; color: var(--text-3); font-size: 12px; }
.badge.paylink-success { background: rgba(22,163,74,.10); color: var(--green); }
.badge.paylink-failed { background: rgba(225,29,72,.10); color: var(--red); }
.badge.paylink-running { background: rgba(65,105,225,.10); color: #3559b7; }
.badge.paylink-pending, .badge.paylink-queued, .badge.paylink-stopped { background: rgba(110,118,129,.10); color: var(--text-2); }

/* ===== iCloud 邮箱与子邮箱库存 ===== */
.icloud-mailbox-editor {
  width: 560px; max-height: 90vh; padding: 28px 32px 24px; overflow-y: auto;
}
.icloud-mailbox-editor h2 { margin-bottom: 20px; }
.icloud-mailbox-form { display: flex; flex-direction: column; gap: 17px; }
.icloud-form-field { min-width: 0; }
.modal .icloud-form-field label {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin: 0 0 7px; color: var(--text-2); font-size: 12.5px; font-weight: 600;
}
.icloud-form-field .required { color: var(--red); }
.icloud-password-state { color: var(--green); font-size: 11.5px; font-weight: 500; }
.icloud-form-field textarea.px-input {
  display: block; min-height: 82px; resize: vertical; line-height: 1.55;
}
.icloud-password-help {
  margin-top: 8px; padding: 9px 11px;
  color: var(--text-3); background: #f7f9fc;
  border: 1px solid #edf1f7; border-radius: 8px;
  font-size: 12px; line-height: 1.55;
}
.icloud-inbox-choice { padding-bottom: 2px; }
.icloud-inbox-summary {
  margin-top: 8px; color: var(--text-3); font-size: 12px; line-height: 1.5;
}
.icloud-inbox-fields { min-width: 0; }
#icloud-inbox-qq-fields {
  gap: 17px; padding: 15px;
  border: 1px solid #e7e4f7; border-radius: 11px;
  background: linear-gradient(135deg, rgba(248,247,255,.88), rgba(250,252,255,.92));
}
.icloud-import-format { display: flex; flex-direction: column; gap: 5px; }
.icloud-mailbox-editor .modal-actions {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid #edf1f7;
}
.icloud-inbox-route {
  display: block; max-width: 320px; margin-top: 5px;
  color: #64748b; font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.icloud-inbox-route.qq { color: #0e7490; }
.icloud-row-note {
  display: block; max-width: 320px; margin-top: 5px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.icloud-stock { display: inline-flex; align-items: baseline; gap: 5px; margin-bottom: 3px; }
.icloud-stock b { color: #0e7490; font-size: 18px; line-height: 1; }
.icloud-stock span, .icloud-stock + small { color: var(--text-3); font-size: 12px; }
.icloud-registration-cell { min-width: 112px; }
.icloud-registration-switch { gap: 7px; margin: 0; }
.icloud-registration-switch .switch-label { min-width: 28px; font-size: 12px; }
.icloud-alias-modal {
  width: min(1040px, 95vw); max-height: 91vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.icloud-login-target-modal { width: min(470px, calc(100vw - 28px)); }
.icloud-session-migration-modal { width: min(520px, calc(100vw - 28px)); }
.icloud-session-migration-form { display: grid; gap: 14px; margin-top: 18px; }
.icloud-session-migration-form input[type="file"] {
  height: auto; min-height: 40px; padding: 7px 9px; font-size: 12px;
}
.icloud-login-target-options { display: grid; gap: 10px; margin-top: 18px; }
.icloud-login-target-options > button {
  display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 13px;
  width: 100%; min-height: 68px; padding: 11px 13px; text-align: left; cursor: pointer;
  color: var(--text); background: #fff; border: 1px solid #dce2ec; border-radius: 8px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.icloud-login-target-options > button:hover {
  border-color: rgba(79,110,247,.55); background: rgba(79,110,247,.035); box-shadow: 0 5px 16px rgba(31,38,90,.07);
}
.icloud-login-target-options > button > span:last-child { display: grid; gap: 3px; min-width: 0; }
.icloud-login-target-options strong { font-size: 13.5px; }
.icloud-login-target-options small { color: var(--text-3); font-size: 11.5px; line-height: 1.45; }
.icloud-login-target-icon {
  display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center;
  color: #0e7490; background: rgba(14,116,144,.09); border-radius: 8px;
}
.icloud-login-target-icon.apple { color: #334155; background: #f1f5f9; }
.icloud-login-target-icon svg { width: 21px; height: 21px; }
.icloud-web-panel {
  margin-top: 16px; padding: 14px 16px;
  border: 1px solid #e5eaf3; border-radius: 12px;
  background: linear-gradient(135deg, rgba(247,249,253,.96), rgba(250,247,255,.9));
}
.icloud-web-main {
  display: grid; grid-template-columns: minmax(220px, 1fr) 172px auto;
  align-items: center; gap: 14px;
}
.icloud-web-title { display: flex; align-items: center; gap: 9px; color: var(--text-1); font-size: 13px; font-weight: 650; }
.icloud-web-message { margin-top: 5px; color: var(--text-3); font-size: 12px; line-height: 1.45; }
.icloud-web-mode { display: flex; flex-direction: column; gap: 5px; color: var(--text-3); font-size: 11.5px; }
.icloud-web-mode .px-input { width: 100%; height: 32px; font-size: 12px; }
.icloud-web-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.icloud-web-proxy {
  display: grid; grid-template-columns: 132px minmax(180px, 1fr) 82px max-content;
  align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid #e5eaf3;
}
.icloud-web-proxy-control {
  display: flex; align-items: center; justify-content: flex-start; gap: 14px;
  min-width: 0; color: var(--text-2); font-size: 12px; font-weight: 600;
}
.icloud-web-proxy-switch {
  position: relative; display: block; width: 42px; height: 24px;
  flex: 0 0 42px; margin: 0; cursor: pointer;
}
.icloud-web-proxy-switch input {
  position: absolute; inset: 0; z-index: 2; width: 42px; height: 24px;
  margin: 0; opacity: 0; cursor: pointer;
}
.icloud-web-proxy-track {
  position: relative; display: block; box-sizing: border-box;
  width: 42px; height: 24px; border: 1px solid #b8c1d3; border-radius: 12px;
  background: #d7ddea; transition: background .18s ease, border-color .18s ease;
}
.icloud-web-proxy-track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(28,35,52,.3);
  transition: transform .18s ease;
}
.icloud-web-proxy-switch input:checked + .icloud-web-proxy-track {
  border-color: var(--primary); background: var(--primary);
}
.icloud-web-proxy-switch input:checked + .icloud-web-proxy-track::after { transform: translateX(18px); }
.icloud-web-proxy-switch input:focus-visible + .icloud-web-proxy-track {
  outline: 3px solid rgba(108,92,231,.2); outline-offset: 2px;
}
.icloud-web-proxy-switch input:disabled + .icloud-web-proxy-track { opacity: .55; cursor: not-allowed; }
.icloud-web-proxy .px-input { height: 32px; font-size: 12px; }
.icloud-web-proxy > span:last-child {
  justify-self: end; padding: 4px 8px; border-radius: 6px;
  color: var(--text-3); background: rgba(110,118,129,.08);
  font-size: 11.5px; white-space: nowrap;
}
.px-btn.danger-soft { color: var(--red); background: rgba(225,29,72,.04); }
.badge.web-ready, .badge.web-completed { color: var(--green); background: rgba(22,163,74,.12); }
.badge.web-completed_with_errors { color: var(--amber); background: rgba(217,119,6,.13); }
.badge.web-waiting_login, .badge.web-login_required { color: var(--amber); background: rgba(217,119,6,.13); }
.badge.web-cooling_down, .badge.web-rate_limited, .badge.web-limit_suspected,
.badge.web-paused { color: var(--amber); background: rgba(217,119,6,.13); }
.badge.web-opening_browser, .badge.web-checking_login, .badge.web-starting,
.badge.web-generating, .badge.web-syncing, .badge.web-deleting, .badge.web-stopping {
  color: var(--cyan); background: rgba(8,145,178,.13);
}
.badge.web-error { color: var(--red); background: rgba(225,29,72,.12); }
.badge.web-not_logged_in, .badge.web-unknown, .badge.web-stopped {
  color: var(--text-3); background: rgba(110,118,129,.11);
}
.icloud-job {
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 320px) auto;
  align-items: center; gap: 12px; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid #e5eaf3;
}
.icloud-job-copy { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-2); font-size: 12px; }
.icloud-job-copy b { flex: 0 0 auto; color: var(--cyan); }
.icloud-job-track { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(110,118,129,.13); }
.icloud-job-track span {
  display: block; width: 0; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--primary)); transition: width .25s ease;
}
.icloud-generation-plan {
  gap: 9px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #e5eaf3;
}
.icloud-generation-plan-head,
.icloud-generation-plan-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.icloud-generation-plan-head > div,
.icloud-generation-plan-foot > div { display: flex; align-items: center; gap: 8px; }
.icloud-generation-plan-head strong { color: var(--text-1); font-size: 12.5px; }
.icloud-generation-plan-head b { color: var(--cyan); font-size: 12.5px; }
.icloud-generation-plan-message,
.icloud-generation-plan-foot > span { color: var(--text-3); font-size: 11.5px; line-height: 1.45; }
.icloud-alias-toolbar {
  display: flex; align-items: center; gap: 9px; margin-top: 14px;
}
.icloud-alias-toolbar > span { margin-left: 4px; color: var(--text-3); font-size: 11.5px; line-height: 1.45; }
.icloud-alias-import { display: flex; align-items: stretch; gap: 10px; margin-top: 16px; }
.icloud-alias-import textarea { flex: 1; resize: vertical; min-height: 72px; }
.icloud-alias-import .px-btn { flex: 0 0 auto; align-self: flex-end; }
.icloud-alias-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex: 0 0 auto; min-height: 40px; margin: 7px 0 4px;
}
.icloud-alias-summary { color: var(--text-2); font-size: 13px; }
.icloud-alias-meta-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.icloud-alias-quick-select {
  display: flex; align-items: center; gap: 7px; padding: 6px 7px 6px 11px;
  border: 1px solid #e5eaf3; border-radius: 9px; background: rgba(255,255,255,.82);
}
.icloud-alias-quick-select label { color: var(--text-2); font-size: 12px; white-space: nowrap; }
.icloud-alias-quick-select .px-input { width: 70px; height: 28px; padding: 3px 8px; font-size: 12px; }
.icloud-alias-batch {
  display: flex; align-items: center; justify-content: flex-end; gap: 7px;
  padding: 6px 7px 6px 11px; border: 1px solid #e5eaf3; border-radius: 9px;
  background: rgba(255,255,255,.82);
}
.icloud-alias-batch > span { color: var(--text-2); font-size: 12px; white-space: nowrap; }
.icloud-alias-batch > span b { color: var(--primary); }
.icloud-alias-table { flex: 1; min-height: 180px; overflow: auto; }
.icloud-alias-grid { min-width: 1040px; table-layout: auto; }
.icloud-alias-grid th:nth-child(2), .icloud-alias-grid td:nth-child(2) { min-width: 245px; }
.icloud-alias-grid th:nth-child(3), .icloud-alias-grid td:nth-child(3) { width: 96px; min-width: 96px; }
.icloud-alias-grid th:nth-child(4), .icloud-alias-grid td:nth-child(4) { width: 96px; min-width: 96px; }
.icloud-alias-grid th:nth-child(5), .icloud-alias-grid td:nth-child(5) { width: 68px; min-width: 68px; white-space: nowrap; }
.icloud-alias-grid th:nth-child(6), .icloud-alias-grid td:nth-child(6) { min-width: 120px; }
.icloud-alias-grid th:nth-child(7), .icloud-alias-grid td:nth-child(7) { width: 220px; min-width: 220px; }
.icloud-alias-grid .badge { white-space: nowrap; flex-wrap: nowrap; }
.icloud-alias-grid .account-actions { white-space: nowrap; }
.icloud-error-cell {
  max-width: 260px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.badge.alias-available { color: var(--green); background: rgba(22,163,74,.12); }
.badge.alias-reserved { color: #2563eb; background: rgba(37,99,235,.11); }
.badge.alias-registered { color: #7c3aed; background: rgba(124,58,237,.11); }
.badge.alias-occupied, .badge.alias-failed { color: var(--red); background: rgba(225,29,72,.11); }
.badge.alias-disabled { color: var(--text-3); background: rgba(110,118,129,.11); }
.px-btn.compact { min-height: 28px; padding: 3px 9px; font-size: 12px; }
.icloud-generate-modal { width: 540px; }
.icloud-generate-modal h2 { margin-bottom: 8px; }
.icloud-generate-modal .icloud-mailbox-form { margin-top: 16px; }
.icloud-generate-modes {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px;
  margin-top: 18px; padding: 3px; border: 1px solid #e3e8f1; border-radius: 8px; background: #f4f6fa;
}
.icloud-generate-modes button {
  min-height: 32px; border: 0; border-radius: 6px; color: var(--text-3);
  background: transparent; cursor: pointer; font-size: 12.5px; font-weight: 600;
}
.icloud-generate-modes button.active {
  color: var(--text-1); background: #fff; box-shadow: 0 1px 3px rgba(20,31,51,.12);
}
.icloud-plan-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 12px; }
.icloud-plan-estimate {
  grid-column: 1 / -1; padding: 10px 12px; border: 1px solid #e5eaf3; border-radius: 8px;
  color: var(--text-2); background: #f8fafc; font-size: 12px; line-height: 1.5;
}
.icloud-delete-modal { width: min(650px, 94vw); padding: 26px 28px 22px; }
.icloud-delete-head { display: flex; align-items: flex-start; gap: 13px; }
.icloud-delete-head h2 { margin: 0 0 5px; }
.icloud-delete-head p { margin: 0; color: var(--text-2); font-size: 13px; font-weight: 600; word-break: break-all; }
.icloud-delete-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 40px;
  width: 40px; height: 40px; color: var(--red);
  border-radius: 11px; background: rgba(225,29,72,.09);
}
.icloud-delete-icon svg { width: 21px; height: 21px; }
.icloud-delete-options { display: grid; gap: 12px; margin-top: 20px; }
.icloud-delete-option {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 15px 16px; border: 1px solid #e5eaf3; border-radius: 11px; background: #fafbfe;
}
.icloud-delete-option strong { display: block; margin-bottom: 4px; color: var(--text-1); font-size: 13.5px; }
.icloud-delete-option p { margin: 0; color: var(--text-3); font-size: 12px; line-height: 1.5; }
.icloud-delete-option.remote {
  grid-template-columns: 1fr; border-color: rgba(225,29,72,.22); background: rgba(255,248,250,.86);
}
.icloud-delete-option.remote label { color: var(--red); font-size: 11.5px; font-weight: 600; }
.icloud-delete-option.remote .px-btn { justify-self: end; }
.icloud-delete-modal > .modal-actions { margin-top: 18px; }
.icloud-batch-delete-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 10px;
  max-height: 145px; margin: 18px 0 14px; padding: 12px;
  overflow: auto; border: 1px solid #e5eaf3; border-radius: 10px; background: #fafbfe;
}
.icloud-batch-delete-list span {
  min-width: 0; color: var(--text-2); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.icloud-batch-delete-list b { color: var(--primary); font-size: 12px; font-weight: 600; }
.icloud-batch-delete-warning { margin-top: 0; }
.icloud-account-delete-job {
  margin: 12px 0 0; padding: 13px 16px;
  border: 1px solid #e5eaf3; border-radius: 11px;
  background: linear-gradient(135deg, rgba(247,249,253,.96), rgba(250,247,255,.9));
}
.icloud-account-delete-job-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.icloud-account-delete-job-head > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 0; flex: 1; }
.icloud-account-delete-job-head strong {
  min-width: 0; color: var(--text-2); font-size: 12.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.icloud-account-delete-job-head span { flex: 0 0 auto; color: var(--cyan); font-size: 12px; font-weight: 650; }

@media (max-width: 1180px) {
  .paylink-config-grid, .paylink-config-grid.has-approve-concurrency { grid-template-columns: 1fr 1fr; }
  .paylink-token-pools { grid-column: 1 / -1; }
  .paylink-route-preview { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  .proxy-binding-row { grid-template-columns: 1fr 1fr; }
  .proxy-binding-row > span:last-child { display: none; }
	.paylink-card-fields { grid-template-columns: 2fr repeat(3, 1fr); }
	.card-batch-grid { grid-template-columns: 1fr; }
	.card-batch-pane + .card-batch-pane { padding-left: 0; padding-top: 16px; border-left: 0; border-top: 1px solid var(--glass-border); }
	.card-command-bar { flex-wrap: wrap; justify-content: flex-start; }
	.card-command-status { flex-basis: 100%; }
	.paylink-stats { grid-template-columns: repeat(4, 1fr); }
	.paylink-stats > div { border-bottom: 1px solid var(--glass-border); }
	.paylink-stats > div:nth-child(4n) { border-right: 0; }
}

@media (max-width: 640px) {
  .proxy-binding-row, .proxy-provider-form, .paylink-config-grid, .paylink-config-grid.has-approve-concurrency { grid-template-columns: 1fr; }
  .paylink-token-pools { grid-template-columns: 1fr; }
	.paylink-provider-pools { grid-template-columns: 1fr; }
	.paylink-engine-switch { grid-template-columns: repeat(4, minmax(0, 1fr)); height: 76px; }
	.paylink-engine-switch button { font-size: 12px; white-space: nowrap; }
	.paylink-card-fields { grid-template-columns: 1fr 1fr; }
	.card-flow-rail { gap: 4px; }
	.card-flow-rail li { justify-content: center; }
	.card-flow-rail li::after, .card-flow-rail span { display: none; }
	.stripe-card-grid { grid-template-columns: 1fr 1fr; }
	.stripe-card-grid label:first-child { grid-column: 1 / -1; }
	.card-pool-row { grid-template-columns: minmax(0, 1fr) 52px 62px; }
	.card-pool-row .card-number { grid-column: 1 / -1; }
	.card-pool-row .card-cvc { grid-column: 2; grid-row: 2; }
	.card-pool-row .card-remove { grid-column: 3; grid-row: 2; justify-self: end; }
	.card-route-strip { align-items: flex-start; flex-wrap: wrap; }
	.card-account-tools { grid-template-columns: minmax(0, 1fr) auto auto; }
	.card-account-tools #pl-card-account-search, .card-account-tools #pl-account-picker-search { grid-column: 1 / -1; }
	.paylink-account-picker .card-account-tools { grid-template-columns: minmax(0, 1fr) auto auto; }
	.paylink-account-picker .card-account-range { grid-column: 1 / -1; }
	.card-account-latest-count { width: auto; }
	.card-command-bar .px-btn { flex: 1 1 calc(50% - 8px); }
  .proxy-provider-wide, .paylink-route-preview { grid-column: auto; }
  .proxy-provider-ttl-field .px-input { max-width: none; }
  .paylink-title-row, .paylink-config-head, .paylink-config-foot { align-items: stretch; flex-direction: column; }
  .paylink-head-actions { justify-content: space-between; }
  .paylink-title-row .page-nav-link { align-self: flex-start; }
  .paylink-actions {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%; gap: 8px;
  }
  .paylink-actions > .px-btn { width: 100%; min-width: 0; padding-inline: 10px; }
  .pl-qr-auto-control {
    grid-column: 1 / -1; display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%; gap: 7px; padding: 9px;
  }
  .pl-qr-auto-control > span {
    grid-column: 1 / -1; max-width: none; min-width: 0;
    padding: 0 2px 2px; overflow-wrap: anywhere;
  }
  .pl-qr-auto-control > .px-btn { width: 100%; min-width: 0; padding-inline: 8px; }
  .pl-qr-auto-control > #pl-qr-auto-toggle { grid-column: 1 / -1; }
  .pl-qr-auto-control:has(#pl-qr-auto-viewer:not([hidden])) > #pl-qr-auto-viewer,
  .pl-qr-auto-control:has(#pl-qr-auto-viewer:not([hidden])) > #pl-qr-auto-toggle { grid-column: auto; }
  .paylink-stats { grid-template-columns: repeat(2, 1fr); }
  .paylink-stats > div { border-bottom: 1px solid var(--glass-border); }
  .paylink-stats > div:nth-child(2n) { border-right: 0; }
  .task-filter-bar { align-items: stretch; flex-wrap: wrap; }
  .task-filter-search { flex-basis: 100%; max-width: none; }
  .task-filter-bar .px-select { flex: 1; }
  .icloud-alias-import { flex-direction: column; }
  .icloud-alias-import .px-btn { width: 100%; align-self: stretch; }
  .icloud-mailbox-editor { padding: 24px 22px 20px; }
  .icloud-web-main { grid-template-columns: 1fr; align-items: stretch; }
  .icloud-web-actions { justify-content: flex-start; }
  .icloud-web-proxy { grid-template-columns: minmax(0, 1fr) 82px; }
  .icloud-web-proxy-control { grid-column: 1 / -1; justify-content: flex-start; }
  .icloud-web-proxy > span:last-child { grid-column: 1 / -1; justify-self: start; }
  .icloud-job { grid-template-columns: 1fr; }
  .icloud-generation-plan-head, .icloud-generation-plan-foot { align-items: flex-start; flex-direction: column; }
  .icloud-generation-plan-foot > div { width: 100%; flex-wrap: wrap; }
  .icloud-plan-fields { grid-template-columns: 1fr; }
  .icloud-plan-estimate { grid-column: auto; }
  .icloud-alias-toolbar { align-items: stretch; flex-direction: column; }
  .icloud-alias-toolbar > span { margin-left: 0; }
  .icloud-alias-meta { align-items: stretch; flex-direction: column; }
  .icloud-alias-meta-actions { align-items: stretch; justify-content: flex-start; }
  .icloud-alias-quick-select { flex: 1 1 100%; }
  .icloud-alias-batch { justify-content: flex-start; flex-wrap: wrap; }
  .icloud-delete-option { grid-template-columns: 1fr; align-items: stretch; }
  .icloud-delete-option .px-btn, .icloud-delete-option.remote .px-btn { width: 100%; justify-self: stretch; }
  .icloud-batch-delete-list { grid-template-columns: 1fr; }
  .icloud-account-delete-job-head, .icloud-account-delete-job-head > div { align-items: stretch; flex-direction: column; }

  #icloud-alias-modal {
    align-items: stretch; padding: 8px;
    overflow: hidden; overscroll-behavior: contain;
  }
  .icloud-alias-modal {
    width: 100%; max-width: none; height: calc(100dvh - 16px); max-height: none;
    padding: 0 16px 16px; overflow-x: hidden; overflow-y: auto;
    overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  }
  .icloud-alias-modal > .mail-head {
    position: sticky; top: 0; z-index: 5;
    margin: 0 -16px; padding: 13px 16px;
  }
  .icloud-alias-modal > .mail-head > div { min-width: 0; }
  .icloud-alias-modal > .mail-head h2,
  .icloud-alias-modal > .mail-head .mail-sub {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .icloud-alias-table {
    flex: none; width: 100%; min-height: 300px; max-height: 58dvh;
    overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  }
}
