/* ============ 安筑虚拟商品平台 - 前台样式 ============ */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --bg: #f5f6fb;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --radius: 14px;
    --shadow: 0 4px 20px rgba(79, 70, 229, 0.08);
    --shadow-hover: 0 12px 32px rgba(79, 70, 229, 0.16);
}

* { 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: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶部导航 ---------- */
.site-header {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(30, 27, 75, 0.35);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }

.brand-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 18px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.brand-text { color: #fff; font-size: 19px; font-weight: 700; letter-spacing: 1px; }

.main-nav { display: flex; gap: 8px; }

.main-nav a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.25s;
}

.main-nav a:hover, .main-nav a.active { color: #fff; background: rgba(255, 255, 255, 0.12); }

/* ---------- 公告栏 ---------- */
.notice-bar { background: #fef3c7; color: #92400e; font-size: 13px; padding: 8px 0; border-bottom: 1px solid #fde68a; }
.notice-bar .container { display: flex; align-items: center; gap: 8px; }

/* ---------- 主内容 ---------- */
.main-content { flex: 1; padding: 32px 20px 48px; }

/* ---------- Hero 区 ---------- */
.hero-section {
    background: linear-gradient(135deg, #eef2ff, #f5f3ff, #ede9fe);
    border-radius: 20px;
    padding: 48px 32px;
    text-align: center;
    margin-bottom: 28px;
    border: 1px solid #e0e7ff;
}

.hero-section h1 { font-size: 30px; color: #312e81; margin-bottom: 8px; }
.hero-section p { color: var(--text-light); margin-bottom: 24px; }

.search-box { display: flex; max-width: 520px; margin: 0 auto; background: #fff; border-radius: 50px; padding: 5px; box-shadow: 0 4px 16px rgba(79, 70, 229, 0.12); }

.search-box input { flex: 1; border: none; outline: none; padding: 10px 18px; font-size: 14px; background: transparent; }

.search-box button {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none; color: #fff; padding: 10px 26px; border-radius: 50px;
    cursor: pointer; font-size: 14px; font-weight: 600;
    transition: transform 0.2s;
}

.search-box button:hover { transform: scale(1.03); }

/* ---------- 分类标签 ---------- */
.category-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }

.category-tabs a {
    padding: 7px 18px;
    background: var(--card-bg);
    border-radius: 50px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    transition: all 0.25s;
}

.category-tabs a:hover { border-color: var(--primary-light); color: var(--primary); }

.category-tabs a.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* ---------- 商品网格 ---------- */
.goods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
}

.goods-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 1px solid #eef0f6;
}

.goods-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); border-color: #e0e7ff; }

.goods-cover {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.goods-cover-text { font-size: 52px; font-weight: 800; color: rgba(255, 255, 255, 0.9); text-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); }

.goods-cover.g-1 { background: linear-gradient(135deg, #6366f1, #a855f7); }
.goods-cover.g-2 { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.goods-cover.g-3 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.goods-cover.g-4 { background: linear-gradient(135deg, #10b981, #0ea5e9); }
.goods-cover.g-5 { background: linear-gradient(135deg, #ec4899, #f59e0b); }
.goods-cover.g-6 { background: linear-gradient(135deg, #8b5cf6, #ec4899); }

.goods-badge {
    position: absolute; top: 12px; right: 12px;
    background: rgba(255, 255, 255, 0.92);
    color: #ef4444;
    font-size: 11px; font-weight: 700;
    padding: 3px 10px; border-radius: 50px;
}

.goods-info { padding: 16px 18px 18px; }

.goods-name { font-size: 16px; font-weight: 600; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.goods-desc {
    font-size: 12.5px; color: var(--text-light);
    height: 38px; overflow: hidden;
    margin-bottom: 12px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

.goods-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }

.goods-price { color: #ef4444; font-size: 20px; font-weight: 800; }
.goods-original { color: #94a3b8; font-size: 13px; text-decoration: line-through; }

.goods-stats { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--text-light); }

.goods-stats b { color: var(--text); font-weight: 600; }
.goods-stats b.in { color: var(--success); }
.goods-stats b.out { color: var(--danger); }

.goods-cat { margin-left: auto; background: #eef2ff; color: var(--primary); padding: 2px 10px; border-radius: 50px; font-size: 11px; }

/* ---------- 分页 ---------- */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; }

.pagination a, .pagination span {
    min-width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    color: var(--text-light);
    text-decoration: none;
    font-size: 13px;
    padding: 0 10px;
    transition: all 0.2s;
}

.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; border-color: transparent; }

/* ---------- 空状态 ---------- */
.empty-state { grid-column: 1 / -1; text-align: center; padding: 60px 0; color: var(--text-light); }
.empty-state p { font-size: 16px; }

/* ---------- 商品详情页 ---------- */
.page-head { margin-bottom: 20px; }
.page-head h2 { font-size: 22px; color: var(--text); }

.goods-detail { display: grid; grid-template-columns: 320px 1fr; gap: 28px; }

.detail-cover {
    height: 300px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 96px; font-weight: 800; color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    box-shadow: var(--shadow);
}

.detail-cover.g-1 { background: linear-gradient(135deg, #6366f1, #a855f7); }
.detail-cover.g-2 { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.detail-cover.g-3 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.detail-cover.g-4 { background: linear-gradient(135deg, #10b981, #0ea5e9); }
.detail-cover.g-5 { background: linear-gradient(135deg, #ec4899, #f59e0b); }
.detail-cover.g-6 { background: linear-gradient(135deg, #8b5cf6, #ec4899); }

.detail-hot { margin-top: 20px; background: var(--card-bg); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.detail-hot h3 { font-size: 15px; margin-bottom: 12px; color: var(--text); }

.hot-item { display: flex; justify-content: space-between; padding: 9px 4px; border-bottom: 1px dashed #eef0f6; text-decoration: none; }
.hot-item:last-child { border-bottom: none; }

.hot-name { font-size: 13px; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hot-price { font-size: 13px; color: #ef4444; font-weight: 600; white-space: nowrap; }
.hot-item:hover .hot-name { color: var(--primary); }

.detail-right { background: var(--card-bg); border-radius: var(--radius); padding: 28px 30px; box-shadow: var(--shadow); }

.detail-title { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.detail-title h1 { font-size: 24px; color: var(--text); }

.detail-cat { background: #eef2ff; color: var(--primary); padding: 3px 12px; border-radius: 50px; font-size: 12px; }

.detail-desc { background: #f8fafc; border-radius: 10px; padding: 16px; margin-bottom: 20px; color: var(--text-light); font-size: 14px; border: 1px solid #eef0f6; }

.detail-price-box { background: #fef2f2; border: 1px solid #fee2e2; border-radius: 10px; padding: 16px 20px; margin-bottom: 24px; }

.detail-price, .detail-stock { display: flex; align-items: baseline; gap: 10px; }
.detail-stock { margin-top: 8px; }

.detail-price .label, .detail-stock .label { font-size: 13px; color: var(--text-light); }
.detail-price .value { font-size: 30px; font-weight: 800; color: #ef4444; }
.detail-price .original { font-size: 15px; color: #94a3b8; text-decoration: line-through; }
.detail-stock .value { font-size: 15px; font-weight: 700; }
.detail-stock .value.in { color: var(--success); }
.detail-stock .value.out { color: var(--danger); }

/* ---------- 购买表单 ---------- */
.buy-form .form-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.buy-form .form-row label { width: 88px; font-size: 14px; color: var(--text); flex-shrink: 0; }

.num-stepper { display: flex; align-items: center; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }

.num-btn {
    width: 42px; height: 42px;
    background: #f8fafc; border: none; cursor: pointer;
    font-size: 18px; color: var(--text); transition: background 0.2s;
}

.num-btn:hover { background: #eef2ff; color: var(--primary); }

.num-stepper input {
    width: 64px; height: 42px; text-align: center;
    border: none; border-left: 1px solid #e2e8f0; border-right: 1px solid #e2e8f0;
    font-size: 16px; font-weight: 600; outline: none;
}

.buy-form .hint { font-size: 12px; color: var(--text-light); }

.contact-input {
    flex: 1; max-width: 320px;
    height: 44px; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 0 14px; font-size: 14px; outline: none; transition: border 0.2s;
}

.contact-input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12); }

.total-row .total-amount { font-size: 24px; font-weight: 800; color: #ef4444; }

.btn-buy {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff; border: none;
    padding: 13px 48px; border-radius: 50px;
    font-size: 16px; font-weight: 700; cursor: pointer;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
    transition: all 0.25s;
}

.btn-buy:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(79, 70, 229, 0.45); }

.buy-tips { font-size: 12px; color: var(--text-light); margin-top: 4px; }

.sold-out-box { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 32px; text-align: center; color: var(--text-light); }

/* ---------- 查询页 ---------- */
.query-page { display: flex; justify-content: center; padding-top: 20px; }

.query-card { background: var(--card-bg); border-radius: var(--radius); padding: 36px 40px; width: 100%; max-width: 460px; box-shadow: var(--shadow); }

.query-card h2 { font-size: 20px; margin-bottom: 6px; }

.query-tip { font-size: 13px; color: var(--text-light); margin-bottom: 22px; }

.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: 13px; color: var(--text); margin-bottom: 6px; font-weight: 500; }
.form-field input {
    width: 100%; height: 44px;
    border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 0 14px; font-size: 14px; outline: none; transition: border 0.2s;
}
.form-field input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12); }

.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff; border: none;
    padding: 11px 36px; border-radius: 50px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    text-decoration: none;
    transition: all 0.25s;
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(79, 70, 229, 0.35); }

.btn-outline {
    display: inline-block;
    background: transparent; color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 10px 34px; border-radius: 50px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    text-decoration: none; transition: all 0.25s;
}

.btn-outline:hover { background: #eef2ff; }

/* ---------- 支付结果页 ---------- */
.result-page { display: flex; justify-content: center; padding-top: 20px; }

.result-card { background: var(--card-bg); border-radius: var(--radius); padding: 40px 44px; width: 100%; max-width: 560px; box-shadow: var(--shadow); text-align: center; }

.result-icon { font-size: 56px; margin-bottom: 12px; }

.result-card h2 { font-size: 22px; margin-bottom: 8px; }
.result-card.success h2 { color: var(--success); }
.result-card.pending h2 { color: #f59e0b; }

.result-msg { font-size: 14px; color: var(--text-light); margin-bottom: 24px; }

.order-info { background: #f8fafc; border-radius: 10px; padding: 16px 20px; margin-bottom: 24px; text-align: left; }

.info-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; border-bottom: 1px dashed #eef0f6; }
.info-row:last-child { border-bottom: none; }
.info-row span { color: var(--text-light); }
.info-row b { color: var(--text); font-weight: 600; }
.info-row b.amount { color: #ef4444; font-size: 16px; }

.card-box { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 20px; margin-bottom: 24px; }

.card-box h3 { font-size: 15px; color: #166534; margin-bottom: 12px; }

.card-box textarea {
    width: 100%; background: #fff; border: 1px solid #bbf7d0;
    border-radius: 8px; padding: 12px; font-size: 13px;
    font-family: "SFMono-Regular", Consolas, monospace;
    color: #14532d; resize: vertical; outline: none;
}

.card-tip { font-size: 12px; color: #4d7c0f; margin: 10px 0; }

.btn-copy {
    background: var(--success); color: #fff; border: none;
    padding: 9px 32px; border-radius: 50px; font-size: 13px; font-weight: 600; cursor: pointer;
    transition: all 0.2s;
}

.btn-copy:hover { background: #059669; }

.result-actions { display: flex; justify-content: center; gap: 14px; margin-top: 8px; }

.auto-tip { font-size: 12px; color: var(--text-light); margin-top: 14px; }

/* ---------- 错误提示页 ---------- */
.error-page { display: flex; justify-content: center; padding-top: 40px; }

.error-card { background: var(--card-bg); border-radius: var(--radius); padding: 48px 56px; text-align: center; box-shadow: var(--shadow); max-width: 480px; }

.error-icon { font-size: 52px; margin-bottom: 14px; }
.error-card h2 { font-size: 18px; color: var(--text); margin-bottom: 24px; font-weight: 600; }
.error-card .btn-primary, .error-card .btn-outline { margin: 0 6px; }

/* ---------- 页脚 ---------- */
.site-footer { background: #1e1b4b; color: rgba(255, 255, 255, 0.6); padding: 20px 0; font-size: 13px; text-align: center; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .hero-section h1 { font-size: 22px; }
    .goods-detail { grid-template-columns: 1fr; }
    .detail-cover { height: 200px; }
    .header-inner { flex-direction: column; height: auto; padding: 12px 0; gap: 8px; }
    .result-card { padding: 28px 22px; }
}
