:root {
  --bg: #f4efe7;
  --surface: #f6f2ee;
  --text: #1f1a19;
  --muted: #6f6a66;
  --line: #d8d2cb;
  --accent: #447af0;
  --accent-soft: #c8d8ff;
  --endpoint-bg-start: #d6ebe7;
  --endpoint-bg-end: #d8e7f7;
  --shadow-soft: 0 16px 40px rgba(31, 26, 25, 0.08);
  --radius-lg: 30px;
  --radius-md: 18px;
  --font-google-sans: "Google Sans", "Product Sans", "Roboto", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

    body {
      margin: 0;
      min-height: 100vh;
      color: var(--text);
      font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
      /* Static background is much more performant */
      background: linear-gradient(135deg, #fdfbf7 0%, #f4efe7 50%, #e8f4f8 100%);
      letter-spacing: 0.02em;
      overflow-x: hidden;
      position: relative;
    }

    /* Ambient Light Effect - GPU accelerated float */
    body::before {
      content: "";
      position: fixed;
      top: -50%;
      left: -50%;
      width: 200%;
      height: 200%;
      background: radial-gradient(circle at center, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 60%);
      opacity: 0.4;
      pointer-events: none;
      z-index: -1;
      /* Use transform for smooth 60fps animation */
      animation: ambientFloat 20s ease-in-out infinite alternate;
      will-change: transform;
    }

    @keyframes ambientFloat {
      0% { transform: translate(0, 0); }
      100% { transform: translate(5%, 5%); }
    }

    .page {  max-width: 1320px;
  margin: 0 auto;
  padding: 52px 24px 40px;
}

.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 42px;
  align-items: center;
}

.brand-side {
  position: relative;
  padding-top: 38px;
  min-height: 520px;
}

.bg-word {
  position: absolute;
  top: 72px;
  left: 0;
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(7rem, 16vw, 13rem);
  font-weight: 700;
  letter-spacing: 0.07em;
  color: rgba(69, 63, 59, 0.09);
  line-height: 0.82;
  pointer-events: none;
  user-select: none;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 18px;
  color: #7f7871;
  font-size: 28px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 170px;
  border-radius: 8px;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(68, 122, 240, 0.07);
  transform-origin: top;
  animation: lineGrowVertical 1.2s cubic-bezier(0.16, 1, 0.3, 1) both 100ms, linePulse 4s ease-in-out infinite 1.3s;
}

.eyebrow-text {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.1rem, 2vw, 2rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  padding-left: 8px;
}

.main-en {
  margin: 0 0 8px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(5.4rem, 11vw, 10rem);
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: 0.06em;
  position: relative;
  z-index: 1;
}

.main-cn {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: clamp(2.1rem, 5.1vw, 4.7rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  position: relative;
  z-index: 1;
}

.title-emphasis {
  position: relative;
  display: inline-block;
  animation: titleSettle 780ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.main-en .title-emphasis {
  background: linear-gradient(235deg, var(--text) 25%, #e6c555 42%, #ffffff 50%, #e6c555 58%, var(--text) 75%);
  background-size: 350% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: titleSettle 780ms cubic-bezier(0.22, 1, 0.36, 1) both, shineLoop 8s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

.main-cn .title-emphasis {
  animation-delay: 90ms;
}

.title-emphasis::after {
  content: "";
  position: absolute;
  left: -0.04em;
  right: -0.03em;
  bottom: 0.08em;
  height: 0.23em;
  border-radius: 999px;
  z-index: -1;
  opacity: 0;
  transform-origin: left center;
  transform: scaleX(0.28);
  background: linear-gradient(92deg, rgba(68, 122, 240, 0.03), rgba(68, 122, 240, 0.22), rgba(68, 122, 240, 0.04));
  animation: titleUnderline 920ms cubic-bezier(0.23, 1, 0.32, 1) 180ms forwards;
}

.main-cn .title-emphasis::after {
  bottom: 0.05em;
  height: 0.26em;
  background: linear-gradient(92deg, rgba(68, 122, 240, 0.07), rgba(68, 122, 240, 0.33), rgba(68, 122, 240, 0.09));
  animation-delay: 290ms;
}

.slogan {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(0.95rem, 1.6vw, 1.55rem);
  color: #88817a;
  letter-spacing: 0.23em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.slogan-line {
  width: 210px;
  height: 2px;
  margin-top: 20px;
  background: rgba(68, 122, 240, 0.56);
  border-radius: 2px;
  transform-origin: left;
  opacity: 0;
  filter: blur(10px);
}

.slogan-line.hero-animate {
  animation: sloganLineReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes sloganLineReveal {
  0% { 
    transform: translateY(20px) scaleX(0); 
    opacity: 0; 
    filter: blur(5px);
  }
  100% { 
    transform: translateY(0) scaleX(1); 
    opacity: 1; 
    filter: blur(0);
  }
}

@keyframes lineGrowVertical {
  0% { transform: scaleY(0); opacity: 0; }
  100% { transform: scaleY(1); opacity: 1; }
}

@keyframes linePulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(68, 122, 240, 0.07); }
  50% { box-shadow: 0 0 0 6px rgba(68, 122, 240, 0.12); }
}

.card {
  background: rgba(248, 244, 240, 0.96);
  border: 1px solid rgba(154, 145, 137, 0.12);
  border-radius: var(--radius-lg);
  padding: clamp(26px, 4.2vw, 44px);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(5px);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #69635d;
  margin-bottom: 24px;
  letter-spacing: 0.12em;
}

.card-head-right {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: #2f2a28;
  font-size: 24px;
  line-height: 1;
  font-weight: 600;
}

.card-title {
  margin: 0 0 6px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(3.2rem, 5vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
}

.card-subtitle {
  margin: 0 0 16px;
  font-size: clamp(2.1rem, 3vw, 3.15rem);
  line-height: 1.08;
  letter-spacing: 0.04em;
}

.card-desc {
  margin: 0 0 38px;
  color: #3e3935;
  font-size: clamp(1.08rem, 1.7vw, 1.58rem);
  line-height: 1.9;
  letter-spacing: 0.03em;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.card-btn {
  position: relative;
  min-width: 130px;
  padding: 16px 30px;
  border-radius: 16px;
  border: 1.6px solid #49413d;
  background: transparent;
  color: #272220;
  font-family: var(--font-google-sans);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate; /* Ensures pseudo-element stays behind text */
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.card-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accent);
  z-index: -1;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.card-btn:hover,
.card-btn:focus-visible {
  outline: none;
  color: white;
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 15px 30px -6px rgba(68, 122, 240, 0.35);
}

.card-btn:hover::before,
.card-btn:focus-visible::before {
  transform: scaleY(1);
}

.card-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -4px rgba(68, 122, 240, 0.3);
}

@keyframes titleSettle {
  from {
    opacity: 0.93;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes titleUnderline {
  0% {
    opacity: 0;
    transform: scaleX(0.28);
  }
  58% {
    opacity: 0.92;
    transform: scaleX(1.03);
  }
  100% {
    opacity: 0.72;
    transform: scaleX(1);
  }
}

@keyframes shineLoop {
  0% {
    background-position: 130%;
  }
  50% {
    background-position: -30%;
  }
  100% {
    background-position: -30%;
  }
}

    /* High Performance Animations */
    .hero-animate {
      opacity: 0;
      /* Only animate transform/opacity for 60fps */
      will-change: transform, opacity;
      /* Use `both` so it retains final state but allows subsequent animations */
      animation: slideUpBlur 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
    }

    /* Chain breathing animation after entrance */
    .card.hero-animate, .endpoint-section-modern.hero-animate {
      will-change: transform;
      animation: 
        slideUpBlur 0.8s cubic-bezier(0.16, 1, 0.3, 1) both,
        cardFloat 6s ease-in-out infinite 0.8s; /* Changed to Float for performance */
    }

    .bg-word.hero-animate {
      will-change: transform;
      transform: translateY(60px) scale(0.9);
      animation: 
        bgWordReveal 1.4s cubic-bezier(0.16, 1, 0.3, 1) both,
        floatSlow 8s ease-in-out infinite 1.4s;
    }

    @keyframes slideUpBlur {
      0% {
        opacity: 0;
        transform: translateY(40px);
        /* Filter is expensive, remove or reduce if laggy. Keeping for entrance only. */
        filter: blur(8px);
      }
      100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
      }
    }

    /* Renamed to Float as we removed shadow/border animation */
    @keyframes cardFloat {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-8px); }
    }

    @keyframes floatSlow {
      0%, 100% { transform: translateY(0) scale(1); }
      50% { transform: translateY(-12px) scale(1.02); }
    }

    @keyframes bgWordReveal {  0% {
    opacity: 0;
    transform: translateY(60px) scale(0.9);
    filter: blur(20px);
  }
  100% {
    opacity: 1; /* Note: opacity is controlled by color in original CSS, but this ensures visibility */
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.delay-0 { animation-delay: 0ms; }
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }

@media (prefers-reduced-motion: reduce) {
  .hero-animate, .bg-word.hero-animate {
    opacity: 1;
    transform: none;
    filter: none;
    animation: none;
  }
  .hero {
    grid-template-columns: 1fr;
  }

  .brand-side {
    min-height: auto;
  }

  .card {
    max-width: 760px;
  }
}

@media (max-width: 760px) {
  .page {
    padding: 24px 16px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .brand-side {
    min-height: auto;
    padding-top: 0;
    margin-bottom: 24px;
  }

  .bg-word {
    top: 20px;
    font-size: clamp(4rem, 18vw, 7rem);
    opacity: 0.6; /* Slight fade so it doesn't fight content */
  }

  .main-en {
    font-size: clamp(3.2rem, 15vw, 5rem);
    line-height: 0.9;
  }

  .main-cn {
    font-size: clamp(1.8rem, 8vw, 2.6rem);
    margin-bottom: 6px;
  }

  .eyebrow {
    margin-bottom: 14px;
    font-size: 20px;
  }

  .eyebrow::before {
    width: 4px;
    height: 80px; /* shorter on mobile */
  }

  .card {
    padding: 24px 20px;
  }

  .card-title {
    font-size: 2.8rem;
  }

  .card-desc {
    font-size: 1rem;
    margin-bottom: 28px;
  }

  .card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .card-btn {
    width: 100%;
    min-width: 0;
    padding: 14px 10px; /* Reduce padding to fit text */
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade-up {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .title-emphasis {
    animation: none;
  }

  .title-emphasis::after {
    animation: none;
    opacity: 0.72;
    transform: scaleX(1);
  }

  .card-btn {
    transition: none;
  }
}

/* Modern Endpoint Redesign */
.endpoint-section-modern {
  margin-top: 42px;
  font-family: var(--font-google-sans);
  /* Make main background transparent to let pseudo-element show */
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  padding: 36px;
  box-shadow: 
    0 20px 40px -10px rgba(0, 0, 0, 0.05),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
  position: relative;
}

/* Static Gradient Background */
.endpoint-section-modern::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  /* Premium static gradient: Soft White to a hint of Tech Blue */
  background: linear-gradient(135deg, 
    #ffffff 0%, 
    #f8faff 50%,
    #f0f5ff 100%);
  border-radius: 24px; /* Matches parent radius */
  opacity: 1;
}

.endpoint-section-modern:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 30px 60px -12px rgba(68, 122, 240, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.8) inset;
}

.modern-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #64748b;
  margin-bottom: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modern-label::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(68, 122, 240, 0.2);
}

.url-composer {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 18px;
  padding: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01);
}

.url-composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(68, 122, 240, 0.15);
  transform: scale(1.01);
}

.static-base {
  padding: 14px 18px;
  background: #f1f5f9;
  border-radius: 12px;
  color: #475569;
  font-weight: 600;
  font-size: 0.95rem;
  user-select: all;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.static-base:hover {
  background: #e2e8f0;
  color: #334155;
}

.path-selector-wrapper {
  flex: 1;
  position: relative;
  margin: 0 6px;
}

.path-trigger {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 2px solid transparent;
  padding: 12px 16px;
  font-size: 0.95rem;
  color: #1e293b;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 12px;
  transition: all 0.2s;
  font-family: inherit;
}

.path-trigger:hover {
  background: #f8fafc;
}

.path-trigger:focus-visible {
  outline: none;
  background: #f1f5f9;
}

.path-trigger svg {
  color: #94a3b8;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.path-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
  color: var(--accent);
}

.path-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  width: 100%;
  background: white;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 
    0 20px 40px -10px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(0,0,0,0.02);
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 100;
  transform-origin: top center;
}

.path-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.path-option {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  margin-bottom: 2px;
}

.path-option:last-child {
  margin-bottom: 0;
}

.path-option:hover {
  background: #f8fafc;
  color: #334155;
  transform: translateX(4px);
}

.path-option.selected {
  background: rgba(68, 122, 240, 0.08);
  color: var(--accent);
  font-weight: 600;
}

.path-option .tag {
  margin-left: auto;
  font-size: 0.75rem;
  padding: 4px 8px;
  background: rgba(0,0,0,0.04);
  border-radius: 6px;
  opacity: 0.7;
}

    .action-btn {
      width: 48px;
      height: 48px;
      border: none;
      background: var(--accent);
      color: white;
      border-radius: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
      flex-shrink: 0;
      position: relative;
      overflow: hidden;
    }

    .action-btn.success {
      background: #10b981; /* Green-500 equivalent */
      transform: scale(1.05);
      box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
    }

    .action-btn svg {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .icon-copy {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }

    .action-btn.success .icon-copy {
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.5) rotate(-15deg);
    }

    .icon-check {
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.5) rotate(15deg);
    }

    .action-btn.success .icon-check {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }

    .action-btn::after {  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(68, 122, 240, 0.4);
}

.action-btn:hover::after {
  opacity: 1;
}

.action-btn:active {
  transform: translateY(0) scale(0.96);
}

.copy-tooltip {
  position: absolute;
  top: -45px;
  right: -10px;
  background: #1e293b;
  color: white;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.2);
}

.copy-tooltip::after {
  content: '';
  position: absolute;
  bottom: -4px;
  right: 24px;
  width: 8px;
  height: 8px;
  background: #1e293b;
  transform: rotate(45deg);
}

.copy-tooltip.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.copy-tooltip.error {
  background: #b91c1c;
}

.copy-tooltip.error::after {
  background: #b91c1c;
}

@media (max-width: 760px) {
  .endpoint-section-modern {
    padding: 20px;
    margin-top: 32px;
    border-radius: 20px;
  }

  /* Fix background radius for mobile */
  .endpoint-section-modern::before {
    border-radius: 20px;
  }
  
  .url-composer {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }

  .static-base, .path-selector-wrapper, .action-btn {
    width: 100%;
    margin: 0;
  }

  .static-base {
    padding: 12px 14px;
    font-size: 0.9rem;
    overflow-x: auto; /* Allow scrolling for long URLs */
  }

  .path-trigger {
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
  }
  
  .action-btn {
    margin-top: 0; /* gap handles this now */
    border-radius: 10px;
  }
}
