/* 轻盈学堂 · 柔砂胶囊 — 机构获客工作台样式（锚定 DESIGN.md） */
:root {
  --bg-canvas: #EFF3F0;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F5F9F7;
  --ink-primary: #16241F;
  --ink-secondary: #465B53;
  --ink-muted: #647A71;

  --brand-teal: #0D7C66;
  --brand-teal-hover: #096351;
  --brand-teal-soft: #E3F5F0;
  --brand-teal-ink: #0A6250;

  --accent-apricot: #C95624;
  --accent-apricot-hover: #AD461A;
  --accent-apricot-soft: #FEF0E8;
  --accent-apricot-ink: #A34218;

  --danger: #C23B3B;
  --danger-soft: #FDECEC;

  --border-subtle: rgba(20, 40, 32, 0.08);
  --border-control: rgba(20, 40, 32, 0.16);
  --shadow-card: 0 6px 20px rgba(20, 40, 32, 0.045);
  --shadow-modal: 0 24px 56px rgba(15, 32, 26, 0.18);

  --radius-card: 20px;
  --radius-inner: 14px;
  --radius-input: 12px;
  --radius-pill: 9999px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  font-style: normal;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-canvas);
  color: var(--ink-primary);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.num-text {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  font-variant-numeric: tabular-nums;
}

.mono-text {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

/* 统一焦点环 */
:is(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--brand-teal);
  outline-offset: 2px;
}

/* ==================== 桌面双栏满高隔离布局（P-39） ==================== */
.app-shell {
  height: 100dvh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  overflow: hidden;
}

/* 左侧悬浮圆角侧栏 */
.sidebar {
  height: 100%;
  min-height: 0;
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  padding: 18px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 6px 14px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--brand-teal);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(13, 124, 102, 0.22);
}

.brand-copy {
  min-width: 0;
  flex: 1;
}

.brand-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.3;
}

.brand-sub {
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-pill {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 120ms var(--ease-out);
}

.nav-pill-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

@media (hover: hover) and (pointer: fine) {
  .nav-pill:hover:not(.active) {
    background: var(--bg-subtle);
    color: var(--ink-primary);
  }
}

.nav-pill:active {
  transform: scale(0.985);
}

.nav-pill.active {
  background: var(--brand-teal);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(13, 124, 102, 0.22);
}

.nav-count-badge {
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  background: var(--accent-apricot-soft);
  color: var(--accent-apricot-ink);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-pill.active .nav-count-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-meta-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-meta-label {
  font-size: 11.5px;
  color: var(--ink-muted);
  font-weight: 500;
}

.sidebar-meta-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-primary);
}

.sso-mini-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-control);
  color: var(--brand-teal-ink);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .sso-mini-link:hover {
    background: var(--brand-teal-soft);
    border-color: rgba(13, 124, 102, 0.3);
  }
}

.sidebar-user-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-teal-soft);
  color: var(--brand-teal-ink);
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.user-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
}

.role-badge.admin {
  background: var(--accent-apricot-soft);
  color: var(--accent-apricot-ink);
}

.role-badge.teacher {
  background: var(--brand-teal-soft);
  color: var(--brand-teal-ink);
}

.identity-select {
  width: 100%;
  min-height: 30px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 3px 28px 3px 10px;
  border-radius: 9px;
  border: 1px solid var(--border-control);
  background-color: var(--bg-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

/* 装饰小圆点 */
.dot-teal, .dot-apricot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-teal { background: var(--brand-teal); }
.dot-apricot { background: var(--accent-apricot); }

/* ==================== 右侧独立滚动主工作区 ==================== */
.workspace-scroll {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 2px;
}

/* 顶部融合浮卡顶栏 */
.topbar {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-title-block {
  min-width: 0;
}

.topbar-greeting {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.3;
}

.topbar-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pending-alert-pill {
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--accent-apricot-soft);
  border: 1px solid rgba(201, 86, 36, 0.25);
  color: var(--accent-apricot-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out), transform 120ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .pending-alert-pill:hover {
    background: #FCE3D5;
  }
}

.pending-alert-pill:active {
  transform: scale(0.98);
}

.tenant-capsule {
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--ink-primary);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 24px;
}

.page-view {
  display: none;
}

.page-view.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==================== 按钮系统 ==================== */
.btn-primary, .btn-apricot, .btn-secondary, .btn-ghost {
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out), transform 120ms var(--ease-out), opacity 150ms var(--ease-out);
}

