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

:root {
  --bg: #fff;
  --card: #fff;
  --primary: #3385ff;
  --primary-dark: #2b77e5;
  --text: #222;
  --muted: #9195a3;
  --border: #e4e7ed;
  --trust: #10b981;
  --radius: 8px;
  --link: #2440b3;
}

html {
  overflow-y: auto;
}
body {
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Header · 百度式顶栏 */
.header {
  padding: 0;
  background: transparent;
  border: none;
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 100;
}
.header-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 14px 24px;
  gap: 16px;
  min-height: 60px;
}
body:not(.on-home) .header-top {
  justify-content: space-between;
}
body.on-home .header-left {
  display: none;
}
body:not(.on-home) .header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-mini {
  display: flex;
  gap: 20px;
  align-items: center;
}
.nav-link {
  padding: 0;
  background: none;
  border: none;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
}
.nav-link:hover { color: var(--primary); }
.nav-link.active { color: var(--primary); font-weight: 600; }
.nav-cart-count {
  color: var(--primary);
  font-weight: 600;
  font-size: 16px;
}
[hidden] { display: none !important; }
.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.nav-user-name {
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-logout {
  font-size: 14px !important;
  color: var(--muted) !important;
}
.nav-logout:hover {
  color: var(--primary) !important;
}
.nav-register {
  color: var(--primary);
  font-weight: 600;
}

/* 购物车按钮 */
.nav-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: none;
  border: none;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  position: relative;
}
.nav-cart-btn:hover { color: var(--primary); }
.nav-cart-btn.active { color: var(--primary); font-weight: 600; }
.nav-cart-icon {
  display: inline-block;
  transition: transform 0.3s ease;
  animation: cartIconIdle 4s ease-in-out infinite;
}
.nav-cart-btn.has-items .nav-cart-icon {
  animation: cartIconIdle 3s ease-in-out 1s infinite;
}
@keyframes cartIconIdle {
  0%, 100% { transform: rotate(0deg); }
  5% { transform: rotate(-8deg); }
  10% { transform: rotate(8deg); }
  15% { transform: rotate(0deg); }
}
.nav-cart-icon.shake {
  animation: cartIconShake 0.6s ease !important;
}
@keyframes cartIconShake {
  0%  { transform: rotate(0deg); }
  15% { transform: rotate(-18deg); }
  30% { transform: rotate(18deg); }
  45% { transform: rotate(-14deg); }
  60% { transform: rotate(14deg); }
  75% { transform: rotate(-8deg); }
  90% { transform: rotate(8deg); }
  100% { transform: rotate(0deg); }
}

/* 购物车红色徽章 */
.nav-cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #ff4d4f;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9px;
  line-height: 1;
  font-family: Arial, sans-serif;
  box-shadow: 0 1px 4px rgba(255, 77, 79, 0.4);
  margin-left: -2px;
  margin-top: 1px;
  flex-shrink: 0;
}
.nav-cart-badge.bump {
  animation: cartBadgeBump 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes cartBadgeBump {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.7); }
  55%  { transform: scale(0.85); }
  75%  { transform: scale(1.25); }
  90%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* 头像下拉菜单 */
.nav-user-wrap {
  position: relative;
  display: inline-block;
}
.nav-avatar-btn {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.2s ease;
}
.nav-avatar-btn:hover {
  box-shadow: 0 0 0 3px rgba(51, 133, 255, 0.25);
}
.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4e6ef2, #3385ff);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  padding: 16px;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
}
.nav-user-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.nav-user-dropdown-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.nav-user-dropdown-phone {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 12px;
}
.nav-user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 10px -16px;
}
.nav-user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  background: none;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-user-dropdown-item:hover {
  background: #f0f6ff;
  color: var(--primary);
}
.nav-user-dropdown-logout {
  color: var(--muted);
}
.nav-user-dropdown-logout:hover {
  background: #fff1f0;
  color: #ff4d4f;
}

body:not(.on-home) .header {
  position: sticky;
  background: #fff;
  border-bottom: none;
}

/* Main */
main {
  flex: 1 0 auto;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
}
body.on-home main {
  max-width: none;
  padding: 0;
}

