* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(180deg, #f2f4fb 0%, #eef1fa 100%);
    color: #222;
    min-height: 100vh;
    padding: 20px 12px 40px;
}
.shop-wrap { max-width: 1200px; margin: 0 auto; }

/* 顶部店铺条 */
.shop-head {
    background: #fff; border-radius: 14px; padding: 18px 22px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    box-shadow: 0 2px 12px rgba(80,90,140,.06);
    margin-bottom: 14px; flex-wrap: wrap;
}
.shop-info { display: flex; align-items: center; gap: 14px; }
.shop-avatar {
    width: 62px; height: 62px; border-radius: 50%;
    background: linear-gradient(135deg, #4b3f2f, #211b12);
    color: #f5c777; font-weight: bold; font-size: 22px;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.shop-avatar img { width: 100%; height: 100%; object-fit: cover; }
.shop-meta { line-height: 1.5; }
.shop-name { font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.tag-btn {
    background: #5b4bff; color: #fff; font-size: 12px; padding: 3px 10px;
    border-radius: 4px; text-decoration: none; font-weight: normal;
}
.shop-sub { color: #666; font-size: 13px; margin-top: 2px; }
.shop-sub b { color: #333; font-weight: 500; }

.shop-actions { display: flex; gap: 10px; }
.pill-btn {
    background: #5b4bff; color: #fff !important;
    padding: 10px 18px; border-radius: 999px; text-decoration: none;
    font-size: 14px; display: inline-flex; align-items: center; gap: 4px;
}
.pill-btn.warn { background: #8a5cf6; }
.pill-btn:hover { opacity: .9; }

/* 面板 */
.panel {
    background: #fff; border-radius: 12px; padding: 18px 20px;
    box-shadow: 0 2px 12px rgba(80,90,140,.05);
    margin-bottom: 14px;
}
.panel-title {
    font-size: 15px; font-weight: 600; margin-bottom: 14px;
    display: flex; align-items: center; gap: 8px; color: #333;
}
.dot { width: 6px; height: 16px; background: #5b4bff; border-radius: 3px; display: inline-block; }
.notice-panel .panel-title { color: #5b4bff; }
.notice-body { color: #444; font-size: 14px; line-height: 1.7; padding: 4px 0; }

/* 分类 */
.cat-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px;
}
.cat-card {
    position: relative; padding: 16px 18px; border-radius: 10px;
    background: #f5f6fb; border: 2px solid transparent;
    text-decoration: none; color: #333; transition: .15s;
}
.cat-card:hover { border-color: #cfd0ff; }
.cat-card.on {
    background: linear-gradient(135deg, #6a5cff, #5b4bff);
    color: #fff; border-color: #5b4bff;
}
.cat-name { font-weight: 600; font-size: 15px; }
.cat-sub { font-size: 12px; margin-top: 4px; opacity: .8; }
.cat-check {
    position: absolute; right: 12px; bottom: 10px;
    width: 24px; height: 24px; border-radius: 50%;
    background: #fff; color: #5b4bff; display: flex; align-items: center; justify-content: center;
    font-weight: bold;
}

/* 商品 */
.prod-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px;
}
.prod-card {
    position: relative; display: flex; align-items: center; gap: 12px;
    padding: 12px; border-radius: 10px;
    background: #f7f8fc; border: 2px solid transparent;
    text-decoration: none; color: #333; transition: .15s;
}
.prod-card:hover { border-color: #cfd0ff; }
.prod-card.on { border-color: #5b4bff; background: #fff; box-shadow: 0 0 0 3px rgba(91,75,255,.08); }
.prod-thumb {
    width: 62px; height: 62px; border-radius: 8px; overflow: hidden;
    background: linear-gradient(135deg, #4b3f2f, #211b12);
    color: #f5c777; font-weight: bold; font-size: 18px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; }
.prod-info { flex: 1; min-width: 0; }
.prod-name { font-size: 14px; color: #444; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-line { display: flex; align-items: center; gap: 8px; }
.prod-price { color: #333; font-weight: 700; font-size: 15px; }
.stock-tag {
    background: #fff0ee; color: #ff5b47; padding: 2px 8px;
    border-radius: 4px; font-size: 12px;
}
.prod-check {
    position: absolute; right: 12px; bottom: 12px;
    width: 22px; height: 22px; border-radius: 50%; background: #5b4bff;
    color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px;
}

/* 商品描述 */
.desc-body {
    color: #555; font-size: 14px; line-height: 1.8;
    background: #fafbff; padding: 14px 16px; border-radius: 8px;
    white-space: pre-wrap;
}

/* 购买表单 */
.buy-form .field { margin-bottom: 16px; }
.buy-form label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.buy-form input[type=text], .buy-form input[type=number] {
    width: 100%; padding: 11px 12px; border: 1px solid #e2e5ee;
    border-radius: 8px; font-size: 14px; background: #fafbff;
}
.buy-form input:focus { border-color: #5b4bff; outline: none; background: #fff; }
.opt-row { display: flex; flex-wrap: wrap; gap: 10px; }
.opt {
    background: #f5f6fb; border: 2px solid transparent;
    padding: 10px 18px; border-radius: 8px; cursor: pointer;
    font-size: 14px; display: inline-flex; align-items: center; gap: 6px;
}
.opt input { accent-color: #5b4bff; }
.opt:has(input:checked) { border-color: #5b4bff; background: #fff; color: #5b4bff; }
.pay-summary {
    display: flex; justify-content: space-between; align-items: center;
    background: #fafbff; padding: 14px 16px; border-radius: 8px; margin: 18px 0 12px;
}
.pay-total { color: #ff5b47; font-size: 22px; font-weight: 700; }
.submit-btn {
    width: 100%; padding: 14px; background: linear-gradient(135deg, #6a5cff, #5b4bff);
    color: #fff; border: 0; border-radius: 10px; font-size: 16px; font-weight: 600;
    cursor: pointer; box-shadow: 0 4px 14px rgba(91,75,255,.35);
}
.submit-btn:hover { opacity: .95; }
.alert { background: #ffefef; color: #b02a2a; padding: 10px 12px; border-radius: 6px; margin-bottom: 12px; font-size: 14px; }
.empty { color: #888; text-align: center; padding: 30px 0; }
.footer { color: #999; text-align: center; padding: 20px 0 0; font-size: 12px; }

/* 查询订单页 */
.query-wrap { max-width: 720px; margin: 0 auto; }
.query-box { background: #fff; border-radius: 12px; padding: 36px 40px 30px; margin-bottom: 14px; position: relative; box-shadow: 0 2px 12px rgba(80,90,140,.06); }
.back-btn { position: absolute; left: 24px; top: 24px; width: 34px; height: 34px; border-radius: 50%; background: transparent; color: #5b4bff; font-size: 18px; display: flex; align-items: center; justify-content: center; text-decoration: none; transition: .15s; }
.back-btn:hover { background: #f0f0ff; }
.sale-btn { position: absolute; right: 24px; top: 24px; color: #5b4bff; font-size: 14px; text-decoration: none; }
.q-icon { color: #5b4bff; font-size: 26px; margin-top: 8px; }
.q-title { font-size: 24px; margin: 6px 0 8px; color: #222; font-weight: 600; }
.q-sub { color: #888; font-size: 13px; margin: 0 0 24px; }
.q-input { background: #fafbff; border: 1px solid #ebeef5; border-radius: 8px; padding: 14px 16px; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; transition: .15s; }
.q-input:focus-within { border-color: #5b4bff; background: #fff; }
.q-input-icon { color: #5b4bff; font-size: 16px; }
.q-input input { flex: 1; border: 0; outline: none; background: transparent; font-size: 14px; }
.q-captcha { background: #f5f6fb; border-radius: 8px; padding: 14px 16px; text-align: center; margin-bottom: 18px; color: #555; }
.q-captcha input { width: 70px; border: 1px solid #d2d6de; border-radius: 4px; padding: 4px 8px; margin-left: 6px; text-align: center; }
.q-submit { width: 100%; padding: 14px; background: linear-gradient(135deg, #6a5cff, #5b4bff); color: #fff; border: 0; border-radius: 8px; font-size: 16px; font-weight: 500; cursor: pointer; box-shadow: 0 4px 14px rgba(91,75,255,.28); }
.q-submit:hover { opacity: .95; }
.q-tip { margin-top: 26px; }
.q-tip-title { color: #5b4bff; font-size: 14px; margin-bottom: 8px; }
.q-tip p { color: #999; font-size: 12px; margin: 4px 0; }

.results h2 { font-size: 16px; margin: 0 0 14px; color: #333; }
.q-order { border: 1px solid #eee; border-radius: 8px; padding: 14px 16px; margin-bottom: 10px; }
.q-order-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.q-order-no { color: #333; font-size: 13px; font-weight: 500; }
.q-order-status { padding: 2px 10px; border-radius: 4px; font-size: 12px; }
.q-order-status.s-0 { background: #fdf6e3; color: #b58900; }
.q-order-status.s-1 { background: #e8f4fd; color: #3c8dbc; }
.q-order-status.s-2 { background: #dff0d8; color: #3c763d; }
.q-order-status.s-3 { background: #f2dede; color: #a94442; }
.q-order-body p { font-size: 13px; color: #555; margin: 4px 0; }
.q-cards { width: 100%; padding: 10px; font-family: monospace; font-size: 13px; border: 1px solid #ddd; border-radius: 6px; background: #fafbff; }

/* 二维码弹窗 */
.qr-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 999; padding: 20px;
}
.qr-box {
    background: #fff; border-radius: 14px; padding: 26px 30px;
    max-width: 320px; width: 100%; text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.qr-box h3 { margin: 0 0 16px; color: #333; font-size: 17px; }
.qr-img { max-width: 220px; width: 100%; border: 1px solid #eee; border-radius: 8px; padding: 8px; background: #fafbff; }
.qr-tip { color: #666; font-size: 13px; margin: 10px 0 4px; }
.qr-wx { color: #333; font-size: 14px; margin: 12px 0 6px; }
.qr-wx b { color: #d97706; margin: 0 4px; }
.qr-qq { color: #5b4bff; font-size: 13px; margin-left: 8px; }
.qr-close {
    margin-top: 16px; background: #5b4bff; color: #fff; border: 0;
    padding: 10px 30px; border-radius: 8px; font-size: 14px; cursor: pointer;
}
.qr-close:hover { opacity: .9; }

@media (max-width: 640px) {
    .shop-head { padding: 14px; }
    .shop-name { font-size: 16px; }
    .shop-actions { width: 100%; }
    .pill-btn { flex: 1; justify-content: center; padding: 10px 14px; font-size: 13px; }
    .panel { padding: 14px; }
}
