/**
 * BPO 电联门户 — Memoriq 风格配色 + 顶栏居中布局
 * https://memoriq.me/
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.bpo-app {
  --bpo-bg: #ffffff;
  --bpo-bg-elevated: #f7f7f7;
  --bpo-bg-warm: #fafaf9;
  --bpo-card: #ffffff;
  --bpo-surface: #f1f1f1;
  --bpo-border: #e5e5e5;
  --bpo-border-soft: #eeeeee;
  --bpo-text: #0a0a0a;
  --bpo-text-secondary: #525252;
  --bpo-text-muted: #737373;
  --bpo-accent: #148b74;
  --bpo-accent-hover: #117a66;
  --bpo-accent-soft: rgba(20, 139, 116, 0.1);
  --bpo-accent-border: rgba(20, 139, 116, 0.25);
  --bpo-danger: #dc2626;
  --bpo-danger-soft: rgba(220, 38, 38, 0.08);
  --bpo-radius: 4px;
  --bpo-radius-lg: var(--bpo-radius);
  --notion-radius: var(--bpo-radius);
  --notion-radius-lg: var(--bpo-radius);
  --bpo-shadow: 0 24px 80px rgba(0, 0, 0, 0.06);
  --bpo-topbar-h: 56px;
  --bpo-content-max: 1200px;
  --bpo-font: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bpo-heading: var(--bpo-font);
  --notion-accent: var(--bpo-accent);
  --notion-accent-hover: var(--bpo-accent-hover);
  font-family: var(--bpo-font);
  color: var(--bpo-text);
  background: var(--bpo-bg-warm);
  -webkit-font-smoothing: antialiased;
}

.bpo-app #radar-shell.bpo-shell:not(.hidden) {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bpo-app #radar-shell.hidden {
  display: none !important;
}

.bpo-app #radar-chrome {
  width: 100%;
  align-self: stretch;
}

.bpo-app #radar-app {
  flex: 1 0 auto;
  width: min(var(--bpo-content-max), calc(100vw - 48px));
  max-width: var(--bpo-content-max);
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 28px 24px 40px;
  min-height: calc(100vh - var(--bpo-topbar-h) - 52px);
  box-sizing: border-box;
}

.bpo-app .workbench-page,
.bpo-app .ela-page-inner {
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
}

.bpo-app .ela-page-inner h1,
.bpo-app .ela-page-inner h2.text-xl,
.bpo-app .bpo-page-title {
  font-family: var(--bpo-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ── Topbar ─────────────────────────────────────────────── */
.bpo-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--bpo-topbar-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bpo-border);
}

.bpo-topbar-inner {
  max-width: var(--bpo-content-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.bpo-topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--bpo-text);
  flex-shrink: 0;
  text-decoration: none;
}

.bpo-topbar-brand i {
  font-size: 18px;
  color: var(--bpo-accent);
}

.bpo-topbar-project {
  position: relative;
  flex-shrink: 0;
}

.bpo-topbar-project-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--bpo-border);
  border-radius: var(--bpo-radius);
  background: var(--bpo-card);
  font-size: 13px;
  font-weight: 500;
  color: var(--bpo-text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  max-width: 200px;
}

.bpo-topbar-project-btn:hover {
  border-color: var(--bpo-accent-border);
  background: var(--bpo-accent-soft);
}

.bpo-topbar-project-icon {
  width: 22px;
  height: 22px;
  border-radius: var(--bpo-radius);
  background: var(--bpo-accent-soft);
  color: var(--bpo-accent);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.bpo-topbar-project-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--bpo-card);
  border: 1px solid var(--bpo-border);
  border-radius: var(--bpo-radius-lg);
  box-shadow: var(--bpo-shadow);
  padding: 6px;
  z-index: 60;
}

.bpo-topbar-project-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--bpo-radius);
  background: transparent;
  font-size: 13px;
  color: var(--bpo-text);
  cursor: pointer;
  text-align: left;
}

.bpo-topbar-project-option:hover {
  background: var(--bpo-bg-elevated);
}

.bpo-topbar-project-option.active {
  background: var(--bpo-accent-soft);
  color: var(--bpo-accent-hover);
}

.bpo-topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.bpo-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--bpo-radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--bpo-text-secondary);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.bpo-nav-item i {
  font-size: 16px;
}

