:root {
    --kg-accent: #991b1b;
    --kg-accent-strong: #7f1d1d;
    --kg-ink: #17191d;
    --kg-muted: #68707d;
    --kg-page: #f5f4f1;
    --kg-surface: #fff;
    --kg-soft: #f7f7f6;
    --kg-divider: #e8e7e3;
    --kg-shadow:
        0 0 0 1px rgba(0, 0, 0, .055),
        0 1px 2px -1px rgba(0, 0, 0, .06),
        0 12px 32px -22px rgba(36, 28, 24, .24);
    --kg-shadow-hover:
        0 0 0 1px rgba(0, 0, 0, .075),
        0 2px 5px -2px rgba(0, 0, 0, .08),
        0 18px 38px -22px rgba(36, 28, 24, .30);
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--kg-page);
}

body.kindergarten-detail-page {
    margin: 0;
    background: var(--kg-page);
    color: var(--kg-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.kindergarten-detail-page .kg-detail-top-button {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 20;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: var(--kg-ink);
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 10px 24px rgba(68, 52, 35, .16);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease, color .18s ease, visibility 0s linear .18s;
    touch-action: manipulation;
}

.kindergarten-detail-page .kg-detail-top-button.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
}

.kindergarten-detail-page .kg-detail-top-button:focus-visible {
    outline: 2px solid var(--kg-accent);
    outline-offset: 3px;
}

.kindergarten-detail-page .kg-detail-identity h1:focus-visible {
    outline: 2px solid var(--kg-accent);
    outline-offset: 3px;
}

.kindergarten-detail-page .kg-detail-top-button:active {
    transform: scale(.96);
}

@media (hover: hover) and (pointer: fine) {
    .kindergarten-detail-page .kg-detail-top-button:hover {
        color: var(--kg-accent);
    }
}

.kg-detail-main {
    width: min(1080px, calc(100% - 48px));
    margin: 0 auto;
    padding: 92px 0 72px;
}

.kg-detail-identity-shell {
    position: relative;
    display: grid;
    gap: 18px;
}

.kg-detail-return {
    margin: 0;
}

.kg-detail-back,
.kg-detail-action {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-align: center;
    text-decoration: none;
    transition-property: transform, box-shadow, background-color, color;
    transition-duration: 150ms;
    transition-timing-function: ease-out;
}

.kg-detail-back {
    min-width: 44px;
    padding: 0 15px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .74);
    box-shadow: var(--kg-shadow);
    color: #32353b;
    font-size: 14px;
    font-weight: 650;
}

.kg-detail-back:hover {
    background: #fff;
    color: var(--kg-accent);
}

.kg-detail-back:active,
.kg-detail-action:active {
    transform: scale(.96);
}

.kg-detail-back:focus-visible,
.kg-detail-action:focus-visible,
.kg-detail-article-row:focus-visible {
    outline: 3px solid rgba(153, 27, 27, .28);
    outline-offset: 3px;
}

.kg-detail-hero,
.kg-detail-section,
.kg-detail-facts {
    border-radius: 22px;
    background: var(--kg-surface);
    box-shadow: var(--kg-shadow);
}

.kg-detail-hero {
    position: relative;
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr) auto;
    gap: 28px;
    align-items: center;
    min-height: 204px;
    padding: 34px;
    overflow: hidden;
    background:
        radial-gradient(circle at 92% 4%, rgba(153, 27, 27, .09), transparent 30%),
        var(--kg-surface);
}

.kg-detail-logo-shell {
    display: grid;
    width: 120px;
    height: 120px;
    place-items: center;
    padding: 8px;
    box-sizing: border-box;
    border-radius: 22px;
    background: #f2f1ee;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .045);
}

.kg-detail-logo-shell picture,
.kg-detail-logo {
    display: block;
    width: 104px;
    height: 104px;
}

.kg-detail-logo {
    border-radius: 15px;
    object-fit: contain;
    background: #fff;
    outline: 1px solid rgba(0, 0, 0, .1);
    outline-offset: -1px;
}

.kg-detail-identity {
    min-width: 0;
}

.kg-detail-identity h1 {
    max-width: 700px;
    margin: 0;
    font-size: clamp(26px, 3.2vw, 38px);
    line-height: 1.16;
    font-weight: 800;
    letter-spacing: -.025em;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
    text-wrap: balance;
}

.kindergarten-detail-page.lang-en .kg-detail-identity h1 {
    font-size: clamp(24px, 2.7vw, 34px);
    line-height: 1.22;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
    text-wrap: balance;
}

.kg-detail-secondary-name {
    margin: 9px 0 0;
    color: #4f5661;
    font-size: 16px;
    line-height: 1.5;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
    text-wrap: wrap;
}

.kg-detail-location-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.kg-detail-location-tag {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 0 10px;
    border-radius: 10px;
    background: var(--kg-soft);
    color: #4f5661;
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
}

