/* 我的学习改版：KPI、统计范围、视口适配、窄屏（加载于 learning-center.css 之后） */

/* 字号阶梯见 typography.css → #homePanelData 映射全局 token */
#homePanelData {
  --lcx-radius-control: 8px;
}

#homePanelData .lcx-banner.hp-hub-banner .lcx-banner-text strong {
  font-size: var(--lcx-font-title);
  font-weight: var(--lcx-fw-strong);
  line-height: var(--lcx-lh-tight);
}
#homePanelData .lcx-banner.hp-hub-banner .lcx-banner-text span {
  font-size: var(--lcx-font-body);
  line-height: var(--lcx-lh);
  color: var(--tx-2);
}
#homePanelData .lcx-scope-tab {
  font-size: var(--lcx-font-body);
  font-weight: var(--lcx-fw-medium);
}
#homePanelData .lcx-user-name {
  font-size: var(--lcx-font-body);
  font-weight: var(--lcx-fw-strong);
  line-height: var(--lcx-lh-tight);
}
#homePanelData .lcx-user-id {
  font-size: var(--lcx-font-caption);
  line-height: var(--lcx-lh);
  color: var(--tx-2);
}
#homePanelData .lcx-nav-title {
  font-size: var(--lcx-font-caption);
  font-weight: var(--lcx-fw-strong);
  line-height: var(--lcx-lh);
  color: var(--tx-3);
  text-transform: none;
  letter-spacing: 0;
}
#homePanelData .lcx-nav-item {
  font-size: var(--lcx-font-body);
  font-weight: var(--lcx-fw-medium);
  line-height: var(--lcx-lh);
}
#homePanelData .lcx-title {
  font-size: var(--lcx-font-title);
  font-weight: var(--lcx-fw-strong);
  line-height: var(--lcx-lh-tight);
}
#homePanelData .lcx-card-hd--skill {
  justify-content: flex-start;
  margin-bottom: 10px;
}

.lcx-sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--bd);
  min-width: 0;
}

#homePanelData .lcx-sidebar {
  width: clamp(196px, 16vw, 220px);
  min-height: 0;
  overflow: hidden;
  padding: 10px 0;
}
#homePanelData .lcx-sidebar-user { flex-shrink: 0; margin-bottom: 8px; }

.lcx-streak-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0 12px 10px;
  padding: 0 4px;
}
.lcx-streak-wrap .hp-streak-badge {
  width: 100%;
  justify-content: center;
  padding: 6px 10px;
}
.lcx-streak-wrap .hp-streak-num { font-size: 1.15rem; }
.lcx-streak-caption {
  font-size: 0.68rem;
  color: var(--tx-3);
  letter-spacing: 0.02em;
}

#homePanelData .lcx-nav {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}
#homePanelData .lcx-sidebar-foot { flex-shrink: 0; }