.btn-sm {
  min-height: 34px;
  padding: 0 13px;
  font-size: 12.5px;
}

.btn-primary {
  background: var(--brand-teal);
  color: #FFFFFF;
  border: 1px solid var(--brand-teal);
  box-shadow: 0 5px 14px rgba(13, 124, 102, 0.2);
}

.btn-apricot {
  background: var(--accent-apricot);
  color: #FFFFFF;
  border: 1px solid var(--accent-apricot);
  box-shadow: 0 5px 14px rgba(201, 86, 36, 0.22);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--ink-primary);
  border: 1px solid var(--border-control);
}

.btn-ghost {
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  border: 1px solid transparent;
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover:not(:disabled) { background: var(--brand-teal-hover); }
  .btn-apricot:hover:not(:disabled) { background: var(--accent-apricot-hover); }
  .btn-secondary:hover:not(:disabled) { background: var(--bg-subtle); border-color: rgba(20, 40, 32, 0.24); }
  .btn-ghost:hover:not(:disabled) { background: var(--brand-teal-soft); color: var(--brand-teal-ink); }
}

:is(.btn-primary, .btn-apricot, .btn-secondary, .btn-ghost):active:not(:disabled) {
  transform: scale(0.98);
}

:is(.btn-primary, .btn-apricot, .btn-secondary, .btn-ghost):disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover { background: var(--brand-teal-soft); color: var(--brand-teal-ink); }
}

.mobile-only { display: none; }

/* ==================== 首页优先待办英雄卡 ==================== */
.hero-queue-card {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  border: 1px solid rgba(201, 86, 36, 0.2);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.hero-queue-card.is-clear {
  border-color: var(--border-subtle);
}

.hero-queue-head {
  background: var(--accent-apricot-soft);
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  border-bottom: 1px solid rgba(201, 86, 36, 0.12);
}

.hero-queue-card.is-clear .hero-queue-head {
  background: var(--brand-teal-soft);
  border-bottom-color: rgba(13, 124, 102, 0.12);
}

.hero-queue-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.priority-pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid rgba(201, 86, 36, 0.2);
  color: var(--accent-apricot-ink);
  font-size: 11.5px;
  font-weight: 600;
}

.hero-queue-card.is-clear .priority-pill {
  border-color: rgba(13, 124, 102, 0.2);
  color: var(--brand-teal-ink);
}

.hero-queue-title {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-primary);
}

.hero-queue-desc {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.hero-queue-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-queue-body {
  padding: 14px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-req-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-inner);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}

.hero-req-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.req-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-apricot-soft);
  color: var(--accent-apricot-ink);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-req-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hero-req-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.req-code-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--brand-teal-soft);
  color: var(--brand-teal-ink);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.hero-req-campaign {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-primary);
}

.hero-req-sub {
  font-size: 12px;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero-clear-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

/* ==================== KPI 网格 ==================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-card.kpi-highlight {
  background: #F4FBF8;
  border-color: rgba(13, 124, 102, 0.16);
}

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kpi-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.kpi-icon-pill {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon-pill.teal {
  background: var(--brand-teal-soft);
  color: var(--brand-teal-ink);
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink-primary);
  line-height: 1.15;
}

.kpi-card.kpi-highlight .kpi-value {
  color: var(--brand-teal);
}

.kpi-foot {
  font-size: 12px;
  color: var(--ink-muted);
}

/* ==================== 双栏 Bento ==================== */
.bento-split {
  display: grid;
  grid-template-columns: 1.28fr 0.92fr;
  gap: 16px;
  align-items: start;
}

.surface-card {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink-primary);
}

.card-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.select-pill {
  min-height: 36px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 0 38px 0 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-control);
  background-color: var(--bg-subtle);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2322382c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 14px 14px;
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

/* 漏斗列表 */
.funnel-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.funnel-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.funnel-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.funnel-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-primary);
}

.funnel-stats {
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.funnel-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.funnel-track {
  flex: 1;
  height: 12px;
  border-radius: var(--radius-pill);
  background: #EBF1EE;
  overflow: hidden;
}

.funnel-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #32AE93 0%, #0D7C66 100%);
  transform-origin: left center;
  transition: transform 280ms var(--ease-out);
}

