@charset "utf-8";

/* 首页学科导航；不影响题库、作业和其他页面。 */
.subject-hub {
    --hub-blue: #2a7efb;
    width: min(1200px, calc(100% - 48px));
    margin: 32px auto 48px;
    border: 1px solid #e6edf7;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 8px 32px rgba(35, 70, 120, .045);
    overflow: hidden;
    text-align: left;
}
.subject-hub, .subject-hub * { box-sizing: border-box; }
.subject-hub__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 32px;
    border-bottom: 1px solid #edf1f7;
    background: linear-gradient(110deg, #f7faff, #fff 65%);
}
.subject-hub__heading { display: flex; align-items: center; gap: 14px; }
.subject-hub__mark {
    display: grid;
    place-items: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border: 1px solid #dceaff;
    border-radius: 14px;
    color: var(--hub-blue);
    background: #edf5ff;
}
.subject-hub svg { display: block; }
.subject-hub__title {
    margin: 0;
    color: #24354f;
    font-size: 22px;
    font-weight: 600;
    line-height: 30px;
    letter-spacing: .5px;
}
.subject-hub__description {
    margin: 5px 0 0;
    color: #8290a5;
    font-size: 13px;
    line-height: 22px;
}
.subject-hub__hint {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 8px;
    color: #6c82a3;
    background: #f3f7fc;
    font-size: 12px;
    line-height: 18px;
    white-space: nowrap;
}
.subject-hub__stages { margin: 0; padding: 0 32px; list-style: none; }
.subject-stage {
    display: grid;
    grid-template-columns: 156px minmax(0, 1fr);
    align-items: start;
    gap: 28px;
    margin: 0;
    padding: 28px 0;
}
.subject-stage + .subject-stage { border-top: 1px solid #edf1f7; }
.subject-stage__intro { padding: 8px 0 0; }
.subject-stage__label { display: flex; align-items: center; gap: 10px; }
.subject-stage__accent {
    width: 4px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 4px;
    background: var(--hub-blue);
}
.subject-stage:nth-child(3n + 2) .subject-stage__accent { background: #7485d9; }
.subject-stage:nth-child(3n) .subject-stage__accent { background: #44aaa1; }
.subject-stage__title { margin: 0; color: #34445c; font-size: 18px; font-weight: 600; line-height: 26px; }
.subject-stage__count { margin: 7px 0 0 14px; color: #96a2b3; font-size: 12px; line-height: 20px; }
.subject-stage__current {
    display: inline-block;
    margin: 10px 0 0 14px;
    padding: 2px 8px;
    border-radius: 5px;
    color: #5388d4;
    background: #f0f6ff;
    font-size: 11px;
    line-height: 18px;
}
.subject-stage__subjects {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.subject-stage__subjects > li { min-width: 0; margin: 0; padding: 0; }
.subject-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 76px;
    height: 100%;
    padding: 15px 16px;
    border: 1px solid #edf1f6;
    border-radius: 12px;
    background: #fafbfd;
    color: #34445c;
    text-decoration: none;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.subject-tile:visited { color: #34445c; }
.subject-tile__symbol {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    height: 38px;
    border-radius: 10px;
    background: #eaf2ff;
    color: #4987df;
    font-size: 17px;
    font-weight: 600;
    line-height: 1;
}
.subject-stage__subjects > li:nth-child(4n + 2) .subject-tile__symbol { color: #6c78c4; background: #eef0fc; }
.subject-stage__subjects > li:nth-child(4n + 3) .subject-tile__symbol { color: #379a8c; background: #e9f6f2; }
.subject-stage__subjects > li:nth-child(4n) .subject-tile__symbol { color: #b78c4c; background: #faf2e6; }
.subject-tile__content { min-width: 0; flex: 1; }
.subject-tile__name { display: block; color: inherit; font-size: 15px; font-weight: 600; line-height: 22px; overflow-wrap: anywhere; }
.subject-tile__action { display: block; margin-top: 2px; color: #94a1b3; font-size: 11px; line-height: 18px; }
.subject-tile__arrow { flex: 0 0 16px; color: #b0bdd0; transition: color .18s ease, transform .18s ease; }
.subject-tile:hover, .subject-tile:focus-visible {
    border-color: #b8d4fe;
    background: #f3f8ff;
    color: #2472e3;
    box-shadow: 0 5px 14px rgba(42, 126, 251, .07);
    transform: translateY(-2px);
    text-decoration: none;
}
.subject-tile:hover .subject-tile__action, .subject-tile:focus-visible .subject-tile__action { color: #6698de; }
.subject-tile:hover .subject-tile__arrow, .subject-tile:focus-visible .subject-tile__arrow { color: var(--hub-blue); transform: translateX(2px); }
.subject-tile:focus-visible { outline: 2px solid var(--hub-blue); outline-offset: 3px; }
.subject-hub__empty { margin: 0; padding: 40px 24px; color: #8290a5; text-align: center; }

@media (max-width: 1100px) {
    .subject-stage { grid-template-columns: 130px minmax(0, 1fr); gap: 20px; }
    .subject-stage__subjects { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .subject-hub { width: calc(100% - 32px); margin: 24px auto 32px; border-radius: 16px; }
    .subject-hub__header { padding: 22px 20px; }
    .subject-hub__hint { display: none; }
    .subject-hub__stages { padding: 0 20px; }
    .subject-stage { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 22px 0; }
    .subject-stage__intro { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 0; }
    .subject-stage__count, .subject-stage__current { margin: 0; }
    .subject-stage__subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .subject-tile { gap: 10px; padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .subject-tile, .subject-tile__arrow { transition: none; }
    .subject-tile:hover, .subject-tile:focus-visible, .subject-tile:hover .subject-tile__arrow, .subject-tile:focus-visible .subject-tile__arrow { transform: none; }
}