.page { display: none; }
.page.active { display: block; }

/* ========== 首页 · 百度风格 ========== */
.home-page.active {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
}

body:not(.on-home) main {
  padding-top: 12px;
  max-width: min(1440px, 96vw);
  padding-left: 24px;
  padding-right: 24px;
}

h2 { font-size: 1.25rem; margin-bottom: 8px; font-weight: normal; }
.subtitle { color: var(--muted); margin-bottom: 20px; font-size: 13px; }

.bd-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px 60px;
  min-height: calc(100vh - 48px);
}

.bd-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  user-select: none;
}
.bd-logo-icon {
  width: 56px;
  height: 56px;
  line-height: 56px;
  text-align: center;
  font-size: 28px;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(135deg, #4e6ef2, #3385ff);
  border-radius: 12px;
}
.bd-logo-name {
  font-size: 32px;
  font-weight: 300;
  color: #222;
  letter-spacing: 2px;
}

.bd-search {
  display: flex;
  width: 100%;
  max-width: 640px;
  height: 44px;
  border: 2px solid var(--primary);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(51, 133, 255, 0.15);
}
.bd-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 18px;
  font-size: 16px;
  font-family: inherit;
}
.bd-search-btn {
  width: 108px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 1px;
}
.bd-search-btn:hover { background: var(--primary-dark); }

.bd-hot {
  margin-top: 20px;
  max-width: 640px;
  width: 100%;
  font-size: 13px;
  color: var(--muted);
  line-height: 2;
}
.bd-hot-label { margin-right: 4px; }
.bd-hot-item {
  background: none;
  border: none;
  color: var(--link);
  font-size: 13px;
  cursor: pointer;
  padding: 0 8px;
  font-family: inherit;
}
.bd-hot-item:hover { text-decoration: underline; }

.bd-cats {
  margin-top: 44px;
  max-width: 560px;
  width: 100%;
}

