/* ====================================================
   谷歌卡站 - 前台样式表 (Premium Apple Style)
   ==================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
    --white: #ffffff;
    --bg: #f5f5f7;
    --border: #d2d2d7;
    --text: #1d1d1f;
    --text-2: #6e6e73;
    --text-3: #86868b;
    --accent: #d22d2d;
    --blue: #0071e3;
    --green: #34c759;
    --radius: 18px;
    --header-h: 56px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.14);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ====================================================
   HEADER
   ==================================================== */
.header {
    position: sticky;
    top: 0;
    z-index: 500;
    height: var(--header-h);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.header.scrolled {
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.logo-icon {
    height: 55px;
    display: flex;
    align-items: center;
}

.logo-icon img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.logo-text {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: var(--text);
}

.header-center {
    display: flex;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

.header-nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}

.header-nav-link:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-my-orders {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: rgba(0, 0, 0, 0.06);
    padding: 7px 14px;
    border-radius: 20px;
    transition: background 0.15s;
    white-space: nowrap;
}

.btn-my-orders:hover {
    background: rgba(0, 0, 0, 0.1);
}

.search-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    padding: 7px 14px;
    min-width: 180px;
    transition: background 0.2s;
}

.search-wrap:focus-within {
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2);
}

.search-icon {
    color: var(--text-3);
    flex-shrink: 0;
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: var(--text);
    width: 100%;
    font-family: inherit;
}

/* ====================================================
   ANNOUNCEMENT BAR
   ==================================================== */
.announcement {
    background: rgba(0, 0, 0, 0.04);
    border-bottom: 1px solid var(--border);
    padding: 9px 0;
    font-size: 13px;
    color: var(--text-2);
    overflow: hidden;
}

.announcement .container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ann-icon {
    flex-shrink: 0;
}

.ann-scroll {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.ann-scroll span {
    display: inline-block;
    animation: marquee 30s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translateX(100vw);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* ====================================================
   MAIN CONTENT
   ==================================================== */
.main-wrap {
    padding: 28px 0 60px;
    flex: 1;
}

/* ---- Category Tabs ---- */
.category-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.cat-tab {
    display: inline-flex;
    align-items: center;
    padding: 7px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
    background: white;
    border: 1px solid var(--border);
    transition: all 0.2s;
    cursor: pointer;
}

.cat-tab:hover {
    background: var(--text);
    color: white;
    border-color: var(--text);
}

.cat-tab.active {
    background: var(--text);
    color: white;
    border-color: var(--text);
}

/* ---- Product Grid ---- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(.34, 1.56, .64, 1), box-shadow 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.product-card.sold-out {
    cursor: default;
    opacity: 0.72;
}

.product-card.sold-out:hover {
    transform: none;
    box-shadow: none;
}

.card-img-wrap {
    position: relative;
    background: #f0f0f5;
    aspect-ratio: 1;
    overflow: hidden;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.product-card:hover .card-img {
    transform: scale(1.04);
}

.sold-out .card-img {
    filter: grayscale(0.7);
}

.card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.70);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.3px;
}

.badge-sold {
    background: var(--accent);
}

.card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
}

.card-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.card-stock {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.stock-in {
    color: #1a6b38;
    background: #d1fae5;
}

.stock-out {
    color: #991b1b;
    background: #fee2e2;
}

.btn-buy-quick {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 9px;
    background: var(--text);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.btn-buy-quick:hover {
    background: #333;
}

/* ---- Empty State ---- */
.empty-state {
    grid-column: 1/-1;
    text-align: center;
    padding: 80px 0;
    color: var(--text-3);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ====================================================
   FOOTER
   ==================================================== */
.footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
}

.footer-note {
    font-size: 12px;
    color: var(--text-3);
}

.footer-note a {
    color: var(--blue);
}


/* ====================================================
   PRODUCT DETAIL PAGE
   ==================================================== */
.product-page-wrap {
    padding: 30px 0 80px;
    position: relative;
}

.product-split-layout {
    display: flex;
    align-items: flex-start;
    gap: 40px;
}

/* Left Content (Rich Text) */
.product-left-content {
    flex: 1;
    min-width: 0;
    background: white;
    padding: 30px 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.product-title-main {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 12px;
}

.product-meta-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border);
}

.tag-cat,
.tag-safeguard {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.tag-cat {
    background: rgba(0, 113, 227, 0.1);
    color: var(--blue);
}

.tag-safeguard {
    background: rgba(52, 199, 89, 0.1);
    color: var(--green);
}

.rich-text-body {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
}

.rich-text-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
    box-shadow: var(--shadow-sm);
}

.rich-text-body h1,
.rich-text-body h2,
.rich-text-body h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--text);
}

.rich-text-body p {
    margin-bottom: 1em;
}

.rich-text-body a {
    color: var(--blue);
    text-decoration: underline;
}