.funnel-fill.is-final {
  background: linear-gradient(90deg, #E28051 0%, #C95624 100%);
}

.funnel-pct-chip {
  min-width: 54px;
  text-align: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--brand-teal-ink);
  font-size: 12px;
  font-weight: 600;
}

.funnel-pct-chip.is-final {
  background: var(--accent-apricot-soft);
  color: var(--accent-apricot-ink);
}

.funnel-footnote {
  padding: 11px 14px;
  border-radius: var(--radius-inner);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--ink-secondary);
  line-height: 1.55;
}

/* 老师归因列表 */
.attribution-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attr-row {
  padding: 12px 14px;
  border-radius: var(--radius-inner);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.attr-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.attr-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-primary);
}

.copy-chip {
  margin-top: 3px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-control);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-size: 11.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background-color 140ms var(--ease-out), border-color 140ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .copy-chip:hover { background: var(--brand-teal-soft); border-color: rgba(13, 124, 102, 0.3); color: var(--brand-teal-ink); }
}

.attr-metrics {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}

.attr-ratio {
  font-size: 13px;
  color: var(--ink-secondary);
}

.attr-ratio strong {
  color: var(--brand-teal);
  font-weight: 600;
}

/* ==================== 区块头与工具条 ==================== */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}

.section-title {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink-primary);
}

.section-desc {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.toolbar-card {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.segmented-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}

.seg-btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

.seg-btn.active {
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(20, 40, 32, 0.08);
}

.seg-count {
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--accent-apricot-soft);
  color: var(--accent-apricot-ink);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.search-field {
  min-width: 230px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  min-height: 36px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border-control);
  color: var(--ink-muted);
}

.search-field:focus-within {
  border-color: var(--brand-teal);
  background: var(--bg-surface);
}

.search-field input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-primary);
}

.chip-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-chip {
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms var(--ease-out), color 140ms var(--ease-out), border-color 140ms var(--ease-out);
}

.filter-chip.active {
  background: var(--brand-teal-soft);
  border-color: rgba(13, 124, 102, 0.3);
  color: var(--brand-teal-ink);
  font-weight: 600;
}

/* ==================== 数据表格 ==================== */
.table-surface {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

th {
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  color: var(--ink-primary);
}

tbody tr:last-child td {
  border-bottom: none;
}

@media (hover: hover) and (pointer: fine) {
  tbody tr:hover td {
    background: #FAFDFB;
  }
}

.col-right {
  text-align: right;
}

.cell-title {
  font-weight: 600;
  color: var(--ink-primary);
}

.cell-sub {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 2px;
}

.action-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.code-nowrap {
  white-space: nowrap;
}

/* 状态胶囊 */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.pill-teal { background: var(--brand-teal-soft); color: var(--brand-teal-ink); }
.pill-apricot { background: var(--accent-apricot-soft); color: var(--accent-apricot-ink); }
.pill-blue { background: #EBF3FE; color: #1D61C4; }
.pill-muted { background: #EDF2F0; color: var(--ink-secondary); }

.badge-unique {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  background: #F3EEFB;
  color: #6938B8;
  border: 1px solid rgba(105, 56, 184, 0.2);
  white-space: nowrap;
}

/* 空状态与错误态 */
.empty-cell {
  text-align: center;
  padding: 36px 20px !important;
  color: var(--ink-secondary);
}

.empty-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-primary);
}

.empty-desc {
  font-size: 13px;
  color: var(--ink-muted);
  max-width: 380px;
}

/* 成员二维码缩略 */
.qr-thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-control);
  object-fit: contain;
  background: #FFFFFF;
  padding: 2px;
}

.qr-thumb.is-default {
  border: 1px dashed rgba(13, 124, 102, 0.45);
  background: var(--bg-subtle);
  opacity: 0.92;
}

