* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #f4f7fc; color: #0b1a33; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Microsoft YaHei', sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #8ec7ff; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.calculator-header { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; flex-shrink: 0; min-height: 66px; padding: 10px 28px; background: #fff; border-bottom: 1px solid #e7edf5; }
.calculator-plan { justify-self: start; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 8px; color: #16803d; background: #eaf8ef; font-size: .8rem; font-weight: 500; }
.calculator-plan strong { font-size: .85rem; font-style: italic; font-weight: 800; }
.calculator-title { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; font-size: 1.325rem; font-weight: 700; line-height: 1.4; }
.calculator-title-icon { display: grid; place-items: center; width: 36px; height: 36px; color: #006acd; font: 600 1.7rem/1 Georgia, serif; }
.calculator-open-link { display: inline-flex; align-items: center; gap: 6px; justify-self: end; color: #69798d; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.calculator-open-link:hover { color: #006acd; }
.calculator-main { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 24px; width: 100%; padding: 32px 24px 16px; }
.calculator-wrapper { display: flex; flex: 1 0 auto; align-items: center; justify-content: center; width: 100%; min-width: 0; }
.symbol-card { width: 100%; max-width: 1160px; min-width: 0; padding: 26px; border: 1px solid #e5ebf3; border-radius: 24px; background: #fff; box-shadow: 0 12px 40px rgba(18,61,107,.06); }
.tool-intro { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid #e7edf5; }
.section-kicker { display: block; margin-bottom: 7px; color: #8895a7; font-size: .75rem; }
.tool-intro h2 { margin: 0 0 8px; color: #315d8d; font-size: 1.4rem; }
.tool-intro p { margin: 0; color: #69798d; font-size: .85rem; line-height: 1.8; }
.catalog-badge { padding: 8px 11px; border: 1px solid #dcece4; border-radius: 9px; color: #648977; background: #f5faf7; font-size: .75rem; white-space: nowrap; }
.search-form { display: flex; flex-wrap: wrap; gap: 10px; }
.search-field { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 200px; padding: 0 12px; border: 1px solid #dce5f0; border-radius: 12px; background: #f8faff; }
.search-field:focus-within { border-color: #006acd; box-shadow: 0 0 0 3px #e7f2ff; }
.search-field > span { color: #8895a7; font-size: 1.7rem; line-height: 1; }
.search-field input { width: 0; min-width: 0; flex: 1; height: 46px; padding: 10px 0; border: 0; outline: none; color: #0b1a33; background: transparent; font-size: .85rem; }
.search-field input:focus-visible { outline: none; }
.search-field input::placeholder { color: #98a5b6; }
.search-field button, .text-button { padding: 5px 0; border: 0; color: #6f849d; background: transparent; font-size: .75rem; }
.search-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; margin: 12px 0 20px; color: #96a3b5; font-size: .72rem; }
.search-examples button { padding: 4px 9px; border: 1px solid #e5ebf3; border-radius: 6px; color: #6f849d; background: #fff; font-size: .72rem; }
.search-examples button:hover { color: #006acd; border-color: #bfd6ec; background: #eef4fe; }
.selected-detail { margin-bottom: 14px; padding: 16px 18px; border: 1px solid #dce5f0; border-radius: 16px; background: #f8faff; }
.detail-heading { display: flex; align-items: center; gap: 16px; }
.selected-glyph { display: grid; place-items: center; flex-shrink: 0; width: 64px; height: 64px; border: 1px solid #e2eaf5; border-radius: 14px; color: #006acd; background: #fff; font: 2.5rem/1.3 'Segoe UI Symbol', 'Apple Symbols', 'Noto Sans Symbols 2', 'Microsoft YaHei', sans-serif; }
.selected-description { flex: 1; min-width: 0; }
.detail-kicker { display: block; margin-bottom: 3px; color: #96a3b5; font-size: .65rem; }
.selected-description h3 { margin: 0; color: #315d8d; font-size: .95rem; line-height: 1.6; overflow-wrap: anywhere; }
.selected-description p { margin: 4px 0; color: #8895a7; font-size: .68rem; line-height: 1.7; overflow-wrap: anywhere; }
.selected-categories { color: #8895a7; font-size: .68rem; }
.code-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.code-field { min-width: 0; }
.code-field label { display: block; margin-bottom: 6px; color: #8895a7; font-size: .68rem; }
.code-field > div { display: flex; gap: 6px; align-items: center; }
.code-field input { width: 0; min-width: 0; flex: 1; height: 32px; padding: 6px 8px; border: 1px solid #e2eaf5; border-radius: 6px; color: #536f8b; background: #fff; font: .75rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.code-field button { flex-shrink: 0; padding: 6px 3px; border: 0; color: #6f849d; background: transparent; font-size: .7rem; }
.tool-status { margin: 12px 0 18px; color: #69798d; font-size: .78rem; line-height: 1.8; overflow-wrap: anywhere; }
.tool-status.is-error { color: #c63646; }
.manual-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; margin-bottom: 18px; border: 1px solid #f0d9ad; border-radius: 10px; color: #8a692e; background: #fffbf2; font-size: .75rem; }
.manual-copy input { flex: 1; min-width: 100px; width: 150px; padding: 8px; border: 1px solid #e8d5ad; border-radius: 6px; background: #fff; color: #0b1a33; }
.catalog-layout { display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: 24px; align-items: start; padding-top: 20px; border-top: 1px solid #eef2f8; }
.category-panel { min-width: 0; padding: 14px 10px; border: 1px solid #d2dce9; border-radius: 14px; }
.category-panel h3 { margin: 0 8px 12px; color: #315d8d; font-size: .85rem; font-weight: 600; }
.category-list { display: flex; flex-direction: column; gap: 4px; max-height: 590px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 2px; }
.category-button { display: flex; align-items: center; justify-content: space-between; gap: 5px; width: 100%; min-height: 35px; padding: 8px; border: 0; border-radius: 7px; background: transparent; color: #69798d; font-size: .75rem; text-align: left; }
.category-button span:last-child { color: #96a3b5; font-size: .65rem; }
.category-button:hover { color: #006acd; background: #f4f7fc; }
.category-button.is-active { color: #006acd; background: #eaf3ff; font-weight: 600; }
.results-panel { min-width: 0; }
.results-heading { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 10px; min-height: 49px; margin-bottom: 15px; }
.results-heading h3 { margin: 0; color: #315d8d; font-size: .95rem; font-weight: 600; }
.results-heading p { margin: 7px 0 0; color: #96a3b5; font-size: .72rem; line-height: 1.6; }
.symbol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 9px; }
.symbol-tile { display: flex; min-width: 0; min-height: 72px; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 11px 4px 9px; border: 1px solid #e3eaf4; border-radius: 10px; background: #fff; color: #254568; }
.symbol-tile:hover { color: #006acd; border-color: #b6cfe9; background: #f8faff; }
.symbol-tile.is-selected { border-color: #81b5e9; background: #eaf3ff; }
.tile-glyph { display: block; font: 1.75rem/1.2 'Segoe UI Symbol', 'Apple Symbols', 'Noto Sans Symbols 2', 'Microsoft YaHei', sans-serif; }
.tile-code { color: #96a3b5; font: .56rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.empty-results { padding: 40px 15px; border: 1px dashed #d9e2ef; border-radius: 14px; background: #f8faff; text-align: center; }
.empty-results > span { color: #a7bed7; font-size: 2.7rem; }
.empty-results h4 { margin: 12px 0; color: #6e85a0; font-size: 1rem; font-weight: 500; }
.empty-results p { color: #96a3b5; font-size: .78rem; line-height: 1.8; }
.result-pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; margin-top: 22px; color: #8895a7; font-size: .75rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 16px; border: 1px solid #dce5f0; border-radius: 10px; font-size: .8rem; font-weight: 600; line-height: 1.5; }
.button.primary { color: #fff; background: #006acd; border-color: #006acd; }
.button.primary:hover { background: #0059b3; }
.button.secondary { color: #536f8b; background: #fff; }
.button.secondary:hover:not(:disabled) { color: #006acd; background: #eef4fe; border-color: #bfd6ec; }
.calculator-tips { flex-shrink: 0; width: 100%; max-width: 1160px; margin-top: auto; padding: 18px 8px 0; border-top: 1px solid #e7edf5; color: #66758a; font-size: .8rem; line-height: 1.9; }
.calculator-tips h2 { margin: 0 0 12px; color: #69798d; font-size: .9rem; font-weight: 600; }
.tips-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.tips-grid p { margin: 0; }
.tips-grid strong { display: block; margin-bottom: 5px; color: #536f8b; font-weight: 600; }
.tips-grid a { color: #536f8b; }
@media (max-width: 767.98px) {
    .calculator-header { padding: 8px 16px; gap: 10px; }
    .calculator-plan { padding: 5px 8px; font-size: .72rem; }
    .calculator-title { gap: 7px; font-size: 1.175rem; }
    .calculator-open-link { font-size: .8rem; }
    .calculator-main { padding: 24px 16px 16px; gap: 20px; }
    .symbol-card { padding: 20px; }
    .catalog-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .category-list { flex-direction: row; flex-wrap: wrap; gap: 6px; max-height: 164px; }
    .category-panel { padding: 12px 10px; }
    .category-button { width: auto; gap: 7px; min-height: 33px; padding: 7px 9px; font-size: .7rem; }
    .tips-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .code-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .code-field { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 8px; }
    .code-field label { margin: 0; }
}
@media (max-width: 575.98px) {
    .calculator-header { grid-template-columns: minmax(0, 1fr) auto; }
    .calculator-title { grid-column: 1 / -1; grid-row: 1; }
    .calculator-plan { grid-column: 1; grid-row: 2; }
    .calculator-open-link { grid-column: 2; grid-row: 2; }
    .symbol-card { padding: 18px 16px; border-radius: 22px; }
    .tool-intro h2 { font-size: 1.25rem; }
    .search-field { flex-basis: 100%; }
    .search-form > .button { width: 100%; }
    .detail-heading { flex-wrap: wrap; gap: 12px; }
    .selected-glyph { width: 52px; height: 52px; font-size: 2rem; }
    .detail-heading > .button { width: 100%; }
    .selected-detail { padding: 14px 12px; }
    .code-field { grid-template-columns: minmax(0, 1fr); gap: 5px; }
    .symbol-grid { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 7px; }
    .result-pager { gap: 8px; font-size: .68rem; }
    .result-pager .button { padding: 8px 10px; font-size: .72rem; }
}
