:root { color-scheme: light; --paper: #faf8f0; --ink: #253528; --green: #284c3b; --muted: #4e6155; --line: #c5cabd; --soft: #eaece0; --serif: 'Instrument Serif', Georgia, serif; --sans: 'Instrument Sans', system-ui, sans-serif; }
* { box-sizing: border-box; }
html { scroll-padding-top: 18px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--sans); }
button,input { font: inherit; }
a { color: var(--green); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .12em; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #216a83; outline-offset: 3px; }
img { display: block; width: 100%; height: auto; }
h1,h2,h3,p,figure { margin: 0; }
h1,h2,h3 { font-family: var(--serif); font-weight: 400; line-height: .98; }
h1 { font-size: clamp(3rem, 6.25vw, 6.4rem); letter-spacing: -.035em; }
h2 { font-size: clamp(2.2rem, 4.3vw, 4rem); letter-spacing: -.022em; }
h3 { font-size: clamp(1.9rem, 3vw, 2.75rem); }
.shell { width: min(1240px, calc(100% - 2 * clamp(20px, 5vw, 72px))); margin-inline: auto; }
.masthead { min-height: 78px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; position: relative; }
.wordmark { font: italic 2.6rem/.95 var(--serif); color: var(--ink); letter-spacing: -.035em; text-decoration: none; }
.desktop-nav { display: flex; gap: clamp(16px, 4vw, 56px); align-items: center; }
.desktop-nav a,.mobile-nav a { color: var(--ink); text-decoration: none; display: inline-flex; min-height: 44px; align-items: center; font-weight: 600; }
.desktop-nav a:hover,.mobile-nav a:hover { text-decoration: underline; }
.mobile-nav { display: none; }
.skip { position: absolute; left: 14px; top: -180px; z-index: 8; padding: 10px 16px; background: white; }
.skip:focus { top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hero { display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); gap: clamp(28px, 5vw, 70px); align-items: center; padding: clamp(28px, 5.8vw, 78px) 0 0; }
.hero h1 { max-width: 10ch; }
.lede { color: var(--muted); font-size: clamp(1rem, 1.7vw, 1.22rem); margin-top: 14px; max-width: 52ch; }
.hero-media img { border-radius: 6px; aspect-ratio: 4 / 3; object-fit: cover; object-position: 58% center; }
figcaption { padding-top: 6px; font-size: .82rem; color: var(--muted); }
.hero-destination { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.search-panel {
  margin-top: 20px;
  padding: clamp(12px, 2.2vw, 20px);
  border: 1px solid #bbc9b9;
  border-radius: 8px;
  background: #e9eee3;
}
.search-label { display: block; margin-bottom: 8px; color: var(--ink); font-size: clamp(1.08rem, 2.3vw, 1.23rem); font-weight: 700; line-height: 1.35; }
#search-form { display: flex; border: 2px solid var(--green); border-radius: 6px; background: #fff; }
#search-form:focus-within { outline: 2px solid #216a83; outline-offset: 3px; }
#search-input { appearance: none; background: transparent; border: 0; min-width: 0; flex: 1; padding: 12px; color: var(--ink); }
#search-input:focus-visible { outline: 0; }
#search-input::placeholder { color: var(--muted); opacity: 1; }
#search-form button {
  min-height: 54px;
  flex: 0 0 auto;
  border: 0;
  padding: 0 clamp(12px, 3vw, 22px);
  border-radius: 0 3px 3px 0;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
#search-form button:hover { background: #193d2c; }
#search-result { margin-top: 10px; }
.search-list { padding: 0; margin: 0; list-style: none; }
.search-list li a { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); min-height: 48px; padding: 8px 0; font-weight: 600; }
.search-list small { color: var(--muted); font-weight: 400; }
.quick-links { display: grid; grid-template-columns: 1fr 1fr; margin-top: 16px; }
.quick-links a { min-height: 54px; padding: 7px 12px 7px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 7px; justify-content: space-between; font-weight: 700; text-decoration: none; }
.quick-links a:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--line); }
.quick-links a:nth-child(n+3) { border-bottom: 1px solid var(--line); }
.quick-links a:hover { text-decoration: underline; }
.arrow { color: var(--green); flex: none; }
.section { padding: clamp(36px, 6vw, 84px) 0 0; }
.section-heading { margin-bottom: 20px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap; }
.section-heading a { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); gap: 26px; }
.card { color: inherit; text-decoration: none; display: block; }
.card:hover h3 { text-decoration: underline; text-underline-offset: .11em; }
.card img { aspect-ratio: 1.82; object-fit: cover; margin-bottom: 13px; border-radius: 5px; }
.card p { color: var(--muted); margin-top: 7px; }
.eyeline { display: block; color: var(--green); font-size: .83rem; font-weight: 700; margin-bottom: 4px; }
.guide-list { margin: 12px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.guide-list li { border-bottom: 1px solid var(--line); }
.guide-list li a { padding: 15px 3px; display: flex; gap: 12px; justify-content: space-between; text-decoration: none; }
.guide-list li a:hover strong { text-decoration: underline; }
.guide-list strong { display: block; color: var(--ink); font-size: 1.16rem; }
.description { display: block; color: var(--muted); }
.hub { padding-top: clamp(35px, 7vw, 88px); }
.hub .cards,.hub .guide-list { margin-top: 40px; }
.hub .quick-links { max-width: 560px; margin-top: 30px; }
.article { max-width: 720px; margin: auto; }
.breadcrumb { display: flex; gap: 10px; align-items: center; padding-top: clamp(20px, 4vw, 44px); color: var(--muted); font-size: .93rem; }
.breadcrumb a { min-height: 36px; display: flex; align-items: center; }
.article-heading { padding-top: 20px; }
.article h1 { font-size: clamp(3.1rem, 6.15vw, 5.7rem); }
.meta { color: var(--muted); margin-top: 13px; font-size: .9rem; }
.quick-answer { background: var(--soft); border-radius: 8px; margin-top: 23px; padding: 19px clamp(18px, 3.5vw, 30px); }
.quick-answer h2 { font-size: clamp(2rem, 4vw, 2.6rem); margin-bottom: 8px; }
.quick-answer p,.article-section { font-size: 1.07rem; }
.action-link { min-height: 44px; display: inline-flex; gap: 7px; align-items: center; font-weight: 700; margin-top: 3px; }
.contents { margin-top: 20px; border: 1px solid #849184; border-radius: 6px; }
.contents summary { min-height: 46px; padding: 10px 15px; font-weight: 700; cursor: pointer; }
.contents ol { margin: 0 0 12px 20px; }
.contents li a { display: inline-flex; align-items: center; min-height: 38px; }
.article-section { margin-top: clamp(28px, 5vw, 54px); overflow-wrap: anywhere; }
.article-section h2 { margin-bottom: 14px; font-size: clamp(2.2rem, 4.8vw, 3.5rem); }
.article-section p + p { margin-top: 12px; }
.article-section ul,.article-section ol { margin-block: 0; padding-left: 1.4em; }
.article-section li + li { margin-top: 9px; }
.article-photo { margin-top: 20px; }
.article-photo img { border-radius: 5px; aspect-ratio: 16 / 9; object-fit: cover; }
.documentary { margin: 20px 0; }
.documentary img { width: auto; max-width: 100%; max-height: 520px; aspect-ratio: auto; object-fit: contain; }
.documentary figcaption { line-height: 1.45; }
.photo-credit { display: block; margin-top: 3px; font-size: .79rem; }
.hero-route { background: var(--soft); padding: clamp(24px, 4.5vw, 54px); border-radius: 8px; }
.hero-route h2 { margin: 7px 0 12px; }
.hero-route ol { margin: 0 0 8px; padding-left: 1.4em; }
.cards .card { border-top: 1px solid var(--line); padding: 15px 0 9px; }
.visual-guide { margin: 0 0 20px; padding: 16px 17px; border-radius: 8px; background: var(--soft); }
.visual-guide figcaption { color: var(--ink); font-size: 1.06rem; font-weight: 700; padding: 0 0 9px; }
.visual-guide ol { list-style: none; padding: 0; margin: 0; counter-reset: guide-step; }
.visual-guide li { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; counter-increment: guide-step; }
.visual-guide li + li { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.visual-guide li::before { content: counter(guide-step); grid-row: 1 / span 2; width: 26px; height: 26px; align-self: center; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: white; font-size: .82rem; font-weight: 700; }
.visual-guide span { grid-column: 2; color: var(--muted); font-size: .95rem; }
.footer { display: flex; gap: 22px; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-top: clamp(44px, 8vw, 96px); padding: 20px 0 36px; border-top: 1px solid var(--line); }
.footer .wordmark { font-size: 2rem; }
@media (max-width: 700px) {
  .masthead { min-height: 65px; }
  .wordmark { font-size: 2.4rem; }
  .desktop-nav { display: none; }
  .mobile-nav { display: block; }
  .mobile-nav summary { cursor: pointer; padding: 10px 0 10px 10px; min-height: 44px; }
  .mobile-nav nav { position: absolute; top: calc(100% + 1px); right: 0; z-index: 3; background: var(--paper); padding: 6px 16px; border: 1px solid var(--line); min-width: 190px; }
  .mobile-nav nav a { display: flex; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .hero h1 { max-width: 15ch; font-size: clamp(3.45rem, 11vw, 4.5rem); }
  .hero-media img { aspect-ratio: 1.62; }
  .hero .lede { margin-top: 10px; }
  .search-panel { margin-top: 17px; }
  .quick-links { margin-top: 12px; }
  .quick-links a { min-height: 48px; font-size: .95rem; }
  .quick-links a:nth-child(even) { padding-left: 10px; }
  .cards { gap: 22px; }
  .article-heading { padding-top: 12px; }
  .article h1 { font-size: clamp(3rem, 11vw, 4.5rem); }
}

/* Payment walkthrough */
.payment-jumps,.payment-stores { display: flex; flex-wrap: wrap; gap: 7px 20px; margin-top: 12px; }
.payment-jumps a,.payment-stores a { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; font-size: .95rem; font-weight: 700; }
.payment-jumps a { text-decoration-thickness: 1px; }
.payment-steps { display: grid; gap: 22px; }
.payment-steps > li { padding-inline-start: 5px; }
.payment-steps > li::marker { color: var(--green); font-size: 1rem; font-weight: 700; }
.payment-steps > li + li { margin-top: 0; }
.payment-page h3 { margin-bottom: 8px; line-height: 1.1; font-size: clamp(1.65rem, 3vw, 2.15rem); }
.payment-stores { margin-top: 4px; }
.payment-official-image { margin: 15px 0 17px; max-width: 510px; }
.payment-official-image img { width: 100%; height: auto; background: #f5f7f3; border-radius: 6px; }
.payment-official-image figcaption { line-height: 1.45; }
.payment-official-image figcaption a { display: block; margin-top: 3px; font-size: .79rem; }
.tap-guide { --tap-bg: #eff4fc; --tap-border: #becfea; --tap-ink: #223f6f; margin: 14px 0; padding: 13px; background: var(--tap-bg); }
.tap-guide--wechat { --tap-bg: #eff5ed; --tap-border: #bfd4bc; --tap-ink: #274c33; }
.payment-page .tap-guide figcaption { font-size: .9rem; }
.payment-page .tap-guide ol { display: flex; flex-wrap: wrap; gap: 7px; padding: 0; }
.payment-page .tap-guide li { display: flex; flex: 1 1 114px; flex-direction: column; gap: 2px; margin: 0; padding: 8px; min-width: 0; border: 1px solid var(--tap-border); border-radius: 5px; background: white; }
.payment-page .tap-guide li::before { content: none; }
.payment-page .tap-guide li span { font-size: .76rem; }
.payment-page .tap-guide li strong { color: var(--tap-ink); font-size: .9rem; }
.payment-page .payment-fix { margin-top: 14px; border: 1px solid var(--line); border-radius: 5px; padding: 0 13px; }
.payment-fix summary { display: list-item; min-height: 44px; padding-block: 9px; cursor: pointer; color: var(--green); font-weight: 700; }
.payment-fix p:last-child { margin-bottom: 12px; }
.payment-page .payment-source { margin-top: 8px; font-size: .9rem; }
.payment-subhead { margin-top: 23px; }
.payment-checks { margin: 10px 0 0; border-top: 1px solid var(--line); }
.payment-checks div { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.65fr); gap: 3px 15px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.payment-checks dt { font-weight: 700; }
.payment-checks dd { margin: 0; }
.payment-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 275px), 1fr)); gap: 14px; margin-top: 18px; }
.payment-modes section { padding: 14px; border: 1px solid var(--line); border-radius: 7px; }
.payment-modes h3 { font-size: 1.75rem; }
.payment-modes img { border-radius: 5px; margin-bottom: 10px; }
.payment-modes p { font-size: 1rem; }
.payment-fallback { margin-top: 16px; }
@media (max-width: 480px) {
  .payment-steps { gap: 17px; }
  .payment-checks div { grid-template-columns: 1fr; }
  .payment-page .payment-jumps { column-gap: 14px; }
}

/* Alipay chapter navigation and walkthrough */
.alipay-contents { padding: 12px 17px; background: var(--soft); border-radius: 7px; }
.alipay-contents li + li { margin-top: 0; }
.alipay-contents a { display: inline-flex; align-items: center; min-height: 38px; font-size: .96rem; font-weight: 600; }
.alipay-parts > section { margin-top: 28px; }
.alipay-parts [id] { scroll-margin-top: 14px; }
.alipay-parts h4 { font-size: 1.1rem; line-height: 1.35; margin: 19px 0 8px; }
.alipay-modes h4 { margin-top: 0; }
.alipay-modes li { font-size: 1rem; }
.payment-official-image--compact { max-width: 230px; }
@media (max-width: 480px) {
  .alipay-contents a { min-height: 44px; }
}

/* Guide content affordances */
.article-section > h3 { margin: 22px 0 10px; font-size: clamp(1.65rem, 3vw, 2.15rem); line-height: 1.15; }
.article-section > p + ol, .article-section > p + ul { margin-top: 10px; }
.article-section > ul + p, .article-section > ol + p { margin-top: 13px; }
.article-section[id], .alipay-parts [id] { scroll-margin-top: 14px; }
.step-photo a:has(> img) { display: block; width: fit-content; max-width: 100%; }
.step-photo img { max-height: 590px; }

/* Task shortcuts and the guide’s finish line */
.first-trip-link { margin-top: 8px; }
.guide-jumps { display: flex; flex-wrap: wrap; column-gap: 18px; }
.guide-jumps a { display: inline-flex; align-items: center; min-height: 44px; font-size: .95rem; font-weight: 700; }
.completion { background: var(--soft); padding: 20px clamp(16px, 4vw, 28px); border-radius: 8px; }
.completion h2 { font-size: clamp(1.8rem, 4.8vw, 2.5rem); }
.completion li > strong { display: block; line-height: 1.35; }
.completion .completion-fallback { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.trip-actions { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,260px),1fr)); gap: 24px; margin-top: 28px; }
.trip-actions section { border-top: 1px solid var(--line); padding-top: 16px; }
.trip-actions h3 { font-size: clamp(1.8rem,3vw,2.3rem); }
.trip-actions ul { list-style: none; margin: 8px 0 0; padding: 0; }
.trip-actions a { display: flex; align-items: center; min-height: 44px; padding-block: 5px; font-weight: 600; }
@media print {
  .masthead, .footer, .skip, .guide-jumps, .payment-jumps, .contents { display: none; }
  body { color: #111; background: white; }
  .article .article-section { margin-top: 18px; }
  .article img { max-height: 330px; object-fit: contain; }
  .article figure, .completion { break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; }
}

.print-guide { min-height: 44px; margin-top: 10px; border: 1px solid var(--green); border-radius: 5px; padding: 6px 11px; background: var(--paper); color: var(--green); font-weight: 700; cursor: pointer; }
@media print {
  .print-guide { display: none; }
}


/* James in China identity */
.masthead { gap: 16px; }
.masthead > .wordmark { white-space: nowrap; }
.hero-sidebar { display: grid; gap: 14px; }
.hero-james, .about-james {
  display: grid;
  grid-template-columns: minmax(84px, 30%) minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 3vw, 26px);
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.james-portrait {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--soft);
  object-fit: cover;
}
.hero-james h2, .about-james h2 { margin-bottom: 8px; font-size: clamp(1.95rem, 3.4vw, 3rem); }
.hero-james p, .about-james p { color: var(--muted); line-height: 1.45; }
.hero-james a { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; margin-top: 2px; font-weight: 600; }
.about-james { margin-top: 24px; }
@media (min-width: 701px) and (max-width: 920px) {
  .masthead .wordmark { font-size: 2.3rem; }
  .desktop-nav { gap: 20px; }
}
@media (max-width: 380px) {
  .masthead .wordmark { font-size: 2.08rem; }
  .hero-james, .about-james { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; }
}
@media print {
  .hero-james, .about-james { break-inside: avoid; }
}

.masthead .wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: block;
  object-fit: contain;
}