/* SSO 配置卡 */
.sso-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sso-item {
  padding: 12px 14px;
  border-radius: var(--radius-inner);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.sso-item-label {
  font-size: 12px;
  color: var(--ink-muted);
}

.sso-item-val {
  font-size: 12.5px;
  color: var(--ink-primary);
  word-break: break-all;
}

/* ==================== 弹窗体系 ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(16, 28, 24, 0.38);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms var(--ease-out);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(520px, 100%);
  max-height: calc(100dvh - 36px);
  background: var(--bg-surface);
  border-radius: 22px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(10px) scale(0.98);
  transition: transform 200ms var(--ease-out);
}

.modal-card.modal-lg {
  width: min(720px, 100%);
}

.modal-backdrop.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 600;
  color: var(--ink-primary);
}

.modal-sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.modal-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.modal-scroll-body {
  max-height: 62dvh;
}

.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 表单字段 */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-primary);
}

.req-star {
  color: var(--accent-apricot);
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-control);
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  transition: border-color 140ms var(--ease-out);
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
  padding-right: 34px;
  cursor: pointer;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand-teal);
}

.form-textarea {
  resize: vertical;
}

.form-error-banner {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
}

/* 发码回执盒子 */
.receipt-code-box {
  padding: 16px;
  border-radius: 16px;
  background: var(--brand-teal-soft);
  border: 1px solid rgba(13, 124, 102, 0.2);
  text-align: center;
}

.receipt-code-label {
  font-size: 12px;
  color: var(--brand-teal-ink);
  font-weight: 500;
}

.receipt-code-value {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-primary);
}

/* 二维码实时预览 */
.qr-live-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-inner);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}

.qr-live-preview img {
  width: 68px;
  height: 68px;
  border-radius: 10px;
  border: 1px solid var(--border-control);
  background: #FFFFFF;
  object-fit: contain;
  padding: 4px;
  flex-shrink: 0;
}

.qr-live-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
}

.qr-live-desc {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-muted);
}

/* 题目预览条目 */
.preview-q-item {
  padding: 14px;
  border-radius: var(--radius-inner);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-q-stem {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.6;
}

.preview-q-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-opt-chip {
  padding: 4px 10px;
  border-radius: 9px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--ink-secondary);
}

.preview-opt-chip.is-correct {
  background: var(--brand-teal-soft);
  border-color: rgba(13, 124, 102, 0.28);
  color: var(--brand-teal-ink);
  font-weight: 600;
}

.preview-q-analysis {
  font-size: 12.5px;
  color: var(--ink-secondary);
  background: var(--bg-surface);
  border-radius: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border-subtle);
}

/* 骨架屏 */
.skeleton-line {
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(90deg, #EBF0ED 25%, #F4F8F6 50%, #EBF0ED 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toast */
.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 200;
  pointer-events: none;
}

.admin-toast {
  background: var(--ink-primary);
  color: #FFFFFF;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 14px 36px rgba(15, 32, 26, 0.24);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
  max-width: min(480px, calc(100vw - 32px));
  text-align: center;
}

.admin-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.sidebar-backdrop {
  display: none;
}

/* ==================== 响应式断点 ==================== */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento-split { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .mobile-only { display: inline-flex; }

  .app-shell {
    height: auto;
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
    display: block;
    padding: 12px;
    overflow-x: hidden;
  }

  .workspace-scroll {
    height: auto;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    padding-right: 0;
  }

  .topbar-sub {
    overflow-wrap: anywhere;
  }

  .sidebar {
    position: fixed;
    top: 12px;
    bottom: 12px;
    left: 12px;
    width: min(280px, calc(100vw - 40px));
    height: auto;
    z-index: 150;
    transform: translateX(calc(-100% - 24px));
    transition: transform 240ms var(--ease-out);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 140;
    background: rgba(16, 28, 24, 0.36);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms var(--ease-out);
  }

  .sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .topbar {
    padding: 12px 14px;
    flex-wrap: wrap;
  }

  .sso-grid, .form-row-2 {
    grid-template-columns: 1fr;
  }

  .search-field {
    min-width: 0;
    flex: 1;
  }
}

@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .topbar-right { width: 100%; justify-content: flex-start; }
  .hero-queue-head { padding: 14px 16px; }
  .hero-queue-body { padding: 12px 14px 14px; }
  .hero-req-item { flex-direction: column; align-items: stretch; }
  .hero-req-item .btn-apricot { width: 100%; }
}

/* 动效无障碍降级 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==================== v1.1.0 新增模块样式 ==================== */

/* 1. 获客走势趋势图与高频错题榜 */
.trends-card, .top-mistakes-card {
  display: flex;
  flex-direction: column;
}

