/* ===== 前台样式（无外部依赖） ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; background: #f3f5fa; color: #333; min-height: 100vh; display: flex; flex-direction: column; }

.wrap { width: 1080px; max-width: 94vw; margin: 0 auto; }
.narrow { width: 620px; }

/* 头部 */
.site-head { background: #fff; border-bottom: 1px solid #e6eaf2; position: sticky; top: 0; z-index: 10; }
.head-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { font-size: 18px; font-weight: 700; color: #2c3e50; text-decoration: none; }
.site-head nav a { color: #666; text-decoration: none; margin-left: 22px; font-size: 14px; padding-bottom: 4px; }
.site-head nav a.on, .site-head nav a:hover { color: #4f6ef7; border-bottom: 2px solid #4f6ef7; }

/* 公告 */
.notice { background: #eef3ff; color: #4a5c8a; font-size: 13px; padding: 8px 0; text-align: center; }

/* 商品网格 */
.goods-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; padding: 28px 0 60px; }
.goods-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 4px 16px rgba(30, 40, 80, .06); display: flex; flex-direction: column; transition: transform .15s; }
.goods-card:hover { transform: translateY(-2px); }
.goods-name { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.goods-desc { color: #888; font-size: 13px; line-height: 1.6; margin-bottom: 14px; word-break: break-all; }
.goods-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; }
.goods-price .price { font-size: 22px; font-weight: 700; color: #e8453c; }
.goods-price .orig { font-size: 13px; color: #aaa; text-decoration: line-through; margin-left: 6px; }
.stock { font-size: 12px; color: #999; margin-top: 2px; }
.btn-buy { display: inline-block; padding: 8px 22px; background: #4f6ef7; color: #fff; border-radius: 8px; text-decoration: none; font-size: 14px; }
.btn-buy:hover { background: #3f5ce6; }
.btn-buy.disabled { background: #c3cbda; cursor: not-allowed; }

/* 卡片 / 表单 */
.card { background: #fff; border-radius: 12px; padding: 26px; box-shadow: 0 4px 16px rgba(30, 40, 80, .06); margin: 28px 0 60px; }
.pname { font-size: 18px; margin-bottom: 14px; }
.pname.center { text-align: center; }
.pprice { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.pprice .price { font-size: 26px; font-weight: 700; color: #e8453c; }
.stock-inline { color: #999; font-size: 13px; }

.frow { margin-bottom: 16px; }
.frow label { display: block; font-size: 13px; color: #555; margin-bottom: 6px; }
.order-form input[type="text"], .order-form input[type="number"] { width: 100%; padding: 10px 12px; border: 1px solid #d8dee9; border-radius: 8px; font-size: 14px; }
.order-form input:focus { outline: none; border-color: #4f6ef7; }

.qty-box { display: flex; align-items: center; gap: 10px; }
.qty-box button { width: 36px; height: 36px; border: 1px solid #d8dee9; background: #f7f9fc; border-radius: 8px; font-size: 16px; cursor: pointer; }
.qty-box input { width: 80px; text-align: center; }

.pay-group { border: 1px solid #e6eaf2; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.pay-group-name { font-size: 13px; color: #666; margin-bottom: 8px; }
.pay-opts { display: flex; gap: 18px; flex-wrap: wrap; }
.pay-opt { display: flex; align-items: center; gap: 5px; font-size: 14px; cursor: pointer; }

.total-line { font-size: 15px; color: #555; margin: 6px 0 14px; }
.total-line span { font-size: 20px; font-weight: 700; color: #e8453c; }
.btn-submit { display: block; width: 100%; padding: 12px; border: 0; border-radius: 10px; background: #4f6ef7; color: #fff; font-size: 16px; text-align: center; text-decoration: none; cursor: pointer; }
.btn-submit:hover { background: #3f5ce6; }
.btn-ghost { display: inline-block; padding: 9px 18px; border: 1px solid #c9d2e5; border-radius: 8px; background: #fff; color: #4f6ef7; font-size: 14px; cursor: pointer; }
.center { text-align: center; }

/* 提示 */
.msg { border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.msg.err { background: #fdecec; color: #c0392b; }
.tip { color: #888; font-size: 13px; margin: 10px 0; }
.check-bar { margin-top: 14px; padding-top: 14px; border-top: 1px dashed #e6eaf2; display: flex; justify-content: space-between; align-items: center; color: #888; font-size: 13px; }

/* 订单信息表 */
.order-info { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: 14px; }
.order-info td { padding: 8px 10px; border-bottom: 1px solid #f0f2f7; }
.order-info td:first-child { color: #888; width: 110px; }
.amount { color: #e8453c; font-weight: 700; font-size: 16px; }
.mono { font-family: Consolas, Menlo, monospace; word-break: break-all; }

/* 卡密展示 */
.code-box { background: #f7f9fc; border: 1px solid #e6eaf2; border-radius: 10px; padding: 12px; margin: 14px 0; }
.code-line { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-bottom: 1px dashed #e2e7f1; }
.code-line:last-child { border-bottom: 0; }
.code-line .mono { font-size: 14px; }
.copy-btn { border: 1px solid #c9d2e5; background: #fff; border-radius: 6px; padding: 3px 12px; font-size: 12px; color: #4f6ef7; cursor: pointer; flex-shrink: 0; margin-left: 10px; }

/* 结果页 */
.result-card { text-align: center; }
.result-icon { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 12px; font-size: 28px; line-height: 56px; }
.result-icon.ok { background: #e8f7ee; color: #1e7a3c; }
.result-icon.wait { background: #fff7e6; color: #b7791f; }
.result-icon.close { background: #fdecec; color: #c0392b; }
.result-meta { color: #888; font-size: 13px; line-height: 1.8; margin-top: 10px; }
.meta-line { color: #999; font-size: 12px; margin-top: 18px; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.tag.st-paid { background: #e8f7ee; color: #1e7a3c; }
.tag.st-wait { background: #fff7e6; color: #b7791f; }
.tag.st-closed { background: #eef0f4; color: #7a8190; }
.tag.st-refund { background: #fdecec; color: #c0392b; }

.empty { text-align: center; color: #aaa; padding: 60px 0; font-size: 14px; }

/* 页脚 */
.site-foot { margin-top: auto; padding: 20px 0; text-align: center; color: #aaa; font-size: 12px; border-top: 1px solid #e6eaf2; background: #fff; }

@media (max-width: 640px) {
    .goods-grid { grid-template-columns: 1fr; }
    .narrow { width: 94vw; }
}
