* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    color: #333;
    -webkit-font-smoothing: antialiased;
}

/* 导航 */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: #fff; border-bottom: 1px solid #eee;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
}
.nav-brand { font-size: 1rem; font-weight: 700; color: #1a1a2e; }
.nav-links { display: flex; gap: 16px; }
.nav-link { font-size: 0.85rem; color: #666; cursor: pointer; padding: 4px 8px; }
.nav-link.active { color: #6c5ce7; font-weight: 600; }

/* 页面 */
.page { display: none; min-height: 100vh; padding-top: 56px; }
.page.active { display: block; }

/* Hero */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff; padding: 40px 20px 50px; text-align: center;
}
.hero h1 { font-size: 1.8rem; line-height: 1.4; margin-bottom: 12px; }
.hero-sub { font-size: 1rem; opacity: 0.95; margin-bottom: 8px; }
.hero-desc { font-size: 0.8rem; opacity: 0.8; margin-bottom: 24px; }
.btn-large { padding: 12px 32px; font-size: 1rem; margin: 6px; border-radius: 25px; }

/* 按钮 */
.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff; border: none; border-radius: 8px;
    padding: 10px 20px; font-size: 0.9rem; cursor: pointer;
    font-weight: 600; transition: opacity 0.2s;
}
.btn-primary:active { opacity: 0.8; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
    background: rgba(255,255,255,0.2); color: #fff;
    border: 1px solid rgba(255,255,255,0.5); border-radius: 8px;
    padding: 10px 20px; font-size: 0.9rem; cursor: pointer;
}

/* 特性 */
.features {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
    padding: 20px 16px;
}
.feature-card {
    background: #fff; border-radius: 12px; padding: 20px 16px;
    text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.feature-icon { font-size: 2rem; margin-bottom: 8px; }
.feature-card h3 { font-size: 0.95rem; margin-bottom: 6px; color: #1a1a2e; }
.feature-card p { font-size: 0.75rem; color: #888; line-height: 1.5; }

/* 区块 */
.section { padding: 30px 16px; }
.section-gray { background: #fff; }
.section-title {
    font-size: 1.3rem; text-align: center; margin-bottom: 24px;
    color: #1a1a2e; font-weight: 700;
}

/* 产品卡片 */
.product-list { display: flex; flex-direction: column; gap: 16px; }
.product-card {
    background: #fff; border-radius: 16px; padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 2px solid transparent; transition: border-color 0.2s;
}
.product-card.hot { border-color: #6c5ce7; position: relative; }
.product-card.hot::before {
    content: '热门'; position: absolute; top: -1px; right: 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff; font-size: 0.7rem; padding: 2px 10px;
    border-radius: 0 0 8px 8px;
}
.product-name { font-size: 1.1rem; font-weight: 700; color: #1a1a2e; margin-bottom: 6px; }
.product-desc { font-size: 0.8rem; color: #888; margin-bottom: 12px; line-height: 1.6; }
.product-features { list-style: none; margin-bottom: 16px; }
.product-features li {
    font-size: 0.8rem; color: #555; padding: 4px 0;
    padding-left: 20px; position: relative;
}
.product-features li::before {
    content: '✓'; position: absolute; left: 0; color: #27ae60; font-weight: 700;
}
.product-price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 16px; }
.price-symbol { font-size: 1rem; color: #e74c3c; font-weight: 600; }
.price-value { font-size: 2rem; color: #e74c3c; font-weight: 700; }
.price-unit { font-size: 0.8rem; color: #999; }
.product-card .btn-primary { width: 100%; padding: 12px; font-size: 1rem; }

/* 流程 */
.steps {
    display: flex; align-items: flex-start; justify-content: center;
    flex-wrap: wrap; gap: 8px;
}
.step { text-align: center; flex: 1; min-width: 70px; }
.step-num {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff; font-weight: 700; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 8px;
}
.step h4 { font-size: 0.85rem; color: #1a1a2e; margin-bottom: 4px; }
.step p { font-size: 0.7rem; color: #888; }
.step-arrow { color: #ccc; font-size: 1.2rem; padding-top: 8px; }

/* 底部 */
.footer {
    background: #1a1a2e; color: #aaa; text-align: center;
    padding: 30px 20px; margin-top: 20px;
}
.footer p { font-size: 0.8rem; margin-bottom: 6px; }
.footer-small { font-size: 0.7rem !important; opacity: 0.6; }

/* 聊天页 */
.chat-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: #fff; border-bottom: 1px solid #eee;
    display: flex; align-items: center; padding: 12px 16px; gap: 10px;
}
.back-btn { font-size: 1.3rem; cursor: pointer; color: #666; padding: 4px; }
.chat-avatar { font-size: 1.8rem; }
.chat-info { flex: 1; }
.chat-name { font-size: 1rem; font-weight: 600; color: #1a1a2e; }
.chat-status { font-size: 0.75rem; color: #27ae60; display: flex; align-items: center; gap: 4px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #27ae60; }

.chat-messages {
    padding: 70px 16px 120px; min-height: 100vh;
}
.msg { margin-bottom: 16px; display: flex; gap: 8px; }
.msg-ai { justify-content: flex-start; }
.msg-user { justify-content: flex-end; }
.msg-avatar { font-size: 1.5rem; flex-shrink: 0; }
.msg-bubble {
    max-width: 75%; padding: 12px 16px; border-radius: 16px;
    font-size: 0.9rem; line-height: 1.6; word-break: break-word;
}
.msg-ai .msg-bubble { background: #fff; border-bottom-left-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.msg-user .msg-bubble { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border-bottom-right-radius: 4px; }

.quick-replies {
    position: fixed; bottom: 60px; left: 0; right: 0;
    display: flex; gap: 8px; padding: 8px 16px;
    background: transparent; overflow-x: auto; z-index: 50;
}
.quick-reply {
    background: #fff; border: 1px solid #ddd; border-radius: 20px;
    padding: 6px 14px; font-size: 0.8rem; color: #666;
    white-space: nowrap; cursor: pointer; flex-shrink: 0;
}
.chat-input-area {
    position: fixed; bottom: 0; left: 0; right: 0;
    display: flex; gap: 8px; padding: 10px 16px;
    background: #fff; border-top: 1px solid #eee; z-index: 50;
}
#chat-input {
    flex: 1; padding: 10px 14px; border: 1px solid #ddd;
    border-radius: 20px; font-size: 0.9rem; outline: none;
}
#chat-input:focus { border-color: #6c5ce7; }
.btn-send {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff; border: none; border-radius: 20px;
    padding: 10px 20px; font-size: 0.9rem; cursor: pointer;
}

/* 下单按钮在聊天中 */
.order-btn-wrap { text-align: center; padding: 12px; }
.order-btn-wrap .btn-primary { max-width: 220px; width: 100%; padding: 12px; font-size: 1rem; }

/* 支付页 */
.payment-container { padding: 70px 16px 30px; }
.payment-card {
    background: #fff; border-radius: 16px; padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06); text-align: center;
}
.payment-amount { margin-bottom: 20px; }
.amount-label { display: block; font-size: 0.85rem; color: #888; margin-bottom: 8px; }
.amount-value { font-size: 2.5rem; color: #e74c3c; font-weight: 700; }
.order-details {
    background: #f8f9fa; border-radius: 8px; padding: 12px;
    margin-bottom: 20px; text-align: left;
}
.order-details p { font-size: 0.8rem; color: #555; margin-bottom: 4px; }
.qrcode-section { margin-bottom: 10px; }
.qrcode-img {
    width: 200px; height: 200px; margin: 0 auto 12px;
    border: 1px solid #eee; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.qrcode-img img { width: 100%; height: 100%; object-fit: contain; }
.qrcode-tip { font-size: 0.85rem; color: #333; margin-bottom: 4px; }
.qrcode-tip-small { font-size: 0.7rem; color: #999; }

/* 交付页 */
.delivery-container { padding: 70px 16px 30px; }
.timeline { background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.timeline-loading { text-align: center; color: #999; padding: 20px; }
.timeline-item {
    display: flex; gap: 12px; padding-bottom: 20px;
    position: relative;
}
.timeline-item:not(:last-child)::after {
    content: ''; position: absolute; left: 15px; top: 32px; bottom: 0;
    width: 2px; background: #eee;
}
.timeline-item.done:not(:last-child)::after { background: #27ae60; }
.timeline-dot {
    width: 32px; height: 32px; border-radius: 50%;
    background: #eee; display: flex; align-items: center;
    justify-content: center; font-size: 0.8rem; flex-shrink: 0;
    z-index: 1;
}
.timeline-item.done .timeline-dot { background: #27ae60; color: #fff; }
.timeline-item.active .timeline-dot { background: #6c5ce7; color: #fff; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.timeline-content { flex: 1; }
.timeline-title { font-size: 0.9rem; font-weight: 600; color: #333; margin-bottom: 2px; }
.timeline-desc { font-size: 0.75rem; color: #999; }
.timeline-item.done .timeline-title { color: #27ae60; }

.delivery-result {
    margin-top: 16px; background: #fff; border-radius: 16px;
    padding: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.delivery-result h4 { font-size: 0.95rem; margin-bottom: 10px; color: #1a1a2e; }
.delivery-result p { font-size: 0.8rem; color: #555; margin-bottom: 6px; word-break: break-all; }
.delivery-result a { color: #6c5ce7; text-decoration: none; }

/* 订单页 */
.orders-container { padding: 70px 16px 30px; }
.orders-list { display: flex; flex-direction: column; gap: 12px; }
.order-item {
    background: #fff; border-radius: 12px; padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04); cursor: pointer;
}
.order-item-top { display: flex; justify-content: space-between; margin-bottom: 8px; }
.order-no { font-size: 0.8rem; color: #888; }
.order-status { font-size: 0.8rem; font-weight: 600; }
.order-status.pending { color: #f39c12; }
.order-status.paid { color: #27ae60; }
.order-status.delivering { color: #6c5ce7; }
.order-status.delivered { color: #27ae60; }
.order-product { font-size: 0.9rem; color: #333; margin-bottom: 4px; }
.order-amount { font-size: 1rem; color: #e74c3c; font-weight: 600; }
.empty-state { text-align: center; color: #999; padding: 60px 0; font-size: 0.9rem; }

/* 浮动AI按钮 */
.float-ai-btn {
    position: fixed; bottom: 24px; right: 16px; z-index: 90;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff; border-radius: 25px; padding: 12px 18px;
    font-size: 0.85rem; font-weight: 600; cursor: pointer;
    box-shadow: 0 4px 16px rgba(102,126,234,0.4);
    display: flex; align-items: center; gap: 6px;
}
.float-ai-btn.hidden { display: none; }

/* Toast */
#toast-message {
    position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
    padding: 12px 24px; border-radius: 8px; font-size: 0.85rem;
    z-index: 9999; max-width: 90%; text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2); color: #fff;
}
