/* ==========================================================================
   合久网络 · 站点增量样式
   1. 顶部导航（桌面横排 + 移动抽屉 + 服务下拉）
   2. 建站方案板块（三档方案 / 六项交付 / 做法对比）
   加载顺序必须在 style.css 与 extra.css 之后。
   ========================================================================== */

/* ---------- 1. 顶部导航 ---------- */
.nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__item { position: relative; }

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  color: rgba(246, 241, 231, .9);
  white-space: nowrap;
  transition: color .22s ease, background .22s ease;
}

.nav__link:hover,
.nav__link:focus-visible {
  color: var(--c-accent);
  background: rgba(246, 241, 231, .1);
}

.nav__link.is-active { color: var(--c-accent); }

.topbar.is-scrolled .nav__link { color: var(--c-text-2); }
.topbar.is-scrolled .nav__link:hover,
.topbar.is-scrolled .nav__link:focus-visible {
  color: var(--c-primary-deep);
  background: var(--c-bg-light);
}
.topbar.is-scrolled .nav__link.is-active {
  color: var(--c-primary-deep);
  background: var(--c-bg-light);
}

.nav__caret {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  transition: transform .22s ease;
}

/* 服务下拉 */
.nav__sub {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 210px;
  padding: 8px;
  list-style: none;
  margin: 0;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
  z-index: 5;
}

.nav__item--has-sub:hover .nav__sub,
.nav__item--has-sub:focus-within .nav__sub,
.nav__item--has-sub.is-open .nav__sub {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav__item--has-sub:hover .nav__caret,
.nav__item--has-sub.is-open .nav__caret { transform: rotate(180deg); }

.nav__sub a {
  display: block;
  padding: 10px 13px;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--c-text-2);
  transition: background .18s ease, color .18s ease;
}

.nav__sub a:hover,
.nav__sub a:focus-visible {
  background: var(--c-bg-light);
  color: var(--c-primary-deep);
}

.nav__sub small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--c-text-3);
  margin-top: 2px;
}

/* 汉堡按钮 */
.nav__cta { display: none; }

.nav-toggle {
  display: none;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid rgba(246, 241, 231, .3);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: border-color .22s ease, background .22s ease;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #F6F1E7;
  transition: transform .25s ease, opacity .2s ease, background .22s ease;
}

.topbar.is-scrolled .nav-toggle {
  border-color: var(--c-line);
  background: var(--c-bg-light);
}
.topbar.is-scrolled .nav-toggle span { background: var(--c-text-1); }

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 2. 建站方案板块 ---------- */
.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.plan {
  display: flex;
  flex-direction: column;
  padding: 30px 26px;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.plan:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #DECBA8;
}

.plan--featured {
  border-color: var(--c-primary);
  box-shadow: var(--shadow);
  position: relative;
}

.plan__badge {
  position: absolute;
  top: -13px;
  left: 26px;
  padding: 4px 13px;
  border-radius: 999px;
  background: var(--c-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}

.plan__name {
  font-size: 21px;
  font-weight: 800;
  color: var(--c-text-1);
  margin: 0 0 6px;
  letter-spacing: .01em;
}

.plan__fit {
  font-size: 14px;
  line-height: 1.7;
  color: var(--c-text-3);
  margin: 0 0 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--c-line);
}

.plan__list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  gap: 11px;
}

.plan__list li {
  position: relative;
  padding-left: 24px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--c-text-2);
}

.plan__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--c-primary);
  border-bottom: 2px solid var(--c-primary);
  transform: rotate(-45deg);
}

.plan__list li.is-off { color: var(--c-text-3); }
.plan__list li.is-off::before {
  border-color: var(--c-line);
  transform: none;
  top: 9px;
  width: 11px;
  height: 2px;
  border-left: 0;
  border-bottom: 2px solid var(--c-line);
}

.plan__foot {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--c-line);
}

.plan__note {
  font-size: 13px;
  color: var(--c-text-3);
  line-height: 1.65;
  margin: 0 0 14px;
}

