/* ==========================================================================
   公司官网首页模板 —— 样式表
   参照通用在线旅游网站布局重写，配色可在此统一调整。
   TODO: 若要换成贵司品牌色，只需修改下方 :root 里的变量。
   ========================================================================== */

:root {
  /* 品牌色 */
  --brand: #00be88;
  --brand-dark: #00a878;
  --brand-light: #e5f8f3;
  /* 点缀色 */
  --accent: #ff8844;
  --accent-2: #ffa650;
  /* 价格红 */
  --price: #ff4d4f;
  /* 文字 */
  --text: #333;
  --text-2: #666;
  --text-3: #999;
  /* 边框与背景 */
  --border: #e8e8e8;
  --bg: #ffffff;
  --bg-gray: #f1f4f9;
  /* 布局 */
  --container: 1200px;
  --radius: 6px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 15px;
}

/* ============ 顶部栏 ============ */
.topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  height: 84px;
  gap: 24px;
}
.logo { flex: 0 0 auto; }
.logo img { height: 56px; width: auto; }

.search-box {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  height: 42px;
  border: 2px solid var(--brand);
  border-radius: var(--radius);
}
.search-city {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
  padding: 0 12px;
  background: var(--brand-light);
  color: var(--brand-dark);
  cursor: pointer;
  white-space: nowrap;
  border-radius: calc(var(--radius) - 2px) 0 0 calc(var(--radius) - 2px);
}
.search-city__label { color: var(--text-3); font-size: 12px; }
.search-city__value { font-weight: 600; }
.caret {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--brand-dark);
}

/* 出发地下拉面板 */
.search-city__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
  display: none;
  z-index: 300;
}
.search-city.is-open .search-city__dropdown { display: block; }
.search-city__option {
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  border-radius: 4px;
  white-space: nowrap;
}
.search-city__option:hover { background: var(--brand-light); color: var(--brand-dark); }
.search-city__option.is-active { background: var(--brand); color: #fff; }
.search-input {
  flex: 1;
  height: 100%;
  border: none;
  outline: none;
  padding: 0 12px;
  font-size: 14px;
}
.search-btn {
  height: 100%;
  padding: 0 22px;
  border: none;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  border-radius: 0 calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0;
}
.search-btn:hover { background: var(--brand-dark); }

.service {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 12px;
}
.service__phone { color: var(--accent); font-weight: 600; }
.service__online { color: var(--text-3); cursor: pointer; }
.service__online:hover { color: var(--brand); }

/* ============ 主导航 ============ */
.main-nav { background: var(--brand); }
.main-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
}
.main-nav__list { display: flex; height: 100%; }
.main-nav__item { height: 100%; }
.main-nav__item a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 18px;
  color: #fff;
  font-size: 15px;
}
.main-nav__item a:hover,
.main-nav__item.is-active a { background: rgba(0, 0, 0, 0.12); }
.main-nav__user { display: flex; gap: 14px; }
.main-nav__user a { color: #fff; font-size: 13px; }
.main-nav__user a:hover { text-decoration: underline; }

/* ============ 移动端导航汉堡按钮（由 topbar.js 注入） ============ */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  background: none;
  border: none;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: #fff;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.main-nav.is-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.main-nav.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
.main-nav.is-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============ 轮播 ============ */
.hero { margin-top: 16px; }
.carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.carousel__track { display: flex; transition: transform 0.5s ease; }
.carousel__slide { flex: 0 0 100%; }
.carousel__slide img { width: 100%; height: 340px; object-fit: cover; }
.carousel__dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}
.carousel__dots .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}
.carousel__dots .dot.is-active { background: #fff; }
.carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 60px;
  border: none;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 26px;
  opacity: 0;
  transition: opacity 0.3s;
}
.carousel:hover .carousel__arrow { opacity: 1; }
.carousel__arrow--prev { left: 0; border-radius: 0 var(--radius) var(--radius) 0; }
.carousel__arrow--next { right: 0; border-radius: var(--radius) 0 0 var(--radius); }

