:root {
    color-scheme: light;
    --bg: #fcfaf8;
    --surface: #ffffff;
    --surface-muted: #f5f2ee;
    --text: #292524;
    --muted: #78716c;
    --line: #e7e5e4;
    --brand: #f97316;
    --brand-dark: #ea580c;
    --brand-light: #fff6ed;
    --blue: #eff6ff;
    --blue-ink: #2563eb;
    --green: #f0fdf4;
    --green-ink: #16a34a;
    --purple: #faf5ff;
    --purple-ink: #9333ea;
    --teal: #f0fdfa;
    --teal-ink: #0f766e;
    --rose: #fff1f2;
    --rose-ink: #e11d48;
    --amber: #fffbeb;
    --amber-ink: #d97706;
    --indigo: #eef2ff;
    --indigo-ink: #4f46e5;
    --slate: #f8fafc;
    --slate-ink: #475569;
    --shadow: 0 10px 30px rgba(41, 37, 36, 0.06);
    --shadow-hover: 0 14px 36px rgba(41, 37, 36, 0.1);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family:
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        Arial,
        "Noto Sans SC",
        "PingFang SC",
        "Microsoft YaHei",
        sans-serif;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
}

body.modal-open {
    overflow: hidden;
}

a {
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

.icon {
    display: block;
    flex: 0 0 auto;
    width: var(--icon-size, 1.5rem);
    height: var(--icon-size, 1.5rem);
    background-color: currentColor;
    -webkit-mask: var(--icon-mask) center / contain no-repeat;
    mask: var(--icon-mask) center / contain no-repeat;
}

.icon-book {
    --icon-mask: url("/assets/icons/book.svg");
}

.icon-briefcase {
    --icon-mask: url("/assets/icons/briefcase.svg");
}

.icon-enlarge {
    --icon-mask: url("/assets/icons/enlarge.svg");
}

.icon-message {
    --icon-mask: url("/assets/icons/message.svg");
}

.icon-mic {
    --icon-mask: url("/assets/icons/mic.svg");
}

.icon-newspaper {
    --icon-mask: url("/assets/icons/newspaper.svg");
}

.icon-package {
    --icon-mask: url("/assets/icons/package.svg");
}

.icon-search {
    --icon-mask: url("/assets/icons/search.svg");
}

.icon-ship {
    --icon-mask: url("/assets/icons/ship.svg");
}

.icon-wechat {
    --icon-mask: url("/assets/icons/wechat.svg");
}

.icon-x {
    --icon-mask: url("/assets/icons/x.svg");
}

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

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(100%, 1024px);
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

.brand-link {
    display: inline-flex;
    min-width: 0;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0;
    text-decoration: none;
}

.brand-icon {
    color: var(--brand);
}

.site-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.75rem;
}

.site-actions a,
.site-actions button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 650;
    padding: 0.35rem 0;
    text-decoration: none;
    transition: color 160ms ease;
    white-space: nowrap;
}

.site-actions a:hover,
.site-actions button:hover {
    color: var(--brand);
}

.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text);
}

.main {
    flex: 1;
}

.catalog-page {
    padding: 0.504rem 0 1.75rem;
}

.catalog-section {
    width: min(100%, 1024px);
    margin: 0 auto 2.7rem;
    padding: 0 1.5rem;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
}

.section-heading span {
    width: 0.25rem;
    height: 1.25rem;
    border-radius: 999px;
    background: var(--brand);
}

.section-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.125rem;
    font-weight: 750;
    letter-spacing: 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.product-card {
    display: flex;
    min-width: 0;
    min-height: 100%;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 0.78rem;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition:
        border-color 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease;
}

.product-card:hover {
    border-color: rgba(249, 115, 22, 0.32);
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

.product-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 5.5rem;
    width: 100%;
    border-radius: 8px;
    margin-bottom: 0.8rem;
}

.product-image-icon {
    display: block;
    width: var(--icon-size, 2rem);
    height: var(--icon-size, 2rem);
    object-fit: contain;
}

.product-icon-brand {
    background: var(--brand-light);
    color: var(--brand);
}

.product-icon-blue {
    background: var(--blue);
    color: var(--blue-ink);
}

.product-icon-green {
    background: var(--green);
    color: var(--green-ink);
}

.product-icon-purple {
    background: var(--purple);
    color: var(--purple-ink);
}

.product-icon-teal {
    background: var(--teal);
    color: var(--teal-ink);
}

.product-icon-rose {
    background: var(--rose);
    color: var(--rose-ink);
}

.product-icon-amber {
    background: var(--amber);
    color: var(--amber-ink);
}

.product-icon-indigo {
    background: var(--indigo);
    color: var(--indigo-ink);
}

.product-icon-slate {
    background: var(--slate);
    color: var(--slate-ink);
}

