@layer reset, base, layout, components, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, p { margin: 0; }
  img { display: block; max-width: 100%; }
  button, input { font: inherit; }
  button, a { -webkit-tap-highlight-color: transparent; }
}

@layer base {
  :root {
    color-scheme: light;
    --radius: 16px;
    --width: 1160px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background: var(--white);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    scroll-padding-top: 100px;
  }
  body { min-width: 320px; }
  a { color: var(--green); text-underline-offset: .25em; }
  button { cursor: pointer; }
  :focus-visible { outline: 3px solid var(--green); outline-offset: 5px; }
  ::selection { background: var(--selection); color: var(--ink); }
  h1, h2, h3 { line-height: 1.2; text-wrap: balance; }
  h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); font-weight: 750; letter-spacing: -.05em; }
  h2 { font-size: clamp(1.8rem, 3.4vw, 2.9rem); font-weight: 700; letter-spacing: -.035em; max-width: 900px; }
  h3 { font-size: 1.15rem; font-weight: 650; letter-spacing: -.015em; }
  p + p { margin-top: 1rem; }
  p, li { overflow-wrap: break-word; }
  .muted, .small { color: var(--muted); }
  .small { font-size: .9rem; line-height: 1.75; }
  h2 + p { margin-top: 1.2rem; max-width: 780px; }
  ul { padding-left: 1.3rem; margin: 1rem 0; }
  li + li { margin-top: .8rem; }
  [lang="zh-CN"] h1 { letter-spacing: -.025em; line-height: 1.3; }
  [lang="zh-CN"] h2 { line-height: 1.4; }
}

@layer layout {
  .wrap { width: min(100% - 64px, var(--width)); margin-inline: auto; }
  main > section:not(.hero) { padding-block: 88px; }
  .grid { display: grid; gap: 24px; margin-top: 32px; }
  .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; align-items: center; margin-top: 36px; }
  .split > *, .grid > * { min-width: 0; }
  .topbar { position: sticky; top: 0; z-index: 20; background: var(--white); border-bottom: 1px solid var(--line); }
  .topbar .wrap { min-height: 86px; display: flex; gap: 24px; align-items: center; justify-content: space-between; }
  nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 22px; }
  nav a { color: var(--muted); font-size: .83rem; font-weight: 550; text-decoration: none; padding: 10px 8px; border-radius: 6px; position: relative; }
  nav a::after { content: ""; position: absolute; inset: auto 8px 3px; height: 2px; background: var(--green); transform: scaleX(0); }
  nav a:is(:hover, :focus-visible, [aria-current="location"]) { color: var(--deep); background: var(--paper); }
  nav a:is(:hover, :focus-visible, [aria-current="location"])::after { transform: scaleX(1); }
  .topbar .wrap > div:last-child { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
  .hero { position: relative; isolation: isolate; overflow: hidden; background: var(--deep); color: var(--white); }
  .hero-photo { position: absolute; inset: 0 0 0 auto; width: 65%; height: 100%; object-fit: cover; object-position: center; z-index: -2; }
  .hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--deep) 15%, var(--hero-overlay) 38%, var(--hero-fade) 100%); z-index: -1; }
  .hero .wrap { padding-block: 105px 92px; }
  .hero-copy { max-width: 720px; }
  .hero .lead { margin-top: 24px; max-width: 580px; color: var(--hero-text); font-size: 1.05rem; }
  .hero .tag { color: var(--gold); }
  .hero-copy > p:last-child { margin-top: 32px; display: flex; gap: 14px; flex-wrap: wrap; }
  .hero :focus-visible { outline-color: var(--gold); }
  .stats { background: var(--paper); padding-block: 32px; }
  .stats .grid { margin-top: 0; }
  .stat { padding-inline: 16px; }
  .stat + .stat { border-left: 1px solid var(--line); }
  .stat .n { display: block; font-weight: 650; font-size: 2rem; line-height: 1.3; color: var(--deep); letter-spacing: -.035em; }
  .stat .l { font-size: .8rem; color: var(--muted); }
  .countdown { padding-block: 40px; }
  .countdown h2 { font-size: 1.3rem; }
  .countdown p { margin-top: 8px; }
  .countdown .grid { margin-top: 20px; gap: 0; }
  #team, #calendar, #fees, #faq { background: var(--paper); }
  #team { padding-block: 64px; }
  #contact { background: var(--contact-bg); }
  footer { padding-block: 54px calc(28px + var(--contact-bar-height, 64px)); background: var(--ink); color: var(--footer-text); }
}

