:root {
    --bg: rgba(255, 255, 255, 1);
    --text: rgba(34, 34, 34, 1);
    --muted: #5fa3a3;
    --line: #e0e0e0d9;
    --accent: #5fa3a3;
    --accent-soft: #a3dada;
}

/* 基礎樣式 */
html:lang(zh-Hant) body,
html:lang(ja) body,
html:lang(en) body {
    font-style: normal;
}

html:lang(zh-Hant) body {
    font-family: "Chocolate Classical Sans", "Outfit", "LINE Seed JP", sans-serif;
}

html:lang(ja) body {
    font-family: "LINE Seed JP", "Outfit", "Chocolate Classical Sans", sans-serif;
}

html:lang(en) body {
    font-family: "Outfit", "Chocolate Classical Sans", "LINE Seed JP", sans-serif;
}

html {
    width: 100%;
    font-size: 1.25rem;
}

body {
    padding: 0;
    margin: 0;
    min-height: 100%;
    position: relative;
    isolation: isolate;
    color: var(--text);
    line-height: 1.4;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        rgba(255, 255, 255, 0.45) url("https://pe.ooearth.com/images/b1.jpg") center / cover no-repeat;
    background-blend-mode: overlay;
}

p {
    margin: 0.8em 0 0.8em 0;
}

h2 {
    margin: 0.8rem;
    font-size: 1.25rem;
}

main,
section {
    width: 100%;
}

section h1 {
    margin-left: 5%;
}

/* 主要版面 */
.other-nav,
.h0,
.horizon-content,
.in-content {
    box-sizing: border-box;
    width: 90%;
    max-width: 1000px;
}

.other-nav,
.h0,
.horizon-content {
    margin: 20px auto 10px;
}

.other-nav {
    justify-content: start;
    align-items: start;
    gap: 10px;
    padding: 12px 0 12px 0;
    background: none;
}

.horizon-content {
    display: grid;
    column-gap: 5%;
    grid-template-columns: 7fr 3fr;
}

.left-content,
.small-content {
    margin-bottom: 42px;
    backdrop-filter: blur(3px);
}

.small-content h2 {
    margin: 4px;
    font-size: 1rem;
}

.left-content,
.in-content {
    background: #ffffff99;
    padding: 2%;
}

.left-content,
.small-content,
.in-content {
    border-radius: 5px;
}

.small-content {
    background: #a3dada99;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.in-content {
    margin: 20px auto;
    backdrop-filter: blur(3px);
}

.clocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(10rem, 25%, 15rem), 1fr));
    gap: 1.5rem;
    align-items: stretch;
    justify-content: center;
    box-sizing: border-box;
}

.clock-card {
    background: #a3dada99;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    border-radius: 5px;
}

/* 頁首、標誌與語言導覽 */
#header-index,
footer {
    /* background: #5fa3a3cd; */
    background: linear-gradient(to right, #5fa3a3, #5fa3a366, #5fa3a3cd);
    backdrop-filter: blur(3px);
    border: none;
}

#header-index {
    width: 100%;
    position: sticky;
    top: 0;
    padding: 0;
    margin: 0;
    z-index: 1100;
}

.logo-div {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 16px;
}

.logo-img,
.logo-img-small {
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-img {
    position: sticky;
    top: 0;
    z-index: 25;
    width: 52px;
}

.logo-img-small {
    width: 36px;
}

.logo-text {
    color: #ffffff;
    line-height: 0.9;
    text-align: left;
}

#keepingTitle {
    color: #ffffff;
    font-size: 1rem;
}

.logo-zh,
.logo-ja {
    font-size: 0.75rem;
}

.logo-zh {
    font-family: "Chocolate Classical Sans", sans-serif;
}

.logo-ja {
    font-family: "LINE Seed JP", sans-serif;
}

.logo-en {
    font-family: "Outfit", sans-serif;
    font-size: 1.45rem;
}

.logo-link,
.logo-link:hover,
.logo-link:focus-visible {
    display: inline-block;
    padding: 0;
    color: inherit;
    text-decoration: none;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.logo-multiple {
    display: flex;
    align-items: center;
    justify-content: left;
    gap: 14px;
    margin: 0;
    padding: 0;
}

.languages {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: fit-content;
    margin-left: auto;
    gap: 10px;
    padding: 8px 16px;
    background: none;
}

.button-group {
    display: flex;
    width: fit-content;
    gap: 6px;
    padding: 6px 2px 6px 0;
    border-radius: 999px;
    background: none;
}

.button-group button {
    margin: 0;
    padding: 3px 6px 3px 6px;
}

.button-group-small button {
    margin: 0;
    padding: 2px 5px 2px 5px;
}

.button-group-small {
    display: flex;
    width: fit-content;
    gap: 4px;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
}


.a-button,
#header-index,
.logo-div,
.logo-img,
.logo-img-small,
.logo-multiple,
.languages,
.button-group,
.button-group-small {
    transition: all 0.3s ease;
}

/* 按鈕 */
.a-button,
.t-button,
.a-button-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    text-decoration: none;
    background: var(--bg);
}

