/* Layout and typography shared by the homepage, documents, and tool directory. */
:root {
  color-scheme: light;
  --background: #fff;
  --ink: #20262c;
  --muted: #646d77;
  --line: #e8ebee;
  --accent: #365e83;
  --surface: #fff;
  --sunk: #f1f3f5;
  --active: #f1f3f5;
  --link-underline: #b8c1c9;
  --font-size-caption: 12px;
  --font-size-home-label: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #14191d;
  --ink: #e7ebee;
  --muted: #adb6bf;
  --line: #303a43;
  --accent: #9dc1e0;
  --surface: #1c242b;
  --sunk: #10161a;
  --active: #2b3640;
  --link-underline: #75899b;
}
* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--background); color: var(--ink); font-family: var(--font); font-weight: 400; line-height: 1.65; }
a { color: inherit; text-decoration: none; text-underline-offset: .2em; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 3px; }
button { color: inherit; font: inherit; cursor: pointer; }
.icon { display: block; flex-shrink: 0; }
.skip-link { position: fixed; left: 16px; top: 12px; z-index: 10; padding: 8px 16px; background: var(--surface); border: 1px solid var(--ink); transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.theme-switch { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 102px; height: 34px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--sunk); }
.theme-switch-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 3); border: 1px solid var(--line); border-radius: 999px; background: var(--surface); transform: translateX(calc(var(--theme-index, 1) * 100%)); transition: transform 200ms ease; pointer-events: none; }
.theme-switch [data-theme-choice] { position: relative; z-index: 1; display: grid; place-items: center; min-width: 0; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--muted); line-height: 1; }
.theme-switch [data-theme-choice][aria-checked="true"], .theme-switch [data-theme-choice]:hover { color: var(--ink); }
.theme-switch [data-theme-choice]:focus-visible { outline-offset: 2px; border-radius: 999px; }
.theme-switch .icon { width: 14px; height: 14px; }
.home-shell { position: relative; min-height: 100svh; display: grid; align-content: center; padding: 56px 40px; }
.home-appearance { position: absolute; top: 24px; right: 24px; }
.home-grid { width: min(100%, 800px); margin: 0 auto; display: flex; flex-direction: column; }
.identity { min-width: 0; text-align: center; }
.name { margin: 0; font-size: 40px; line-height: 1.22; font-weight: 600; letter-spacing: .015em; }
.name > span { display: block; }
.name-en { margin-top: 8px; font-size: 28px; font-weight: 400; letter-spacing: -.015em; }
.affiliation { max-width: 680px; margin: 28px auto 0; color: var(--muted); font-size: 14px; line-height: 1.8; text-wrap: balance; }
.affiliation > span { display: block; }
.affiliation > span + span { margin-top: 4px; }
.affiliation > span[lang="en"] { font-size: var(--font-size-caption); }
.personal-nav { margin-top: 28px; display: flex; justify-content: center; align-items: flex-start; gap: 48px; flex-wrap: wrap; }
.personal-nav a { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; min-width: 56px; min-height: 52px; white-space: nowrap; font-size: var(--font-size-home-label); line-height: 1.5; }
.nav-subtitle { color: var(--muted); font-size: var(--font-size-caption); line-height: 1.5; }
.home-resources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto repeat(var(--resource-rows), auto) auto; column-gap: 48px; min-width: 0; margin-top: 44px; }
.home-tools, .home-skills { min-width: 0; display: grid; grid-template-rows: subgrid; grid-row: 1 / span var(--resource-span); }
.home-tools { grid-column: 1; }
.home-skills { grid-column: 2; }
.home-resources .tool-list { display: grid; grid-template-rows: subgrid; grid-row: 2 / span var(--resource-rows); }
.home-resources .all-tools-link { grid-row: var(--resource-span); align-self: start; justify-self: start; }
.section-kicker { font-size: 14px; line-height: 1.5; font-weight: 400; color: var(--muted); margin: 0 0 22px; }
.section-kicker-bilingual > span { display: block; }
.home-resources .section-kicker { color: var(--ink); font-size: var(--font-size-home-label); }
.section-kicker-en { color: var(--muted); font-size: var(--font-size-caption); margin-top: 3px; }
.tool-list { list-style: none; margin: 0; padding: 0; }
.tool-list li + li { margin-top: 18px; }
.tool-link { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 18px; align-items: start; padding: 8px 0; min-height: 56px; }
.tool-icon { display: grid; place-items: center; width: 28px; height: 36px; }
.tool-icon .icon { width: 28px; height: 28px; }
.tool-copy { display: block; min-width: 0; }
.tool-title { display: block; }
.tool-name { display: block; color: var(--ink); font-size: 17px; line-height: 1.45; font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.tool-name-en { display: block; color: var(--muted); font-size: var(--font-size-caption); line-height: 1.6; font-weight: 400; margin-top: 3px; overflow-wrap: anywhere; min-width: 0; }
.home-resources .tool-name { font-size: 15px; font-weight: 400; }
.tool-description, .tool-description-en { text-wrap: pretty; }
.tool-description { display: block; color: var(--muted); font-size: 14px; line-height: 1.6; margin-top: 4px; }
.tool-link:hover .tool-name { text-decoration: underline; }
.all-tools-link { display: inline-flex; gap: 8px; align-items: center; margin-top: 24px; min-height: 44px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.all-tools-subtitle { font-size: var(--font-size-caption); }
.all-tools-link .icon { width: 16px; height: 16px; }
.social-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.social-links a { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 44px; }
.social-links .icon { width: 19px; height: 19px; }
.home-social { justify-content: center; margin-top: 16px; }
.document-header { position: relative; width: min(100% - 80px, 1040px); margin: 0 auto; padding: 35px 0; display: flex; justify-content: space-between; align-items: center; gap: 28px; }
.document-appearance { flex: 0 0 auto; }
.wordmark { display: inline-flex; flex-direction: column; gap: 3px; align-items: flex-start; font-size: 18px; line-height: 1.3; font-weight: 500; white-space: nowrap; }
.wordmark .wordmark-en { font-size: var(--font-size-caption); line-height: 1.5; font-weight: 400; color: var(--muted); }
.document-nav { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; margin-left: auto; }
.document-nav a { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; min-width: 44px; min-height: 44px; font-size: 14px; line-height: 1.5; white-space: nowrap; }
.document-nav-subtitle { color: var(--muted); font-size: var(--font-size-caption); line-height: 1.5; }
.document-nav [aria-current="page"] { color: var(--accent); }
.document-main { width: min(100% - 80px, 740px); margin: 55px auto 0; }
.page-heading { margin-bottom: 38px; }
.page-heading h1, .notfound-main h1 { font-size: 28px; font-weight: 500; line-height: 1.4; margin: 0; }
.page-title-label, .page-title-subtitle { display: block; }
.page-title-label { color: var(--ink); }
.page-title-subtitle { color: var(--muted); font-size: 16px; font-weight: 400; line-height: 1.5; margin-top: 6px; }
.language-title-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; }
.language-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; padding: 3px; gap: 3px; }
.language-switch a { display: grid; place-items: center; min-height: 44px; padding: 0 15px; font-size: 14px; color: var(--muted); border-radius: 4px; }
.language-switch [aria-current="page"] { color: var(--ink); background: var(--active); }
.cv-actions { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 18px; color: var(--muted); }
.cv-actions a, .cv-actions button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; }
.cv-actions button { border: 0; background: none; padding: 0; }
.cv-actions .icon { width: 17px; height: 17px; }
.prose { font-size: 16px; line-height: 1.9; overflow-wrap: break-word; }
.about-prose { text-wrap: pretty; }
.prose p { margin: 0 0 1.2em; }
.prose h2 { font-size: 19px; font-weight: 500; line-height: 1.6; margin: 2em 0 .8em; scroll-margin-top: 24px; }
.prose h3 { font-size: 17px; font-weight: 500; margin: 1.7em 0 .7em; }
.prose a { text-decoration: underline; text-decoration-color: var(--link-underline); }
.prose ul { padding-left: 1.2em; margin: .8em 0 1.3em; }
.prose li { margin-bottom: .4em; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0 1.5em; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); font-weight: 400; vertical-align: top; }
.prose th { color: var(--muted); }
.document-footer { width: min(100% - 80px, 740px); margin: 64px auto 0; padding: 24px 0 36px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; text-align: center; }
.document-footer .social-links { width: max-content; max-width: none; flex-wrap: nowrap; justify-content: center; gap: 0; margin: 0; }
.document-footer p { color: var(--muted); font-size: var(--font-size-caption); margin: 0; }
.home-footer { margin-top: 0; padding-top: 0; border-top: 0; }
.tools-main { max-width: 740px; }
.tools-intro { color: var(--muted); font-size: 15px; margin-bottom: 28px; }
.tools-intro p { margin-bottom: 3px; }
.directory-list li + li { margin-top: 0; }
.directory-list .tool-link { grid-template-columns: 28px minmax(0, 1fr) 16px; padding: 22px 0; gap: 20px; border-bottom: 1px solid var(--line); }
.tool-description-en { display: block; color: var(--muted); font-size: 13px; line-height: 1.6; margin-top: 3px; }
.home-resources .tool-description-en { font-size: var(--font-size-caption); }
.tool-arrow { width: 16px; height: 16px; color: var(--muted); }
.notfound-main { min-height: 40vh; }
.notfound-main > p:not(.section-kicker) { color: var(--muted); margin-top: 24px; }
.notfound-links { display: flex; gap: 24px; flex-wrap: wrap; }
.notfound-links a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: underline; }
@media (max-width: 1099px) {
  .home-shell { padding: 60px 32px 44px; }
  .home-grid { max-width: 700px; }
  .home-resources { margin-top: 44px; column-gap: 36px; }
  .document-header { align-items: flex-start; flex-direction: column; gap: 10px; padding-bottom: 16px; }
  .document-header .wordmark { max-width: calc(100% - 118px); }
  .document-appearance { position: absolute; top: 35px; right: 0; }
  .document-nav { gap: 22px; margin-left: 0; }
  .document-main { margin-top: 32px; }
}
@media (max-width: 639px) {
  .home-shell { min-height: auto; display: block; padding: 86px 24px 32px; }
  .home-appearance { top: 20px; right: 24px; }
  .identity { text-align: left; }
  .name { font-size: 32px; }
  .name-en { font-size: 24px; margin-top: 7px; }
  .affiliation { margin-top: 22px; margin-inline: 0; text-wrap: pretty; }
  .personal-nav { justify-content: flex-start; margin-top: 22px; gap: 28px; }
  .home-grid { max-width: 440px; }
  .home-resources { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; margin-top: 40px; gap: 36px; }
  .home-tools, .home-skills { display: block; grid-column: auto; grid-row: auto; }
  .home-resources .tool-list { display: block; }
  .section-kicker { margin-bottom: 20px; }
  .tool-name { font-size: 16px; }
  .tool-list li + li { margin-top: 14px; }
  .tool-link { gap: 16px; padding: 10px 0; }
  .tool-icon, .tool-icon .icon { width: 26px; }
  .tool-icon .icon { height: 26px; }
  .all-tools-link { margin-top: 20px; }
  .home-social { justify-content: flex-start; gap: 0; margin-top: 14px; margin-left: -10px; }
  .document-header { width: calc(100% - 48px); padding-top: 23px; }
  .document-appearance { top: 23px; }
  .document-nav { gap: 8px; }
  .document-nav a { font-size: 13px; }
  .document-main, .document-footer { width: calc(100% - 48px); }
  .page-heading { margin-bottom: 28px; }
  .page-heading h1, .notfound-main h1 { font-size: 24px; }
  .page-title-subtitle { font-size: 14px; }
  .prose { font-size: 15px; line-height: 1.85; }
  .prose h2 { font-size: 18px; }
  .prose table { font-size: 14px; }
  .directory-list .tool-link { gap: 16px; }
  .document-footer { margin-top: 44px; }
  .home-footer { margin-top: 0; }
  .tools-intro { font-size: 14px; }
}
@media (max-width: 359px) {
  .home-shell { padding-inline: 20px; }
  .home-appearance { right: 20px; }
  .personal-nav { gap: 22px; }
  .social-links { max-width: 220px; }
  .home-social { max-width: none; width: calc(100% + 40px); margin-left: -20px; justify-content: center; }
  .document-header, .document-main, .document-footer { width: calc(100% - 40px); }
  .document-nav { gap: 6px; width: calc(100% + 20px); margin-inline: -10px; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-switch-thumb { transition: none; }
}
@media print {
  @page { size: A4; margin: 16mm 18mm; }
  :root, :root[data-theme="dark"] { color-scheme: light; --background: #fff; --ink: #111; --muted: #646d77; --line: #e8ebee; --accent: #365e83; --surface: #fff; --sunk: #f1f3f5; --active: #f1f3f5; --link-underline: #b8c1c9; }
  body { background: var(--background); color: var(--ink); font-size: 10pt; }
  .document-header, .document-footer, .skip-link, .cv-actions, .language-switch, .theme-switch, .home-appearance, .document-appearance { display: none; }
  .document-main { width: auto; max-width: none; margin: 0; }
  .page-heading { margin: 0 0 14pt; }
  .page-heading h1 { font-size: 19pt; }
  .prose { font-size: 9.4pt; line-height: 1.65; }
  .prose h2 { font-size: 11.5pt; margin-top: 16pt; margin-bottom: 6pt; break-after: avoid; }
  .cv-prose h2[id="标准相关工作"], .cv-prose h2[id="Standards-Work"] { break-before: page; margin-top: 0; }
  .prose p, .prose li { margin-bottom: 5pt; }
  .prose ul { margin-top: 5pt; margin-bottom: 8pt; }
  .prose li, .prose table { break-inside: avoid; }
  .prose th, .prose td { padding: 5pt 9pt 5pt 0; }
  a { color: inherit; text-decoration: none !important; }
}
