/* 车配家 PC 端样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", Arial, sans-serif; font-size: 14px; color: #333; background: #f8f9fa; }
a { color: #2c8eff; text-decoration: none; }
a:hover { color: #1a7ae0; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* 顶部导航 */
.header { background: #fff; border-bottom: 1px solid #e5e5e5; position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; gap: 32px; }
.header .logo { font-size: 24px; font-weight: bold; color: #1e3c72; }
.header .search { flex: 1; display: flex; max-width: 600px; }
.header .search input { flex: 1; height: 38px; padding: 0 12px; border: 1px solid #ddd; border-right: none; border-radius: 4px 0 0 4px; font-size: 14px; }
.header .search input:focus { outline: none; border-color: #2c8eff; }
.header .search button { width: 80px; background: #2c8eff; color: #fff; border: none; border-radius: 0 4px 4px 0; font-size: 14px; }
.header .nav { display: flex; gap: 16px; align-items: center; font-size: 13px; }
.header .nav a { color: #666; }
.header .cart-link { position: relative; }
.header .cart-badge { position: absolute; top: -8px; right: -12px; min-width: 18px; height: 18px; line-height: 18px; background: #f56565; color: #fff; border-radius: 9px; text-align: center; font-size: 11px; padding: 0 4px; }

/* 容器 */
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* 分类导航 */
.cat-nav { background: #fff; border-radius: 4px; padding: 16px 24px; margin-bottom: 24px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.cat-nav h3 { font-size: 16px; margin-bottom: 12px; }
.cat-nav .cats { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.cat-nav .cats a { padding: 4px 12px; border-radius: 16px; background: #f0f4fa; color: #555; font-size: 13px; }
.cat-nav .cats a:hover { background: #2c8eff; color: #fff; }

/* 商品网格 */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.product-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); transition: box-shadow .2s, transform .2s; cursor: pointer; }
.product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.15); transform: translateY(-2px); }
.product-card .img { aspect-ratio: 1; overflow: hidden; background: #f0f0f0; }
.product-card .img img { width: 100%; height: 100%; object-fit: cover; }
.product-card .info { padding: 12px; }
.product-card .name { font-size: 14px; color: #333; line-height: 1.4; height: 40px; overflow: hidden; margin-bottom: 8px; }
.product-card .meta { display: flex; justify-content: space-between; align-items: center; }
.product-card .price { color: #f56565; font-size: 18px; font-weight: bold; }
.product-card .brand { color: #999; font-size: 12px; }
.product-card .badge { position: absolute; top: 8px; left: 8px; background: #f56565; color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.product-card .wrap { position: relative; }

/* 分页 */
.pager { display: flex; gap: 6px; justify-content: center; margin: 32px 0; }
.pager button { min-width: 36px; height: 36px; border: 1px solid #ddd; background: #fff; border-radius: 4px; }
.pager button.active { background: #2c8eff; color: #fff; border-color: #2c8eff; }
.pager button:disabled { color: #ccc; }

/* 详情 */
.detail-wrap { display: flex; gap: 32px; background: #fff; padding: 32px; border-radius: 8px; }
.detail-wrap .gallery { width: 460px; }
.detail-wrap .gallery .main { aspect-ratio: 1; border: 1px solid #eee; border-radius: 4px; overflow: hidden; }
.detail-wrap .gallery .main img { width: 100%; height: 100%; object-fit: contain; }
.detail-wrap .gallery .thumbs { display: flex; gap: 8px; margin-top: 12px; }
.detail-wrap .gallery .thumbs div { width: 70px; height: 70px; border: 2px solid #eee; border-radius: 4px; cursor: pointer; overflow: hidden; }
.detail-wrap .gallery .thumbs div.active { border-color: #2c8eff; }
.detail-wrap .info { flex: 1; }
.detail-wrap .info h1 { font-size: 22px; margin-bottom: 16px; line-height: 1.4; }
.detail-wrap .info .price { font-size: 28px; color: #f56565; font-weight: bold; margin-bottom: 16px; }
.detail-wrap .info .meta-row { display: flex; padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; color: #666; }
.detail-wrap .info .meta-row .label { width: 80px; color: #999; }
.detail-wrap .info .qty-row { display: flex; align-items: center; gap: 12px; margin: 24px 0; }
.detail-wrap .info .qty-ctrl { display: flex; align-items: center; }
.detail-wrap .info .qty-ctrl button { width: 36px; height: 36px; border: 1px solid #ddd; background: #fff; font-size: 16px; }
.detail-wrap .info .qty-ctrl input { width: 60px; height: 36px; border: 1px solid #ddd; text-align: center; font-size: 14px; border-left: none; border-right: none; }
.detail-wrap .info .actions { display: flex; gap: 12px; margin-top: 24px; }
.detail-wrap .info .btn-cart { padding: 12px 32px; background: #ff8800; color: #fff; border: none; border-radius: 4px; font-size: 15px; }
.detail-wrap .info .btn-buy { padding: 12px 32px; background: #f56565; color: #fff; border: none; border-radius: 4px; font-size: 15px; }
.detail-wrap .info .btn-fav { padding: 12px 20px; background: #fff; border: 1px solid #ddd; border-radius: 4px; color: #666; }

/* 资料表 */
.spec-table { background: #fff; padding: 24px; margin-top: 24px; border-radius: 8px; }
.spec-table table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { padding: 10px 12px; border: 1px solid #f0f0f0; text-align: left; font-size: 13px; }
.spec-table th { background: #fafbfc; }

/* 表单 */
.form-card { max-width: 400px; margin: 60px auto; background: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 2px 16px rgba(0,0,0,.08); }
.form-card h1 { text-align: center; margin-bottom: 24px; color: #1e3c72; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; margin-bottom: 6px; color: #666; font-size: 13px; }
.form-row input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }
.form-row input:focus { border-color: #2c8eff; outline: none; }
.form-row .code-row { display: flex; gap: 8px; }
.form-row .code-row input { flex: 1; }
.form-row .code-row button { width: 120px; background: #2c8eff; color: #fff; border: none; border-radius: 4px; font-size: 13px; }
.form-row .code-row button:disabled { background: #aaa; }
.form-submit { width: 100%; height: 42px; background: #2c8eff; color: #fff; border: none; border-radius: 4px; font-size: 15px; margin-top: 8px; }
.form-submit:hover { background: #1a7ae0; }
.form-submit:disabled { background: #aaa; cursor: not-allowed; }
.form-card .extra { text-align: center; margin-top: 16px; font-size: 13px; color: #999; }

/* Toast */
.cpj-toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-20px); padding: 10px 20px; border-radius: 4px; color: #fff; font-size: 14px; opacity: 0; transition: all .3s; z-index: 2000; }
.cpj-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.cpj-toast-info { background: #2c8eff; }
.cpj-toast-success { background: #38a169; }
.cpj-toast-error { background: #f56565; }

/* 通用按钮 */
.btn { display: inline-block; padding: 8px 18px; border: 1px solid #ddd; background: #fff; border-radius: 4px; font-size: 14px; color: #333; }
.btn-primary { background: #2c8eff; color: #fff; border-color: #2c8eff; }
.btn-primary:hover { background: #1a7ae0; }
.btn-danger { background: #f56565; color: #fff; border-color: #f56565; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 表格 */
.table { width: 100%; background: #fff; border-radius: 4px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05); border-collapse: collapse; }
.table th, .table td { padding: 12px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.table th { background: #fafbfc; color: #666; font-weight: 500; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag-success { background: #e6ffed; color: #38a169; }
.tag-warn { background: #fff8e1; color: #f69300; }
.tag-danger { background: #ffeef0; color: #f56565; }
.tag-info { background: #e6f4ff; color: #2c8eff; }
.tag-gray { background: #f0f0f0; color: #999; }

/* footer */
.footer { background: #1e3c72; color: #c5d3e8; padding: 24px 0; text-align: center; font-size: 13px; margin-top: 40px; }

/* 空态 */
.empty { text-align: center; padding: 60px 20px; color: #999; }
.empty .ico { font-size: 48px; opacity: .3; margin-bottom: 8px; }

/* 支付页 */
.pay-wrap { max-width: 600px; margin: 40px auto; background: #fff; padding: 40px; border-radius: 8px; text-align: center; }
.pay-wrap .amt { font-size: 36px; color: #f56565; margin: 16px 0; }
.pay-wrap .methods { display: flex; gap: 16px; justify-content: center; margin: 24px 0; }
.pay-wrap .method { padding: 20px 32px; border: 2px solid #eee; border-radius: 8px; cursor: pointer; font-size: 16px; }
.pay-wrap .method.active { border-color: #2c8eff; }
.pay-wrap .qrcode { width: 240px; height: 240px; margin: 24px auto; }
