/* ========================================
   云慧安商城 - 全局样式 (主题A: 天猫质感)
   ======================================== */

/* -------------------- Reset & Base -------------------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #FF6A00;
  --primary-hover: #E55E00;
  --primary-light: #FFF0E6;
  --secondary: #222222;
  --bg-body: #f5f5f5;
  --bg-white: #ffffff;
  --text-primary: #222222;
  --text-secondary: #666666;
  --text-light: #999999;
  --price-color: #FF0000;
  --border-color: #e8e8e8;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 6px;
  --nav-height: 64px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  padding-top: var(--nav-height);
  min-width: 1200px;
}

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

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 1200px;
  margin: 0 auto;
}

/* -------------------- Buttons -------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s ease;
  gap: 6px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255,106,0,0.35);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-lg {
  padding: 14px 36px;
  font-size: 16px;
  border-radius: var(--radius);
}

/* -------------------- Header / Nav -------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  height: var(--nav-height);
}

.header .container {
  display: flex;
  align-items: center;
  height: 100%;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--secondary);
  margin-right: 48px;
  flex-shrink: 0;
}
.logo span {
  color: var(--primary);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
}

.nav > li {
  position: relative;
}

.nav > li > a {
  display: block;
  padding: 0 20px;
  height: var(--nav-height);
  line-height: var(--nav-height);
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 400;
  transition: color 0.25s;
  white-space: nowrap;
}

.nav > li > a:hover,
.nav > li > a.active {
  color: var(--primary);
}

/* Dropdown */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.25s ease;
  z-index: 1001;
}

.nav > 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-secondary);
  transition: all 0.2s;
}

.dropdown-menu a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* Header Right */
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.header-right a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.25s;
}
.header-right a:hover {
  color: var(--primary);
}

/* -------------------- Page Banner -------------------- */
.page-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  padding: 48px 0;
  text-align: center;
  color: #fff;
  margin-bottom: 40px;
}

.page-banner h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-banner p {
  font-size: 16px;
  opacity: 0.85;
}

/* -------------------- Cards -------------------- */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* -------------------- Section Title -------------------- */
.section-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  padding-left: 16px;
  border-left: 4px solid var(--primary);
  color: var(--secondary);
}

.section-title .more {
  float: right;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-light);
  line-height: 32px;
}

/* -------------------- Product Card -------------------- */
.product-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.product-card .thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #fafafa;
}

.product-card .info {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card .title {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
  min-height: 42px;
}

.product-card .price {
  font-size: 20px;
  font-weight: 700;
  color: var(--price-color);
  margin-bottom: 12px;
}

.product-card .price .symbol {
  font-size: 14px;
}

.product-card .cart-btn {
  padding: 8px 0;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
}

.product-card .cart-btn:hover {
  background: var(--primary-hover);
}

/* -------------------- Star Rating -------------------- */
.stars {
  color: #f5a623;
  font-size: 13px;
  letter-spacing: 2px;
}

/* -------------------- Footer -------------------- */
.footer {
  background: var(--secondary);
  color: #ccc;
  padding: 48px 0 32px;
  margin-top: 60px;
}

.footer .container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand h3 {
  font-size: 20px;
  color: #fff;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.8;
  color: #999;
}

.footer h4 {
  font-size: 15px;
  color: #fff;
  margin-bottom: 16px;
  font-weight: 500;
}

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

.footer ul li a {
  font-size: 13px;
  color: #999;
  transition: color 0.25s;
}

.footer ul li a:hover {
  color: var(--primary);
}

.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #333;
  text-align: center;
  font-size: 13px;
  color: #777;
}

.footer-bottom a {
  color: #999;
  transition: color 0.25s;
}

.footer-bottom a:hover {
  color: var(--primary);
}

/* -------------------- 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;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 36px 40px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  position: relative;
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 24px;
  color: #999;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

.modal-close:hover {
  color: #333;
}

.modal-box .qrcode {
  width: 200px;
  height: 200px;
  background: #eee;
  margin: 20px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #999;
}

.modal-box .qrcode img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

.modal-box p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* -------------------- Breadcrumb -------------------- */
.breadcrumb {
  padding: 16px 0;
  font-size: 13px;
  color: var(--text-light);
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb span {
  color: var(--text-light);
}

/* -------------------- Utilities -------------------- */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }

/* Grid */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
