/* ===== 集市列表页 =====
   弹性 rem 体系：尺寸随 html 根字号平滑缩放，宽屏下整体封顶。
   视觉基调：EDC 装备实验室 —— 深空暗底 + 荧光绿点缀 + 暖棕卡面，
   用多层渐变、噪点、辉光和卡片层级营造质感与氛围 */

:root {
  --bg: #1d1d1d;
  --bg-deep: #141414;
  --card: #2a2420;
  --card-hi: #352c25;
  --accent: #b4ea54;
  --accent-soft: rgba(180, 234, 84, 0.14);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f5f3ef;
  --text-dim: rgba(255, 255, 255, 0.5);
}

.market-page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -100px, rgba(180, 234, 84, 0.08), transparent 60%),
    var(--bg);
  overflow-x: hidden;
}

/* ===== 顶部背景 ===== */
.market-top {
  position: relative;
  padding: 0 4vw 2.75rem;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(180, 234, 84, 0.18), rgba(29, 29, 29, 0) 62%),
    radial-gradient(130% 100% at 50% -20%, #343434 0%, #1d1d1d 72%);
}
/* 顶部噪点 + 底部辉光分隔线 */
.market-top::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(180, 234, 84, 0.55), transparent);
  opacity: 0.6;
}
.market-top::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: radial-gradient(rgba(255, 255, 255, 0.6) 0.7px, transparent 0.7px);
  background-size: 18px 18px;
}

/* ===== 导航 ===== */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 1.25rem 0;
  position: relative;
  z-index: 2;
}
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.25s ease;
}
.brand:hover { transform: translateY(-2px); }
.brand-logo {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(180, 234, 84, 0.35));
}
.brand-name {
  margin-left: 0.6rem;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: linear-gradient(90deg, #fff 20%, var(--accent) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-right .nav-link {
  position: relative;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
  text-decoration: none;
  transition: color 0.2s;
  padding-bottom: 0.2rem;
}
.nav-right .nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.nav-right .nav-link:hover { color: var(--accent); }
.nav-right .nav-link:hover::after { width: 100%; }

/* ===== 标题 ===== */
.market-title {
  margin-top: 2.75rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  animation: riseIn 0.6s ease both;
}
.market-title .title-cn {
  color: #fff;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
.market-title .title-en {
  color: var(--accent);
  font-size: 1.1rem;
  letter-spacing: 0.35em;
  font-weight: 600;
}

/* ===== 出售 / 求购 切换 ===== */
.market-nav {
  margin-top: 1.6rem;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  animation: riseIn 0.6s 0.08s ease both;
}
.market-nav .nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 2rem;
  border-radius: 2rem;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.market-nav .nav-item:hover {
  border-color: rgba(180, 234, 84, 0.4);
  transform: translateY(-1px);
}
.market-nav .nav-item .nav-icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.5rem;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  transition: filter 0.25s;
}
.market-nav .nav-item .sale-icon {
  background-image: url("https://doge.cli-cla.com/static/edc-plus/consignment/sale_1.png");
}
.market-nav .nav-item-ac .sale-icon {
  background-image: url("https://doge.cli-cla.com/static/edc-plus/consignment/sale_1_ac.png");
}
.market-nav .nav-item .buy-icon {
  background-image: url("https://doge.cli-cla.com/static/edc-plus/consignment/buy.png");
}
.market-nav .nav-item-ac .buy-icon {
  background-image: url("https://doge.cli-cla.com/static/edc-plus/consignment/buy_ac.png");
}
.market-nav .nav-item-ac {
  background: linear-gradient(180deg, #c6f26b, var(--accent));
  color: #1d1d1d;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 22px rgba(180, 234, 84, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.market-nav .nav-line {
  width: 1px;
  height: 1.5rem;
  margin: 0 0.75rem;
  background: #c4c4c4;
  opacity: 0.5;
}
.market-nav .nav-line:last-of-type {
  margin-left: auto;
}
/* 平台交易告知链接 */
.notice-link {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.25s ease;
  cursor: pointer;
}
.notice-link:hover {
  color: rgba(255, 255, 255, 0.7);
}
.notice-icon {
  font-size: 1rem;
  line-height: 1;
}

/* ===== 列表 ===== */
.list-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 4vw 5rem;
  min-height: 40vh;
}
.goods-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  justify-content: center;
}

