/* 站点框架：导航、移动菜单、页脚和联系浮层。 */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 900;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--white);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 300;
  height: var(--header-h);
  border-bottom: 1px solid var(--line-soft);
  background: var(--white);
}

.header__inner,
.header__actions,
.main-nav,
.brand,
.header__login {
  display: flex;
  align-items: center;
}

.header__inner {
  height: 100%;
  gap: 24px;
}

.brand {
  flex-shrink: 0;
}

.brand__logo {
  width: auto;
  height: 28px;
}

.main-nav {
  flex: 1;
  justify-content: flex-end;
  gap: 24px;
}

.main-nav a,
.header__login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 13px;
}

.main-nav a:hover,
.main-nav a.is-current {
  color: var(--gold-ink);
}

.nav-ico {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header__actions {
  gap: 16px;
}

.header__login {
  min-height: 32px;
  padding: 5px 11px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.2;
}

.header__login {
  gap: 5px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
}

.header__login .nav-ico {
  width: 15px;
  height: 15px;
}

.header__login:hover {
  border-color: var(--gold);
  color: var(--gold-light);
}

.header__user {
  display: none;
}

html.auth-in .header__user {
  display: block;
}

html.auth-in .header__login {
  display: none;
}

.header__avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
}

.account-menu {
  position: relative;
}

.account-menu__trigger {
  list-style: none;
  cursor: pointer;
}

.account-menu__trigger::-webkit-details-marker {
  display: none;
}

.account-menu__items {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  min-width: 160px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.account-menu__items > a,
.account-menu__items > button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 13px;
  text-align: left;
}

.account-menu__items > :is(a, button):hover {
  background: var(--gold-wash);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 0;
  background: transparent;
}

.menu-toggle span {
  width: 24px;
  height: 1px;
  background: var(--ink);
}

.mobile-menu {
  display: none;
}

.site-footer {
  position: relative;
  overflow: hidden;
  padding: 56px 0 24px;
  background: var(--navy);
  color: var(--paper);
}

.site-footer__watermark {
  display: none;
}

.site-footer__top {
  display: block;
}

.site-footer .brand__logo {
  height: 32px;
}

.site-footer__brand > p,
.site-footer__bottom {
  font-size: 12px;
  color: #f7f3eab3;
}

.site-footer__brand > p {
  margin-top: 16px;
}

.site-footer a:hover {
  color: var(--gold-light);
}

.site-footer__follow,
.site-footer__follow-links,
.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
}

.footer-follow {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid #f7f3ea29;
}

.site-footer__bottom p {
  margin: 0;
}

.contact-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
}

.contact-fab svg {
  width: 20px;
  height: 20px;
}

.contact-layer {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: grid;
  place-items: center;
  padding: 24px;
}

.contact-layer__mask {
  position: absolute;
  inset: 0;
  background: #14110d80;
}

.contact-layer__card {
  position: relative;
  width: 100%;
  max-width: 380px;
  max-height: calc(100svh - 48px);
  overflow-y: auto;
  padding: 36px;
  border-radius: var(--radius-lg);
  background: var(--white);
  text-align: center;
}

.contact-layer__close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 24px;
}

.contact-layer__card img {
  width: 180px;
  margin: 20px auto;
}

.contact-layer__kicker {
  color: var(--gold-ink);
  font-size: 11px;
}

.contact-layer__card h2 {
  font-size: 24px;
}

.contact-layer__card p {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .main-nav {
    gap: 14px;
  }

  .main-nav .nav-ico {
    display: none;
  }
}

@media (max-width: 900px) {
  .header__inner {
    justify-content: space-between;
  }

  .main-nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .mobile-menu.is-open {
    position: fixed;
    inset: var(--header-h) 0 0;
    z-index: 290;
    display: block;
    overflow-y: auto;
    padding: 32px var(--gutter);
    background: var(--paper);
  }

  .mobile-menu__nav > a {
    display: flex;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .mobile-menu__nav > a > span:first-child {
    color: var(--gold-ink);
  }

  .mobile-menu__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 24px;
  }

  .contact-fab {
    right: 16px;
    bottom: 16px;
    padding: 10px 12px;
  }
}

/* 已登录时，移动端菜单里的申请入口也收起 */
html.auth-in .mobile-menu a[href="/#apply"] {
  display: none;
}

/* 头像先藏起来，等拿到正确的姓氏首字再显示，避免闪一个「会」字 */
html.auth-in:not(.auth-ready) .header__user {
  visibility: hidden;
}

/* 移动端给悬浮客服按钮留出内容空间 */
@media (max-width: 700px) {
  body:not(.tea-page):has(.contact-fab) main {
    padding-bottom: 78px;
  }
}

@media (max-width: 700px) {
  .contact-fab {
    width: 46px;
    height: 46px;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
  }

  .contact-fab span {
    display: none;
  }

  .contact-fab svg {
    width: 22px;
    height: 22px;
  }
}
