/* ============================================================
   处理拉二手交易平台 — 主样式表
   设计参考 997788.com，红色/棕色主题，收藏·文玩·字画·邮币卡
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  font-size: 14px;
  color: #333;
  background: #F4F4F4;
  min-width: 1000px;
}
a { color: #333; text-decoration: none; }
a:hover { color: #CE2B2A; }
ul, ol { list-style: none; }
img { border: 0; vertical-align: middle; }
input, button { font-family: inherit; outline: none; }

.wrap {
  width: 1000px;
  margin: 0 auto;
  position: relative;
}

/* --- Top Bar --- */
.top-bar {
  height: 30px;
  line-height: 30px;
  background: #f5f5f5;
  border-bottom: 1px solid #d6d6d6;
  font-size: 12px;
}
.top-bar .wrap {
  display: flex;
  justify-content: space-between;
}
.top-bar a {
  margin: 0 8px;
  color: #666;
}
.top-bar a:hover { color: #CE2B2A; }
.top-left span { color: #999; margin-right: 4px; }

/* --- Header --- */
.header {
  display: flex;
  align-items: center;
  padding: 18px 0 12px;
  background: #fff;
}
.header .logo {
  width: 200px;
  flex-shrink: 0;
}
.header .logo img {
  height: 60px;
}
.logo-text {
  font-size: 32px;
  font-weight: bold;
  color: #CE2B2A;
  letter-spacing: 2px;
}

/* -- Search -- */
.search-box {
  flex: 1;
  padding: 0 20px;
}
.search-tabs {
  margin-bottom: 4px;
  font-size: 12px;
}
.search-tabs span {
  cursor: pointer;
  padding: 2px 10px;
  color: #999;
  border: 1px solid transparent;
}
.search-tabs span.active {
  color: #CE2B2A;
  border-color: #CE2B2A;
  background: #fff;
}
.search-bar {
  display: flex;
  height: 40px;
  border: 2px solid #CE2B2A;
}
.search-bar input {
  flex: 1;
  border: 0;
  padding: 0 12px;
  font-size: 14px;
  color: #333;
}
.search-bar input::placeholder { color: #aaa; }
.search-bar button {
  width: 96px;
  border: 0;
  background: #CE2B2A;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  letter-spacing: 2px;
}
.search-bar button:hover { background: #b52322; }
.hot-words {
  margin-top: 6px;
  font-size: 12px;
  color: #999;
}
.hot-words a {
  color: #CE2B2A;
  margin: 0 4px;
}
.hot-words a:hover { text-decoration: underline; }

.header-ad {
  width: 200px;
  flex-shrink: 0;
}
.ad-placeholder {
  width: 100%;
  height: 60px;
  line-height: 60px;
  text-align: center;
  background: #f8f8f8;
  border: 1px dashed #ddd;
  color: #bbb;
  font-size: 14px;
}

/* --- Nav Bar --- */
.nav-bar {
  background: #CE2B2A;
  height: 40px;
}
.nav-bar .wrap {
  display: flex;
  align-items: center;
  height: 40px;
}
.nav-category-all {
  width: 200px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  background: #b52322;
  position: relative;
}
.nav-main {
  display: flex;
  flex: 1;
  height: 40px;
  align-items: center;
}
.nav-main li { height: 40px; }
.nav-main li a {
  display: block;
  height: 40px;
  line-height: 40px;
  padding: 0 18px;
  color: #fff;
  font-size: 14px;
}
.nav-main li a:hover,
.nav-main li a.active {
  background: #b52322;
}

/* --- Main Layout --- */
.main {
  display: flex;
  margin-top: 10px;
  min-height: 600px;
}

/* --- Category Dropdown --- */
.category-dropdown {
  width: 200px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  z-index: 10;
}
.category-inner {
  padding: 0;
}
.cat-loading {
  padding: 20px;
  text-align: center;
  color: #999;
}
.cat-item {
  display: block;
  height: 36px;
  line-height: 36px;
  padding: 0 15px;
  font-size: 14px;
  cursor: pointer;
  position: relative;
  border-bottom: 1px solid #f4f4f4;
}
.cat-item:hover {
  color: #CE2B2A;
  background: #fff8f8;
}
.cat-item::after {
  content: '';
  position: absolute;
  right: 15px;
  top: 14px;
  width: 6px;
  height: 6px;
  border-top: 1px solid #ccc;
  border-right: 1px solid #ccc;
  transform: rotate(45deg);
}

/* Category Flyout */
.cat-flyout {
  display: none;
  position: absolute;
  left: 200px;
  top: 0;
  width: 560px;
  min-height: 400px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-left: 0;
  border-radius: 0 5px 5px 0;
  box-shadow: 0 0 9px rgba(109,57,2,0.2);
  padding: 15px;
  z-index: 11;
}
.cat-item:hover .cat-flyout,
.cat-flyout:hover { display: block; }
.cat-sub-group { margin-bottom: 12px; }
.cat-sub-title {
  display: inline-block;
  font-weight: bold;
  font-size: 13px;
  color: #CE2B2A;
  min-width: 70px;
  vertical-align: top;
  padding-top: 2px;
}
.cat-sub-list {
  display: inline;
}
.cat-sub-list a {
  display: inline-block;
  padding: 2px 8px;
  font-size: 13px;
  white-space: nowrap;
}
.cat-sub-list a:hover { color: #CE2B2A; text-decoration: underline; }

/* --- Content Area --- */
.content {
  flex: 1;
  margin: 0 10px;
  min-width: 0;
}

/* Notice Bar */
.notice-bar {
  display: flex;
  align-items: center;
  height: 36px;
  background: #fff;
  border-radius: 5px;
  padding: 0 12px;
  margin-bottom: 10px;
  overflow: hidden;
}
.notice-tag {
  background: #CE2B2A;
  color: #fff;
  padding: 2px 10px;
  border-radius: 3px;
  font-size: 12px;
  margin-right: 10px;
  flex-shrink: 0;
}
.notice-scroll {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  display: flex;
}
.notice-scroll a {
  margin-right: 30px;
  font-size: 13px;
  flex-shrink: 0;
}
.notice-scroll a:hover { color: #CE2B2A; }
@keyframes noticeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Banner */
.banner {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  height: 260px;
}
.banner-main {
  flex: 1;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.banner-slide {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  font-weight: bold;
  letter-spacing: 3px;
}
.banner-slide.active { display: flex; }
.banner-side {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.banner-side-item {
  flex: 1;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s;
}
.banner-side-item:hover {
  color: #CE2B2A;
  box-shadow: 0 0 9px rgba(109,57,2,0.3);
}

/* Channel Bar */
.channel-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  background: #fff;
  border-radius: 8px;
  padding: 12px 15px;
  flex-wrap: wrap;
}
.channel-item {
  text-align: center;
  cursor: pointer;
  min-width: 70px;
  padding: 5px;
}
.channel-item:hover { color: #CE2B2A; }
.channel-item .ch-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 4px;
  background: #f4f4f4;
  border-radius: 8px;
  line-height: 40px;
  font-size: 18px;
}
.channel-item .ch-name {
  font-size: 12px;
  color: #666;
}

/* Goods Header */
.goods-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-radius: 8px 8px 0 0;
  padding: 12px 15px;
  border-bottom: 2px solid #CE2B2A;
}
.goods-header-tabs span {
  cursor: pointer;
  padding: 6px 16px;
  font-size: 15px;
  margin-right: 4px;
  border-radius: 3px;
}
.goods-header-tabs span.active {
  background: #CE2B2A;
  color: #fff;
}
.goods-sort { font-size: 13px; }
.goods-sort a {
  margin: 0 6px;
  padding: 4px 8px;
}
.goods-sort a.active { color: #CE2B2A; font-weight: bold; }

/* Goods Grid */
.goods-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  background: #fff;
  padding: 15px;
  border-radius: 0 0 8px 8px;
  margin-bottom: 10px;
}
.goods-card {
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.goods-card:hover {
  box-shadow: 0 0 9px rgba(109,57,2,0.54);
}
.goods-card .g-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #f8f8f8;
}
.goods-card .g-img-placeholder {
  width: 100%;
  height: 180px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 48px;
}
.goods-card .g-info {
  padding: 8px 10px;
}
.goods-card .g-name {
  font-size: 14px;
  color: #333;
  line-height: 1.4;
  height: 40px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 6px;
}
.goods-card .g-price {
  font-size: 18px;
  font-weight: bold;
  color: #f1912c;
}
.goods-card .g-price .unit {
  font-size: 13px;
  font-weight: normal;
}
.goods-card .g-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 12px;
  color: #999;
}
.goods-card .g-tag {
  background: #CE2B2A;
  color: #fff;
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 11px;
}

/* Pagination */
.pagination {
  text-align: center;
  padding: 15px 0 30px;
}
.pagination a {
  display: inline-block;
  min-width: 36px;
  height: 36px;
  line-height: 36px;
  margin: 0 3px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 3px;
  font-size: 14px;
  text-align: center;
}
.pagination a:hover { border-color: #CE2B2A; color: #CE2B2A; }
.pagination a.active {
  background: #CE2B2A;
  color: #fff;
  border-color: #CE2B2A;
}

/* --- Sidebar --- */
.sidebar {
  width: 260px;
  flex-shrink: 0;
}
.side-card {
  background: #fff;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}
.side-card-title {
  height: 38px;
  line-height: 38px;
  padding: 0 15px;
  font-size: 15px;
  font-weight: bold;
  border-bottom: 2px solid #CE2B2A;
  color: #CE2B2A;
}
.login-form {
  padding: 15px;
  text-align: center;
}
.user-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 10px;
  background: #f0f0f0;
}
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.login-input {
  width: 100%;
  height: 36px;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 0 10px;
  font-size: 13px;
  margin-bottom: 8px;
}
.login-input:focus { border-color: #CE2B2A; }
.login-btn-main {
  width: 100%;
  height: 38px;
  border: 0;
  background: #CE2B2A;
  color: #fff;
  font-size: 15px;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 4px;
}
.login-btn-main:hover { background: #b52322; }
.login-links {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
}
.login-links a { color: #999; }
.login-links a:hover { color: #CE2B2A; }
.welcome-text {
  font-size: 14px;
  margin-bottom: 10px;
}
.welcome-text strong { color: #CE2B2A; }
.user-link {
  display: block;
  line-height: 28px;
  font-size: 13px;
  color: #666;
}
.user-link:hover { color: #CE2B2A; }

/* Deal List */
.deal-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 15px;
  border-bottom: 1px solid #f4f4f4;
  font-size: 13px;
}
.deal-list li:hover { background: #fafafa; }
.deal-goods { color: #333; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-price { color: #f1912c; font-weight: bold; flex-shrink: 0; margin-left: 8px; }

/* Shop List */
.shop-list li {
  padding: 8px 15px;
  border-bottom: 1px solid #f4f4f4;
  font-size: 13px;
  cursor: pointer;
}
.shop-list li:hover { color: #CE2B2A; background: #fafafa; }

/* --- Partner Bar --- */
.partner-bar {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 10px;
  text-align: center;
}
.partner-bar h3 {
  font-size: 18px;
  color: #333;
  margin-bottom: 15px;
  letter-spacing: 2px;
}
.partner-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.partner-links a {
  display: inline-block;
  width: 14%;
  padding: 8px 0;
  font-size: 13px;
  border-right: 1px solid #f4f4f4;
}
.partner-links a:last-child { border-right: 0; }
.partner-links a:hover { color: #6D3902; }

/* --- Footer --- */
.footer {
  background: #fff;
  border-top: 2px solid #CE2B2A;
  padding: 30px 0;
}
.footer-links {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
}
.footer-links dl { text-align: center; }
.footer-links dt {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
}
.footer-links dd {
  line-height: 26px;
  font-size: 13px;
}
.footer-links dd a { color: #666; }
.footer-links dd a:hover { color: #CE2B2A; }
.copyright {
  text-align: center;
  font-size: 12px;
  color: #999;
  line-height: 24px;
}

/* --- Loading --- */
.loading {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 14px;
}

/* --- Responsive enhancements for modern browsers --- */
@media (max-width: 1020px) {
  body { min-width: auto; overflow-x: auto; }
}