/* ===== 商品卡片 ===== */
.goods-card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.12)),
    var(--card-hi);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  overflow: hidden;
  padding-bottom: 0.8rem;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  animation: riseIn 0.5s ease both;
}
/* 入场错峰 */
.goods-card:nth-child(1) { animation-delay: 0.02s; }
.goods-card:nth-child(2) { animation-delay: 0.06s; }
.goods-card:nth-child(3) { animation-delay: 0.1s; }
.goods-card:nth-child(4) { animation-delay: 0.14s; }
.goods-card:nth-child(5) { animation-delay: 0.18s; }
.goods-card:nth-child(6) { animation-delay: 0.22s; }
.goods-card:nth-child(n + 7) { animation-delay: 0.26s; }
.goods-card:hover {
  transform: translateY(-6px);
  border-color: rgba(180, 234, 84, 0.45);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(180, 234, 84, 0.12);
}
.goods-card .img-box {
  position: relative;
  margin: 0.4rem auto 0;
  width: calc(100% - 0.8rem);
  height: 0;
  padding-bottom: calc(100% - 0.8rem);
  border-radius: 0.55rem;
  overflow: hidden;
  background: #222;
}
.goods-card .img-box::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.35));
  pointer-events: none;
}
.goods-card .img-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.goods-card:hover .img-box img { transform: scale(1.08); }
.goods-card .new-flag {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 2.4rem;
  height: 2.4rem;
  z-index: 3;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  animation: popIn 0.5s 0.3s ease both;
}
.goods-card .name {
  margin-top: 0.8rem;
  padding: 0 0.85rem 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  min-height: 2.8rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.goods-card .quality {
  margin-top: 0.4rem;
  padding: 0 0.85rem;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1rem;
}
.goods-card .price-wrap {
  margin-top: 0.85rem;
  padding: 0 0.85rem;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
}
.goods-card .price-wrap .price {
  font-size: 1.5rem;
  margin-right: 0.3rem;
  color: var(--accent);
  font-family: Arial, Helvetica, sans-serif;
  text-shadow: 0 0 18px rgba(180, 234, 84, 0.25);
}
.goods-card .footer {
  margin-top: 0.7rem;
  padding: 0 1rem 0 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.7rem;
}
.goods-card .footer .avatar-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}
.goods-card .footer .avatar {
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.goods-card .footer .name {
  margin-left: 0.4rem;
  padding: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: #dcd7cf;
  min-height: 0;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.goods-card .footer .status {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 600;
}
.goods-card .footer .status .status-icon {
  width: 1.1rem;
  height: 1.1rem;
  margin-right: 0.2rem;
  filter: drop-shadow(0 0 4px currentColor);
}
.goods-card .footer .status-sale {
  color: #0aecbf;
}
.goods-card .footer .status-buy {
  color: #ec81eb;
}

/* ===== 加载 / 空状态 ===== */
.loading {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  padding: 2.5rem 0;
}
.loading-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(180, 234, 84, 0.5);
  animation: blink 1s infinite ease-in-out;
}
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}
.no-more {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 2rem 0;
  letter-spacing: 0.1em;
}
.empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 1.05rem;
  padding: 5rem 0;
}
.empty::before {
  content: "";
  display: block;
  width: 3.2rem;
  height: 3.2rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(180, 234, 84, 0.35), rgba(180, 234, 84, 0.06));
  box-shadow: 0 0 24px rgba(180, 234, 84, 0.15);
}

/* ===== 动效 ===== */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  0% { opacity: 0; transform: scale(0.4); }
  70% { transform: scale(1.15); }
  100% { opacity: 1; transform: scale(1); }
}

/* ===== 移动端微调（其余尺寸已由 rem 弹性缩放自动适配） ===== */
@media (max-width: 600px) {
  .goods-list { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .nav-right .nav-link { font-size: 0.95rem; }
  .market-nav .nav-item { padding: 0.55rem 1.25rem; font-size: 1rem; }
}