/* 六项交付 */
.deliver {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 44px;
}

.deliver__item {
  padding: 22px 20px;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
}

.deliver__item h4 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 8px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--c-text-1);
}

.deliver__no {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--c-bg-light);
  color: var(--c-primary-deep);
  font-size: 12px;
  font-weight: 800;
}

.deliver__item p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--c-text-3);
}

/* 做法对比表 */
.cmp-wrap {
  margin-top: 44px;
  overflow-x: auto;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  background: #fff;
}

.cmp {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 14.5px;
}

.cmp th,
.cmp td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--c-line);
  text-align: left;
  vertical-align: top;
  line-height: 1.7;
}

.cmp thead th {
  background: var(--c-bg-light);
  color: var(--c-text-1);
  font-weight: 700;
  white-space: nowrap;
}

.cmp thead th:last-child { color: var(--c-primary-deep); }

.cmp td:first-child {
  font-weight: 700;
  color: var(--c-text-1);
  white-space: nowrap;
}

.cmp td:not(:first-child) { color: var(--c-text-3); }
.cmp td:last-child { color: var(--c-text-2); }
.cmp tbody tr:last-child td { border-bottom: 0; }
.cmp tbody tr:nth-child(even) { background: #FCFBF7; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .nav__link { padding: 9px 10px; font-size: 14.5px; }
}

@media (max-width: 980px) {
  /* 移动端顶栏只留品牌与汉堡：电话与 CTA 收进抽屉。
     汉堡用绝对定位钉在右侧，不参与 flex 分配，避免被挤出视口。 */
  .topbar__inner { gap: 12px; position: relative; padding-right: 54px; }
  .topbar__aside { display: none; }
  .nav-toggle {
    display: flex;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
  }
  .nav__cta { display: flex; margin-top: 18px; }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex: none;
    display: block;
    padding: 12px 20px 22px;
    background: #fff;
    border-bottom: 1px solid var(--c-line);
    box-shadow: 0 18px 40px rgba(28, 26, 22, .12);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .24s ease, transform .24s ease, visibility .24s;
    z-index: 99;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav__list { display: block; }

  .nav__item { border-bottom: 1px solid var(--c-line); }
  .nav__item:last-child { border-bottom: 0; }

  .nav__link {
    width: 100%;
    justify-content: space-between;
    padding: 15px 4px;
    font-size: 16px;
    color: var(--c-text-1);
    border-radius: 0;
  }

  .topbar.is-scrolled .nav__link { color: var(--c-text-1); }

  .nav__link:hover,
  .nav__link:focus-visible,
  .topbar.is-scrolled .nav__link:hover {
    background: transparent;
    color: var(--c-primary-deep);
  }

  .nav__link.is-active { color: var(--c-primary-deep); }

  .nav__sub {
    position: static;
    transform: none;
    min-width: 0;
    padding: 0 0 10px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    display: none;
  }

  .nav__item--has-sub.is-open .nav__sub { display: block; }

  .nav__item--has-sub:hover .nav__sub { display: none; }
  .nav__item--has-sub.is-open:hover .nav__sub { display: block; }

  .nav__sub a {
    padding: 11px 16px;
    font-size: 15px;
    background: var(--c-bg-light);
    margin-bottom: 6px;
  }

  .nav__caret { width: 15px; height: 15px; }

  .plans { grid-template-columns: 1fr; }
  .deliver { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .deliver { grid-template-columns: 1fr; }
  .plan { padding: 26px 22px; }
  .cmp { font-size: 13.5px; }
  .cmp th, .cmp td { padding: 12px 14px; }
}

/* 导航项从 6 个增加到 7 个后，1200px 以下的横向空间不够，
   收紧菜单内边距并隐藏电话的副标题，避免与电话号码相撞。 */
@media (max-width: 1200px) {
  .nav__list { gap: 0; }
  .nav__link { padding: 9px 8px; font-size: 14px; }
  .topbar__aside { gap: 12px; }
  .topbar__phone small { display: none; }
  .topbar__divider { display: none; }
}