@layer components {
  .skip-link { position: fixed; left: 16px; top: 8px; padding: 12px 20px; background: var(--white); transform: translateY(-150%); z-index: 40; }
  .skip-link:focus { transform: translateY(0); }
  .brand { flex-shrink: 0; display: flex; flex-direction: column; line-height: 1; text-decoration: none; color: var(--deep); }
  .bn { font-size: 1.55rem; font-weight: 800; letter-spacing: -.06em; }
  .bmy { font-weight: 450; }
  .bEa { color: var(--green); }
  .bbar { width: 32px; height: 3px; background: var(--mint); margin-top: 7px; }
  .bs { font-size: .52rem; font-weight: 700; letter-spacing: .22em; margin-top: 5px; }
  .langbtn, .navtoggle { border: 1px solid var(--line); padding: 9px 13px; border-radius: 30px; background: var(--white); color: var(--ink); font-size: .8rem; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .navtoggle { display: none; }
  .btn { display: inline-flex; justify-content: center; align-items: center; min-height: 50px; padding: 13px 24px; border-radius: 6px; font-size: .9rem; font-weight: 650; text-decoration: none; transition: background .15s; }
  .btn-primary { background: var(--gold); color: var(--ink); }
  .btn-primary:hover { background: var(--button-hover); }
  .btn-ghost { color: var(--white); border: 1px solid var(--ghost-line); }
  .btn-ghost:hover { background: var(--ghost-hover); }
  .tag { display: block; color: var(--green); font-size: .73rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 18px; }
  .trustline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin-top: 28px; max-width: 620px; font-size: .8rem; color: var(--hero-text); }
  .trustline span { display: flex; gap: 8px; }
  .trustline span::before { content: "✓"; color: var(--mint); }
  .cdbox { padding: 4px 24px 4px 0; }
  .cdbox + .cdbox { padding-left: 24px; border-left: 1px solid var(--line); }
  .cdbox .d { display: block; font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 600; color: var(--green); letter-spacing: -.035em; }
  .cdbox .l { font-size: .8rem; color: var(--muted); }
  .card { border-radius: var(--radius); padding: 28px; background: var(--paper); }
  .card h3 { margin-bottom: 14px; }
  #services .card { padding: 32px; }
  #services .card:nth-child(3) { background: var(--deep); color: var(--white); }
  #services .card:nth-child(3) li, #services .card:nth-child(3) .small { color: var(--hero-text); }
  #services .card:nth-child(3) li::before { color: var(--mint); }
  .photo { overflow: hidden; border-radius: var(--radius); background: var(--paper); aspect-ratio: 4 / 3; }
  .photo.tall { aspect-ratio: 5 / 6; }
  .photo.wide { aspect-ratio: 5 / 4; }
  .photo img { width: 100%; height: 100%; object-fit: cover; }
  .pos-top { object-position: center 28%; }
  .pos-mid { object-position: center 40%; }
  .pos-doc { object-position: center 52%; }
  .pos-arrival { object-position: center 48%; }
  .subhead { margin-block: 40px 20px; }
  .bullets { list-style: none; margin-block: 20px 0; padding: 0; }
  .bullets li { position: relative; padding-left: 24px; color: var(--muted); font-size: .92rem; }
  .bullets li::before { content: "✓"; position: absolute; left: 0; color: var(--green); }
  .bullets.no li::before { content: "–"; }
  .steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; }
  .step { padding-top: 16px; border-top: 2px solid var(--line); }
  .step .n { display: block; color: var(--green); font-size: 1.65rem; font-weight: 600; margin-bottom: 12px; }
  .step p { font-size: .85rem; color: var(--muted); }
  .bandline { font-size: .8rem; color: var(--muted); margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line); }
  .langband { font-size: 1.1rem; max-width: 850px; margin-top: 24px; color: var(--deep); }
  table { border-collapse: collapse; width: 100%; margin-top: 24px; font-size: .88rem; }
  th, td { text-align: left; padding: 18px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
  th { font-weight: 650; color: var(--deep); }
  td { color: var(--muted); }
  #calendar td:first-child { width: 25%; white-space: nowrap; font-weight: 600; color: var(--deep); }
  .callout { margin-top: 28px; border-left: 3px solid var(--green); padding-left: 20px; font-size: .88rem; }
  .callout p { margin-top: 10px; color: var(--muted); }
  .refund3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-block: 24px; }
  .refund3 .card { background: var(--white); }
  #gallery .photo { aspect-ratio: 4 / 5; }
  #gallery .small { margin-top: 12px; }
  #faq .grid { gap: 0 40px; align-items: start; }
  .faq-item { padding-block: 24px; border-bottom: 1px solid var(--line); }
  summary { cursor: pointer; font-size: 1rem; font-weight: 600; padding-right: 24px; position: relative; list-style: none; }
  summary::-webkit-details-marker { display: none; }
  summary::after { content: "+"; position: absolute; right: 0; color: var(--green); font-size: 1.3rem; line-height: 1.2; }
  details[open] summary::after { content: "−"; }
  .faq-item p { margin-top: 16px; }
  address { font-size: .9rem; font-style: normal; color: var(--muted); }
  .footer-bottom { display: flex; gap: 32px; align-items: flex-start; justify-content: space-between; }
  .footer-bottom { margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--footer-line); font-size: .72rem; }
  .footer-bottom p { margin: 0; }
  footer :focus-visible { outline-color: var(--mint); }
}

