/* ===== 全局重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f0f5ff;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===== Header 头部 ===== */
.header {
    background: linear-gradient(135deg, #0066ff, #0052d9);
    color: #fff;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
}

.header h1 {
    flex: 1;
    font-size: 18px;
    text-align: center;
}

/* ===== 通用卡片 ===== */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* ===== 空状态 ===== */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 14px;
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

/* ===== 加载状态 ===== */
.loading {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 2000;
    display: none;
}

.toast.show {
    display: block;
    animation: fadeIn 0.3s;
}

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

/* ===== 弹窗遮罩 ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    padding: 25px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    font-size: 18px;
    color: #333;
}

.modal-close {
    width: 30px;
    height: 30px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #999;
    cursor: pointer;
}

/* ===== 表单元素 ===== */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.form-input,
.modal-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
}

.form-input:focus,
.modal-input:focus {
    border-color: #0066ff;
}

/* ===== 通用按钮 ===== */
.btn {
    padding: 14px 0;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #0066ff, #0052d9);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0,102,255,0.3);
}

.btn-secondary {
    background: #fff;
    color: #0066ff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.btn-submit {
    display: block;
    background: linear-gradient(135deg, #0066ff, #0052d9);
    color: #fff;
    text-align: center;
    padding: 14px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 16px;
    margin: 15px;
    box-shadow: 0 4px 15px rgba(0,102,255,0.3);
    border: none;
    cursor: pointer;
}

.btn-submit:active {
    transform: scale(0.98);
}

/* ===== Tab 标签页 ===== */
.tabs {
    background: #fff;
    display: flex;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 56px;
    z-index: 99;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    text-decoration: none;
}

.tab.active {
    color: #0066ff;
    border-bottom: 2px solid #0066ff;
    font-weight: 600;
}

/* ===== 列表项 ===== */
.list-item {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* ===== 订单/记录卡片 ===== */
.record-item,
.order-item {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ===== 状态标签 ===== */
.status-badge {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 500;
}

.status-pending { background: #fff7e6; color: #fa8c16; }
.status-processing { background: #e6f7ff; color: #1890ff; }
.status-done { background: #f6ffed; color: #52c41a; }
.status-rejected { background: #fff1f0; color: #ff4d4f; }
.status-cancelled { background: #f5f5f5; color: #999; }

/* ===== 颜色工具类 ===== */
.text-primary { color: #0066ff; }
.text-success { color: #52c41a; }
.text-danger { color: #ff4d4f; }
.text-warning { color: #faad14; }
.text-muted { color: #999; }

/* ===== 渐变背景变体 ===== */
.bg-blue { background: linear-gradient(135deg, #0066ff, #0052d9); }
.bg-cyan { background: linear-gradient(135deg, #1890ff, #096dd9); }

/* ===== 底部悬浮按钮 ===== */
.back-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #0066ff, #0052d9);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 15px rgba(0,102,255,0.4);
    cursor: pointer;
    text-decoration: none;
}

/* ===== 首页 Navbar ===== */
.navbar {
    background: linear-gradient(135deg, #0066ff 0%, #0052d9 100%);
    color: #fff;
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0,102,255,0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand { font-size: 22px; font-weight: 600; letter-spacing: 1px; }
.navbar-brand span { font-size: 14px; opacity: 0.85; margin-left: 8px; }
.navbar-left { display: flex; align-items: center; gap: 30px; }
.navbar-nav { display: flex; gap: 20px; }
.nav-item { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 14px; padding: 6px 12px; border-radius: 20px; transition: all 0.3s; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,0.2); }
.navbar-user { display: flex; align-items: center; gap: 12px; }
.nav-user-btn { background: rgba(255,255,255,0.15); }
.user-name { font-size: 14px; opacity: 0.95; }
.nav-btn { background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.3); color: #fff; padding: 6px 18px; border-radius: 20px; cursor: pointer; font-size: 13px; transition: all 0.3s; }
.nav-btn:hover { background: rgba(255,255,255,0.3); }

/* ===== 首页 Hero ===== */
.hero { background: linear-gradient(135deg, #0066ff 0%, #0052d9 50%, #003d99 100%); padding: 60px 20px; text-align: center; color: #fff; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%); animation: pulse 8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.hero h1 { font-size: 42px; font-weight: 700; margin-bottom: 15px; letter-spacing: 2px; position: relative; }
.hero p { font-size: 18px; opacity: 0.9; position: relative; }
.hero-badges { display: flex; justify-content: center; gap: 30px; margin-top: 30px; position: relative; }
.hero-badge { background: rgba(255,255,255,0.15); padding: 10px 25px; border-radius: 30px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.hero-badge::before { content: '✓'; color: #7cd0ff; }

/* ===== 首页 Section ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 40px 20px; }
.section { margin-bottom: 50px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.section-title { font-size: 24px; font-weight: 600; color: #1a1a1a; display: flex; align-items: center; gap: 12px; }
.section-title::before { content: ''; width: 5px; height: 28px; background: linear-gradient(180deg, #0066ff, #66a3ff); border-radius: 3px; }
.section-more { color: #0066ff; font-size: 14px; text-decoration: none; display: flex; align-items: center; gap: 5px; }

/* ===== 分类卡片 ===== */
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.category-card { background: #fff; border-radius: 16px; padding: 30px 20px; text-align: center; box-shadow: 0 4px 20px rgba(0,0,0,0.05); transition: all 0.3s; cursor: pointer; border: 1px solid #e8f0ff; position: relative; overflow: hidden; }
.category-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, #0066ff, #66a3ff); transform: scaleX(0); transition: transform 0.3s; }
.category-card:hover { transform: translateY(-5px); box-shadow: 0 12px 40px rgba(0,102,255,0.15); }
.category-card:hover::before { transform: scaleX(1); }
.category-icon { width: 70px; height: 70px; margin: 0 auto 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 32px; }
.category-card.phone .category-icon { background: linear-gradient(135deg, #e8f8f5, #d0f0eb); }
.category-card.shopping .category-icon { background: linear-gradient(135deg, #fff5e6, #ffe8cc); }
.category-card.video .category-icon { background: linear-gradient(135deg, #f3e8ff, #e4d4ff); }
.category-card.takeout .category-icon { background: linear-gradient(135deg, #ffe6e6, #ffd0d0); }
.category-card h3 { font-size: 18px; font-weight: 600; color: #1a1a1a; margin-bottom: 6px; }
.category-card p { font-size: 13px; color: #888; }

/* ===== 商品卡片 ===== */
.goods-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 20px; box-sizing: border-box; }
.goods-card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.05); transition: all 0.3s; border: 1px solid #f0f5ff; box-sizing: border-box; cursor: pointer; }
.goods-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,102,255,0.12); }
.goods-cover { height: 140px; aspect-ratio: 2/1; width: 100%; background: linear-gradient(135deg, #f8faff, #e8f0ff); display: flex; align-items: center; justify-content: center; font-size: 56px; position: relative; }
.goods-tag { position: absolute; top: 12px; left: 12px; background: linear-gradient(135deg, #0066ff, #0052d9); color: #fff; padding: 4px 12px; border-radius: 12px; font-size: 11px; }
.goods-tag.tag-merchant { background: linear-gradient(135deg, #ff9500, #ff6b00); box-shadow: 0 2px 8px rgba(255,149,0,0.3); }
.goods-tag.tag-self { background: linear-gradient(135deg, #00c853, #00e676); box-shadow: 0 2px 8px rgba(0,200,83,0.3); }
.goods-info { padding: 18px; }
.goods-name { font-size: 15px; font-weight: 500; color: #1a1a1a; margin-bottom: 10px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.goods-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 12px; }
.goods-sales { color: #999; }
.goods-rating { color: #ff9500; font-weight: 500; }
.goods-bottom { display: flex; justify-content: space-between; align-items: center; }
.goods-price { color: #ff4d4f; font-size: 20px; font-weight: 700; }
.goods-price::before { content: '¥'; font-size: 14px; font-weight: 500; }
.goods-original { color: #999; font-size: 13px; text-decoration: line-through; margin-left: 8px; }
.goods-btn { background: linear-gradient(135deg, #0066ff, #0052d9); color: #fff; border: none; padding: 8px 12px; border-radius: 20px; font-size: 12px; cursor: pointer; transition: all 0.3s; white-space: nowrap; min-width: 70px; text-align: center; box-sizing: border-box; }
.goods-btn:hover { opacity: 0.9; transform: scale(1.05); }

/* ===== Footer ===== */
.footer { background: #1a1a1a; color: #888; text-align: center; padding: 40px 20px; margin-top: 60px; }
.footer p { font-size: 14px; }
.footer-brand { font-size: 20px; color: #fff; margin-bottom: 10px; }

/* ===== 首页弹窗 ===== */
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); z-index: 200; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal.active { display: flex; }
.modal-content { background: #fff; padding: 35px; border-radius: 20px; width: 90%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal-title { font-size: 22px; font-weight: 600; text-align: center; margin-bottom: 25px; color: #1a1a1a; }
.form-btn { width: 100%; padding: 14px; background: linear-gradient(135deg, #0066ff, #0052d9); color: #fff; border: none; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.3s; }
.form-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.form-btn.secondary { background: #f5f5f5; color: #666; margin-top: 10px; }
.form-btn.secondary:hover { background: #eee; }
.form-switch { text-align: center; margin-top: 20px; font-size: 14px; color: #888; }
.form-switch a { color: #0066ff; text-decoration: none; }

/* ===== 分类/购买页面 ===== */
.category-page, .buy-page { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: #f0f5ff; z-index: 150; overflow-y: auto; }
.category-page.active, .buy-page.active { display: block; }
.category-header, .buy-header { background: linear-gradient(135deg, #0066ff 0%, #0052d9 100%); color: #fff; padding: 30px 20px; display: flex; align-items: center; gap: 15px; position: sticky; top: 0; z-index: 151; }
.buy-header { padding: 20px; }
.buy-header h2 { font-size: 18px; flex: 1; text-align: center; margin-right: 50px; }
.back-btn-sm { background: rgba(255,255,255,0.2); border: none; color: #fff; width: 40px; height: 40px; border-radius: 50%; font-size: 20px; cursor: pointer; }
.category-header h2 { font-size: 22px; }
.buy-content { padding: 20px; max-width: 600px; margin: 0 auto; }
.buy-card { background: #fff; border-radius: 16px; padding: 20px; margin-bottom: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.buy-goods-info { display: flex; gap: 15px; }
.buy-goods-cover { width: 100px; height: 100px; background: #f8faff; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 48px; }
.buy-goods-detail { flex: 1; }
.buy-goods-name { font-size: 16px; font-weight: 600; color: #1a1a1a; margin-bottom: 10px; }
.buy-goods-price { color: #ff4d4f; font-size: 24px; font-weight: 700; }
.buy-goods-price::before { content: '¥'; font-size: 16px; }
.buy-form-item { padding: 15px 0; border-bottom: 1px solid #f0f0f0; }
.buy-form-item:last-child { border-bottom: none; }
.buy-form-label { font-size: 14px; color: #666; margin-bottom: 8px; }
.buy-form-input { width: 100%; padding: 12px; border: 2px solid #e8f0ff; border-radius: 10px; font-size: 16px; }
.buy-form-input:focus { outline: none; border-color: #0066ff; }
.buy-submit { width: 100%; padding: 16px; background: linear-gradient(135deg, #0066ff, #0052d9); color: #fff; border: none; border-radius: 12px; font-size: 18px; font-weight: 600; cursor: pointer; margin-top: 20px; }
.buy-submit:active { opacity: 0.9; }

/* ===== 支付方式 ===== */
.pay-method { display: flex; align-items: center; padding: 15px; border: 2px solid #e8f0ff; border-radius: 12px; margin-bottom: 12px; cursor: pointer; transition: all 0.3s; }
.pay-method.active { border-color: #0066ff; background: #f0f7ff; }
.pay-method-icon { font-size: 28px; margin-right: 12px; }
.pay-method-info { flex: 1; }
.pay-method-name { font-size: 15px; color: #333; font-weight: 500; }
.pay-method-desc { font-size: 12px; color: #999; margin-top: 2px; }
.pay-method-check { width: 22px; height: 22px; border: 2px solid #ddd; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; transition: all 0.3s; }
.pay-method.active .pay-method-check { background: #0066ff; border-color: #0066ff; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .hero h1 { font-size: 28px; }
    .hero p { font-size: 15px; }
    .hero-badges { flex-wrap: wrap; gap: 10px; }
    .hero-badge { padding: 8px 16px; font-size: 12px; }
    .navbar { height: 50px; }
    .navbar-brand { font-size: 18px; }
    .navbar-brand span { display: none; }
    .navbar-left { gap: 0; }
    .navbar-nav { display: none; }
    .navbar-user { gap: 8px; }
    .user-name { display: none; }
    .nav-user-btn { padding: 6px 12px; font-size: 12px; }
    .category-grid, .goods-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .goods-card { padding: 8px; overflow: hidden; }
    .goods-cover { height: 50px; font-size: 24px; }
    .goods-info { padding: 0; }
    .goods-name { font-size: 12px; line-height: 1.3; height: 2.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .goods-bottom { margin-top: 6px; }
    .goods-price { font-size: 14px; }
    .goods-original { font-size: 10px; }
    .goods-btn { padding: 5px 8px; font-size: 11px; min-width: 50px; border-radius: 10px; }
    .category-card { padding: 20px 15px; }
    .category-icon { width: 56px; height: 56px; font-size: 26px; }
    .section-title { font-size: 20px; }
    .goods-cover { height: 110px; font-size: 44px; }
}