.bpo-nav-item:hover {
  color: var(--bpo-text);
  background: var(--bpo-bg-elevated);
}

.bpo-nav-item.bpo-nav-active {
  color: var(--bpo-accent);
  background: var(--bpo-accent-soft);
}

.bpo-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.bpo-topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bpo-topbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--bpo-radius);
  background: var(--bpo-surface);
  color: var(--bpo-text-secondary);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}

.bpo-topbar-username {
  font-size: 13px;
  font-weight: 500;
  color: var(--bpo-text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bpo-topbar-logout {
  border: none;
  background: transparent;
  color: var(--bpo-text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--bpo-radius);
}

.bpo-topbar-logout:hover {
  color: var(--bpo-danger);
  background: var(--bpo-danger-soft);
}

@media (max-width: 768px) {
  .bpo-topbar-username,
  .bpo-nav-item span {
    display: none;
  }
  .bpo-topbar-inner {
    gap: 10px;
    padding: 0 12px;
  }
}

/* ── Footer ─────────────────────────────────────────────── */
.bpo-footer {
  width: 100%;
  align-self: stretch;
  border-top: 1px solid var(--bpo-border);
  background: var(--bpo-card);
  padding: 16px 24px;
}

.bpo-footer-inner {
  max-width: var(--bpo-content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--bpo-text-muted);
}

/* ── Forms / Buttons (Memoriq) ──────────────────────────── */
.bpo-app .bpo-label,
.bpo-app .ela-label,
.bpo-app .n-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--bpo-text-secondary);
  margin-bottom: 6px;
}

.bpo-app .bpo-input,
.bpo-app .ela-input,
.bpo-app .n-input {
  width: 100%;
  border: 1px solid var(--bpo-border);
  border-radius: var(--bpo-radius);
  padding: 10px 12px;
  font-size: 14px;
  background: var(--bpo-card);
  color: var(--bpo-text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.bpo-app .bpo-input:focus,
.bpo-app .ela-input:focus,
.bpo-app .n-input:focus {
  border-color: var(--bpo-accent);
  box-shadow: 0 0 0 3px var(--bpo-accent-soft);
}

.bpo-app .bpo-btn,
.bpo-app .ela-btn,
.bpo-app .n-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--bpo-radius);
  border: 1px solid var(--bpo-border);
  background: var(--bpo-card);
  color: var(--bpo-text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.bpo-app .bpo-btn:active,
.bpo-app .ela-btn:active,
.bpo-app .n-btn:active {
  transform: scale(0.98);
}

.bpo-app .bpo-btn-primary,
.bpo-app .ela-btn-primary,
.bpo-app .n-btn-primary {
  background: var(--bpo-accent);
  border-color: var(--bpo-accent);
  color: #fff;
}

.bpo-app .bpo-btn-primary:hover:not(:disabled),
.bpo-app .ela-btn-primary:hover:not(:disabled),
.bpo-app .n-btn-primary:hover:not(:disabled) {
  background: var(--bpo-accent-hover);
  border-color: var(--bpo-accent-hover);
}

.bpo-app .bpo-btn:disabled,
.bpo-app .ela-btn:disabled,
.bpo-app .n-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.bpo-app .bpo-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bpo-accent-soft);
  color: var(--bpo-accent-hover);
  border: 1px solid var(--bpo-accent-border);
}

.bpo-app .n-card {
  background: var(--bpo-card);
  border: 1px solid var(--bpo-border);
  border-radius: var(--bpo-radius-lg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.bpo-app .bg-brand-600 { background-color: var(--bpo-accent) !important; }
.bpo-app .hover\:bg-brand-700:hover { background-color: var(--bpo-accent-hover) !important; }
.bpo-app .text-brand-600,
.bpo-app .text-brand-700 { color: var(--bpo-accent) !important; }
.bpo-app .border-brand-500 { border-color: var(--bpo-accent) !important; }
.bpo-app .ring-brand-500 { --tw-ring-color: var(--bpo-accent) !important; }
.bpo-app .focus\:ring-brand-500:focus { --tw-ring-color: var(--bpo-accent) !important; }

/* ── Blop-style sign-in split ───────────────────────────── */
.bpo-signin-page {
  min-height: 100vh;
  background: var(--bpo-bg);
}

.bpo-signin-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.bpo-signin-aside {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 56px;
  background: var(--bpo-bg-elevated);
  border-right: 1px solid var(--bpo-border-soft);
}

.bpo-signin-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--bpo-text);
  margin-bottom: 48px;
}

