:root {
  --primary: #1677FF;
  --primary-hover: #0958d9;
  --primary-light: #e6f4ff;
  --secondary: #00B96B;
  --secondary-hover: #009a5a;
  --bg: #f5f7fa;
  --bg-white: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #666;
  --text-light: #999;
  --border: #e8e8e8;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --transition: all 0.3s ease;
  --nav-height: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-top: var(--nav-height);
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, textarea, select { font-family: inherit; outline: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Navigation ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.navbar .container {
  display: flex;
  align-items: center;
  height: 100%;
}

.nav-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.nav-logo span {
  color: var(--secondary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 40px;
  height: 100%;
}

.nav-links > li {
  position: relative;
  height: 100%;
}

.nav-links > li > a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 16px;
  font-size: 15px;
  color: var(--text);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-links > li > a:hover,
.nav-links > li > a.active {
  color: var(--primary);
}

.nav-links > li > a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 3px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
}

/* Dropdown */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: var(--transition);
  z-index: 100;
  overflow: hidden;
}

.nav-links > li:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--text);
  transition: var(--transition);
}

.dropdown-menu a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-arrow {
  font-size: 10px;
  margin-left: 4px;
  transition: var(--transition);
}

.nav-links > li:hover .nav-arrow {
  transform: rotate(180deg);
}