.kg-detail-trust-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 8px;
    margin-top: 12px;
    padding-right: 0;
    color: var(--kg-muted);
    font-size: 12px;
    line-height: 1.5;
}

.kg-detail-trust-meta strong,
.kg-detail-trust-meta time {
    font-weight: 400;
}

.kg-detail-trust-meta time,
.kg-detail-rating-tag strong,
.kg-detail-fact-row dd,
.kg-detail-article-row time {
    font-variant-numeric: tabular-nums;
}

.kg-detail-identity-action {
    align-self: end;
}

.kg-detail-action {
    min-height: 48px;
    padding: 0 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 720;
}

.kg-detail-action-primary {
    background: var(--kg-accent);
    color: #fff;
    box-shadow: 0 8px 18px -10px rgba(153, 27, 27, .72);
}

.kg-detail-action-primary:hover {
    background: var(--kg-accent-strong);
    box-shadow: 0 10px 22px -10px rgba(127, 29, 29, .78);
}

.kg-detail-action-secondary {
    background: #f0efec;
    color: #34383e;
}

.kg-detail-action-secondary:hover {
    background: #e8e6e1;
}

.kg-detail-section,
.kg-detail-facts {
    margin-top: 24px;
    padding: 30px 32px;
}

.kg-detail-section-heading {
    margin-bottom: 20px;
}

.kg-detail-section-heading h2,
.kg-detail-facts h2 {
    margin: 0;
    font-size: 23px;
    letter-spacing: -.02em;
    text-wrap: balance;
}

.kg-detail-rating-list {
    border-top: 1px solid var(--kg-divider);
}

.kg-detail-rating-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 356px;
    gap: 24px;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid var(--kg-divider);
}

.kg-detail-rating-row h3 {
    margin: 0;
    color: #3e444d;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.6;
    text-wrap: pretty;
}

.kg-detail-rating-credentials {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

.kg-detail-rating-tag {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    min-height: 36px;
    align-items: center;
    justify-content: flex-start;
    padding: 0 14px;
    box-sizing: border-box;
    border-radius: 999px;
    background: var(--kg-soft);
    color: var(--kg-accent);
    font-size: 16px;
    white-space: nowrap;
}

.kg-detail-rating-tag strong {
    color: var(--kg-accent);
    font-size: 16px;
    font-weight: 800;
}

.kg-detail-facts h2 {
    margin-bottom: 20px;
}

.kg-detail-facts dl {
    margin: 0;
    border-top: 1px solid var(--kg-divider);
}

.kg-detail-facts-intro {
    margin: 0 0 24px;
    padding: 0;
    border: 0;
    color: #40464f;
    font-size: 16px;
    line-height: 1.95;
    overflow-wrap: anywhere;
}

.kg-detail-fact-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 18px;
    align-items: baseline;
    min-width: 0;
    padding: 17px 0;
    border-bottom: 1px solid var(--kg-divider);
}

.kg-detail-fact-row dt,
.kg-detail-fact-row dd {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

.kg-detail-fact-row dt {
    color: var(--kg-muted);
}

.kg-detail-fact-row dd {
    color: #292d33;
    font-weight: 650;
    text-align: left;
    text-wrap: pretty;
}

.kg-detail-fact-row-fee strong {
    color: #292d33;
    font-size: 14px;
}

.kg-detail-facts-disclaimer {
    margin: 18px 0 0;
    color: var(--kg-muted);
    font-size: 12px;
    line-height: 1.65;
    text-wrap: pretty;
}

.kg-detail-article-list {
    border-top: 1px solid var(--kg-divider);
}

.kg-detail-article-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    min-height: 0;
    padding: 18px 0;
    box-sizing: border-box;
    border-bottom: 1px solid var(--kg-divider);
    color: inherit;
    text-decoration: none;
    transition-property: color;
    transition-duration: 150ms;
    transition-timing-function: ease-out;
}

.kg-detail-article-row:hover {
    color: var(--kg-accent);
}

.kg-detail-article-row time {
    color: var(--kg-muted);
    font-size: 12px;
    line-height: 1.5;
    font-weight: 400;
    white-space: nowrap;
}

.kg-detail-article-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.55;
    text-wrap: balance;
}

.kg-detail-article-empty {
    margin: 0;
    padding: 20px 0 4px;
    border-top: 1px solid var(--kg-divider);
    color: var(--kg-muted);
    font-size: 14px;
}

.kg-detail-mobile-actions {
    display: none;
}

@media (min-width: 1280px) {
    .kg-detail-identity-shell {
        display: block;
    }

    .kg-detail-return {
        position: absolute;
        z-index: 2;
        top: 0;
        right: calc(100% + 16px);
        width: max-content;
    }
}

