:root {
    --cat-green: #15803d;
    --cat-green-dark: #14532d;
    --cat-green-deep: #052e16;
    --cat-green-soft: #dcfce7;
    --cat-green-mid: #86efac;
    --cat-bg: #f3faf5;
    --cat-card: #ffffff;
    --cat-line: #cdebd6;
    --cat-text: #14532d;
    --cat-muted: #4d7c5e;
    --cat-price: #166534;
    --cat-sold: #9ca3af;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--cat-bg);
    color: var(--cat-text);
    font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

a { color: var(--cat-green); text-decoration: none; }
a:hover { text-decoration: underline; }

.cat-wrap { min-height: 100vh; display: flex; flex-direction: column; }

.cat-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--cat-line);
    backdrop-filter: blur(8px);
}

.cat-nav-inner,
.cat-inner {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.cat-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
}

.cat-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--cat-green-dark);
    text-decoration: none;
    white-space: nowrap;
}

.cat-brand img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.cat-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    font-size: 14px;
    font-weight: 600;
}

.cat-links a { color: var(--cat-green-dark); text-decoration: none; }
.cat-links a:hover,
.cat-links a.is-on { color: var(--cat-green); }

.cat-menu {
    display: none;
    margin-left: auto;
    border: 1px solid var(--cat-line);
    background: #fff;
    color: var(--cat-green-dark);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.cat-hero {
    background: linear-gradient(180deg, #ecfdf3 0%, var(--cat-bg) 100%);
    padding: 48px 0 28px;
    border-bottom: 1px solid var(--cat-line);
}

.cat-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.2;
    color: var(--cat-green-deep);
}

.cat-hero p {
    margin: 0;
    max-width: 720px;
    color: var(--cat-muted);
    font-size: 17px;
}

.cat-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.cat-badge {
    background: var(--cat-green-soft);
    color: var(--cat-green-dark);
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
}

.cat-notice {
    background: #fff;
    border: 1px solid var(--cat-line);
    border-left: 4px solid var(--cat-green);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 24px 0 0;
    color: var(--cat-muted);
}

.cat-notice strong { color: var(--cat-green-dark); }
.cat-notice img,
.cat-notice video,
.cat-notice iframe { max-width: 100%; height: auto; }

.cat-process { margin: 28px 0 8px; }
.cat-process h2,
.cat-section h2 {
    margin: 0 0 8px;
    font-size: 24px;
    color: var(--cat-green-deep);
}

.cat-kicker {
    display: inline-block;
    background: var(--cat-green);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.cat-process p,
.cat-lead { margin: 0 0 16px; color: var(--cat-muted); }

.cat-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 28px;
    position: sticky;
    top: 64px;
    z-index: 30;
    background: var(--cat-bg);
    padding: 8px 0;
}

.cat-toc a {
    background: #fff;
    border: 1px solid var(--cat-line);
    color: var(--cat-green-dark);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.cat-toc a:hover { border-color: var(--cat-green); background: var(--cat-green-soft); }

.cat-section { margin: 0 0 40px; }

.cat-table-wrap {
    overflow-x: auto;
    background: var(--cat-card);
    border: 1px solid var(--cat-line);
    border-radius: 12px;
}

table.cat-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.cat-table th,
.cat-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--cat-line);
    vertical-align: middle;
}

.cat-table th {
    background: #f0fdf4;
    color: var(--cat-green-dark);
    font-size: 13px;
    font-weight: 700;
}

