/* Unified Mentor Roster Ledger & Refined Date Control · C++ 训练营 导师工作台 */
:root {
  --mentor-roster-height: clamp(220px, calc(100dvh - 340px), 680px);
  --mentor-roster-heading-size: 1.55rem;
}

/* Preserve layered ambient canvas & frosted masthead across all mentor tabs */
body:has(.mentor-today) {
  background: var(--mentor-canvas);
}

#app:has(.mentor-today) {
  background-color: var(--mentor-canvas);
  background-image: var(--mentor-canvas-glow);
  background-repeat: no-repeat;
}

#app .mentor-today-mast {
  position: sticky;
  top: 0;
  min-height: 68px;
  background: var(--mentor-surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgb(226 232 242 / .9);
  box-shadow: 0 1px 0 rgb(255 255 255 / .75);
}

#app .mentor-today-brand {
  gap: 10px;
}

#app .mentor-today-brand strong {
  font-size: 19px;
  font-weight: 740;
  letter-spacing: -.03em;
}

#app .mentor-today-brand i {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--mentor-accent-soft);
  color: var(--mentor-accent);
  font-size: 13px;
  font-weight: 800;
}

#app .mentor-today-brand span {
  border-inline-start: 0;
  padding-inline-start: 2px;
  color: var(--mentor-muted);
  font-size: var(--mentor-text-label);
  font-weight: 500;
}

#app .mentor-today-mast .button {
  min-height: 36px;
  border: 1px solid var(--mentor-rule);
  background: var(--mentor-paper);
  box-shadow: var(--mentor-shadow-xs);
  font-weight: 550;
}

#app .mentor-today-mast .button .icon {
  display: inline-block;
}

#app .mentor-today-mast .mentor-student-invite-launch {
  border-color: var(--mentor-accent-border);
  background: var(--mentor-accent-soft);
  color: var(--mentor-accent);
  box-shadow: none;
}

#app .mentor-today-actions > .button:last-child {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

#app .mentor-today {
  padding-top: 24px;
  padding-bottom: var(--mentor-space-2xl);
}

/* Segmented Pill Navigation Unified Across All 3 Tabs */
#app .mentor-today > .discussion-workbench-nav {
  display: inline-flex;
  width: auto;
  min-height: 0;
  gap: 4px;
  margin: 0 0 22px;
  padding: 4px;
  border: 1px solid var(--mentor-rule);
  border-radius: 12px;
  background: var(--mentor-recessed);
  box-shadow: inset 0 1px 2px rgb(15 28 56 / .04);
}

#app .mentor-today > .discussion-workbench-nav > button {
  position: relative;
  min-height: 36px;
  padding: 7px 16px;
  border-radius: 9px;
  font-size: var(--mentor-text-label);
  font-weight: 600;
  color: var(--mentor-muted);
}

#app .mentor-today > .discussion-workbench-nav > button[aria-pressed="true"] {
  color: var(--mentor-ink);
  background: var(--mentor-paper);
  box-shadow: 0 1px 3px rgb(15 28 56 / .1), 0 1px 1px rgb(15 28 56 / .04);
}

#app .mentor-today > .discussion-workbench-nav > button[aria-pressed="true"]::after {
  display: none;
}

/* Heading & Refined Pill Date Navigator */
#app .mentor-roster .mentor-today-heading {
  align-items: center;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

#app .mentor-roster-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
}

#app .mentor-roster-title h1 {
  margin: 0;
  font-size: var(--mentor-roster-heading-size);
  font-weight: 720;
  letter-spacing: -.03em;
  text-wrap: balance;
}

#app .mentor-roster-summary {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 1px solid var(--mentor-rule);
  border-radius: 999px;
  background: var(--mentor-paper);
  color: var(--mentor-secondary);
  font-size: var(--mentor-text-xs);
  font-weight: 600;
}

#app .mentor-today .mentor-pending-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--mentor-accent);
  color: var(--mentor-on-accent);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#app .mentor-today .mentor-pending-count[hidden] {
  display: none;
}

