/* ========== 基础重置与变量 ========== */
:root {
    --primary: #1a7a6d;
    --primary-light: #e8f5f3;
    --primary-gradient: linear-gradient(135deg, #2a9d8f 0%, #1a7a6d 100%);
    --accent: #f4a261;
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --text: #2d3436;
    --text-secondary: #636e72;
    --text-light: #b2bec3;
    --border: #dfe6e9;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --max-width: 480px;
    --tab-height: 56px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #e0e3e7;
    color: var(--text);
    line-height: 1.6;
    overscroll-behavior-y: none;
    -webkit-font-smoothing: antialiased;
}

.app-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    background: var(--bg);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    box-shadow: 0 0 40px rgba(0,0,0,0.08);
}

/* ========== 主内容区 ========== */
.main-content {
    padding-bottom: calc(var(--tab-height) + var(--safe-bottom) + 12px);
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== 首页 ========== */
.home-header {
    background: var(--primary-gradient);
    padding: 24px 20px 0;
    color: #fff;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: block;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.2);
}

.logo-text h1 {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
}

.logo-text p {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}

.banner {
    background: var(--primary-gradient);
    padding: 0 20px 32px;
    position: relative;
    overflow: hidden;
}

.banner-content {
    position: relative;
    z-index: 1;
}

.banner-content h2 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.banner-content p {
    font-size: 13px;
    color: rgba(255,255,255,0.9);
    letter-spacing: 2px;
}

.banner-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
}

.banner-wave svg {
    width: 100%;
    height: 100%;
}

.section {
    padding: 20px 16px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
    padding-left: 10px;
    position: relative;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 14px;
    background: var(--primary);
    border-radius: 2px;
}

/* 关于我们 */
.about-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}

.about-card p {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 14px;
}

.about-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    border-radius: 20px;
    font-weight: 500;
}

/* 核心优势 */
.feature-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.feature-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-item:active {
    transform: scale(0.98);
}

.feature-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-gradient);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.feature-text {
    display: flex;
    flex-direction: column;
}

.feature-text strong {
    font-size: 14px;
    color: var(--text);
    font-weight: 600;
}

.feature-text span {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 1px;
}

/* 热门产品预览 */
.preview-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.preview-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.preview-card:active {
    transform: scale(0.97);
}

.preview-img {
    width: 100%;
    height: 85px;
    position: relative;
    overflow: hidden;
    background: var(--bg);
    cursor: pointer;
}

.preview-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.preview-card:active .preview-img img {
    transform: scale(1.05);
}

.preview-info {
    padding: 10px 12px 12px;
}

.preview-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-info .price {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    margin-top: 4px;
}

.btn-view-all {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-view-all:active {
    opacity: 0.85;
}

/* ========== 产品页 ========== */
.page-header {
    background: var(--primary-gradient);
    padding: 28px 20px 24px;
    color: #fff;
    text-align: center;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-header p {
    font-size: 12px;
    opacity: 0.85;
}

.product-filter {
    display: flex;
    gap: 8px;
    padding: 14px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.product-filter::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    flex-shrink: 0;
    padding: 6px 16px;
    background: var(--bg);
    border: none;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.filter-btn.active {
    background: var(--primary);
    color: #fff;
}

.filter-btn:active {
    transform: scale(0.95);
}

.product-list {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    display: flex;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.product-img {
    width: 110px;
    height: 110px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: var(--bg);
    cursor: pointer;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.product-card:active .product-img img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 8px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    border-radius: 10px;
    font-weight: 600;
}

.product-detail {
    flex: 1;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.4;
}

.product-spec {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-price {
    font-size: 15px;
    color: #e74c3c;
    font-weight: 700;
}

.product-price span {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-light);
    margin-left: 4px;
}

.product-tag {
    font-size: 11px;
    padding: 3px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 10px;
    font-weight: 500;
}

/* ========== 联系页 ========== */
.contact-header {
    padding-bottom: 32px;
}

.contact-card {
    margin: -20px 16px 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 8px 0;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f2f5;
}

.contact-item:last-child {
    border-bottom: none;
}

.contact-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.contact-icon::before {
    content: '';
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.phone-icon { background: #fff3e0; }
.phone-icon::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f4a261'%3E%3Cpath d='M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z'/%3E%3C/svg%3E"); }

.mobile-icon { background: #e8f5e9; }
.mobile-icon::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234caf50'%3E%3Cpath d='M17 1.01L7 1c-1.1 0-2 .9-2 2v18c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-1.99-2-1.99zM17 19H7V5h10v14z'/%3E%3C/svg%3E"); }

.email-icon { background: #e3f2fd; }
.email-icon::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232196f3'%3E%3Cpath d='M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E"); }

.addr-icon { background: #fce4ec; }
.addr-icon::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e91e63'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z'/%3E%3C/svg%3E"); }

.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-info label {
    display: block;
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 2px;
}

.contact-value {
    font-size: 14px;
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.contact-value {
    color: var(--primary);
}

.scope-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}

.scope-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.qr-section {
    text-align: center;
    padding: 20px 16px 8px;
}

.qr-placeholder {
    width: 140px;
    height: 140px;
    margin: 0 auto 12px;
    background: var(--card-bg);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    border: 1px dashed var(--border);
}

.qr-placeholder span {
    font-size: 12px;
    color: var(--text-light);
}

.qr-section p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ========== 底部导航 ========== */
.bottom-tab {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    height: calc(var(--tab-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: var(--tab-height);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    color: var(--text-light);
}

.tab-item.active {
    color: var(--primary);
}

.tab-icon {
    width: 22px;
    height: 22px;
    transition: color 0.2s;
}

.home-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E"); }
.products-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M20 6h-4V4c0-1.11-.89-2-2-2h-4c-1.11 0-2 .89-2 2v2H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-6 0h-4V4h4v2z'/%3E%3C/svg%3E"); }
.tab-contact-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM6 9h12v2H6V9zm8 5H6v-2h8v2zm4-6H6V6h12v2z'/%3E%3C/svg%3E"); }

.tab-label {
    font-size: 11px;
    font-weight: 500;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state p {
    font-size: 14px;
    margin-top: 12px;
}

/* ========== 图片全屏查看 ========== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: lightboxFadeIn 0.25s ease;
}

.lightbox.active {
    display: flex;
}

@keyframes lightboxFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    animation: lightboxZoom 0.25s ease;
}

@keyframes lightboxZoom {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-close:active {
    background: rgba(255,255,255,0.3);
}

.lightbox-caption {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 13px;
    text-align: center;
    max-width: 90%;
    opacity: 0.85;
}