.cat-table tbody tr:hover { background: #f7fef9; }
.cat-table tbody tr.is-sold { opacity: .7; }

.cat-num { color: var(--cat-muted); width: 48px; }
.cat-name { font-weight: 700; color: var(--cat-green-deep); line-height: 1.45; }
.cat-desc { color: var(--cat-muted); font-size: 14px; max-width: 360px; }
.cat-desc { color: var(--cat-muted); font-size: 14px; max-width: 360px; }
.cat-name,
.cat-desc,
.cat-drawer h3,
.cat-drawer .productName {
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.cat-table-no-desc th:nth-child(3),
.cat-table-no-desc td.cat-desc {
    display: none;
}
.cat-price { font-weight: 700; color: var(--cat-price); white-space: nowrap; }

.cat-status {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    word-break: keep-all;
}

.cat-table th:nth-child(5),
.cat-cell-status {
    white-space: nowrap;
    width: 1%;
    min-width: 7em;
}

.cat-status.ok { background: var(--cat-green-soft); color: var(--cat-green-dark); }
.cat-status.sold { background: #f3f4f6; color: var(--cat-sold); }

.cat-buy {
    display: inline-block;
    background: var(--cat-green);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none !important;
}

.cat-buy:hover { background: var(--cat-green-dark); }
.cat-buy:disabled,
.cat-buy.is-off {
    background: #d1d5db;
    cursor: not-allowed;
}

.cat-empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--cat-muted);
}

.cat-cta {
    background: var(--cat-green-deep);
    color: #ecfdf3;
    border-radius: 16px;
    padding: 32px;
    margin: 12px 0 48px;
}

.cat-cta h2 { margin: 0 0 8px; color: #fff; }
.cat-cta p { margin: 0 0 16px; color: #bbf7d0; }
.cat-cta a.cat-buy { background: #22c55e; }

.cat-foot {
    margin-top: auto;
    background: #0b0b0b;
    color: #a3a3a3;
    border-top: 1px solid #262626;
    padding: 48px 0 28px;
    font-size: 14px;
}

.cat-foot a {
    color: #d4d4d4;
    text-decoration: none;
}

.cat-foot a:hover {
    color: #fff;
    text-decoration: none;
}

.cat-foot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px 48px;
    padding-bottom: 36px;
    border-bottom: 1px solid #262626;
}

.cat-foot-col h3 {
    margin: 0 0 14px;
    color: #f5f5f5;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.cat-foot-col a {
    display: block;
    padding: 5px 0;
    line-height: 1.4;
}

.cat-foot-bottom {
    padding-top: 20px;
    font-size: 13px;
    color: #737373;
}

.cat-foot-bottom p { margin: 0 0 6px; }

.cat-tools { padding: 28px 0 48px; }
.cat-tools h1 { margin: 0 0 8px; }
.cat-tool-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0 24px;
}
.cat-tool-tabs a {
    border: 1px solid var(--cat-line);
    background: #fff;
    color: var(--cat-green-dark);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.cat-tool-tabs a.is-on,
.cat-tool-tabs a:hover {
    background: var(--cat-green-deep);
    border-color: var(--cat-green-deep);
    color: #fff;
    text-decoration: none;
}
.cat-tool-panel {
    background: #fff;
    border: 1px solid var(--cat-line);
    border-radius: 16px;
    padding: 24px;
}
.cat-tool-panel label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin: 12px 0 6px;
}
.cat-tool-panel input,
.cat-tool-panel textarea {
    width: 100%;
    border: 1px solid var(--cat-line);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
}
.cat-tool-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.cat-tool-row input { flex: 1; }
.cat-tool-code {
    flex: 1;
    font-size: 28px;
    letter-spacing: .2em;
    font-weight: 700;
    color: var(--cat-green-deep);
}
.cat-tool-panel button,
.cat-tool-panel .cat-buy {
    border: 0;
    background: var(--cat-green);
    color: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-block;
    margin-top: 8px;
}
.cat-muted { color: var(--cat-muted); word-break: break-all; }

.cat-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 46, 22, .45);
    z-index: 80;
    display: none;
    align-items: stretch;
    justify-content: flex-end;
}

.cat-overlay.is-open { display: flex; }

.cat-drawer {
    width: min(560px, 100%);
    background: #fff;
    height: 100%;
    overflow: auto;
    box-shadow: -12px 0 40px rgba(20, 83, 45, .18);
    padding: 20px 20px 40px;
}

.cat-drawer h3 { margin: 0 0 12px; color: var(--cat-green-deep); }

.cat-close {
    float: right;
    border: 0;
    background: var(--cat-green-soft);
    color: var(--cat-green-dark);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
}