@media (max-width: 420px) {
  .masthead .wordmark { font-size: clamp(1.65rem, 6.2vw, 2.08rem); gap: 7px; }
  .brand-mark { width: 35px; height: 35px; flex-basis: 35px; }
}

#search-form > input[type="search"] {
  min-width: 0;
}

.guide-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
}

.guide-pagination a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

@media (min-width: 701px) and (max-width: 920px) {
  .masthead .desktop-nav { gap: clamp(13px, 2vw, 20px); }
}

.task-heading {
  font: 700 1rem/1.4 var(--sans);
  letter-spacing: 0;
  margin-top: 20px;
}

.task-links { margin-top: 7px; }
.quick-links.task-links a { border-bottom: 0; }
.quick-links.task-links a:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
.browse-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.browse-cards .card { padding: 18px; }
.browse-cards .card h3 { font-size: clamp(1.7rem, 3vw, 2.35rem); }
.browse-cards .card p { margin-top: 9px; }
.mobile-search { display: none; }
.masthead a[aria-current="page"] { text-decoration: underline; text-underline-offset: .3em; }
.hub .hub-jumps { max-width: 760px; }
.hub-group .section-heading { margin-bottom: 14px; }
.hub .hub-group .guide-list { margin-top: 0; }
.hub-browse { margin-top: 32px; }
.archive-links { display: flex; flex-wrap: wrap; gap: 0 18px; margin-top: 14px; }
.archive-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.best-match { margin: 22px 0 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); }
.best-match a, .best-match .description { display: block; }
.best-match a { padding: 4px 0; text-decoration: none; }
.best-match a:hover strong { text-decoration: underline; }
.guide-content { overflow-wrap: anywhere; }
.guide-content > h2 { margin-top: 1.5em; margin-bottom: .44em; font-size: clamp(2rem, 4.8vw, 3.3rem); }
.guide-content > p + p { margin-top: .9em; }
.guide-content > figure { margin: 1.3em 0; }
.guide-content > :is(ol, ul) { padding-inline-start: 1.4em; }
.guide-content > :is(ol, ul) > li + li { margin-top: .6em; }
.guide-content > nav[aria-label="In this guide"] li a, .guide-contents-list a { display: inline-flex; align-items: center; min-height: 44px; }
.guide-content li a { text-underline-offset: .2em; }
.guide-related { margin-top: 44px; }
.guide-content > table { display: block; max-width: 100%; overflow-x: auto; }
.guide-content > table :is(td, th) { text-align: start; padding: 7px 10px; }