#app .mentor-roster-time {
  color: var(--mentor-secondary);
  font-size: var(--mentor-text-small);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Unified Toolbar: Segmented Filters + Search + Refresh */
#app .mentor-roster .mentor-roster-toolbar {
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 14px;
  flex-wrap: wrap;
}

#app .mentor-roster-filters {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--mentor-rule);
  border-radius: 10px;
  background: var(--mentor-recessed);
}

#app .mentor-roster-filters button {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--mentor-muted);
  font: inherit;
  font-size: var(--mentor-text-small);
  font-weight: 600;
}

#app .mentor-roster-filters button[aria-pressed="true"] {
  background: var(--mentor-paper);
  color: var(--mentor-accent);
  box-shadow: 0 1px 3px rgb(15 28 56 / .09);
}

#app .mentor-roster-filters button[aria-pressed="true"]::after {
  display: none;
}

#app .mentor-roster-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgb(15 27 45 / .06);
  color: var(--mentor-secondary);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

#app .mentor-roster-filters button[aria-pressed="true"] .mentor-roster-filter-count {
  background: var(--mentor-accent-soft);
  color: var(--mentor-accent);
}

#app .mentor-roster-search-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

#app .mentor-roster-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 280px;
  max-width: 100%;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--mentor-edge);
  border-radius: var(--mentor-radius);
  color: var(--mentor-muted);
  background: var(--mentor-paper);
  box-shadow: var(--mentor-shadow-xs);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

#app .mentor-roster-search:hover {
  border-color: var(--mentor-edge-hover);
}

#app .mentor-roster-search .icon {
  flex: none;
  color: var(--mentor-subtle);
}

#app .mentor-roster .mentor-roster-search input {
  flex: 1;
  width: 0;
  height: 38px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  font-size: var(--mentor-text-label);
}

#app .mentor-roster .mentor-roster-search input:focus-visible {
  outline: none;
  box-shadow: none;
}

#app .mentor-roster-search:focus-within {
  border-color: var(--mentor-accent);
  box-shadow: 0 0 0 3px var(--mentor-accent-ring);
}

#app .mentor-roster-refresh {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--mentor-edge);
  border-radius: var(--mentor-radius);
  background: var(--mentor-paper);
  color: var(--mentor-secondary);
  box-shadow: var(--mentor-shadow-xs);
}

#app .mentor-roster .mentor-roster-feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px solid var(--mentor-error-border);
  border-radius: var(--mentor-radius);
  background: var(--mentor-error-soft);
  color: var(--mentor-error);
  font-size: var(--mentor-text-small);
}

#app .mentor-roster .mentor-roster-feedback:empty {
  display: none;
}

/* Elevated Ledger Card Matching Tab 3 (学员详情) */
#app .mentor-roster .mentor-roster-table {
  contain: paint;
  height: auto;
  min-height: 180px;
  max-height: var(--mentor-roster-height);
  border: 1px solid var(--mentor-rule);
  border-radius: var(--mentor-radius-lg);
  background: var(--mentor-paper);
  box-shadow: var(--mentor-shadow-card);
  scrollbar-gutter: auto;
  scrollbar-color: var(--mentor-edge) transparent;
}

#app .mentor-roster table {
  table-layout: fixed;
  width: 100%;
}

#app .mentor-roster th:nth-child(1) { width: 19%; }
#app .mentor-roster th:nth-child(2) { width: 29%; }
#app .mentor-roster th:nth-child(3) { width: 16%; }
#app .mentor-roster th:nth-child(4) { width: 15%; }
#app .mentor-roster th:last-child { width: 21%; text-align: right; }
#app .mentor-roster td:last-child { text-align: right; }

#app .mentor-roster :is(th, td) {
  padding: 14px 20px;
  border-color: var(--mentor-rule-subtle);
  font-size: var(--mentor-text-label);
  font-weight: 400;
  vertical-align: middle;
}

