@layer components {
  .ui-arrow { display: inline-block; width: 1em; height: 1em; flex-shrink: 0; vertical-align: -.12em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .language-picker { position: relative; display: flex; align-items: center; flex-shrink: 0; }
  .language-trigger { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 130px; min-height: 44px; font: inherit; font-size: 12px; color: #456d57; background: #f7f9f4; border: 1px solid #dce3d5; border-radius: 9px; padding: 10px 14px; white-space: nowrap; cursor: pointer; }
  .language-trigger:hover, .language-trigger[aria-expanded="true"] { background: #eef3e9; border-color: #a7bea9; }
  .language-chevron { width: 10px; height: 10px; flex-shrink: 0; fill: none; stroke: #628e72; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .language-trigger[aria-expanded="true"] .language-chevron { transform: rotate(180deg); }
  .language-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 204px; max-width: calc(100vw - 28px); padding: 7px; border: 1px solid #dce3d5; border-radius: 12px; background: #fcfcfa; box-shadow: 0 12px 32px #334b3620; z-index: 40; }
  .language-menu[hidden] { display: none; }
  .language-menu button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 7px; background: transparent; color: #657660; font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
  .language-menu button:hover { background: #f0f4e9; }
  .language-menu button[aria-checked="true"] { color: #456d57; background: #eaf1e8; }
  .language-trigger:focus-visible, .language-menu button:focus-visible { outline: 2px solid #628e72; outline-offset: 2px; }
  .language-check { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: #628e72; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
  .language-menu button[aria-checked="true"] .language-check { opacity: 1; }
  .header-actions { gap: 16px; }
  .header-actions .button.small { width: 130px; height: 44px; min-height: 44px; padding: 10px 14px; gap: 12px; border-radius: 9px; font-size: 12px; flex-shrink: 0; }
  .header-actions .button.small span { font-size: 12px; }
  .site-header nav a { white-space: nowrap; }
  .nav-label-compact { display: none; }
  .site-footer { font-size: 13px; }
  .footer-links { margin-top: 22px; }
  .footer-nav { display: flex; flex-wrap: wrap; gap: 12px 24px; }
  .footer-nav a:hover { color: #456d57; }
  .site-footer > .copyright { display: block; text-align: right; margin-top: 18px; letter-spacing: .06em; }
  .footer-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 18px; margin: 19px 0; font-size: 13px; }
  .footer-contact strong { font-size: 13px; font-weight: 600; color: #657660; }
  .footer-contact a:hover { color: #456d57; text-decoration: underline; }
  .contact-emails { line-height: 1.8; }
  .contact-emails a { white-space: nowrap; }
  .contact-separator { margin-inline: 1em; }
  html:not([lang="zh-CN"]) .brand-caption { display: none; }
  html:not([lang="zh-CN"]) .hero h1 { font-size: clamp(36px, 4.1vw, 64px); line-height: 1.13; }
  html:not([lang="zh-CN"]) .hero h1 .title-accent { display: inline-block; }
  html:not([lang="zh-CN"]) .hero .art-note { font-size: 16px; margin-top: 75px; max-width: 180px; }
  html:not([lang="zh-CN"]) .type-card h3 { font-size: 19px; }
  html:not([lang="zh-CN"]) .result-hero h1 { font-size: clamp(32px, 4vw, 56px); }
  html:not([lang="zh-CN"]) .answer-label { font-size: 10px; line-height: 1.35; max-width: 105px; }
  html:not([lang="zh-CN"]) .radar text { font-size: 8px; }
  html:not([lang="zh-CN"]) .dimension-labels { gap: 12px; font-size: 11px; }
  html:not([lang="zh-CN"]) .dimension-labels > span { flex: 1; }
  html:not([lang="zh-CN"]) .dimension-labels > span:last-child { text-align: right; }
  html:not([lang="zh-CN"]) .ranking-row { grid-template-columns: 34px 64px minmax(0, 1fr) 120px 20px; }
  html:not([lang="zh-CN"]) .ranking-type strong { overflow-wrap: anywhere; }
  html:not([lang="zh-CN"]) .about-dimensions > div { min-width: 0; }
  html:not([lang="zh-CN"]) .about-dimensions p { white-space: normal; }
  html:not([lang="zh-CN"]) .result-type-code > span { display: none; }
  .faq-list summary > span { flex-shrink: 0; margin-left: 16px; }
  .research-links { margin: 0 0 24px; padding-left: 21px; max-width: 880px; font-size: 12px; line-height: 1.8; color: #7c8775; }
  .research-links li { margin-bottom: 8px; }
  .research-links a, .faq-list p a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
  .copyright { font-size: 12px; color: #99a08f; }
  .rankings-wrap { max-width: 1100px; }
  .ranking-intro { max-width: 730px; color: #7d8977; font-size: 14px; margin-bottom: 28px; }
  .ranking-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 13px; background: #f4f7ef; overflow: hidden; }
  .ranking-stats > div { padding: 22px 27px; border-right: 1px solid #dfe6d8; }
  .ranking-stats > div:last-child { border: 0; }
  .ranking-stats span { display: block; font-size: 12px; color: #7a8873; }
  .ranking-stats strong { display: block; font-size: 36px; color: var(--green); letter-spacing: -.03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .ranking-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 28px 0 20px; }
  .ranking-toolbar .species-toggle { margin: 0; max-width: 100%; }
  .ranking-toolbar .species-toggle button { flex: 1; min-width: 0; }
  .ranking-refresh { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 18px; font-size: 12px; color: #69775f; }
  .ranking-refresh > span { white-space: nowrap; }
  .ranking-refresh time { font-variant-numeric: tabular-nums; }
  .ranking-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ranking-row { display: grid; grid-template-columns: 27px 64px minmax(0, 1fr) 83px 13px; align-items: center; gap: 12px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 11px; background: white; transition: border-color .2s; }
  .ranking-row:hover { border-color: var(--group-color); }
  .ranking-position { font-size: 18px; font-weight: 700; color: var(--group-color); font-variant-numeric: tabular-nums; }
  .ranking-row .pet-image { width: 64px; height: 64px; border-radius: 9px; background: var(--group-pale); }
  .ranking-type strong { display: block; font-size: 16px; line-height: 1.5; }
  .ranking-type > span { font-size: 11px; letter-spacing: .08em; color: var(--group-color); }
  .ranking-frequency { text-align: right; min-width: 0; }
  .ranking-frequency strong { display: block; color: var(--group-color); font-size: 17px; font-variant-numeric: tabular-nums; }
  .ranking-frequency > span { font-size: 10px; color: #909989; }
  .ranking-bar { background: #eef0e9; height: 3px; margin-top: 6px; border-radius: 2px; overflow: hidden; }
  .ranking-bar > span { display: block; height: 100%; background: var(--group-color); }
  .ranking-arrow { color: #9ba48f; }
  .ranking-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 20px; font-size: 11px; color: #8e9984; }
  .ranking-note { color: #8c9586; font-size: 11px; line-height: 1.8; margin-top: 13px; }
  .ranking-note > span { display: block; }
  .ranking-message, .ranking-empty { border: 1px dashed #d8e1d0; border-radius: 11px; padding: 32px; text-align: center; color: #7f8b75; font-size: 13px; margin: 18px 0; }
  .ranking-message strong, .ranking-empty strong { font-size: 16px; color: var(--green); }
  .ranking-message p, .ranking-empty p { margin: 8px 0 13px; }
  .submission-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 15px 28px; background: #f0f5eb; border: 1px solid #dfe7d7; border-radius: 12px; padding: 25px 30px; margin: 28px 0; }
  .submission-panel h2 { font-size: 22px; margin: 8px 0; }
  .submission-panel p:not(.eyebrow) { font-size: 12px; color: #7e8b72; }
  .submission-panel .submission-privacy { font-size: 10px; margin-top: 9px; max-width: 600px; }
  .submission-actions { display: flex; flex-direction: column; align-items: center; gap: 13px; }
  .submission-actions .button { font-size: 12px; }
  .submission-status { grid-column: 1 / -1; }
  .submission-status:empty { display: none; }
  #share-dialog { width: 780px; }
  #share-dialog .share-preview { display: flex; justify-content: center; align-items: center; border: 1px solid var(--line); background: #f2f5ed; border-radius: 12px; padding: 16px; min-height: 190px; margin: 24px 0 20px; font-size: 13px; color: #87927d; }
  .share-preview img { width: 250px; height: auto; max-width: 100%; box-shadow: 0 5px 18px #33422f18; }
  .share-label { display: block; font-size: 12px; color: #788870; margin: 12px 0 8px; }
  #share-copy { display: block; width: 100%; resize: vertical; min-height: 135px; border: 1px solid #dce4d4; border-radius: 8px; padding: 13px 15px; color: var(--ink); font: inherit; font-size: 13px; line-height: 1.8; background: #fff; }
  .share-dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
  .share-dialog-actions .button { font-size: 12px; }
  .share-hint { font-size: 11px; color: #87927c; margin-top: 13px; }
}
@layer responsive {
  .site-header nav .records-link { font-size: inherit; }
  @media (max-width: 1150px) {
    .site-header { display: grid; grid-template-columns: 1fr auto; grid-template-rows: 58px 34px; height: 104px; gap: 0 12px; align-content: start; }
    .site-header .brand { grid-column: 1; grid-row: 1; }
    .header-actions { grid-column: 2; grid-row: 1; }
    .site-header nav { grid-column: 1 / -1; grid-row: 2; width: 100%; height: 34px; justify-content: center; margin: 0; gap: 30px; }
    .site-header nav a[aria-current]::after { bottom: -4px; }
    html { scroll-padding-top: 120px; }
  }
  @media (max-width: 850px) {
    .site-header { height: 104px; gap: 0 12px; }
    .site-header nav { gap: 17px; }
    .ranking-rows { grid-template-columns: 1fr; }
    .submission-panel { grid-template-columns: 1fr; }
    .submission-actions { flex-direction: row; justify-content: space-between; flex-wrap: wrap; }
  }
  @media (max-width: 600px) {
    html[lang="zh-CN"] .answer-2 .answer-label { white-space: nowrap; }
    .header-actions { gap: 6px; }
    .header-actions .button.small { display: inline-flex; width: 88px; height: 40px; min-height: 40px; padding: 9px 6px; font-size: 11px; justify-content: center; }
    .header-actions .button.small .ui-arrow { display: none; }
    .records-link { width: auto; padding-left: 0; white-space: nowrap; }
    .language-trigger { width: 88px; min-width: 88px; height: 40px; min-height: 40px; font-size: 11px; gap: 6px; padding: 9px 8px; }
    .language-chevron { width: 8px; height: 8px; }
    .language-menu button { font-size: 11px; }
    html:not([lang="zh-CN"]) .hero h1 { font-size: 36px; }
    html:not([lang="zh-CN"]) .hero .art-note { font-size: 12px; margin-top: 35px; }
    html:not([lang="zh-CN"]) .species-choice .pet-image { width: 76px; height: 76px; right: 0; bottom: 0; }
    html:not([lang="zh-CN"]) .choice-copy strong { font-size: 15px; }
    html:not([lang="zh-CN"]) .choice-copy > span:last-child { max-width: 85px; font-size: 9px; line-height: 1.45; }
    html:not([lang="zh-CN"]) .hero-meta { gap: 12px; flex-wrap: wrap; }
    html:not([lang="zh-CN"]) .ranking-row { grid-template-columns: 21px 44px minmax(0, 1fr) 70px; }
    html:not([lang="zh-CN"]) .ranking-frequency span { font-size: 9px; }
    html:not([lang="zh-CN"]) .answer-label { font-size: 8px; }
    html:not([lang="zh-CN"]) .quiz-controls { flex-wrap: wrap; }
    html { scroll-padding-top: 138px; }
    .site-header { display: grid; grid-template-columns: 1fr auto; grid-template-rows: 58px 52px; height: 122px; gap: 0 8px; align-content: start; }
    .site-header .brand { grid-column: 1; grid-row: 1; }
    .header-actions { grid-column: 2; grid-row: 1; }
    .site-header nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-column: 1 / -1; grid-row: 2; width: 100%; height: 52px; margin: 0; font-size: 12px; gap: 6px; }
    .site-header nav a { justify-content: center; min-width: 0; text-align: center; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }
    html[lang="zh-CN"] .site-header nav { grid-template-columns: minmax(2em, .75fr) minmax(4em, .9fr) minmax(3em, .85fr) minmax(4em, 1fr) minmax(6em, 1.5fr); }
    html[lang="zh-CN"] .site-header nav .records-link { white-space: nowrap; overflow-wrap: normal; }
    html:not([lang="zh-CN"]) .nav-label-full { display: none; }
    html:not([lang="zh-CN"]) .nav-label-compact { display: inline; }
    .site-header nav a:first-child { display: flex; }
    .site-header nav a[aria-current]::after { bottom: -4px; }
    .rankings-wrap .section-heading { gap: 15px; flex-wrap: wrap; }
    .ranking-intro { font-size: 12px; }
    .ranking-stats > div { padding: 16px 13px; }
    .ranking-stats strong { font-size: 27px; }
    .ranking-stats span { font-size: 10px; }
    .ranking-toolbar { gap: 10px; flex-wrap: wrap; }
    .ranking-toolbar .species-toggle button { padding: 8px 14px; }
    .ranking-refresh { width: 100%; justify-content: flex-start; gap: 6px 14px; font-size: 11px; }
    .ranking-refresh > span { white-space: normal; }
    .ranking-row { grid-template-columns: 21px 44px minmax(0, 1fr) 70px; gap: 9px; padding: 13px 12px; }
    .ranking-row .pet-image { width: 44px; height: 44px; }
    .ranking-position { font-size: 14px; }
    .ranking-type strong { font-size: 14px; }
    .ranking-frequency strong { font-size: 14px; }
    .ranking-arrow { display: none; }
    .ranking-message, .ranking-empty { padding: 24px 18px; }
    .submission-panel { padding: 22px 20px; }
    .submission-panel h2 { font-size: 20px; }
    .submission-actions { gap: 12px; }
    .submission-actions .button { width: 100%; }
    #share-dialog h2 { font-size: 21px; padding-right: 12px; }
    .share-preview img { width: 250px; -webkit-touch-callout: default; user-select: auto; }
    .share-dialog-actions { gap: 10px; }
    .share-dialog-actions .button { width: 100%; }
    .site-footer { font-size: 12px; }
    .footer-contact, .footer-contact strong { font-size: 12px; }
    .site-footer .copyright { font-size: 11px; }
    .site-footer > .copyright { text-align: left; }
    .footer-nav { gap: 10px 18px; }
  }
}