/* 品类导航 · 高级卡片 */
.cat-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  width: 100%;
}
@media (max-width: 680px) {
  .cat-nav { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 420px) {
  .cat-nav { grid-template-columns: repeat(3, 1fr); }
}
.cat-nav.bd-cats {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 420px) {
  .cat-nav.bd-cats { grid-template-columns: repeat(4, 1fr); gap: 8px; }
}

.bd-cats .cat-nav-item {
  padding: 8px 4px;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.bd-cats .cat-nav-item:hover {
  border: none;
  box-shadow: none;
  transform: translateY(-2px);
  background: none;
}
.bd-cats .cat-nav-item.accent:hover,
.bd-cats .cat-nav-item.hot:hover,
.bd-cats .cat-nav-item.active {
  border: none;
  background: none;
  box-shadow: none;
}
.bd-cats .cat-nav-icon-img {
  filter: none;
  opacity: 1;
}
.bd-cats .cat-nav-label {
  color: #333;
}
.bd-cats .cat-nav-item:hover .cat-nav-icon-img {
  transform: scale(1.06);
}

/* 方案货架 · 品类导航单行紧凑 */
.back-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: none;
  border: none;
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  border-radius: 8px;
  transition: color 0.2s ease;
}
.back-home:hover {
  color: var(--primary);
}
.back-home-icon {
  flex-shrink: 0;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-brand-icon {
  width: 48px;
  height: 48px;
  line-height: 48px;
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(135deg, #4e6ef2, #3385ff);
  border-radius: 11px;
  flex-shrink: 0;
}
.header-brand-name {
  font-size: 26px;
  font-weight: 300;
  color: #222;
  letter-spacing: 1.5px;
  white-space: nowrap;
}

.solutions-cats {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  max-width: 100%;
  width: 100%;
  margin: 0 0 20px;
  gap: 6px;
}
.solutions-cats .cat-nav-item {
  padding: 6px 4px;
  gap: 6px;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.solutions-cats .cat-nav-icon-img {
  width: 2.75rem;
  height: 2.75rem;
}
.solutions-cats .cat-nav-label {
  font-size: 13px;
}
.solutions-cats .cat-nav-item:hover {
  border: none;
  box-shadow: none;
  transform: translateY(-2px);
  background: none;
}
.solutions-cats .cat-nav-item.active,
.solutions-cats .cat-nav-item.accent:hover,
.solutions-cats .cat-nav-item.hot:hover {
  border: none;
  background: none;
  box-shadow: none;
}
.solutions-cats .cat-nav-icon-img {
  filter: none;
  opacity: 1;
  transition: transform 0.2s ease;
}
.solutions-cats .cat-nav-item:hover .cat-nav-icon-img,
.solutions-cats .cat-nav-item.active .cat-nav-icon-img {
  transform: scale(1.06);
}
.solutions-cats .cat-nav-item:not(.active) .cat-nav-label {
  color: #666;
}
.solutions-cats .cat-nav-item:hover .cat-nav-label,
.solutions-cats .cat-nav-item.active .cat-nav-label {
  color: var(--primary);
  font-weight: 600;
}
.solutions-cats .cat-nav-item.accent:hover .cat-nav-label,
.solutions-cats .cat-nav-item.accent.active .cat-nav-label {
  color: #7c3aed;
}

.cat-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 8px;
  background: #fff;
  border: 1px solid #e8ecf3;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  color: #333;
  transition: all 0.22s ease;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.cat-nav-item:hover {
  border-color: #b8d4ff;
  box-shadow: 0 8px 24px rgba(51, 133, 255, 0.12);
  transform: translateY(-2px);
}
.cat-nav-item.active {
  border-color: var(--primary);
  background: linear-gradient(180deg, #f0f6ff 0%, #fff 100%);
  box-shadow: 0 8px 20px rgba(51, 133, 255, 0.15);
}
.cat-nav-item.hot:hover { border-color: #ffb088; }
.cat-nav-item.hot.active { border-color: #ff6b35; background: linear-gradient(180deg, #fff5f0 0%, #fff 100%); }
.cat-nav-item.accent:hover { border-color: #c4b5fd; }
.cat-nav-item.accent.active { border-color: #7c3aed; background: linear-gradient(180deg, #faf5ff 0%, #fff 100%); }

.cat-nav-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.cat-nav-icon img,
.cat-nav-icon-img {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
  display: block;
}
.cat-nav-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.filter-bar-premium {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
  padding: 4px 0;
  background: transparent;
  border: none;
  flex-wrap: nowrap;
  overflow-x: auto;
}
@media (max-width: 680px) {
  .filter-bar-premium { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 420px) {
  .filter-bar-premium { grid-template-columns: repeat(3, 1fr); }
}
.filter-bar-premium .cat-nav-item {
  min-width: 0;
  flex-shrink: 0;
}
.filter-bar-premium .cat-nav-item.filter {
  padding: 16px 8px;
  background: #fff;
  border: 1px solid #e8ecf3;
  border-radius: 12px;
  color: #333;
}

.bd-slogan {
  margin-top: 48px;
  font-size: 16px;
  color: #999;
  letter-spacing: 0.5px;
}

.bd-footer {
  flex-shrink: 0;
  padding: 16px;
  text-align: center;
  border-top: none;
}
.bd-copyright {
  font-size: 13px;
  color: #aaa;
  line-height: 1.6;
  margin: 0;
}

/* 通用按钮 */
.btn {
  padding: 8px 20px;
  font-weight: normal;
  border-radius: 4px;
  font-family: inherit;
}
.btn.primary {
  background: var(--primary);
  color: #fff;
}
.btn.primary:hover { background: var(--primary-dark); }
.btn.outline {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn.outline:hover { border-color: var(--primary); color: var(--primary); }

.nav-btn, .cart-btn, .filter, .btn {
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  border-radius: 4px;
  transition: 0.2s;
  font-family: inherit;
}

/* Agent */
.agent-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
}
@media (max-width: 768px) {
  .agent-layout { grid-template-columns: 1fr; }
}

.agent-form {
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.agent-form label { font-size: 0.85rem; font-weight: 600; margin-top: 8px; }
.agent-form input, .agent-form select, .agent-form textarea {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}
.agent-form textarea { min-height: 80px; resize: vertical; }
.agent-form .btn { margin-top: 12px; }

.agent-chat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 360px;
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
}
.msg.bot {
  background: #f3f4f6;
  align-self: flex-start;
}
.msg.user {
  background: #e8f2ff;
  align-self: flex-end;
}
.msg .rec-card {
  margin-top: 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.msg .rec-card h4 { font-size: 0.95rem; margin-bottom: 4px; }
.msg .rec-card .price { color: var(--primary); font-weight: 700; }
.msg .rec-card .trust { color: var(--trust); font-size: 0.8rem; }

.agent-reply {
  line-height: 1.7;
  font-size: 0.9rem;
  color: #333;
}

/* Products */
.filter-bar { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.filter {
  padding: 6px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
}
.filter.active, .filter:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0f6ff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  width: 100%;
}
@media (max-width: 1200px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .product-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .solutions-cats {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 4px;
  }
  .solutions-cats .cat-nav-icon-img {
    width: 2.25rem;
    height: 2.25rem;
  }
  .solutions-cats .cat-nav-label {
    font-size: 11px;
  }
}

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.product-card:hover {
  box-shadow: 0 6px 20px rgba(51, 133, 255, 0.12);
  transform: translateY(-2px);
}
.product-card .cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #e8f2ff, #f5f9ff);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-card .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-card .cover .cover-emoji {
  font-size: 3rem;
  line-height: 1;
}
.product-card.hot-card {
  border-color: #b8d4ff;
  box-shadow: 0 2px 8px rgba(51, 133, 255, 0.1);
}
.product-card.hot-card .cover {
  background: linear-gradient(135deg, #e8f2ff, #f5f9ff);
}
.hot-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.9rem;
  background: var(--primary);
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  font-weight: 600;
}
.festival-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.88rem;
  background: #7c3aed;
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  font-weight: 600;
  line-height: 1.35;
  max-width: 58%;
  text-align: right;
}
.festival-bar,
.sub-bar {
  margin-top: -12px;
  margin-bottom: 20px;
  padding: 12px;
  border-radius: var(--radius);
}
#festival-bar {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  margin-bottom: 12px;
}
.cat-search-wrap {
  display: flex;
  max-width: 100%;
  height: 40px;
  margin-bottom: 20px;
  border: 1px solid #e4e7ed;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.cat-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
}
.cat-search-btn {
  width: 72px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.cat-search-btn:hover {
  background: var(--primary-dark);
}
#page-solutions.cat-gift .cat-search-wrap {
  border-color: #e9d5ff;
}
#page-solutions.cat-gift .cat-search-btn {
  background: #7c3aed;
}
#page-solutions.cat-gift .cat-search-btn:hover {
  background: #6d28d9;
}
#pet-bar {
  background: #fff7ed;
  border: 1px solid #fed7aa;
}
.pet-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.9rem;
  background: #f59e0b;
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  font-weight: 600;
}
.product-card.hot-card .pet-tag,
.product-card.hot-card .festival-tag {
  top: 42px;
}
.product-card .body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.product-card h3 { font-size: 1.3rem; margin-bottom: 8px; font-weight: 600; line-height: 1.35; }
.card-labels {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.hot-label {
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 700;
}
.festival-label {
  color: #7c3aed;
  font-size: 1.05rem;
  font-weight: 600;
}
.product-card .desc { font-size: 1.02rem; color: var(--muted); flex: 1; margin-bottom: 12px; line-height: 1.65; }
.product-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.product-card .price { color: var(--primary); font-size: 1.55rem; font-weight: 700; }
.product-card .trust-badge {
  font-size: 0.95rem;
  color: var(--trust);
  background: #ecfdf5;
  padding: 4px 10px;
  border-radius: 6px;
}
.product-card .merchant { font-size: 0.98rem; color: var(--muted); margin-bottom: 12px; }
.product-card .actions { display: flex; gap: 10px; }
.product-card .actions .btn { flex: 1; padding: 11px 8px; font-size: 1.02rem; }

/* 方案包详情 · 居中弹窗 */
.pkg-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  pointer-events: none;
}
.pkg-modal.open {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: auto;
}
.pkg-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.pkg-modal.open .pkg-modal-mask {
  opacity: 1;
}
.pkg-modal-panel {
  position: relative;
  width: min(400px, 100%);
  max-height: min(400px, 78vh);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  transform: scale(0.94);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
  z-index: 1;
}
.pkg-modal.open .pkg-modal-panel {
  transform: scale(1);
  opacity: 1;
}
.pkg-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  z-index: 2;
}
.pkg-modal-close:hover {
  background: #eee;
  color: #333;
}
.pkg-modal-header {
  padding: 14px 44px 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.pkg-modal-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.35;
}
.pkg-modal-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 4px;
  line-height: 1.45;
}
.pkg-modal-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}
.pkg-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}
.pkg-section + .pkg-section {
  margin-top: 14px;
}
.pkg-section-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
}
.pkg-confirmed-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pkg-confirmed-item {
  position: relative;
  padding: 10px 12px 10px 16px;
  background: #f8fafc;
  border: 1px solid #e8ecf3;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.4;
}
.pkg-confirmed-item::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}
.pkg-confirmed-name {
  font-weight: 500;
  color: #333;
}
.pkg-section-surprise .pkg-section-title {
  color: #7c3aed;
}
.pkg-surprise-box {
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, #faf5ff 0%, #fff7ed 100%);
  border: 1px dashed #c4b5fd;
  text-align: center;
}
.pkg-surprise-icon {
  display: block;
  font-size: 1.6rem;
  margin-bottom: 8px;
}
.pkg-surprise-text {
  font-size: 0.98rem;
  font-weight: 600;
  color: #5b21b6;
  line-height: 1.5;
  margin-bottom: 6px;
}
.pkg-surprise-note {
  font-size: 0.82rem;
  color: #9ca3af;
  line-height: 1.4;
}
.pkg-modal-footer {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  padding: 10px 16px 16px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.pkg-modal-footer .btn {
  flex: 1;
  padding: 10px 12px;
  font-size: 0.95rem;
}

/* Cart */
.cart-list, .order-list { display: flex; flex-direction: column; gap: 12px; }
.cart-item, .order-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.cart-item .info h4 { font-size: 0.95rem; }
.cart-item .info p { font-size: 0.82rem; color: var(--muted); }
.cart-footer {
  margin-top: 20px;
  padding: 20px;
  background: var(--card);
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.checkout-form {
  margin-top: 20px;
  padding: 20px;
  background: var(--card);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
}
.checkout-field { display: grid; gap: 6px; }
.checkout-field label { font-size: 0.85rem; color: var(--muted); }
.checkout-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.region-selects {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}
.region-select {
  width: 100%;
  padding: 8px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}
.total strong { color: var(--primary); font-size: 1.3rem; }

.order-card .status {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  background: #ecfdf5;
  color: var(--trust);
}
.order-card .status.after-sale { background: #fef3c7; color: #d97706; }
.order-actions { display: flex; gap: 8px; }

.empty { color: var(--muted); text-align: center; padding: 40px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1a2e;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  opacity: 0;
  transition: 0.3s;
  z-index: 200;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── 登录弹窗 ── */
.login-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: maskIn 0.22s ease;
}
.login-modal.open {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: auto;
}
.login-modal-mask {
  position: absolute;
  inset: 0;
}
@keyframes maskIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.login-modal-panel {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 20px;
  padding: 0;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08),
    0 24px 60px rgba(0,0,0,0.22),
    0 8px 24px rgba(0,0,0,0.12);
  z-index: 1;
  overflow: hidden;
  animation: panelIn 0.28s cubic-bezier(0.34, 1.26, 0.64, 1);
}
@keyframes panelIn {
  from { transform: scale(0.9) translateY(16px); opacity: 0; }
  to   { transform: scale(1) translateY(0);    opacity: 1; }
}

.login-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(0,0,0,0.06);
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #999;
  z-index: 10;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-modal-close:hover {
  background: rgba(0,0,0,0.14);
  color: #555;
}

/* 品牌头部 */
.auth-brand {
  text-align: center;
  padding: 36px 28px 24px;
  background: linear-gradient(160deg, #f0f5ff 0%, #ffffff 80%);
  border-bottom: 1px solid #eef2ff;
}
.auth-brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  filter: drop-shadow(0 6px 16px rgba(78,110,242,0.3));
}
.login-modal-panel h3 {
  font-size: 0;
  width: 0;
  height: 0;
  overflow: hidden;
}
.auth-brand h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 6px;
  letter-spacing: 1px;
}
.auth-brand-sub {
  font-size: 0.8rem;
  color: #8a8fa8;
  margin: 0;
  line-height: 1.5;
}

/* 表单区 */
.auth-form {
  padding: 24px 28px 0;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  background: #f8f9fc;
  border: 1.5px solid #e8eaf0;
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.auth-input-wrap:focus-within {
  border-color: #4e6ef2;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(78,110,242,0.12);
}
.auth-input-icon {
  display: flex;
  align-items: center;
  padding: 0 12px 0 14px;
  flex-shrink: 0;
  pointer-events: none;
}
.auth-input {
  flex: 1;
  height: 46px;
  border: none;
  background: transparent;
  padding: 0 14px 0 2px;
  font-size: 15px;
  font-family: inherit;
  color: #222;
  outline: none;
}
.auth-input::placeholder {
  color: #b0b4c4;
}
.auth-pwd-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  margin-right: 6px;
  flex-shrink: 0;
  color: #aaa;
  transition: color 0.2s;
  border-radius: 6px;
}
.auth-pwd-toggle:hover { color: #666; }
.auth-pwd-toggle.show-pwd #auth-pwd-lines { display: none; }

.auth-submit {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #4e6ef2, #5b7fff);
  border: none;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(78,110,242,0.35);
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}
.auth-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(78,110,242,0.42);
}
.auth-submit:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 4px 14px rgba(78,110,242,0.3);
}
.auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* 底部链接 */
.auth-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px 26px;
  flex-wrap: wrap;
}
.auth-dot {
  color: #d1d5db;
  font-size: 14px;
  user-select: none;
}
.auth-link {
  border: none;
  background: none;
  padding: 4px 6px;
  color: #8a8fa8;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  transition: color 0.2s;
  text-decoration: none;
}
.auth-link:hover { color: #555; }
.auth-link-primary {
  color: #4e6ef2;
  font-weight: 500;
}
.auth-link-primary:hover { color: #3b5bdb; }

/* 旧样式兼容 */
.login-modal-tip { display: none; }
.login-label    { display: none; }
.login-input    { display: none; }
.login-submit   { display: none; }

/* ===== 支付页面 ===== */
.payment-container {
  max-width: 420px;
  margin: 0 auto;
  padding: 12px 14px;
}

.payment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  position: relative;
}

.payment-header h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.payment-header .back-home {
  display: flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.payment-header .back-home:hover { color: var(--primary); }
.payment-header .back-home svg { flex-shrink: 0; }

/* 订单信息卡片 */
.payment-order-card {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.payment-order-title {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}

.payment-order-no {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.payment-order-items {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
  line-height: 1.5;
}

.payment-order-total {
  font-size: 14px;
  text-align: right;
  color: var(--muted);
}

.payment-order-total strong {
  font-size: 22px;
  color: #ff6600;
  font-weight: 600;
}

/* 收货信息卡片 */
.payment-address-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.payment-address-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.payment-address-info {
  font-size: 14px;
  color: var(--text);
}

.payment-address-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.payment-address-phone {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.payment-address-detail {
  color: var(--text);
  font-size: 13px;
}

/* 支付方式 */
.payment-methods {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.payment-methods-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.payment-method-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.payment-method-item:last-child { margin-bottom: 0; }
.payment-method-item:hover { border-color: var(--primary); }
.payment-method-item.selected { border-color: var(--primary); background: #e6f0ff; }
.payment-method-item input { display: none; }
.payment-method-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}
.payment-method-icon.small { width: 30px; height: 30px; }
.payment-method-icon img { width: 100%; height: 100%; object-fit: contain; }
.payment-method-name { flex: 1; font-size: 14px; color: var(--text); }
.payment-method-check { color: var(--primary); font-weight: bold; font-size: 15px; width: 20px; text-align: center; }

/* 支付按钮 */
.payment-btn {
  width: 100%;
  height: 44px;
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(135deg, #ff6600, #ff8533);
  border: none;
  border-radius: 22px;
  margin-bottom: 10px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(255, 102, 0, 0.35);
}

.payment-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 102, 0, 0.4);
}

.payment-btn:disabled {
  background: #ccc;
  box-shadow: none;
  cursor: not-allowed;
}

/* 协议 */
.payment-agreement {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 0;
}
.payment-agreement input[type="checkbox"] { width: 14px; height: 14px; cursor: pointer; }
.payment-agreement a { color: var(--primary); text-decoration: none; }

/* 支付页面容器，高度自适应，滚动在页面层而非容器内 */
#page-payment {
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
}

/* ===== 支付成功页面 ===== */
.payment-success {
  text-align: center;
  padding: 60px 20px;
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.payment-success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #34d399);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

.payment-success-title { font-size: 24px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.payment-success-sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }

.payment-success-info {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px 28px;
  margin-bottom: 32px;
  text-align: left;
  width: 100%;
  max-width: 320px;
}

.payment-success-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}
.payment-success-row:first-child { border-bottom: 1px dashed var(--border); }
.payment-success-label { font-size: 13px; color: var(--muted); }
.payment-success-value { font-size: 14px; color: var(--text); font-weight: 500; }

.payment-success-actions {
  display: flex;
  gap: 14px;
  width: 100%;
  max-width: 320px;
}
.payment-success-actions .btn { flex: 1; height: 44px; font-size: 15px; border-radius: 22px; }

/* ===== 客服浮层 ===== */
.cs-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: maskIn 0.22s ease;
}
.cs-overlay.open { display: flex; }
.cs-overlay[hidden] { display: none; }

.cs-panel {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08),
    0 24px 60px rgba(0,0,0,0.22),
    0 8px 24px rgba(0,0,0,0.12);
  overflow: hidden;
  animation: panelIn 0.28s cubic-bezier(0.34, 1.26, 0.64, 1);
}

.cs-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(0,0,0,0.07);
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #999;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.cs-close:hover { background: rgba(0,0,0,0.14); color: #555; }

.cs-tabs {
  display: flex;
  border-bottom: 1px solid #e8ecf3;
  background: #fafafa;
}
.cs-tab {
  flex: 1;
  padding: 14px 16px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: #888;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.cs-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: #fff;
}
.cs-tab:hover:not(.active) { color: #555; }

.cs-content { padding: 20px; }

/* 微信客服 */
.cs-wechat-wrap {
  text-align: center;
}
.cs-qr {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  border: 1px solid #e8ecf3;
  margin: 0 auto 16px;
  display: block;
  object-fit: cover;
  background: #f5f7fa;
}
.cs-wechat-tip {
  font-size: 14px;
  color: #333;
  margin-bottom: 6px;
  font-weight: 500;
}
.cs-wechat-tip.sub { font-size: 12px; color: #999; font-weight: normal; }

/* 留言表单 */
.cs-form { display: flex; flex-direction: column; gap: 14px; }
.cs-form-row { display: flex; flex-direction: column; gap: 5px; }
.cs-form-row label { font-size: 13px; color: #555; font-weight: 500; }
.cs-form-row input,
.cs-form-row select,
.cs-form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e4e7ed;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: #222;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fafafa;
  box-sizing: border-box;
}
.cs-form-row input:focus,
.cs-form-row select:focus,
.cs-form-row textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(51,133,255,0.1);
  background: #fff;
}
.cs-form-row textarea { resize: vertical; min-height: 80px; }
.cs-form-row select { appearance: none; cursor: pointer; }

.cs-submit-btn {
  width: 100%;
  height: 44px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 600;
  background: linear-gradient(135deg, #4e6ef2, #5b7fff);
  border: none;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(78,110,242,0.35);
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  font-family: inherit;
  letter-spacing: 1px;
  margin-top: 4px;
}
.cs-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(78,110,242,0.4);
}
.cs-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* 留言成功状态 */
.cs-success-msg {
  text-align: center;
  padding: 20px 0;
}
.cs-success-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #34d399);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  color: #fff;
  font-size: 28px;
}
.cs-success-title { font-size: 16px; font-weight: 600; color: #1a1a2e; margin-bottom: 6px; }
.cs-success-sub { font-size: 13px; color: #888; }
