:root {
    --jk-yellow: #fff3c4;
    --jk-yellow-soft: #fff8df;
    --jk-yellow-deep: #f2d875;
    --jk-blue: #1e88e5;
    --jk-blue-dark: #1565c0;
    --jk-blue-soft: #e6f4ff;
    --ink: #273142;
    --ink-strong: #162033;
    --muted: #667385;
    --surface: rgba(255, 255, 255, 0.74);
    --surface-strong: rgba(255, 255, 255, 0.88);
    --line: rgba(30, 136, 229, 0.2);
    --line-strong: rgba(30, 136, 229, 0.36);
    --danger: #b3261e;
    --shadow-soft: 0 18px 44px rgba(35, 58, 92, 0.14);
    --shadow-card: 0 18px 44px rgba(35, 58, 92, 0.16);
    --shadow-hover: 0 24px 58px rgba(21, 101, 192, 0.22);
    --glow-blue: 0 0 0 1px rgba(30, 136, 229, 0.18), 0 0 34px rgba(30, 136, 229, 0.16);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
    background: var(--jk-yellow);
}

body {
    position: relative;
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 243, 196, 0.9) 36%, rgba(242, 216, 117, 0.58)),
        linear-gradient(125deg, rgba(30, 136, 229, 0.16), rgba(255, 255, 255, 0) 46%),
        linear-gradient(245deg, rgba(21, 101, 192, 0.14), rgba(255, 255, 255, 0) 42%),
        var(--jk-yellow);
    background-attachment: fixed;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
    background-size: 96px 96px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0.16));
}

.catalog-shell,
.detail-shell,
.site-footer {
    position: relative;
    z-index: 1;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(30, 136, 229, 0.18);
    background:
        linear-gradient(135deg, rgba(255, 248, 223, 0.92), rgba(255, 243, 196, 0.82) 52%, rgba(230, 244, 255, 0.86)),
        rgba(255, 243, 196, 0.92);
    box-shadow: 0 10px 36px rgba(35, 58, 92, 0.13);
    backdrop-filter: blur(18px);
}

.site-header::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--jk-blue), #64c8ff, var(--jk-yellow-deep), var(--jk-blue));
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(1180px, calc(100% - 32px));
    min-height: 82px;
    margin: 0 auto;
}

.brand-logo {
    width: 58px;
    height: 58px;
    object-fit: contain;
    border: 1px solid rgba(30, 136, 229, 0.18);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 12px 26px rgba(30, 136, 229, 0.16);
}

.brand-copy {
    display: grid;
    gap: 3px;
}

.brand-name {
    color: var(--jk-blue);
    font-size: 1.55rem;
    font-weight: 860;
    line-height: 1.05;
    text-shadow: 0 8px 22px rgba(30, 136, 229, 0.15);
}

.brand-line {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 680;
}

.catalog-shell,
.detail-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 42px;
}

.toolbar {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 13px;
    align-items: end;
    overflow: hidden;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 248, 223, 0.72)),
        rgba(255, 255, 255, 0.74);
    box-shadow: var(--shadow-soft), var(--glow-blue);
    backdrop-filter: blur(18px);
}

.toolbar::before,
.product-card::before,
.detail-media::before,
.detail-info::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(30, 136, 229, 0.5), rgba(255, 255, 255, 0.75), transparent);
}

.search-wrap {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    width: 15px;
    height: 15px;
    transform: translateY(-50%);
    border: 2px solid var(--jk-blue);
    border-radius: 50%;
    pointer-events: none;
    filter: drop-shadow(0 0 8px rgba(30, 136, 229, 0.18));
}

.search-icon::after {
    content: "";
    position: absolute;
    right: -6px;
    bottom: -5px;
    width: 8px;
    height: 2px;
    border-radius: 2px;
    background: var(--jk-blue);
    transform: rotate(45deg);
}

.search-input,
.sort-select {
    width: 100%;
    min-height: 50px;
    border: 1px solid rgba(30, 136, 229, 0.34);
    border-radius: var(--radius);
    color: var(--ink-strong);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 250, 232, 0.9)),
        white;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 10px 22px rgba(35, 58, 92, 0.08);
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease;
}

