/* Shared reading and interaction refinements. No remote font dependency. */
:root {
  --ink: #203449;
  --muted: #5d7184;
  --navy: #18344f;
  --canvas: #f4f7fa;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
}
html { scrollbar-gutter: stable; }
body { line-height: 1.7; }
body:has(dialog[open]) { overflow: hidden; }
a { text-underline-offset: 3px; }
.skip-link { position: fixed; top: -100px; left: 16px; padding: 10px 18px; background: white; z-index: 100; border-radius: 8px; }
.skip-link:focus { top: 10px; }
.header-nav a { font-size: .9375rem; padding: 6px 0; }
.page-subtitle { margin: 8px 0 0; font-size: .9375rem; color: var(--muted); }
.snapshot { line-height: 1.8; }
.primary, .quiet-button, .icon-button, .reset-button, select { min-height: 44px; border-radius: 8px; }
.quiet-button:hover, .icon-button:hover:not(:disabled) { background: var(--blue-soft); }
.icon-button { min-width: 44px; }
select, input[type=number] { font-size: .9375rem; color: var(--ink); border-color: #cbd7e2; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); flex-shrink: 0; }
.search-box input { height: 44px; }
.search-box input::placeholder { color: #697c8e; }
.filter-body>label:not(.check-label) { font-size: .9375rem; margin-top: 16px; }
.filter-body small, .filter-note { font-size: .8125rem; color: var(--muted); }
.check-label { font-size: .875rem; }
.results { scroll-margin-top: 20px; }
.toolbar-actions select { min-height: 44px; max-width: 160px; font-size: .875rem; }
.result-total strong { font-size: 1.2rem; }
.view-tab { font-size: .9375rem; min-height: 46px; }
.view-guide-link { font-size: .8125rem; color: var(--blue); }
.active-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 18px; }
.filter-chip { display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 6px 11px; min-height: 38px; border: 1px solid #cddde9; background: #eaf2f9; border-radius: 8px; color: #305875; font-size: .8125rem; }
.filter-chip>span:first-child { overflow-wrap: anywhere; text-align: left; }
.filter-chip>span:last-child { font-size: 1.125rem; }
.clear-filters { color: var(--blue); background: none; padding: 7px; min-height: 38px; font-size: .8125rem; }

/* Card hierarchy: familiar Chinese label, English key, original value. */
.skill-card { display: flex; flex-direction: column; border-radius: 14px; }
.skill-card.is-selected { border-color: #5688af; box-shadow: inset 0 0 0 1px #5688af; }
.card-title .skill-name { font-size: 1.1875rem; line-height: 1.5; }
.card-meta { color: var(--muted); font-size: .8125rem; flex-wrap: wrap; gap: 5px 9px; margin-top: 5px; }
.name-count { padding: 3px 7px; min-height: 30px; border-radius: 5px; }
.card-desc { color: #425b70; line-height: 1.9; margin: 18px 0; min-height: 3.8em; }
.stats-row { gap: 12px; margin: auto 0 18px; padding: 13px 12px; border-radius: 9px; background: #f5f8fb; }
.stat { border: 0; padding: 0; }
.stat-label { display: flex; flex-direction: column; min-height: 3.6em; }
.stat .field-alias { order: -1; margin: 0 0 3px; font-size: .875rem; color: #425c73; }
.stat .field-key-link { color: #526d84; }
.stat b { font-size: 1.25rem; font-family: var(--mono); font-weight: 600; margin-top: 5px; line-height: 1.6; }
.card-foot { padding: 8px 0; }
.detail-link, .compare-toggle { min-height: 44px; font-size: .875rem; }
.compare-toggle input { width: 18px; height: 18px; }
.pagination button { min-height: 44px; border-radius: 8px; }

/* Keep closing controls available while reading long records. */
dialog { overscroll-behavior: contain; max-width: calc(100% - 20px); }
.dialog-shell { padding-top: 0; }
.dialog-top { position: sticky; top: 0; z-index: 2; background: white; margin: 0 -30px 24px; padding: 14px 30px; font-size: .9375rem; }
.close-dialog { width: 44px; height: 44px; }
.detail-title>div { min-width: 0; }
.detail-desc { font-size: 1rem; line-height: 1.95; overflow-wrap: anywhere; }
.detail-id, .raw-source { font-size: .875rem; }
.field-guide-note { font-size: .875rem; line-height: 1.85; }
.field-search { flex: 1; font-size: 1rem; min-height: 46px; }
.field-controls label { display: flex; align-items: center; gap: 5px; font-size: .875rem; min-height: 44px; }
.field-group>summary { font-size: 1rem; padding: 16px 0; }
.field-group>summary span { font-size: .8125rem; }
.field-table th { width: 34%; }
.field-table th, .field-table td { padding: 13px 15px; }
.field-table td { font-size: .9375rem; line-height: 1.85; }
.field-table th .field-key-link, .compare-table tbody th .field-key-link { font-size: .875rem; }
.field-alias { font-family: var(--font); font-size: .875rem; color: var(--muted); }
.null-value { color: #65798b; font-size: .875rem; }
.confidence { font-family: var(--font); font-size: .75rem; padding: 3px 8px; }
.field-help { font-family: var(--font); }
.field-help>summary { font-size: .875rem; padding: 10px 0 4px; }
.field-help>summary .confidence { font-size: .75rem; }
.field-help p { font-size: .9375rem; line-height: 1.9; color: #435d73; }
.field-help>a { font-size: .875rem; }
.compare-table { font-size: .9375rem; }
.compare-note { font-size: .875rem; }
.compare-table thead small { opacity: 1; color: #d0e0ed; }
.compare-tools { align-items: center; }
.compare-tools label { display: flex; align-items: center; gap: 6px; min-height: 44px; }
.compare-bar { padding-bottom: env(safe-area-inset-bottom); }
.compare-hint { font-size: .8125rem; color: var(--muted); }
.selection-chip button { min-width: 32px; min-height: 36px; padding: 6px; }
.selection-chip>span:not(.skill-icon) { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.selection-chip small { opacity: 1; color: var(--muted); }
.page-footer, .filing-links { font-size: .8125rem; color: var(--muted); }
.site-version { font-variant-numeric: tabular-nums; color: #6b8090; }
.reference-note { margin: 0 0 16px; color: #5d7184; font-size: .8125rem; line-height: 1.8; }
.reference-note strong { color: #466378; font-weight: 600; }
.page-footer a, .filing-links a { color: #526e86; padding: 5px 0; }
.page-footer button { padding: 6px 0; min-height: 36px; }

@media (max-width: 1100px) {
  .cards { grid-template-columns: 1fr; }
  .compare-actions { flex-wrap: wrap; justify-content: flex-end; }
  .compare-hint { width: 100%; text-align: right; }
}
@media (max-width: 650px) {
  .workspace { padding-bottom: calc(155px + env(safe-area-inset-bottom)); }
  .header-nav a { font-size: .875rem; }
  .page-subtitle { font-size: .875rem; }
  .quick-search button { min-height: 40px; }
  .filters summary { min-height: 52px; }
  .filters summary:after { content: '展开筛选'; font-size: .8125rem; }
  .filters details[open] summary:after { content: '收起筛选'; }
  .filters select, .filters input[type=number] { font-size: 1rem; }
  .results-toolbar { flex-wrap: wrap; gap: 10px; }
  .toolbar-actions { margin-left: auto; }
  .toolbar-actions select { font-size: .875rem; max-width: 140px; }
  .toolbar-actions .icon-button { min-width: 44px; }
  .view-tabs { flex-wrap: wrap; }
  .view-guide-link { font-size: .8125rem; }
  .card-title .skill-name { font-size: 1.125rem; }
  .stats-row { gap: 9px; padding: 12px 10px; }
  .stat-label { min-height: 4.4em; }
  .stat .field-alias { font-size: .8125rem; }
  .dialog-top { margin: 0 -16px 20px; padding: 10px 16px; }
  .field-search { flex-basis: 100%; }
  .field-controls { gap: 4px; }
  .field-table, .field-table tbody, .field-table tr { display: block; }
  .field-table tr { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
  .field-table th, .field-table td { display: block; width: 100%; padding: 12px 14px; }
  .field-table td { border: 0; font-size: 1rem; }
  .field-table th .field-key-link { font-size: .9375rem; }
  .field-help p { font-size: 1rem; }
  .field-help>summary .confidence { display: inline-block; margin: 0 0 0 5px; }
  .compare-table td { font-size: .9375rem; }
  .compare-table td>span { min-width: 0; }
  .compare-table td:before { width: 88px; font-size: .8125rem; }
  .compare-actions { flex-wrap: nowrap; gap: 8px; }
  .compare-hint { width: auto; margin-right: auto; text-align: left; font-size: .75rem; }
  .compare-actions .primary { flex: initial; padding: 9px 17px; }
  .toast { bottom: 165px; }
}
@media (max-width: 430px) {
  .header-nav { width: 100%; justify-content: space-between; border-top: 1px solid #ffffff22; padding-top: 5px; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions select { flex: 1; max-width: none; }
  .view-guide-link { padding-left: 4px; }
  .stats-row { gap: 6px; padding: 11px 8px; }
  .pagination { gap: 12px; font-size: .8125rem; }
  .pagination button { padding: 9px 12px; }
}
