/* Additive modal only. No canvas/header/node/global body styles. */
#xh-template-library{position:fixed;inset:0;z-index:110000;font:14px/1.6 "Microsoft YaHei",sans-serif;color:#eee}
#xh-template-library *{box-sizing:border-box}
#xh-template-library .xh-tpl-backdrop{position:absolute;inset:0;background:#0009;backdrop-filter:blur(3px)}
#xh-template-library section{position:absolute;inset:7vh 7vw;display:flex;flex-direction:column;background:#18191b;border:1px solid #3c3d40;border-radius:18px;box-shadow:0 24px 100px #0008;overflow:hidden}
#xh-template-library header{padding:20px 24px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #333}
#xh-template-library h2{font-size:21px;margin:0}#xh-template-library h3{font-size:20px}
#xh-template-library p{margin:6px 0;color:#babdc4}
#xh-template-library button{border:1px solid #414349;border-radius:9px;background:#24262a;color:#eee;padding:9px 14px;cursor:pointer;font:inherit;text-align:left}
#xh-template-library button:hover{border-color:#868b99;background:#30333a}
#xh-template-library button:focus-visible,#xh-template-library input:focus-visible,#xh-template-library textarea:focus-visible{outline:2px solid #bdc7f1;outline-offset:3px}
#xh-template-library button:disabled{opacity:.5;cursor:wait}
#xh-template-library header button{font-size:26px;padding:0 12px}
#xh-template-library .xh-tpl-body{display:grid;grid-template-columns:200px minmax(0,1fr);flex:1;min-height:0}
#xh-template-library nav{padding:18px 12px;background:#202124;border-right:1px solid #333;overflow:auto}
#xh-template-library nav button{display:block;width:100%;margin:4px 0;border-color:transparent;background:transparent}
#xh-template-library nav button[aria-pressed=true]{background:#373a43;border-color:#595f70;color:#fff}
#xh-template-library main{padding:22px;overflow:auto;min-width:0}
#xh-template-library form{display:flex;gap:8px;margin-bottom:18px}
#xh-template-library input,#xh-template-library textarea{font:inherit;color:#f5f5f5;background:#24262a;border:1px solid #4b4e56;border-radius:8px;padding:10px 12px;min-width:0;width:100%}
#xh-template-library form button{white-space:nowrap}
#xh-template-library .xh-tpl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(215px,1fr));gap:16px}
#xh-template-library .xh-tpl-card{display:flex;flex-direction:column;min-height:205px;padding:18px;background:#24262a}
#xh-template-library .xh-tpl-card strong{font-size:16px}
#xh-template-library .xh-tpl-card p{font-size:13px;flex:1}
#xh-template-library .xh-tpl-symbol{font-size:28px;color:#c2c9e0;margin-bottom:12px}
#xh-template-library .xh-tpl-cover{width:100%;height:auto;aspect-ratio:1;object-fit:cover;border-radius:8px;margin-bottom:12px;background:#1b1c20}
#xh-template-library small{color:#aab0bd}
#xh-template-library .xh-tpl-card-action{margin-top:12px;color:#d8def5}
#xh-template-library .xh-tpl-error{color:#ffbaba;border:1px solid #764747;border-radius:8px;padding:10px}
#xh-template-library .xh-tpl-flow{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:18px;list-style-position:inside;padding:0}
#xh-template-library .xh-tpl-flow li{background:#232529;border:1px solid #454851;border-radius:12px;padding:18px}
#xh-template-library .xh-tpl-flow span{display:block;color:#b2bbd6}
#xh-template-library .xh-tpl-flow p{white-space:pre-wrap;max-height:180px;overflow:auto}
#xh-template-library .xh-tpl-primary{background:#e4e7ee;color:#16181d;border-color:#e4e7ee;font-weight:600}
#xh-template-library footer{border-top:1px solid #333;padding:12px 24px;color:#b4b8c1;font-size:12px}
#xh-template-library [data-save-form]{display:grid;max-width:600px}#xh-template-library [data-save-form] label{display:block}
@media(max-width:720px){#xh-template-library section{inset:3vh 3vw}#xh-template-library .xh-tpl-body{grid-template-columns:130px minmax(0,1fr)}#xh-template-library main{padding:12px}#xh-template-library header{padding:14px}#xh-template-library .xh-tpl-grid{grid-template-columns:1fr}}