.product-title-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.product-title {
    min-width: 0;
    color: var(--text);
    flex: 0 1 auto;
    font-weight: 800;
    line-height: 1.35;
}

.product-status-badge {
    display: inline-flex;
    flex: 0 0 auto;
    border: 1px solid rgba(249, 115, 22, 0.26);
    border-radius: 999px;
    background: rgba(255, 247, 237, 0.9);
    color: #9a3412;
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1;
    padding: 0.24rem 0.48rem;
}

.product-desc {
    display: block;
    flex: 1;
    margin: 0.35rem 0 0.9rem;
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.65;
}

.product-meta {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    border-top: 1px solid var(--line);
    padding-top: 0.58rem;
}

.price,
.detail-price,
.buy-bar-price {
    color: var(--brand);
    font-weight: 850;
    line-height: 1;
}

.price {
    font-size: 1.12rem;
}

.price span,
.detail-price span,
.buy-bar-price span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 500;
}

.detail-link {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    transition: color 160ms ease;
}

.product-card:hover .detail-link {
    color: var(--brand);
}

.product-detail-page {
    width: min(100%, 768px);
    margin: 0 auto;
    padding: 1.5rem 1.5rem 6.8rem;
}

.back-link {
    display: inline-flex;
    margin-bottom: 1.4rem;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 650;
    text-decoration: none;
}

.back-link:hover {
    color: var(--text);
}

.detail-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.draft-banner {
    display: grid;
    gap: 0.22rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(249, 115, 22, 0.24);
    border-radius: 8px;
    background: rgba(255, 247, 237, 0.92);
    color: #7c2d12;
    padding: 0.78rem 0.9rem;
    text-align: center;
}

.draft-banner strong,
.draft-banner span {
    display: block;
}

.draft-banner strong {
    color: #9a3412;
    font-size: 0.92rem;
    line-height: 1.25;
}

.draft-banner span {
    font-size: 0.86rem;
    line-height: 1.45;
}

.detail-icon {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1rem;
}

.detail-card h1 {
    margin: 0;
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 850;
    line-height: 1.25;
    text-align: center;
}

.detail-price {
    margin: 0.75rem 0 1.4rem;
    font-size: 2rem;
    text-align: center;
}

.detail-price span {
    font-size: 1rem;
}

.detail-action {
    margin: 0 0 2rem;
    text-align: center;
}

.buy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 2.75rem;
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: var(--brand);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 750;
    padding: 0.72rem 2.5rem;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(249, 115, 22, 0.22);
    transition:
        background-color 160ms ease,
        transform 160ms ease;
}

.buy-button:hover {
    background: var(--brand-dark);
    transform: translateY(-1px);
}

.buy-button-disabled,
.buy-button-disabled:hover,
.buy-button:disabled,
.buy-button:disabled:hover {
    background: var(--surface-muted);
    color: var(--muted);
    cursor: not-allowed;
    opacity: 1;
    box-shadow: none;
    transform: none;
}

.buy-button-small {
    min-height: 2.45rem;
    padding: 0.58rem 1.55rem;
    font-size: 0.9rem;
}

.detail-copy {
    color: rgba(41, 37, 36, 0.82);
    font-size: 1rem;
    line-height: 1.75;
}

.detail-copy h2 {
    margin: 1.15rem 0 0.42rem;
    color: var(--text);
    font-size: 1rem;
    font-weight: 850;
    letter-spacing: 0;
}

.detail-copy h2:first-child {
    margin-top: 0;
}

.detail-copy p {
    margin: 0 0 0.95rem;
}

.detail-copy ul,
.detail-copy ol {
    margin: 0 0 0.95rem;
    padding-left: 1.25rem;
}

.detail-copy li::marker {
    color: rgba(249, 115, 22, 0.65);
}

.detail-copy li + li {
    margin-top: 0.25rem;
}

.detail-copy blockquote {
    margin: 0 0 0.95rem;
    border-left: 3px solid rgba(249, 115, 22, 0.5);
    padding: 0.1rem 0 0.1rem 0.85rem;
}

.detail-copy blockquote p {
    margin: 0;
}

