/* 优选商城 - 主样式表 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #e1251b;      /* 主红色 */
  --primary-dark: #c01a12;
  --bg: #f4f4f4;
  --text: #333;
  --muted: #999;
  --price: #e1251b;
}
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
a { color: #333; text-decoration: none; }
a:hover { color: var(--primary); }
.wrap { width: 1180px; margin: 0 auto; }
.clearfix::after { content: ""; display: block; clear: both; }

/* 顶部栏 */
.topbar { background: #333; color: #ccc; font-size: 12px; padding: 6px 0; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; }
.topbar a { color: #ccc; margin: 0 4px; }
.topbar a:hover { color: #fff; }
.topbar .cart-link { color: #ffd4d1; font-weight: 600; }
.topbar .cart-link .cart-count { background: var(--primary); color: #fff; border-radius: 10px; padding: 0 6px; margin-left: 3px; font-size: 11px; }

/* 头部 */
.header { background: #fff; border-bottom: 2px solid var(--primary); }
.header .wrap { display: flex; align-items: center; padding: 16px 0; gap: 30px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-badge { background: var(--primary); color: #fff; width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; }
.logo-text h1 { font-size: 24px; color: var(--primary); letter-spacing: 1px; }
.logo-text p { font-size: 11px; color: #999; }
.header-search { flex: 1; display: flex; max-width: 540px; }
.header-search input[type=text] { flex: 1; padding: 10px 14px; border: 2px solid var(--primary); border-right: none; border-radius: 4px 0 0 4px; outline: none; font-size: 14px; }
.header-search button { padding: 10px 26px; background: var(--primary); color: #fff; border: none; border-radius: 0 4px 4px 0; cursor: pointer; font-size: 15px; font-weight: 600; }
.header-search button:hover { background: var(--primary-dark); }

/* 分类导航 */
.catnav { background: var(--primary); }
.catnav ul { list-style: none; display: flex; }
.catnav li { flex: 1; text-align: center; }
.catnav a { display: block; color: #fff; padding: 10px 0; font-size: 15px; }
.catnav a:hover { background: var(--primary-dark); color: #fff; }

/* 主体 */
.main { padding: 20px 0; min-height: 500px; }

/* 横幅 */
.banner { background: linear-gradient(120deg, #e1251b, #ff6a5e 60%, #e1251b); color: #fff; border-radius: 8px; padding: 46px 40px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; }
.banner h2 { font-size: 30px; margin-bottom: 8px; }
.banner p { opacity: .95; font-size: 15px; }
.banner .banner-btn { background: #fff; color: var(--primary); padding: 10px 24px; border-radius: 20px; font-weight: 600; display: inline-block; margin-top: 14px; }

/* 商品网格 */
.section-title { font-size: 20px; font-weight: 700; margin: 24px 0 14px; padding-left: 10px; border-left: 4px solid var(--primary); }
.section-title .more { float: right; font-size: 13px; font-weight: 400; color: #999; }
.product-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.product-card { background: #fff; border-radius: 8px; overflow: hidden; transition: all .2s; cursor: pointer; }
.product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); transform: translateY(-3px); }
.product-img { height: 140px; display: flex; align-items: center; justify-content: center; font-size: 56px; }
.product-info { padding: 10px 12px 14px; }
.product-name { font-size: 13px; height: 38px; overflow: hidden; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-price { color: var(--price); font-size: 18px; font-weight: 700; margin-top: 6px; }
.product-price .yuan { font-size: 12px; }
.product-price .orig { color: #999; font-size: 12px; text-decoration: line-through; font-weight: 400; margin-left: 6px; }
.product-meta { color: #999; font-size: 12px; margin-top: 4px; display: flex; justify-content: space-between; }
.product-card .buy-btn { display: block; text-align: center; background: var(--primary); color: #fff; padding: 6px 0; font-size: 13px; margin-top: 8px; border-radius: 4px; }
.product-card .buy-btn:hover { background: var(--primary-dark); color: #fff; }

/* 分类快捷图标 */
.cat-icons { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 8px; }
.cat-icons a { background: #fff; border-radius: 8px; padding: 16px 0; text-align: center; font-size: 14px; }
.cat-icons a .icon { display: block; font-size: 30px; margin-bottom: 6px; }
.cat-icons a:hover { color: var(--primary); box-shadow: 0 2px 10px rgba(0,0,0,.08); }

/* 商品详情 */
.pd-wrap { display: grid; grid-template-columns: 420px 1fr; gap: 30px; background: #fff; border-radius: 8px; padding: 26px; }
.pd-img { height: 380px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 150px; }
.pd-info h1 { font-size: 22px; margin-bottom: 10px; }
.pd-price-box { background: #fff5f5; border: 1px solid #ffe1e0; padding: 14px; border-radius: 6px; margin: 14px 0; }
.pd-price-box .price { color: var(--price); font-size: 28px; font-weight: 700; }
.pd-price-box .orig { color: #999; text-decoration: line-through; margin-left: 10px; }
.pd-desc { color: #666; margin: 14px 0; line-height: 1.8; }
.pd-buy { display: flex; gap: 12px; align-items: center; margin-top: 20px; }
.qty-input { width: 60px; padding: 8px; border: 1px solid #ddd; border-radius: 4px; text-align: center; }
.btn-buy { background: var(--primary); color: #fff; padding: 12px 30px; border: none; border-radius: 20px; font-size: 16px; font-weight: 600; cursor: pointer; }
.btn-buy:hover { background: var(--primary-dark); }
.btn-cart { background: #ff9800; color: #fff; padding: 12px 24px; border: none; border-radius: 20px; font-size: 15px; cursor: pointer; }

/* 表单 */
.form-box { max-width: 400px; margin: 30px auto; background: #fff; border-radius: 8px; padding: 30px 36px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.form-box h2 { text-align: center; margin-bottom: 22px; font-size: 20px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 5px; color: #555; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 9px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; outline: none; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); }
.btn-primary { width: 100%; padding: 11px; background: var(--primary); color: #fff; border: none; border-radius: 4px; font-size: 15px; cursor: pointer; }
.btn-primary:hover { background: var(--primary-dark); }
.form-tip { font-size: 12px; color: #999; text-align: center; margin-top: 12px; }
.form-tip a { color: var(--primary); }

/* 表格 */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 6px; overflow: hidden; }
.table th, .table td { padding: 11px 12px; border-bottom: 1px solid #f0f0f0; text-align: left; }
.table th { background: #fafafa; color: #666; font-weight: 600; }
.table tr:hover td { background: #fff8f8; }
.tag { padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.tag-red { background: #fff0ef; color: var(--primary); }
.tag-green { background: #e8f7e8; color: #2e7d32; }
.tag-yellow { background: #fff8e1; color: #f57c00; }
.tag-blue { background: #e3f2fd; color: #1565c0; }

/* 购物车 */
.cart-row { display: grid; grid-template-columns: 60px 1fr 100px 100px 120px 40px; align-items: center; gap: 10px; padding: 14px; background: #fff; border-radius: 6px; margin-bottom: 10px; }
.cart-row .c-img { font-size: 40px; text-align: center; }
.cart-row .c-name { font-size: 14px; }
.cart-total { background: #fff; border-radius: 6px; padding: 16px 20px; text-align: right; font-size: 16px; }
.cart-total .amount { color: var(--price); font-size: 24px; font-weight: 700; }

/* 消息 */
.msg { padding: 10px 16px; border-radius: 4px; margin-bottom: 14px; font-size: 13px; }
.msg-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.msg-error { background: #fdecea; color: #c62828; border: 1px solid #ef9a9a; }
.msg-info { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }

/* 评论 */
.review-list { list-style: none; }
.review-list li { padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.review-list .r-user { font-weight: 600; color: #333; }
.review-list .r-time { color: #999; font-size: 12px; margin-left: 8px; }
.review-list .r-stars { color: #ff9800; margin-left: 8px; font-size: 13px; }
.review-list .r-content { margin-top: 4px; color: #555; }

/* 页脚 */
.footer { background: #2b2b2b; color: #aaa; margin-top: 30px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; padding: 30px 0; }
.footer h3 { color: #fff; margin-bottom: 12px; font-size: 15px; }
.footer p { font-size: 13px; margin-bottom: 6px; }
.footer a { color: #aaa; }
.footer a:hover { color: #fff; }
.copyright { border-top: 1px solid #3a3a3a; text-align: center; padding: 14px 0; font-size: 12px; }

/* 空状态 */
.empty { color: #999; padding: 30px; text-align: center; }
.empty .icon { font-size: 50px; display: block; margin-bottom: 10px; }

/* 响应式 */
@media (max-width: 1200px) { .wrap { width: 96%; } .product-grid { grid-template-columns: repeat(4, 1fr); } }
