/**
 * 赳赳大秦门户 · 场馆入口（macOS Dock 放大）
 */
#services {
  position: relative;
  padding: clamp(3.5rem, 7vh, 5.5rem) clamp(1.25rem, 4vw, 4rem) clamp(4rem, 8vh, 6.5rem);
  overflow: visible;
}

#services.hero-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 24;
  padding: 3.2rem 0.75rem 1.15rem;
  overflow: visible;
  pointer-events: none;
}

#services.hero-dock::before,
#services.hero-dock::after {
  display: none;
}

#services.hero-dock .portal-sy-root,
#services.hero-dock .mac-dock {
  pointer-events: auto;
}

#services::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 160px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.42), transparent);
}

#services::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.portal-app.n-layout--light #services::before {
  background: linear-gradient(to bottom, rgba(154, 102, 64, 0.08), transparent);
}

.portal-app.n-layout--light #services::after {
  opacity: 0.02;
}

#services .section-head {
  position: relative;
  z-index: 1;
  align-items: flex-start;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
  padding-left: 0.15rem;
}

#services .section-head .head-line {
  width: 3px;
  height: 2.4rem;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-dim));
  flex-shrink: 0;
}

#services .section-head h2 {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  color: var(--text-primary);
  line-height: 1.3;
}

#services .portal-sy-root {
  position: relative;
  z-index: 1;
  gap: 0;
}

.mac-dock-stage {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
}

#services.hero-dock .mac-dock-hint {
  display: none;
}

.mac-dock-hint {
  margin: 0 0 2.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  opacity: 0.72;
}

.mac-dock {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  max-width: 100%;
  isolation: isolate;
  contain: layout style;
}

.mac-dock-items {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  padding: 0 1.1rem 0.55rem;
  min-height: 92px;
}

.mac-dock-item {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  width: 68px;
  position: relative;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: 50% 100%;
  z-index: 1;
  backface-visibility: hidden;
}

.mac-dock-item.is-focus {
  z-index: 2;
}

.mac-dock-label {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  white-space: nowrap;
  padding: 0.28rem 0.7rem;
  border-radius: 8px;
  background: rgba(18, 16, 14, 0.88);
  color: #f4ead8;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.mac-dock-item.is-focus .mac-dock-label,
.mac-dock-item:focus-visible .mac-dock-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.mac-dock-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.22), transparent 46%),
    linear-gradient(180deg, #3a342c 0%, #1a1714 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28) inset,
    0 10px 18px rgba(0, 0, 0, 0.28);
}

.mac-dock-item:nth-child(3n + 1) .mac-dock-icon {
  background:
    linear-gradient(160deg, rgba(255, 236, 190, 0.28), transparent 42%),
    linear-gradient(180deg, #c8a84e 0%, #8a6a28 100%);
}

.mac-dock-item:nth-child(3n + 2) .mac-dock-icon {
  background:
    linear-gradient(160deg, rgba(210, 236, 244, 0.28), transparent 42%),
    linear-gradient(180deg, #6fa8b8 0%, #3d6e7c 100%);
}

.mac-dock-item:nth-child(3n) .mac-dock-icon {
  background:
    linear-gradient(160deg, rgba(255, 214, 196, 0.28), transparent 42%),
    linear-gradient(180deg, #b06a52 0%, #7a3e30 100%);
}

.mac-dock-glyph {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.55rem;
  font-weight: 600;
  color: #fffaf0;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.mac-dock-shelf {
  width: calc(100% - 8px);
  height: 58px;
  margin-top: -12px;
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.34) 0%,
    rgba(255, 255, 255, 0.12) 42%,
    rgba(20, 16, 12, 0.22) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.4) inset;
}

.mac-dock-item--active .mac-dock-icon {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 0 0 2px rgba(200, 168, 78, 0.55),
    0 10px 18px rgba(0, 0, 0, 0.28);
}

.portal-app.n-layout--light .mac-dock-label {
  background: rgba(48, 38, 28, 0.9);
}

.portal-app.n-layout--light .mac-dock-shelf {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.62) 0%,
    rgba(255, 248, 236, 0.28) 42%,
    rgba(154, 102, 64, 0.08) 100%
  );
  border-color: rgba(255, 255, 255, 0.7);
}

#services .portal-loading,
#services .portal-error {
  border-radius: 16px;
  border: 1px dashed rgba(201, 168, 106, 0.22);
  background: rgba(12, 10, 9, 0.65);
}

@media (max-width: 760px) {
  #services.hero-dock {
    padding-bottom: 0.7rem;
  }

  .mac-dock-stage {
    min-height: 0;
    padding-top: 0.4rem;
  }

  .mac-dock {
    max-width: 100%;
  }

  .mac-dock-items {
    flex-wrap: wrap;
    justify-content: center;
    min-height: 0;
    gap: 14px 16px;
  }

  .mac-dock-item {
    width: 58px;
    transform: none;
  }

  .mac-dock-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
  }

  .mac-dock-label {
    position: static;
    transform: none;
    opacity: 1;
    margin-top: 0.4rem;
    background: transparent;
    box-shadow: none;
    color: var(--text-muted);
    font-size: 0.68rem;
    padding: 0;
  }

  .mac-dock-shelf {
    display: none;
  }

  .mac-dock-hint {
    letter-spacing: 0.08em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mac-dock-item {
    transform: none;
  }
}