/* ============ 轮播 + 左侧分类导航（仿 ctish 楼梯式分类） ============ */
.hero-layout {
  display: flex;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-cats {
  flex: 0 0 200px;
  background: #2b3648;
}
.hero-cats ul {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.hero-cats li {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.hero-cats li::after {
  content: '›';
  font-size: 20px;
  opacity: 0.55;
}
.hero-cats li:hover,
.hero-cats li.is-active { background: var(--brand); }
.hero-main { flex: 1; position: relative; min-width: 0; }
.hero-layout .carousel { border-radius: 0; box-shadow: none; }

/* ============ 多级菜单 ============ */
.mega-menu {
  position: relative;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.mega-menu__tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.mega-menu__tab {
  padding: 12px 20px;
  font-size: 15px;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.mega-menu__tab:hover { color: var(--brand); }
.mega-menu__tab.is-active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}
.mega-menu__panels {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: none;
  background: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 18px 22px;
  overflow: auto;
}
.mega-menu__panels.is-open { display: block; }
.mega-menu__panel { display: none; }
.mega-menu__panel.is-active { display: block; }
.menu-group { margin-bottom: 12px; }
.menu-group:last-child { margin-bottom: 0; }
.menu-group__title { font-size: 13px; color: var(--text-3); margin-bottom: 6px; }
.menu-group__links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.menu-group__links a { color: var(--text-2); }
.menu-group__links a:hover { color: var(--brand); }

/* ============ 通用板块 ============ */
.section { margin-top: 28px; }
.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.section-title {
  font-size: 20px;
  font-weight: 700;
  padding-left: 10px;
  border-left: 4px solid var(--brand);
}
.section-tabs { display: flex; gap: 6px; }
.section-tab {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-2);
}
.section-tab.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* 倒计时 */
.countdown { margin-left: auto; color: var(--text-2); font-size: 13px; }
.countdown__num {
  display: inline-block;
  min-width: 22px;
  padding: 1px 4px;
  margin: 0 2px;
  text-align: center;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  font-weight: 600;
}

/* ============ 产品网格与卡片 ============ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.product-grid--6 { grid-template-columns: repeat(6, 1fr); }

.product-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.3s, transform 0.3s;
}
.product-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}
.product-card__pic { position: relative; display: block; overflow: hidden; }
.product-card__pic img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.product-card:hover .product-card__pic img { transform: scale(1.06); }
.product-card__tag {
  position: absolute;
  top: 8px; left: 8px;
  padding: 1px 8px;
  font-style: normal;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-radius: 3px;
}
.product-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
  margin: 8px 10px 0;
  color: var(--text);
  font-size: 13px;
}
.product-card__title:hover { color: var(--brand); }
.product-card__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 8px 10px 10px;
}
.product-card__price { color: var(--price); font-size: 13px; }
.product-card__price em { font-style: normal; font-size: 18px; font-weight: 700; }
.product-card__from { color: var(--text-3); font-size: 12px; }

/* ============ 页脚 ============ */
.footer {
  margin-top: 40px;
  background: #2b2b2b;
  color: #bbb;
  padding: 36px 0 24px;
  font-size: 13px;
}
.footer-cols {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}
.footer-col { flex: 1 1 160px; }
.footer-col__title {
  color: #fff;
  font-size: 15px;
  margin-bottom: 14px;
}
.footer-col a { display: block; margin-bottom: 8px; color: #bbb; }
.footer-col a:hover { color: var(--brand); }
.footer-col--subscribe { flex: 1 1 260px; }
.subscribe { display: flex; margin-bottom: 12px; }
.subscribe input {
  flex: 1;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #555;
  border-right: none;
  background: #333;
  color: #ddd;
  outline: none;
}
.subscribe button {
  height: 36px;
  padding: 0 16px;
  border: none;
  background: var(--brand);
  color: #fff;
}
.footer-col__phone { color: var(--accent-2); }
.footer-col--qr img { width: 90px; height: 90px; margin-bottom: 6px; }
.footer-bottom {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #444;
  color: #888;
  text-align: center;
  line-height: 1.8;
}
.footer-bottom a { color: #999; }
.footer-bottom a:hover { color: var(--brand); }

/* ============ 悬浮导航 ============ */
.float-nav {
  position: fixed;
  right: 12px;
  bottom: 120px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}
.float-nav__item {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
  box-shadow: var(--shadow);
}
.float-nav__item:hover { color: var(--brand); border-color: var(--brand); }
.float-nav__item.back-top { background: var(--brand); color: #fff; border: none; }
.float-nav__item.back-top:hover { background: var(--brand-dark); }

/* ============ 小程序二维码弹窗 ============ */
.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
}
.qr-modal.is-open { display: flex; }
.qr-modal__box {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 28px 32px 24px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.qr-modal__close {
  position: absolute;
  top: 6px;
  right: 12px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: #999;
  cursor: pointer;
}
.qr-modal__box img {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  border-radius: 6px;
}
.qr-modal__box p { margin-top: 12px; font-size: 15px; color: var(--text); }
.qr-modal__box .qr-modal__sub { margin-top: 4px; font-size: 12px; color: var(--text-3); }

/* ============ 左侧悬浮导航条（首页，滚动后淡入） ============ */
.cat-float-nav {
  position: fixed;
  top: 150px;
  left: calc(50% - 700px);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}
.cat-float-nav.is-visible { opacity: 1; visibility: visible; }
.cat-float-nav ul {
  width: 88px;
  max-height: 70vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cat-float-nav li { border-bottom: 1px solid #f0f0f0; }
.cat-float-nav li:last-child { border-bottom: none; }
.cat-float-nav li a {
  display: block;
  height: 34px;
  line-height: 34px;
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
}
.cat-float-nav li a:hover { color: var(--brand); background: var(--brand-light); }
@media (max-width: 1400px) {
  .cat-float-nav { display: none; }
}

/* ============ 首页：主题推荐 / 服务保障 ============ */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.theme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 160px;
  padding: 18px;
  border-radius: var(--radius);
  color: #fff;
  overflow: hidden;
  background: linear-gradient(135deg, #ffa650, #ff6b6b);
  transition: transform 0.3s, box-shadow 0.3s;
}
.theme-card:nth-child(2) { background: linear-gradient(135deg, #4aa3ff, #5b6bd0); }
.theme-card:nth-child(3) { background: linear-gradient(135deg, #00be88, #2f9a7c); }
.theme-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.theme-card__tag {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 2px 10px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
}
.theme-card__title { font-size: 20px; font-weight: 700; }
.theme-card__desc { margin-top: 6px; font-size: 13px; opacity: 0.85; }

.trust-row {
  display: flex;
  gap: 16px;
  padding: 22px 20px;
  background: var(--bg-gray);
  border-radius: var(--radius);
}
.trust-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}
.trust-item__icon {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}
.trust-item b { font-size: 15px; color: var(--text); }
.trust-item p { margin-top: 2px; font-size: 12px; color: var(--text-3); }
@media (max-width: 768px) {
  .theme-grid { grid-template-columns: 1fr; }
  .trust-row { flex-wrap: wrap; }
  .trust-item { flex: 1 1 40%; }
}

/* ============ 响应式（窄屏折叠导航、网格降列） ============ */
@media (max-width: 992px) {
  .product-grid--6 { grid-template-columns: repeat(3, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .topbar-inner { height: auto; flex-wrap: wrap; padding: 10px 15px; }
  .logo img { height: 46px; }
  .search-box { flex: 1 1 100%; min-width: 0; margin-top: 10px; }
  .service { display: none; }

  /* 主导航：汉堡菜单 + 竖向展开（仅当 JS 注入按钮后生效） */
  .main-nav.has-toggle .main-nav__inner { flex-wrap: wrap; height: auto; min-height: 44px; }
  .main-nav.has-toggle .nav-toggle { display: flex; }
  .main-nav.has-toggle .main-nav__list {
    flex: 1 1 100%;
    flex-direction: column;
    height: auto;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .main-nav.has-toggle.is-open .main-nav__list { max-height: 440px; }
  .main-nav.has-toggle .main-nav__item { height: auto; }
  .main-nav.has-toggle .main-nav__item a {
    display: flex;
    align-items: center;
    height: auto;
    padding: 11px 4px;
    font-size: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }
  .main-nav.has-toggle .main-nav__item:first-child a { border-top: none; }
  .main-nav__user { display: none; }

  .hero-cats { display: none; }
  .carousel__slide img { height: 200px; }
  .section-head { flex-wrap: wrap; }
  .section-title { font-size: 18px; }
  .product-grid--6 { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .float-nav { bottom: 60px; }
}
