:root {
    --mel-bg: #fcf8f1;
    --mel-paper: #fffdf8;
    --mel-soft: #f3eadc;
    --mel-line: #e8dccb;
    --mel-text: #332820;
    --mel-muted: #75695f;
    --mel-primary: #bb6b33;
    --mel-primary-dark: #8d4c24;
    --mel-green: #66785b;
    --mel-red: #a8574d;
}

body.mel-body {
    margin: 0;
    background: var(--mel-bg);
    color: var(--mel-text);
    font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
    overflow-x: hidden;
}

.mel-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.mel-container {
    width: min(1060px, calc(100% - 34px));
    margin: 0 auto;
}

.mel-main {
    flex: 1 0 auto;
    padding: 28px 0 58px;
}

.mel-nav {
    border-bottom: 1px solid var(--mel-line);
    background: rgba(252, 248, 241, .95);
}

.mel-nav-inner {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.mel-brand,
.mel-link,
.mel-button,
.mel-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.mel-brand {
    min-width: 0;
    color: var(--mel-text);
    font-weight: 700;
}

.mel-brand img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 50%;
    background: var(--mel-soft);
}

.mel-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mel-links {
    display: flex;
    gap: 12px;
}

.mel-link,
.mel-button,
.mel-ghost {
    min-height: 40px;
    border: 1px solid var(--mel-line);
    border-radius: 999px;
    padding: 8px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 700;
}

.mel-link,
.mel-ghost {
    color: var(--mel-muted);
    background: var(--mel-paper);
}

.mel-button {
    color: #fff;
    border-color: var(--mel-primary);
    background: var(--mel-primary);
}

.mel-link:hover,
.mel-ghost:hover {
    color: var(--mel-primary-dark);
    border-color: var(--mel-primary);
}

.mel-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 28px;
    align-items: end;
    padding: 36px 0 24px;
    border-bottom: 1px solid var(--mel-line);
}

.mel-title {
    margin: 10px 0;
    font-size: clamp(30px, 4.5vw, 50px);
    line-height: 1.12;
    letter-spacing: 0;
}

.mel-kicker {
    color: var(--mel-primary-dark);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.mel-muted {
    color: var(--mel-muted);
}

.mel-notice,
.mel-panel,
.mel-paper {
    border: 1px solid var(--mel-line);
    border-radius: 6px;
    background: var(--mel-paper);
}

.mel-notice,
.mel-panel {
    padding: 22px;
}

.mel-directory {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding-top: 22px;
}

.mel-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.mel-search input,
.mel-form input,
.mel-form select,
.mel-form textarea {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    border: 1px solid var(--mel-line);
    border-radius: 6px;
    padding: 0 12px;
    color: var(--mel-text);
    background: #fff;
}

.mel-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mel-tab {
    border: 1px solid var(--mel-line);
    border-radius: 999px;
    padding: 8px 13px;
    color: var(--mel-muted);
    background: var(--mel-paper);
    cursor: pointer;
}

.mel-tab.is-active {
    color: #fff;
    border-color: var(--mel-primary);
    background: var(--mel-primary);
}

.mel-list {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--mel-line);
}

.mel-row {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) 140px 120px;
    gap: 18px;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid var(--mel-line);
    color: var(--mel-text);
    text-decoration: none;
}

.mel-index {
    color: var(--mel-muted);
    font-style: italic;
}

.mel-thumb {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--mel-soft);
}

.mel-name {
    margin: 0 0 7px;
    font-size: 18px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.mel-desc {
    margin: 0;
    color: var(--mel-muted);
    line-height: 1.58;
    overflow-wrap: anywhere;
}

.mel-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
}

.mel-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    color: var(--mel-muted);
    background: var(--mel-soft);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 700;
}

.mel-green {
    color: var(--mel-green);
}

.mel-red {
    color: var(--mel-red);
}

.mel-price {
    color: var(--mel-primary-dark);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 22px;
    font-weight: 900;
    white-space: nowrap;
}

.mel-old-price {
    display: block;
    color: var(--mel-muted);
    font-size: 12px;
}

.mel-buy-layout {
    display: grid;
    gap: 20px;
}

.mel-intro {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
}

.mel-cover {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 6px;
    background: var(--mel-soft);
}

.mel-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.mel-form .wide {
    grid-column: 1 / -1;
}

.mel-form label,
.mel-label {
    display: block;
    margin-bottom: 6px;
    color: var(--mel-muted);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 760;
}

.mel-payways {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mel-payways label {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--mel-line);
    border-radius: 999px;
    padding: 8px 12px;
    background: var(--mel-soft);
}

.mel-description {
    line-height: 1.86;
    overflow-wrap: anywhere;
}

.mel-summary {
    display: grid;
}

.mel-summary-row {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--mel-line);
    overflow-wrap: anywhere;
}

.mel-summary-row label {
    color: var(--mel-muted);
}

.mel-qr {
    width: min(290px, 100%);
    margin: 18px auto;
    padding: 18px;
    border: 1px solid var(--mel-line);
    border-radius: 6px;
    background: #fff;
}

.mel-qr img {
    width: 100%;
    height: auto;
}

.mel-kami {
    width: 100%;
    min-height: 170px;
    border: 1px solid var(--mel-line);
    border-radius: 6px;
    padding: 12px;
    box-sizing: border-box;
}

.mel-empty {
    padding: 34px 22px;
    border: 1px dashed var(--mel-line);
    border-radius: 6px;
    color: var(--mel-muted);
    text-align: center;
    background: var(--mel-paper);
}

.mel-footer {
    flex-shrink: 0;
    padding: 30px 0;
    border-top: 1px solid var(--mel-line);
    color: var(--mel-muted);
    background: #f7efe4;
    text-align: center;
}

.mel-footer a {
    color: var(--mel-primary-dark);
}

.mel-body :focus-visible {
    outline: 3px solid rgba(187, 107, 51, .25);
    outline-offset: 2px;
}

@media (max-width: 860px) {
    .mel-hero,
    .mel-intro {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .mel-container {
        width: min(100% - 22px, 1060px);
    }

    .mel-nav-inner,
    .mel-links,
    .mel-toolbar {
        align-items: stretch;
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .mel-link,
    .mel-button,
    .mel-ghost {
        width: 100%;
        box-sizing: border-box;
    }

    .mel-row,
    .mel-form,
    .mel-summary-row {
        grid-template-columns: 1fr;
    }

    .mel-thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .mel-price {
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mel-body *,
    .mel-body *::before,
    .mel-body *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