.lcx-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--t), color var(--t), box-shadow var(--t);
}
.lcx-nav-item:hover { background: rgba(227, 24, 55, 0.06); color: var(--tx); }
.lcx-nav-item.active { background: var(--ielts-red); color: #fff; font-weight: 600; }
.lcx-nav-item.lcx-nav-link {
  font-weight: 500;
  color: var(--v-teal, var(--ielts-red));
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lcx-nav-item.lcx-nav-link:hover {
  background: rgba(227, 24, 55, 0.08);
  color: var(--v-teal-dk, var(--ielts-red-dark, #c8102e));
}
.lcx-nav-item:focus { outline: none; }
.lcx-nav-item:focus-visible {
  outline: none;
  box-shadow: var(--focus, 0 0 0 2px var(--bg), 0 0 0 4px var(--ielts-red));
}
.lcx-nav-badge {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  font-weight: 600;
}
.lcx-nav-item.active .lcx-nav-badge { background: rgba(255, 255, 255, 0.25); }
.lcx-nav-item.lcx-nav-link .lcx-nav-badge { text-decoration: none; }

.lcx-scope-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.lcx-scope-tab {
  /* base Interaction chip styles live in home.css (.hp-chip / .lcx-scope-tab) */
  padding: 5px 14px;
  font-size: 0.78rem;
}
.lcx-scope-tab.active {
  border-color: var(--ielts-red);
  background: rgba(227, 24, 55, 0.08);
  color: var(--ielts-red);
}

/* —— 行动流：成绩带 + 待办 —— */
.lcx-score-band {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--card) 100%);
  border: 1px solid var(--bd);
  border-radius: 12px;
  min-width: 0;
}
.lcx-score-hero { flex: 0 0 auto; min-width: 88px; }
.lcx-score-lbl {
  font-size: var(--lcx-font-caption);
  font-weight: var(--lcx-fw-medium);
  line-height: var(--lcx-lh);
  color: var(--tx-3);
}
.lcx-score-big {
  font-size: var(--lcx-font-display);
  font-weight: var(--lcx-fw-strong);
  line-height: var(--lcx-lh-tight);
  color: var(--ielts-red);
  margin-top: 2px;
}
.lcx-score-meta {
  font-size: var(--lcx-font-caption);
  line-height: var(--lcx-lh);
  color: var(--tx-2);
  margin-top: 4px;
  max-width: 18rem;
}
.lcx-skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.lcx-skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: var(--lcx-font-caption);
  font-weight: var(--lcx-fw-medium);
  line-height: var(--lcx-lh);
  border: 1px solid var(--bd);
  background: var(--card);
  white-space: nowrap;
}
.lcx-skill-chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.lcx-skill-chip[data-s="listen"] .dot { background: #2563eb; }
.lcx-skill-chip[data-s="read"] .dot { background: #059669; }
.lcx-skill-chip[data-s="write"] .dot { background: #d97706; }
.lcx-skill-chip[data-s="speak"] .dot { background: #7c3aed; }
.lcx-score-streak {
  margin-left: auto;
  align-self: center;
  padding: 7px 11px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  font-size: var(--lcx-font-caption);
  font-weight: var(--lcx-fw-medium);
  line-height: var(--lcx-lh);
  color: #c2410c;
  white-space: nowrap;
}
body.dark-mode .lcx-score-streak {
  background: rgba(251, 146, 60, 0.12);
  border-color: rgba(251, 146, 60, 0.35);
  color: #fdba74;
}

.lcx-todo-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  min-width: 0;
}
.lcx-todo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  border: 1px solid var(--bd);
  border-radius: var(--lcx-radius-control);
  padding: 10px 12px;
  background: var(--card);
  cursor: pointer;
  font-family: var(--f-body);
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 0;
  min-height: 6.25rem;
  box-sizing: border-box;
}
.lcx-todo:hover {
  border-color: rgba(227, 24, 55, 0.35);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.lcx-todo--wrong { border-left: 3px solid #d97706; }
.lcx-todo--vocab { border-left: 3px solid #059669; }
.lcx-todo--drill { border-left: 3px solid #2563eb; }
.lcx-todo--drill[data-s="read"] { border-left-color: #059669; }
.lcx-todo--drill[data-s="warn"] { border-left-color: #d97706; }
.lcx-todo--drill[data-s="speak"] { border-left-color: #7c3aed; }
.lcx-todo.is-priority {
  border-color: rgba(227, 24, 55, 0.45);
  box-shadow: 0 0 0 1px rgba(227, 24, 55, 0.12);
}
.lcx-todo-lbl {
  display: block;
  font-size: var(--lcx-font-caption);
  font-weight: var(--lcx-fw-medium);
  line-height: var(--lcx-lh);
  color: var(--tx-3);
}
.lcx-todo-val {
  display: block;
  font-size: var(--lcx-font-stat);
  font-weight: var(--lcx-fw-strong);
  line-height: var(--lcx-lh-tight);
  margin-top: 2px;
  color: var(--tx);
}
.lcx-todo-sub {
  display: block;
  font-size: var(--lcx-font-caption);
  color: var(--tx-2);
  margin-top: auto;
  line-height: var(--lcx-lh);
  overflow: hidden;
  text-overflow: ellipsis;
}

.lcx-acc-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.lcx-acc-bar {
  flex: 1;
  min-width: 48px;
  max-width: 72px;
  height: 5px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
}
.lcx-acc-bar > i {
  display: block;
  height: 100%;
  background: #2563eb;
  border-radius: 999px;
}

.lcx-empty-hint {
  text-align: center;
  padding: 18px 12px;
  margin-top: 12px;
  background: var(--surface);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--tx-2);
  line-height: 1.5;
}
.lcx-empty-hint button {
  border: none;
  background: none;
  padding: 0;
  color: var(--ielts-red);
  font-weight: 600;
  cursor: pointer;
  font: inherit;
}
.lcx-empty-hint button:hover { text-decoration: underline; }

.lcx-actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lcx-btn-ghost {
  border: 1px solid var(--bd);
  background: var(--card);
  border-radius: var(--lcx-radius-control);
  padding: 0 12px;
  min-height: 28px;
  font-size: var(--lcx-font-caption);
  font-weight: var(--lcx-fw-medium);
  line-height: var(--lcx-lh);
  cursor: pointer;
  color: var(--tx);
  font-family: var(--f-body);
}
.lcx-btn-ghost:hover { border-color: var(--ielts-red); color: var(--ielts-red); }
.lcx-btn-ghost-block { width: 100%; margin-top: 8px; }

.lcx-next-title {
  font-weight: var(--lcx-fw-strong);
  font-size: var(--lcx-font-body);
  line-height: var(--lcx-lh-tight);
  margin-bottom: 8px;
  color: var(--tx);
}
.lcx-next-list { list-style: none; margin: 0; padding: 0; }
.lcx-next-list li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--bd);
  font-size: var(--lcx-font-body);
  line-height: var(--lcx-lh);
  color: var(--tx-2);
}
.lcx-next-list li:last-child { border-bottom: none; }
.lcx-next-pri {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(227, 24, 55, 0.12);
  color: var(--ielts-red);
  font-weight: var(--lcx-fw-strong);
  font-size: var(--lcx-font-caption);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lcx-next-list button {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.lcx-next-list button strong { color: var(--tx); }
.lcx-next-list button:hover strong { color: var(--ielts-red); }

.lcx-ai-footnote {
  font-size: 0.65rem;
  color: var(--tx-3);
  text-align: center;
  margin: 8px 0 0;
}

.lcx-skill-tab.active {
  color: var(--ielts-red);
  border-bottom-color: var(--ielts-red);
}
.lcx-subtab.active {
  background: rgba(227, 24, 55, 0.08);
  border-color: var(--ielts-red);
  color: var(--ielts-red);
}
.lcx-ai-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ielts-red);
  color: #fff;
  font-weight: var(--lcx-fw-strong);
  font-size: var(--lcx-font-caption);
}
.lcx-path-hub {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--bd);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--card) 100%);
  overflow: visible;
  flex-shrink: 0;
  scroll-margin-block: 12px;
}
.lcx-path-row {
  overflow: visible;
}
.lcx-path-hub-hd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.lcx-path-hub-title {
  margin: 0;
  font-size: var(--lcx-font-title);
  font-weight: var(--lcx-fw-strong);
  line-height: var(--lcx-lh-tight);
}
.lcx-path-primary-cta {
  border: none;
  border-radius: var(--lcx-radius-control);
  padding: 0 16px;
  min-height: 32px;
  background: var(--ielts-red);
  color: #fff;
  font-size: var(--lcx-font-body);
  font-weight: var(--lcx-fw-strong);
  line-height: var(--lcx-lh);
  cursor: pointer;
  font-family: var(--f-body);
}
.lcx-path-primary-cta:hover { background: var(--ielts-red-dark, #c8102e); }
.lcx-path-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}
@container lcx-center (max-width: 640px) {
  .lcx-path-row { grid-template-columns: 1fr; }
}
.lcx-path-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  border: 1px solid var(--bd);
  border-radius: var(--lcx-radius-control);
  padding: 12px 14px;
  background: var(--card);
  cursor: pointer;
  font-family: var(--f-body);
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 6.25rem;
  box-sizing: border-box;
}
.lcx-path-card:hover {
  border-color: rgba(227, 24, 55, 0.35);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.lcx-path-card--active {
  border-left: 3px solid var(--ielts-red);
}
.lcx-path-lbl {
  display: block;
  font-size: var(--lcx-font-caption);
  font-weight: var(--lcx-fw-medium);
  line-height: var(--lcx-lh);
  color: var(--tx-3);
}
.lcx-path-val {
  display: block;
  font-size: var(--lcx-font-stat);
  font-weight: var(--lcx-fw-strong);
  line-height: var(--lcx-lh-tight);
}
.lcx-path-sub {
  display: block;
  font-size: var(--lcx-font-caption);
  color: var(--tx-2);
  margin-top: auto;
  line-height: var(--lcx-lh);
}
.lcx-card-collapsed-hint {
  margin: 0 0 8px;
  padding: 10px 12px;
  font-size: var(--lcx-font-body);
  line-height: var(--lcx-lh);
  color: var(--tx-2);
  background: var(--surface);
  border-radius: 8px;
}
.lcx-card--collapsed .lcx-card-hd,
.lcx-card--collapsed .lcx-toolbar,
.lcx-card--collapsed .lcx-analysis-body,
.lcx-card--collapsed .lcx-loading,
.lcx-card--collapsed .lcx-error { display: none !important; }
#lcxViewAnalysis .lcx-card-analysis-fit.lcx-card--collapsed {
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
}
#lcxViewAnalysis .lcx-card-analysis-fit.lcx-card--collapsed .lcx-card-collapsed-hint {
  margin: 0;
}
.lcx-review-btn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: var(--ielts-red);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--f-body);
  margin-top: 4px;
}
.lcx-review-btn:hover { background: var(--ielts-red-dark, #c8102e); }
.lcx-review-btn--secondary {
  background: transparent;
  color: var(--ielts-red);
  border: 1px solid rgba(227, 24, 55, 0.35);
  font-weight: var(--lcx-fw-medium);
  font-size: var(--lcx-font-body);
  line-height: var(--lcx-lh);
  padding: 0 12px;
  min-height: 28px;
  border-radius: var(--lcx-radius-control);
}
.lcx-review-btn--secondary:hover {
  background: rgba(227, 24, 55, 0.06);
}

#homePanelData .lcx-banner { flex-shrink: 0; }
#homePanelData .lcx-banner.hp-hub-banner {
  flex-wrap: wrap;
  align-items: center;
  min-height: 0;
}
#homePanelData .lcx-banner.hp-hub-banner .lcx-banner-text {
  flex: 1 1 auto;
  align-items: flex-start;
  text-align: left;
  min-width: 0;
}
#homePanelData .lcx-banner.hp-hub-banner .lcx-banner-text span {
  display: block;
  max-width: 72ch;
}

