/* ============================================================================
 * launcher.css — 启动页「选择账号」（iOS 18 视觉规范）
 *
 * 与 panel-ios.css 共用同一套设计语言：
 *   · 材质 Regular Material：半透明 + blur(32px) saturate(180%)
 *   · 圆角：卡片 20pt，行容器 14pt，按钮 14pt
 *   · 字阶：LargeTitle 28/700、Body 16、Footnote 13、Caption 12
 *   · 触控：主按钮 50pt 高，行高 ≥ 58pt
 *   · 颜色：systemBlue #0A84FF / systemRed #FF453A
 * ========================================================================== */

#binLauncher,
#binLauncher *,
#blAlert,
#blAlert * {
  box-sizing: border-box;
}

html.bl-locked,
html.bl-locked body {
  overflow: hidden !important;
  background: #0b0b0f;
}

#binLauncher {
  --bl-label: #ffffff;
  --bl-label-2: rgba(235, 235, 245, 0.6);
  --bl-label-3: rgba(235, 235, 245, 0.32);
  --bl-card: rgba(30, 30, 33, 0.72);
  --bl-card-solid: #1c1c1e;
  --bl-separator: rgba(84, 84, 88, 0.6);
  --bl-fill: rgba(120, 120, 128, 0.2);
  --bl-tint: #0a84ff;
  --bl-red: #ff453a;
  --bl-green: #30d158;

  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(10, 132, 255, 0.22), transparent 62%),
    radial-gradient(90% 60% at 100% 108%, rgba(94, 92, 230, 0.16), transparent 60%),
    linear-gradient(180deg, #0b0b0f 0%, #121218 58%, #0d0d12 100%);
  color: var(--bl-label);
  text-align: left;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  opacity: 1;
  transition: opacity 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

@media (prefers-color-scheme: light) {
  #binLauncher {
    --bl-label: #000000;
    --bl-label-2: rgba(60, 60, 67, 0.6);
    --bl-label-3: rgba(60, 60, 67, 0.3);
    --bl-card: rgba(255, 255, 255, 0.78);
    --bl-card-solid: #ffffff;
    --bl-separator: rgba(60, 60, 67, 0.26);
    --bl-fill: rgba(120, 120, 128, 0.16);
    --bl-tint: #007aff;
    --bl-red: #ff3b30;
    --bl-green: #34c759;
    background:
      radial-gradient(120% 80% at 50% -10%, rgba(0, 122, 255, 0.16), transparent 62%),
      radial-gradient(90% 60% at 100% 108%, rgba(94, 92, 230, 0.1), transparent 60%),
      linear-gradient(180deg, #f7f7fb 0%, #eef0f6 60%, #f4f4f8 100%);
  }
}

#binLauncher.bl-leaving {
  opacity: 0;
  pointer-events: none;
}

/* ============================== 内容容器 ============================== */
#binLauncher .bl-inner {
  width: 100%;
  max-width: 380px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: bl-rise 0.42s cubic-bezier(0.32, 0.72, 0, 1) both;
}

@keyframes bl-rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}

/* ============================== 顶部标题 ============================== */
#binLauncher .bl-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 4px;
}

#binLauncher .bl-appicon {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #4da3ff 0%, #0a84ff 46%, #0b63d6 100%);
  box-shadow:
    0 8px 22px rgba(10, 132, 255, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
  color: #fff;
}

#binLauncher .bl-appicon svg {
  width: 30px;
  height: 30px;
}

#binLauncher .bl-titles {
  min-width: 0;
}

#binLauncher .bl-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -0.6px;
}

#binLauncher .bl-subtitle {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 400;
  letter-spacing: -0.24px;
  color: var(--bl-label-2);
}

/* ============================== 账号列表 ============================== */
#binLauncher.bl-no-items .bl-section {
  display: none;
}

#binLauncher .bl-section {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 6px 6px;
}

#binLauncher .bl-section-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.08px;
  color: var(--bl-label-2);
  text-transform: uppercase;
}

#binLauncher .bl-edit {
  border: 0;
  background: none;
  padding: 4px 2px;
  margin: -4px 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.24px;
  color: var(--bl-tint);
  cursor: pointer;
}

#binLauncher .bl-list {
  position: relative;
  border-radius: 14px;
  background: var(--bl-card);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  backdrop-filter: blur(32px) saturate(180%);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  overflow-y: auto;
  max-height: min(46vh, 320px);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

@media (prefers-color-scheme: light) {
  #binLauncher .bl-list {
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  }
}

#binLauncher .bl-list::-webkit-scrollbar {
  display: none;
}

#binLauncher .bl-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.16s ease;
}

#binLauncher .bl-row + .bl-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 14px;
  right: 0;
  height: 0.5px;
  background: var(--bl-separator);
}

#binLauncher .bl-row:active {
  background: var(--bl-fill);
}

#binLauncher .bl-check {
  flex: none;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid var(--bl-label-3);
  color: transparent;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

