.home-progress {
    --hp-paper: #fffdf9;
    --hp-surface: #ffffff;
    --hp-ink: #183040;
    --hp-muted: #63737e;
    --hp-line: #dfe5e2;
    --hp-mist: #f1f4f2;
    --hp-orange: #c9501b;
    --hp-orange-dark: #a83c0e;
    --hp-orange-soft: #fff1e7;
    --hp-jade: #287f62;
    --hp-jade-soft: #e7f3ed;
    --hp-gold: #e7a52f;
    --hp-gold-soft: #fff6dc;
    color-scheme: light only !important;
    width: 100%;
    color: var(--hp-ink);
    font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
    text-align: left;
}

.home-progress *,
.home-progress *::before,
.home-progress *::after {
    box-sizing: border-box;
}

.home-progress[hidden] {
    display: none !important;
}

.portal-shell-ready[data-portal-home="home"] #start-screen,
.portal-shell-ready[data-portal-home="home"] .practice-library-shell,
.portal-shell-ready[data-portal-home="home"] .hsk-selection-container,
.portal-shell-ready[data-portal-home="home"] #study-selection-container,
.portal-shell-ready[data-portal-home="home"] #level-dashboard,
.portal-shell-ready[data-portal-home="daily"] #progress-home,
.portal-shell-ready[data-portal-home="practice"] #progress-home {
    display: none !important;
}

.hp-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin: 0 0 22px;
}

.hp-intro h1 {
    max-width: 720px;
    margin: 0;
    color: var(--hp-ink);
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 1.03;
}

.hp-intro p {
    max-width: 650px;
    margin: 9px 0 0;
    color: var(--hp-muted);
    font-size: 0.96rem;
    line-height: 1.55;
}

.hp-date {
    flex: 0 0 auto;
    margin-bottom: 4px;
    color: var(--hp-muted);
    font-size: 0.82rem;
    font-weight: 650;
}

.hp-primary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(290px, 0.75fr);
    gap: 18px;
    align-items: stretch;
}

.hp-journey,
.hp-today,
.hp-proof,
.hp-panel {
    border: 1px solid var(--hp-line);
    border-radius: 24px;
    background: var(--hp-surface);
}

.hp-journey {
    position: relative;
    overflow: hidden;
    padding: 34px 38px;
    box-shadow: 0 18px 50px rgba(24, 48, 64, 0.07);
}

.hp-journey::after {
    position: absolute;
    top: -22px;
    right: 22px;
    color: rgba(201, 80, 27, 0.045);
    content: "学";
    font-family: KaiTi, STKaiti, serif;
    font-size: 10rem;
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
}

.hp-journey-top,
.hp-today-top,
.hp-week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.hp-track-pill,
.hp-streak {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    border: 1px solid #efbea2;
    border-radius: 999px;
    background: #fff8f3;
    color: var(--hp-orange-dark);
    padding: 6px 10px;
    font-size: 0.76rem;
    font-weight: 800;
}

.hp-track-pill::before {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--hp-orange);
    box-shadow: 0 0 0 4px rgba(201, 80, 27, 0.12);
    content: "";
}

.hp-mastery {
    position: relative;
    z-index: 1;
    color: var(--hp-muted);
    font-size: 0.78rem;
    font-weight: 650;
}

.hp-mastery strong {
    margin-left: 8px;
    color: var(--hp-ink);
    font-size: 1.18rem;
    font-weight: 850;
}

.hp-journey h2 {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 28px 0 8px;
    color: var(--hp-ink);
    font-size: clamp(2rem, 3.2vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 1.08;
}

.hp-journey-subtitle {
    position: relative;
    z-index: 1;
    margin: 0;
    color: var(--hp-muted);
    font-size: 0.93rem;
}

.hp-chapter-path {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 14px 10px;
    margin: 28px 0;
}

.hp-chapter-node {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    justify-self: center;
    border: 3px solid var(--hp-mist);
    border-radius: 50%;
    background: var(--hp-surface);
    color: #94a0a6;
    font-size: 0.72rem;
    font-weight: 850;
}

.hp-chapter-node.is-complete {
    border-color: var(--hp-jade);
    background: var(--hp-jade);
    color: #fff;
}

.hp-chapter-node.is-current {
    border-color: var(--hp-orange);
    background: var(--hp-orange-soft);
    color: var(--hp-orange-dark);
    box-shadow: 0 0 0 5px rgba(201, 80, 27, 0.11);
}

.hp-next-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    border-top: 1px solid var(--hp-line);
    padding-top: 22px;
}