.lcx-body-inner.lcx-body-analysis {
  grid-template-columns: minmax(0, 1fr) minmax(0, 280px);
  gap: 12px;
}

/* 学习分析主滚动层：勿 hidden（会裁切「今天从哪里继续」且无法滚到底） */
#lcxViewAnalysis.lcx-view:not([hidden]) {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
#lcxViewAnalysis .lcx-body-inner.lcx-body-analysis {
  flex: 0 0 auto;
  min-height: 0;
  height: auto;
  overflow: visible;
  align-items: start;
}
#lcxViewAnalysis .lcx-center {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: visible;
  container-type: inline-size;
  container-name: lcx-center;
}

@container lcx-center (max-width: 520px) {
  .lcx-todo-row { grid-template-columns: 1fr; }
  .lcx-score-streak { margin-left: 0; width: 100%; text-align: center; }
}
#lcxViewAnalysis .lcx-score-band,
#lcxViewAnalysis .lcx-path-hub,
#lcxViewAnalysis .lcx-todo-row { flex-shrink: 0; }

/* —— 合并教练侧栏 —— */
.lcx-coach-card {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 0;
}
body.dark-mode .lcx-coach-card { background: #152230; }
.lcx-coach-section {
  border-top: 1px solid var(--bd);
  margin-top: 12px;
  padding-top: 12px;
}
.lcx-coach-section .lcx-next-title { margin-bottom: 6px; }
.lcx-coach-gauge .lcx-gauge-wrap { margin-top: 4px; }
#lcxViewAnalysis .lcx-card-analysis-fit {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 14px;
}
#lcxViewAnalysis .lcx-card-analysis-fit:not(.lcx-card--collapsed) {
  flex: 1 1 0;
  min-height: 220px;
}
#lcxViewAnalysis .lcx-card-analysis-fit .lcx-card-hd,
#lcxViewAnalysis .lcx-card-analysis-fit .lcx-toolbar { flex-shrink: 0; }
#lcxViewAnalysis .lcx-analysis-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
#lcxViewAnalysis .lcx-block-table {
  flex-shrink: 0;
  margin-top: 0;
  max-height: 42%;
  overflow: hidden;
}
#lcxViewAnalysis .lcx-block-trend {
  flex: 1;
  min-height: 0;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#lcxViewAnalysis .lcx-block-trend .lcx-block-title {
  flex-shrink: 0;
  margin-bottom: 4px;
  font-size: 0.88rem;
}
#lcxViewAnalysis .lcx-chart-wrap {
  flex: 1;
  min-height: 64px;
  margin-top: 0;
  display: flex;
  align-items: stretch;
}
#lcxViewAnalysis .lcx-chart-wrap canvas {
  width: 100%;
  height: 100% !important;
  min-height: 64px;
  display: block;
}
#lcxViewAnalysis .lcx-legend { flex-shrink: 0; margin-top: 4px; gap: 8px; }
#lcxViewAnalysis .lcx-aside {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  gap: 0;
}
#lcxViewAnalysis .lcx-aside-coach .lcx-coach-card {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
#lcxViewAnalysis .lcx-coach-card .lcx-bubble-ai {
  flex: 0 0 auto;
  margin: 8px 0 10px;
  font-size: var(--lcx-font-body);
  line-height: var(--lcx-lh);
  overflow: visible;
  display: block;
}
#homePanelData .lcx-coach-card .lcx-ai-name {
  font-size: var(--lcx-font-body);
  font-weight: var(--lcx-fw-strong);
  line-height: var(--lcx-lh-tight);
}
#homePanelData .lcx-coach-card .lcx-ai-sub {
  font-size: var(--lcx-font-caption);
  line-height: var(--lcx-lh);
}
#homePanelData .lcx-coach-card .lcx-goal-hd {
  font-size: var(--lcx-font-body);
  font-weight: var(--lcx-fw-strong);
  line-height: var(--lcx-lh-tight);
}
#homePanelData .lcx-gauge-label {
  font-size: var(--lcx-font-caption);
  line-height: var(--lcx-lh);
}
#lcxViewAnalysis .lcx-coach-section {
  flex-shrink: 0;
  min-height: 0;
  overflow: visible;
}
#lcxViewAnalysis .lcx-coach-section .lcx-next-list {
  max-height: none;
  overflow: visible;
}
#lcxViewAnalysis .lcx-coach-gauge {
  flex-shrink: 0;
}
#lcxViewAnalysis .lcx-gauge-wrap canvas {
  width: 100%;
  height: var(--lcx-gauge-h, clamp(72px, 11vh, 108px));
  max-height: var(--lcx-gauge-h, clamp(72px, 11vh, 108px));
  display: block;
}

