﻿:root {
    --bg: #f7f5f0;
    --card: #ffffff;
    --text: #1d1b18;
    --muted: #7a746b;
    --light: #f2efe8;
    --border: #e8e1d6;
    --primary: #2b2721;
    --primary-dark: #11100e;
    --success: #2f7d5c;
    --danger: #9a5b2f;
    --shadow: 0 18px 48px rgba(46, 38, 28, 0.08);
    --soft-shadow: 0 8px 24px rgba(46, 38, 28, 0.05);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.92), transparent 32%), linear-gradient(180deg, #fbfaf7 0%, var(--bg) 100%);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

.page-shell { width: min(1180px, 100%); margin: 0 auto; padding: 40px 24px 64px; }

.hero-section { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 34px 0 28px; border-bottom: 1px solid var(--border); }
.eyebrow { margin-bottom: 10px; color: var(--primary); font-size: 12px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
.hero-section h1 { margin: 0; font-size: clamp(34px, 5vw, 56px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; }
.hero-section p { max-width: 520px; margin: 16px 0 0; color: var(--muted); font-size: 16px; }

.contact-button, .search-button, .pagination-bar button, .retry-button, .primary-button {
    min-height: 40px;
    padding: 0 22px;
    border: 1px solid var(--primary);
    border-radius: 999px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.contact-button:hover, .search-button:hover, .pagination-bar button:hover, .retry-button:hover, .primary-button:hover { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 10px 24px rgba(29, 27, 24, 0.14); transform: translateY(-1px); }

.toolbar-card { display: flex; gap: 16px; margin: 28px 0 24px; padding: 10px; border: 1px solid var(--border); border-radius: 999px; background: rgba(255, 255, 255, 0.76); box-shadow: var(--soft-shadow); backdrop-filter: blur(16px); }
.search-box { flex: 1; display: flex; align-items: center; min-width: 0; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; }
.search-icon { width: 14px; height: 14px; margin-right: 8px; border: 2px solid var(--muted); border-radius: 50%; position: relative; flex: 0 0 auto; }
.search-icon::after { content: ''; position: absolute; right: -6px; bottom: -5px; width: 7px; height: 2px; border-radius: 2px; background: var(--muted); transform: rotate(45deg); }
.search-box input { width: 100%; height: 44px; border: 0; outline: none; background: transparent; color: var(--text); }
.search-box input::placeholder { color: #9c958a; }

.status-card { padding: 40px 24px; border: 1px solid var(--border); border-radius: 24px; background: rgba(255, 255, 255, 0.76); color: var(--muted); text-align: center; box-shadow: var(--soft-shadow); }
.goods-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.goods-card { overflow: hidden; border: 1px solid var(--border); border-radius: 26px; background: rgba(255, 255, 255, 0.9); box-shadow: var(--soft-shadow); transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
.goods-card:hover { border-color: #d8cbbb; transform: translateY(-4px); box-shadow: var(--shadow); }
.goods-image-wrap { position: relative; aspect-ratio: 1 / 1; background: linear-gradient(135deg, #f2efe8, #faf8f4); }
.goods-image-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.24s ease; }
.goods-card:hover .goods-image-wrap img { transform: scale(1.025); }
.image-fallback { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: linear-gradient(135deg, #f2efe8, #faf8f4); color: #aaa196; font-size: 13px; text-align: center; }
.goods-image-wrap .image-fallback { position: absolute; inset: 0; }
.goods-badge { position: absolute; left: 14px; top: 14px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.88); color: var(--text); font-size: 12px; font-weight: 600; backdrop-filter: blur(12px); }
.goods-info { padding: 16px; }
.goods-title { min-height: 46px; margin: 0 0 10px; color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.45; display: -webkit-box; line-clamp: 2; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.goods-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; letter-spacing: 0.01em; }
.goods-price { margin-top: 14px; color: var(--danger); font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.goods-action { width: 100%; height: 42px; margin-top: 14px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--primary); font-weight: 500; transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease; }
.goods-action:hover { border-color: var(--primary); background: var(--primary); color: #ffffff; transform: translateY(-1px); }
.pagination-bar { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 32px; color: var(--muted); }

.detail-drawer, .contact-modal, .image-viewer { position: fixed; inset: 0; z-index: 1000; display: none; }
.detail-drawer.is-open, .contact-modal.is-open, .image-viewer.is-open { display: block; }
.drawer-mask, .modal-mask { position: absolute; inset: 0; background: rgba(29, 27, 24, 0.42); backdrop-filter: blur(4px); }
.drawer-panel { position: absolute; left: 50%; top: 50%; width: min(720px, calc(100% - 32px)); max-height: min(760px, calc(100vh - 48px)); overflow-y: auto; padding: 26px; border-radius: 30px; background: var(--card); box-shadow: var(--shadow); transform: translate(-50%, -50%); }
.drawer-close, .modal-close, .image-viewer-close { position: absolute; right: 16px; top: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f4f1eb; color: var(--text); font-size: 24px; line-height: 1; }
.detail-hero { display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 22px; align-items: stretch; margin-right: 36px; padding: 12px; border: 1px solid var(--border); border-radius: 28px; background: #fbfaf7; }
.detail-cover-wrap { min-width: 0; }
.detail-cover { width: 100%; height: 100%; min-height: 188px; aspect-ratio: 1 / 1; border-radius: 20px; object-fit: cover; background: var(--light); }
.image-fallback.detail-cover { min-height: 188px; }
.detail-summary { display: flex; min-width: 0; flex-direction: column; justify-content: center; padding: 6px 8px 6px 0; }
.detail-title { margin: 8px 0 14px; font-size: 22px; font-weight: 600; line-height: 1.35; letter-spacing: -0.02em; }
.detail-code, .detail-freight { color: var(--muted); font-size: 13px; }
.detail-price { margin: 0 0 8px; color: var(--danger); font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.section-title { margin: 24px 0 12px; font-size: 16px; font-weight: 600; }
.image-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.image-strip img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; background: var(--light); flex: 0 0 auto; }
.image-strip .image-fallback { width: 64px; height: 64px; flex: 0 0 auto; border-radius: 14px; font-size: 12px; }
.sku-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sku-card { min-width: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 18px; background: #fbfaf7; }
.sku-card > div { min-width: 0; }
.sku-name { overflow: hidden; font-weight: 600; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.sku-price { margin-top: 4px; color: var(--danger); font-weight: 700; }

.modal-card { position: absolute; left: 50%; top: 50%; width: min(400px, calc(100% - 32px)); transform: translate(-50%, -50%); padding: 24px; border-radius: 26px; background: var(--card); box-shadow: var(--shadow); }
.modal-card h2 { margin: 0 40px 16px 0; font-size: 22px; font-weight: 600; }
.contact-qrcode { width: 180px; height: 180px; display: block; margin: 0 auto 16px; border-radius: 18px; object-fit: cover; background: var(--light); }
.image-fallback.contact-qrcode { display: flex; margin: 0 auto 16px; }
.contact-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); color: var(--muted); }
.contact-line strong { color: var(--text); }
.detail-contact-button { width: 100%; margin-top: 24px; }

.image-viewer { z-index: 1100; background: rgba(17, 16, 14, 0.88); }
.image-viewer img { position: absolute; left: 50%; top: 50%; max-width: 92vw; max-height: 88vh; transform: translate(-50%, -50%); object-fit: contain; }
.image-viewer-close { z-index: 1; background: rgba(255, 255, 255, 0.18); color: #ffffff; }
.skeleton-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.skeleton-card { height: 326px; border-radius: 26px; background: linear-gradient(90deg, #ede7dc 25%, #faf8f4 37%, #ede7dc 63%); background-size: 400% 100%; animation: shimmer 1.2s ease-in-out infinite; }

@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

@media (max-width: 1024px) {
    .goods-grid, .skeleton-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .page-shell { padding: 22px 14px 44px; }
    .hero-section { align-items: flex-start; flex-direction: column; gap: 20px; padding: 22px 0 24px; }
    .toolbar-card { flex-direction: column; border-radius: 24px; padding: 12px; }
    .search-button, .contact-button { width: 100%; }
    .goods-grid, .skeleton-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .goods-info { padding: 12px; }
    .drawer-panel { width: calc(100% - 28px); max-height: calc(100vh - 28px); padding: 18px; border-radius: 24px; }
    .detail-hero { grid-template-columns: 136px minmax(0, 1fr); gap: 14px; margin-right: 28px; padding: 10px; border-radius: 22px; }
    .detail-cover { min-height: 136px; border-radius: 16px; }
    .image-fallback.detail-cover { min-height: 136px; }
    .detail-title { margin: 6px 0 10px; font-size: 18px; }
    .detail-price { font-size: 23px; }
    .sku-list { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .goods-grid, .skeleton-grid { grid-template-columns: 1fr; }
    .detail-hero { display: block; margin-right: 0; }
    .detail-cover { height: auto; min-height: 0; aspect-ratio: 4 / 3; }
    .image-fallback.detail-cover { min-height: 220px; }
    .detail-summary { padding: 14px 4px 4px; }
}
