.ranking-page {
    --rank-ink: #19382c;
    --rank-serif: "Instrument Serif", "Noto Serif CJK SC", "Songti SC", SimSun, serif;
    padding-block: 24px 64px;
}

.ranking-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    align-items: center;
    min-height: 420px;
    overflow: hidden;
    border-radius: 20px;
    background: #132c23;
}
.ranking-hero img, .ranking-hero::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.ranking-hero img { object-fit: cover; object-position: center 55%; z-index: -2; }
.ranking-hero::after {
    content: "";
    z-index: -1;
    background: linear-gradient(90deg, #10251f 0%, #10251ff0 26%, #10251f5e 61%, #10251f12 100%);
}
.ranking-hero-content { padding: clamp(25px, 5vw, 72px); color: #f5f2e7; }
.ranking-hero-content p { color: #e2e9e0; }
.ranking-hero-content .ranking-region { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: #f0d9ab; font-weight: 700; }
.ranking-hero h1 {
    font-family: var(--rank-serif);
    font-size: clamp(43px, 6.15vw, 86px);
    letter-spacing: -.045em;
    line-height: 1.03;
    margin-bottom: 16px;
    color: #fffdf2;
}
.ranking-hero h1 span { display: block; color: #f0d19b; }
.rank-hero-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding: 8px 14px;
    min-height: 42px;
    border: 1px solid #dfbc80;
    border-radius: 7px;
    background: #f2d6a5;
    color: #20392e;
    font-weight: 700;
    text-decoration: none;
}
.rank-hero-link:hover { background: #fae8c4; color: #20392e; }

.ranking-results { margin-top: 34px; scroll-margin-top: 18px; }
.ranking-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-bottom: 17px; }
.ranking-heading h2 { color: var(--rank-ink); font-size: clamp(24px, 3vw, 36px); }
.ranking-heading p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.ranking-heading > a { font-size: 14px; }
.ranking-featured, .ranking-rows { list-style: none; padding: 0; margin: 0; }
.ranking-featured { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rank-card { min-width: 0; }
.rank-card-link {
    height: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    grid-template-rows: auto auto 1fr auto;
    gap: 10px;
    padding: 18px;
    background: var(--white);
    border: 1px solid #d9e0d4;
    border-top: 3px solid #a4b49e;
    border-radius: 12px;
    color: var(--ink);
    text-decoration: none;
}
.rank-card:first-child .rank-card-link { border-top-color: #b28b4b; background: linear-gradient(155deg, #fbf1db, #fffefa 70%); }
.rank-card-link:hover { border-color: #9aab98; color: var(--ink); }
.rank-card:first-child .rank-card-link:hover { border-color: #b28b4b; }
.rank-number {
    display: grid;
    place-items: center;
    width: 42px;
    min-height: 42px;
    background: #e9f0e4;
    color: #294d3c;
    border-radius: 8px;
    font-family: Georgia, serif;
    font-size: 22px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.rank-card:first-child .rank-number { background: #254336; color: #f3d49b; }
.rank-district { align-self: center; justify-self: end; font-size: 13px; color: var(--muted); }
.rank-card h3, .rank-address, .rank-card-bottom { grid-column: 1 / -1; }
.rank-card h3 { font-size: 22px; overflow-wrap: anywhere; }
.rank-address { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.rank-card-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 9px; }
.rank-price { font-size: 19px; color: var(--rank-ink); font-weight: 700; white-space: nowrap; }
.rank-price small, .rank-reviews { font-size: 12px; font-weight: 400; color: var(--muted); }
.rank-reviews { display: block; }
.rank-arrow { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 50%; color: var(--forest); }

.ranking-rows { margin-top: 16px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ranking-rows li + li { border-top: 1px solid var(--line); }
.ranking-rows li a {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto 29px;
    align-items: center;
    gap: 13px;
    padding: 11px 16px;
    color: var(--ink);
    text-decoration: none;
}
.ranking-rows li a:hover { background: #f0f4eb; }
.ranking-rows li a:focus-visible { outline-offset: -4px; }
.ranking-rows .rank-number { width: 36px; min-height: 36px; font-size: 17px; }
.rank-row-school h3 { font-size: 17px; overflow-wrap: anywhere; }
.rank-row-school p { margin-top: 2px; font-size: 12px; color: var(--muted); }

@media (max-width: 680px) {
    .ranking-page { padding-block: 15px 42px; }
    .ranking-hero { min-height: 290px; border-radius: 14px; }
    .ranking-hero img { object-position: 60% center; }
    .ranking-hero::after { background: linear-gradient(90deg, #10251ff7 0%, #10251fdf 35%, #10251f5c 100%); }
    .ranking-hero-content { padding: 22px 18px; }
    .ranking-hero-content > p:not(.ranking-region) { max-width: 245px; font-size: 13px; }
    .ranking-hero h1 { margin-bottom: 12px; }
    .rank-hero-link { margin-top: 16px; }
    .ranking-results { margin-top: 24px; }
    .ranking-heading { align-items: start; }
    .ranking-heading > a { margin-top: 4px; font-size: 12px; }
    .ranking-featured { grid-template-columns: 1fr; gap: 8px; }
    .rank-card-link { padding: 11px; gap: 6px; }
    .rank-card h3 { font-size: 18px; }
    .rank-address { font-size: 12px; }
    .ranking-rows li a { grid-template-columns: 29px minmax(0, 1fr) auto 20px; gap: 7px; padding: 9px; }
    .ranking-rows .rank-number { width: 27px; min-height: 28px; font-size: 14px; }
    .ranking-rows .rank-price { font-size: 14px; }
    .ranking-rows .rank-price small { display: block; text-align: right; font-size: 10px; }
    .rank-row-school h3 { font-size: 14px; }
    .ranking-rows .rank-arrow { width: 20px; height: 20px; font-size: 12px; }
}
