:root {
  color-scheme: light;
  --blue: #087af2; --blue-deep: #075fc4; --blue-soft: #eaf3ff;
  --ink: #1b2940; --muted: #607086; --line: #dfe6ef;
  --white: #ffffff; --surface: #ffffff; --page: #f5f7fb; --subtle: #f7f9fc;
  --label-bg: #edf5f0; --label-text: #306145; --button-ink: #ffffff;
  --max: 1312px;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --blue: #69aaff; --blue-deep: #85baff; --blue-soft: #1d3350;
  --ink: #e5ecf6; --muted: #a7b5c9; --line: #324055;
  --white: #172234; --surface: #172234; --page: #101a29; --subtle: #1d2a3e;
  --label-bg: #203b30; --label-text: #a3d0b7; --button-ink: #102038;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 78px; }
body { margin: 0; color: var(--ink); background: var(--page); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, a { font: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, pre:focus-visible { outline: 3px solid var(--blue-deep); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 100; padding: 12px 16px; background: var(--blue-deep); color: var(--button-ink); }
.skip-link:focus { top: 12px; }
/* Layer order: header 20, expanded conditions 10, feedback 30. */
.site-header { height: 60px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 0 max(24px, calc((100vw - var(--max))/2)); border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; white-space: nowrap; }
.brand strong { font: 850 25px/1 "Microsoft YaHei", sans-serif; letter-spacing: -.03em; }
.brand strong span { color: var(--blue); }
.brand small { color: var(--muted); font-size: 11px; }
.site-header nav { height: 100%; margin-left: auto; display: flex; }
.site-header nav a { display: flex; align-items: center; min-height: 44px; padding-inline: 14px; text-decoration: none; font-size: 13px; font-weight: 650; white-space: nowrap; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--blue-deep); box-shadow: inset 0 -2px var(--blue); }
.theme-toggle, .nav-toggle { min-height: 34px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 12px; white-space: nowrap; }
.theme-toggle:hover, .nav-toggle:hover { color: var(--blue-deep); border-color: var(--blue-deep); }
.nav-toggle { display: none; }
.portal-layout { display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 24px; max-width: 1360px; margin: 0 auto; padding: 16px 24px 32px; }
.category-rail { position: sticky; top: 76px; align-self: start; max-height: calc(100dvh - 92px); overflow-y: auto; padding: 8px 12px 16px 0; border-right: 1px solid var(--line); scrollbar-width: thin; }
.rail-label { margin: 0 10px 9px; color: var(--muted); font-size: 11px; }
.category-filters { display: grid; gap: 4px; }
.category-filters button, .rail-favorites { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 40px; padding: 8px 9px; border: 0; border-radius: 6px; color: var(--ink); background: transparent; font-size: 12px; text-align: left; white-space: nowrap; }
.category-mark { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 11px; }
.category-filters button small, .rail-favorites small { margin-left: auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.category-filters button:hover, .rail-favorites:hover { background: var(--blue-soft); }
.category-filters button[aria-pressed="true"], .rail-favorites[aria-pressed="true"] { background: var(--blue-soft); color: var(--blue-deep); font-weight: 700; }
.category-filters button[aria-pressed="true"] .category-mark { border-color: var(--blue-deep); color: var(--blue-deep); }
.rail-favorites { margin-top: 10px; border-top: 1px solid var(--line); border-radius: 0; padding-top: 15px; }
.rail-favorites>span { width: 22px; font-size: 20px; text-align: center; }
.rail-resources { padding-top: 24px; }
.rail-resources a { display: flex; justify-content: space-between; padding: 9px 11px; color: var(--muted); text-decoration: none; font-size: 12px; }
.rail-resources a:hover { color: var(--blue-deep); }
.rail-note { margin: 22px 8px 0; padding-top: 15px; border-top: 1px solid var(--line); }
.rail-note strong { font-size: 12px; }
.rail-note p { color: var(--muted); font-size: 11px; line-height: 1.8; margin: 7px 0; }
.rail-note a { color: var(--blue-deep); font-size: 11px; text-underline-offset: 3px; }
.portal-main { min-width: 0; }
.search-panel { padding: 12px 18px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.search-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.search-heading>div:first-child { display: flex; align-items: baseline; gap: 18px; min-width: 0; }
.search-heading h1 { margin: 0; font-size: 22px; line-height: 30px; letter-spacing: -.025em; white-space: nowrap; }
.search-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.catalog-summary { display: flex; align-items: baseline; gap: 12px; white-space: nowrap; font-size: 11px; color: var(--muted); }
.catalog-summary strong { font-size: 19px; line-height: 28px; color: var(--blue-deep); font-variant-numeric: tabular-nums; }
.catalog-summary small { font-size: 11px; font-weight: 400; }
.directory-search { display: flex; min-height: 42px; margin-top: 8px; padding: 3px; background: var(--subtle); border: 1px solid var(--line); border-radius: 6px; }
.directory-search:focus-within { border-color: var(--blue-deep); outline: 2px solid var(--blue-soft); }
.directory-search input { flex: 1; min-width: 0; border: 0; padding: 7px 12px; background: transparent; color: var(--ink); font-size: 13px; outline: none; }
.directory-search input::placeholder { color: var(--muted); }
.directory-search button { min-width: 106px; padding: 7px 18px; border: 0; border-radius: 4px; background: var(--blue-deep); color: var(--button-ink); font-size: 13px; font-weight: 650; white-space: nowrap; }
.directory-search button:hover { filter: brightness(.92); }
.quick-search { display: flex; align-items: center; gap: 15px; min-height: 29px; color: var(--muted); font-size: 11px; }
.quick-search button { min-height: 29px; border: 0; padding: 2px 0; color: var(--muted); background: transparent; font-size: 11px; }
.quick-search button:hover { color: var(--blue-deep); text-decoration: underline; }
.search-hint { margin-left: auto; }
.topic-links { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-top: 10px; }
.topic-links>a, .topic-links>button { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 56px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); text-align: left; text-decoration: none; color: var(--ink); }
.topic-links>a:hover, .topic-links>button:hover, .topic-links>button[aria-pressed="true"] { border-color: var(--blue-deep); background: var(--blue-soft); }
.topic-mark { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 6px; background: var(--blue-soft); color: var(--blue-deep); font-size: 14px; font-weight: 700; }
.topic-links strong, .topic-links small { display: block; }
.topic-links strong { font-size: 12px; line-height: 18px; }
.topic-links small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 15px; white-space: nowrap; }
.topic-arrow { margin-left: auto; color: var(--muted); font-size: 16px; }
.directory { padding-top: 3px; }
.directory-status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; min-height: 34px; color: var(--muted); font-size: 11px; }
.directory-status p { margin: 0; }
.directory-status #resultCount { font-weight: 600; color: var(--ink); }
.domestic-filter { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; margin-left: auto; white-space: nowrap; font-size: 11px; cursor: pointer; }
.domestic-filter input { width: 14px; height: 14px; accent-color: var(--blue-deep); }
.catalog-date { color: var(--muted); font-size: 10px; white-space: nowrap; }
.reset-filter { border: 0; padding: 4px 0; background: none; color: var(--blue-deep); font-size: 11px; text-decoration: underline; }
.directory-group { margin-bottom: 10px; scroll-margin-top: 80px; }
.group-heading { display: flex; align-items: center; gap: 16px; min-height: 26px; margin-bottom: 4px; }
.group-heading h2 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 15px; line-height: 22px; }
.group-heading h2>span { color: var(--muted); font-size: 11px; font-weight: 400; }
.group-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.tool-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; align-items: start; }
.directory-entry { position: relative; min-width: 0; padding: 10px 11px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); transition: border-color .15s ease, box-shadow .15s ease; }
.directory-entry:hover { border-color: #a8c2e2; box-shadow: 0 3px 10px #163c6f0a; }
.entry-top { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.tool-logo { position: relative; display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; overflow: hidden; border-radius: 7px; background: var(--blue-soft); color: var(--blue-deep); font-size: 13px; font-weight: 750; }
.tool-logo img { position: absolute; inset: 1px; width: 32px; height: 32px; object-fit: contain; background: #fff; border-radius: 6px; }
.entry-title { flex: 1; min-width: 0; }
.entry-title h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; font-size: 14px; line-height: 20px; white-space: nowrap; }
.entry-title h3 a { text-decoration: none; }
.entry-title h3 a:hover { color: var(--blue-deep); text-decoration: underline; text-underline-offset: 3px; }
.entry-subline { display: flex; align-items: center; gap: 6px; min-width: 0; line-height: 15px; font-size: 10px; white-space: nowrap; }
.free-label { overflow: hidden; text-overflow: ellipsis; color: var(--label-text); }
.region-label { flex-shrink: 0; color: var(--muted); font-size: 9px; }
.favorite-button { display: grid; place-items: center; flex-shrink: 0; width: 25px; height: 28px; align-self: start; border: 0; border-radius: 4px; padding: 0; color: var(--muted); background: transparent; font-size: 21px; line-height: 1; }
.favorite-button:hover, .favorite-button[aria-pressed="true"] { color: var(--blue-deep); background: var(--blue-soft); }
.entry-purpose { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-height: 38px; margin: 6px 0 3px; color: var(--muted); font-size: 13px; line-height: 19px; }
.entry-bottom { display: flex; align-items: start; justify-content: space-between; gap: 6px; min-height: 24px; }
.entry-bottom details { position: relative; min-width: 0; color: var(--muted); font-size: 11px; }
.entry-bottom summary { display: flex; align-items: center; gap: 4px; min-height: 24px; cursor: pointer; list-style: none; white-space: nowrap; }
.entry-bottom summary::-webkit-details-marker { display: none; }
.entry-bottom summary::after { content: '+'; font-size: 13px; }
.entry-bottom details[open] summary::after { content: '−'; }
.entry-bottom details[open] summary { color: var(--blue-deep); }
.entry-conditions { position: absolute; top: calc(100% + 4px); left: -11px; z-index: 10; width: 246px; max-width: calc(100vw - 48px); padding: 13px 15px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: 0 8px 24px #10284c20; font-size: 12px; line-height: 1.8; }
.entry-conditions p { margin: 0 0 8px; }
.entry-conditions a { color: var(--blue-deep); text-underline-offset: 3px; }
.close-conditions { display: block; min-height: 38px; margin-top: 10px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--subtle); color: var(--ink); font-size: 12px; }
.visit-link { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; color: var(--blue-deep); font-size: 11px; font-weight: 650; white-space: nowrap; text-decoration: none; }
.visit-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.empty-results { margin: 10px 0 20px; padding: 36px 20px; border: 1px dashed var(--line); border-radius: 8px; text-align: center; background: var(--surface); }
.empty-results h2 { margin: 0; font-size: 20px; }
.empty-results p { color: var(--muted); line-height: 1.8; }
.empty-results button { border: 0; border-radius: 6px; padding: 10px 18px; background: var(--blue-deep); color: var(--button-ink); min-height: 40px; }
.selection-note { margin-top: 20px; padding: 13px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.selection-note summary { cursor: pointer; min-height: 28px; }
.selection-note p { max-width: 90ch; line-height: 1.8; }
.next-step { padding-top: 16px; }
.next-step>h2 { margin: 0 0 12px; font-size: 17px; }
.next-links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.next-links>a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); text-decoration: none; }
.next-links h3 { margin: 0; font-size: 15px; }
.next-links p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.next-links b { color: var(--blue-deep); font-size: 12px; white-space: nowrap; }
.next-links a:hover { border-color: var(--blue-deep); }
footer { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px; padding: 26px max(24px, calc((100vw - var(--max))/2)); border-top: 1px solid var(--line); background: var(--surface); }
footer .brand strong { font-size: 21px; }
footer p { color: var(--muted); font-size: 11px; }
footer nav { display: flex; gap: 20px; }
footer nav a { color: var(--muted); font-size: 11px; }
.copy-toast { position: fixed; left: 50%; bottom: 24px; z-index: 30; width: max-content; max-width: calc(100vw - 32px); padding: 12px 18px; border: 1px solid var(--line); border-radius: 7px; background: var(--ink); color: var(--surface); font-size: 13px; line-height: 1.6; opacity: 0; transform: translate(-50%,10px); transition: opacity .15s ease, transform .15s ease; pointer-events: none; }
.copy-toast.is-visible { opacity: 1; transform: translate(-50%,0); }
/* Existing article routes share these reading and prompt styles. */
.page-shell { max-width: 1100px; margin: 0 auto; padding: 44px 28px 70px; }
.page-shell>header { padding-bottom: 24px; border-bottom: 2px solid var(--ink); }
.page-shell h1 { margin: 0; font-size: clamp(30px,4vw,46px); letter-spacing: -.03em; line-height: 1.3; }
.page-shell>header p { max-width: 70ch; color: var(--muted); line-height: 1.8; }
.resource-page { margin-top: 24px; }
.resource-page>section, .resource-page>a { display: block; padding: 24px 0; border-bottom: 1px solid var(--line); text-decoration: none; scroll-margin-top: 80px; }
.resource-page h2, .resource-page h3 { margin: 0; }
.resource-page p { max-width: 75ch; color: var(--muted); line-height: 1.8; }
.resource-page pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 22px; border: 1px solid var(--line); border-radius: 7px; background: var(--blue-soft); font: inherit; line-height: 1.8; }
.resource-page button { min-height: 44px; border: 0; border-radius: 6px; padding: 0 20px; background: var(--blue-deep); color: var(--button-ink); font-weight: 700; }
.resource-page button.is-copied { background: var(--label-text); color: var(--surface); }
.resource-page button:disabled { opacity: .65; cursor: progress; }
@media(max-width:1250px) {
  .brand small { display: none; }
  .search-heading p { display: none; }
  .catalog-summary { gap: 8px; }
  .topic-links>a, .topic-links>button { padding-inline: 9px; gap: 7px; }
  .topic-arrow { display: none; }
}
@media(max-width:1100px) {
  .portal-layout { grid-template-columns: 164px minmax(0,1fr); gap: 18px; padding-inline: 20px; }
  .tool-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .topic-links { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .catalog-date { display: none; }
  .entry-conditions { width: 220px; }
}
@media(max-width:800px) {
  .site-header { gap: 12px; padding-inline: 16px; }
  .site-header nav a { padding-inline: 10px; font-size: 12px; }
  .portal-layout { grid-template-columns: minmax(0,1fr); gap: 12px; padding: 10px 16px 26px; }
  .category-rail { position: static; max-height: none; padding: 0; border: 0; overflow: visible; }
  .category-rail>.rail-label, .rail-resources, .rail-note, .rail-favorites { display: none; }
  .category-filters { display: flex; gap: 7px; overflow-x: auto; padding: 1px 0 4px; scrollbar-width: thin; }
  .category-filters button { width: auto; flex-shrink: 0; min-height: 36px; padding: 7px 11px; border: 1px solid var(--line); background: var(--surface); }
  .category-filters button small, .category-mark { display: none; }
  .tool-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .entry-purpose { font-size: 12px; }
}
@media(max-width:640px) {
  html { scroll-padding-top: 74px; }
  .site-header { height: 58px; gap: 9px; }
  .brand strong { font-size: 24px; }
  .theme-toggle { margin-left: auto; min-height: 36px; padding-inline: 10px; }
  .nav-toggle { display: block; min-height: 36px; }
  .site-header nav { display: none; position: absolute; top: 58px; left: 0; right: 0; height: auto; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
  .site-header nav.is-open { display: grid; }
  .site-header nav a { min-height: 44px; font-size: 14px; }
  .portal-layout { padding-inline: 12px; }
  .search-panel { padding: 13px 13px 8px; }
  .search-heading h1 { font-size: 20px; line-height: 29px; }
  .catalog-summary { display: none; }
  .directory-search { min-height: 44px; }
  .directory-search input { padding-inline: 8px; font-size: 12px; }
  .directory-search button { min-width: 75px; padding-inline: 10px; font-size: 12px; }
  .quick-search { min-height: 32px; gap: 18px; }
  .quick-search button { min-height: 32px; font-size: 11px; }
  .search-hint { display: none; }
  .topic-links { gap: 8px; margin-top: 10px; }
  .topic-links>a, .topic-links>button { min-height: 61px; padding: 9px; gap: 8px; }
  .topic-mark { width: 27px; height: 29px; }
  .topic-links strong { font-size: 11px; }
  .topic-links small { font-size: 9px; }
  .directory-status { gap: 5px 10px; padding-block: 9px 4px; }
  .domestic-filter { min-height: 34px; font-size: 10px; }
  .group-heading { margin-block: 6px; min-height: 25px; }
  .group-heading h2 { font-size: 15px; }
  .group-heading p { font-size: 10px; }
  .tool-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .directory-entry { padding: 10px 9px 6px; }
  .entry-top { gap: 6px; }
  .tool-logo { width: 27px; height: 29px; font-size: 11px; }
  .tool-logo img { width: 25px; height: 27px; }
  .entry-title h3 { font-size: 13px; line-height: 18px; white-space: normal; overflow-wrap: anywhere; }
  .entry-subline { gap: 4px; font-size: 9px; }
  .region-label { display: none; }
  .favorite-button { width: 30px; height: 36px; font-size: 19px; }
  .entry-purpose { min-height: 57px; -webkit-line-clamp: 3; font-size: 13px; line-height: 19px; margin-top: 7px; }
  .entry-bottom { gap: 3px; }
  .entry-bottom summary, .visit-link { min-height: 40px; font-size: 11px; }
  .entry-bottom summary { gap: 2px; }
  .entry-conditions, .directory-entry:nth-child(even) .entry-conditions { position: fixed; top: auto; bottom: 16px; left: 16px; right: 16px; z-index: 40; width: auto; max-width: none; max-height: 55vh; overflow-y: auto; font-size: 14px; padding: 18px; }
  .close-conditions { min-height: 44px; width: 100%; font-size: 14px; }
  .directory-entry[data-search*="本地部署"] .entry-subline { display: block; }
  .directory-entry[data-search*="本地部署"] .entry-subline .free-label { display: block; }
  .directory-entry[data-search*="本地部署"] .region-label { display: block; font-size: 9px; }
  .next-links { grid-template-columns: 1fr; gap: 10px; }
  .next-links>a { padding: 16px; }
  footer { grid-template-columns: 1fr; gap: 12px; padding: 24px 16px; }
  footer p { margin: 0; }
  footer nav { flex-wrap: wrap; gap: 15px; }
  footer nav a { display: inline-flex; align-items: center; min-height: 36px; }
  .page-shell { padding: 30px 18px 52px; }
  .resource-page pre { padding: 16px; font-size: 14px; }
}
@media(max-width:360px) {
  .tool-grid { grid-template-columns: 1fr; }
  .entry-purpose { min-height: 32px; -webkit-line-clamp: 2; }
  .entry-title h3 { font-size: 14px; }
  .directory-entry:nth-child(even) .entry-conditions { left: 16px; right: 16px; }
  .entry-bottom summary, .visit-link { font-size: 11px; }
}
@media(prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto; }
  .copy-toast, .directory-entry { transition: none; }
}
