/*
 * 梦想家魔方 · 精修与工作台主题（保持为最后加载的现有样式表）。
 * 末尾已批准主题与 app.js 的 workspace-* 语义增强协议配套。
 */
:root {
  --refine-brand: #f59e0b;
  --refine-brand-hover: #d97706;
  --refine-sidebar: #2d3748;
  --refine-page: #f8f9fb;
  --refine-text: #2d3748;
  --refine-muted: #8490a4;
  --refine-border: #e8edf3;
  --refine-card: #ffffff;
  --refine-shadow: 0 5px 18px rgba(45, 55, 72, .05);
  --refine-shadow-hover: 0 10px 28px rgba(45, 55, 72, .09);
  --refine-radius: 13px;
  --refine-radius-sm: 9px;
}

body {
  color: var(--refine-text);
  background: var(--refine-page);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Sidebar: preserve the original dark slate and amber identity. */
.sidebar {
  width: 230px;
  background: var(--refine-sidebar);
  box-shadow: 1px 0 0 rgba(15, 23, 42, .08);
}

.sidebar .logo {
  padding: 25px 22px 19px;
  color: var(--refine-brand);
  border-bottom-color: rgba(255, 255, 255, .07);
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -.2px;
}

.sidebar .logo span {
  margin-top: 4px;
  color: #7f8999;
  font-size: 10px;
  letter-spacing: 1.6px;
}

.sidebar nav {
  padding: 10px 10px;
}

.sidebar nav a {
  min-height: 42px;
  margin: 2px 0;
  padding: 9px 13px;
  gap: 11px;
  color: #aeb7c7;
  border: 0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 520;
  line-height: 1.45;
}

.sidebar nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .055);
}

.sidebar nav a.active {
  color: #fff;
  background: rgba(245, 158, 11, .14);
  box-shadow: inset 3px 0 0 var(--refine-brand);
}

.sidebar nav a .icon {
  min-width: 18px;
  opacity: .76;
  text-align: center;
}

.sidebar nav a.active .icon {
  opacity: 1;
}

/* Header and page spacing. */
.header {
  min-height: 70px;
  padding: 13px 34px;
  border-bottom: 1px solid var(--refine-border);
  background: rgba(255, 255, 255, .94);
  box-shadow: none;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.page-head-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.header h1 {
  color: #273247;
  font-size: 21px;
  font-weight: 760;
  letter-spacing: -.35px;
}

.page-subtitle {
  color: #8a94a6;
  font-size: 12px;
  font-weight: 520;
  letter-spacing: .05px;
}

/* Keep dense schedule controls aligned and legible without changing page structure. */
.schedule-filter-strip {
  gap: 10px;
  align-items: center;
}

.schedule-filter-strip input,
.schedule-filter-strip select {
  min-height: 36px;
  color: #3b465a;
  background: #fff;
}

.schedule-filter-strip #schedSearch {
  width: 200px;
}