@media (max-width: 900px) {
  .lcx-body-inner.lcx-body-analysis {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    overflow: visible;
    height: auto;
  }
  #lcxViewAnalysis .lcx-aside {
    max-height: none;
    height: auto;
    overflow: visible;
    flex: none;
  }
  #lcxViewAnalysis .lcx-aside-coach .lcx-coach-card {
    flex: none;
    height: auto;
    overflow: visible;
  }
  #lcxViewAnalysis .lcx-coach-card .lcx-bubble-ai {
    flex: none;
    max-height: none;
    -webkit-line-clamp: unset;
    display: block;
  }
  #lcxViewAnalysis .lcx-coach-section .lcx-next-list {
    max-height: none;
    overflow: visible;
  }
}

/* 固定底栏：宽屏由各 view 内滚留白；窄屏由 .lcx-body 统一滚 */
@media (min-width: 992px) {
  body.oh-hub-footer-on #homePanelData .lcx-body > .lcx-view:not([hidden]) {
    box-sizing: border-box;
    padding-bottom: calc(12px + var(--oh-hub-footer-h, 58px) + env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: calc(var(--oh-hub-footer-h, 58px) + env(safe-area-inset-bottom, 0px) + 16px);
  }

  /* 学习分析：勿把中间列压进固定视口，主列按内容增高 + 本 view 内滚 */
  #lcxViewAnalysis:not([hidden]) {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  #lcxViewAnalysis .lcx-body-inner.lcx-body-analysis {
    height: auto;
    min-height: min(100%, auto);
    overflow: visible;
    align-items: start;
  }
  #lcxViewAnalysis .lcx-center {
    overflow: visible;
    min-height: auto;
  }
  #lcxViewAnalysis .lcx-card-analysis-fit {
    flex: 0 0 auto;
    width: 100%;
    min-height: 280px;
    max-height: none;
    overflow: visible;
  }
  #lcxViewAnalysis .lcx-card-analysis-fit.lcx-card--collapsed {
    min-height: 0;
  }
  #lcxViewAnalysis .lcx-analysis-body {
    flex: 0 0 auto;
    min-height: 220px;
    overflow: visible;
  }
  #lcxViewAnalysis .lcx-block-table {
    max-height: none;
    overflow: visible;
  }
  #lcxViewAnalysis .lcx-block-trend {
    flex: 0 0 auto;
    min-height: 160px;
    overflow: visible;
  }
  #lcxViewAnalysis .lcx-aside {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: calc(var(--hp-tab-panel-h, 75vh) - 32px);
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
  }
  #lcxViewAnalysis .lcx-aside-coach .lcx-coach-card {
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
  }
  #lcxViewAnalysis .lcx-coach-card .lcx-bubble-ai {
    max-height: none;
    -webkit-line-clamp: unset;
    display: block;
  }
  #lcxViewAnalysis .lcx-coach-section .lcx-next-list {
    max-height: none;
    overflow: visible;
  }

  #homePanelData .lcx-sidebar {
    padding-bottom: 6px;
  }
  #homePanelData .lcx-nav {
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: 10px;
    scroll-padding-block-end: 12px;
  }
  #homePanelData .lcx-sidebar-foot {
    flex-shrink: 0;
    margin-top: auto;
  }
}

