* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f6fa; color: #2c3e50; font-size: 14px; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* 头部 */
.site-header { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.06); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo img { max-height: 36px; }
.logo-text { font-size: 22px; font-weight: 700; color: #667eea; }
.header-nav { display: flex; gap: 24px; }
.header-nav a { color: #5a6772; font-weight: 500; transition: color 0.2s; }
.header-nav a:hover { color: #667eea; }

/* 公告 */
.announcement { background: linear-gradient(90deg, #667eea, #764ba2); color: #fff; padding: 12px 20px; margin: 10px auto 0; font-size: 14px; max-width: 500px; border-radius: 4px; line-height: 1.6; overflow-wrap: break-word; word-wrap: break-word; }

/* 分类标签 */
.category-tabs { background: #fff; padding: 16px; border-radius: 8px; margin: 20px 0; box-shadow: 0 1px 3px rgba(0,0,0,0.06); display: flex; gap: 8px; flex-wrap: wrap; }
.category-tabs a { padding: 8px 16px; border-radius: 20px; background: #f5f6fa; color: #5a6772; font-size: 13px; transition: all 0.2s; }
.category-tabs a:hover, .category-tabs a.active { background: #667eea; color: #fff; }

/* 商品列表 */
.goods-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; padding-bottom: 40px; }
.goods-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.06); transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column; }
.goods-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.1); }
.goods-card .thumb { width: 100%; aspect-ratio: 4/3; background: #f5f6fa; overflow: hidden; }
.goods-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.goods-card .thumb .placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 40px; color: #bdc3c7; }
.goods-card .body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.goods-card .category-tag { display: inline-block; font-size: 11px; color: #667eea; background: #eef0fe; padding: 2px 8px; border-radius: 10px; margin-bottom: 6px; align-self: flex-start; }
.goods-card .name { font-size: 15px; font-weight: 600; color: #2c3e50; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.goods-card .desc { font-size: 12px; color: #95a5a6; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.goods-card .footer { display: flex; justify-content: space-between; align-items: center; }
.goods-card .price { color: #e74c3c; font-size: 18px; font-weight: 700; }
.goods-card .price small { font-size: 12px; font-weight: normal; }
.goods-card .stock { font-size: 11px; color: #95a5a6; }
.goods-card .stock .out { color: #e74c3c; }
.goods-card .buy-btn { background: #667eea; color: #fff; padding: 7px 16px; border-radius: 4px; font-size: 13px; transition: background 0.2s; border: none; cursor: pointer; }
.goods-card .buy-btn:hover { background: #5a6fd8; }
.goods-card .buy-btn:disabled { background: #bdc3c7; cursor: not-allowed; }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; color: #95a5a6; }
.empty-state .icon { font-size: 50px; margin-bottom: 16px; }

/* 下单页 */
.order-section { background: #fff; max-width: 640px; margin: 30px auto; padding: 28px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.order-section h2 { font-size: 18px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid #ecf0f1; }
.goods-summary { display: flex; gap: 14px; padding: 14px; background: #f5f6fa; border-radius: 6px; margin-bottom: 20px; }
.goods-summary img { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; }
.goods-summary .info { flex: 1; }
.goods-summary .info .name { font-weight: 600; margin-bottom: 4px; }
.goods-summary .info .price { color: #e74c3c; font-size: 18px; font-weight: 700; }
.goods-summary .info .stock { font-size: 12px; color: #95a5a6; }
.form-field { margin-bottom: 16px; }
.form-field label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-field label .req { color: #e74c3c; }
.form-field input, .form-field select, .form-field textarea {
    width: 100%; padding: 9px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; font-family: inherit;
}
.form-field input:focus, .form-field select:focus { outline: none; border-color: #667eea; }
.qty-row { display: flex; align-items: center; gap: 8px; }
.qty-row button { width: 32px; height: 32px; border: 1px solid #ddd; background: #fff; border-radius: 4px; cursor: pointer; font-size: 16px; }
.qty-row input { width: 60px; text-align: center; }
.total-row { padding: 14px 0; border-top: 1px dashed #ecf0f1; display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.total-row .total { color: #e74c3c; font-weight: 700; font-size: 22px; }
.submit-btn { width: 100%; padding: 12px; background: #667eea; color: #fff; border: none; border-radius: 4px; font-size: 15px; font-weight: 500; cursor: pointer; transition: background 0.2s; }
.submit-btn:hover { background: #5a6fd8; }
.submit-btn:disabled { background: #bdc3c7; cursor: not-allowed; }

/* 订单查询 */
.query-form { background: #fff; max-width: 640px; margin: 30px auto; padding: 28px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.query-form h2 { font-size: 18px; margin-bottom: 20px; }
.query-tabs { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid #ecf0f1; }
.query-tabs a { padding: 10px 16px; color: #5a6772; border-bottom: 2px solid transparent; }
.query-tabs a.active { color: #667eea; border-bottom-color: #667eea; font-weight: 600; }

/* 订单结果 */
.order-result { background: #fff; max-width: 640px; margin: 30px auto; padding: 28px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.result-status { text-align: center; padding: 20px 0; }
.result-status .icon { font-size: 50px; margin-bottom: 12px; }
.result-status .icon.success { color: #27ae60; }
.result-status .icon.pending { color: #f39c12; }
.result-status .title { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.result-status .subtitle { color: #7f8c8d; font-size: 13px; }
.order-info-table { width: 100%; margin: 20px 0; border-collapse: collapse; }
.order-info-table th { text-align: right; padding: 8px 12px; color: #7f8c8d; width: 100px; }
.order-info-table td { padding: 8px 12px; }
.cards-box { background: #f5f6fa; border-radius: 6px; padding: 14px; margin-top: 16px; }
.cards-box h4 { font-size: 14px; margin-bottom: 10px; }
.cards-box textarea { width: 100%; min-height: 120px; font-family: monospace; padding: 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; }

/* 页脚 */
.site-footer { background: #2c3e50; color: #bdc3c7; padding: 20px 0; margin-top: 40px; }
.site-footer .footer-info { text-align: center; font-size: 12px; }
.site-footer a { color: #bdc3c7; }
.site-footer a:hover { color: #fff; }

@media (max-width: 768px) {
    .header-inner { height: 56px; }
    .logo-text { font-size: 18px; }
    .header-nav { gap: 16px; }
    .goods-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .goods-card .body { padding: 10px; }
    .goods-card .name { font-size: 13px; }
    .goods-card .price { font-size: 15px; }
    .order-section, .query-form, .order-result { margin: 16px; padding: 20px; }
}