#binLauncher .bl-row.is-current .bl-check {
  border-color: transparent;
  background: var(--bl-tint);
  color: #fff;
}

#binLauncher .bl-check svg {
  width: 14px;
  height: 14px;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

#binLauncher .bl-row.is-current .bl-check svg {
  opacity: 1;
  transform: scale(1);
}

#binLauncher .bl-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#binLauncher .bl-name {
  font-size: 16px;
  line-height: 1.24;
  font-weight: 500;
  letter-spacing: -0.32px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#binLauncher .bl-meta {
  font-size: 12px;
  line-height: 1.26;
  letter-spacing: -0.08px;
  color: var(--bl-label-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#binLauncher .bl-del {
  flex: none;
  width: 32px;
  height: 32px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bl-fill);
  color: var(--bl-red);
  transition: transform 0.16s ease, background 0.16s ease;
}

#binLauncher .bl-list.is-editing .bl-del {
  display: flex;
}

#binLauncher .bl-del:active {
  transform: scale(0.92);
  background: rgba(255, 69, 58, 0.24);
}

#binLauncher .bl-del svg {
  width: 16px;
  height: 16px;
}

/* ============================== 空态 ============================== */
#binLauncher .bl-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 34px 24px;
  border-radius: 14px;
  background: var(--bl-card);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  backdrop-filter: blur(32px) saturate(180%);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
}

#binLauncher .bl-empty.is-visible {
  display: flex;
}

#binLauncher .bl-empty-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--bl-fill);
  color: var(--bl-label-2);
}

#binLauncher .bl-empty-icon svg {
  width: 22px;
  height: 22px;
}

#binLauncher .bl-empty-title {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.32px;
}

#binLauncher .bl-empty-text {
  margin: 0;
  max-width: 270px;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: -0.08px;
  color: var(--bl-label-2);
}

/* ============================== 按钮区 ============================== */
#binLauncher .bl-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 2px;
}

#binLauncher .bl-btn {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.41px;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

#binLauncher .bl-btn:active {
  transform: scale(0.975);
  opacity: 0.9;
}

#binLauncher .bl-btn svg {
  width: 19px;
  height: 19px;
}

#binLauncher .bl-btn-primary {
  background: var(--bl-tint);
  color: #fff;
  box-shadow: 0 8px 22px rgba(10, 132, 255, 0.28);
}

#binLauncher .bl-btn-secondary {
  background: var(--bl-fill);
  color: var(--bl-label);
}

#binLauncher .bl-hint {
  margin: 0;
  padding: 0 8px;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: -0.08px;
  text-align: center;
  color: var(--bl-label-3);
}

/* ============================== 启动中遮罩 ============================== */
#binLauncher .bl-boot {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(11, 11, 15, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fff;
  z-index: 2;
}

#binLauncher .bl-boot.is-visible {
  display: flex;
}

#binLauncher .bl-spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  animation: bl-spin 0.8s linear infinite;
}

@keyframes bl-spin {
  to {
    transform: rotate(360deg);
  }
}

#binLauncher .bl-boot-text {
  font-size: 14px;
  letter-spacing: -0.15px;
  color: rgba(255, 255, 255, 0.7);
}

/* ============================== 确认弹窗 ============================== */
#blAlert {
  position: fixed;
  inset: 0;
  z-index: 2147483100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: bl-fade 0.2s ease both;
}

@keyframes bl-fade {
  from {
    opacity: 0;
  }
}

#blAlert .bl-alert {
  width: 272px;
  max-width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bl-card-solid, #1c1c1e);
  color: var(--bl-label, #fff);
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.46);
  animation: bl-pop 0.24s cubic-bezier(0.32, 0.72, 0, 1) both;
}

@keyframes bl-pop {
  from {
    opacity: 0;
    transform: scale(1.06);
  }
}

#blAlert .bl-alert-title {
  margin: 0;
  padding: 20px 18px 4px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.41px;
}

#blAlert .bl-alert-msg {
  margin: 0;
  padding: 0 18px 20px;
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: -0.08px;
  color: rgba(235, 235, 245, 0.62);
}

@media (prefers-color-scheme: light) {
  #blAlert .bl-alert {
    --bl-label: #000;
    background: #fff;
  }
  #blAlert .bl-alert-msg {
    color: rgba(60, 60, 67, 0.62);
  }
}

#blAlert .bl-alert-actions {
  display: flex;
  border-top: 0.5px solid rgba(84, 84, 88, 0.6);
}

#blAlert .bl-alert-actions button {
  flex: 1;
  height: 44px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 17px;
  letter-spacing: -0.41px;
  color: #0a84ff;
  cursor: pointer;
}

#blAlert .bl-alert-actions button + button {
  border-left: 0.5px solid rgba(84, 84, 88, 0.6);
}

#blAlert .bl-alert-actions button.is-danger {
  color: #ff453a;
  font-weight: 600;
}

#blAlert .bl-alert-actions button.is-primary {
  font-weight: 600;
}