@media (max-width: 860px) {
    .kg-detail-main {
        width: min(100% - 28px, 720px);
        padding-top: 84px;
    }

    .kg-detail-hero {
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 22px;
        min-height: 0;
        padding: 28px;
    }

    .kg-detail-logo-shell {
        width: 96px;
        height: 96px;
        border-radius: 23px;
    }

    .kg-detail-logo-shell picture,
    .kg-detail-logo {
        width: 80px;
        height: 80px;
    }

    .kg-detail-identity-action {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    .kg-detail-trust-meta {
        padding-right: 0;
    }

    .kg-detail-identity-action .kg-detail-action {
        width: 100%;
    }
}

@media (max-width: 600px) {
    body.kindergarten-detail-page {
        padding-bottom: calc(82px + env(safe-area-inset-bottom));
    }

    .kg-detail-main {
        width: calc(100% - 24px);
        padding: 82px 0 calc(102px + env(safe-area-inset-bottom));
    }

    .kg-detail-identity-shell {
        gap: 12px;
    }

    .kg-detail-back {
        font-size: 13px;
    }

    .kg-detail-hero {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 15px;
        padding: 20px 18px;
        border-radius: 19px;
    }

    .kg-detail-logo-shell {
        width: 68px;
        height: 68px;
        padding: 5px;
        border-radius: 17px;
    }

    .kg-detail-logo-shell picture,
    .kg-detail-logo {
        width: 58px;
        height: 58px;
    }

    .kg-detail-logo {
        border-radius: 12px;
    }

    .kg-detail-identity h1 {
        font-size: clamp(20px, 5.8vw, 25px);
        line-height: 1.18;
        letter-spacing: -.018em;
    }

    .kindergarten-detail-page.lang-en .kg-detail-identity h1 {
        font-size: clamp(19px, 5.2vw, 23px);
        line-height: 1.24;
    }

    .kg-detail-secondary-name {
        margin-top: 6px;
        font-size: 13px;
    }

    .kg-detail-location-tags {
        gap: 5px;
        margin-top: 12px;
    }

    .kg-detail-location-tag {
        min-height: 24px;
        padding: 0 8px;
        border-radius: 8px;
        font-size: 11px;
    }

    .kg-detail-trust-meta {
        grid-column: 1 / -1;
        margin-top: 10px;
        font-size: 11px;
    }

    .kg-detail-identity-action {
        display: none;
    }

    .kg-detail-section,
    .kg-detail-facts {
        margin-top: 16px;
        padding: 23px 18px;
        border-radius: 18px;
    }

    .kg-detail-section-heading,
    .kg-detail-facts h2 {
        margin-bottom: 17px;
    }

    .kg-detail-section-heading h2,
    .kg-detail-facts h2 {
        font-size: 21px;
    }

    .kg-detail-rating-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 16px 0;
    }

    .kg-detail-rating-row h3 {
        font-size: 14px;
        line-height: 1.6;
    }

    .kg-detail-rating-credentials {
        gap: 8px;
        width: 100%;
    }

    .kg-detail-rating-tag {
        width: auto;
        max-width: 100%;
        min-height: 34px;
        justify-content: flex-start;
        padding: 0 14px;
        font-size: 14px;
        text-align: left;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .kg-detail-rating-tag strong {
        font-size: 14px;
    }

    .kg-detail-facts-intro {
        margin-bottom: 20px;
        padding: 0;
        font-size: 15px;
        line-height: 1.85;
    }

    .kg-detail-fact-row {
        grid-template-columns: 84px minmax(0, 1fr);
        gap: 14px;
        padding: 15px 0;
    }

    .kg-detail-fact-row dt,
    .kg-detail-fact-row dd {
        font-size: 14px;
        line-height: 1.6;
    }

    .kg-detail-fact-row-fee strong {
        font-size: 14px;
    }

    .kg-detail-facts-disclaimer {
        margin-top: 14px;
        font-size: 11px;
        line-height: 1.55;
    }

    .kg-detail-article-row {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 10px;
        min-height: 0;
        padding: 16px 0;
    }

    .kg-detail-article-row time {
        font-size: 12px;
    }

    .kg-detail-article-title {
        font-size: 15px;
        line-height: 1.55;
    }

    .kg-detail-article-empty {
        padding-top: 16px;
        font-size: 13px;
    }

    .kg-detail-mobile-actions {
        position: fixed;
        z-index: 1000;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .94);
        box-shadow: 0 -1px 0 rgba(0, 0, 0, .06), 0 -12px 32px rgba(0, 0, 0, .10);
        backdrop-filter: blur(16px);
    }

    .kindergarten-detail-page #bottomMenuPC {
        margin-bottom: calc(92px + env(safe-area-inset-bottom));
    }

    .kindergarten-detail-page .kg-detail-top-button {
        right: calc(16px + env(safe-area-inset-right));
        bottom: calc(82px + env(safe-area-inset-bottom));
        z-index: 1001;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kg-detail-back,
    .kg-detail-action,
    .kg-detail-article-row,
    .kg-detail-top-button {
        transition-duration: 0ms;
    }

    .kg-detail-top-button {
        transform: none;
    }
}
