.chem-library{width:min(calc(100% - 64px),1600px);max-width:1600px;margin:0 auto;padding-top:36px;padding-bottom:64px;--chem-accent:var(--teal,#267b79);--chem-on-accent:#fff;font-size:16px;line-height:1.65}
html[data-theme=dark] .chem-library{--chem-on-accent:#102735}
.chem-library *{box-sizing:border-box}.chem-library [hidden]{display:none!important}
.chem-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin-bottom:30px}.chem-kicker{margin:0 0 10px;color:var(--chem-accent);font-size:15px;font-weight:650;letter-spacing:.05em}.chem-heading h1{font-size:clamp(32px,3vw,46px);line-height:1.2;letter-spacing:-.035em;margin:0 0 15px}.chem-heading>div>p:last-child{margin:0;color:var(--muted);font-size:18px;max-width:48em}.chem-heading>a{white-space:nowrap;margin-top:8px;font-weight:600;text-underline-offset:5px}
.chem-library button,.chem-library input,.chem-library textarea,.chem-library select{font:inherit}.chem-library button{border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--ink);padding:9px 14px;min-height:44px;cursor:pointer;font-weight:550;line-height:1.4;transition:background .16s,border-color .16s,box-shadow .16s}.chem-library button:hover{border-color:var(--chem-accent);background:var(--soft)}.chem-library button:active{box-shadow:inset 0 1px 3px #0002}.chem-library button:disabled{opacity:.55;cursor:wait}.chem-library .chem-primary{background:var(--chem-accent);color:var(--chem-on-accent);border-color:var(--chem-accent)}.chem-library .chem-primary:hover{background:var(--chem-accent);color:var(--chem-on-accent);filter:brightness(1.08)}.chem-library :is(button,input,textarea,select,a):focus-visible{outline:3px solid var(--chem-accent);outline-offset:3px}
.chem-context{display:flex;align-items:center;justify-content:space-between;gap:18px;border:1px solid var(--line);border-left:3px solid var(--chem-accent);border-radius:10px;padding:15px 20px;background:var(--surface);margin-bottom:24px}.chem-context span{display:block;color:var(--muted);font-size:15px}.chem-context button{flex-shrink:0}.chem-picker-mode{padding-bottom:116px}.chem-picker-mode .chem-context{position:sticky;top:calc(var(--chem-nav-offset,88px) + 8px);z-index:12;box-shadow:0 6px 22px #00000012}.chem-picker-dock{position:fixed;inset:auto 0 0;display:flex;align-items:center;justify-content:center;gap:22px;padding:12px 20px calc(12px + env(safe-area-inset-bottom));background:var(--surface);border-top:1px solid var(--line);z-index:18;box-shadow:0 -5px 24px #0000000b}.chem-picker-dock span{color:var(--muted);font-size:15px}
.chem-search{padding:24px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}.chem-search>label{display:block;font-size:16px;font-weight:650;margin-bottom:10px}.chem-search>div{display:flex;gap:10px;align-items:center}.chem-search input{width:100%;min-width:0;min-height:50px;border:1px solid var(--line);border-radius:8px;background:var(--soft);color:var(--ink);padding:11px 15px}.chem-search input::placeholder{color:var(--muted);opacity:1}.chem-search button{white-space:nowrap;min-height:50px}.chem-search .chem-primary{padding-inline:24px}
.chem-search>p{font-size:15px;color:var(--muted);margin:12px 0 0}.chem-refine{display:flex;justify-content:flex-end;gap:20px;flex-wrap:wrap;padding-top:17px}.chem-refine label,.chem-category-mobile label{display:flex;gap:10px;align-items:center;font-size:15px;color:var(--muted)}.chem-refine select,.chem-category-mobile select{background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:8px;min-height:44px;padding:8px 30px 8px 11px;max-width:min(100%,340px)}.chem-refine select:disabled,.chem-category-mobile select:disabled{opacity:.55;cursor:wait}.chem-category-mobile{display:none}
.chem-categories{display:flex;gap:9px;flex-wrap:wrap;padding:22px 0 10px;border-bottom:1px solid var(--line)}.chem-categories button{display:flex;gap:9px;align-items:center}.chem-categories small{font-size:15px;color:var(--muted);font-weight:400}.chem-categories button[aria-pressed=true],#chem-saved[aria-pressed=true]{border-color:var(--chem-accent);background:var(--soft);color:var(--chem-accent);box-shadow:inset 0 -2px var(--chem-accent)}
.chem-results{display:flex;justify-content:space-between;gap:16px;align-items:center;margin-top:19px}.chem-results>p{margin:0;font-size:17px;font-weight:600}.chem-results button{flex-shrink:0}.chem-status{min-height:26px;font-size:15px;color:var(--chem-accent);margin:6px 0 13px}
.chem-status:empty{display:none}.chem-grid{margin-top:18px}
.chem-preview-link{display:block;flex-shrink:0;text-decoration:none;cursor:pointer}.chem-preview-link:hover .chem-preview{background:#f6fbfb}.chem-library .chem-preview-link:focus-visible{outline-offset:-4px;position:relative;z-index:1}
.chem-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px;align-items:stretch}.chem-card{min-width:0;border:1px solid var(--line);border-radius:13px;background:var(--surface);overflow:hidden;display:flex;flex-direction:column;transition:border-color .16s,box-shadow .16s}.chem-card:hover{border-color:var(--chem-accent);box-shadow:0 4px 18px #00000008}.chem-preview{width:100%;height:170px;display:block;object-fit:contain;padding:14px 16px;background:#fff;border-bottom:1px solid var(--line)}.chem-card-content{padding:18px 19px;display:flex;flex-direction:column;flex:1}.chem-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:9px}.chem-card h2{font-size:20px;line-height:1.4;letter-spacing:-.02em;margin:0;overflow-wrap:anywhere}.chem-abbr{display:block;font-size:16px;margin-top:3px;color:var(--muted);font-weight:500}.chem-save{padding:4px 9px!important;min-height:35px!important;font-size:15px!important;flex-shrink:0}.chem-save[aria-pressed=true]{color:var(--chem-accent);border-color:var(--chem-accent)}.chem-english{font-size:15px;line-height:1.4;color:var(--muted);margin:8px 0 0;overflow-wrap:anywhere}.chem-formula{font-size:23px;font-family:Arial,"Microsoft YaHei",sans-serif;line-height:1.5;margin:14px 0 11px;overflow-wrap:anywhere}.chem-kind{font-size:15px;color:var(--muted);margin:0 0 17px}.chem-card-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:auto}.chem-card-actions button{font-size:15px;padding:9px 11px;flex:1;white-space:nowrap}
.chem-empty{padding:44px 24px;border:1px dashed var(--line);border-radius:13px;background:var(--surface);text-align:center}.chem-empty h2{font-size:23px;margin:0 0 10px}.chem-empty p{font-size:17px;color:var(--muted);margin:0 0 20px}.chem-pagination{display:flex;justify-content:center;gap:8px;align-items:center;flex-wrap:wrap;margin:28px 0}.chem-pagination p{margin:0 10px;color:var(--muted)}.chem-pagination button[aria-current=page]{border-color:var(--chem-accent);background:var(--chem-accent);color:var(--chem-on-accent)}.chem-boundary{border-top:1px solid var(--line);margin-top:34px;padding-top:22px;color:var(--muted);font-size:15px;max-width:1000px}.chem-boundary strong{color:var(--ink);font-size:17px}.chem-boundary p{margin:8px 0}
.chem-dialog,.chem-copy-dialog{border:1px solid var(--line);border-radius:16px;color:var(--ink);background:var(--surface);padding:0;box-shadow:0 25px 100px #0005}.chem-dialog{width:min(1000px,calc(100vw - 40px));max-height:calc(100dvh - 40px);overflow:auto}.chem-dialog::backdrop,.chem-copy-dialog::backdrop{background:#0b1724a6}.chem-dialog>header{display:flex;align-items:flex-start;gap:20px;justify-content:space-between;padding:26px 30px;border-bottom:1px solid var(--line)}.chem-dialog h2{font-size:28px;margin:0;line-height:1.3}.chem-dialog header p:last-child{font-size:16px;color:var(--muted);margin:9px 0 0}.chem-dialog header button{flex-shrink:0}.chem-detail-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:30px;padding:28px 30px}.chem-detail-visual{min-width:0}.chem-detail-visual img{display:block;width:100%;height:290px;object-fit:contain;padding:18px;background:white;border:1px solid var(--line);border-radius:10px}.chem-detail-visual p{font-size:15px;color:var(--muted);margin:13px 0}.chem-detail-info{min-width:0}.chem-detail-info section+section{margin-top:24px;padding-top:20px;border-top:1px solid var(--line)}.chem-dialog h3{font-size:17px;margin:0 0 8px}.chem-detail-formula{font-size:29px;line-height:1.4;margin:0 0 16px;overflow-wrap:anywhere}.chem-detail-actions{display:flex;flex-wrap:wrap;gap:9px}.chem-detail-actions button{font-size:16px}.chem-detail-info p,.chem-sources{font-size:16px;overflow-wrap:anywhere}.chem-detail-info p{margin:8px 0}.chem-sources{padding-left:20px;margin:8px 0}.chem-sources li+li{margin-top:12px}.chem-sources a{text-underline-offset:3px}.chem-sources span{display:block;color:var(--muted);font-size:15px}.chem-detail-info .chem-meta{font-size:15px;color:var(--muted);margin-top:16px}.chem-dialog>footer{padding:20px 30px 22px;border-top:1px solid var(--line);background:var(--soft)}.chem-dialog footer p{font-size:15px;min-height:25px;margin:12px 0 0;color:var(--chem-accent)}
.chem-copy-dialog{width:min(680px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;padding:26px}.chem-copy-dialog h2{font-size:24px;margin:0 0 12px}.chem-copy-dialog p,.chem-copy-dialog label{font-size:16px}.chem-copy-dialog textarea{display:block;width:100%;min-height:150px;padding:12px;margin:8px 0 18px;border:1px solid var(--line);border-radius:8px;background:var(--soft);color:var(--ink);font-family:ui-monospace,Consolas,monospace;font-size:15px}.chem-copy-dialog>div{display:flex;gap:10px}
.chem-downloads{margin-top:34px;padding:22px 24px;border:1px solid var(--line);border-radius:13px;background:var(--surface)}.chem-downloads h2{font-size:22px;margin:0 0 7px}.chem-downloads p{font-size:16px;color:var(--muted);margin:0 0 17px}.chem-downloads>div{display:flex;flex-wrap:wrap;gap:12px}.chem-downloads a{display:inline-flex;align-items:center;gap:18px;min-height:44px;border:1px solid var(--line);border-radius:8px;padding:9px 14px;font-size:16px;font-weight:600;text-decoration:none}.chem-downloads a:hover{border-color:var(--chem-accent);background:var(--soft)}.chem-downloads a span{font-size:15px;color:var(--muted);font-weight:400}
@media(min-width:1800px){.chem-grid{grid-template-columns:repeat(5,minmax(0,1fr))}}
@media(max-width:1100px){.chem-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.chem-heading{gap:18px}.chem-card-content{padding:17px}}
@media(max-width:780px){.chem-library{padding-top:30px}.chem-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.chem-heading{display:block}.chem-heading>a{display:inline-block;margin-top:18px}.chem-heading>div>p:last-child{font-size:17px}.chem-search{padding:18px}.chem-categories{gap:7px}.chem-categories button{padding:9px 11px}.chem-preview{height:150px;padding:12px}.chem-card h2{font-size:19px}.chem-formula{font-size:22px}.chem-dialog>header{padding:21px}.chem-detail-layout{grid-template-columns:1fr;padding:21px;gap:22px}.chem-detail-visual img{height:220px}.chem-dialog>footer{padding:20px 21px}.chem-detail-visual p{margin-bottom:0}.chem-dialog h2{font-size:25px}}
@media(max-width:600px){.chem-categories{display:none}.chem-category-mobile{display:block;padding-top:18px}.chem-category-mobile select{flex:1;min-width:0}.chem-refine{justify-content:flex-start;gap:10px}.chem-refine label{flex:1 1 100%;min-width:0}.chem-refine select{flex:1;min-width:0}}
@media(max-width:440px){.chem-grid{grid-template-columns:1fr}.chem-preview{height:178px}.chem-card-content{padding:20px}.chem-search input{flex:1}.chem-search .chem-primary{padding-inline:14px}.chem-search button{font-size:15px;padding-inline:10px}.chem-results{align-items:flex-start}.chem-results>p{font-size:16px}.chem-dialog{width:calc(100vw - 20px);max-height:calc(100dvh - 20px)}.chem-dialog>header{gap:10px}.chem-detail-actions button{flex-grow:1}.chem-pagination p{width:100%;text-align:center;order:-1}.chem-context{padding:14px 16px;gap:5px}}
@media(prefers-reduced-motion:reduce){.chem-library button,.chem-card{transition:none}}
.chem-dialog #chem-copy-name{margin-top:12px;font-size:15px;padding:7px 12px}.chem-dialog #chem-detail-en{font-size:16px;color:var(--muted);margin:9px 0 0}.chem-dialog #chem-detail-visual-title{font-size:23px;line-height:1.3;margin:0 0 14px}.chem-detail-visual #chem-copy-image{margin-top:2px}.chem-detail-visual .chem-meta{font-size:15px;line-height:1.65}.chem-sources .chem-source-title{margin-top:5px;color:var(--ink)}.chem-empty button+button{margin-left:10px}
.chem-style-control{display:flex;align-items:center;gap:12px;font-size:15px;font-weight:600;min-width:0}.chem-style-control select{flex:1;min-width:0;max-width:100%;min-height:44px;padding:8px 30px 8px 11px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink)}.chem-detail-visual #chem-style-note{margin:8px 0 14px;overflow-wrap:anywhere}.chem-style-control select:disabled{opacity:.55;cursor:wait}
.chem-dialog{overflow:hidden}.chem-dialog[open]{display:flex;flex-direction:column}.chem-dialog>header,.chem-dialog>footer{flex-shrink:0}.chem-dialog>header{padding:18px 24px;gap:16px}.chem-dialog>header>div{min-width:0}.chem-dialog>header .chem-kicker{font-size:13px;margin-bottom:5px}.chem-dialog h2{font-size:25px;overflow-wrap:anywhere}.chem-dialog #chem-detail-en{font-size:14px;margin-top:5px;line-height:1.4}.chem-dialog #chem-detail-close{white-space:nowrap;min-width:74px}.chem-detail-scroll{overflow:auto;min-height:0;overscroll-behavior:contain;scroll-padding:16px;scrollbar-gutter:stable}.chem-dialog>footer{padding:14px 24px 16px}.chem-dialog footer p{margin:8px 0 0;font-size:14px;line-height:1.5;min-height:0}.chem-dialog footer .chem-detail-actions{align-items:stretch}.chem-more{margin-top:22px;border-top:1px solid var(--line)}.chem-more summary{padding:13px 0;min-height:44px;cursor:pointer;font-size:16px;font-weight:600;list-style-position:inside}.chem-more section{padding-top:12px}.chem-more summary:focus-visible{outline:3px solid var(--chem-accent);outline-offset:3px}.chem-dialog #chem-copy-name{margin-top:0;padding:9px 14px;min-height:44px}.chem-dialog .chem-detail-visual #chem-detail-visual-note{font-size:14px;line-height:1.5}
@media(max-width:600px){.chem-context{flex-wrap:wrap;gap:10px}.chem-context span{display:none}.chem-context strong{font-size:15px}.chem-context button{font-size:14px;padding:8px 10px}.chem-picker-dock{justify-content:space-between;gap:12px;padding-inline:16px}.chem-picker-dock span{font-size:14px;max-width:13em}.chem-dialog>header{padding:14px 16px}.chem-dialog h2{font-size:21px}.chem-dialog>header .chem-kicker{max-width:23em;line-height:1.4}.chem-dialog #chem-detail-en{display:none}.chem-detail-layout{padding:16px;gap:20px}.chem-detail-visual img{height:190px}.chem-dialog #chem-detail-visual-title{font-size:19px;margin-bottom:10px}.chem-dialog>footer{padding:12px 14px calc(12px + env(safe-area-inset-bottom))}.chem-dialog footer .chem-detail-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.chem-dialog footer .chem-detail-actions button{font-size:15px;padding:9px 8px;min-height:44px}.chem-dialog footer p{font-size:13px}.chem-dialog .chem-style-control{font-size:14px;gap:8px}.chem-dialog .chem-detail-visual p{font-size:14px}.chem-more{margin-top:18px}}
.chem-formulations{margin-top:18px;border-top:1px solid var(--line);min-width:0}.chem-formulations>summary{min-height:44px;padding:12px 0;cursor:pointer;font-weight:650;display:flex;align-items:center;flex-wrap:wrap;gap:7px 12px;list-style:none}.chem-formulations>summary::before{content:"▸";font-size:13px;color:var(--chem-accent)}.chem-formulations[open]>summary::before{content:"▾"}.chem-formulations-count{font-size:13px;font-weight:500;color:var(--muted)}.chem-formulations-body>.chem-meta{margin:4px 0 12px;font-size:13px;line-height:1.65}.chem-formulations :is(summary,a,button):focus-visible{outline:3px solid var(--chem-accent);outline-offset:3px}.chem-formulations-paper{border:1px solid var(--line);border-radius:9px;margin:11px 0;padding:0 12px;min-width:0}.chem-formulations-paper>summary{padding:12px 0;min-height:44px;cursor:pointer;line-height:1.5;overflow-wrap:anywhere;font-size:14px;font-weight:600;list-style-position:inside}.chem-formulations-paper>summary>span{display:inline}.chem-formulations-paper>summary>small{display:block;color:var(--muted);font-size:12px;font-weight:400;margin-top:5px}.chem-detail-info .chem-formulations-citation{font-size:12px;line-height:1.6;margin:0 0 8px}.chem-formulations-links{display:flex;flex-wrap:wrap;gap:8px 16px;font-size:12px;line-height:1.6;overflow-wrap:anywhere;margin-bottom:12px}.chem-formulation{border-top:1px solid var(--line);padding-bottom:9px}.chem-formulation>summary{cursor:pointer;min-height:44px;padding:11px 0;list-style-position:inside;font-size:14px;line-height:1.6;font-weight:600;overflow-wrap:anywhere}.chem-formulation>summary>small{display:block;font-size:12px;font-weight:500;line-height:1.7;margin-top:4px}.chem-formulation-complete{color:var(--chem-accent)}.chem-formulation-partial{color:var(--ink);background:var(--soft);padding:3px 7px;border-left:2px solid var(--chem-accent)}.chem-formulation>summary>.chem-formulation-caveat{color:var(--muted);font-weight:400;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.chem-detail-info .chem-formulation-abstract{font-size:13px;line-height:1.65;margin:2px 0 12px}.chem-formulation-facts{display:grid;grid-template-columns:80px minmax(0,1fr);gap:7px 11px;margin:0;font-size:13px;line-height:1.65;overflow-wrap:anywhere}.chem-formulation-facts dt{color:var(--muted)}.chem-formulation-facts dd{margin:0}.chem-formulation-evidence{margin-top:14px;padding:10px 12px;background:var(--soft);border-radius:7px;font-size:12px;line-height:1.6;overflow-wrap:anywhere}.chem-detail-info .chem-formulation-evidence p,.chem-detail-info .chem-formulation-evidence .chem-meta{font-size:12px;margin:5px 0;line-height:1.65}.chem-formulation-components{display:flex;align-items:center;flex-wrap:wrap;gap:5px;margin:12px 0;font-size:12px;color:var(--muted)}.chem-formulation-components button{font-size:12px;padding:5px 8px;min-height:36px;font-weight:500}.chem-formulation-components button:disabled{cursor:default;opacity:.7}.chem-formulation-actions{display:flex;flex-wrap:wrap;gap:7px;margin:11px 0}.chem-formulation-actions button{min-height:44px;font-size:13px;padding:8px 10px}.chem-formulations-scope{font-size:12px;line-height:1.65;color:var(--muted);margin:10px 0}.chem-formulations-scope>summary{cursor:pointer;padding:8px 0;min-height:36px}.chem-detail-info .chem-formulations-scope p{font-size:12px}.chem-formulations-body>#chem-formulations-feedback:empty{display:none}
@media(max-width:600px){.chem-formulation-components button{min-height:44px}.chem-formulation-facts{grid-template-columns:72px minmax(0,1fr);gap:6px 9px}.chem-formulation-actions button{flex:1}.chem-formulations-paper{padding-inline:10px}.chem-formulations>summary{font-size:15px}.chem-formulation>summary>.chem-formulation-caveat{-webkit-line-clamp:3}}
.chem-literature-entry{display:flex;flex-wrap:wrap;gap:7px 16px;font-size:12px;margin:0 0 20px;color:var(--muted,#536779)}.chem-literature-entry a{font-weight:650}