.a-button,
.t-button {
    border-radius: 999px;
}

.a-button {
    padding: 0.45rem 0.85rem;
    font-size: 0.9rem;
    border: 2px solid #a3dadaa3;
}

.t-button {
    margin: 5px;
    padding: 0.1rem 0.4rem;
    font-size: 1rem;
    border: 2px solid #5fa3a388;
}

.a-button-small {
    padding: 0.2rem;
    font-size: 0.8rem;
    border-radius: 50px;
    border: 2px solid #a3dadaa3;
}

.t-button,
.a-button-small {
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.a-button-small.active:hover,
.t-button:hover,
.a-button-small:hover,
.a-button-small:focus-visible,
.a-button:hover,
.a-button:focus-visible {
    color: var(--text);
    background: var(--accent-soft);
    border: 2px solid #5fa3a3a3;
}

button {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 6px 13px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    cursor: pointer;
    transition: 0.2s ease;
    backdrop-filter: blur(3px);
}

button:hover {
    color: var(--text);
    background: var(--accent-soft);
}

button.active {
    background: var(--accent);
    color: #ffffff;
}

.a-button-small.active {
    background: var(--accent);
    color: #ffffff;
    border: 2px solid #a3dadaa3;
}

/* 投影片 */
.slideshow {
    display: block;
    width: 100%;
}

.slideshow_img_container {
    position: relative;
    width: 100%;
}

.slideshow-hidden-image,
.slideshow-displaying-image {
    position: absolute;
}

.slideshow-hidden-image {
    z-index: 100;
}

.slideshow-displaying-image {
    z-index: 200;
}

.slideshow_img,
.noShowImg {
    width: 100%;
    transition: width 0.2s ease, height 0.2s ease;
    border-radius: 5px;
}

.noShowImg {
    visibility: hidden;
}

.imgLink {
    padding: 0;
    margin: 0;
    color: var(--accent);
}

.imgLink .underImg {
    padding: 0;
    margin: 0;
}

.slideshow_control {
    display: flex;
    gap: 12px;
    margin-top: 3px 0 3px 0;
}

.slideshow_direction {
    display: inline-flex;
    width: 28px;
    height: 28px;
    cursor: pointer;
}

.slideshow_control,
.slideshow_direction {
    align-items: center;
    justify-content: center;
}

.slideshow_direction::before {
    content: "";
    width: 9px;
    height: 9px;
    border-top: 1.5px solid currentColor;
    border-left: 1.5px solid currentColor;
    transition: width 0.2s ease, height 0.2s ease;
}

.slideshow_direction[direction="prev"]::before {
    transform: rotate(-45deg);
}

.slideshow_direction[direction="next"]::before {
    transform: rotate(135deg);
}

.slideshow_direction:hover::before {
    width: 12px;
    height: 12px;
}

.slideshow_points {
    display: inline-block;
    width: 7px;
    height: 7px;
    border: 1px solid currentColor;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.slideshow_points:hover {
    transform: scale(1.25);
}

.slideshow_points.slideshow_now {
    background-color: currentColor;
}

/* 新聞 */
.news-list {
    margin-top: 0.8rem;
}

.news-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}

.news-item:last-child {
    border-bottom: 0;
}

.news-date,
.news-region {
    display: inline-block;
}

.news-date,
.news-region,
.news-source {
    color: var(--muted);
    font-size: 0.85rem;
}

.news-title {
    margin: 0.25rem 0;
    font-size: 1.1rem;
}

.news-region {
    margin-left: 0.75rem;
}

.news-source {
    margin: 0.5rem 0 0;
}

.news-source-link {
    color: inherit;
    text-underline-offset: 0.15em;
}

/* 地圖 */
.map-div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(10rem, 20%, 15rem), 1fr));
    gap: 1.5rem;
    align-items: start;
    justify-content: start;
    box-sizing: border-box;
    width: 100%;
    max-width: 62rem;
    margin-inline: 0 auto;
}