@media (max-width: 700px) {
  .masthead { gap: 10px; }
  .masthead .wordmark { margin-right: auto; }
  .mobile-search { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding-inline: 3px; font-size: .92rem; font-weight: 650; }
  .mobile-nav summary { padding-inline-start: 2px; }
  .browse-cards { grid-template-columns: 1fr; }
  .hub .hub-jumps { margin-top: 17px; }
}

@media (max-width: 390px) {
  .masthead .wordmark { font-size: clamp(1.36rem, 5.6vw, 1.75rem); gap: 5px; }
  .masthead .brand-mark { width: 28px; height: 28px; flex-basis: 28px; }
}

@media print {
  .guide-related { display: none; }
}

.guide-overview { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 18px; margin-top: 22px; color: var(--muted); }
.guide-overview-links { display: flex; flex-wrap: wrap; gap: 0 16px; }
.guide-overview a { display: inline-flex; min-height: 44px; align-items: center; font-weight: 600; }
.hub .guide-overview + .guide-list { margin-top: 4px; }

.guide-page-numbers { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.guide-page-numbers a, .guide-page-numbers [aria-current] { display: inline-flex; justify-content: center; align-items: center; min-width: 44px; min-height: 44px; border-radius: 4px; }
.guide-page-numbers [aria-current] { background: var(--soft); font-weight: 700; }
.guide-page-gap { padding-inline: 4px; }