.bpo-signin-logo i {
  font-size: 22px;
  color: var(--bpo-accent);
}

.bpo-signin-eyebrow {
  margin: 0 0 12px;
  color: var(--bpo-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bpo-signin-headline {
  font-family: var(--bpo-heading);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
  color: var(--bpo-text);
  max-width: 420px;
}

.bpo-signin-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 400px;
}

.bpo-signin-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--bpo-text-secondary);
  line-height: 1.5;
}

.bpo-signin-features li i {
  color: var(--bpo-accent);
  font-size: 18px;
  margin-top: 1px;
  flex-shrink: 0;
}

.bpo-signin-tagline {
  margin-top: 40px;
  font-size: 12px;
  color: var(--bpo-text-muted);
}

.bpo-signin-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
}

.bpo-signin-form-wrap {
  width: 100%;
  max-width: 380px;
}

.bpo-signin-form-wrap h1 {
  font-family: var(--bpo-heading);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.bpo-signin-form-wrap .bpo-signin-sub {
  font-size: 14px;
  color: var(--bpo-text-muted);
  margin: 0 0 28px;
}

.bpo-signin-error {
  padding: 10px 12px;
  margin-bottom: 16px;
  border-radius: var(--bpo-radius);
  font-size: 13px;
  background: var(--bpo-danger-soft);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: var(--bpo-danger);
}

.bpo-signin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Pick / standalone centered */
.bpo-standalone-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bpo-bg-warm);
}

.bpo-standalone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--bpo-border);
  background: rgba(255, 255, 255, 0.92);
}

.bpo-standalone-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.bpo-standalone-card {
  width: 100%;
  max-width: 440px;
  background: var(--bpo-card);
  border: 1px solid var(--bpo-border);
  border-radius: var(--bpo-radius-lg);
  box-shadow: var(--bpo-shadow);
  padding: 32px 28px;
}

.bpo-standalone-card h1 {
  font-family: var(--bpo-heading);
  font-size: 26px;
  font-weight: 600;
  margin: 0;
}

.bpo-project-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--bpo-border);
  border-radius: var(--bpo-radius);
  background: var(--bpo-card);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.bpo-project-option:hover {
  border-color: var(--bpo-accent-border);
  background: var(--bpo-accent-soft);
}

@media (max-width: 900px) {
  .bpo-signin-split {
    grid-template-columns: 1fr;
    min-height: 100vh;
  }
  .bpo-signin-aside {
    display: none;
  }
  .bpo-signin-main {
    min-height: 100vh;
    padding: 24px 20px;
  }
}

/* ── 项目选择弹层 ───────────────────────────────────────── */
.bpo-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 10, 10, 0.35);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 72px 16px 24px;
}

.bpo-picker {
  width: 100%;
  max-width: 480px;
  background: var(--bpo-card);
  border: 1px solid var(--bpo-border);
  border-radius: var(--bpo-radius-lg);
  box-shadow: var(--bpo-shadow);
  overflow: hidden;
}

.bpo-picker--flat {
  max-width: 440px;
}

.bpo-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--bpo-border-soft);
}

.bpo-picker-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.bpo-picker-close {
  border: none;
  background: transparent;
  color: var(--bpo-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--bpo-radius);
}

.bpo-picker-close:hover { background: var(--bpo-surface); }

.bpo-picker-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 16px;
  padding: 8px 12px;
  border: 1px solid var(--bpo-border);
  border-radius: var(--bpo-radius);
  background: var(--bpo-bg-elevated);
}

.bpo-picker-search input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
}

.bpo-picker-recent {
  padding: 0 16px 10px;
}

.bpo-picker-recent-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bpo-text-muted);
  margin: 0 0 6px;
}

.bpo-picker-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--bpo-border);
  background: var(--bpo-card);
  font-size: 11px;
  color: var(--bpo-text-secondary);
  cursor: pointer;
}

.bpo-picker-chip.active,
.bpo-picker-chip:hover {
  border-color: var(--bpo-accent-border);
  background: var(--bpo-accent-soft);
  color: var(--bpo-accent-hover);
}

.bpo-picker-body {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  border-top: 1px solid var(--bpo-border-soft);
  min-height: 280px;
}