@layer responsive {
  @media (max-width: 1100px) {
    .topbar .wrap { flex-wrap: wrap; gap: 0 16px; padding-block: 16px; }
    .topbar nav { order: 3; width: 100%; margin-top: 16px; justify-content: flex-start; gap: 8px 24px; }
    .hero .wrap { padding-block: 80px; }
    .split { gap: 32px; }
    .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  }
  @media (max-width: 760px) {
    :root { scroll-padding-top: 88px; }
    .wrap { width: min(100% - 40px, var(--width)); }
    main > section:not(.hero) { padding-block: 56px; }
    .topbar .wrap { min-height: 76px; padding-block: 12px; }
    .bn { font-size: 1.35rem; }
    .bs { font-size: .46rem; }
    .topbar nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; padding-top: 8px; border-top: 1px solid var(--line); }
    .js .navtoggle { display: inline-flex; }
    .js .topbar nav:not(.open) { display: none; }
    nav a { min-height: 44px; display: flex; align-items: center; }
    .hero .wrap { padding-block: 64px; }
    .hero-copy { max-width: 600px; }
    .hero-photo { width: 100%; opacity: .38; }
    .hero::after { background: linear-gradient(90deg, var(--hero-mobile-start), var(--hero-mobile-end)); }
    h1 { font-size: clamp(2.3rem, 7.5vw, 3.5rem); }
    .hero .lead { font-size: 1rem; }
    .g3, .g2, .split { grid-template-columns: 1fr; }
    .stats .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; }
    .stat { padding-inline: 0; }
    .stat + .stat { border-left: 0; }
    .stat .n { font-size: 1.75rem; }
    .cdbox, .cdbox + .cdbox { padding: 14px 0; border-left: 0; border-bottom: 1px solid var(--line); }
    .cdbox:last-child { border-bottom: 0; }
    .cdbox .d { font-size: 1.3rem; }
    .countdown .grid { grid-template-columns: 1fr; }
    .photo.tall, .photo.wide { aspect-ratio: 4 / 3; }
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
    .card, #services .card { padding: 24px; }
    .refund3 { grid-template-columns: 1fr; gap: 16px; }
    th, td { padding: 14px 8px; font-size: .8rem; overflow-wrap: anywhere; }
    #fees table { table-layout: fixed; }
    .footer-bottom { flex-direction: column; gap: 24px; }
  }
  @media (max-width: 420px) {
    .trustline { grid-template-columns: 1fr; gap: 8px; }
    .hero-copy > p:last-child { flex-direction: column; }
    .g4 { grid-template-columns: 1fr; }
    #gallery .photo { aspect-ratio: 4 / 3; }
    .steps { grid-template-columns: 1fr; }
  }
  @media (prefers-reduced-motion: no-preference) {
    :root { scroll-behavior: smooth; }
  }
  @media print {
    .topbar, .skip-link, .hero-copy > p:last-child { display: none; }
    main > section:not(.hero) { padding-block: 24px; }
    .hero { color: var(--ink); background: none; }
    .hero .lead, .hero .trustline, .hero .tag { color: var(--ink); }
    .hero-photo, .hero::after { display: none; }
    .hero .wrap { padding-block: 24px; }
    .wrap { width: 100%; }
    details p { display: block; }
    .card, .faq-item, .photo { break-inside: avoid; }
  }
}

