@layer reset,base,layout,components,material,responsive;
@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  body,
  h1,
  h2,
  h3,
  p {
    margin: 0;
  }
  button,
  input,
  select,
  textarea {
    font: inherit;
  }
  button,
  a,
  input,
  textarea,
  select {
    -webkit-tap-highlight-color: transparent;
  }
  button {
    cursor: pointer;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
  img,
  canvas,
  svg {
    max-width: 100%;
  }
  button {
    color: inherit;
  }
  button:disabled {
    cursor: wait;
    opacity: 0.65;
  }
  [hidden] {
    display: none !important;
  }
}
@layer base {
  :root {
    --surface: #e0e7ef;
    --ink: #203747;
    --muted: #405b6e;
    --accent: #12667a;
    --shadow: #b2c0ce;
    --light: #fff;
    --line: #bdced9;
    --glass: linear-gradient(145deg, #edf3f8eb, #dbe4edeb);
    --glass-solid: #e0e7ef;
    --glass-edge: #ffffff52;
    --glass-blur: 10px;
    --control: linear-gradient(155deg, #f1f6fa 0%, #e2eaf2 48%, #cddae7 100%);
    --control-pressed: linear-gradient(145deg, #c8d7e3, #e1ebf3);
    --control-selected: linear-gradient(145deg, #cbdde8, #e1edf4);
    --control-shadow:
      -5px -5px 11px #ffffffed, 6px 7px 12px #aebdccbd, 0 3px 1px #acbccbd9,
      inset 1px 1px 2px #ffffffed, inset -1px -2px 3px #a6b9cb59;
    --control-inset:
      inset 4px 4px 8px #9bb0c2b3, inset -4px -4px 8px #ffffffd9,
      0 1px 0 #ffffffb3;
    --scroll-track: #dce5ee;
    --scroll-thumb: #456e83;
    --scroll-hover: #286e83;
    --raised:
      9px 9px 19px #afbdcde6, -9px -9px 19px #ffffffed,
      inset 1px 1px 2px #ffffffbf, inset -1px -1px 2px #aebfce59;
    --inset: inset 5px 5px 10px #acbccdcc, inset -5px -5px 10px #fffffff2;
    --radius: 20px;
    --font:
      ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei",
      sans-serif;
  }
  html {
    scroll-behavior: smooth;
    scroll-padding-top: 24px;
  }
  body {
    font-family: var(--font);
    background: var(--surface);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
  }
  ::selection {
    background: #b9d5ce;
    color: #173e35;
  }
  h1,
  h2,
  h3 {
    line-height: 1.4;
    text-wrap: balance;
  }
  h1 {
    font-size: 36px;
    letter-spacing: -1.2px;
  }
  h2 {
    font-size: 23px;
    letter-spacing: -0.5px;
  }
  h3 {
    font-size: 17px;
  }
  p {
    color: var(--muted);
  }
  button {
    border: 0;
    background: var(--surface);
  }
  a,
  button,
  input,
  select,
  textarea {
    outline-offset: 5px;
  }
  :focus-visible {
    outline: 3px solid var(--accent) !important;
  }
  a:hover {
    color: var(--accent);
  }
  .icon {
    width: 21px;
    height: 21px;
    flex-shrink: 0;
    vertical-align: middle;
  }
  .neu {
    background: var(--surface);
    box-shadow: var(--raised);
    border-radius: var(--radius);
  }
  .inset {
    background: var(--surface);
    box-shadow: var(--inset);
    border-radius: 16px;
  }
  .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;
  }
  .skip {
    position: fixed;
    top: -100px;
    left: 24px;
    z-index: 1000;
    padding: 12px 24px;
    background: var(--surface);
    box-shadow: var(--raised);
  }
  .skip:focus {
    top: 16px;
  }
  .live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px #326b6210;
    margin-right: 8px;
  }
  .english,
  .source-label {
    font-size: 12px;
    letter-spacing: 0.2px;
    color: var(--muted);
  }
  .eyebrow {
    display: block;
    color: var(--accent);
    font-size: 13px;
    margin-bottom: 14px;
  }
  .metadata,
  .helper {
    font-size: 12px;
    line-height: 1.8;
    color: var(--muted);
  }
  .metadata {
    margin-top: 22px;
  }
  .term-link {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: #91aca7;
    text-underline-offset: 4px;
  }
  .definition {
    font-size: 20px;
    line-height: 1.9;
  }
  .text-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
  }
  .chip {
    display: inline-flex;
    flex-direction: column;
    border-radius: 12px;
    box-shadow: var(--inset);
    padding: 10px 16px;
    font-size: 13px;
    line-height: 1.7;
  }
  .chip small {
    font-size: 11px;
    color: var(--muted);
  }
  .term-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0;
  }
  .button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 13px;
    padding: 11px 21px;
    font-size: 14px;
    font-weight: 600;
    border: 0;
    transition: box-shadow 0.2s;
  }
  .button:hover,
  .icon-button:hover {
    box-shadow:
      3px 3px 7px var(--shadow),
      -3px -3px 7px var(--light);
  }
  .button:active {
    box-shadow: var(--inset);
  }
  .button.primary {
    color: var(--accent);
  }
  .icon-button {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 13px;
    flex-shrink: 0;
  }
  .icon-button.small {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }
  .button[aria-pressed="true"],
  button[data-save][aria-pressed="true"] {
    color: var(--accent);
    box-shadow: var(--inset);
  }
  [data-save][aria-pressed="true"] svg {
    fill: #326b6226;
  }
}
@layer layout {
  .layout {
    display: flex;
    min-height: 100vh;
  }
  .sidebar {
    width: 244px;
    flex-shrink: 0;
    padding: 37px 23px 24px;
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--surface);
    box-shadow: 5px 0 18px #bdc6d138;
    z-index: 30;
  }
  .main-shell {
    width: calc(100% - 244px);
    margin-left: 244px;
  }
  .topbar {
    height: 86px;
    padding: 0 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }
  .topbar-left,
  .topbar-actions {
    display: flex;
    align-items: center;
    gap: 23px;
  }
  .breadcrumb-top {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    gap: 12px;
    align-items: center;
  }
  .breadcrumb-top strong {
    font-weight: 500;
    color: var(--ink);
  }
  .subtle-link {
    display: flex;
    gap: 7px;
    align-items: center;
    font-size: 12px;
  }
  .subtle-link .icon {
    width: 16px;
    height: 16px;
  }
  main {
    padding: 0 48px 48px;
    max-width: 1600px;
    margin: 0 auto;
    outline: none;
  }
  footer {
    margin: 0 48px;
    padding: 28px 0 25px;
    border-top: 1px solid #c9d1da;
    font-size: 11px;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 14px;
  }
  footer div {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
  }
  footer p {
    width: 100%;
    font-size: 11px;
  }
  .section {
    margin-top: 43px;
  }
  .section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 23px;
  }
  .section-heading h2 {
    font-size: 21px;
  }
  .section-heading p {
    font-size: 13px;
    margin-top: 7px;
  }
  .tools-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 23px;
  }
  .page-heading {
    padding: 28px 0 32px;
  }
  .page-heading p {
    margin-top: 15px;
    max-width: 65ch;
  }
  .tool-layout,
  .reader-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 32px;
    align-items: start;
  }
  .reader-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
  }
  .catalog-layout {
    display: grid;
    grid-template-columns: 196px minmax(0, 1fr);
    gap: 26px;
    margin-top: 25px;
  }
  .catalog-results .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .book-grid,
  .workflow-grid,
  .glossary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 28px;
  }
}
@layer components {
  .brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 40px;
  }
  .brand > span:last-child {
    font-family: Georgia, serif;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -0.7px;
    line-height: 1.2;
  }
  .brand small {
    display: block;
    font-family: var(--font);
    font-size: 10px;
    letter-spacing: 4px;
    margin-top: 8px;
    font-weight: 400;
    color: var(--muted);
  }
  .brand-mark {
    width: 44px;
    height: 48px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
  }
  .brand-mark .icon {
    width: 29px;
    height: 29px;
  }
  .nav-label {
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 1px;
    padding: 0 13px;
    margin: 0 0 13px;
  }
  .primary-nav,
  .cluster-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 30px;
  }
  .primary-nav a,
  .cluster-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 45px;
    padding: 10px 13px;
    border-radius: 12px;
    font-size: 13px;
    color: #4c5c6e;
  }
  .primary-nav a span,
  .cluster-nav a span {
    margin-left: auto;
    font-size: 10px;
    color: var(--muted);
  }
  .primary-nav a[aria-current="page"] {
    box-shadow: var(--inset);
    color: var(--accent);
    font-weight: 600;
  }
  .primary-nav a:hover,
  .cluster-nav a:hover {
    color: var(--accent);
    box-shadow:
      3px 3px 7px var(--shadow),
      -3px -3px 7px var(--light);
  }
  .cluster-nav {
    gap: 3px;
    margin-bottom: 20px;
  }
  .cluster-nav .icon {
    width: 18px;
    height: 18px;
  }
  .cluster-nav a {
    font-size: 12px;
    min-height: 39px;
  }
  .sidebar-bottom {
    margin-top: auto;
    padding: 18px 14px;
    flex-shrink: 0;
  }
  .sidebar-bottom strong {
    font-size: 11px;
    font-weight: 500;
  }
  .sidebar-bottom p {
    font-size: 10px;
    line-height: 1.9;
    margin: 8px 0 10px 15px;
  }
  .sidebar-bottom a {
    font-size: 10px;
    color: var(--accent);
    margin-left: 15px;
  }
  .sidebar-bottom .icon {
    width: 13px;
    height: 13px;
  }
  .sidebar-about {
    font-size: 10px;
    color: var(--muted);
    padding: 17px 15px 0;
  }
  .mobile-menu,
  .mobile-close {
    display: none;
  }
  .hero {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    min-height: 320px;
    align-items: center;
    padding: 14px 0 18px;
  }
  .hero-note {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 23px;
  }
  .hero h1 {
    font-family: Georgia, "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
    font-size: clamp(30px, 3vw, 46px);
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 1px;
  }
  .hero h1 span {
    color: var(--accent);
  }
  .hero-copy > p {
    font-size: 13px;
    line-height: 1.9;
    margin-top: 18px;
  }
  .hero-metrics {
    display: flex;
    gap: 37px;
    margin-top: 30px;
  }
  .hero-metrics > div {
    display: flex;
    flex-direction: column;
  }
  .hero-metrics strong {
    font-size: 25px;
    font-weight: 500;
    letter-spacing: -0.5px;
  }
  .hero-metrics strong small {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
  }
  .hero-metrics span {
    font-size: 10px;
    color: var(--muted);
    margin-top: 4px;
  }

  .discovery {
    margin-top: 28px;
  }
  .search-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 13px 11px 21px;
    min-height: 66px;
    border-radius: 18px;
  }
  .search-bar > .icon {
    color: #718193;
  }
  .search-bar input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    min-width: 0;
    font-size: 14px;
    color: var(--ink);
    padding: 6px 0;
  }
  .search-bar input::placeholder {
    color: #607083;
  }
  .search-bar input:focus-visible {
    outline: 0 !important;
  }
  .search-bar:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
  }
  .search-submit {
    padding: 8px 25px;
    border-radius: 11px;
    min-height: 40px;
    color: var(--accent);
    font-size: 13px;
    flex-shrink: 0;
  }
  .filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 22px;
  }
  .domain-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }
  .domain-tabs button {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 11px;
    color: var(--muted);
    transition: box-shadow 0.2s;
  }
  .domain-tabs button[aria-pressed="true"] {
    box-shadow: var(--raised);
    color: var(--accent);
    font-weight: 600;
  }
  .domain-tabs .icon {
    width: 16px;
    height: 16px;
  }
  .local-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    min-height: 44px;
  }
  .local-switch input {
    position: absolute;
    width: 36px;
    height: 22px;
    opacity: 0;
    left: 0;
  }
  .switch-track {
    pointer-events: none;
    width: 35px;
    height: 20px;
    box-shadow: var(--inset);
    border-radius: 15px;
    position: relative;
  }
  .switch-track:after {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 14px;
    height: 14px;
    box-shadow:
      3px 3px 5px var(--shadow),
      -2px -2px 4px var(--light);
    border-radius: 50%;
    background: var(--surface);
    transition: left 0.2s;
  }
  .local-switch input:checked + .switch-track:after {
    left: 18px;
    background: var(--accent);
  }
  .local-switch input:focus-visible + .switch-track {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
  }
  .popular {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 17px;
    font-size: 11px;
    color: var(--muted);
  }
  .popular span {
    color: #405467;
  }
  .popular a {
    text-decoration: underline;
    text-decoration-color: #bec9d0;
    text-underline-offset: 4px;
  }
  .tool-card {
    padding: 21px 22px 17px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s;
  }
  .tool-card:hover {
    box-shadow:
      4px 4px 9px var(--shadow),
      -4px -4px 9px var(--light);
  }
  .tool-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 17px;
  }
  .tool-symbol {
    width: 42px;
    height: 42px;
    box-shadow: var(--inset);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    color: #557d76;
    flex-shrink: 0;
  }
  .tool-symbol.human {
    color: #7e6a84;
  }
  .tool-symbol.animal {
    color: #8a7250;
  }
  .tool-symbol.plant {
    color: #527951;
  }
  .tool-symbol .icon {
    width: 22px;
    height: 22px;
  }
  .mode-tag {
    font-size: 10px;
    white-space: nowrap;
    color: var(--accent);
    letter-spacing: 0.1px;
  }
  .mode-tag.external {
    color: #776545;
  }
  .save-button {
    width: 36px;
    height: 36px;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #778594;
  }
  .save-button .icon {
    width: 16px;
    height: 16px;
  }
  .tool-title {
    display: block;
    margin-bottom: 10px;
  }
  .tool-title h3 {
    font-size: 15px;
    font-weight: 600;
  }
  .tool-card > p {
    font-size: 11px;
    line-height: 1.9;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px;
  }
  .tool-meta {
    border-top: 1px solid #cbd3dd;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 17px;
    padding-top: 12px;
    font-size: 9px;
    color: #56667a;
  }
  .domain-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
  }
  .domain-card {
    padding: 22px 18px;
    display: flex;
    align-items: center;
    gap: 13px;
    position: relative;
    min-height: 122px;
  }
  .domain-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 49px;
    height: 61px;
    border-radius: 44%;
    box-shadow:
      5px 5px 10px #b7c2d0,
      -5px -5px 10px #ffffffc0;
    color: var(--accent);
    flex-shrink: 0;
  }
  .domain-illustration .icon {
    width: 30px;
    height: 30px;
  }
  .domain-card.animal .domain-illustration {
    color: #866c4c;
  }
  .domain-card.human .domain-illustration {
    color: #826d80;
  }
  .domain-card .english {
    font-size: 9px;
  }
  .domain-card h3 {
    font-size: 16px;
    margin-top: 4px;
  }
  .domain-card p {
    font-size: 10px;
    margin-top: 5px;
  }
  .round-arrow {
    position: absolute;
    right: 13px;
    top: 17px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .round-arrow .icon {
    width: 12px;
    height: 12px;
  }
  .knowledge-banner {
    padding: 35px 30px;
    display: flex;
    gap: 34px;
    align-items: center;
  }
  .knowledge-banner h2 {
    font-size: 25px;
    font-family: Georgia, "Songti SC", serif;
    letter-spacing: 0.3px;
  }
  .knowledge-banner p {
    font-size: 12px;
    margin: 13px 0 19px;
    line-height: 1.9;
  }
  .knowledge-banner .eyebrow {
    font-size: 10px;
  }
  .knowledge-banner .button {
    font-size: 12px;
    min-height: 40px;
  }
  .book-object {
    height: 150px;
    width: 113px;
    flex-shrink: 0;
    position: relative;
    transform: perspective(600px) rotateY(-16deg) rotateZ(-7deg);
    border-radius: 4px 12px 12px 4px;
    box-shadow:
      12px 15px 19px #b3bfcc,
      -3px -3px 8px #fff,
      inset 7px 0 6px #cad5dc;
    background: #d4dee3;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 5px solid #b7c9cb;
  }
  .book-object span {
    font-family: "Songti SC", serif;
    font-size: 22px;
    line-height: 1.8;
    letter-spacing: 6px;
    color: #355a56;
  }
  .book-object i {
    position: absolute;
    right: -5px;
    top: 7px;
    bottom: 5px;
    width: 5px;
    background: repeating-linear-gradient(#e5e9ed 0 2px, #c3cdd7 2px 3px);
    border-radius: 0 4px 4px 0;
  }
  .library-stats {
    margin-left: auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
  }
  .library-stats strong {
    font-size: 25px;
    font-weight: 500;
  }
  .library-stats span {
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 12px;
  }
  .breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    font-size: 12px;
    color: var(--muted);
    padding: 15px 0;
  }
  .breadcrumbs span[aria-current] {
    color: var(--ink);
  }
  .catalog-filters {
    padding: 21px 13px;
    height: fit-content;
  }
  .catalog-filters h2,
  .catalog-filters h3 {
    font-size: 12px;
    margin: 0 10px 13px;
    font-weight: 600;
  }
  .catalog-filters a {
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 11px;
    border-radius: 9px;
    min-height: 39px;
  }
  .catalog-filters a[aria-current] {
    color: #1d574a;
    font-weight: 600;
    background: #cbd9dc;
  }
  .catalog-filters a span {
    margin-left: auto;
    font-size: 10px;
  }
  .catalog-filters .icon {
    width: 15px;
    height: 15px;
  }
  .catalog-filters hr {
    border: 0;
    border-top: 1px solid #c2cdd7;
    margin: 19px 10px;
  }
  .results-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 23px;
    font-size: 12px;
    min-height: 36px;
  }
  .results-toolbar select {
    border: 0;
    background: var(--surface);
    font-size: 11px;
    color: var(--muted);
    max-width: 150px;
    padding: 7px;
  }
  .results-toolbar p {
    font-size: 12px;
  }
  .pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 30px;
    font-size: 12px;
  }
  .empty-state {
    text-align: center;
    padding: 80px 25px;
    grid-column: 1/-1;
  }
  .empty-state p {
    margin: 18px 0 26px;
  }
  .empty-number {
    font-size: 100px;
    letter-spacing: -8px;
    color: var(--accent);
  }
  .tool-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 20px 0 32px;
  }
  .tool-heading h1 {
    font-size: 30px;
    margin: 14px 0;
  }
  .tool-heading p {
    max-width: 65ch;
    font-size: 14px;
  }
  .tool-heading > .button {
    flex-shrink: 0;
  }
  .tag-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
  }
  .tag-row .chip {
    padding: 6px 12px;
    font-size: 11px;
  }
  .work-panel {
    padding: 28px;
  }
  .panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
  }
  .panel-heading h2 {
    font-size: 18px;
  }
  .panel-heading > span {
    font-size: 10px;
    color: var(--accent);
  }
  .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }
  .field {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .field.full {
    grid-column: 1/-1;
  }
  .field label {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 9px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
  }
  .field label span {
    font-size: 11px;
    color: var(--muted);
    font-weight: 400;
  }
  .field input,
  .field textarea,
  .field select {
    border: 0;
    box-shadow: var(--inset);
    background: var(--surface);
    border-radius: 12px;
    padding: 13px 15px;
    color: var(--ink);
    min-width: 0;
    width: 100%;
    min-height: 48px;
    font-size: 14px;
  }
  .field textarea {
    resize: vertical;
    font-family: ui-monospace, monospace;
    font-size: 13px;
    line-height: 1.8;
  }
  .field input[aria-invalid="true"] {
    outline: 2px solid #994d4d;
  }
  .form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
  }
  .form-error {
    color: #923f3f;
    font-size: 13px;
    padding: 15px 0;
  }
  .result-panel {
    padding: 23px;
    margin-top: 27px;
  }
  .result-panel .panel-heading {
    margin-bottom: 10px;
  }
  .result-panel .panel-heading > div {
    display: flex;
  }
  .result-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
    padding: 11px 0;
    border-bottom: 1px solid #c3cdd7;
  }
  .result-row:last-child {
    border: 0;
  }
  .result-row > span {
    font-size: 12px;
  }
  .result-row strong {
    font-size: 22px;
    color: var(--accent);
    font-weight: 500;
    overflow-wrap: anywhere;
    text-align: right;
  }
  .result-row small {
    font-size: 11px;
    margin-left: 5px;
    color: var(--muted);
  }
  .result-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: ui-monospace, monospace;
    font-size: 12px;
    padding: 14px 0;
    max-height: 450px;
    overflow: auto;
  }
  .result-panel .helper {
    margin-top: 15px;
  }
  .result-chart {
    width: 100%;
    height: auto;
    margin-top: 20px;
  }
  .article-section {
    margin-top: 32px;
  }
  .article-section h2 {
    font-size: 20px;
    margin-bottom: 16px;
  }
  .article-section p {
    font-size: 14px;
    line-height: 1.9;
  }
  .formula {
    padding: 20px;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.8;
    overflow-wrap: anywhere;
    margin-bottom: 18px;
  }
  .source-list {
    padding-left: 20px;
  }
  .source-list li {
    margin-bottom: 18px;
  }
  .source-list a {
    color: var(--accent);
    font-size: 13px;
  }
  .source-list .icon {
    width: 13px;
    height: 13px;
  }
  .source-list p {
    font-size: 12px;
    margin-top: 6px;
  }
  .aside-card {
    padding: 22px;
    margin-bottom: 25px;
  }
  .aside-card h2 {
    font-size: 14px;
    margin-bottom: 17px;
  }
  .aside-card p {
    font-size: 12px;
    line-height: 1.9;
  }
  .aside-card > a:not(.related-link):not(.reading-link) {
    font-size: 12px;
    margin-top: 15px;
    display: inline-flex;
  }
  .related-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px;
    margin: 12px 0;
    font-size: 11px;
  }
  .related-link > .icon {
    width: 16px;
    height: 16px;
    color: var(--accent);
  }
  .related-link > .icon:last-child {
    margin-left: auto;
    width: 12px;
    height: 12px;
  }
  .related-link span {
    overflow-wrap: anywhere;
  }
  .related-link small {
    font-size: 9px;
    display: block;
    color: var(--muted);
    margin-top: 3px;
  }
  .reading-link {
    display: block;
    font-size: 13px;
    padding: 11px 0;
    border-bottom: 1px solid #c7d1db;
  }
  .reading-link small {
    font-size: 10px;
    display: block;
    color: var(--muted);
    margin-top: 4px;
  }
  .file-zone {
    padding: 27px;
    text-align: center;
    margin-bottom: 22px;
  }
  .file-zone label {
    display: block;
    font-size: 15px;
    margin: 10px;
  }
  .file-zone p {
    font-size: 11px;
    margin: 12px 0;
  }
  .file-zone input {
    max-width: 100%;
    font-size: 12px;
    min-height: 44px;
  }
  .file-zone input::file-selector-button {
    background: var(--surface);
    border: 0;
    border-radius: 8px;
    padding: 10px 15px;
    box-shadow: var(--raised);
    margin-right: 15px;
    color: var(--accent);
    cursor: pointer;
  }
  #image-preview {
    margin: 20px auto;
    max-height: 450px;
    object-fit: contain;
    display: block;
    border-radius: 10px;
  }
  .tool-form > .button {
    margin-top: 22px;
  }
  .library-intro {
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 22px 26px;
  }
  .library-intro p {
    font-size: 13px;
  }
  .library-intro .icon {
    width: 28px;
    height: 28px;
    color: var(--accent);
  }
  .book-card {
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 22px;
  }
  .book-card > div {
    flex: 1;
    min-width: 0;
  }
  .book-card h3 {
    font-size: 18px;
    margin: 9px 0;
  }
  .book-card p {
    font-size: 12px;
    line-height: 1.9;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .book-card small {
    display: block;
    margin-top: 12px;
    font-size: 10px;
    color: var(--muted);
  }
  .book-card > .icon {
    width: 15px;
    height: 15px;
  }
  .book-spine {
    width: 52px;
    height: 88px;
    border-radius: 4px 9px 9px 4px;
    box-shadow:
      5px 5px 9px var(--shadow),
      -4px -4px 8px var(--light),
      inset 4px 0 6px #c0ccd4;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
  }
  .book-spine.plant {
    color: #647b48;
  }
  .reader {
    padding: 32px;
    min-width: 0;
  }
  .reader p {
    font-size: 15px;
    line-height: 1.95;
    margin: 17px 0;
    overflow-wrap: anywhere;
  }
  .reader h2 {
    font-size: 22px;
    margin: 30px 0 17px;
  }
  .reader h2:first-child {
    margin-top: 0;
  }
  .reader h3 {
    font-size: 18px;
    margin: 24px 0 14px;
    overflow-wrap: anywhere;
  }
  .reader .helper {
    font-size: 12px;
  }
  .reader-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    border-bottom: 1px solid #c4ced7;
    padding-bottom: 20px;
    margin-bottom: 24px;
    font-size: 12px;
    color: var(--accent);
  }
  .book-body[lang="zh-Hant"] {
    font-family: "Songti SC", "Noto Serif CJK SC", serif;
    font-size: 18px;
  }
  .book-body[lang="zh-Hant"] p {
    font-size: 17px;
    line-height: 2.1;
  }
  .book-body[lang="en"] {
    font-family: Georgia, serif;
  }
  .book-body[lang="en"] p {
    font-size: 17px;
    line-height: 1.9;
  }
  .translation-pair {
    padding: 17px 22px;
    margin: 18px 0;
  }
  .translation-pair p {
    font-size: 14px;
  }
  .translation-pair p[lang="en"] {
    font-family: Georgia, serif;
    color: #4b6074;
  }
  .facts {
    font-size: 12px;
    margin: 23px 0;
  }
  .facts > div {
    display: grid;
    grid-template-columns: 85px 1fr;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #c4ced7;
  }
  .facts dt {
    color: var(--muted);
  }
  .facts dd {
    margin: 0;
    overflow-wrap: anywhere;
  }
  .external-description {
    font-size: 14px;
    line-height: 1.9;
    margin-top: 14px;
    overflow-wrap: anywhere;
  }
  .glossary-card {
    padding: 26px;
  }
  .glossary-card h2 {
    font-size: 19px;
  }
  .glossary-card > span {
    font-family: Georgia, serif;
    font-size: 13px;
    display: block;
    color: var(--accent);
    margin: 7px 0 14px;
  }
  .glossary-card p {
    font-size: 13px;
    line-height: 1.85;
  }
  .workflow-card {
    padding: 30px;
  }
  .workflow-card h2 {
    font-size: 20px;
    margin: 20px 0 12px;
  }
  .workflow-card p {
    font-size: 13px;
    line-height: 1.8;
  }
  .workflow-card > span:last-child {
    display: block;
    font-size: 11px;
    color: var(--accent);
    margin-top: 25px;
  }
  .workflow-card > span:last-child .icon {
    width: 15px;
    height: 15px;
    margin-left: 15px;
  }
  .workflow-step {
    padding: 26px;
    display: flex;
    gap: 25px;
    margin: 23px 0;
  }
  .workflow-step h2 {
    font-size: 20px;
    margin-bottom: 12px;
  }
  .workflow-step p {
    font-size: 13px;
    margin-bottom: 14px;
  }
  .step-number {
    width: 47px;
    height: 47px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-family: Georgia, serif;
    font-size: 23px;
  }
  .toast {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    padding: 14px 25px;
    background: #263b37;
    color: #fff;
    font-size: 13px;
    border-radius: 14px;
    box-shadow: 0 6px 24px #243b3333;
    max-width: calc(100vw - 36px);
  }
  .lookup-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    line-height: 1.8;
    margin-top: 20px;
  }
  .lookup-table td,
  .lookup-table th {
    padding: 12px 9px;
    text-align: left;
    border-bottom: 1px solid #c4ced7;
    vertical-align: top;
    overflow-wrap: anywhere;
  }
  .lookup-table a {
    color: var(--accent);
    text-decoration: underline;
  }
  .lookup-results {
    overflow-x: auto;
  }
  .lookup-label {
    font-size: 12px;
    margin: 18px 0;
  }
  .status-label {
    padding: 5px 8px;
    border-radius: 7px;
    box-shadow: var(--inset);
    font-size: 10px;
  }
}
@layer material {
  /* The shared surface and opposing light/shadow establish the 3D material. */
  body {
    background-color: var(--surface);
    background-image:
      radial-gradient(ellipse 65% 630px at 88% 7%, #a9dce51a, transparent),
      radial-gradient(ellipse 60% 680px at 6% 56%, #c0d2f114, transparent),
      linear-gradient(#64899f03 1px, transparent 1px),
      linear-gradient(90deg, #64899f03 1px, transparent 1px);
    background-size:
      auto,
      auto,
      48px 48px,
      48px 48px;
  }
  ::selection {
    background: #b9e3ed;
    color: #183e52;
  }
  .neu {
    background: var(--glass);
    border: 1px solid var(--glass-edge);
    box-shadow: var(--raised);
  }
  .inset {
    background: #dce6efb3;
    border: 1px solid #e7eff678;
    box-shadow: var(--inset);
  }
  .sidebar {
    background: #e0e7efed;
    border-right: 1px solid var(--glass-edge);
    box-shadow:
      8px 0 22px #aabac94d,
      inset -1px 0 1px #ffffffbf;
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(120%);
    backdrop-filter: blur(var(--glass-blur)) saturate(120%);
  }
  .topbar {
    background: #e6eef626;
    border-bottom: 1px solid #ffffff26;
  }
  /* Limit large-area blur to navigation and working surfaces, not every card. */
  .work-panel,
  .knowledge-banner,
  .search-bar {
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
  }
  .reader {
    background: linear-gradient(145deg, #eaf0f6f5, #dfe7eff5);
  }
  .tool-card:hover {
    box-shadow: var(--raised);
  }
  .tool-meta,
  footer {
    border-color: #aac6d54d;
  }
  .primary-nav a[aria-current="page"],
  .catalog-filters a[aria-current="page"] {
    background: var(--control-selected);
    box-shadow: var(--control-inset);
    color: var(--accent);
  }
  :is(
    .button,
    .icon-button,
    .search-submit,
    .save-button,
    .domain-tabs button
  ) {
    background: var(--control);
    border: 1px solid var(--glass-edge);
    box-shadow: var(--control-shadow);
    transition:
      box-shadow 160ms ease,
      background-color 160ms ease,
      border-color 160ms ease,
      transform 160ms ease;
  }
  .button.primary,
  .search-submit {
    background: linear-gradient(145deg, #eaf5fa, #ccdfeb);
    border-color: #ffffff73;
    color: #12566c;
    text-shadow: 0 1px 0 #ffffffb3;
  }
  .button.inset {
    background: var(--control-pressed);
    box-shadow: var(--control-inset);
  }
  .save-button {
    color: #466b80;
  }
  .button[aria-pressed="true"],
  button[data-save][aria-pressed="true"],
  .domain-tabs button[aria-pressed="true"],
  .icon-button[aria-pressed="true"] {
    background: var(--control-selected);
    border-color: #779eaf;
    box-shadow: var(--control-inset);
    color: #174e65;
  }
  [data-save][aria-pressed="true"] svg {
    fill: #368ba83d;
  }
  :is(
      .button,
      .icon-button,
      .search-submit,
      .save-button,
      .domain-tabs button
    ):active:not(:disabled) {
    background: var(--control-pressed);
    box-shadow: var(--control-inset);
    transform: translateY(2px);
  }
  :is(.button, .icon-button, .search-submit, .save-button):disabled {
    box-shadow: none;
    transform: none;
  }
  .field input,
  .field textarea,
  .field select,
  .results-toolbar select {
    background: #dce6efcc;
    border: 1px solid #e7eff673;
    box-shadow: var(--inset);
  }
  .results-toolbar select {
    border-radius: 10px;
  }
  select option {
    background: var(--glass-solid);
    color: var(--ink);
  }
  .file-zone input::file-selector-button {
    background: var(--control);
    border: 1px solid var(--glass-edge);
    box-shadow: var(--control-shadow);
  }
  .file-zone input::file-selector-button:active {
    background: var(--control-pressed);
    box-shadow: var(--control-inset);
  }
  .switch-track {
    border: 1px solid #afc0cf;
    background: #d4e0ea;
  }
  .switch-track:after {
    top: 2px;
    left: 2px;
    background: var(--control);
    box-shadow:
      2px 2px 4px #899fb2a6,
      -1px -1px 3px #fff,
      inset 0 1px 0 #fff;
  }
  .local-switch input:checked + .switch-track:after {
    left: 17px;
    background: var(--accent);
  }
  .live-dot {
    box-shadow:
      0 0 0 4px #4198b012,
      0 0 9px #31a6c433;
  }

  .book-object {
    background: linear-gradient(130deg, #f1fcff, #c9e4ee);
    box-shadow:
      12px 15px 20px #9cafbfcc,
      -4px -4px 10px #ffffffe6,
      inset 5px 0 7px #afc6d6,
      inset 2px 0 0 #ffffffeb;
  }
  /* Native scrollbar behavior, with Chromium/WebKit and Firefox styling. */
  html {
    scrollbar-gutter: stable;
  }
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) var(--scroll-track);
  }
  ::-webkit-scrollbar {
    width: 12px;
    height: 12px;
  }
  ::-webkit-scrollbar-track {
    background: var(--scroll-track);
    border-radius: 10px;
    box-shadow:
      inset 2px 2px 4px #9bb0c273,
      inset -2px -2px 4px #fff;
  }
  ::-webkit-scrollbar-thumb {
    border: 3px solid var(--scroll-track);
    border-radius: 10px;
    background: linear-gradient(180deg, #648a9c, var(--scroll-thumb));
    box-shadow:
      inset 1px 1px 2px #ffffffa6,
      inset -1px -1px 2px #274c6373;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--scroll-hover);
  }
  ::-webkit-scrollbar-corner {
    background: var(--scroll-track);
  }
  @supports selector(::-webkit-scrollbar) {
    * {
      scrollbar-width: auto;
      scrollbar-color: auto;
    }
  }
  @media (hover: hover) and (pointer: fine) {
    :is(
        .button,
        .icon-button,
        .search-submit,
        .save-button,
        .domain-tabs button
      ):hover:not(:disabled):not([aria-pressed="true"]):not(:active) {
      border-color: #76aabe;
      box-shadow:
        -6px -6px 13px #fffffff2,
        7px 8px 14px #a6b9ccd9,
        0 3px 1px #a5bacb,
        inset 1px 1px 2px #fff,
        inset -1px -2px 3px #a6b9cb59;
    }
    .tool-card:hover {
      border-color: #ffffff8c;
      box-shadow:
        11px 11px 22px #a9bbced9,
        -10px -10px 21px #fff,
        inset 1px 1px 2px #ffffffd9,
        inset -1px -1px 2px #aebfce66;
    }
    .primary-nav a:hover,
    .cluster-nav a:hover {
      background-color: #e4edf5;
      box-shadow:
        4px 4px 8px #afbfce99,
        -4px -4px 8px #ffffffd9;
    }
  }
  @supports not (
    (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))
  ) {
    .neu,
    .sidebar,
    .topbar {
      background: var(--glass-solid);
    }
  }
}
@layer responsive {
  @media (min-width: 1600px) {
    main {
      padding-left: 65px;
      padding-right: 65px;
    }
    .hero {
      min-height: 360px;
    }
    .hero h1 {
      font-size: 50px;
    }
    .tools-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .catalog-results .tools-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }
  @media (max-width: 1200px) {
    .sidebar {
      width: 218px;
      padding: 30px 17px 22px;
    }
    .main-shell {
      margin-left: 218px;
      width: calc(100% - 218px);
    }
    main {
      padding: 0 30px 40px;
    }
    .topbar {
      padding: 0 30px;
    }
    footer {
      margin: 0 30px;
    }
    .hero h1 {
      font-size: 35px;
    }
    .hero-metrics {
      gap: 23px;
    }

    .tool-card {
      padding: 19px 17px;
    }
    .tool-card-top {
      gap: 8px;
    }
    .domain-card {
      padding: 19px 14px;
      gap: 12px;
    }
    .domain-illustration {
      width: 38px;
      height: 52px;
    }
    .domain-card h3 {
      font-size: 14px;
    }
    .domain-card p {
      font-size: 9px;
    }
    .domain-card .english {
      font-size: 8px;
    }
    .knowledge-banner {
      gap: 25px;
    }
    .book-object {
      width: 91px;
      height: 129px;
    }
    .knowledge-banner h2 {
      font-size: 23px;
    }
    .library-stats {
      padding: 0;
    }
    .tool-layout,
    .reader-layout {
      grid-template-columns: minmax(0, 1fr) 235px;
      gap: 23px;
    }
    .catalog-layout {
      grid-template-columns: 170px minmax(0, 1fr);
      gap: 22px;
    }
    .catalog-results .tool-meta {
      font-size: 8px;
    }
    .catalog-results .tool-symbol {
      width: 35px;
      height: 35px;
    }
    .catalog-results .tool-card-top {
      gap: 7px;
    }
  }
  @media (max-width: 980px) {
    .sidebar {
      width: 200px;
      padding-left: 14px;
      padding-right: 14px;
    }
    .main-shell {
      margin-left: 200px;
      width: calc(100% - 200px);
    }
    .brand > span:last-child {
      font-size: 21px;
    }
    .hero {
      grid-template-columns: 1fr 0.75fr;
    }
    .hero h1 {
      font-size: 29px;
    }
    .hero-copy > p {
      font-size: 12px;
    }
    .hero-note {
      font-size: 10px;
    }
    .hero-metrics strong {
      font-size: 22px;
    }
    .hero-metrics {
      gap: 18px;
    }
    .hero-metrics span {
      font-size: 9px;
    }

    .tools-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .domain-cards {
      grid-template-columns: 1fr;
    }
    .domain-card {
      min-height: 95px;
      padding: 18px 25px;
    }
    .domain-card h3 {
      font-size: 17px;
    }
    .domain-card .english {
      font-size: 10px;
    }
    .domain-card p {
      font-size: 11px;
    }
    .round-arrow {
      right: 24px;
      top: 36px;
    }
    .filter-row {
      align-items: flex-start;
      flex-wrap: wrap;
      gap: 10px;
    }
    .domain-tabs {
      gap: 8px;
    }
    .knowledge-banner {
      gap: 26px;
    }
    .knowledge-banner .library-stats {
      display: none;
    }
    .knowledge-banner p br {
      display: none;
    }
    .tool-layout,
    .reader-layout {
      grid-template-columns: 1fr;
    }
    .tool-aside {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 22px;
    }
    .tool-aside > .aside-card:last-child {
      grid-column: 1/-1;
    }
    .catalog-layout {
      grid-template-columns: 1fr;
    }
    .catalog-filters {
      display: none;
    }
    .book-grid {
      grid-template-columns: 1fr;
    }
    .topbar-actions .subtle-link {
      font-size: 10px;
    }
    .tool-heading h1 {
      font-size: 27px;
    }
    .glossary-grid {
      grid-template-columns: 1fr 1fr;
    }
    .work-panel {
      padding: 25px;
    }
  }
  @media (max-width: 760px) {
    .sidebar {
      visibility: hidden;
      transform: translateX(-110%);
      width: 270px;
      transition:
        transform 0.2s,
        visibility 0.2s;
      padding: 30px 24px;
      z-index: 90;
    }
    .sidebar.open {
      visibility: visible;
      transform: translateX(0);
    }
    .main-shell {
      width: 100%;
      margin: 0;
    }
    .mobile-menu {
      display: inline-flex;
    }
    .mobile-close {
      display: flex;
      position: absolute;
      right: 12px;
      top: 9px;
      padding: 10px;
      background: transparent;
    }
    .drawer-backdrop {
      position: fixed;
      inset: 0;
      background: #35465850;
      z-index: 80;
    }
    .sidebar .brand {
      margin-bottom: 28px;
    }
    .topbar {
      height: 74px;
      padding: 0 23px;
    }
    .topbar-left {
      gap: 10px;
    }
    .topbar-actions {
      gap: 12px;
    }
    .breadcrumb-top {
      font-size: 11px;
    }
    .breadcrumb-top > span,
    .breadcrumb-top > strong {
      display: none;
    }
    .topbar-actions .subtle-link {
      font-size: 10px;
      gap: 4px;
    }
    main {
      padding: 0 24px 35px;
    }
    footer {
      margin: 0 24px;
      line-height: 1.9;
    }
    .hero {
      padding-top: 10px;
      min-height: 320px;
      grid-template-columns: 1fr 0.7fr;
    }
    .hero h1 {
      font-size: 34px;
    }
    .hero-note {
      font-size: 11px;
    }
    .hero-copy > p {
      font-size: 12px;
    }
    .hero-metrics {
      gap: 22px;
    }
    .hero-metrics strong {
      font-size: 24px;
    }
    .hero-metrics span {
      font-size: 10px;
    }
    .hero-metrics {
      margin-top: 23px;
    }
    .hero-note {
      margin-bottom: 19px;
    }
    .discovery {
      margin-top: 17px;
    }
    .section {
      margin-top: 34px;
    }
    .catalog-results .tools-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .page-heading h1 {
      font-size: 30px;
    }
    .glossary-grid {
      gap: 19px;
    }
    .workflows-grid {
      grid-template-columns: 1fr;
    }
    .reader {
      padding: 26px;
    }
    .tool-heading {
      align-items: flex-start;
    }
    .tool-heading > .button {
      padding: 11px 14px;
      font-size: 12px;
    }
    .tool-heading h1 {
      font-size: 26px;
    }
    .tool-heading p {
      font-size: 13px;
    }
    .tool-aside {
      grid-template-columns: 1fr 1fr;
    }
    .book-card {
      padding: 24px;
    }
    .domain-cards {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .domain-card {
      padding: 21px 15px;
      flex-direction: column;
      align-items: flex-start;
      gap: 17px;
    }
    .domain-card .round-arrow {
      top: 23px;
      right: 14px;
    }
    .domain-illustration {
      width: 42px;
      height: 51px;
    }
    .domain-card h3 {
      font-size: 15px;
    }
    .domain-card p {
      font-size: 10px;
    }
    .domain-card .english {
      font-size: 9px;
    }
  }
  @media (max-width: 530px) {
    main {
      padding: 0 20px 32px;
    }
    .topbar {
      padding: 0 16px;
    }
    .hero {
      display: block;
      position: relative;
      min-height: unset;
      padding: 18px 0;
    }
    .hero-copy {
      position: relative;
      z-index: 2;
    }
    .hero h1 {
      font-size: 33px;
      letter-spacing: 0;
    }
    .hero-note {
      font-size: 10px;
    }
    .hero-copy > p {
      max-width: 250px;
      font-size: 11px;
    }
    .hero-copy > p br {
      display: none;
    }

    .hero-metrics {
      gap: 26px;
      margin-top: 27px;
    }
    .hero-metrics strong {
      font-size: 24px;
    }
    .hero-metrics span {
      font-size: 9px;
    }
    .search-bar {
      padding: 10px 10px 10px 16px;
      gap: 9px;
      min-height: 59px;
    }
    .search-bar input {
      font-size: 12px;
    }
    .search-submit {
      padding: 8px 17px;
      font-size: 12px;
    }
    .search-bar > .icon {
      width: 17px;
      height: 17px;
    }
    .domain-tabs {
      gap: 6px;
      justify-content: space-between;
      width: 100%;
    }
    .domain-tabs button {
      font-size: 10px;
      padding: 9px 9px;
      min-height: 44px;
      gap: 5px;
    }
    .domain-tabs .icon {
      width: 14px;
      height: 14px;
    }
    .filter-row {
      margin-top: 18px;
    }
    .local-switch {
      margin-left: auto;
      min-height: 35px;
      font-size: 10px;
    }
    .popular {
      gap: 13px;
      font-size: 10px;
      margin-top: 9px;
    }
    .popular a:last-child {
      display: none;
    }
    .section-heading {
      gap: 12px;
      margin-bottom: 21px;
    }
    .section-heading h2 {
      font-size: 19px;
    }
    .section-heading p {
      font-size: 11px;
      max-width: 250px;
      line-height: 1.8;
    }
    .text-link {
      font-size: 11px;
      gap: 4px;
      flex-shrink: 0;
    }
    .text-link .icon {
      width: 16px;
      height: 16px;
    }
    .tools-grid,
    .catalog-results .tools-grid {
      grid-template-columns: 1fr;
      gap: 19px;
    }
    .tool-card {
      padding: 20px 23px;
    }
    .tool-card-top {
      margin-bottom: 13px;
    }
    .tool-title h3 {
      font-size: 16px;
    }
    .tool-card > p {
      font-size: 12px;
      min-height: unset;
    }
    .tool-meta {
      font-size: 10px;
      margin-top: 16px;
    }
    .tool-symbol {
      width: 43px;
      height: 43px;
    }
    .mode-tag {
      font-size: 10px;
    }
    .save-button {
      width: 44px;
      height: 44px;
    }
    .tool-card-top {
      gap: 14px;
    }
    .tool-meta {
      padding-top: 12px;
    }
    .domain-cards {
      grid-template-columns: 1fr;
    }
    .domain-card {
      flex-direction: row;
      align-items: center;
      padding: 20px 24px;
      gap: 24px;
    }
    .domain-card h3 {
      font-size: 18px;
    }
    .domain-card .english {
      font-size: 10px;
    }
    .domain-card p {
      font-size: 11px;
    }
    .domain-card .round-arrow {
      right: 24px;
      top: 44px;
    }
    .domain-illustration {
      width: 48px;
      height: 59px;
    }
    .knowledge-banner {
      padding: 26px 22px;
      gap: 22px;
      position: relative;
      overflow: hidden;
    }
    .book-object span {
      display: none;
    }
    .book-object {
      position: absolute;
      right: -13px;
      top: 32px;
      opacity: 0.35;
      width: 96px;
      height: 138px;
    }
    .knowledge-banner > div:nth-child(2) {
      position: relative;
      z-index: 1;
    }
    .knowledge-banner h2 {
      font-size: 24px;
      max-width: 220px;
      line-height: 1.6;
    }
    .knowledge-banner p {
      font-size: 11px;
      max-width: 235px;
    }
    .knowledge-banner .eyebrow {
      font-size: 10px;
    }
    .topbar-actions .subtle-link {
      font-size: 0;
    }
    .topbar-actions .subtle-link .icon {
      width: 19px;
      height: 19px;
    }
    .topbar-actions {
      gap: 15px;
    }
    .topbar-actions .icon-button {
      width: 42px;
      height: 42px;
    }
    .breadcrumb-top {
      font-size: 11px;
    }
    .page-heading {
      padding-top: 20px;
    }
    .page-heading h1 {
      font-size: 29px;
    }
    .page-heading p {
      font-size: 13px;
    }
    .tool-heading {
      flex-wrap: wrap;
      gap: 18px;
    }
    .tool-heading h1 {
      font-size: 27px;
    }
    .tool-heading > .button {
      margin-left: auto;
    }
    .form-grid {
      grid-template-columns: 1fr;
      gap: 19px;
    }
    .work-panel {
      padding: 23px 20px;
    }
    .tool-layout {
      gap: 25px;
    }
    .tool-aside {
      display: block;
    }
    .result-row {
      align-items: flex-start;
      gap: 12px;
    }
    .result-row strong {
      font-size: 22px;
    }
    .result-row > span {
      font-size: 11px;
      min-width: 60px;
    }
    .result-panel {
      padding: 19px 16px;
    }
    .article-section h2 {
      font-size: 19px;
    }
    .article-section p {
      font-size: 13px;
    }
    .formula {
      font-size: 13px;
    }
    .form-actions .button {
      flex: 1;
      padding: 12px 13px;
      font-size: 12px;
    }
    .reader {
      padding: 24px 20px;
    }
    .reader p {
      font-size: 14px;
    }
    .reader h2 {
      font-size: 20px;
    }
    .reader h3 {
      font-size: 17px;
    }
    .book-body[lang="en"] p {
      font-size: 16px;
    }
    .book-body[lang="zh-Hant"] p {
      font-size: 16px;
    }
    .book-card {
      gap: 18px;
      padding: 24px 21px;
    }
    .book-spine {
      width: 39px;
      height: 72px;
    }
    .book-card h3 {
      font-size: 17px;
    }
    .book-card p {
      font-size: 11px;
    }
    .book-card > .icon {
      display: none;
    }
    .library-intro {
      padding: 21px;
      gap: 14px;
      align-items: flex-start;
    }
    .library-intro p {
      font-size: 12px;
    }
    .glossary-grid,
    .workflow-grid {
      grid-template-columns: 1fr;
    }
    .workflow-step {
      gap: 17px;
      padding: 24px 20px;
    }
    .workflow-step h2 {
      font-size: 18px;
    }
    .workflow-step p {
      font-size: 12px;
    }
    .step-number {
      width: 37px;
      height: 37px;
      font-size: 20px;
    }
    .source-list {
      padding-left: 17px;
    }
    .facts > div {
      grid-template-columns: 65px 1fr;
    }
    .pagination .button {
      font-size: 12px;
      padding: 10px 17px;
    }
    .catalog-results .tool-symbol {
      width: 43px;
      height: 43px;
    }
    .catalog-results .tool-meta {
      font-size: 10px;
    }
    .breadcrumbs {
      font-size: 10px;
      gap: 7px;
    }
    .empty-state {
      padding: 60px 15px;
    }
    .empty-state h1 {
      font-size: 26px;
    }
    .empty-state h2 {
      font-size: 20px;
    }
    .empty-state p {
      font-size: 13px;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
      transition: none !important;
      animation: none !important;
    }
  }
  [data-contrast="high"] {
    --ink: #15232f;
    --muted: #324556;
    --accent: #164a3d;
    --line: #758795;
    --glass: #edf4f8;
    --control: #edf4f8;
    --control-selected: #cce3ed;
    --scroll-thumb: #365e73;
    --scroll-hover: #164a3d;
  }
  .high-contrast .neu,
  .high-contrast .inset {
    outline: 1px solid #788b9c;
  }
  .high-contrast .sidebar,
  .high-contrast .topbar,
  .high-contrast .work-panel,
  .high-contrast .search-bar,
  .high-contrast .knowledge-banner {
    background: var(--glass-solid);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  @media (prefers-reduced-transparency: reduce) {
    :root {
      --glass: #edf4f8;
      --glass-blur: 0;
    }
    .sidebar,
    .topbar,
    .inset,
    .field input,
    .field textarea,
    .field select {
      background: var(--glass-solid);
    }
  }
  .high-contrast .mode-tag,
  .high-contrast .helper,
  .high-contrast .tool-meta {
    font-size: 12px;
  }
  @media (forced-colors: active) {
    * {
      scrollbar-color: auto;
      scrollbar-width: auto;
    }
    body,
    .sidebar,
    .topbar,
    .neu,
    .inset {
      background: Canvas;
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
    }
    .neu,
    .inset,
    button,
    input,
    select,
    textarea {
      border: 1px solid CanvasText;
    }
    .live-dot {
      background: Highlight;
    }
    .mode-tag {
      color: CanvasText;
    }
  }
  @media print {
    .sidebar,
    .topbar,
    footer,
    .save-button,
    .form-actions,
    .tool-aside,
    .reader-controls {
      display: none !important;
    }
    .main-shell {
      margin: 0;
      width: 100%;
    }
    main {
      padding: 0;
    }
    .neu,
    .inset {
      box-shadow: none !important;
      background: #fff !important;
    }
    .tool-layout,
    .reader-layout {
      display: block;
    }
    body {
      background: #fff;
      color: #000;
    }
    a {
      text-decoration: underline;
    }
    .reader {
      padding: 0;
    }
  }
}
@layer components {
  .knowledge-search {
    padding: 20px 24px;
  }
  .knowledge-search label {
    display: block;
    font-size: 13px;
    margin-bottom: 13px;
  }
  .knowledge-search > div {
    display: flex;
    gap: 15px;
  }
  .knowledge-search input {
    min-width: 0;
    flex: 1;
    background: transparent;
    border: 0;
    padding: 10px;
    font: inherit;
  }
  .knowledge-search button {
    flex-shrink: 0;
  }
  .knowledge-result {
    display: block;
    padding: 20px;
    margin-top: 15px;
  }
  .knowledge-result h3 {
    font-size: 16px;
    margin-bottom: 10px;
  }
  .knowledge-result p {
    font-size: 13px;
    line-height: 1.9;
  }
  .knowledge-result mark {
    background: #b8cdc4;
  }
  #dicom-canvas {
    max-width: 100%;
    max-height: 600px;
    object-fit: contain;
    margin: 20px auto;
    display: block;
    background: #000;
  }
  #dicom-metadata {
    margin-top: 20px;
  }
  #dicom-controls > .button {
    margin-top: 20px;
  }
}
