/* ========== 全局样式 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  width: 1200px;
  max-width: 96%;
  margin: 0 auto;
}

/* ========== 顶部导航 ========== */
.topbar {
  background: #333;
  color: #ccc;
  font-size: 12px;
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 32px;
}

.topbar a:hover {
  color: #fff;
}

.topbar .right a {
  margin-left: 16px;
}

.header {
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header .container {
  display: flex;
  align-items: center;
  height: 80px;
  gap: 40px;
}

.logo {
  font-size: 26px;
  font-weight: bold;
  color: #e4393c;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo .logo-icon {
  width: 36px;
  height: 36px;
  background: #e4393c;
  color: #fff;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.search-box {
  flex: 1;
  display: flex;
  max-width: 550px;
}

.search-box input {
  flex: 1;
  height: 40px;
  border: 2px solid #e4393c;
  border-right: none;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
  border-radius: 4px 0 0 4px;
}

.search-box button {
  width: 90px;
  height: 40px;
  background: #e4393c;
  color: #fff;
  border: none;
  font-size: 15px;
  cursor: pointer;
  border-radius: 0 4px 4px 0;
}

.search-box button:hover {
  background: #c81623;
}

.header-cart {
  position: relative;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 8px 18px;
  color: #e4393c;
  font-size: 14px;
  cursor: pointer;
  background: #fff;
}

.header-cart .cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #e4393c;
  color: #fff;
  font-size: 11px;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 9px;
  padding: 0 4px;
}

/* 主导航 */
.nav {
  background: #fff;
  border-top: 1px solid #f0f0f0;
}

.nav .container {
  display: flex;
  height: 44px;
  align-items: center;
  gap: 32px;
}

.nav a {
  font-size: 15px;
  color: #333;
  height: 44px;
  line-height: 44px;
  position: relative;
}

.nav a:hover,
.nav a.active {
  color: #e4393c;
}

.nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #e4393c;
}

/* ========== 轮播横幅 ========== */
.banner {
  margin-top: 16px;
  position: relative;
  height: 320px;
  border-radius: 8px;
  overflow: hidden;
}

.banner-slide {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #fff;
  text-align: center;
  background-size: cover;
  background-position: center;
}

.banner-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.banner-slide h2,
.banner-slide p {
  position: relative;
  z-index: 1;
}

.banner-slide.active {
  display: flex;
}

.banner-slide h2 {
  font-size: 36px;
  margin-bottom: 12px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.banner-slide p {
  font-size: 18px;
  opacity: 0.9;
}

.banner-dots {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
}

.banner-dots span {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  margin: 0 5px;
  cursor: pointer;
}

.banner-dots span.active {
  background: #fff;
}

/* ========== 分类栏 ========== */
.category-bar {
  margin-top: 16px;
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-bar button {
  border: 1px solid #e0e0e0;
  background: #fff;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  color: #555;
  transition: all 0.2s;
}

.category-bar button:hover {
  border-color: #e4393c;
  color: #e4393c;
}

.category-bar button.active {
  background: #e4393c;
  border-color: #e4393c;
  color: #fff;
}

/* ========== 商品列表 ========== */
.section-title {
  margin: 24px 0 16px;
  font-size: 22px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: "";
  width: 5px;
  height: 22px;
  background: #e4393c;
  border-radius: 3px;
}

.goods-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}

@media (max-width: 1024px) {
  .goods-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .goods-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.goods-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  display: block;
}

.goods-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.goods-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  position: relative;
  overflow: hidden;
  background: #f2f2f2;
}

.goods-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.goods-card:hover .goods-img img {
  transform: scale(1.05);
}

.goods-img .tag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  background: rgba(228, 57, 60, 0.92);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}

.goods-info {
  padding: 10px 12px 14px;
}

.goods-name {
  font-size: 14px;
  line-height: 1.4;
  height: 40px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 8px;
}

.goods-price {
  color: #e4393c;
  font-size: 18px;
  font-weight: bold;
}