#app .mentor-roster thead th {
  height: 42px;
  padding-block: 10px;
  border-bottom: 1px solid var(--mentor-rule);
  background: var(--mentor-soft);
  color: var(--mentor-muted);
  font-size: var(--mentor-text-xs);
  font-weight: 600;
  letter-spacing: .02em;
}

#app .mentor-roster tbody th {
  position: sticky;
  inset-inline-start: 0;
  background: var(--mentor-paper);
  color: var(--mentor-ink);
  font-size: var(--mentor-text-label);
  font-weight: 650;
}

#app .mentor-roster small {
  color: var(--mentor-muted);
  font-family: var(--mentor-mono);
  font-size: var(--mentor-text-xs);
  line-height: 1.5;
}

#app .mentor-roster-work strong {
  font-weight: 600;
  color: var(--mentor-ink);
}

#app .mentor-roster-work small {
  font-family: var(--mentor-font);
  color: var(--mentor-muted);
}

#app .mentor-roster-work-state {
  color: var(--mentor-muted);
  font-size: var(--mentor-text-small);
}

/* Color-Coded Status Pills */
#app .mentor-roster-row-state {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

#app .mentor-roster-state-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border: 1px solid var(--mentor-neutral-border);
  border-radius: 6px;
  background: var(--mentor-neutral-soft);
  color: var(--mentor-neutral);
  font-size: var(--mentor-text-xs);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

#app .mentor-roster-row-state[data-tone="pending"] .mentor-roster-state-pill {
  border-color: var(--mentor-accent-border);
  background: var(--mentor-accent-soft);
  color: var(--mentor-accent);
}

#app .mentor-roster-row-state[data-tone="pending"] .mentor-roster-state-pill::before,
#app .mentor-roster-row-state[data-tone="success"] .mentor-roster-state-pill::before,
#app .mentor-roster-row-state[data-tone="warning"] .mentor-roster-state-pill::before,
#app .mentor-roster-row-state[data-tone="error"] .mentor-roster-state-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

#app .mentor-roster-row-state[data-tone="success"] .mentor-roster-state-pill {
  border-color: var(--mentor-success-border);
  background: var(--mentor-success-soft);
  color: var(--mentor-success);
}

#app .mentor-roster-row-state[data-tone="warning"] .mentor-roster-state-pill {
  border-color: var(--mentor-warning-border);
  background: var(--mentor-warning-soft);
  color: var(--mentor-warning);
}

#app .mentor-roster-row-state[data-tone="error"] .mentor-roster-state-pill {
  border-color: var(--mentor-error-border);
  background: var(--mentor-error-soft);
  color: var(--mentor-error);
}

#app .mentor-roster-row-state[data-tone="empty"] .mentor-roster-state-pill {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mentor-subtle);
  font-weight: 500;
}

/* Consistent Row Action Pills */
#app .mentor-roster-row-actions {
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

#app .mentor-roster .mentor-roster-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 0;
  padding: 5px 12px;
  border: 1px solid var(--mentor-accent-border);
  border-radius: 8px;
  box-shadow: none;
  background: var(--mentor-accent-soft);
  color: var(--mentor-accent);
  font: inherit;
  font-size: var(--mentor-text-small);
  font-weight: 600;
}

#app .mentor-roster .mentor-roster-history-action {
  border-color: var(--mentor-edge);
  background: var(--mentor-paper);
  color: var(--mentor-secondary);
  box-shadow: var(--mentor-shadow-xs);
  font-weight: 550;
}

#app .mentor-roster :is(button, .mentor-roster-date, [tabindex]):focus-visible {
  outline: 2px solid var(--mentor-accent);
  outline-offset: 2px;
}

#app .mentor-roster-pager {
  min-height: 56px;
  padding: 12px 2px 0;
  border: 0;
  background: transparent;
}

#app .mentor-roster > .mentor-roster-pager .button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--mentor-edge);
  border-radius: var(--mentor-radius);
  background: var(--mentor-paper);
  box-shadow: var(--mentor-shadow-xs);
  font-size: var(--mentor-text-small);
  font-weight: 550;
}