.cat-drawer .description img { max-width: 100%; height: auto; }
.cat-drawer .form-control {
    width: 100%;
    border: 1px solid var(--cat-line);
    border-radius: 8px;
    padding: 8px 10px;
}
.cat-drawer fieldset { border: 0; margin: 0 0 12px; padding: 0; }
.cat-drawer label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.cat-pay { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cat-pay a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--cat-green-soft);
    color: var(--cat-green-dark);
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 8px 10px;
    font-weight: 700;
    text-decoration: none;
}
.cat-pay a img { height: 18px; }
.cat-pay a:hover { background: var(--cat-green); color: #fff; }
.button-click.checked,
.race-click.checked {
    outline: 2px solid var(--cat-green);
    background: var(--cat-green-soft);
}
.commodity-icon { height: 18px; margin-right: 4px; vertical-align: middle; }

.cat-query-box {
    background: #fff;
    border: 1px solid var(--cat-line);
    border-radius: 12px;
    padding: 20px;
    margin: 28px 0;
}

.cat-query-box .input-group { display: flex; gap: 8px; }
.cat-query-box input {
    flex: 1;
    border: 1px solid var(--cat-line);
    border-radius: 8px;
    padding: 10px 12px;
}
.cat-query-box button {
    background: var(--cat-green);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
}

.hr-top {
    border-top: 1px solid var(--cat-line);
    padding: 12px 0;
    word-break: break-word;
}

body.cat-lock { overflow: hidden; }

@media (max-width: 768px) {
    html, body { font-size: 15px; }

    .cat-nav-inner,
    .cat-inner {
        width: calc(100% - 20px);
    }

    .cat-nav-inner {
        flex-wrap: wrap;
        min-height: 56px;
        padding: 8px 0;
        gap: 8px;
    }

    .cat-brand span {
        max-width: 58vw;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .cat-menu { display: inline-flex; align-items: center; justify-content: center; }

    .cat-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 4px 0 8px;
    }

    .cat-links.is-open { display: flex; }

    .cat-links a {
        padding: 10px 4px;
        border-top: 1px solid var(--cat-line);
        font-size: 15px;
    }

    .cat-hero { padding: 22px 0 14px; }
    .cat-hero h1 { font-size: 24px; }
    .cat-hero p { font-size: 15px; }

    .cat-process h2,
    .cat-section h2 { font-size: 20px; }

    .cat-toc {
        top: 56px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 8px -10px 20px;
        padding: 8px 10px;
        scrollbar-width: none;
    }

    .cat-toc::-webkit-scrollbar { display: none; }
    .cat-toc a { flex: 0 0 auto; white-space: nowrap; }

    .cat-table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
        border-radius: 0;
    }

    table.cat-table {
        min-width: 0;
        border: 0;
    }

    .cat-table thead { display: none; }

    .cat-table tbody {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .cat-table tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "name price"
            "desc desc"
            "status action";
        gap: 6px 10px;
        background: #fff;
        border: 1px solid var(--cat-line);
        border-radius: 12px;
        padding: 12px;
        align-items: center;
    }

    .cat-table td {
        border: 0;
        padding: 0;
        max-width: none;
    }

    .cat-num { display: none; }
    .cat-name { grid-area: name; font-size: 16px; }
    .cat-desc { grid-area: desc; font-size: 13px; }
    .cat-price { grid-area: price; font-size: 16px; }
    .cat-cell-status { grid-area: status; }
    .cat-cell-action { grid-area: action; justify-self: end; }

    .cat-desc:empty { display: none; }
    .cat-table-no-desc tbody tr,
    .cat-table tbody tr:not(:has(.cat-desc:not(:empty))) {
        grid-template-areas:
            "name price"
            "status action";
    }

    .cat-buy {
        min-height: 40px;
        min-width: 72px;
        padding: 8px 14px;
    }

    .cat-cta { padding: 18px; margin: 8px 0 32px; }

    .cat-overlay {
        align-items: flex-end;
        justify-content: stretch;
    }

    .cat-drawer {
        width: 100%;
        height: auto;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
        padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
    }

    .cat-pay a {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    .cat-query-box { margin: 16px 0; padding: 14px; }

    .cat-query-box .input-group {
        flex-direction: column;
    }

    .cat-query-box button { width: 100%; min-height: 44px; }

    .cat-drawer .buyNum { width: 100% !important; }

    .cat-foot-grid { grid-template-columns: 1fr; gap: 28px; }

    .cat-tool-row { flex-direction: column; align-items: stretch; }
}