.search-input {
    padding: 0 14px 0 44px;
}

.sort-wrap {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 760;
}

.sort-select {
    padding: 0 12px;
}

.search-input:focus,
.sort-select:focus,
.back-link:focus,
.product-card:focus,
.thumb-button:focus {
    border-color: rgba(30, 136, 229, 0.72);
    box-shadow:
        0 0 0 4px rgba(30, 136, 229, 0.16),
        0 14px 30px rgba(30, 136, 229, 0.14);
}

.notice {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(30, 136, 229, 0.18);
    border-radius: var(--radius);
    color: var(--ink);
    background: rgba(255, 255, 255, 0.76);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
}

.notice-error {
    border-color: rgba(179, 38, 30, 0.3);
    color: var(--danger);
}

.catalog-status {
    display: flex;
    gap: 7px;
    align-items: baseline;
    padding: 22px 2px 16px;
    color: var(--muted);
    font-size: 0.94rem;
    font-weight: 720;
}

.catalog-status span:first-child {
    color: var(--jk-blue-dark);
    font-size: 1.32rem;
    font-weight: 880;
    text-shadow: 0 6px 18px rgba(30, 136, 229, 0.14);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(218px, 1fr));
    gap: 18px;
}

.product-card {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 358px;
    overflow: hidden;
    border: 1px solid rgba(30, 136, 229, 0.16);
    border-radius: var(--radius);
    color: var(--ink);
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.9), rgba(255, 248, 223, 0.76) 58%, rgba(230, 244, 255, 0.72)),
        rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px);
    transition:
        transform 170ms ease,
        box-shadow 170ms ease,
        border-color 170ms ease,
        background 170ms ease;
}

.product-card::after {
    content: "";
    position: absolute;
    inset: auto 12px 0;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(90deg, rgba(30, 136, 229, 0), rgba(30, 136, 229, 0.72), rgba(30, 136, 229, 0));
    opacity: 0;
    transition: opacity 170ms ease;
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: rgba(30, 136, 229, 0.42);
    box-shadow: var(--shadow-hover), 0 0 34px rgba(30, 136, 229, 0.14);
}

.product-card:hover::after {
    opacity: 1;
}

.product-image-box {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    margin: 12px 12px 0;
    padding: 14px;
    border: 1px solid rgba(30, 136, 229, 0.13);
    border-radius: var(--radius);
    background:
        linear-gradient(145deg, rgba(248, 251, 255, 0.96), rgba(255, 248, 223, 0.82)),
        #f8fbff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), inset 0 -18px 34px rgba(30, 136, 229, 0.05);
}

.product-image-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 12px 18px rgba(35, 58, 92, 0.12));
    transition: transform 180ms ease, filter 180ms ease;
}

.product-card:hover .product-image-box img {
    transform: scale(1.025);
    filter: drop-shadow(0 16px 22px rgba(35, 58, 92, 0.16));
}

.product-copy {
    display: grid;
    gap: 10px;
    align-content: start;
    padding: 15px;
}

.product-name {
    min-height: 46px;
    margin: 0;
    color: var(--ink-strong);
    font-size: 0.99rem;
    font-weight: 820;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.product-code,
.updated-at {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 680;
    overflow-wrap: anywhere;
}

.product-price,
.detail-price {
    margin: 0;
    color: var(--jk-blue);
    font-weight: 900;
}

.product-price {
    font-size: 1.08rem;
}

.detail-price {
    font-size: 2rem;
}

.product-link-label,
.back-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    border: 1px solid rgba(30, 136, 229, 0.52);
    border-radius: var(--radius);
    color: white;
    background:
        linear-gradient(135deg, var(--jk-blue), #45b9ff 54%, var(--jk-blue-dark));
    box-shadow: 0 10px 24px rgba(30, 136, 229, 0.24);
    overflow: hidden;
    transition:
        transform 160ms ease,
        box-shadow 160ms ease,
        border-color 160ms ease;
}

.product-link-label {
    min-height: 37px;
    padding: 0 13px;
    font-size: 0.88rem;
    font-weight: 800;
}

.product-link-label::before,
.back-link::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.26), transparent);
    transform: translateX(-120%);
    transition: transform 300ms ease;
}