.detail-copy hr {
    margin: 1.2rem 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.detail-copy a {
    color: var(--brand);
    font-weight: 750;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.detail-copy code {
    border-radius: 4px;
    background: rgba(245, 242, 238, 0.9);
    color: var(--text);
    font-size: 0.92em;
    padding: 0.08rem 0.28rem;
}

.markdown-image-shell {
    display: block;
    max-width: 100%;
    margin: 0 auto 0.95rem;
    text-align: center;
}

.markdown-image-button {
    display: inline-flex;
    justify-content: center;
    max-width: 100%;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: zoom-in;
}

.markdown-image-frame {
    position: relative;
    display: block;
    max-width: min(100%, 30rem);
    overflow: hidden;
    border: 3px solid #f9dec9;
    border-radius: 8px;
    line-height: 0;
}

.markdown-image-button:focus-visible {
    outline: 3px solid rgba(249, 115, 22, 0.42);
    outline-offset: 4px;
}

.markdown-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

.zoom-hint {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.26rem;
    height: 1.26rem;
    border-radius: 4px;
    background: rgba(41, 37, 36, 0.34);
    color: rgba(255, 255, 255, 0.86);
    pointer-events: none;
    transition:
        background-color 160ms ease,
        color 160ms ease,
        opacity 160ms ease;
}

.zoom-hint-icon {
    --icon-size: 0.7rem;
}

.markdown-image-button:hover .zoom-hint,
.markdown-image-button:focus-visible .zoom-hint {
    background: rgba(41, 37, 36, 0.68);
    color: #ffffff;
}

.markdown-image-broken {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: min(100%, 30rem);
    min-height: 4rem;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: rgba(245, 242, 238, 0.65);
    color: var(--muted);
    padding: 1rem;
    font-size: 0.92rem;
}

.image-preview-backdrop {
    position: fixed;
    z-index: 80;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.78);
    cursor: zoom-out;
    padding: 1rem;
}

.image-preview-image {
    display: block;
    max-width: min(100%, 72rem);
    max-height: calc(100vh - 2rem);
    border-radius: 8px;
    cursor: zoom-out;
    object-fit: contain;
}

.image-preview-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    cursor: pointer;
}

.empty-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: rgba(245, 242, 238, 0.65);
    color: var(--muted);
    padding: 2rem 1rem;
    text-align: center;
}

.empty-detail p {
    margin: 0;
}

.buy-bar {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid var(--line);
    background: rgba(252, 250, 248, 0.95);
    padding: 0.75rem 1.5rem;
    backdrop-filter: blur(10px);
}

.buy-bar > div {
    min-width: 0;
    flex: 1 1 auto;
}

.buy-bar p {
    margin: 0;
}

.buy-bar p:first-child {
    overflow: hidden;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.buy-bar-price {
    margin-top: 0.18rem !important;
    font-size: 1.15rem;
}

@media (min-width: 760px) {
    .product-detail-page {
        padding-bottom: 6.8rem;
    }

    .buy-bar {
        right: 0;
        left: 0;
        width: auto;
        transform: none;
        justify-content: space-between;
        border: 0;
        border-top: 1px solid var(--line);
        border-radius: 0;
        background: rgba(252, 250, 248, 0.95);
        padding: 0.75rem max(1.5rem, calc((100% - 720px) / 2 + 2rem));
        box-shadow: none;
    }

    .buy-bar > div {
        flex: 1 1 auto;
    }

    .buy-bar p:first-child {
        display: block;
    }

    .buy-bar-price {
        margin-top: 0.18rem !important;
        font-size: 1.15rem;
    }
}

.not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(100%, 640px);
    margin: 0 auto;
    padding: 4rem 1.5rem;
    color: var(--muted);
    text-align: center;
}

.not-found h1 {
    margin: 1rem 0 0.35rem;
    color: var(--text);
    font-size: 1.25rem;
}

.not-found p {
    margin: 0 0 1.4rem;
}

.site-footer {
    border-top: 1px solid var(--line);
    margin-top: auto;
    padding: 1rem;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.site-footer p {
    margin: 0;
}

.modal-backdrop {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.contact-modal {
    position: relative;
    width: min(100%, 26rem);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 1.65rem;
    box-shadow: 0 24px 70px rgba(41, 37, 36, 0.2);
}

.modal-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 2rem;
    height: 2rem;
}

.contact-modal h2 {
    margin: 0 0 1rem;
    color: var(--text);
    font-size: 1.12rem;
}

.contact-card {
    border-radius: 8px;
    background: rgba(245, 242, 238, 0.75);
    padding: 1rem;
}

.contact-card + .contact-card {
    margin-top: 0.75rem;
}

.contact-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.contact-card p:first-child {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    color: var(--text);
    font-weight: 750;
}

.contact-card strong {
    color: var(--text);
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(249, 115, 22, 0.42);
    outline-offset: 3px;
}

@media (min-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
    }

    .product-card {
        padding: 1rem;
    }

    .detail-card {
        padding: 2rem;
    }
}

@media (min-width: 960px) {
    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 380px) {
    .site-nav,
    .catalog-section,
    .product-detail-page,
    .buy-bar {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .brand-link {
        font-size: 1.08rem;
    }

    .product-card {
        padding: 0.7rem;
    }

    .product-icon {
        height: 4.75rem;
    }

    .product-title {
        font-size: 0.92rem;
    }

    .product-desc {
        font-size: 0.8rem;
    }
}