.header .actions {
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-actions-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.content {
  padding: 26px 34px 40px;
}

.page-content-shell {
  display: grid;
  gap: 18px;
}

.page-filter-strip {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 2px;
  padding: 14px 16px;
  border: 1px solid #e5ebf3;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98) 0%, rgba(248, 250, 252, .96) 100%);
  box-shadow: 0 4px 14px rgba(45, 55, 72, .045);
}

.page-filter-strip > span {
  color: #8a94a6;
  font-size: 12px;
  font-weight: 600;
}

/* Buttons: one clear hierarchy across all pages. */
.btn {
  min-height: 36px;
  padding: 8px 15px;
  gap: 6px;
  border-radius: var(--refine-radius-sm);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.35;
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(245, 158, 11, .2);
  outline-offset: 2px;
}

.btn-primary {
  color: #fff;
  border: 1px solid var(--refine-brand);
  background: var(--refine-brand);
  box-shadow: 0 4px 11px rgba(245, 158, 11, .2);
}

.btn-primary:hover {
  border-color: var(--refine-brand-hover);
  background: var(--refine-brand-hover);
  box-shadow: 0 7px 16px rgba(217, 119, 6, .23);
}

.btn-outline {
  color: #4f5c70;
  border: 1px solid #dfe5ed;
  background: #fff;
  box-shadow: none;
}

.btn-outline:hover {
  color: #2f3a4d;
  border-color: #c8d0dc;
  background: #f9fafc;
  box-shadow: 0 5px 13px rgba(45, 55, 72, .07);
}

.btn-danger {
  color: #d94848;
  border: 1px solid #f3caca;
  background: #fff;
}

.btn-danger:hover {
  color: #c73737;
  border-color: #ecaaaa;
  background: #fff7f7;
}

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

.btn-xs {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 11px;
}

.btn-group {
  gap: 7px;
}

/* Metric cards. */
.cards {
  gap: 14px;
  margin-bottom: 20px;
}

.page-metric-grid {
  margin-bottom: 0;
}

.card {
  min-height: 108px;
  padding: 19px 21px;
  border: 1px solid var(--refine-border);
  border-radius: var(--refine-radius);
  background: var(--refine-card);
  box-shadow: 0 4px 16px rgba(45, 55, 72, .045);
}

.card::before {
  top: 0;
  right: auto;
  bottom: 0;
  width: 3px;
  height: auto;
  background: var(--refine-brand);
  opacity: .74;
}

.card:hover {
  border-color: #dde3eb;
  box-shadow: var(--refine-shadow-hover);
  transform: translateY(-1px);
}

.card .label {
  margin-bottom: 7px;
  color: var(--refine-muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .2px;
  text-transform: none;
}

.card .value {
  color: var(--refine-text);
  font-size: 30px;
  font-weight: 780;
  letter-spacing: -.7px;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
}

.card .value.ok {
  color: #15956f;
}

.card .value.warn {
  color: #e05252;
}

/* Tables and toolbars. */
.table-wrap,
.timetable-wrap,
.pkg-table-wrap {
  border: 1px solid var(--refine-border);
  border-radius: var(--refine-radius);
  background: #fff;
  box-shadow: var(--refine-shadow);
}

.surface-panel {
  overflow: hidden;
}

.table-wrap .toolbar {
  min-height: 55px;
  padding: 12px 18px;
  gap: 10px;
  border-bottom: 1px solid var(--refine-border);
}

.panel-toolbar {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.table-wrap .toolbar strong {
  color: #344055;
  font-weight: 720;
}

.table-wrap .toolbar input {
  height: 36px;
  padding: 8px 12px;
  border-color: #dfe5ed;
  border-radius: var(--refine-radius-sm);
  background: #f9fafc;
}

.table-wrap .toolbar input:focus {
  border-color: var(--refine-brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .11);
}

th {
  padding: 11px 15px;
  color: #7f899b;
  border-bottom: 1px solid #e6ebf1;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 680;
  letter-spacing: .2px;
}

td {
  padding: 12px 15px;
  color: #3b465a;
  border-bottom-color: #eef1f5;
  font-size: 12.5px;
  line-height: 1.45;
}

tr:hover td {
  background: #fbfcfd;
}

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

/* Forms, badges and dialogs. */
.form-group {
  margin-bottom: 15px;
}

.detail-grid-upgraded .detail-item {
  padding: 12px 14px;
  border: 1px solid #edf2f7;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.detail-grid-upgraded .dl {
  color: #8a94a6;
}

.detail-grid-upgraded .dv {
  color: #2f3b50;
}

.form-group label {
  margin-bottom: 6px;
  color: #566277;
  font-size: 11.5px;
  font-weight: 680;
}

.form-group input,
.form-group select,
.form-group textarea {
  min-height: 40px;
  padding: 9px 12px;
  color: #354055;
  border-color: #dfe5ed;
  border-radius: var(--refine-radius-sm);
  background: #f9fafc;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--refine-brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .11);
}

.badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 680;
}

.modal {
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(30, 41, 59, .2);
}

.modal-header {
  padding: 18px 22px;
  color: #303b4f;
  border-bottom-color: var(--refine-border);
  font-size: 15px;
}

.modal-body {
  padding: 20px 22px;
}

.modal-footer {
  padding: 13px 22px;
  border-top-color: var(--refine-border);
}

.login-box {
  border: 1px solid rgba(226, 232, 240, .82);
  border-radius: 17px;
}

.login-box h2 {
  color: #2d3748;
  letter-spacing: -.4px;
}

.login-box input {
  border-color: #dfe5ed;
  background: #f9fafc;
}

/* Timetable controls keep their course colors while gaining the shared rhythm. */
.week-nav {
  gap: 8px;
  margin-bottom: 18px;
}

.week-nav button,
.week-nav select {
  min-height: 36px;
  border-color: #dfe5ed;
  border-radius: var(--refine-radius-sm);
  color: #4f5c70;
  background: #fff;
}

.week-nav button.today-btn {
  color: #fff;
  border-color: var(--refine-brand);
  background: var(--refine-brand);
}

.tt-block {
  border-radius: 7px;
  box-shadow: 0 1px 3px rgba(45, 55, 72, .06);
}

.tt-block:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(45, 55, 72, .11);
}

.notify-bell,
.pkg-btn {
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.notify-bell:hover,
.pkg-btn:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.notify-center-toast {
  border: 1px solid rgba(226, 232, 240, .9);
  box-shadow: 0 24px 56px rgba(15, 23, 42, .22);
}

.notify-center-toast p,
.notify-item {
  white-space: pre-line;
}

.pkg-table-wrap {
  border-radius: 14px;
}

.pkg-table-wrap td input,
.pkg-table-wrap td select {
  border-radius: 8px;
}

@media (max-width: 768px) {
  .content {
    padding: 10px 9px 80px;
  }

  .header {
    min-height: 58px;
    padding: 9px 13px;
  }

  .header h1 {
    font-size: 16px;
  }

  .page-subtitle {
    font-size: 11px;
  }

  .page-filter-strip {
    gap: 8px;
    padding: 12px;
  }

  .cards {
    gap: 8px;
    margin-bottom: 12px;
  }

  .card {
    min-height: 94px;
    padding: 14px 15px;
  }

  .card .value {
    font-size: 24px;
  }

  .btn {
    min-height: 42px;
    padding: 9px 14px;
    font-size: 13px;
  }

  .btn-sm {
    min-height: 38px;
  }

  .btn-xs {
    min-height: 34px;
  }

  .table-wrap,
  .timetable-wrap,
  .mobile-card,
  .tt-mobile .tt-card {
    border-radius: 11px;
  }

  th,
  td {
    padding: 9px 10px;
    font-size: 11px;
  }

  .modal-body {
    padding: 14px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Data Center monthly view */
.analytics-center-scoped {
  --analytics-blue: #2563eb;
  --analytics-ink: #243047;
  --analytics-muted: #718096;
  display: block;
}

.analytics-center-scoped .analytics-month-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid #dfe7f2;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff 0%, #f7faff 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, .06);
}

.analytics-center-scoped .analytics-month-copy,
.analytics-center-scoped .analytics-month-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.analytics-center-scoped .analytics-eyebrow,
.analytics-center-scoped .analytics-section-kicker {
  color: var(--analytics-muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .12em;
}

.analytics-center-scoped .analytics-month-copy strong {
  color: var(--analytics-ink);
  font-size: 19px;
  letter-spacing: -.02em;
}

.analytics-center-scoped .analytics-month-actions input[type="month"] {
  min-height: 38px;
  padding: 7px 11px;
  color: #344156;
  border: 1px solid #d9e1eb;
  border-radius: 9px;
  background: #fff;
  font: inherit;
}

.analytics-center-scoped .analytics-month-state,
.analytics-center-scoped .analytics-section-month {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
}

.analytics-center-scoped .analytics-month-state.current {
  color: #047857;
  background: #d1fae5;
}

.analytics-center-scoped .analytics-month-state.history {
  color: #92400e;
  background: #fef3c7;
}

.analytics-center-scoped .analytics-primary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.analytics-center-scoped .analytics-primary-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-top: 3px solid var(--analytics-blue);
}

.analytics-center-scoped .analytics-primary-card:nth-child(2) {
  border-top-color: #10b981;
}

.analytics-center-scoped .analytics-primary-card:nth-child(3) {
  border-top-color: #f59e0b;
}

.analytics-center-scoped .analytics-primary-card:nth-child(4) {
  border-top-color: #8b5cf6;
}

.analytics-center-scoped .analytics-primary-card .value {
  margin-top: 8px;
  color: var(--analytics-ink);
  font-size: 30px;
  line-height: 1;
}

.analytics-center-scoped .analytics-card-note,
.analytics-center-scoped .analytics-ratio {
  color: var(--analytics-muted);
  font-size: 10.5px;
  font-weight: 500;
}

.analytics-center-scoped .analytics-card-note {
  margin-top: 9px;
}

.analytics-center-scoped .analytics-section {
  margin-top: 18px;
  margin-bottom: 0;
}

.analytics-center-scoped .analytics-section .toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 11px 16px;
}

.analytics-center-scoped .analytics-section .toolbar > div {
  display: grid;
  gap: 2px;
}

.analytics-center-scoped .analytics-section-month {
  color: #53637a;
  background: #edf2f7;
}

.analytics-center-scoped .analytics-table-scroll {
  overflow-x: auto;
}

.analytics-center-scoped .analytics-total-row {
  color: #334155;
  background: #f8fafc;
  font-weight: 720;
}

.analytics-center-scoped .analytics-empty {
  padding: 32px 16px;
  color: var(--analytics-muted);
  text-align: center;
}

.analytics-center-scoped .analytics-warn {
  color: #dc2626;
}

.analytics-center-scoped .analytics-funnel-body {
  display: grid;
  gap: 16px;
  padding: 20px 22px 22px;
}

.analytics-center-scoped .analytics-funnel-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: #40506a;
  font-size: 12px;
  font-weight: 650;
}

.analytics-center-scoped .analytics-funnel-label strong {
  color: var(--analytics-ink);
  font-size: 14px;
}

.analytics-center-scoped .analytics-funnel-label small {
  color: var(--analytics-muted);
  font-size: 10px;
}

.analytics-center-scoped .analytics-funnel-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.analytics-center-scoped .analytics-funnel-track span {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  transition: width .3s ease;
}

@media (max-width: 900px) {
  .analytics-center-scoped .analytics-primary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .analytics-center-scoped .analytics-month-bar {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

  .analytics-center-scoped .analytics-month-copy,
  .analytics-center-scoped .analytics-month-actions {
    flex-wrap: wrap;
  }

  .analytics-center-scoped .analytics-month-actions input[type="month"] {
    flex: 1 1 150px;
    min-width: 0;
  }

  .analytics-center-scoped .analytics-month-actions .btn {
    flex: 0 0 auto;
  }

  .analytics-center-scoped .analytics-primary-cards {
    gap: 8px;
  }

  .analytics-center-scoped .analytics-primary-card {
    min-height: 112px;
    padding: 13px;
  }

  .analytics-center-scoped .analytics-primary-card .value {
    font-size: 25px;
  }

  .analytics-center-scoped .analytics-section {
    margin-top: 14px;
  }

  .analytics-center-scoped .analytics-section .toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

/* ===== 手机端全面优化 ===== */

/* --- 核心滚动修复（解决表格无法滑动的问题） --- */
@media (max-width: 768px) {
  /* 修复表格横向滚动 - 最关键 */
  .table-wrap {
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap table {
    min-width: 560px;
  }

  /* 修复主内容区滚动 */
  .main {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* --- 模态框 --- */
  .modal {
    width: 94%;
    max-width: 94%;
    border-radius: 16px 16px 0 0;
    max-height: 85vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    position: fixed;
    bottom: 0;
    top: auto;
    animation: mobileSlideUp .25s ease;
  }

  @keyframes mobileSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .modal-header {
    padding: 16px 18px;
    font-size: 16px;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    border-radius: 16px 16px 0 0;
  }

  .modal-body {
    padding: 14px 16px;
    max-height: 50vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-footer {
    padding: 12px 16px;
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid var(--refine-border);
    display: flex;
    gap: 8px;
  }

  .modal-footer .btn {
    flex: 1;
    min-height: 44px;
  }

  .modal-close {
    font-size: 24px;
    padding: 8px 12px;
    min-width: 44px;
    min-height: 44px;
  }

  /* --- 头部 --- */
  .header {
    min-height: 50px;
    padding: 8px 12px;
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(12px);
  }

  .header h1 { font-size: 16px; }
  .page-subtitle { display: none; }

  .header .actions {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 4px;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .header .actions::-webkit-scrollbar { display: none; }

  .header .actions .btn {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 11px;
    padding: 5px 10px;
    min-height: 32px;
    border-radius: 7px;
  }

  /* --- 内容区 --- */
  .content {
    padding: 8px 8px 80px;
  }

  /* --- 卡片 --- */
  .cards {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
  }

  .card {
    min-height: 82px;
    padding: 12px 13px;
    border-radius: 11px;
  }

  .card .label {
    font-size: 10px;
    margin-bottom: 2px;
  }

  .card .value {
    font-size: 24px;
  }

  /* --- 底部导航 --- */
  .bottom-bar {
    display: flex;
    height: 54px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -1px 0 rgba(0,0,0,.05), 0 -4px 12px rgba(0,0,0,.04);
    z-index: 200;
  }

  .bottom-bar a {
    font-size: 10px;
    font-weight: 600;
    gap: 1px;
    padding: 3px 0 0;
    color: #8896a8;
    min-height: 44px;
    justify-content: flex-start;
  }

  .bottom-bar a.active {
    color: var(--refine-brand);
  }

  .bottom-bar a.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 3px;
    background: var(--refine-brand);
    border-radius: 0 0 3px 3px;
  }

  .bottom-bar a .bb-icon { font-size: 20px; }

  /* --- 按钮 --- */
  .btn {
    min-height: 40px;
    padding: 8px 13px;
    font-size: 13px;
  }

  .btn-sm { min-height: 36px; }
  .btn-xs { min-height: 32px; font-size: 11px; padding: 5px 9px; }

  .btn-group {
    gap: 4px;
    flex-wrap: wrap;
  }

  /* --- 表单 --- */
  .form-group label { font-size: 12px; }
  .form-group input, .form-group select, .form-group textarea {
    padding: 11px 13px;
    font-size: 16px;
    min-height: 44px;
    border-radius: 9px;
    background: #fff;
  }

  .form-row {
    flex-direction: column;
    gap: 8px;
  }

  /* --- 登录框 --- */
  .login-box {
    width: 90%;
    padding: 24px 18px;
  }

  /* --- 课表 --- */
  .timetable-wrap { display: none; }
  .tt-mobile { display: block; }

  .tt-mobile .tt-day-header {
    padding: 12px 14px;
    border-radius: 10px 10px 0 0;
  }

  .tt-mobile .tt-day-header .day-label { font-size: 15px; }

  .tt-mobile .tt-card {
    padding: 12px 14px;
    margin: 6px 0;
    gap: 10px;
    border-radius: 10px;
  }

  .tt-mobile .tt-card .tt-time {
    font-size: 14px;
    min-width: 72px;
  }

  .tt-mobile .tt-card .tt-stu {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tt-mobile .tt-card .tt-actions button {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 36px;
  }

  /* --- 课表页周导航 --- */
  .week-nav {
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .week-nav button {
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 12px;
  }

  .week-nav .week-label {
    font-size: 13px;
    min-width: auto;
    flex-shrink: 0;
  }

  /* --- 体验课跟踪筛选栏 --- */
  #contentArea input[type="date"],
  #contentArea input[type="text"] {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* --- 快递包裹按钮 --- */
  .pkg-btn {
    right: 12px;
    bottom: 90px;
    width: 40px;
    height: 40px;
    font-size: 18px;
    z-index: 190;
  }

  /* --- 退出登录 --- */
  .logout-fixed {
    bottom: 66px;
    left: 6px;
    z-index: 190;
  }

  .logout-fixed a {
    font-size: 10px;
    padding: 4px 8px;
  }

  /* --- Toast --- */
  .toast-notify {
    top: 6px;
    right: 6px;
    left: 6px;
    max-width: none;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
  }

  /* --- 数据中心 --- */
  .analytics-center-scoped .analytics-primary-cards {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .analytics-center-scoped .analytics-primary-card {
    min-height: 90px;
    padding: 12px;
  }

  .analytics-center-scoped .analytics-primary-card .value {
    font-size: 22px;
  }

  /* --- 排课页面筛选条 --- */
  .schedule-filter-strip {
    gap: 4px;
    padding: 8px 10px;
    flex-wrap: wrap;
  }

  .schedule-filter-strip input,
  .schedule-filter-strip select {
    min-height: 34px;
    font-size: 13px;
    padding: 5px 8px;
    flex: 1 1 auto;
    min-width: 80px;
  }

  /* --- 桌面专用元素隐藏 --- */
  .desktop-only { display: none !important; }
  .ai-robot { display: none !important; }
  .ai-chat-popup { display: none !important; }
}

/* 超小屏额外优化（iPhone SE / 320px） */
@media (max-width: 380px) {
  .cards {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .card {
    min-height: 80px;
    padding: 10px 12px;
  }

  .card .value {
    font-size: 22px;
  }

  .table-wrap table {
    min-width: 480px;
  }

  .btn {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 12px;
  }

  .modal {
    width: 98%;
    max-width: 98%;
  }
}

/* WORKSPACE THEME — approved 2026-09-08 */
/* Shared presentation only. Existing routes, records, handlers and permissions remain intact. */
:root {
  --workspace-page: #f5f3ed;
  --workspace-nav: #233631;
  --workspace-brand: #ec9b29;
  --workspace-paper: #fffefa;
  --workspace-ink: #29382f;
  --workspace-muted: #687760;
  --workspace-line: #e0e4d6;
  --workspace-soft: #f0f1e7;
  --workspace-success: #46734f;
  --refine-brand: var(--workspace-brand);
  --refine-brand-hover: #bd751b;
  --refine-sidebar: var(--workspace-nav);
  --refine-page: var(--workspace-page);
  --refine-text: var(--workspace-ink);
  --refine-muted: var(--workspace-muted);
  --refine-border: var(--workspace-line);
  --refine-card: var(--workspace-paper);
  --refine-shadow: 0 3px 10px rgba(43, 59, 34, .035);
  --refine-shadow-hover: 0 5px 16px rgba(43, 59, 34, .07);
  --refine-radius: 12px;
  --refine-radius-sm: 8px;
  --bg: var(--workspace-page);
  --white: var(--workspace-paper);
  --sidebar-bg: var(--workspace-nav);
  --text: var(--workspace-ink);
  --text-light: var(--workspace-muted);
  --border: var(--workspace-line);
}

body {
  color: var(--workspace-ink);
  background: var(--workspace-page);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.main,
.content,
.page-content-shell {
  min-width: 0;
}

.main { background: var(--workspace-page); }
.content { padding: 25px 30px 36px; }
.page-content-shell { align-content: start; gap: 18px; }

.sidebar,
body.desktop-base-active .sidebar {
  width: 224px;
  background: var(--workspace-nav);
  border-right: 1px solid #3a4c40;
  box-shadow: none;
}

.sidebar .logo,
body.desktop-base-active .sidebar .logo {
  padding: 29px 23px 24px;
  color: #edc888;
  letter-spacing: .5px;
  border-bottom-color: #3a4c40;
}

.sidebar .logo span { color: #b4c0af; font-size: 10px; }
.sidebar nav { padding: 13px 11px; }
.sidebar nav a,
body.desktop-base-active .sidebar nav a {
  min-height: 46px;
  padding: 10px 14px;
  color: #c0cabd;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  gap: 11px;
}

.sidebar nav a:hover,
body.desktop-base-active .sidebar nav a:hover { background: #2e4338; color: #fff6e2; }
.sidebar nav a.active,
body.desktop-base-active .sidebar nav a.active {
  color: #f4deb6;
  background: #354a3f;
  box-shadow: inset 3px 0 0 var(--workspace-brand);
}
.sidebar .stats { color: #b1bfaa; border-top-color: #3a4c40; }
.sidebar > div:last-child a { color: #b8c5b0 !important; }

.header,
body.desktop-base-active .header {
  min-height: 76px;
  padding: 16px 30px;
  gap: 16px;
  color: var(--workspace-ink);
  background: #faf9f5;
  border-bottom: 1px solid var(--workspace-line);
  box-shadow: none;
}
.header h1,
body.desktop-base-active .header h1 {
  color: var(--workspace-ink);
  font-family: inherit;
  font-size: 24px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -.6px;
}
.page-subtitle,
body.desktop-base-active .page-subtitle { color: var(--workspace-muted); font-size: 13px; }
.header .actions { gap: 8px; }
.header > div:last-child { min-width: 0; }
.notify-bell,
body.desktop-base-active .notify-bell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  background: var(--workspace-paper);
  border: 1px solid var(--workspace-line);
  border-radius: 9px;
}

.content .btn,
.header .btn,
.modal .btn { min-height: 40px; font-size: 13px; font-weight: 550; border-radius: 8px; }
.btn:hover { transform: none; }
.btn-primary {
  color: #fff8e7;
  background: var(--workspace-nav);
  border-color: var(--workspace-nav);
  box-shadow: none;
}
.btn-primary:hover { background: #354d3d; border-color: #354d3d; box-shadow: none; }
.btn-outline { background: var(--workspace-paper); color: #536448; border-color: #d6ddc9; }
.btn-outline:hover { background: #f2f3e8; color: #354b30; border-color: #bccbac; box-shadow: none; }
.btn-danger { background: #fff8f3; border-color: #ebc8b7; color: #a04e33; }
.btn:disabled,
button:disabled { cursor: not-allowed; }
.content button:focus-visible,
.header button:focus-visible,
.modal button:focus-visible,
.sidebar a:focus-visible,
.bottom-bar a:focus-visible,
.content input:focus-visible,
.content select:focus-visible,
.modal input:focus-visible,
.modal select:focus-visible,
.modal textarea:focus-visible {
  outline: 3px solid #a96918;
  outline-offset: 3px;
}

.page-filter-strip,
.schedule-filter-strip {
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--workspace-line);
  border-radius: 10px;
  background: var(--workspace-paper);
  box-shadow: none;
}
.page-filter-strip > span { color: #697860; font-size: 12px; }
.content input:not([type="checkbox"]):not([type="radio"]),
.content select,
.modal input:not([type="checkbox"]):not([type="radio"]),
.modal select,
.modal textarea {
  min-height: 40px;
  min-width: 0;
  max-width: 100%;
  border: 1px solid #d7ddcb;
  border-radius: 8px;
  background: var(--workspace-paper);
  color: var(--workspace-ink);
  font-size: 14px;
}
.content input::placeholder,
.modal input::placeholder,
.modal textarea::placeholder { color: #7b8770; }
.content input[type="checkbox"],
.content input[type="radio"],
.modal input[type="checkbox"],
.modal input[type="radio"] { accent-color: #667e46; }
.workspace-filter-toggle { display: none; min-height: 44px; }

.table-wrap,
.timetable-wrap,
.pkg-table-wrap,
.surface-panel,
.card,
.mobile-card,
.analytics-center-scoped .analytics-primary-card {
  border: 1px solid var(--workspace-line);
  border-radius: 12px;
  background: var(--workspace-paper);
  box-shadow: var(--refine-shadow);
}
.table-wrap .toolbar,
.panel-toolbar {
  min-height: 56px;
  padding: 14px 18px;
  background: var(--workspace-paper);
  border-bottom: 1px solid var(--workspace-line);
}
.table-wrap .toolbar strong { color: var(--workspace-ink); font-size: 15px; font-weight: 600; }
.content table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.content th {
  padding: 12px 14px;
  color: #68755c;
  background: #f3f5eb;
  border-bottom-color: var(--workspace-line);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.5;
}
.content td {
  padding: 13px 14px;
  color: #35492f;
  border-bottom-color: #e9eddf;
  font-size: 14px;
  line-height: 1.6;
}
.content tr:hover td { background: #f8faf1; }
.workspace-cell-title { font-weight: 600; }
.workspace-cell-actions { white-space: normal; }
.workspace-cell-actions .btn { margin: 2px 3px 2px 0; }
.badge { font-size: 12px; border-radius: 5px; font-weight: 550; }
.cards { gap: 14px; }
.card { padding: 19px; }
.card::before { opacity: .7; height: 3px; }
.card:hover { transform: none; }
.card .label { color: #647359; font-size: 13px; }
.card .value { color: #354d36; font-size: 30px; font-weight: 600; }
.card .value.ok { color: var(--workspace-success); }
.card .value.warn { color: #a35332; }
.detail-grid-upgraded .detail-item { background: #fbfcf4; border-color: var(--workspace-line); box-shadow: none; }
.detail-grid-upgraded .dl { color: #728062; font-size: 12px; }
.detail-grid-upgraded .dv { color: var(--workspace-ink); font-size: 15px; }
.form-group label { color: #647357; font-size: 13px; }
.analytics-center-scoped {
  --analytics-blue: var(--workspace-brand);
  --analytics-ink: var(--workspace-ink);
  --analytics-muted: var(--workspace-muted);
}
.analytics-center-scoped .analytics-month-bar { background: var(--workspace-paper); border-color: var(--workspace-line); box-shadow: var(--refine-shadow); }
.analytics-center-scoped .analytics-card-note,
.analytics-center-scoped .analytics-ratio { color: var(--workspace-muted); font-size: 12px; line-height: 1.6; }
.analytics-center-scoped .analytics-section-month { color: var(--workspace-muted); background: var(--workspace-soft); font-size: 12px; }
.analytics-center-scoped .analytics-total-row { color: var(--workspace-ink); background: var(--workspace-soft); }
.analytics-center-scoped .analytics-funnel-label { color: var(--workspace-ink); font-size: 14px; }
.analytics-center-scoped .analytics-funnel-label small { font-size: 12px; }
.analytics-center-scoped .analytics-funnel-track { background: var(--workspace-soft); }

.modal-overlay { z-index: 400; background: rgba(28, 44, 40, .38); }
.modal {
  border: 1px solid #dfe4d2;
  background: var(--workspace-paper);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(25, 46, 29, .19);
}
.modal-header { color: var(--workspace-ink); background: var(--workspace-paper); border-color: var(--workspace-line); font-weight: 600; }
.modal-body { font-size: 14px; }
.modal-footer { border-color: var(--workspace-line); background: #fbfcf5; }
.modal-close { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: #627257; }
.workspace-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.workspace-menu .btn { min-width: 0; min-height: 56px; padding: 14px; text-align: left; justify-content: flex-start; white-space: normal; }
.notify-inbox-overlay { z-index: 410; }
.notify-inbox { background: var(--workspace-paper); border: 1px solid var(--workspace-line); }
.notify-item { color: var(--workspace-ink); font-size: 14px; }
.notify-item .ni-time { font-size: 12px; color: var(--workspace-muted); }
.toast-notify { z-index: 600; background: #fbfff4; color: #39502f; border-left-color: #8b9f68; }
.loading,
.desktop-lazy-loading,
.desktop-lazy-error { color: #647459; font-size: 14px; }
.desktop-lazy-error p,
.desktop-lazy-loading small { color: #6f7d63; font-size: 13px; }

/* The existing teaching-hub data becomes the primary working surface, in normal flow. */
body.desktop-base-active {
  --base-page: var(--workspace-page);
  --base-panel: var(--workspace-paper);
  --base-line: var(--workspace-line);
  --base-text: var(--workspace-ink);
  --base-muted: var(--workspace-muted);
  --base-orange: var(--workspace-brand);
  background: var(--workspace-page);
}
body.desktop-base-active .main { background: var(--workspace-page); }
body.desktop-base-active .content { padding: 25px 30px 36px; }
.desktop-base { min-height: 0; padding: 0; overflow: visible; font-family: inherit; color: var(--workspace-ink); }
.desktop-base::before,
.desktop-base__grid,
.desktop-base__orbit,
.desktop-base__board::before,
.desktop-base__board::after,
.desktop-base__hub::before,
.desktop-base__node::after,
.desktop-base__legend { display: none; }
.desktop-base__intro { padding: 0 0 18px; gap: 16px; }
.desktop-base__eyebrow { color: #94702f; font-size: 10px; }
.desktop-base__intro h2 { font-size: 24px; letter-spacing: -.5px; font-weight: 600; }
.desktop-base__intro p:last-child { color: var(--workspace-muted); font-size: 13px; }
.desktop-base__state { min-width: 200px; border: 1px solid var(--workspace-line); border-radius: 8px; background: var(--workspace-paper); box-shadow: none; }
.desktop-base__state small { color: var(--workspace-muted); font-size: 12px; }
.desktop-base__board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.desktop-base__hub {
  position: relative;
  inset: auto;
  grid-column: 1 / -1;
  min-width: 0;
  width: auto;
  border: 1px solid var(--workspace-line);
  border-radius: 12px;
  background: var(--workspace-paper);
  box-shadow: var(--refine-shadow);
}
.desktop-base__hub-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--workspace-line); background: var(--workspace-paper); }
.desktop-base__hub-head strong { font-size: 17px; }
.desktop-base__hub-head small { font-size: 10px; }
.desktop-base__hub-head > span { font-size: 12px; color: var(--workspace-muted); }
.desktop-base__hub-body { display: flex; flex-direction: column; padding: 16px; gap: 16px; }
.desktop-base__metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.desktop-base__metrics article { padding: 17px 15px; border: 1px solid var(--workspace-line); border-radius: 9px; background: #fafbf2; box-shadow: none; }
.desktop-base__metrics small { display: block; color: #69765e; font-size: 13px; white-space: normal; }
.desktop-base__metrics strong { font-size: 28px; color: #344b32; }
.desktop-base__metrics article > span { font-size: 12px; color: #758465; }
.desktop-base__panels { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; overflow: visible; }
.desktop-base__panel { display: flex; flex-direction: column; min-width: 0; min-height: 220px; border: 1px solid var(--workspace-line); border-radius: 9px; background: var(--workspace-paper); }
.desktop-base__panel > header { display: flex; align-items: flex-start; justify-content: space-between; min-height: 68px; padding: 12px; flex-wrap: wrap; background: #fafbf3; border-bottom: 1px solid var(--workspace-line); }
.desktop-base__panel > header small { font-size: 10px; color: #7d886d; }
.desktop-base__panel > header h3 { font-size: 15px; }
.desktop-base__panel > header h3 b { font-size: 12px; }
.desktop-base__panel-actions { max-width: 100%; }
.desktop-base__summary-action { min-height: 40px; padding: 7px 12px; border: 1px solid #d7dfc8; border-radius: 7px; font-size: 12px; background: #edf1e3; color: #46603d; }
.desktop-base__summary-action:hover { background: #e1e9d2; }
.desktop-base__teacher-filter { display: flex; max-width: 100%; gap: 6px; overflow-x: auto; }
.desktop-base__teacher-filter button { min-height: 38px; padding: 6px 11px; font-size: 12px; border-radius: 7px; }
.desktop-base__panel-body { max-height: 390px; overflow: auto; }
.desktop-base__course-row,
.desktop-base__renewal-row { padding: 11px 12px; gap: 8px; color: #69745e; font-size: 13px; line-height: 1.6; border-bottom: 1px solid #e9eddf; }
.desktop-base__course-row { grid-template-columns: 80px minmax(65px, 1fr) minmax(62px, 1fr) 48px; }
.desktop-base__renewal-row { grid-template-columns: minmax(65px, 1fr) minmax(58px, .8fr) 57px 57px; }
.desktop-base__course-row strong,
.desktop-base__renewal-row strong { font-size: 14px; color: #34492f; }
.desktop-base__renewal-row b { font-size: 12px; }
.desktop-base__empty { font-size: 13px; color: #778367; }
.desktop-base__node {
  position: relative;
  inset: auto;
  width: auto;
  min-height: 92px;
  padding: 16px 20px;
  border: 1px solid var(--workspace-line);
  border-radius: 10px;
  background: var(--workspace-paper);
  box-shadow: var(--refine-shadow);
}
.desktop-base__node::before { top: 17px; right: 14px; width: 4px; height: 22px; border-radius: 2px; opacity: .6; box-shadow: none; }
.desktop-base__node > span { display: block; font-size: 15px; font-weight: 600; }
.desktop-base__node > small { display: block; color: var(--workspace-muted); font-size: 12px; letter-spacing: 0; }
.desktop-base__node > i { display: none; }
.desktop-base__node:hover { transform: none; border-color: #bfcdab; background: #fbfdf4; box-shadow: var(--refine-shadow-hover); }

.timetable-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.timetable-scroll table { min-width: 1000px; }
.timetable-scroll thead th { color: #596d4e; background: #f4f6eb; font-size: 13px; }
.timetable-scroll td { font-size: 13px; }
.tt-block { min-height: 44px; }
.tt-block .tt-name { font-size: 13px; }
.tt-block .tt-teacher { font-size: 11px; opacity: .85; }
.tt-time-tag { font-size: 11px; opacity: .8; }
.tt-block.completed { opacity: .78; }
.week-nav button { min-height: 44px; border-radius: 8px; font-size: 13px; }
.week-nav button.today-btn { background: #e9eedb; color: #466036; border-color: #d9e1c8; box-shadow: none; }

@media (min-width: 769px) and (max-width: 1120px) {
  .sidebar,
  body.desktop-base-active .sidebar { width: 190px; }
  .content,
  body.desktop-base-active .content { padding: 22px; }
  .header,
  body.desktop-base-active .header { padding-inline: 22px; flex-wrap: wrap; }
  .desktop-base__panels { grid-template-columns: 1fr; }
  .desktop-base__board { min-height: 0; }
}

@media (max-width: 768px) {
  body { min-height: 100dvh; }
  .main { overflow-x: visible !important; overflow-y: visible !important; min-width: 0; }
  .content,
  body.desktop-base-active .content { padding: 12px 14px calc(92px + env(safe-area-inset-bottom, 0px)); overflow: visible; }
  .page-content-shell { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .header,
  body.desktop-base-active .header {
    min-height: 60px;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 8px;
    gap: 8px;
    flex-wrap: wrap;
    background: #faf9f5;
    position: sticky;
    top: 0;
    z-index: 50;
  }
  .header h1,
  body.desktop-base-active .header h1 { font-size: 22px; line-height: 1.35; }
  .header .page-head-copy { flex: 1 1 auto; }
  .header > div:last-child { display: contents !important; }
  .header #notifyBell { order: 1; flex: 0 0 44px; }
  .header #headerActions {
    order: 2;
    display: flex;
    flex: 1 0 100%;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    gap: 7px;
    padding: 3px 0 5px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    justify-content: flex-start;
    scrollbar-width: thin;
  }
  .header #headerActions:empty { display: none; }
  .header #headerActions .btn { flex: 0 0 auto; white-space: nowrap; }
  .page-subtitle { display: none; }
  .mobile-back { min-height: 44px; align-content: center; font-size: 14px; margin-right: 3px; }

  .content button,
  .header button,
  .modal button,
  .notify-inbox button,
  .content .btn,
  .header .btn,
  .modal .btn {
    min-height: 44px !important;
    min-width: 44px;
    font-size: 14px !important;
    padding: 9px 12px;
    border-radius: 8px;
  }
  .content input:not([type="checkbox"]):not([type="radio"]),
  .content select,
  .content textarea,
  .modal input:not([type="checkbox"]):not([type="radio"]),
  .modal select,
  .modal textarea {
    min-height: 44px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: 16px !important;
    padding: 10px 11px;
    border-radius: 8px;
  }
  .content input[type="checkbox"],
  .content input[type="radio"],
  .modal input[type="checkbox"],
  .modal input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    display: inline-grid;
    place-content: center;
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
  }
  .content input[type="checkbox"]::before,
  .modal input[type="checkbox"]::before,
  .content input[type="radio"]::before,
  .modal input[type="radio"]::before { content: ""; display: block; width: 18px; height: 18px; border: 1.5px solid #91a17c; border-radius: 4px; background: var(--workspace-paper); }
  .content input[type="checkbox"]:checked::before,
  .modal input[type="checkbox"]:checked::before { background: #5d7844; border-color: #5d7844; }
  .content input[type="checkbox"]:checked::after,
  .modal input[type="checkbox"]:checked::after { content: ""; position: absolute; width: 5px; height: 10px; left: 19px; top: 15px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
  .content input[type="checkbox"]:indeterminate::after,
  .modal input[type="checkbox"]:indeterminate::after { content: ""; position: absolute; width: 10px; height: 2px; left: 17px; top: 21px; background: #5d7844; }
  .content input[type="radio"]::before,
  .modal input[type="radio"]::before { border-radius: 50%; }
  .content input[type="radio"]:checked::before,
  .modal input[type="radio"]:checked::before { background: #5d7844; box-shadow: inset 0 0 0 4px var(--workspace-paper); }
  .content input[type="checkbox"]:disabled,
  .modal input[type="checkbox"]:disabled,
  .content input[type="radio"]:disabled,
  .modal input[type="radio"]:disabled { opacity: .55; cursor: not-allowed; }
  .form-row { flex-direction: column; gap: 10px; }
  .form-row > *,
  .form-group { min-width: 0; max-width: 100%; }
  .form-group label { font-size: 14px; }
  .btn-group { gap: 8px; flex-wrap: wrap; }

  .page-filter-strip,
  .schedule-filter-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px !important;
    padding: 10px !important;
    margin-bottom: 0 !important;
    min-width: 0;
    background: var(--workspace-paper) !important;
    border: 1px solid var(--workspace-line);
    border-radius: 10px;
  }
  .page-filter-strip > input,
  .page-filter-strip > select { flex: 1 1 135px; width: auto !important; }
  .page-filter-strip .workspace-filter-search { flex: 1 1 170px; min-width: 0; width: auto !important; max-width: 100%; }
  .page-filter-strip .workspace-filter-search input { width: 100% !important; }
  .workspace-filter-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; flex: 0 0 auto; border: 1px solid #d5ddc6; color: #4b643d; background: #f4f7eb; }
  .page-filter-strip[data-workspace-collapsed="true"] > :not(.workspace-filter-search):not(.workspace-filter-toggle) { display: none !important; }
  .page-filter-strip[data-workspace-collapsed="true"] > .workspace-filter-search { order: -2; }
  .workspace-filter-toggle { order: -1; }

  /* Unconverted matrices keep a real local scroll viewport. No page-wide cropping. */
  .table-wrap,
  .timetable-wrap,
  .pkg-table-wrap { min-width: 0; max-width: 100%; overflow-x: auto !important; overflow-y: visible !important; }
  .table-wrap .toolbar { flex-wrap: wrap; padding: 12px 14px; gap: 8px; }
  .table-wrap .toolbar.workspace-redundant-title { display: none; }
  .table-wrap .toolbar input { flex: 1 1 150px; width: auto; min-width: 0; }
  .content td { font-size: 14px; }
  .content th { font-size: 12px; }
  .workspace-card-table {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
    border-collapse: separate;
  }
  .workspace-card-table > thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .workspace-card-table.workspace-has-selection > thead,
  .workspace-card-table.workspace-has-column-controls > thead { position: static; display: block; width: auto; height: auto; clip: auto; white-space: normal; overflow: visible; padding: 4px 12px; border-bottom: 1px solid var(--workspace-line); }
  .workspace-card-table.workspace-has-selection > thead > tr,
  .workspace-card-table.workspace-has-column-controls > thead > tr { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .workspace-card-table.workspace-has-selection > thead th,
  .workspace-card-table.workspace-has-column-controls > thead th { display: none; }
  .workspace-card-table > thead th.workspace-cell-select,
  .workspace-card-table > thead th.workspace-column-control { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; width: auto !important; padding: 4px 8px; border: 0; background: transparent; font-size: 13px; }
  .workspace-card-table > thead th.workspace-cell-select::after { content: "全选"; white-space: nowrap; }
  .workspace-card-table > tbody { display: grid; gap: 10px; padding: 12px; }
  .workspace-card-table > tbody > tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    padding: 14px;
    min-width: 0;
    border: 1px solid var(--workspace-line);
    border-radius: 11px;
    background: var(--workspace-paper);
    box-shadow: 0 2px 6px rgba(43, 59, 34, .025);
  }
  .workspace-card-table > tbody > tr > td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0 !important;
    width: auto !important;
    max-width: 100%;
    height: auto !important;
    padding: 0 !important;
    border: 0;
    color: #3c5135;
    background: transparent;
    font-size: 14px !important;
    line-height: 1.55;
    text-align: left !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  .workspace-card-table td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 400; color: #6e7d62; }
  .workspace-card-table td.workspace-cell-title { order: -3; grid-column: 1 / -1; min-height: 30px; padding: 0 100px 5px 0 !important; color: #2f472e; font-size: 18px !important; font-weight: 650; }
  .workspace-card-table.workspace-has-selection td.workspace-cell-title { padding-right: 138px !important; }
  .workspace-card-table td.workspace-cell-title strong { font-size: inherit !important; }
  .workspace-card-table td.workspace-cell-title { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 5px; }
  .workspace-card-table > tbody > tr > td:not(.workspace-cell-title):not(.workspace-cell-actions) > :is(span, small, strong)[style*="font-size"] { font-size: inherit !important; }
  .workspace-card-table td.workspace-cell-title::before,
  .workspace-card-table td.workspace-cell-actions::before,
  .workspace-card-table td.workspace-cell-select::before,
  .workspace-card-table > tbody > tr:has(> td.workspace-cell-title) > td.workspace-cell-status::before { display: none; }
  /* History/log cards without a title keep their status label and normal grid slot. */
  .workspace-card-table > tbody > tr:has(> td.workspace-cell-title) > td.workspace-cell-status { position: absolute; top: 15px; right: 14px; max-width: 100px; }
  .workspace-card-table.workspace-has-selection > tbody > tr:has(> td.workspace-cell-title) > td.workspace-cell-status { right: 51px; }
  .workspace-card-table .badge { font-size: 12px !important; line-height: 1.6; }
  .workspace-card-table td.workspace-cell-select { position: absolute; top: 5px; right: 5px; min-width: 44px !important; min-height: 44px; align-items: center; justify-content: center; }
  .workspace-card-table td.workspace-cell-actions { grid-column: 1 / -1; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; border-top: 1px solid #e9eddf; padding-top: 10px !important; margin-top: 1px; }
  .workspace-card-table td.workspace-cell-actions .btn { margin: 0; }
  .workspace-card-table td[colspan] { grid-column: 1 / -1; }
  .workspace-card-table > tbody > tr.workspace-table-message { display: block; padding: 20px 14px; background: #f4f7ec; box-shadow: none; }
  .workspace-card-table > tbody > tr.workspace-table-message > td { display: block; padding: 0 !important; text-align: center !important; }
  /* Only profile cards omit secondary profile fields; original cells remain in the DOM. */
  .workspace-card-table.workspace-student-table td[data-label="年龄"],
  .workspace-card-table.workspace-student-table td[data-label="家长名"],
  .workspace-card-table.workspace-student-table td[data-label="地区"] { display: none; }
  .workspace-card-table.workspace-student-table > tbody > tr { gap: 8px 12px; }
  .workspace-card-table.workspace-student-table > tbody > tr > td:not(.workspace-cell-title):not(.workspace-cell-actions):not(.workspace-cell-select):not(.workspace-cell-status) { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 5px; }
  .workspace-card-table.workspace-student-table td[data-label]::before { flex: 0 0 auto; }
  .workspace-card-table td[data-label="可教课程"] { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
  .workspace-card-table td[data-label="可教课程"]::before { flex: 0 0 100%; }
  .workspace-card-table > tfoot { display: block; width: 100%; border-top: 1px solid var(--workspace-line); }
  .workspace-card-table > tfoot > tr { display: flex; flex-wrap: wrap; }
  .workspace-card-table > tfoot td { display: block; flex: 1 1 auto; padding: 12px 14px !important; font-size: 13px !important; white-space: normal; }

  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 0; }
  .card { min-height: 92px; padding: 14px; }
  .card .label { font-size: 12px; line-height: 1.5; }
  .card .value { font-size: 26px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-grid-upgraded .dv { font-size: 16px; }
  .mobile-card { padding: 14px; }
  .mobile-card .mc-name { font-size: 18px; }
  .mobile-card .mc-meta { font-size: 14px; color: var(--workspace-muted); }
  .mobile-card .mc-actions { gap: 8px; }

  .bottom-bar {
    display: flex;
    height: auto;
    min-height: calc(68px + env(safe-area-inset-bottom, 0px));
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--workspace-line);
    background: rgba(255, 254, 250, .96);
    box-shadow: none;
    z-index: 200;
  }
  .bottom-bar a { position: relative; min-height: 54px; justify-content: center; gap: 4px; padding: 4px 0; color: #708263; font-size: 11px; }
  .bottom-bar a.active { color: #3d5d2e; background: #eef2e1; border-radius: 10px; }
  .bottom-bar a.active::before { display: none; }
  .bottom-bar a .bb-icon { font-size: 21px; }
  .bottom-bar a.mobile-workspace-primary {
    background: #243d35; color: #fffefa; border-radius: 14px;
    font-size: 12px; font-weight: 700; margin-inline: 3px;
  }
  .bottom-bar a.mobile-workspace-primary .bb-icon { font-size: 23px; line-height: 1; }
  .mobile-workspace-today { min-width: 0; }
  .mobile-workspace-heading {
    border-radius: 18px; padding: 20px; margin-bottom: 14px;
    background: #243d35; color: #fffefa;
  }
  .mobile-workspace-heading h2 { margin: 4px 0 8px; color: inherit; font-size: 25px; line-height: 1.3; letter-spacing: -.5px; }
  .mobile-workspace-heading p { margin: 0; color: #d3ded3; font-size: 14px; line-height: 1.6; }
  .mobile-workspace-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; font-size: 14px; line-height: 1.6; }
  .mobile-workspace-summary > span { padding: 6px 10px; border: 1px solid var(--workspace-line); border-radius: 8px; background: #fffefa; }
  .mobile-workspace-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
  .mobile-workspace-links .btn { flex: 1 1 120px; min-height: 46px; padding: 11px 12px; white-space: normal; }
  .modal-body details { border-top: 1px solid var(--workspace-line); margin-top: 8px; padding-top: 8px; }
  .modal-body details > summary { cursor: pointer; min-height: 44px; padding: 11px 0; font-size: 15px; font-weight: 600; color: #566e45; }
  .pkg-btn { width: 44px; height: 44px; right: 14px; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  .logout-fixed { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .logout-fixed a { min-height: 44px; padding: 11px 12px; font-size: 12px; color: #566e45; background: #fffefa; }

  .modal-overlay {
    align-items: flex-end; padding: 0; z-index: 400;
    top: var(--workspace-viewport-top, 0px); bottom: auto;
    height: var(--workspace-viewport-height, 100dvh);
  }
  .modal {
    position: relative;
    inset: auto;
    display: flex;
    flex-direction: column;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90vh;
    max-height: 90dvh;
    max-height: min(90dvh, var(--workspace-viewport-height, 90dvh));
    margin: 0;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    overflow: hidden;
    overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .modal-header { position: relative; top: auto; z-index: 2; padding: 15px 18px; min-height: 64px; gap: 10px; font-size: 18px; flex: 0 0 auto; border-radius: 22px 22px 0 0; }
  /* One scroll owner: fields must never overflow beneath the action bar. */
  .modal-body { flex: 1 1 auto; padding: 17px 18px; min-height: 0; max-height: none !important; overflow-y: auto; overscroll-behavior: contain; font-size: 16px; }
  .modal-footer { flex: 0 0 auto; position: relative; bottom: auto; z-index: 2; flex-wrap: wrap; gap: 8px; padding: 12px 18px; }
  .modal-footer .btn { flex: 1 1 110px; }
  .modal-close { flex-shrink: 0; padding: 6px; border-radius: 50%; background: #edf1e2; }
  .notify-inbox-overlay { align-items: flex-end; }
  .notify-inbox { width: 100%; max-width: 100%; max-height: 88dvh; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .notify-item { padding: 15px 18px; }
  .toast-notify { top: calc(12px + env(safe-area-inset-top, 0px)); left: 14px; right: 14px; font-size: 14px; padding: 14px 18px; }

  .week-nav { gap: 8px; margin-bottom: 10px; }
  .week-nav .week-label { flex: 1 1 140px; font-size: 14px; }
  .tt-mobile .tt-day-header { padding: 8px 10px !important; border-radius: 10px; background: var(--workspace-nav); }
  .tt-mobile .tt-day-header .day-label { font-size: 16px !important; }
  .tt-mobile .tt-card { flex-wrap: wrap; padding: 14px !important; margin: 10px 0 !important; gap: 10px !important; border: 1px solid var(--workspace-line); background: var(--workspace-paper); }
  .tt-mobile .tt-card .tt-time { min-width: 66px !important; font-size: 16px !important; }
  .tt-mobile .tt-card .tt-info { min-width: 0; flex: 1 1 140px; }
  .tt-mobile .tt-card .tt-stu { font-size: 18px !important; white-space: normal; overflow: visible; }
  .tt-mobile .tt-card .tt-meta { font-size: 14px !important; color: var(--workspace-muted); }
  .tt-mobile .tt-card .tt-actions { width: 100%; margin-left: 0; padding-top: 9px; border-top: 1px solid var(--workspace-line); gap: 8px; }
  .tt-mobile .tt-card .tt-actions button { min-height: 44px !important; font-size: 14px !important; padding: 9px 12px !important; }
  .tt-mobile .tt-card.completed { opacity: 1; background: #f3f6ec; }
  .tt-mobile .tt-status { font-size: 12px; }
  .timetable-scroll { max-width: 100%; overflow-x: auto; }
  .timetable-scroll table { min-width: 1000px; }
  .analytics-center-scoped .analytics-primary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .analytics-center-scoped .analytics-primary-card { min-height: 92px; padding: 14px; }

  body.desktop-base-active .desktop-base { padding: 0; }
  .desktop-base__intro { display: flex; flex-wrap: wrap; padding-bottom: 12px; gap: 10px; }
  .desktop-base__eyebrow,
  .desktop-base__intro p:last-child { display: none; }
  .desktop-base__intro h2 { font-size: 20px; }
  .desktop-base__state { width: 100%; min-width: 0; padding: 9px 12px 9px 28px; }
  .desktop-base__state strong,
  .desktop-base__state small { display: inline; font-size: 12px; }
  .desktop-base__state small { margin-left: 8px; }
  .desktop-base__state > span { left: 12px; top: 15px; }
  .desktop-base__board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .desktop-base__hub-head { padding: 12px; }
  .desktop-base__hub-head small { display: none; }
  .desktop-base__hub-head strong { font-size: 16px; }
  .desktop-base__hub-body { padding: 10px; gap: 10px; }
  .desktop-base__metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .desktop-base__metrics article { padding: 12px; }
  .desktop-base__metrics strong { font-size: 25px; }
  .desktop-base__metrics small { font-size: 12px; }
  .desktop-base__panels { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .desktop-base__panel > header { gap: 8px; padding: 10px; }
  .desktop-base__panel > header small { display: none; }
  .desktop-base__panel > header h3 { font-size: 15px; }
  .desktop-base__panel-actions { width: 100%; align-items: flex-start; }
  .desktop-base__teacher-filter { max-width: 100%; width: 100%; }
  .desktop-base__panel-body { max-height: 400px; }
  .desktop-base__course-row,
  .desktop-base__renewal-row { display: grid; grid-template-columns: 1fr 1fr; padding: 12px; gap: 5px 12px; font-size: 14px; }
  .desktop-base__course-row strong,
  .desktop-base__renewal-row strong { font-size: 16px; white-space: normal; }
  .desktop-base__course-row time { font-weight: 600; }
  .desktop-base__course-row i { justify-self: start; border-radius: 4px; padding: 2px 6px; font-size: 12px; }
  .desktop-base__renewal-row b { font-size: 14px; text-align: left; }
  .desktop-base__node { min-height: 88px; padding: 13px 15px; }
  .desktop-base__node > span { font-size: 14px; }
  .desktop-base__node > small { font-size: 12px; margin-top: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .desktop-base__board,
  .desktop-base__node,
  .modal { animation: none; transition: none; }
}