.map-div-inner {
    width: 100%;
}

.map-div-inner p {
    display: flex;
    align-items: flex-end;
    font-size: 80%;
    min-height: 32px;
    margin-bottom: 0.5rem;
}

.map-div-inner rt {
    font-size: 0.5rem;
    margin-bottom: 1px;
}

.mini-map {
    width: 100%;
    height: 260px;
    min-height: 260px;
    border-radius: 5px;
    border: 2px solid #5fa3a366;
    overflow: hidden;
}

/* 把署名縮小一點，但不能隱藏 */
.leaflet-control-attribution {
    font-size: 10px;
}

/* 頁尾 */
footer {
    color: white;
    margin-inline: auto;
    padding: 5px 10px 5px 10px;
    margin-top: 25px;
}

footer p {
    margin: 10px 0 10px 3px;
}

footer .a-button {
    padding: 5px;
    margin: 0 5px 5px 0;
    font-size: 0.8rem;
}

.footer-buttons {
    padding: 3px;
    margin: 0 0 10px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

.tinyImg {
    height: 24px;
    margin: 6px 3px 6px 3px;
    box-shadow: 0 0 1px 1px rgba(200, 200, 200, 0.2);
}

/* 響應式樣式 */
@media (max-width: 720px) {

    html,
    body {
        margin: 0;
        padding: 0 !important;
    }

    h1 {
        font-size: 1.25rem;
    }

    #header-index,
    footer {
        /* background: #5fa3a3cd; */
        background: linear-gradient(to right, #5fa3a3, #5fa3a388, #5fa3a3cd);

    }

    .in-content {
        width: 94%;
        margin: 10px auto;
    }

    .horizon-content {
        width: 94%;
        margin: 10px auto;
        column-gap: 3%;
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
        align-items: stretch;
    }

    .left-content,
    .small-content {
        box-sizing: border-box;
        min-width: 0;
        margin-bottom: 24px;
        padding: 3px;
    }

    .logo-multiple,
    .logo-div {
        gap: 6px;
    }

    .logo-img {
        width: 42px;
    }

    .logo-img-small {
        width: 32px;
    }

    .logo-en {
        font-size: 1.2rem;
    }

    .logo-zh,
    .logo-ja {
        font-size: 0.6rem;
    }

    #keepingTitle {
        display: none;
        padding: 0;
        margin: 0;
        font-size: 0.8rem;
    }

    .languages {
        gap: 4px;
        margin-top: 4px;
        margin-bottom: 4px;
        padding: 1px 6px;
    }

    .button-group {
        display: flex;
        flex-direction: column;
        gap: 5px;
        margin: 2px;
        padding: 5px;
        border-radius: 20px;
    }

    .button-group-small {
        gap: 2px;
        padding: 0;
        margin: 5px;
    }

    .button-group button {
        font-size: 0.88rem;
        margin: 1px 5px 1px 2px;
        padding: 2px 2px 2px 2px;
    }

    .button-group-small button {
        font-size: 0.65rem;
        margin: 2px;
        padding: 1px 2px 1px 2px;
    }

    .underImg {
        font-size: 0.75rem;
    }

    .small-content h2 {
        font-size: 0.6rem;
        margin: 0;
        padding: 0;
    }

    .a-button {
        margin: 0;
        padding: 0.35rem 0.55rem;
    }

    .t-button {
        font-size: 0.5rem;
        margin: 2px;
    }

    .map-div {
        grid-template-columns: repeat(auto-fit, minmax(clamp(10rem, 30%, 15rem), 1fr));
        gap: 0.6rem;
        margin: 6px;
    }

    .clocks {
        display: grid;
        grid-template-columns: repeat(2, minmax(calc(50% - 0.5rem), 1fr));
        gap: 0.6rem;
        justify-content: center;
        box-sizing: border-box;
    }

    .map-div-inner {
        box-sizing: border-box;
        max-width: 85%;
        text-align: left;
    }

    .mini-map {
        box-sizing: border-box;
        height: auto;
        min-height: 0;
        aspect-ratio: 1 / 1;
    }

    .map-div-inner .a-button {
        box-sizing: border-box;
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
        justify-content: flex-start;
        text-align: left;
    }

    .footer-buttons {
        flex-direction: column;
        align-items: stretch;
        width: fit-content;
        max-width: 100%;
    }

    .footer-buttons .a-button {
        box-sizing: border-box;
        width: calc(100% - 10px);
    }

    .tinyImg {
        height: 15px;
        margin: 3px 0 3px 1px;
    }

}