.hp-next-copy strong,
.hp-next-copy span {
    display: block;
}

.hp-next-copy strong {
    font-size: 1rem;
}

.hp-next-copy span {
    margin-top: 3px;
    color: var(--hp-muted);
    font-size: 0.82rem;
}

.hp-primary-button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 13px;
    background: var(--hp-orange);
    color: #fff;
    padding: 0 20px;
    box-shadow: 0 8px 20px rgba(201, 80, 27, 0.2);
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 800;
    text-decoration: none;
}

.hp-primary-button:hover {
    background: var(--hp-orange-dark);
    color: #fff;
}

.hp-primary-button:focus-visible,
.hp-history-link:focus-visible {
    outline: 3px solid rgba(201, 80, 27, 0.25);
    outline-offset: 3px;
}

.hp-today {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    border-color: #f0c8b3;
    background: var(--hp-orange-soft);
    padding: 28px;
}

.hp-today h2,
.hp-panel h2 {
    margin: 0;
    color: var(--hp-ink);
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.hp-daily-title-link {
    color: inherit;
    text-decoration: none;
}

.hp-daily-title-link:hover,
.hp-daily-title-link:focus-visible {
    color: var(--hp-orange-dark);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.hp-daily-entry-text {
    margin: 18px 0 28px;
    color: var(--hp-muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.hp-streak {
    border-color: #eab896;
    background: #fffaf6;
    font-size: 0.7rem;
}

.hp-streak svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.hp-review-ring-wrap {
    position: relative;
    display: grid;
    width: 190px;
    height: 190px;
    place-items: center;
    margin: 24px auto 14px;
}

.hp-review-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.hp-review-ring circle {
    fill: none;
    stroke-width: 12;
}

.hp-ring-base {
    stroke: #efd5c6;
}

.hp-ring-progress {
    stroke: #d9541b;
    stroke-linecap: round;
    stroke-dasharray: 402;
    stroke-dashoffset: 402;
    transition: stroke-dashoffset 320ms ease;
}

.hp-ring-copy {
    position: absolute;
    text-align: center;
}

.hp-ring-copy strong,
.hp-ring-copy span {
    display: block;
}

.hp-ring-copy strong {
    color: var(--hp-ink);
    font-size: 2.5rem;
    font-weight: 850;
    letter-spacing: -0.06em;
    line-height: 1;
}

.hp-ring-copy span {
    max-width: 100px;
    margin: 7px auto 0;
    color: var(--hp-muted);
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.25;
}

.hp-today-message {
    max-width: 260px;
    margin: 0 auto 24px;
    color: #536873;
    font-size: 0.82rem;
    line-height: 1.55;
    text-align: center;
}

.hp-today .hp-primary-button {
    width: 100%;
    margin-top: auto;
}

.hp-proof {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 18px 0;
    padding: 18px 24px;
}

.hp-proof-item {
    padding: 0 22px;
}

.hp-proof-item:first-child {
    padding-left: 0;
}

.hp-proof-item + .hp-proof-item {
    border-left: 1px solid var(--hp-line);
}

.hp-proof-item strong,
.hp-proof-item span {
    display: block;
}

.hp-proof-item strong {
    font-size: 1.45rem;
    font-weight: 850;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.hp-proof-item span {
    margin-top: 4px;
    color: var(--hp-muted);
    font-size: 0.76rem;
}

.hp-secondary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.9fr);
    gap: 18px;
}

.hp-panel {
    padding: 28px;
}

.hp-week-total {
    color: var(--hp-jade);
    font-size: 0.8rem;
    font-weight: 850;
}

.hp-panel-subtitle {
    margin: 4px 0 0;
    color: var(--hp-muted);
    font-size: 0.78rem;
}

.hp-week-bars {
    display: grid;
    height: 126px;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin: 26px 0 20px;
}

.hp-day {
    display: grid;
    min-width: 0;
    grid-template-rows: 1fr auto auto;
    gap: 5px;
    color: var(--hp-muted);
    font-size: 0.68rem;
    text-align: center;
}

.hp-bar-track {
    display: flex;
    min-height: 0;
    align-items: flex-end;
    border-radius: 9px;
    background: var(--hp-mist);
    overflow: hidden;
}

.hp-bar {
    width: 100%;
    min-height: 4px;
    border-radius: 9px 9px 4px 4px;
    background: var(--hp-jade);
}

.hp-day.is-today .hp-bar {
    background: var(--hp-orange);
}

.hp-day b {
    color: var(--hp-ink);
    font-size: 0.7rem;
}

.hp-milestone {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: center;
    border: 1px solid #efc46c;
    border-radius: 17px;
    background: var(--hp-gold-soft);
    padding: 16px 18px;
}

.hp-milestone-badge {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border: 2px solid var(--hp-gold);
    border-radius: 50%;
    color: #9f6500;
    font-size: 1rem;
    font-weight: 850;
}

.hp-milestone strong,
.hp-milestone span {
    display: block;
}

.hp-milestone strong {
    font-size: 0.88rem;
}

.hp-milestone span {
    margin-top: 3px;
    color: #8b6b32;
    font-size: 0.76rem;
    line-height: 1.45;
}

.hp-recent-list {
    margin: 23px 0 0;
}

.hp-activity {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 13px;
    align-items: center;
    border-bottom: 1px solid var(--hp-line);
    padding: 13px 0;
}

.hp-activity:last-child {
    border-bottom: 0;
}

.hp-activity-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 11px;
    background: var(--hp-orange-soft);
    font-size: 1rem;
}

.hp-activity:nth-child(2n) .hp-activity-icon {
    background: var(--hp-jade-soft);
}

.hp-activity-copy strong,
.hp-activity-copy span,
.hp-activity-score strong,
.hp-activity-score span {
    display: block;
}

.hp-activity-copy strong {
    color: var(--hp-ink);
    font-size: 0.81rem;
}

.hp-activity-copy span {
    margin-top: 2px;
    color: var(--hp-muted);
    font-size: 0.7rem;
}

.hp-activity-score {
    min-width: 48px;
    text-align: right;
}

.hp-activity-score strong {
    font-size: 0.77rem;
}

.hp-activity-score span {
    margin-top: 1px;
    color: var(--hp-jade);
    font-size: 0.6rem;
    font-weight: 750;
}

.hp-empty,
.hp-status {
    color: var(--hp-muted);
    font-size: 0.8rem;
    line-height: 1.55;
}

.hp-status {
    margin: 14px 0 0;
}

.hp-history-link {
    display: inline-block;
    margin-top: 16px;
    color: var(--hp-orange-dark);
    font-size: 0.75rem;
    font-weight: 800;
    text-decoration: none;
}

@media (max-width: 1040px) {
    .hp-primary-grid,
    .hp-secondary-grid {
        grid-template-columns: 1fr;
    }

    .hp-today {
        min-height: 390px;
    }
}

@media (max-width: 680px) {
    .hp-intro {
        display: block;
        margin-top: 4px;
    }

    .hp-intro h1 {
        font-size: clamp(1.85rem, 8.4vw, 2.35rem);
        letter-spacing: -0.05em;
    }

    .hp-date {
        display: none;
    }

    .hp-journey,
    .hp-today,
    .hp-panel {
        border-radius: 20px;
        padding: 24px 20px;
    }

    .hp-journey h2 {
        margin-top: 24px;
        font-size: clamp(1.8rem, 8vw, 2.2rem);
    }

    .hp-mastery span {
        display: none;
    }

    .hp-chapter-path {
        gap: 12px 4px;
        margin: 25px 0;
    }

    .hp-chapter-node {
        width: 29px;
        height: 29px;
        border-width: 2px;
        font-size: 0.62rem;
    }

    .hp-next-row {
        display: block;
    }

    .hp-next-row .hp-primary-button {
        width: 100%;
        margin-top: 16px;
    }

    .hp-today {
        min-height: auto;
    }

    .hp-review-ring-wrap {
        width: 168px;
        height: 168px;
    }

    .hp-proof {
        padding: 16px 12px;
    }

    .hp-proof-item {
        padding: 0 9px;
    }

    .hp-proof-item strong {
        font-size: 1.18rem;
    }

    .hp-proof-item span {
        font-size: 0.63rem;
        line-height: 1.3;
    }

    .hp-panel {
        padding: 24px 18px;
    }

    .hp-week-bars {
        gap: 6px;
    }

    .hp-milestone {
        gap: 13px;
        padding: 14px;
    }
}

@media (max-width: 360px) {
    .hp-journey,
    .hp-today,
    .hp-panel {
        padding-right: 16px;
        padding-left: 16px;
    }

    .hp-chapter-node {
        width: 26px;
        height: 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hp-ring-progress {
        transition: none;
    }
}

@media (prefers-color-scheme: dark) {
    .home-progress,
    .home-progress * {
        color-scheme: light only !important;
    }
}