#app .mentor-roster > .mentor-roster-pager .button:disabled,
#app .mentor-roster-refresh:disabled {
  opacity: .5;
  cursor: not-allowed;
}

#app .mentor-roster-empty {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  min-height: 200px;
  padding: 32px 24px;
  text-align: center;
  color: var(--mentor-muted);
}

#app .mentor-roster-empty p { margin: 0; }
#app .mentor-roster-announcement { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (hover: hover) {
  #app .mentor-roster-filters button:hover:not([aria-pressed="true"]) {
    background: rgb(255 255 255 / .65);
    color: var(--mentor-ink);
  }
  #app .mentor-roster-refresh:hover:not(:disabled) {
    background: var(--mentor-soft);
    border-color: var(--mentor-edge-hover);
    color: var(--mentor-ink);
  }
  #app .mentor-roster .mentor-roster-report-action:hover {
    background: var(--mentor-accent);
    border-color: var(--mentor-accent);
    color: var(--mentor-on-accent);
    box-shadow: var(--mentor-shadow-primary);
  }
  #app .mentor-roster .mentor-roster-history-action:hover {
    background: var(--mentor-soft);
    border-color: var(--mentor-edge-hover);
    color: var(--mentor-ink);
  }
  #app .mentor-roster tbody tr:hover :is(th, td) {
    background: #f8faff;
  }
}

@media (max-width: 960px) {
  #app .mentor-roster .mentor-roster-toolbar { flex-wrap: wrap; gap: 12px; }
  #app .mentor-roster-search-tools { flex: 1; justify-content: flex-end; }
  #app .mentor-roster-search { width: 240px; }
}

@media (max-width: 680px) {
  :root { --mentor-roster-height: 520px; }
  #app .mentor-today-brand { gap: 8px; flex-wrap: wrap; white-space: normal; }
  #app .mentor-today-brand strong { font-size: 18px; }
  #app .mentor-today > .discussion-workbench-nav { width: 100%; justify-content: stretch; margin-bottom: 18px; }
  #app .mentor-today > .discussion-workbench-nav > button { flex: 1; justify-content: center; padding-inline: 8px; }
  #app .mentor-roster .mentor-today-heading { align-items: stretch; flex-direction: column; gap: 10px; }
  #app .mentor-roster-filters { width: 100%; }
  #app .mentor-roster-filters button { flex: 1; padding-inline: 8px; font-size: var(--mentor-text-xs); }
  #app .mentor-roster-search-tools, #app .mentor-roster-search { width: 100%; }
  #app .mentor-roster .mentor-roster-search input { font-size: 16px; }
  #app .mentor-roster .mentor-roster-table { border: 0; background: transparent; box-shadow: none; overflow: visible; max-height: none; }
}

@container (width < 640px) {
  #app .mentor-roster :is(table, tbody, tr, th, td) { display: block; width: 100%; min-width: 0; }
  #app .mentor-roster thead { display: none; }
  #app .mentor-roster tbody tr {
    padding: 16px;
    margin-bottom: 10px;
    border: 1px solid var(--mentor-rule);
    border-radius: 12px;
    background: var(--mentor-paper);
    box-shadow: var(--mentor-shadow-xs);
  }
  #app .mentor-roster tbody th { position: static; padding: 0 0 10px; border-bottom: 1px solid var(--mentor-rule-subtle); margin-bottom: 8px; background: transparent; }
  #app .mentor-roster tbody td { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 5px 0; border: 0; text-align: left; }
  #app .mentor-roster td::before { content: attr(data-label); color: var(--mentor-muted); font-size: var(--mentor-text-xs); font-weight: 550; }
  #app .mentor-roster tbody td:last-child { padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--mentor-rule-subtle); }
  #app .mentor-roster tbody td:last-child::before { display: none; }
  #app .mentor-roster-row-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #app .mentor-roster-row-actions > :only-child { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  #app :is(.mentor-today-mast, .mentor-today) * { transition: none; }
}
