:root {
    color-scheme: light;
    font-family: "Segoe UI", "Malgun Gothic", sans-serif;
    color: #20231f;
    background: #f7f8f5;
    --rail-width: clamp(36px, 16vw, 200px);
    --rail-gap: 8px;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(ellipse at 50% 0, rgba(220, 237, 224, 0.62), transparent 38rem),
        #f7f8f5;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    height: 76px;
    padding: 0 6.2%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(32, 35, 31, 0.07);
    background: rgba(247, 248, 245, 0.96);
    backdrop-filter: blur(12px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.brand-mark {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #fff;
    background: #2f6747;
    font-size: 17px;
    letter-spacing: 0;
}

.header-link-tabs {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 2vw, 24px);
    overflow-x: auto;
    scrollbar-width: none;
}

.header-link-tabs::-webkit-scrollbar {
    display: none;
}

.header-link-tabs a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #555d53;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.header-link-icon {
    width: 26px;
    height: 26px;
    display: block;
    object-fit: contain;
}

.header-link-tabs a:hover {
    color: #2f6747;
}

.header-note {
    flex: 0 0 auto;
    color: #777d75;
    font-size: 12px;
}

.page-content {
    width: min(1080px, calc(100% - var(--rail-width) - var(--rail-width) - var(--rail-gap) - var(--rail-gap) - 32px));
    margin: 0 auto;
}

.intro {
    padding: 69px 0 35px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 14px;
    color: #518261;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.19em;
}

h1 {
    margin: 0;
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 800;
    letter-spacing: -0.065em;
}

.intro-copy {
    margin: 12px 0 25px;
    color: #777d75;
    font-size: 13px;
}

.search-box {
    width: min(440px, 100%);
    height: 48px;
    margin: 0 auto;
    padding: 0 13px 0 16px;
    display: flex;
    align-items: center;
    gap: 11px;
    border: 1px solid #e6e9e3;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 6px 20px rgba(37, 55, 39, 0.04);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-box:focus-within {
    border-color: #79a786;
    box-shadow: 0 0 0 3px rgba(82, 133, 96, 0.12);
}

.search-box svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    fill: none;
    stroke: #828980;
    stroke-linecap: round;
    stroke-width: 1.7;
}

.search-box input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #20231f;
    font: inherit;
    font-size: 12px;
}

.search-box input::placeholder {
    color: #a4aaa2;
}

.search-box kbd {
    min-width: 22px;
    padding: 3px 6px;
    border: 1px solid #e7e9e4;
    border-radius: 5px;
    color: #92988f;
    background: #fafbf9;
    font: 11px "Segoe UI", sans-serif;
}

.result-count {
    margin: 13px 0 0;
    color: #858b82;
    font-size: 11px;
}

.banner-section {
    padding-bottom: 74px;
}

/* 배너 배열수정 */
.banner-grid {
    display: grid;
    /* grid-template-columns: repeat(4, minmax(0, 1fr)); */
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 4px;
}

.banner-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.banner-card-spacer {
    grid-column: 1 / -1;
}

.banner-image-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: block;
    border-radius: 13px;
    background: #e9eee8;
    box-shadow: 0 4px 12px rgba(30, 42, 31, 0.07);
}

.banner-image-wrap img,
.rail-banner img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 220ms ease;
}

.banner-image-wrap img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.banner-image-empty {
    aspect-ratio: 16 / 2;
    border: 1px solid #dfe4dc;
    background: transparent;
    box-shadow: none;
}

.banner-image-empty img {
    visibility: hidden;
}

.rail-banner:hover img {
    transform: scale(1.055);
}

