/* ==========================================================================
   公共样式 — 布局容器 / 按钮 / 头部 / 页脚 / 通用组件 / 响应式
   移动端策略：≤768px 切换单栏，隐藏次要装饰，侧栏内容下移
   ========================================================================== */

/* ---------- 容器与栅格 ---------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-gutter);
  overflow-x: hidden;
}

.section {
  padding: var(--section-padding) 0;
  overflow-x: clip;
}

.section--alt {
  background-color: var(--color-bg-alt);
}

.section--dark {
  background-color: var(--color-bg-dark);
  color: #fff;
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark p {
  color: #fff;
}

/* 区块标题 */
.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto var(--space-7);
}

.section-head__eyebrow {
  display: inline-block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-3);
}

.section-head__title {
  font-size: var(--fs-3xl);
  margin-bottom: var(--space-4);
}

.section-head__desc {
  font-size: var(--fs-md);
  color: var(--color-text-light);
  line-height: var(--lh-relaxed);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.75rem 1.75rem;
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  cursor: pointer;
  white-space: nowrap;
  border: 2px solid transparent;
  line-height: 1.2;
}

.btn--primary {
  background-color: var(--color-primary);
  color: #fff;
}

.btn--primary:hover {
  background-color: var(--color-primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--accent {
  background-color: var(--color-accent);
  color: #fff;
}

.btn--accent:hover {
  background-color: var(--color-accent-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--ghost {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--ghost:hover {
  background-color: var(--color-primary);
  color: #fff;
}

.btn--ghost-light {
  background-color: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}

.btn--ghost-light:hover {
  background-color: #fff;
  color: var(--color-primary-dark);
}

.btn--lg {
  padding: 1rem 2.5rem;
  font-size: var(--fs-md);
}

.btn--sm {
  padding: 0.5rem 1.25rem;
  font-size: var(--fs-sm);
}

/* ---------- 头部导航 ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background-color: #fff;
  border-bottom: 1px solid var(--color-border-light);
  height: var(--header-height);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  height: 100%;
  position: relative;
}

.header__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.header__logo img {
  height: 72px;
  width: auto;
  display: block;
}

/* 旧版文字 logo 样式已废弃，保留空规则防止报错 */

/* 主导航 */
.nav {
  flex: 1;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.nav__list {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--space-1);
}

.nav__item {
  position: relative;
}

.nav__link {
  display: block;
  padding: 0.5rem 1rem;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--color-text-2);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav__link:hover,
.nav__item.is-active > .nav__link {
  color: var(--color-primary);
  background-color: rgba(10, 77, 140, 0.06);
}

/* 二级下拉 */
.nav__sub {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background-color: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-base);
}

.nav__item:hover > .nav__sub {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav__sublink {
  display: block;
  padding: 0.625rem 0.75rem;
  font-size: var(--fs-sm);
  color: var(--color-text-2);
  border-radius: var(--radius-sm);
}

.nav__sublink:hover {
  background-color: var(--color-bg-alt);
  color: var(--color-primary);
}

/* 头部右侧操作 */
.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* 移动端菜单按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- 页脚 ---------- */
.footer {
  background-color: var(--color-bg-dark);
  color: rgba(255, 255, 255, 0.8);
  padding-top: var(--space-8);
  overflow-x: clip;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: var(--space-6);
  padding-bottom: var(--space-7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer__col h3 {
  color: #fff;
  font-size: var(--fs-md);
  margin-bottom: var(--space-5);
}

.footer__text {
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-4);
}

.footer__contact p {
  font-size: var(--fs-sm);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.footer__links li {
  margin-bottom: var(--space-3);
}

.footer__links a {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.7);
  transition: all var(--transition-fast);
}

.footer__links a:hover {
  color: var(--color-accent);
  padding-left: 4px;
}

/* 订阅表单 */
.subscribe {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.subscribe input {
  flex: 1;
  padding: 0.75rem 1rem;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: var(--fs-sm);
  min-width: 0;
}

.subscribe input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.subscribe input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  font-size: var(--fs-sm);
}

.footer__legal {
  display: flex;
  gap: var(--space-5);
}

.footer__legal a:hover {
  color: var(--color-accent);
}

/* ---------- 页面头图（列表页/单页通用） ---------- */
.page-hero {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: #fff;
  padding: var(--space-6) 0;
  text-align: center;
}

.page-hero__title {
  font-size: var(--fs-xl);
  color: #fff;
  margin-bottom: var(--space-2);
}

.page-hero__desc {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.85);
  max-width: 640px;
  margin: 0 auto;
  line-height: var(--lh-relaxed);
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  background-color: var(--color-bg-alt);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--color-text-light);
}

.breadcrumb__list a {
  color: var(--color-text-light);
}

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

.breadcrumb__sep {
  color: var(--color-border);
}

.breadcrumb__current {
  color: var(--color-text);
  font-weight: var(--fw-medium);
}

/* ---------- CTA 行动召唤区块（通用，全站共用） ---------- */
.cta {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  text-align: center;
  color: #fff;
  padding: var(--space-7) 0;
}

.cta__title {
  font-size: var(--fs-3xl);
  color: #fff;
  margin-bottom: var(--space-5);
}

.cta__desc {
  font-size: var(--fs-md);
  color: rgba(255, 255, 255, 0.9);
  max-width: 600px;
  margin: 0 auto var(--space-6);
  line-height: var(--lh-relaxed);
}

.cta__actions {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ---------- 通用卡片 ---------- */
.card {
  background-color: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-base);
}

/* ---------- FAQ 折叠区块（通用，首页和详情页共用） ---------- */
.faq {
  background-color: var(--color-bg-alt);
}

.faq__list {
  max-width: 960px;
  margin: 0 auto;
}

.faq__item {
  background-color: #fff;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition-fast);
}

.faq__item:hover {
  box-shadow: var(--shadow-sm);
}

.faq__question {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  text-align: left;
  gap: var(--space-3);
}

.faq__question::after {
  content: '+';
  font-size: var(--fs-xl);
  color: var(--color-primary);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.faq__item.is-open .faq__question::after {
  content: '−';
}

.faq__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
}

.faq__item.is-open .faq__answer {
  max-height: 500px;
}

.faq__answer-inner {
  padding: 0 var(--space-5) var(--space-4);
  font-size: var(--fs-sm);
  color: var(--color-text-2);
  line-height: var(--lh-relaxed);
}

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

/* ---------- 浮动联系栏 ---------- */
.floatbar {
  position: fixed;
  right: 20px;
  bottom: 80px;
  z-index: var(--z-dropdown);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.floatbar__item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
  color: #fff;
  font-size: 1.25rem;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  position: relative;
}

/* PC 端隐藏文字标签，只显示图标 */
.floatbar__label {
  display: none;
}

.floatbar__item:hover {
  background-color: var(--color-accent);
  transform: scale(1.1);
}

.floatbar__item--wa {
  background-color: #25d366;
}

.floatbar__backtop {
  background-color: var(--color-text-light);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.floatbar__backtop.is-visible {
  opacity: 1;
  visibility: visible;
}

/* ---------- 工具类 ---------- */
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

/* 隐藏元素工具类 */
.hide-mobile { display: block; }
.hide-desktop { display: none; }

/* ==========================================================================
   响应式断点
   - ≤1024px: 平板（导航开始压缩）
   - ≤768px:  手机（单栏、汉堡菜单、隐藏次要内容）
   - ≤480px:  小屏手机（进一步紧凑）
   ========================================================================== */

/* ---- 平板横屏及以下 ---- */
@media (max-width: 1024px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }

  .header__actions .btn--ghost {
    display: none;
  }
}

/* ---- 手机端核心适配 ---- */
@media (max-width: 768px) {
  /* 容器边距收紧 */
  .container {
    padding: 0 var(--space-4);
  }

  /* 移动端 logo 缩小 */
  .header__logo img {
    height: 56px;
  }

  /* 页面头图移动端缩小 */
  .page-hero {
    padding: var(--space-5) 0;
  }

  .page-hero__title {
    font-size: var(--fs-lg);
  }

  /* 移动端去掉 backdrop-filter，避免影响 fixed 定位的导航 */
  .header {
    backdrop-filter: none;
    background-color: #fff;
  }

  /* 移动端导航：下拉面板式，从 header 下方展开 */
  .nav {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    display: block !important;
    height: auto !important;
    background-color: #fff !important;
    padding: 0 !important;
    transform: translateY(-10px) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s ease !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12) !important;
    border-bottom: 1px solid #e2e8f0 !important;
    z-index: 100 !important;
    flex: none !important;
  }

  .nav.is-open {
    transform: translateY(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }

  .nav__link {
    padding: 0.875rem var(--space-5);
    font-size: var(--fs-md);
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* 有子菜单的项：箭头指示 */
  .nav__item--has-sub > .nav__link::after {
    content: '▾';
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    color: var(--color-text-3);
  }

  .nav__item--has-sub.is-expanded > .nav__link::after {
    transform: rotate(180deg);
  }

  .nav__sub {
    position: static;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transform: none;
    box-shadow: none;
    padding: 0 var(--space-5);
    min-width: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
  }

  .nav__item.is-expanded > .nav__sub {
    opacity: 1;
    visibility: visible;
    max-height: 500px;
  }

  .nav__sublink {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--color-border-light);
  }

  .nav-toggle {
    display: flex;
  }

  /* 头部操作区：只保留主按钮 */
  .header__actions {
    gap: var(--space-2);
  }

  .header__actions .btn {
    padding: 0.5rem 1rem;
    font-size: var(--fs-sm);
  }

  /* 页脚：2列布局，About Sun Young 占满整行 */
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
  }

  .footer__col:first-child {
    grid-column: 1 / -1;
  }

  .footer__col:last-child {
    grid-column: 1 / -1;
  }

  .footer__col h3 {
    font-size: var(--fs-sm);
    margin-bottom: var(--space-3);
  }

  .footer__text {
    font-size: var(--fs-xs);
    margin-bottom: var(--space-3);
  }

  .footer__contact p {
    font-size: var(--fs-xs);
    margin-bottom: var(--space-1);
  }

  .footer__links li {
    margin-bottom: var(--space-2);
  }

  .footer__links a {
    font-size: var(--fs-xs);
  }

  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer__legal {
    justify-content: center;
  }

  /* 手机端：右侧浮动栏改为底部横向固定 CTA 栏 */
  .floatbar {
    right: 0;
    left: 0;
    bottom: 0;
    flex-direction: row;
    justify-content: stretch;
    gap: 0;
    padding: 0;
    background-color: #fff;
    box-shadow: 0 -2px 12px rgba(15, 30, 51, 0.12);
    border-top: 1px solid var(--color-border-light);
    z-index: var(--z-sticky);
  }

  /* 底部留空，防止浮动栏遮挡内容 */
  .footer {
    padding-bottom: 56px;
  }

  .floatbar__item {
    flex: 1;
    height: 56px;
    border-radius: 0;
    font-size: 0.875rem;
    gap: 4px;
    flex-direction: column;
    box-shadow: none;
    position: relative;
  }

  .floatbar__item span,
  .floatbar__item {
    font-size: 0.6875rem;
    font-weight: var(--fw-medium);
    line-height: 1.2;
  }

  /* 底部栏配色：WhatsApp绿 / Email蓝 / Get Quote橙 */
  .floatbar__item:nth-child(1) {
    background-color: #25d366;
  }

  .floatbar__item:nth-child(2) {
    background-color: var(--color-primary);
  }

  .floatbar__item:nth-child(3) {
    background-color: var(--color-accent);
  }

  .floatbar__backtop {
    display: none;
  }

  /* 浮动栏文字标签：手机端显示 */
  .floatbar__label {
    display: block;
    font-size: 0.6875rem;
    font-weight: var(--fw-semibold);
  }

  /* 隐藏工具类生效 */
  .hide-mobile { display: none !important; }
  .hide-desktop { display: block !important; }

  /* 区块间距收紧 */
  .section {
    padding: var(--space-7) 0;
  }

  .section-head {
    margin-bottom: var(--space-6);
  }

  /* FAQ 移动端紧凑 */
  .faq__question {
    padding: var(--space-3) var(--space-4);
    font-size: var(--fs-sm);
  }

  .faq__answer-inner {
    padding: 0 var(--space-4) var(--space-3);
  }
}

/* ---- 小屏手机 ---- */
@media (max-width: 480px) {
  .header__logo img {
    height: 48px;
  }
  .subscribe {
    flex-direction: column;
  }

  .btn--lg {
    padding: 0.875rem 1.75rem;
  }

  /* 小屏页脚：隐藏订阅区块，减少高度 */
  .footer__col:last-child {
    display: none;
  }
}