.bpo-picker-body--flat {
  display: block;
  min-height: 0;
}

.bpo-picker-body--flat .bpo-picker-scroll {
  max-height: 320px;
  padding: 8px;
}

.bpo-picker-project-meta {
  line-height: 1.35;
}

.bpo-picker-col-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bpo-text-muted);
  margin: 0;
  padding: 10px 12px 6px;
}

.bpo-picker-scroll {
  max-height: 240px;
  overflow-y: auto;
  padding: 0 8px 8px;
}

.bpo-picker-tenant,
.bpo-picker-project {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--bpo-radius);
  background: transparent;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  color: var(--bpo-text);
}

.bpo-picker-tenant:hover,
.bpo-picker-project:hover {
  background: var(--bpo-bg-elevated);
}

.bpo-picker-tenant.active,
.bpo-picker-project.active {
  background: var(--bpo-accent-soft);
  color: var(--bpo-accent-hover);
}

.bpo-picker-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--bpo-border-soft);
}

.bpo-picker-link {
  border: none;
  background: transparent;
  color: var(--bpo-text-muted);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bpo-picker-link:hover { color: var(--bpo-accent); }

@media (max-width: 640px) {
  .bpo-picker-body { grid-template-columns: 1fr; }
}

/* ── 电联清单卡片 ───────────────────────────────────────── */
.bpo-app .bpo-call-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bpo-app .bpo-call-tab {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--bpo-radius);
  border: 1px solid var(--bpo-border);
  background: var(--bpo-card);
  color: var(--bpo-text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.bpo-app .bpo-call-tab.active {
  background: var(--bpo-accent);
  border-color: var(--bpo-accent);
  color: #fff;
}

.bpo-app .bpo-call-panel {
  background: var(--bpo-card);
  border: 1px solid var(--bpo-border);
  border-radius: var(--bpo-radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.bpo-app .bpo-call-panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--bpo-border-soft);
  background: var(--bpo-bg-elevated);
}

.bpo-app .bpo-lead-card {
  margin: 12px 16px;
  padding: 16px 18px;
  border: 1px solid var(--bpo-border);
  border-radius: var(--bpo-radius-lg);
  background: var(--bpo-card);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.bpo-app .bpo-lead-card:hover {
  border-color: var(--bpo-accent-border);
  box-shadow: 0 4px 20px rgba(20, 139, 116, 0.08);
}

.bpo-app .bpo-lead-card + .bpo-lead-card {
  margin-top: 0;
}

.bpo-app .bpo-lead-card.is-muted {
  opacity: 0.65;
}

.bpo-app .bpo-lead-phone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--bpo-radius);
  border: 1px solid var(--bpo-accent-border);
  background: var(--bpo-accent-soft);
  margin-bottom: 12px;
}

.bpo-app .bpo-lead-phone a {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  color: var(--bpo-accent-hover);
  text-decoration: none;
}

.bpo-app .bpo-lead-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bpo-accent-soft);
  color: var(--bpo-accent-hover);
  border: 1px solid var(--bpo-accent-border);
}

/* 统一圆角：卡片 / 表单 / 按钮（药丸标签保持 rounded-full） */
.bpo-app #radar-app .rounded-sm,
.bpo-app #radar-app .rounded,
.bpo-app #radar-app .rounded-md,
.bpo-app #radar-app .rounded-lg,
.bpo-app #radar-app .rounded-xl,
.bpo-app #radar-app .rounded-2xl,
.bpo-app #radar-standalone .rounded-sm,
.bpo-app #radar-standalone .rounded,
.bpo-app #radar-standalone .rounded-md,
.bpo-app #radar-standalone .rounded-lg,
.bpo-app #radar-standalone .rounded-xl,
.bpo-app #radar-standalone .rounded-2xl,
.bpo-app #radar-app input:not([type="checkbox"]):not([type="radio"]),
.bpo-app #radar-app textarea,
.bpo-app #radar-app select,
.bpo-app #radar-standalone input:not([type="checkbox"]):not([type="radio"]),
.bpo-app #radar-standalone textarea,
.bpo-app #radar-standalone select {
  border-radius: var(--bpo-radius) !important;
}

/* 覆盖 notion.css 中 #radar-app 的侧边栏左偏移与全宽拉伸 */
.bpo-app #radar-app {
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: var(--bpo-content-max) !important;
  transition: none;
}