.goods-price .orig {
  color: #999;
  font-size: 12px;
  font-weight: normal;
  text-decoration: line-through;
  margin-left: 6px;
}

.goods-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #999;
  display: flex;
  justify-content: space-between;
}

/* ========== 商品详情 ========== */
.detail-wrap {
  margin-top: 20px;
  background: #fff;
  border-radius: 8px;
  padding: 30px;
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.detail-img {
  width: 400px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: #f2f2f2;
}

.detail-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-info {
  flex: 1;
  min-width: 300px;
}

.detail-info h1 {
  font-size: 24px;
  margin-bottom: 14px;
}

.detail-desc {
  color: #888;
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.7;
}

.detail-price-box {
  background: #fff4f4;
  padding: 16px 20px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.detail-price-box .price {
  color: #e4393c;
  font-size: 30px;
  font-weight: bold;
}

.detail-price-box .orig {
  color: #999;
  text-decoration: line-through;
  margin-left: 12px;
}

.detail-row {
  display: flex;
  font-size: 14px;
  margin-bottom: 14px;
  color: #666;
}

.detail-row .label {
  width: 80px;
  color: #999;
}

.qty-box {
  display: inline-flex;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.qty-box button {
  width: 32px;
  height: 32px;
  border: none;
  background: #f7f7f7;
  cursor: pointer;
  font-size: 16px;
}

.qty-box input {
  width: 50px;
  border: none;
  text-align: center;
  font-size: 14px;
  outline: none;
}

.detail-actions {
  margin-top: 24px;
  display: flex;
  gap: 14px;
}

.btn {
  display: inline-block;
  padding: 12px 34px;
  font-size: 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.88;
}

.btn-primary {
  background: #e4393c;
  color: #fff;
}

.btn-outline {
  background: #fff8f8;
  color: #e4393c;
  border: 1px solid #e4393c;
}

.btn-block {
  width: 100%;
}

/* ========== 登录 / 注册 ========== */
.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 0;
}

.auth-card {
  width: 400px;
  max-width: 92%;
  background: #fff;
  border-radius: 10px;
  padding: 36px 34px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 26px;
  font-size: 22px;
}

.form-item {
  margin-bottom: 18px;
}

.form-item label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}

.form-item input {
  width: 100%;
  height: 42px;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-item input:focus {
  border-color: #e4393c;
}

.form-tip {
  font-size: 12px;
  color: #e4393c;
  min-height: 18px;
  margin-bottom: 8px;
}

.auth-switch {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: #888;
}

.auth-switch a {
  color: #e4393c;
}

/* 审核中横幅 */
.audit-banner {
  background: #fff7e6;
  border: 1px solid #ffd591;
  color: #ad6800;
  padding: 10px 16px;
  border-radius: 6px;
  margin-top: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ========== 弹窗提示 ========== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-mask.show {
  display: flex;
}

.modal {
  width: 360px;
  max-width: 90%;
  background: #fff;
  border-radius: 10px;
  padding: 30px 28px;
  text-align: center;
  animation: pop 0.25s ease;
}

@keyframes pop {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal .modal-icon {
  font-size: 44px;
  margin-bottom: 12px;
}

.modal h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.modal p {
  font-size: 14px;
  color: #777;
  line-height: 1.6;
  margin-bottom: 22px;
}

.modal .modal-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* toast */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 14px;
  z-index: 1000;
  display: none;
}

/* ========== 页脚 ========== */
.footer {
  margin-top: auto;
  background: #2b2b2b;
  color: #9a9a9a;
  padding: 30px 0 24px;
  font-size: 13px;
}

.footer .container {
  text-align: center;
  line-height: 2;
}

.footer a {
  color: #9a9a9a;
}

.footer a:hover {
  color: #fff;
}

.footer .links {
  margin-bottom: 8px;
}

.footer .links a {
  margin: 0 12px;
}

.footer .icp a {
  color: #bbb;
}