.trends-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--ink-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-color.pv { background: #6BA396; }
.legend-color.uv { background: var(--brand-teal); }
.legend-color.redeem { background: var(--accent-apricot); }

.trends-chart-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  min-height: 180px;
  padding: 16px 10px 6px;
}

.trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.trend-bars-wrap {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  width: 100%;
  justify-content: center;
}

.trend-bar {
  width: 10px;
  min-height: 4px;
  border-radius: 3px 3px 0 0;
  transition: height 300ms var(--ease-out);
}

.trend-bar.pv { background: #A3CEC5; }
.trend-bar.uv { background: var(--brand-teal); }
.trend-bar.redeem { background: var(--accent-apricot); }

.trend-col-label {
  font-size: 11.5px;
  color: var(--ink-muted);
  white-space: nowrap;
}

.top-mistakes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.top-mistake-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-inner);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}

.mistake-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: var(--brand-teal-soft);
  color: var(--brand-teal-ink);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.mistake-rank-badge.top1 {
  background: var(--accent-apricot-soft);
  color: var(--accent-apricot);
}

.mistake-stem-preview {
  flex: 1;
  font-size: 13.5px;
  color: var(--ink-primary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mistake-stats-pill {
  font-size: 12px;
  color: var(--accent-apricot);
  font-weight: 600;
  white-space: nowrap;
  background: #FFF;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

/* 2. 学员线索 CRM 表格与意向标签 */
.leads-kpi-grid {
  margin-bottom: 14px;
}

.intent-select {
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-control);
  background: var(--bg-surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-primary);
  cursor: pointer;
}

.intent-select.high { background: var(--accent-apricot-soft); color: var(--accent-apricot); border-color: rgba(201,86,36,0.2); }
.intent-select.converted { background: var(--brand-teal-soft); color: var(--brand-teal); border-color: rgba(13,124,102,0.2); }
.intent-select.medium { background: #FEF8E7; color: #8A6805; border-color: rgba(200,160,20,0.2); }
.intent-select.low { background: #F0F3F1; color: var(--ink-muted); }

.notes-history-timeline {
  max-height: 180px;
  overflow-y: auto;
  padding: 8px 12px;
  border-radius: var(--radius-inner);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note-history-entry {
  font-size: 12.5px;
  border-bottom: 1px dashed var(--border-subtle);
  padding-bottom: 6px;
}

.note-history-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.note-entry-meta {
  display: flex;
  justify-content: space-between;
  color: var(--ink-muted);
  font-size: 11.5px;
  margin-bottom: 2px;
}

.note-entry-content {
  color: var(--ink-primary);
  line-height: 1.45;
}

/* 3. 推广物料工作坊与营销海报 */
.poster-workshop-split {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 20px;
}

.poster-card-stage {
  background: linear-gradient(170deg, #FFFFFF 0%, #EFF8F5 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.poster-brand-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.poster-brand-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-teal);
  background: var(--brand-teal-soft);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.poster-edition-tag {
  font-size: 11px;
  color: var(--ink-muted);
}

.poster-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-primary);
  line-height: 1.4;
  margin-bottom: 6px;
}

.poster-subtitle {
  font-size: 12.5px;
  color: var(--ink-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.poster-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 16px;
}

.poster-highlights .p-pill {
  font-size: 11.5px;
  background: #FFFFFF;
  border: 1px solid var(--border-control);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  color: var(--ink-secondary);
}

.poster-teacher-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  text-align: left;
  background: rgba(255, 255, 255, 0.7);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.poster-teacher-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-teal);
  color: #FFF;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.poster-teacher-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
}

.poster-teacher-title {
  font-size: 11px;
  color: var(--ink-muted);
}

.poster-qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  padding: 12px;
  border-radius: var(--radius-inner);
  border: 1px solid var(--border-subtle);
  width: 100%;
}

.poster-qr-section img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  border-radius: 6px;
}

.poster-qr-callout .qr-bold {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-teal);
}

.poster-qr-callout .qr-sub {
  font-size: 11px;
  color: var(--ink-muted);
}

.form-helper-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-inner);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--ink-secondary);
  line-height: 1.6;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .poster-workshop-split {
    grid-template-columns: 1fr;
  }
}