/* ===== Footer ===== */
.footer {
  background: #1a1a2e;
  color: #ccc;
  padding: 48px 0 24px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

.footer h4 {
  color: #fff;
  font-size: 16px;
  margin-bottom: 16px;
}

.footer a {
  color: #999;
  transition: var(--transition);
}

.footer a:hover {
  color: var(--primary);
}

.footer p {
  font-size: 13px;
  line-height: 2;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: #888;
}

.footer-bottom a {
  color: #aaa;
}

.footer-bottom a:hover {
  color: var(--primary);
}

/* ===== Page Title ===== */
.page-title {
  background: linear-gradient(135deg, var(--primary) 0%, #0958d9 100%);
  color: #fff;
  padding: 48px 0;
  text-align: center;
}

.page-title h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-title p {
  font-size: 16px;
  opacity: 0.85;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  padding: 16px 0;
  font-size: 13px;
  color: var(--text-light);
}

.breadcrumb a {
  color: var(--primary);
}

.breadcrumb span {
  color: var(--text-secondary);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  font-size: 15px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-weight: 500;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}

.btn-secondary:hover {
  background: var(--secondary-hover);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.btn-lg {
  padding: 14px 36px;
  font-size: 17px;
}

/* ===== Product Card ===== */
.product-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}

.product-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.product-card .thumb {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: #f0f0f0;
}

.product-card .info {
  padding: 14px 16px 16px;
}

.product-card .title {
  font-size: 14px;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
  line-height: 1.5;
}

.product-card .price {
  color: #f5222d;
  font-size: 18px;
  font-weight: 700;
  margin-top: 8px;
}

.product-card .price::before {
  content: '¥';
  font-size: 13px;
}

.product-card .actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.product-card .btn-cart {
  flex: 1;
  padding: 7px 0;
  font-size: 13px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.product-card .btn-cart:hover {
  background: var(--primary);
  color: #fff;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 420px;
  width: 90%;
  position: relative;
  animation: scaleIn 0.25s ease;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 24px;
  color: var(--text-light);
  background: none;
  transition: var(--transition);
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
}

.modal-box h3 {
  font-size: 20px;
  margin-bottom: 16px;
}

.modal-box .qrcode {
  width: 200px;
  height: 200px;
  margin: 16px auto;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
}

.modal-box .qrcode img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-box .pay-tip {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.modal-box .pay-tip strong {
  color: #f5222d;
}

/* ===== Section ===== */
.section {
  padding: 48px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 32px;
}

.section-header h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
}

.section-header p {
  color: var(--text-secondary);
  margin-top: 8px;
  font-size: 15px;
}

/* ===== Product Grid ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ===== Page Content ===== */
.page-content {
  padding: 40px 0;
  min-height: 400px;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: var(--transition);
  background: var(--bg-white);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.form-error {
  color: #f5222d;
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

.form-group.error input,
.form-group.error textarea {
  border-color: #f5222d;
}

.form-group.error .form-error {
  display: block;
}

/* ===== Banner ===== */
.banner {
  position: relative;
  height: 420px;
  overflow: hidden;
  background: linear-gradient(135deg, #1677FF 0%, #0958d9 50%, #00B96B 100%);
}

.banner-slide {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.banner-slide.active {
  opacity: 1;
}

.banner-content {
  text-align: center;
  color: #fff;
}

.banner-content h1 {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.banner-content p {
  font-size: 18px;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 24px;
}

.banner-dots {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.banner-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: var(--transition);
}

.banner-dots span.active {
  background: #fff;
  width: 28px;
  border-radius: 5px;
}

/* ===== Category Entries ===== */
.category-entries {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.category-entry {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}

.category-entry:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.category-entry .icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.category-entry h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.category-entry p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== Hot Products / Rankings ===== */
.hot-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.hot-item {
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.hot-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.hot-item .rank {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hot-item:nth-child(1) .rank { background: #f5222d; }
.hot-item:nth-child(2) .rank { background: #fa8c16; }
.hot-item:nth-child(3) .rank { background: #fadb14; color: #333; }

.hot-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #f0f0f0;
}

.hot-item .info {
  padding: 10px 12px 12px;
}

.hot-item .title {
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hot-item .price {
  color: #f5222d;
  font-size: 15px;
  font-weight: 700;
  margin-top: 4px;
}

.hot-item .price::before {
  content: '¥';
  font-size: 11px;
}

/* ===== Sidebar Layout ===== */
.sidebar-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
}

.sidebar {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 0;
  height: fit-content;
  position: sticky;
  top: calc(var(--nav-height) + 24px);
}

.sidebar h3 {
  padding: 0 20px 12px;
  font-size: 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.sidebar a {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.sidebar a:hover,
.sidebar a.active {
  color: var(--primary);
  background: var(--primary-light);
  border-left-color: var(--primary);
}

/* ===== Product Detail ===== */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.product-detail .gallery {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fafafa;
}

.product-detail .gallery img {
  width: 100%;
  min-height: 400px;
  object-fit: contain;
}

.product-detail .meta h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.4;
}

.product-detail .meta .price-box {
  background: #fff2f0;
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.product-detail .meta .price-box .current {
  color: #f5222d;
  font-size: 28px;
  font-weight: 700;
}

.product-detail .meta .price-box .current::before {
  content: '¥';
  font-size: 16px;
}

.product-detail .meta .params {
  margin: 20px 0;
}

.product-detail .meta .params dt {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.product-detail .meta .params dd {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 12px;
}

.product-detail .meta .btn-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* ===== Merchant Page ===== */
.merchant-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.merchant-feature {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

.merchant-feature .icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.merchant-feature h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.merchant-feature p {
  font-size: 13px;
  color: var(--text-secondary);
}

.merchant-form {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  max-width: 700px;
  margin: 0 auto;
}

.merchant-form h3 {
  font-size: 20px;
  margin-bottom: 24px;
  text-align: center;
}

/* ===== News List ===== */
.news-list {
  max-width: 900px;
  margin: 0 auto;
}

.news-item {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}

.news-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateX(4px);
}

.news-item .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.news-item .title {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
  transition: var(--transition);
}

.news-item:hover .title {
  color: var(--primary);
}

.news-item .tag {
  background: #f5222d;
  color: #fff;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 4px;
  white-space: nowrap;
  font-weight: 500;
}

.news-item .desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 10px;
  line-height: 1.7;
}

.news-item .date {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 10px;
}

/* ===== Login/Register ===== */
.auth-box {
  max-width: 440px;
  margin: 40px auto;
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
}

.auth-tabs {
  display: flex;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}

.auth-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.auth-form .btn {
  width: 100%;
  margin-top: 8px;
}

/* ===== About Page ===== */
.about-section {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.about-section h2 {
  font-size: 20px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
  color: var(--text);
}

.about-section h3 {
  font-size: 16px;
  margin: 20px 0 10px;
  color: var(--text);
}

.about-section p {
  font-size: 14px;
  line-height: 2;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.about-section ul {
  padding-left: 20px;
}

.about-section ul li {
  font-size: 14px;
  line-height: 2;
  color: var(--text-secondary);
  list-style: disc;
}

/* ===== Contact Info ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.contact-item .icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-item .text h4 {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.contact-item .text p {
  font-size: 15px;
  font-weight: 500;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .hot-list { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .hot-list { grid-template-columns: repeat(2, 1fr); }
  .sidebar-layout { grid-template-columns: 1fr; }
  .product-detail { grid-template-columns: 1fr; }
  .category-entries { grid-template-columns: 1fr; }
  .merchant-features { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .banner { height: 280px; }
  .banner-content h1 { font-size: 26px; }
  .nav-links { gap: 0; margin-left: 16px; }
  .nav-links > li > a { padding: 0 10px; font-size: 13px; }
}
