:root {
  --ink: #030303;
  --muted: #747972;
  --line: #e1e4df;
  --green: #6fbd43;
  --soft-green: #eaf6dd;
  --navy: #071020;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  font-synthesis: none;
  text-rendering: geometricPrecision;
}

@view-transition { navigation: auto; }
::view-transition-group(yys-brand), ::view-transition-group(yys-navigation) { animation-duration: .28s; }
* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; }
body { background: #fff; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.site-header { position: relative; z-index: 20; height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 4px clamp(28px,4vw,64px) 0; border-bottom: 1px solid rgba(3,3,3,.1); background: #f5f6f3; }
.brand { flex: 0 0 auto; view-transition-name: yys-brand; }
.brand img { width: clamp(220px,17vw,270px); height: auto; }
.nav-actions { display: flex; align-items: center; justify-content: flex-end; gap: clamp(18px,2vw,34px); margin-left: auto; view-transition-name: yys-navigation; }
.desktop-nav { --nav-line-left: 0px; --nav-line-width: 24px; position: relative; display: flex; align-items: center; gap: clamp(15px,1.55vw,28px); font-size: clamp(13px,.9vw,15px); white-space: nowrap; }
.nav-item { display: inline-flex; align-items: center; height: 34px; color: var(--ink); font-weight: 500; text-decoration: none; }
.nav-item.active, .nav-item.is-hovered { font-weight: 800; }
.nav-line { position: absolute; left: 0; bottom: -7px; width: var(--nav-line-width); height: 5px; border-radius: 999px; background: #000; transform: translateX(var(--nav-line-left)); transition: transform .28s cubic-bezier(.2,.72,.2,1), width .28s cubic-bezier(.2,.72,.2,1); }
.claim-button, .mobile-claim { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: 999px; padding: 10px 13px 10px 20px; color: #fff; background: var(--green); font-size: clamp(13px,.9vw,15px); font-weight: 850; text-decoration: none; white-space: nowrap; }
.rotating-claim-window { display: block; height: 1.2em; overflow: hidden; }
.rotating-claim-track { display: grid; line-height: 1.2; animation: rotating-claim 6s cubic-bezier(.65,0,.35,1) infinite; }
.rotating-claim-track > span { height: 1.2em; }
.round-icon, .footer-arrow { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; background: rgba(255,255,255,.16); }
.round-icon svg, .footer-arrow svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@keyframes rotating-claim { 0%,38% { transform: translateY(0); } 48%,86% { transform: translateY(-1.2em); } 96%,100% { transform: translateY(-2.4em); } }
.menu-button { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; flex-direction: column; gap: 5px; border: 0; border-radius: 50%; background: var(--navy); }
.menu-button span { width: 18px; height: 2px; border-radius: 2px; background: #fff; transition: transform .2s ease, opacity .2s ease; }
.menu-button[aria-expanded="true"] span:first-child { transform: translateY(7px) rotate(45deg); }
.menu-button[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-button[aria-expanded="true"] span:last-child { transform: translateY(-7px) rotate(-45deg); }
.mobile-nav { position: absolute; top: 74px; left: 18px; right: 18px; z-index: 30; display: grid; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.15); }
.mobile-nav[hidden] { display: none; }
.mobile-nav > a { padding: 13px 14px; border-radius: 12px; color: #181818; font-weight: 650; text-decoration: none; }
.mobile-nav > a.active { color: #fff; background: var(--navy); }
.mobile-nav > .mobile-claim { margin-top: 10px; padding: 12px 13px 12px 18px; color: #fff; }

.wiki-hero { padding: clamp(18px,2.5vw,38px) clamp(18px,4vw,64px) 0; }
.wiki-hero-inner { min-height: clamp(240px,28vw,410px); display: flex; align-items: flex-end; width: min(1540px,100%); margin: auto; padding: clamp(34px,5vw,76px); overflow: hidden; border-radius: clamp(20px,2vw,34px); background: var(--soft-green); }
.wiki-hero h1 { max-width: 1000px; margin: 0; font-size: clamp(44px,6.2vw,104px); line-height: .98; letter-spacing: -.055em; }
.wiki-library { width: min(1420px,calc(100% - clamp(36px,8vw,128px))); margin: 0 auto; padding: clamp(64px,8vw,120px) 0 clamp(100px,11vw,170px); }
.wiki-toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; }
.wiki-search { min-height: 58px; display: flex; align-items: center; gap: 13px; padding: 0 20px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.wiki-search:focus-within { border-color: #111; box-shadow: 0 0 0 3px rgba(0,0,0,.05); }
.wiki-search svg, .filter-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.wiki-search input { width: 100%; border: 0; outline: 0; color: #111; background: transparent; font-size: 16px; }
.filter-button { min-width: 118px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--line); border-radius: 999px; color: #111; background: #fff; font-weight: 800; }
.filter-button[aria-expanded="true"] { color: #fff; background: var(--navy); }
.topic-strip { display: flex; gap: 10px; overflow-x: auto; padding: 22px 0 0; scrollbar-width: none; }
.topic-strip::-webkit-scrollbar { display: none; }
.topic-strip button { flex: 0 0 auto; min-height: 40px; border: 1px solid var(--line); border-radius: 999px; padding: 0 17px; color: #40443f; background: #fff; }
.topic-strip button.active { border-color: var(--green); color: #fff; background: var(--green); font-weight: 800; }
.wiki-layout { display: grid; grid-template-columns: 245px minmax(0,1fr); gap: clamp(38px,5vw,76px); padding-top: 66px; }
.category-panel { align-self: start; display: grid; gap: 8px; padding: 18px; border-radius: 20px; background: #f5f6f3; }
.category-heading, .category-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.category-heading { padding: 8px 10px 15px; color: #757a73; font-size: 13px; font-weight: 750; }
.category-heading small { font: inherit; }
.category-item { min-height: 48px; border: 0; border-radius: 13px; padding: 0 13px; color: #313430; text-align: left; background: transparent; }
.category-item.active { color: #fff; background: var(--navy); font-weight: 750; }
.results-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.results-heading h2 { margin: 0; font-size: clamp(30px,3.1vw,48px); line-height: 1.05; letter-spacing: -.035em; }
.results-heading span { color: var(--muted); font-size: 13px; }
.wiki-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 28px 18px; padding-top: 30px; }
.empty-library { min-height: 360px; display: grid; place-items: center; align-content: center; gap: 9px; text-align: center; color: var(--muted); }
.empty-mark { width: 52px; height: 52px; margin-bottom: 10px; border-radius: 18px 18px 5px 18px; background: var(--soft-green); transform: rotate(-7deg); }
.empty-library strong { color: #30332f; font-size: 19px; }
.empty-library p { margin: 0; font-size: 14px; }
.peer-system-footer { min-height: 124px; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: clamp(32px,5vw,72px); padding: 30px max(32px,calc((100vw - 1232px)/2)); background: var(--green); }
.peer-system-back { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; border: 1px solid rgba(3,3,3,.18); border-radius: 999px; padding: 0 19px 0 12px; color: var(--ink); background: #fff; font-size: 14px; font-weight: 850; text-decoration: none; }
.peer-system-back .footer-arrow { width: 28px; height: 28px; background: rgba(3,3,3,.08); }
.peer-system-meta { display: grid; justify-items: end; gap: 7px; color: rgba(255,255,255,.88); font-size: 12px; font-weight: 800; line-height: 1.6; text-align: right; }

@media (max-width: 1180px) {
  .desktop-nav, .claim-button { display: none; }
  .menu-button { display: flex; }
  .site-header { height: 72px; padding-inline: 22px; }
  .brand img { width: clamp(168px,36vw,210px); }
}
@media (max-width: 760px) {
  .wiki-hero { padding: 12px 12px 0; }
  .wiki-hero-inner { min-height: 210px; padding: 28px 24px; border-radius: 20px; }
  .wiki-hero h1 { max-width: 6em; font-size: clamp(38px,12vw,58px); line-height: 1.02; }
  .wiki-library { width: calc(100% - 28px); padding: 48px 0 90px; }
  .wiki-toolbar { grid-template-columns: minmax(0,1fr) 104px; gap: 9px; }
  .wiki-search { min-height: 52px; padding-inline: 15px; }
  .wiki-search input { font-size: 14px; }
  .filter-button { min-width: 0; }
  .topic-strip { margin-right: -14px; padding-right: 14px; }
  .topic-strip[hidden] { display: none; }
  .wiki-layout { grid-template-columns: 1fr; gap: 28px; padding-top: 46px; }
  .category-panel { display: none; }
  .results-heading h2 { font-size: 32px; }
  .empty-library { min-height: 300px; }
  .peer-system-footer { grid-template-columns: 1fr; gap: 22px; min-height: 180px; padding: 28px 22px; }
  .peer-system-meta { justify-items: end; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .rotating-claim-track { animation: none; } }

/* Content-library layout: navigation on the left, content on the right. */
.wiki-hero { display: none; }
.wiki-library {
  width: 100%;
  min-height: calc(100vh - 78px);
  display: grid;
  grid-template-columns: clamp(260px, 23vw, 350px) minmax(0, 1fr);
  margin: 0;
  padding: 0;
}
.category-panel {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: calc(100vh - 78px);
  max-height: 100vh;
  display: block;
  overflow-y: auto;
  padding: clamp(46px, 6vw, 86px) clamp(24px, 3vw, 48px) 60px;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #f5f6f3;
}
.category-title-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 42px; }
.category-title-row h1 { margin: 0; font-size: clamp(37px, 3.5vw, 56px); line-height: 1; letter-spacing: -.045em; }
.category-close { display: none; }
.category-tree { display: grid; gap: 7px; }
.category-item {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  border-radius: 12px;
  padding: 0 13px;
  color: #3e433c;
  text-align: left;
  background: transparent;
  transition: color .18s ease, background .18s ease;
}
.category-item:hover { background: rgba(255,255,255,.75); }
.category-item.active { color: #fff; background: var(--navy); font-weight: 800; }
.category-item.level-2 { min-height: 40px; padding-left: 27px; font-size: 14px; }
.category-item.level-3 { min-height: 38px; padding-left: 42px; color: #737870; font-size: 13px; }
.category-item.level-3.active { color: #fff; }
.category-count { flex: 0 0 auto; color: inherit; font-size: 11px; opacity: .58; }
.wiki-results { min-width: 0; padding: clamp(46px, 6vw, 88px) clamp(30px, 6vw, 100px) clamp(100px, 10vw, 160px); }
.wiki-toolbar { display: grid; grid-template-columns: minmax(0, 620px); justify-content: end; gap: 12px; margin-bottom: clamp(64px, 7vw, 104px); }
.wiki-search { min-height: 54px; }
.filter-button { display: none; }
.results-heading { padding-bottom: 25px; }
.results-heading h2 { font-size: clamp(34px, 4vw, 58px); }
.wiki-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding-top: 28px; }
.wiki-card {
  min-width: 0;
  min-height: 238px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 34px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(24px, 2.8vw, 36px);
  color: var(--ink);
  background: #fff;
  text-decoration: none;
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}
.wiki-card:hover { transform: translateY(-4px); border-color: transparent; box-shadow: 0 18px 46px rgba(20,27,19,.11); }
.wiki-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.wiki-card-type { display: inline-flex; align-items: center; min-height: 27px; border-radius: 999px; padding: 0 10px; color: #4e7f34; background: var(--soft-green); font-size: 11px; font-weight: 800; }
.wiki-card-arrow { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; color: #fff; background: var(--navy); }
.wiki-card-arrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.wiki-card h3 { margin: 0; font-size: clamp(24px, 2.2vw, 34px); line-height: 1.18; letter-spacing: -.035em; }
.wiki-card-en { display: block; margin-top: 9px; color: #8a8e88; font-size: 12px; line-height: 1.45; }
.wiki-card-summary { margin: 14px 0 0; color: #666b64; font-size: 13px; line-height: 1.65; }
.wiki-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.wiki-card-tags span { border-radius: 999px; padding: 5px 9px; color: #71766f; background: #f4f5f2; font-size: 10px; }
.empty-library, .loading-library { min-height: 390px; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.empty-library:not([hidden]) { display: grid; }
.loading-library { display: flex; justify-content: center; gap: 12px; font-size: 13px; }
.loading-library span { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: wiki-pulse 1.1s ease-in-out infinite; }
@keyframes wiki-pulse { 50% { transform: scale(1.8); opacity: .35; } }

@media (max-width: 900px) {
  .wiki-library { width: 100%; grid-template-columns: 1fr; min-height: calc(100vh - 72px); margin: 0; padding: 0; }
  .category-panel {
    display: block;
    position: fixed;
    inset: 72px 0 0;
    z-index: 16;
    min-height: 0;
    max-height: none;
    padding: 34px 22px 60px;
    border: 0;
    transform: translateX(-102%);
    transition: transform .3s cubic-bezier(.2,.72,.2,1);
  }
  .category-panel.open { transform: translateX(0); }
  .category-title-row { margin-bottom: 28px; }
  .category-close { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; color: #fff; background: var(--navy); font-size: 24px; line-height: 1; }
  .wiki-results { padding: 36px 18px 90px; }
  .wiki-toolbar { grid-template-columns: 108px minmax(0, 1fr); margin-bottom: 54px; }
  .filter-button { min-width: 0; display: flex; min-height: 52px; }
  .wiki-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .results-heading h2 { font-size: 31px; }
  .wiki-card { min-height: 214px; border-radius: 17px; padding: 23px; }
  .wiki-card h3 { font-size: 25px; }
  .wiki-toolbar { margin-bottom: 46px; }
}

/* Document directory and reader */
.wiki-library { grid-template-columns: clamp(300px, 25vw, 390px) minmax(0, 1fr); }
.category-panel { padding: 36px clamp(24px, 2.5vw, 42px) 56px; }
.category-title-row { margin-bottom: 22px; }
.category-title-row h1 { font-size: clamp(23px, 2vw, 30px); line-height: 1.15; letter-spacing: -.025em; }
.sidebar-search { min-height: 48px; margin-bottom: 38px; padding-inline: 15px; background: #fff; }
.sidebar-search input { font-size: 13px; }
.category-tree { display: block; }
.category-loading { display: block; padding: 18px 4px; color: var(--muted); font-size: 13px; }
.directory-group { border-top: 1px solid #d9ddd5; padding: 9px 0; }
.directory-group:last-child { border-bottom: 1px solid #d9ddd5; }
.category-toggle { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 0; padding: 0 4px; color: #171917; text-align: left; background: transparent; font-size: 15px; font-weight: 850; }
.category-toggle svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; transition: transform .22s ease; }
.directory-group.open .category-toggle svg { transform: rotate(180deg); }
.category-content { display: none; padding: 0 0 11px; }
.directory-group.open .category-content { display: block; }
.directory-level-2 { margin: 14px 8px 7px; color: #555a53; font-size: 12px; line-height: 1.4; }
.directory-level-3 { margin: 12px 16px 6px; color: #858a82; font-size: 11px; line-height: 1.4; }
.resource-nav-item { width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; border-radius: 10px; padding: 9px 10px; color: #50554e; text-align: left; background: transparent; font-size: 13px; line-height: 1.45; transition: color .16s ease, background .16s ease; }
.resource-nav-item:hover { color: #111; background: rgba(255,255,255,.72); }
.resource-nav-item.active { color: #fff; background: var(--navy); font-weight: 750; }
.resource-nav-item small { flex: 0 0 auto; color: inherit; font-size: 9px; opacity: .6; }
.wiki-results { padding: clamp(44px, 6vw, 84px) clamp(32px, 7vw, 120px) clamp(100px, 11vw, 170px); }
.wiki-toolbar { display: none; margin: 0 0 30px; }
.document-viewer { width: min(980px, 100%); min-height: 620px; margin: 0 auto; }
.document-loading { min-height: 420px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 13px; }
.document-loading[hidden] { display: none; }
.document-loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: wiki-pulse 1.1s ease-in-out infinite; }
.document-header { padding-bottom: clamp(34px, 5vw, 66px); border-bottom: 1px solid var(--line); }
.document-header[hidden], .document-body[hidden], .document-unavailable[hidden] { display: none; }
.document-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: clamp(38px, 5vw, 64px); }
.document-type { display: inline-flex; align-items: center; min-height: 29px; border-radius: 999px; padding: 0 11px; color: #4e7f34; background: var(--soft-green); font-size: 11px; font-weight: 800; }
.document-source { display: inline-flex; align-items: center; min-height: 38px; border: 1px solid var(--line); border-radius: 999px; padding: 0 15px; color: #171917; font-size: 12px; font-weight: 750; text-decoration: none; }
.document-source:hover { color: #fff; background: var(--navy); }
.document-header h2 { max-width: 900px; margin: 0; font-size: clamp(44px, 5.6vw, 82px); line-height: 1.06; letter-spacing: -.05em; text-wrap: balance; }
.document-title-en { margin: 20px 0 0; color: #929690; font-size: 13px; line-height: 1.5; }
.document-title-en[hidden] { display: none; }
.document-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 26px; }
.document-tags span { border-radius: 999px; padding: 6px 10px; color: #656a63; background: #f2f4ef; font-size: 10px; }
.document-body { padding-top: clamp(52px, 6vw, 82px); }
.document-pdf { width: 100%; height: min(82vh, 1080px); min-height: 680px; display: block; border: 1px solid var(--line); border-radius: 14px; background: #f3f4f1; }
.document-body p { margin: 0 0 1.25em; color: #292c28; font-size: clamp(16px, 1.35vw, 19px); line-height: 1.9; text-align: justify; overflow-wrap: anywhere; }
.document-body h3 { margin: 2.5em 0 .9em; color: #111; font-size: clamp(25px, 2.8vw, 38px); line-height: 1.25; letter-spacing: -.025em; }
.document-body h3:first-child { margin-top: 0; }
.document-space { height: .65em; }
.document-unavailable { min-height: 360px; display: grid; place-items: center; align-content: center; gap: 10px; text-align: center; }
.document-unavailable strong { font-size: 20px; }
.document-unavailable p { margin: 0; color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  .category-panel { display: block; padding: 30px 22px 60px; }
  .category-title-row h1 { font-size: 25px; }
  .wiki-results { padding: 24px 18px 90px; }
  .wiki-toolbar { display: flex; }
  .filter-button { width: auto; min-width: 122px; padding-inline: 15px; }
  .document-viewer { min-height: 520px; }
  .document-header h2 { font-size: clamp(38px, 10vw, 58px); }
  .document-meta-row { margin-bottom: 40px; }
  .document-pdf { min-height: 72vh; border-radius: 10px; }
}