.rich-text-body blockquote {
    border-left: 4px solid var(--border);
    padding-left: 16px;
    color: var(--text-2);
    background: #fafafa;
    padding: 10px 16px;
    border-radius: 0 8px 8px 0;
}

/* Right Sidebar (Sticky Panel) */
.product-right-sidebar {
    width: 360px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-h) + 24px);
}

.buy-panel-sticky {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.bp-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.bp-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.4;
}

.bp-price {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -1px;
}

.bp-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bp-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bp-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
}

.bp-field label em {
    font-style: normal;
    font-weight: 400;
    color: var(--text-3);
    font-size: 12px;
    margin-left: 4px;
}

.bp-input {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text);
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

.bp-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

/* BP Quantity */
.bp-qty {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    width: max-content;
}

.bp-qty .qty-btn {
    width: 34px;
    height: 34px;
    background: #f5f5f7;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--text);
}

.bp-qty .qty-btn:hover {
    background: #e5e5ea;
}

.bp-qty .qty-num {
    width: 60px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-left: 1.5px solid var(--border);
    border-right: 1.5px solid var(--border);
    background: transparent;
    outline: none;
    pointer-events: none;
}

/* Base UI reuse for forms */
.pay-methods {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pay-option {
    flex: 1;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
    transition: all 0.2s;
}

.pay-option:hover {
    border-color: #aaa;
}

.pay-option.active {
    border-color: var(--blue);
    background: rgba(0, 113, 227, 0.06);
    color: var(--blue);
}

.bp-total {
    font-size: 14px;
    color: var(--text-2);
    font-weight: 500;
    text-align: right;
    margin-top: 4px;
}

.bp-total strong {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
    margin-left: 6px;
}

.btn-confirm-buy {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    box-shadow: 0 4px 14px rgba(210, 45, 45, 0.25);
    margin-top: 8px;
}

.btn-confirm-buy:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.bp-footer-safeguard {
    margin-top: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-3);
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}

/* ====================================================
   RESPONSIVE (Mobile First & Apple Aesthetics)
   ==================================================== */
@media (max-width: 900px) {
    .product-split-layout {
        display: flex !important;
        flex-direction: column !important;
    }

    .product-right-sidebar {
        order: 1 !important;
        width: 100% !important;
        position: static !important;
        margin-bottom: 24px !important;
    }

    .product-left-content {
        order: 2 !important;
        padding: 24px !important;
    }
}

@media (max-width: 768px) {
    /* 缩小全局外边距 */
    .container {
        padding: 0 16px;
    }
    
    /* Header 紧凑化：隐藏文字栏，仅保留精简搜索与图标 */
    .header-center {
        display: none;
    }
    .header-right {
        gap: 8px;
    }
    .header-right .btn-my-orders {
        display: flex !important;
        padding: 6px 12px !important;
        border-radius: 20px !important;
        width: auto !important;
        height: auto !important;
        justify-content: center !important;
        background: var(--blue) !important;
        color: white !important;
        font-size: 13px !important;
        font-weight: 600 !important;
    }
    .header-right .btn-my-orders svg {
        margin-right: 4px !important;
        color: white !important;
        display: block !important;
    }
    .search-wrap {
        min-width: 120px;
        padding: 6px 10px;
    }
    .search-input {
        width: 80px;
        font-size: 13px;
    }
    .search-input:focus {
        width: 120px;
    }

    /* 分类标签：改为原生的横向滑动容器，隐藏底部滚动条 */
    .category-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 8px;
        padding-bottom: 12px;
        margin-bottom: 20px;
    }
    .category-bar::-webkit-scrollbar {
        display: none;
    }
    .cat-tab {
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* 英雄区域 (Banner) 瘦身 */
    .hero {
        padding: 40px 0 30px;
    }
    .hero h1 {
        font-size: 32px;
    }
    
    /* 小屏幕毛玻璃弹窗边距调优 */
    .modal-card {
        padding: 32px 20px;
    }
}

@media (max-width: 600px) {
    /* 商品卡片网格适应 iPhone 屏幕宽度 (375px/414px) */
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .product-card {
        padding: 16px 12px; /* 减小内部留白使图片更能撑满 */
    }
}
/* ====================================================
   COMMUNITY MODAL & BANNER
   ==================================================== */
.community-banner {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.btn-community {
    background: rgba(0, 113, 227, 0.08);
    color: var(--blue);
    border: none;
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-community:hover {
    background: rgba(0, 113, 227, 0.12);
    transform: scale(1.02);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: var(--white);
    width: 90%;
    max-width: 480px;
    border-radius: 28px;
    padding: 40px;
    position: relative;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f5f5f7;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    color: var(--text-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-header {
    text-align: center;
    margin-bottom: 32px;
}

.modal-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.contact-item {
    background: #f5f5f7;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 12px;
}

.contact-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-2);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.contact-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--blue);
    word-break: break-all;
}

.modal-note {
    margin-top: 24px;
    padding: 16px;
    background: rgba(52, 199, 89, 0.08);
    color: var(--green);
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    font-weight: 500;
}