/* lg 992↓：卡片占满 Tab 视口，滚动只在 Content（Ant Layout） */
@media (max-width: 991px) {
  .hp-main-tabs > #homePanelData {
    overflow: hidden;
    height: var(--hp-tab-panel-h, calc(100vh - 118px));
    max-height: var(--hp-tab-panel-h, calc(100vh - 118px));
  }
  #homePanelData .lcx-shell,
  #homePanelData .lcx-workspace {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  #homePanelData .lcx-workspace {
    flex-direction: column;
  }
  #homePanelData .lcx-sidebar {
    width: 100%;
    flex: 0 0 auto;
    min-height: 0;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--bd);
    padding: 8px 0 0;
    overflow: visible;
  }
  #homePanelData .lcx-sidebar-user {
    display: none;
  }
  #homePanelData .lcx-streak-wrap {
    display: none;
  }
  #homePanelData .lcx-nav {
    flex: 0 0 auto;
    min-height: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 0 8px 6px;
    overflow: visible;
  }
  #homePanelData .lcx-nav-item.lcx-nav-link {
    display: none;
  }
  #homePanelData .lcx-nav-group { display: contents; }
  #homePanelData .lcx-nav-title {
    flex: 0 0 auto;
    width: auto;
    padding: 6px 4px 6px 2px;
    margin-right: 2px;
    font-size: 0.62rem;
    white-space: nowrap;
    opacity: 0.85;
  }
  #homePanelData .lcx-nav-title::after {
    content: "·";
    margin-left: 6px;
    opacity: 0.5;
  }
  #homePanelData .lcx-nav-item {
    flex: 0 0 auto;
    width: auto;
    padding: 6px 12px;
    font-size: 0.8rem;
    scroll-snap-align: start;
    white-space: nowrap;
  }
  #homePanelData .lcx-sidebar-foot { display: none; }
  /* 平板/窄屏：顶栏+横滑导航压缩高度，主内容区多留给「今天从哪里继续」 */
  #homePanelData .lcx-banner.hp-hub-banner {
    min-height: 0;
    padding: 6px 12px 8px;
    gap: 8px;
    align-items: center;
  }
  #homePanelData .lcx-banner-text {
    flex: 1 1 8rem;
    min-width: 0;
    gap: 0;
  }
  #homePanelData .lcx-banner-text span#lcxBannerSub {
    display: none;
  }
  #homePanelData .lcx-scope-tabs {
    flex: 0 0 auto;
    width: auto;
    margin-top: 0;
    gap: 4px;
  }
  #homePanelData .lcx-scope-tab {
    padding: 4px 10px;
    font-size: var(--lcx-font-caption);
  }
  #homePanelData .lcx-nav-title {
    display: none;
  }
  #homePanelData .lcx-sidebar {
    padding: 2px 0 0;
    border-bottom-width: 1px;
  }
  #homePanelData .lcx-nav {
    padding: 0 8px 6px;
    gap: 4px;
    scroll-padding-inline: 8px 12px;
  }
  #homePanelData .lcx-nav-item {
    padding: 5px 10px;
    font-size: var(--lcx-font-caption);
  }
  #homePanelData .lcx-path-hub {
    padding: 10px 12px;
    margin-bottom: 10px;
  }
  #homePanelData .lcx-main {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
  }
  #homePanelData .lcx-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 10px 12px 16px;
    -webkit-overflow-scrolling: touch;
  }
  body.oh-hub-footer-on #homePanelData .lcx-body {
    padding-bottom: calc(16px + var(--oh-hub-footer-h, 58px) + env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: calc(var(--oh-hub-footer-h, 58px) + env(safe-area-inset-bottom, 0px) + 20px);
  }
  #homePanelData .lcx-body > .lcx-view:not([hidden]) {
    flex: 0 0 auto;
    min-height: 0;
    height: auto;
    overflow: visible;
  }
  /* 顶栏单行：标题 + 统计范围（勿 column，避免占半屏） */
  #homePanelData .lcx-banner.hp-hub-banner {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    min-height: 0;
    border-bottom-width: 2px;
  }
  #homePanelData .lcx-banner-text {
    flex: 0 1 auto;
    min-width: 0;
  }
  #homePanelData .lcx-banner-text strong {
    font-size: var(--lcx-font-body, var(--font-size-base));
    line-height: 1.25;
  }
  #homePanelData .lcx-scope-tabs {
    flex: 1 1 auto;
    width: auto;
    max-width: 100%;
    margin-top: 0;
    justify-content: flex-end;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scroll-padding-inline: 4px 8px;
  }
  .lcx-path-row,
  .lcx-todo-row {
    grid-template-columns: 1fr;
  }
  #lcxViewAnalysis.lcx-view:not([hidden]) {
    flex: 0 0 auto;
    height: auto;
    overflow: visible;
  }
  #lcxViewAnalysis:not([hidden]) { overflow: visible; }
  #lcxViewAnalysis .lcx-body-inner.lcx-body-analysis {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: auto;
    overflow: visible;
  }
  #lcxViewAnalysis .lcx-center {
    overflow: visible;
    flex: none;
    width: 100%;
    container-type: inline-size;
    container-name: lcx-center;
  }
  #lcxViewAnalysis .lcx-card-analysis-fit,
  #lcxViewAnalysis .lcx-analysis-body,
  #lcxViewAnalysis .lcx-block-table,
  #lcxViewAnalysis .lcx-block-trend {
    flex: none;
    overflow: visible;
    max-height: none;
  }
  #lcxViewAnalysis .lcx-chart-wrap {
    flex: none;
    height: min(200px, 42vw);
    min-height: 140px;
  }
  #lcxViewAnalysis .lcx-chart-wrap canvas { min-height: 140px; }
  #lcxViewAnalysis .lcx-aside { width: 100%; gap: 12px; }
}

