/* =========================================================
   生活分类与同城商城 - 传统风格通用样式 (common.css)
   ========================================================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: #333;
  background-color: #f8fafc;
  line-height: 1.5;
}

.runtime-pending body > * {
  visibility: hidden;
}

.runtime-pending body::before {
  content: "正在加载站点内容…";
  visibility: visible;
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  color: #64748b;
  font-size: 14px;
}

a {
  color: #333;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #2563eb;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  vertical-align: middle;
}

/* 1200px 经典居中版心 */
.container {
  width: 1200px;
  margin: 0 auto;
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* 顶部灰色快捷栏 */
.top-bar {
  background-color: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  height: 36px;
  line-height: 36px;
  font-size: 12px;
  color: #64748b;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.city-select {
  cursor: pointer;
  color: #1e293b;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.city-select:hover {
  color: #2563eb;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.top-bar-right a {
  color: #475569;
}

.top-bar-right a:hover {
  color: #2563eb;
}

.cart-link {
  color: #dc2626 !important;
  font-weight: 600;
}

.cart-count {
  background-color: #dc2626;
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 2px;
}

/* 头部搜索栏区域 */
.header-search-wrap {
  background-color: #ffffff;
  padding: 24px 0;
  border-bottom: 1px solid #f1f5f9;
}

.header-search-wrap .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-box {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.logo-text h1 {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.logo-text p {
  font-size: 12px;
  color: #64748b;
}

/* 搜索框 */
.search-box {
  width: 560px;
}

.search-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.search-tab-item {
  padding: 3px 12px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  color: #64748b;
  background-color: #f1f5f9;
}

.search-tab-item.active {
  background-color: #2563eb;
  color: #ffffff;
  font-weight: 600;
}

.search-form {
  display: flex;
  border: 2px solid #2563eb;
  border-radius: 6px;
  overflow: hidden;
}

.search-input {
  flex: 1;
  border: none;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
}

.search-btn {
  background-color: #2563eb;
  color: #ffffff;
  border: none;
  padding: 0 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.search-btn:hover {
  background-color: #1d4ed8;
}

.hot-keywords {
  margin-top: 6px;
  font-size: 12px;
  color: #94a3b8;
}

.hot-keywords a {
  color: #64748b;
  margin-right: 10px;
}

.hot-keywords a:hover {
  color: #2563eb;
}

/* 快捷发布与商家入口按钮 */
.header-actions {
  display: flex;
  gap: 12px;
}

.btn-publish {
  background-color: #ff5500;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 6px -1px rgba(255, 85, 0, 0.25);
}

.btn-publish:hover {
  background-color: #e04b00;
  color: #ffffff;
}

.btn-merchant {
  background-color: #f8fafc;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-merchant:hover {
  background-color: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

/* 主导航栏 */
.main-nav {
  background-color: #1e293b;
  color: #fff;
  height: 48px;
  line-height: 48px;
  font-size: 15px;
}

.main-nav.mall-theme {
  background-color: #e1251b;
}

.main-nav.shop-nav {
  background-color: #c81623;
}

.main-nav .container {
  display: flex;
  align-items: center;
}

.main-nav > .container > a {
  display: block;
  min-height: 48px;
  padding: 0 22px;
  color: #e2e8f0;
  font-weight: 600;
}

.main-nav > .container > a:hover,
.main-nav > .container > a.active {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.16);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-top: 48px;
  padding: 28px max(20px, calc((100vw - 1200px) / 2));
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  font-size: 13px;
}

.site-footer a {
  color: inherit;
}

.nav-category-btn {
  width: 220px;
  background-color: #0f172a;
  color: #fff;
  padding: 0 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.main-nav.mall-theme .nav-category-btn {
  background-color: #c81623;
}

.nav-menu {
  display: flex;
}

.nav-menu li a {
  color: #cbd5e1;
  padding: 0 20px;
  display: block;
  font-weight: 500;
}

.main-nav.mall-theme .nav-menu li a {
  color: #fff;
  opacity: 0.9;
}

.nav-menu li.active a,
.nav-menu li a:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.15);
}

/* 面包屑导航 */
.breadcrumb {
  padding: 14px 0;
  font-size: 13px;
  color: #64748b;
}

.breadcrumb a {
  color: #475569;
}

.breadcrumb a:hover {
  color: #2563eb;
}

.breadcrumb span {
  margin: 0 6px;
  color: #cbd5e1;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  text-align: center;
}

.btn-primary {
  background-color: #2563eb;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #1d4ed8;
  color: #ffffff;
}

.btn-danger {
  background-color: #dc2626;
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #b91c1c;
  color: #ffffff;
}

.btn-outline {
  border-color: #cbd5e1;
  color: #334155;
  background-color: #ffffff;
}

.btn-outline:hover {
  border-color: #94a3b8;
  background-color: #f8fafc;
}

/* 分页组件 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 30px 0;
}

.pagination a, .pagination span {
  padding: 8px 14px;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  color: #475569;
  border-radius: 4px;
  font-size: 13px;
}

.pagination a:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.pagination .active {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* 底部 Footer */
.footer {
  background-color: #0f172a;
  color: #94a3b8;
  padding: 40px 0 20px;
  margin-top: 60px;
  font-size: 13px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 30px;
  margin-bottom: 20px;
}

.footer-col h3 {
  color: #f1f5f9;
  font-size: 15px;
  margin-bottom: 14px;
  font-weight: 600;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col a {
  color: #94a3b8;
}

.footer-col a:hover {
  color: #38bdf8;
}

.footer-bottom {
  text-align: center;
  color: #64748b;
  font-size: 12px;
  line-height: 1.8;
}

/* 弹窗 Popups */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-card {
  background-color: #ffffff;
  width: 440px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2);
}

.modal-header {
  padding: 16px 20px;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: #0f172a;
}

.modal-close {
  cursor: pointer;
  font-size: 18px;
  color: #94a3b8;
}

.modal-close:hover {
  color: #0f172a;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 12px 20px;
  background-color: #f8fafc;
  border-top: 1px solid #e2e8f0;
  text-align: right;
}
