/* ============================================================
   优选商城 - 前端样式（纯静态，独立于后台）
   主色：蓝 #2563eb  强调/价格/按钮：红 #e60012
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #333; background: #f5f6f8; font-size: 14px; line-height: 1.6;
}
a { color: #2563eb; text-decoration: none; }
a:hover { color: #1d4ed8; }
img { max-width: 100%; border: 0; vertical-align: middle; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 12px; }
.muted { color: #999; font-size: 12px; }
.clearfix::after { content: ""; display: block; clear: both; }

/* ---------- 顶部 ---------- */
.site-header { background: #fff; border-bottom: 1px solid #e8e8e8; position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; padding: 14px 12px; gap: 20px; }
.logo { font-size: 24px; font-weight: 700; color: #2563eb; letter-spacing: 1px; white-space: nowrap; }
.logo:hover { color: #2563eb; }
.site-menu { display: flex; align-items: center; gap: 4px; }
.site-menu a {
  color: #444; padding: 6px 14px; border-radius: 18px; font-size: 15px; white-space: nowrap;
}
.site-menu a:hover { color: #2563eb; background: #f0f4ff; }
.site-menu a.active { color: #fff; background: #2563eb; font-weight: 600; }
.search-box { flex: 1; max-width: 520px; display: flex; }
.search-box input {
  flex: 1; height: 38px; padding: 0 12px; border: 2px solid #2563eb; border-right: 0;
  border-radius: 4px 0 0 4px; font-size: 14px; outline: none;
}
.search-box button {
  height: 38px; padding: 0 22px; background: #2563eb; color: #fff; border: 0;
  border-radius: 0 4px 4px 0; cursor: pointer; font-size: 14px;
}
.search-box button:hover { background: #1d4ed8; }
.header-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.header-nav .nav-link { color: #444; padding: 6px 10px; border-radius: 4px; font-size: 14px; }
.header-nav .nav-link:hover { background: #f0f4ff; color: #2563eb; }
.cart-link { color: #e60012; font-weight: 600; }
.cat-nav { background: #fff; border-top: 1px solid #f0f0f0; padding: 8px 12px; display: flex; gap: 4px; flex-wrap: wrap; }
.cat-nav a {
  color: #333; padding: 4px 12px; border-radius: 14px; font-size: 13px; background: #f5f6f8;
}
.cat-nav a:hover { background: #eef3ff; color: #2563eb; }

/* ---------- 通用 ---------- */
main.container { min-height: 60vh; padding-top: 16px; padding-bottom: 40px; }
.alert { padding: 10px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #e8f8ee; color: #1a7f37; border: 1px solid #bfe8cd; }
.alert-error { background: #fdecec; color: #c62828; border: 1px solid #f5c2c2; }
.alert-warning { background: #fff6e0; color: #9a6b00; border: 1px solid #f0dda8; }
.page-title { font-size: 20px; font-weight: 700; margin: 6px 0 16px; color: #222; }
.section-title { font-size: 18px; font-weight: 700; margin: 22px 0 14px; padding-left: 10px; border-left: 4px solid #2563eb; color: #222; }

/* ---------- 商品卡片 ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
.product-card {
  background: #fff; border: 1px solid #eee; border-radius: 8px; overflow: hidden;
  transition: box-shadow .2s, transform .2s; position: relative;
}
.product-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.1); transform: translateY(-2px); }
.product-card .thumb { display: block; width: 100%; height: 220px; object-fit: cover; background: #f7f7f7; }
.product-card .flags { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; }
.flag { display: inline-block; padding: 1px 7px; font-size: 11px; color: #fff; border-radius: 3px; }
.flag-hot { background: #e60012; }
.flag-new { background: #22a06b; }
.flag-rec { background: #f59e0b; }
.flag-top { background: #2563eb; }
.product-card .body { padding: 10px 12px 14px; }
.product-card .name { font-size: 14px; height: 40px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-card .name a { color: #333; }
.product-card .name a:hover { color: #2563eb; }
.product-card .meta { margin-top: 8px; display: flex; align-items: baseline; gap: 8px; }
.price { color: #e60012; font-weight: 700; font-size: 18px; }
.price small { font-size: 12px; font-weight: 400; }
.market-price { color: #999; font-size: 12px; text-decoration: line-through; }
.product-card .sales { margin-left: auto; color: #999; font-size: 12px; }
.product-card .stock { color: #999; font-size: 12px; }

/* ---------- 面包屑 / 筛选 ---------- */
.breadcrumb { font-size: 13px; color: #888; margin-bottom: 12px; }
.breadcrumb a { color: #2563eb; }
.filter-bar { background: #fff; border: 1px solid #eee; border-radius: 6px; padding: 12px 14px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-bar .label { color: #888; font-size: 13px; }
.filter-bar a { padding: 4px 12px; border-radius: 14px; font-size: 13px; color: #444; background: #f5f6f8; }
.filter-bar a:hover { color: #2563eb; background: #eef3ff; }
.filter-bar a.active { background: #2563eb; color: #fff; }

/* ---------- 分页 ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 26px 0; }
.pagination a, .pagination .cur {
  min-width: 34px; height: 34px; line-height: 34px; text-align: center; padding: 0 10px;
  background: #fff; border: 1px solid #e0e0e0; border-radius: 4px; color: #333; font-size: 13px;
}
.pagination .cur { background: #2563eb; border-color: #2563eb; color: #fff; }
.pagination a:hover { border-color: #2563eb; color: #2563eb; }
.pagination .page-info { margin-right: 10px; color: #888; font-size: 13px; }

/* ---------- 详情页 ---------- */
.detail-wrap { background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 20px; }
.detail-layout { display: flex; gap: 26px; }
@media (max-width: 860px) { .detail-layout { flex-direction: column; } }
.detail-gallery { flex: 0 0 420px; }
.detail-gallery .main-img { width: 100%; height: 420px; object-fit: cover; border-radius: 8px; background: #f7f7f7; }
.detail-info { flex: 1; min-width: 0; }
.detail-info h1 { font-size: 22px; line-height: 1.4; color: #222; margin-bottom: 8px; }
.detail-flags { margin-bottom: 12px; display: flex; gap: 6px; }
.detail-price-row {
  background: #fff4f4; border: 1px solid #ffe1e1; border-radius: 6px; padding: 14px 16px; margin: 12px 0;
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
}
.detail-price-row .price { font-size: 28px; }
.detail-price-row .label { color: #888; font-size: 13px; }
.stock-line { color: #666; margin-bottom: 12px; font-size: 13px; }
.stock-line span { margin-right: 18px; }
.stock-line b { color: #e60012; }
.spec-group { margin-bottom: 14px; }
.spec-group .spec-name { font-size: 13px; color: #666; margin-bottom: 6px; }
.spec-values { display: flex; gap: 8px; flex-wrap: wrap; }
.spec-values label {
  position: relative; cursor: pointer;
}
.spec-values input { position: absolute; opacity: 0; pointer-events: none; }
.spec-values .sv {
  display: inline-block; padding: 5px 14px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; background: #fff;
}
.spec-values input:checked + .sv { border-color: #2563eb; color: #2563eb; background: #eef3ff; }
.quantity-row { display: flex; align-items: center; gap: 10px; margin: 16px 0; }
.quantity-box { display: flex; align-items: center; border: 1px solid #ddd; border-radius: 4px; overflow: hidden; }
.quantity-box button { width: 34px; height: 36px; background: #f7f7f7; border: 0; cursor: pointer; font-size: 16px; }
.quantity-box button:hover { background: #eee; }
.quantity-box input { width: 54px; height: 36px; text-align: center; border: 0; border-left: 1px solid #eee; border-right: 1px solid #eee; font-size: 14px; outline: none; }
.buy-row { display: flex; gap: 12px; margin-top: 6px; }
.btn {
  display: inline-block; padding: 10px 26px; border-radius: 4px; font-size: 15px; cursor: pointer;
  border: 1px solid transparent; text-align: center;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; color: #fff; }
.btn-danger { background: #e60012; color: #fff; }
.btn-danger:hover { background: #c4000f; color: #fff; }
.btn-outline { background: #fff; color: #333; border-color: #ddd; }
.btn-outline:hover { border-color: #2563eb; color: #2563eb; }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 5px 14px; font-size: 13px; }

/* ---------- 详情描述 / AI 摘要 ---------- */
.ai-summary { background: #f0f6ff; border: 1px solid #d3e4ff; border-radius: 8px; padding: 16px 18px; margin: 18px 0; }
.ai-summary .ai-tag { display: inline-block; background: #2563eb; color: #fff; font-size: 12px; padding: 2px 10px; border-radius: 10px; margin-bottom: 8px; }
.ai-summary p { color: #335; font-size: 14px; }
.desc-section { margin-top: 26px; }
.desc-content { background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 22px; line-height: 1.9; }
.desc-content img { display: block; max-width: 100%; margin: 10px auto; }
.semantic-tags { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.semantic-tags .tag { background: #f5f6f8; color: #666; padding: 3px 10px; border-radius: 12px; font-size: 12px; }
.faq-list { margin-top: 12px; }
.faq-list details { border: 1px solid #eee; border-radius: 6px; padding: 10px 14px; margin-bottom: 8px; background: #fff; }
.faq-list summary { cursor: pointer; font-weight: 600; color: #333; }

/* ---------- 表格 ---------- */
.table { width: 100%; background: #fff; border: 1px solid #eee; border-radius: 8px; border-collapse: collapse; overflow: hidden; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid #f0f0f0; text-align: left; font-size: 14px; }
.table th { background: #fafbfc; color: #555; font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table .thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; }
.cart-item-info { display: flex; align-items: center; gap: 12px; }
.cart-item-info .name { color: #333; }
.cart-item-info .name:hover { color: #2563eb; }
.cart-item-info .sku { color: #999; font-size: 12px; margin-top: 2px; }

/* ---------- 购物车 / 结算 ---------- */
.cart-total-bar {
  background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 16px 18px; margin-top: 16px;
  display: flex; align-items: center; justify-content: flex-end; gap: 20px;
}
.cart-total-bar .total-price { font-size: 22px; }
.cart-empty { text-align: center; padding: 60px 0; color: #888; }
.cart-empty a { color: #ffffff; }

.checkout-layout { display: flex; gap: 20px; align-items: flex-start; }
@media (max-width: 860px) { .checkout-layout { flex-direction: column; } }
.checkout-main { flex: 1; }
.checkout-side { width: 300px; flex-shrink: 0; }
@media (max-width: 860px) { .checkout-side { width: 100%; } }
.panel { background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 16px 18px; margin-bottom: 16px; }
.panel h3 { font-size: 15px; margin-bottom: 12px; color: #222; }
.address-item {
  border: 1px solid #e6e6e6; border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; cursor: pointer; display: block;
}
.address-item.selected { border-color: #cbd5e1; background: #f1f5f9; }
.address-item .ad-name { font-weight: 600; }
.address-item .ad-tag { display: inline-block; background: #e60012; color: #fff; font-size: 11px; border-radius: 3px; padding: 0 5px; margin-left: 6px; }
.address-item input { margin-right: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 13px; color: #555; margin-bottom: 5px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; height: 38px; padding: 0 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; outline: none;
}
.form-group textarea { height: auto; padding: 8px 10px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #2563eb; }
.order-summary-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; color: #555; }
.order-summary-line .price { font-size: 14px; }

/* ---------- 登录 / 注册 ---------- */
.auth-wrap { max-width: 420px; margin: 30px auto; }
.auth-panel { background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 28px 30px; }
.auth-panel h2 { font-size: 20px; margin-bottom: 6px; text-align: center; }
.auth-panel .sub { text-align: center; color: #999; font-size: 13px; margin-bottom: 20px; }
.auth-panel .btn { width: 100%; margin-top: 6px; }

/* ---------- 会员中心 ---------- */
.uc-stat { display: flex; gap: 14px; margin-bottom: 20px; }
@media (max-width: 640px) { .uc-stat { flex-wrap: wrap; } }
.stat-card { flex: 1; background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 18px; text-align: center; }
.stat-card .num { font-size: 24px; font-weight: 700; color: #2563eb; }
.stat-card .name { color: #888; font-size: 13px; margin-top: 4px; }
.uc-links { background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 14px 18px; }
.uc-links a { display: inline-block; padding: 8px 18px; margin: 4px; background: #f5f6f8; border-radius: 4px; color: #333; }
.uc-links a:hover { background: #eef3ff; color: #2563eb; }

/* ---------- 订单 ---------- */
.order-card { background: #fff; border: 1px solid #eee; border-radius: 8px; margin-bottom: 14px; overflow: hidden; }
.order-head { background: #fafbfc; padding: 10px 16px; display: flex; align-items: center; gap: 16px; font-size: 13px; color: #555; border-bottom: 1px solid #f0f0f0; flex-wrap: wrap; }
.order-head .status { color: #e60012; font-weight: 600; }
.order-body { padding: 12px 16px; }
.order-item-line { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.order-item-line .thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; }
.order-item-line .oi-name { flex: 1; color: #333; }
.order-item-line .oi-price { color: #e60012; }
.order-foot { border-top: 1px dashed #eee; padding: 10px 16px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.order-foot .amount { font-size: 16px; }
.receiver-info { font-size: 13px; color: #555; line-height: 1.9; }
.receiver-info b { color: #222; }

/* ---------- 页脚 ---------- */
.site-footer { background: #fff; border-top: 1px solid #eee; padding: 26px 0 34px; text-align: center; color: #666; font-size: 13px; margin-top: 30px; }
.site-footer p { margin-bottom: 4px; }
/* 文字品牌（无 logo 图时使用）：用 inherit + 透明度，深浅背景都不翻车
   注：/news/css/news.css 里另有一份白字版本（深色页脚用），两边同时加载时以 news.css 为准 */
.footer-brand .brand-word { font-size: 1.25rem; font-weight: 800; letter-spacing: .5px; color: inherit; }
.footer-brand .suffix { margin-left: 10px; font-size: .8rem; font-weight: 500; letter-spacing: .5px; opacity: .75; }
/* 第三方登录（微信） */
.auth-third{margin-top:14px;text-align:center;}
.btn-third{background:#07c160;color:#fff;width:100%;box-sizing:border-box;}
.btn-third:hover{background:#06ad56;color:#fff;}