@media (max-width: 767px) {
  #homePanelData .lcx-banner.hp-hub-banner {
    min-height: 0;
    padding: 4px 10px 6px;
  }
  #homePanelData .lcx-banner-text strong#lcxBannerTitle {
    display: none;
  }
  #homePanelData .lcx-banner-text span#lcxBannerSub {
    display: none;
  }
  #homePanelData .lcx-scope-tabs {
    flex: 1 1 100%;
    justify-content: flex-start;
  }
  .lcx-path-primary-cta {
    width: 100%;
    text-align: center;
  }
  .lcx-score-band {
    flex-direction: column;
    align-items: stretch;
  }
  .lcx-score-streak {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }
  .lcx-skill-chips {
    width: 100%;
  }
}

@media (max-width: 640px) {
  body.oh-hub-footer-on #homePanelData .lcx-body {
    padding-bottom: calc(16px + var(--oh-hub-footer-h, 96px) + env(safe-area-inset-bottom, 0px) + 8px);
    scroll-padding-bottom: calc(var(--oh-hub-footer-h, 96px) + env(safe-area-inset-bottom, 0px) + 24px);
  }
  #homePanelData .lcx-nav-item {
    padding: 8px 12px;
    min-height: 44px;
  }
}

@media (max-height: 820px) and (min-width: 901px) {
  #lcxViewAnalysis .lcx-score-band { padding: 10px 12px; }
  #lcxViewAnalysis .lcx-todo { padding: 8px 10px; }
  #lcxViewAnalysis #lcxScopeNote { display: none; }
}

