/* 概览常驻，详细图表平滑收起；蓝绿主色沿用现有页面。 */
.learning-progress { position: relative; margin: 8px 0 20px; padding: 18px 20px 16px; border: 1px solid #dbe7f7; border-radius: 18px; background: linear-gradient(135deg, #f8fbff, #fff 48%); box-shadow: 0 6px 22px rgb(38 98 173 / 4%); }
.progress-heading, .progress-title { display: flex; align-items: center; }
.progress-heading { justify-content: space-between; gap: 12px; }
.progress-title { gap: 9px; min-width: 0; }
.progress-title-icon { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border-radius: 9px; color: #277bf3; background: #eaf3ff; }
.progress-title-icon svg { width: 20px; height: 20px; }
.progress-heading h2 { margin: 0; color: #263b59; font-size: 1.05rem; white-space: nowrap; }
.progress-period-badge { padding: 3px 7px; border-radius: 6px; color: #8291a7; background: #f0f4fa; font-size: .66rem; white-space: nowrap; }
.progress-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex: 0 0 auto; min-height: 36px; padding: 6px 9px; border: 0; border-radius: 8px; background: transparent; color: #6d819c; font-family: inherit; font-size: .76rem; cursor: pointer; }
.progress-toggle[hidden] { display: none; }
.progress-toggle:hover { color: #0d6efd; background: #edf5ff; }
.progress-toggle svg { width: 14px; height: 14px; transform: rotate(180deg); transition: transform .35s ease; }
.progress-toggle[aria-expanded="false"] svg { transform: rotate(0); }
.progress-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 12px 0 0; padding: 11px 0; border: 1px solid #edf2fa; border-radius: 11px; background: rgb(247 250 255 / 70%); }
.progress-summary > div { display: flex; align-items: baseline; justify-content: center; gap: 10px; min-width: 0; }
.progress-summary > div + div { border-left: 1px solid #e2eaf6; }
.progress-summary span { color: #7d8da5; font-size: .75rem; }
.progress-summary strong { color: #536780; font-size: 1.65rem; line-height: 1; font-variant-numeric: tabular-nums; }
.progress-summary .progress-blue { color: #247bf3; }
.progress-summary .progress-green { color: #0aa57f; }
.progress-summary small { margin-left: 3px; font-size: .72rem; font-weight: 500; }
/* 0fr 至 1fr 使用内容自然高度，切换日期范围后不需要固定最大高度。 */
.progress-details { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows .4s cubic-bezier(.22, 1, .36, 1), opacity .25s ease; }
.progress-details-inner { min-height: 0; overflow: hidden; }
.learning-progress.is-collapsed .progress-details { grid-template-rows: 0fr; opacity: 0; pointer-events: none; }
.learning-progress.is-restoring .progress-details { transition: none; }
.progress-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 14px; }
.progress-ranges { display: flex; gap: 3px; padding: 3px; border-radius: 9px; background: #f0f5fc; }
.progress-ranges a { min-width: 47px; padding: 6px 10px; border-radius: 6px; color: #8290a5; font-size: .72rem; text-decoration: none; text-align: center; white-space: nowrap; }
.progress-ranges a[aria-current] { background: #fff; color: #247bf3; font-weight: 700; box-shadow: 0 1px 5px rgb(39 98 178 / 8%); }
.progress-ranges a:hover { color: #247bf3; }
.progress-ranges a:focus-visible, .progress-import:focus-visible, .progress-toggle:focus-visible { outline: 3px solid #8cbdff; outline-offset: 2px; }
.progress-chart-heading { margin-top: 5px; color: #92a0b4; font-size: .65rem; }
.progress-legend { display: flex; gap: 16px; color: #8290a5; font-size: .7rem; }
.progress-legend > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.progress-bar-key { display: inline-block; flex: 0 0 auto; width: 13px; height: 8px; border-radius: 3px; background: linear-gradient(to top, #5b8def 0% 40%, #7c83d6 40% 70%, #dc9b78 70% 100%); }
/* 采用固定柔和色，图例自然换行；与掌握曲线的鲜绿色拉开区别。 */
.progress-subject-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 11px 0 5px; color: #7889a0; font-size: .68rem; }
.progress-subject-legend > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.progress-subject-caption { color: #95a1b3; }
.progress-subject-key { display: inline-block; flex: 0 0 auto; width: 9px; height: 9px; border-radius: 3px; background: var(--subject-color); }
.progress-line-key { position: relative; display: inline-block; flex: 0 0 auto; width: 18px; height: 2px; border-radius: 2px; background: #08b58b; }
.progress-line-key::after { position: absolute; top: -2px; left: 6px; width: 6px; height: 6px; border-radius: 50%; background: #08b58b; content: ""; }
/* 各范围完整适配视口，不再为手机 30 天设置额外图表宽度。 */
.progress-chart-frame { position: relative; }
.progress-fixed-axis { display: none; position: absolute; z-index: 1; top: 0; left: 0; width: 36px; height: 100%; pointer-events: none; }
.progress-chart-frame.is-scrollable .progress-fixed-axis { display: block; }
.progress-chart-frame.is-scrollable .progress-original-tick { visibility: hidden; }
.progress-chart-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #c9dbf5 transparent; }
.progress-chart { display: block; width: 100%; min-width: 0; height: 190px; }
.progress-chart-all { min-width: 0; }
.progress-grid { stroke: #e8eef7; stroke-dasharray: 3 5; }
.progress-axis { fill: #8797ad; font-family: inherit; font-size: 13px; }
.progress-today-band { fill: #eff6ff; }
.progress-line { fill: none; stroke: #08b58b; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 2px 2px rgb(8 181 139 / 10%)); }
.progress-point { fill: #08b58b; stroke: #fff; stroke-width: 1.8; }
.progress-chart-all .progress-point { stroke-width: .5; }
.progress-today-label { fill: #247bf3; font-family: inherit; font-size: 13px; font-weight: 650; }
.progress-day { cursor: pointer; outline: none; }
.progress-day rect { fill: transparent; }
.progress-day:hover rect, .progress-day:focus rect { fill: rgb(13 110 253 / 5%); stroke: #c1d9fa; stroke-width: 1; }
.progress-tooltip { position: absolute; z-index: 2; display: grid; gap: 7px; width: 156px; padding: 11px 13px; border: 1px solid #d9e4f4; border-radius: 10px; color: #64728a; background: #fff; box-shadow: 0 5px 20px rgb(31 74 128 / 10%); font-size: .75rem; pointer-events: none; }
.progress-tooltip[hidden] { display: none; }
.progress-tooltip > strong { color: #52617b; }
.progress-tooltip > span { display: flex; align-items: center; gap: 7px; }
.progress-tooltip-subjects { display: grid; gap: 6px; padding: 7px 0; border-top: 1px solid #edf2fa; border-bottom: 1px solid #edf2fa; }
.progress-tooltip-subjects[hidden] { display: none; }
.progress-tooltip-subjects > span { display: flex; align-items: center; gap: 7px; }
.progress-tooltip b { margin-left: auto; color: #24354f; font-variant-numeric: tabular-nums; }
.progress-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 3px; }
.progress-footprints { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; color: #8290a5; font-size: .68rem; }
.progress-footprints > span { flex: 0 0 auto; }
.progress-footprint-scroll { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 3px; overflow-x: auto; scrollbar-width: thin; }
.progress-footprint { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: #e0e7f1; }
/* 30 天和所有范围压缩每日足迹宽度，不隐藏日期，也不产生横向滚动。 */
.learning-progress:is([data-progress-period="30"], [data-progress-period="all"]) .progress-footprint-scroll { flex: 1; gap: 0; justify-content: space-between; overflow-x: hidden; }
.learning-progress:is([data-progress-period="30"], [data-progress-period="all"]) .progress-footprint { flex: 1 1 0; width: 0; min-width: 0; max-width: 8px; }
.progress-footprint.is-active { background: #3987ff; }
.progress-footprint.is-mastered { background: #08b58b; }
.progress-footprint.is-today { outline: 1px solid #b0cef7; outline-offset: 2px; }
.progress-footprint:focus-visible { outline: 2px solid #648bd0; outline-offset: 2px; }
.progress-import { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 4px; padding: 8px 12px; border-radius: 8px; color: #247bf3; background: #eaf3ff; font-size: .75rem; font-weight: 650; text-decoration: none; }
.progress-import:hover { color: #fff; background: #247bf3; }
.progress-import > span { font-size: 1.1rem; line-height: 1; }
.progress-note { margin: 9px 0 0; color: #95a1b3; font-size: .65rem; }
.progress-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 0 4px; color: #7c89a0; }
.progress-empty svg { width: 150px; height: 75px; }
.learning-progress.htmx-request { opacity: .7; }
@media (max-width: 600px) {
    .learning-progress { padding: 13px 12px 12px; border-radius: 15px; margin-bottom: 16px; }
    .progress-title { gap: 7px; }
    .progress-title-icon { flex-basis: 26px; height: 26px; border-radius: 8px; }
    .progress-title-icon svg { width: 18px; height: 18px; }
    .progress-heading h2 { font-size: .96rem; }
    .progress-period-badge { padding: 2px 5px; font-size: .6rem; }
    .progress-toggle { min-width: 56px; min-height: 44px; padding: 5px 7px; }
    .progress-summary { padding: 10px 0; margin-top: 4px; }
    .progress-summary > div { flex-direction: column; align-items: center; gap: 6px; }
    .progress-summary span { font-size: .68rem; }
    .progress-summary strong { font-size: 1.5rem; }
    .progress-toolbar { flex-wrap: wrap; gap: 10px; padding-top: 12px; }
    .progress-ranges { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .progress-ranges a { min-width: 0; min-height: 36px; display: grid; place-items: center; padding: 5px 8px; }
    .progress-legend { margin-left: auto; font-size: .65rem; }
    /* 手机端隐藏科目颜色图例，为柱状图留出更多空间。 */
    .progress-subject-legend { display: none; }
    .progress-chart-heading { margin-top: 5px; }
    .progress-chart { height: 200px; }
    .progress-axis, .progress-today-label { font-size: 13px; }
    .progress-footer { gap: 10px; }
    .progress-footprints { gap: 8px; }
    .progress-footprint-scroll { gap: 7px; }
    .progress-import { min-height: 40px; padding: 8px 10px; font-size: .7rem; }
    .progress-note { line-height: 1.5; }
}
/* 尊重系统的减少动态效果设置，展开、收起无需动画也能正常使用。 */
@media (prefers-reduced-motion: reduce) {
    .progress-details, .progress-toggle svg { transition: none; }
}