.card-arrow {
    position: absolute;
    right: 7px;
    bottom: 7px;
    width: 23px;
    height: 23px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #344638;
    background: rgba(255, 255, 255, 0.91);
    font-size: 13px;
    opacity: 0;
    transform: translateY(3px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.banner-card:hover .card-arrow,
.banner-card:focus-visible .card-arrow {
    opacity: 1;
    transform: translateY(0);
}

.banner-card-title {
    max-width: 100%;
    margin-top: 9px;
    overflow: hidden;
    color: #30362f;
    font-size: 11px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.banner-card-category {
    margin-top: 3px;
    color: #92988f;
    font-size: 10px;
}

.empty-state {
    padding: 50px 12px;
    color: #777d75;
    text-align: center;
    font-size: 13px;
}

.link-section {
    padding: 28px 0 64px;
    border-top: 1px solid rgba(32, 35, 31, 0.08);
}

.link-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.link-section-heading .eyebrow {
    margin-bottom: 7px;
}

.link-section-heading h2 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -0.05em;
}

.link-result-count {
    margin: 15px 0 9px;
    color: #858b82;
    font-size: 11px;
}

.link-table-wrap {
    overflow-x: auto;
    border: 1px solid #e6e9e3;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
}

.link-table {
    width: 100%;
    min-width: 720px;
    table-layout: fixed;
    border-collapse: collapse;
    text-align: left;
    font-size: 12px;
}

.link-name-column {
    width: 18%;
}

.link-url-column {
    width: 30%;
}

.link-check-column {
    width: 52%;
}

.link-table th,
.link-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #edf0ea;
}

.link-table thead th {
    color: #777d75;
    background: #f1f4ef;
    font-size: 10px;
    font-weight: 600;
}

.link-table tbody th {
    color: #30362f;
    font-weight: 600;
}

.link-table tbody td {
    color: #71796f;
    overflow-wrap: anywhere;
}

.link-table .link-check-cell {
    color: #71796f;
    font-size: 10px;
    overflow-wrap: anywhere;
}

.link-check-badge {
    display: inline-block;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.link-check-up {
    color: #28643e;
    background: #e8f4e9;
}

.link-check-down {
    color: #9a3e34;
    background: #fbecea;
}

.link-check-unknown {
    color: #666d64;
    background: #eef0ec;
}

.link-check-detail {
    display: block;
    margin-top: 4px;
}

.link-check-time {
    display: inline-block;
    margin-left: 6px;
    color: #858b82;
    font-size: 10px;
    white-space: nowrap;
}

.link-change-heading {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    color: #71796f;
    font-size: 10px;
}

.link-change-heading time {
    color: #858b82;
    white-space: nowrap;
}

.link-check-change-url {
    display: block;
    margin-top: 4px;
    color: #386e4b;
    overflow-wrap: anywhere;
}

.link-table tbody tr:last-child th,
.link-table tbody tr:last-child td {
    border-bottom: 0;
}

.link-table a {
    color: #386e4b;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.link-empty-state {
    padding: 20px;
    border: 1px dashed #dfe4dc;
    border-radius: 12px;
    color: #777d75;
    font-size: 12px;
    line-height: 1.7;
    text-align: center;
}

.link-empty-state code {
    color: #386e4b;
    font-family: Consolas, monospace;
}

.side-rail {
    position: fixed;
    z-index: 2;
    top: 100px;
    bottom: 100px;
    width: var(--rail-width);
    padding: 14px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.side-rail-left {
    left: 16px;
}

.side-rail-right {
    right: 16px;
}

.rail-label {
    margin: 0 0 1px;
    color: #90978e;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-align: center;
}

.rail-banner {
    width: 100%;
    /* aspect-ratio: 1242 / 154; */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    border: 1px solid rgba(32, 35, 31, 0.06);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(35, 48, 36, 0.08);
}

.rail-banner img {
    width: 100%;
    height: auto;
    flex: 0 0 auto;
    object-fit: contain;
}

.rail-banner span {
    padding: 9px 5px;
    color: #424a40;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
}

.popup-banner {
    width: fit-content;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    padding: 0;
    overflow: auto;
    border: 0;
    background: transparent;
}

.popup-banner[open] {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.popup-banner-card {
    position: relative;
    width: fit-content;
    min-height: 0;
    flex: 0 1 auto;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
}

.popup-banner::backdrop {
    background: rgba(15, 20, 16, 0.68);
}

.popup-banner img {
    width: auto;
    height: auto;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 180px);
    display: block;
    object-fit: contain;
}

.popup-banner-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #20231f;
    background: rgba(255, 255, 255, 0.94);
    font: 28px/1 "Segoe UI", sans-serif;
    cursor: pointer;
}

.popup-banner-preference {
    min-height: 24px;
    flex: 0 0 auto;
    padding: 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 11px;
    cursor: pointer;
}

.popup-banner-preference input {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: #2f6747;
}

.site-footer {
    padding: 20px 24px 30px;
    border-top: 1px solid rgba(32, 35, 31, 0.07);
    color: #969c94;
    font-size: 10px;
    text-align: center;
}

[hidden] {
    display: none !important;
}

@media (max-width: 900px) {
    .intro {
        padding-top: 54px;
    }
}

@media (max-width: 560px) {
    .site-header {
        height: 64px;
        padding: 0 calc(var(--rail-width) + 24px);
    }

    .side-rail {
        top: 72px;
        bottom: 72px;
        padding: 6px 0;
        gap: 6px;
    }

    .rail-banner {
        border-radius: 6px;
    }

    .header-note {
        font-size: 10px;
    }

    .page-content {
        width: calc(100% - var(--rail-width) - var(--rail-width) - var(--rail-gap) - var(--rail-gap) - 32px);
    }

    .intro {
        padding: 44px 0 28px;
    }

    .intro-copy {
        max-width: 290px;
        margin: 10px auto 22px;
        line-height: 1.6;
    }

    .banner-card-title {
        font-size: 10px;
    }
}