.lcx-overview-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.lcx-btn-ghost-sm {
  font-size: 0.78rem;
  padding: 6px 12px;
}
.lcx-skill-hd {
  margin: 0 0 14px;
}
.lcx-skill-hd-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
}
.lcx-skill-hd-sub {
  margin: 0;
  font-size: 0.82rem;
  color: var(--tx-2);
}
.lcx-future-plan li span:last-child {
  flex: 1;
  font-size: 0.82rem;
  line-height: 1.45;
}

#lcxViewAnalysis.lcx-hub-mode-plan #lcxSectionAnalytics {
  display: none !important;
}

.lcx-study-plan-card { margin-bottom: 16px; }
.lcx-plan-lead { margin: 6px 0 0; font-size: 0.82rem; color: var(--tx-2); max-width: 52ch; }
.lcx-plan-target-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px 14px;
  margin-bottom: 14px;
}
.lcx-plan-target-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--tx-2);
}
.lcx-plan-target-field input {
  padding: 8px 10px;
  border: 1px solid var(--bd);
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  background: var(--bg);
}
.lcx-plan-target-field--date { grid-column: 1 / -1; max-width: 220px; }
.lcx-plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.lcx-plan-gen-btn { font-size: 0.85rem; padding: 8px 16px; }
.lcx-plan-summary { margin-bottom: 14px; white-space: pre-wrap; }
.lcx-plan-weeks { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.lcx-plan-week {
  padding: 12px 14px;
  border: 1px solid var(--bd);
  border-radius: var(--r-md);
  background: var(--bg-2, var(--bg));
}
.lcx-plan-week-title { margin: 0 0 8px; font-size: 0.9rem; font-weight: 700; }
.lcx-plan-week-tasks { margin: 0; padding-left: 1.2rem; font-size: 0.82rem; color: var(--tx-2); }
.lcx-plan-week-tasks li { margin-bottom: 4px; }
.lcx-plan-notes-label { display: flex; flex-direction: column; gap: 6px; font-size: 0.78rem; color: var(--tx-2); }
.lcx-plan-notes {
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  border: 1px solid var(--bd);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 0.84rem;
  resize: vertical;
}
.lcx-plan-meta { margin: 8px 0 0; font-size: 0.75rem; color: var(--tx-3); }