@layer components {
  [hidden] { display: none !important; }
  button, select, textarea { font: inherit; }
  .contact-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 64px; margin-top: 36px; }
  .contact-aside { align-self: start; padding: 28px; border-radius: var(--radius); background: var(--white); }
  .contact-aside p, .contact-aside address { margin-top: 18px; }
  .contact-aside a { overflow-wrap: anywhere; }
  label { display: block; font-size: .9rem; font-weight: 600; margin: 18px 0 6px; }
  input:not([type="checkbox"]):not([type="hidden"]):not(.honeypot), select, textarea { width: 100%; min-height: 48px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); color: var(--ink); font-size: 1rem; }
  textarea { min-height: 120px; resize: vertical; }
  .check { display: flex; align-items: flex-start; gap: 12px; font-size: .85rem; font-weight: 400; }
  .check input { margin: 5px 0 0; flex: 0 0 20px; width: 20px; height: 20px; accent-color: var(--green); }
  #lead-form > p { margin-top: 24px; }
  .form-submit { border: 0; background: var(--deep); color: var(--white); }
  .form-submit:hover { background: var(--green); }
  .form-submit:disabled { cursor: not-allowed; opacity: .6; }
  .form-notice { padding-left: 16px; border-left: 3px solid var(--green); }
  .popular-badge { display: inline-block; color: var(--gold); font-size: .75rem; margin-top: 8px; }
  .tabs { display: flex; gap: 10px; margin-block: 28px 18px; }
  .tabbtn { min-height: 44px; border: 1px solid var(--line); border-radius: 24px; padding: 10px 22px; color: var(--ink); background: var(--white); }
  .tabbtn.active { background: var(--deep); color: var(--white); border-color: var(--deep); }
  .js .pane:not(.active) { display: none; }
  .quote { margin: 0; border-radius: var(--radius); padding: 24px; background: var(--paper); }
  .quote blockquote { margin: 0 0 24px; }
  .quote p { font-size: .95rem; }
  .policy-list { margin-top: 24px; }
  .fcols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; margin-block: 40px; font-size: .85rem; }
  .fcols h3 { color: var(--white); margin-bottom: 16px; }
  .fcols .small { color: var(--footer-text); }
  footer a { color: var(--mint); }
  .floatbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 25; background: var(--ink); color: var(--footer-text); padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); font-size: .8rem; }
  .floatbar .wrap { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 24px; }
  .floatbar a { color: var(--mint); }
}

@layer responsive {
  @media (max-width: 760px) {
    .contact-grid, .fcols { grid-template-columns: 1fr; gap: 28px; }
    .contact-aside { padding: 24px; }
    .floatbar { font-size: .75rem; padding-top: 10px; }
    .floatbar .wrap { gap: 4px 12px; }
    .floatbar a { overflow-wrap: anywhere; }
  }
  @media print {
    .floatbar, #lead-form, .form-notice, .tabs { display: none; }
    .js .pane:not(.active) { display: block; }
    footer { padding-bottom: 28px; }
  }
}

@layer components {
  .cdbox .badge { display: inline-block; color: var(--green); font-size: .75rem; font-weight: 650; margin-bottom: 10px; }
  .cdbox .cdh { font-size: 1rem; margin-block: 10px; }
  .honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; }
}

@layer components {
  .contact-channels { display: grid; gap: 28px; margin-top: 28px; }
  .contact-channel { margin: 0; text-align: center; }
  .contact-channel h4 { margin: 0 0 14px; font-size: 1rem; font-weight: 650; color: var(--deep); }
  .qr-frame { display: block; position: relative; overflow: hidden; width: min(100%, 224px); aspect-ratio: 1; margin-inline: auto; background: var(--white); border-radius: 8px; }
  .qr-frame .qr-image { position: absolute; max-width: none; height: auto; }
  .qr-wechat .qr-image { width: calc(592 / 496 * 100%); left: calc(-48 / 496 * 100%); top: calc(-160 / 496 * 100%); }
  .qr-whatsapp .qr-image { width: calc(670 / 430 * 100%); left: calc(-120 / 430 * 100%); top: calc(-251 / 430 * 100%); }
  .contact-channel figcaption { margin-top: 12px; color: var(--muted); font-size: .85rem; }
}

@layer components {
  .document-body { min-height: 100svh; display: flex; flex-direction: column; }
  .document-page { flex: 1; max-width: 900px; padding-block: 64px; }
  .document-page h1 { font-size: clamp(2rem, 4vw, 3rem); }
  .document-page h2 { font-size: 1.25rem; margin-block: 32px 12px; }
  .document-page h1 + p { margin-top: 20px; }
  .document-page .btn { margin-top: 24px; }
  .document-footer { padding-bottom: 28px; font-size: .85rem; }
  .home-link { min-height: 44px; display: inline-flex; align-items: center; font-size: .85rem; }
}