.product-card:hover .product-link-label,
.back-link:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.56);
    box-shadow: 0 14px 34px rgba(30, 136, 229, 0.36), 0 0 22px rgba(30, 136, 229, 0.24);
}

.product-card:hover .product-link-label::before,
.back-link:hover::before {
    transform: translateX(120%);
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 13px;
    padding: 44px 16px;
    border: 1px dashed rgba(30, 136, 229, 0.24);
    border-radius: var(--radius);
    color: var(--muted);
    text-align: center;
    background: rgba(255, 255, 255, 0.52);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
}

.empty-state[hidden] {
    display: none;
}

.empty-state img {
    width: 126px;
    max-width: 44%;
    filter: drop-shadow(0 12px 24px rgba(30, 136, 229, 0.12));
}

.empty-state h2 {
    max-width: 520px;
    margin: 0;
    color: var(--ink-strong);
    font-size: 1.16rem;
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    align-items: start;
}

.detail-media,
.detail-info {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(30, 136, 229, 0.18);
    border-radius: var(--radius);
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.88), rgba(255, 248, 223, 0.72), rgba(230, 244, 255, 0.74)),
        rgba(255, 255, 255, 0.76);
    box-shadow: var(--shadow-card), var(--glow-blue);
    backdrop-filter: blur(18px);
}

.detail-media {
    padding: 16px;
}

.detail-image {
    display: block;
    width: 100%;
    max-height: 66vh;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border: 1px solid rgba(30, 136, 229, 0.14);
    border-radius: var(--radius);
    background:
        linear-gradient(145deg, rgba(248, 251, 255, 0.98), rgba(255, 248, 223, 0.82)),
        white;
    box-shadow: inset 0 -24px 44px rgba(30, 136, 229, 0.06);
}

.thumb-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-top: 14px;
}

.thumb-button {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    padding: 6px;
    border: 1px solid rgba(30, 136, 229, 0.2);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 8px 18px rgba(35, 58, 92, 0.08);
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.thumb-button:hover,
.thumb-button.is-active {
    transform: translateY(-1px);
    border-color: rgba(30, 136, 229, 0.68);
    box-shadow: 0 12px 28px rgba(30, 136, 229, 0.18);
}

.thumb-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.detail-info {
    display: grid;
    gap: 15px;
    padding: 20px;
}

.detail-info h1 {
    margin: 0;
    color: var(--ink-strong);
    font-size: 2.05rem;
    line-height: 1.14;
    overflow-wrap: anywhere;
}

.back-link {
    min-height: 43px;
    padding: 0 16px;
    font-weight: 820;
}

.site-footer {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 36px;
    color: rgba(39, 49, 66, 0.72);
    font-size: 0.88rem;
    text-align: center;
}

@media (min-width: 720px) {
    .toolbar {
        grid-template-columns: minmax(0, 1fr) 260px;
        padding: 18px;
    }

    .catalog-shell,
    .detail-shell {
        padding-top: 34px;
    }
}

@media (min-width: 920px) {
    .product-detail {
        grid-template-columns: minmax(0, 1.06fr) minmax(320px, 0.94fr);
        gap: 28px;
    }

    .detail-info {
        position: sticky;
        top: 108px;
        padding: 28px;
    }
}

@media (max-width: 560px) {
    .brand {
        width: min(100% - 24px, 1180px);
        min-height: 74px;
    }

    .brand-logo {
        width: 50px;
        height: 50px;
    }

    .brand-name {
        font-size: 1.28rem;
    }

    .brand-line {
        font-size: 0.84rem;
    }

    .catalog-shell,
    .detail-shell,
    .site-footer {
        width: min(100% - 24px, 1180px);
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .detail-info h1 {
        font-size: 1.52rem;
    }

    .detail-price {
        font-size: 1.7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
