:root{font-family:"Microsoft YaHei",system-ui,sans-serif;color:#294d49;--text:#294d49;--muted:#6d827d;--primary:#31816e;--primary-dark:#245f52}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden}button,input{font:inherit}button{cursor:pointer}.independent-model-app{height:100svh;display:flex;flex-direction:column;min-height:0}.independent-model-workspace{flex:1;min-height:0}.model-area{height:100%;display:flex;flex-direction:column;min-height:0}.model-stage{flex:1;min-height:0;position:relative;overflow:hidden;background:#f9fbf8}.water-layout{display:grid;grid-template-columns:minmax(0,7fr) minmax(275px,3fr);height:100%;position:relative;isolation:isolate}.main-panel{position:relative;overflow:hidden;min-width:0;min-height:0}.panel-top{position:absolute;top:22px;left:28px;right:24px;z-index:4;display:flex;justify-content:space-between;align-items:start;pointer-events:none}.panel-top button{pointer-events:auto;display:none}.eyebrow{font-size:11px;letter-spacing:.08em;color:#7c9690}.panel-top h2{font-size:23px;font-weight:500;margin:8px 0;color:#355d55;letter-spacing:.03em}.canvas-host{touch-action:none;user-select:none;-webkit-user-select:none}.canvas-host canvas{display:block;width:100%;height:100%;outline:none}.main-canvas{position:absolute;inset:0}.world-labels{position:absolute;inset:0;pointer-events:none}.scene-label{position:absolute;transform:translate(-50%,-50%);font-size:12px;white-space:nowrap;color:#477267;text-shadow:0 1px 3px #fff,0 -1px 3px #fff}.scene-label.water-label{color:#a8604f;font-weight:700;background:#fffaf2e8;border:1px solid #d9b58b;border-radius:12px;padding:2px 7px}.scene-label.site-label{background:#f7f5eb;color:#678578;border:1px solid #c5d5c6;border-radius:12px;width:23px;height:23px;display:grid;place-items:center}.protein-caption{position:absolute;right:7%;bottom:25%;display:grid;gap:6px;text-align:right;pointer-events:none}.protein-caption strong{font-size:16px;font-weight:500;color:#46665b}.protein-caption span{font-size:11px;color:#81978f}.local-panel{position:absolute;left:26px;top:25%;width:29%;max-width:290px;min-width:220px;height:285px;border:1px solid #dce5dc;background:#fffefaed;border-radius:16px;overflow:hidden;z-index:3;box-shadow:0 10px 26px #5b7d6710}.local-heading{position:absolute;z-index:3;left:15px;right:12px;top:12px;display:flex;justify-content:space-between;align-items:center}.local-heading .eyebrow{font-size:10px}.local-heading h3{font-size:13px;font-weight:500;margin:5px 0}.site-options{display:flex;gap:4px}.compact{min-height:29px!important;height:29px!important;padding:3px 9px!important;font-size:11px!important;border:1px solid #cfded7;background:#fffef8;border-radius:7px;color:#48665d}.compact.is-active{border-color:#6b9b87;background:#eaf3ed;color:#2d6555}.local-canvas{position:absolute;inset:55px 3px 41px}.local-labels{position:absolute;inset:55px 3px 41px;pointer-events:none}.local-note{position:absolute;bottom:10px;left:9px;right:9px;text-align:center;font-size:11px;line-height:1.6;margin:0;color:#7a8473}.local-note span:first-child{color:#8c7145}.keyframes{position:absolute;left:29px;right:27px;bottom:104px;display:flex;align-items:center;gap:13px;justify-content:center;color:#a4b6ac;z-index:3}.keyframes button{border:0;background:transparent;color:#869d93;padding:7px 4px;font-size:12px;border-bottom:2px solid transparent}.keyframes button.active{color:#446d5c;border-color:#6f9a80}.keyframes b{font-size:10px;margin-right:5px;opacity:.7}.scene-caption{position:absolute;left:80px;right:24px;bottom:18px;display:flex;justify-content:space-between;gap:10px;align-items:center;pointer-events:none}.scene-caption p{font-size:10px;line-height:1.6;text-align:right;color:#7f928b;margin:0}.tracked-tag{font-size:12px;background:#f6eddfcc;border:1px solid #decbae;padding:7px 11px;border-radius:8px;color:#8f7148}.structure-panel{position:relative;border-left:1px solid #dfe8e0;padding:25px 24px 15px;background:#fffefa90;display:flex;flex-direction:column;align-items:center;min-height:0;min-width:0}.structure-head{text-align:center}.structure-head h2{font-size:19px;font-weight:500;margin:9px 0 6px}.structure-head p{font-size:11px;color:#93a096;margin:0 0 16px}.representation{display:flex;gap:5px;z-index:4}.structure-canvas{height:36%;min-height:140px;width:100%;margin-top:7px;position:relative}.structure-labels{position:absolute;pointer-events:none;top:0;left:0;width:100%;height:100%}.structure-labels .scene-label{font-size:17px;font-weight:500}.structure-labels .element{color:#5f7066;font-size:13px}.geometry-facts{display:grid;grid-template-columns:auto auto;align-items:center;column-gap:12px;text-align:left;margin:6px 0 12px}.geometry-facts>strong{font-size:31px;font-weight:500;color:#6b887c;grid-row:span 2}.geometry-facts>span{font-size:11px;color:#84948c}.geometry-facts>div{font-size:12px;margin-top:6px}.geometry-facts b{font-weight:500}.geometry-facts>p{grid-column:span 2;text-align:center;font-size:10px;color:#9aa69f;margin:10px 0 0}.charge-control{font-size:11px;color:#6f857a;display:flex;align-items:center;gap:6px;z-index:3}.charge-control input{accent-color:#6c9682}.polarity-note{font-size:12px;line-height:1.8;text-align:center;color:#6e8278;margin:12px 0}.bond-legend{margin-top:auto;width:100%;display:flex;flex-direction:column;gap:9px;padding:17px 0 5px;border-top:1px solid #e4e9df;max-width:250px}.bond-legend span{font-size:11px;color:#7c8c80;display:flex;align-items:center;gap:9px}.bond-legend i{width:27px;height:0;border-top:3px solid #a4b5ab}.bond-legend .water-hbond{border-top:2px dashed #7ba3ac}.bond-legend .protein-hbond{border-top:2px dashed #b59a63}.back-to-scene{display:none}.timeline-wrap{display:flex;align-items:center;gap:8px;flex:1;min-width:140px}.timeline-wrap>span{font-size:10px;white-space:nowrap}.timeline-wrap output{flex:none;width:70px;font-size:10px;font-variant-numeric:tabular-nums;white-space:nowrap}.timeline-wrap input{min-width:0;flex:1;accent-color:#468573}[data-settings]{font-size:13px;line-height:1.7;display:grid;gap:13px}[data-settings] label{display:flex;gap:8px}.local-panel.is-hidden{display:none}
@media(max-width:860px){.water-layout{grid-template-columns:1fr}.panel-top{top:17px;left:20px;right:17px}.panel-top h2{font-size:18px;max-width:210px;line-height:1.6;margin-top:5px}.panel-top button{display:block}.structure-panel{display:none}.water-layout[data-layout="structure"] .structure-panel{display:flex;border:0;padding:17px 20px}.water-layout[data-layout="structure"] .main-panel{display:none}.back-to-scene{display:block;margin-top:13px}.structure-canvas{min-height:110px;height:35%}.structure-head h2{font-size:18px}.local-panel{width:176px;min-width:0;height:203px;max-width:none;left:13px;top:auto;bottom:127px;border-radius:12px}.local-heading{left:10px;right:8px;top:9px}.local-heading h3{font-size:10px}.local-heading .eyebrow{font-size:8px}.site-options .compact{font-size:10px!important;padding:2px 6px!important;min-height:24px!important;height:24px!important}.local-canvas,.local-labels{inset:48px 3px 38px}.local-note{font-size:9px;bottom:8px}.keyframes{bottom:74px;left:13px;right:13px;gap:5px}.keyframes button{font-size:10px}.keyframes b{display:none}.scene-caption{left:63px;right:12px;bottom:12px;gap:6px}.tracked-tag{font-size:10px;padding:4px 6px}.scene-caption p{font-size:8px}.protein-caption{bottom:30%;right:4%;gap:4px}.protein-caption strong{font-size:12px}.protein-caption span{font-size:8px;max-width:145px}.geometry-facts{margin:1px 0 8px}.geometry-facts>strong{font-size:26px}.polarity-note{font-size:11px;margin:8px 0}.bond-legend{padding-top:9px;gap:6px}.scene-label{font-size:10px}.scene-label.water-label{font-size:10px}.scene-label.site-label{width:18px;height:18px;font-size:9px}}
@media(orientation:landscape) and (max-height:520px){.water-layout{grid-template-columns:1fr}.structure-panel{display:none}.panel-top{top:11px;left:17px;right:16px}.panel-top h2{font-size:15px;margin:3px 0;max-width:none}.panel-top .eyebrow{font-size:9px}.panel-top button{display:block}.local-panel{left:15px;top:69px;bottom:60px;width:210px;height:auto;min-height:112px}.local-heading{top:7px}.local-heading h3{font-size:10px}.local-heading .eyebrow{font-size:8px}.local-canvas,.local-labels{inset:42px 3px 24px}.local-note{font-size:8px;bottom:3px}.local-note br{display:none}.keyframes{bottom:28px;left:220px;right:15px;gap:5px}.keyframes button{font-size:10px;padding:3px}.scene-caption{bottom:5px;left:63px;right:15px}.scene-caption p br{display:none}.scene-caption p{font-size:8px}.tracked-tag{font-size:9px;padding:3px 6px}.protein-caption{bottom:60px;right:8%}.protein-caption strong{font-size:11px}.protein-caption span{font-size:8px}.water-layout[data-layout="structure"]{grid-template-columns:1fr}.water-layout[data-layout="structure"] .structure-panel{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:45px 30px 1fr;padding:10px 30px;gap:4px}.water-layout[data-layout="structure"] .main-panel{display:none}.structure-head{text-align:left;grid-column:1;grid-row:1}.structure-head h2{font-size:14px;margin:4px 0}.structure-head p{display:none}.representation{grid-column:1;grid-row:2;justify-content:start}.structure-canvas{grid-row:1/4;grid-column:2;height:100%;min-height:0;margin:0}.geometry-facts{grid-row:3;grid-column:1;justify-content:start;align-self:start;margin:2px 0}.geometry-facts>strong{font-size:22px}.charge-control{position:absolute;left:30px;bottom:36px;font-size:10px}.polarity-note{display:none}.bond-legend{display:none}.back-to-scene{display:block;position:absolute;bottom:4px;left:30px}.structure-labels .scene-label{font-size:13px}}
@media(max-width:360px),(max-height:500px) and (orientation:portrait){.local-panel{display:none}.panel-top h2{font-size:15px;max-width:170px}.structure-panel{padding:9px 15px}.structure-head .eyebrow{font-size:9px}.structure-head h2{font-size:14px;margin:4px 0}.structure-head p{display:none}.structure-canvas{min-height:70px;height:30%}.geometry-facts>strong{font-size:23px}.geometry-facts>p{display:none}.polarity-note{font-size:10px;margin:4px 0}.bond-legend{gap:3px;padding-top:6px}.bond-legend span{font-size:9px}.charge-control{font-size:10px}.back-to-scene{margin-top:6px}.protein-caption{bottom:32%}}
@media(min-width:861px) and (min-height:521px){.keyframes{bottom:70px}.protein-caption{bottom:24%;right:4%}}
.phone-view-buttons{display:none}.scene-bond-legend{display:none}
@media(max-width:860px),(orientation:landscape) and (max-height:520px){.phone-view-buttons{display:grid;gap:6px;pointer-events:auto}.panel-top h2{font-size:16px;max-width:none}.local-panel{display:none}.main-panel.local-focus .local-panel{display:block;left:14px;right:14px;width:auto;max-width:none;top:102px;bottom:120px;height:auto;min-height:100px}.main-panel.local-focus .main-canvas,.main-panel.local-focus .world-labels,.main-panel.local-focus .protein-caption{visibility:hidden}.main-panel.local-focus .local-heading h3{font-size:14px}.main-panel.local-focus .local-heading .eyebrow{font-size:11px}.main-panel.local-focus .local-note{font-size:12px;bottom:14px}.main-panel.local-focus .local-canvas,.main-panel.local-focus .local-labels{inset:55px 8px 62px}.scene-bond-legend{display:flex;justify-content:center;gap:12px;position:absolute;bottom:53px;left:10px;right:10px;font-size:9px;color:#81958b;pointer-events:none}.scene-bond-legend .ww{color:#789ea7}.scene-bond-legend .wp{color:#a18a57}}
@media(orientation:landscape) and (max-height:520px){.phone-view-buttons{display:flex}.main-panel.local-focus .local-panel{left:80px;right:80px;top:45px;bottom:57px}.main-panel.local-focus .local-heading h3{font-size:10px}.main-panel.local-focus .local-heading .eyebrow{font-size:8px}.main-panel.local-focus .local-canvas,.main-panel.local-focus .local-labels{inset:30px 40px 10px}.main-panel.local-focus .local-note{left:auto;right:10px;bottom:12px;font-size:9px;max-width:100px}.main-panel.local-focus .local-note br{display:block}.scene-bond-legend{bottom:28px;left:15px;right:auto;font-size:8px;gap:7px}.keyframes{left:270px}.panel-top h2{font-size:14px}}
.model-area[data-immersive="true"] .panel-top{top:58px}.model-area[data-immersive="true"] .scene-caption{bottom:57px}.model-area[data-immersive="true"] .keyframes{bottom:100px}.model-area[data-immersive="true"] .structure-panel{padding-top:60px;padding-bottom:70px}
@media(orientation:landscape) and (max-height:520px){.keyframes{left:17px;right:auto;top:100px;bottom:auto;display:grid;gap:1px;justify-items:start}.keyframes>span{display:none}.keyframes button{padding:3px 1px}.scene-bond-legend{left:64px}.model-area[data-immersive="true"] .keyframes{top:112px;bottom:auto}.model-area[data-immersive="true"] .scene-bond-legend{bottom:80px}.model-area[data-immersive="true"] .local-panel{top:100px;bottom:95px}.model-area[data-immersive="true"] .structure-panel{padding:48px 30px 60px}.model-area[data-immersive="true"] .charge-control{bottom:90px}.model-area[data-immersive="true"] .back-to-scene{bottom:56px}}
@media(orientation:landscape) and (max-height:520px){.back-to-scene{left:75px}.main-panel.local-focus .local-canvas,.main-panel.local-focus .local-labels{right:110px}}

/* Binding cues follow the 3D molecular state; they do not blink on a CSS clock. */
.scene-label.is-binding{color:#8d5e20!important;background:#fff0ca!important;border:1px solid #d7ad60;box-shadow:0 0 13px #e9ba6573;font-weight:600}
.scene-label.site-label.is-binding{background:#e8b765!important;color:#473719!important}
.tracked-tag.is-binding{color:#795322;background:#fff0ce;border-color:#d7ad60;box-shadow:0 0 13px #e9ba6536}
.local-panel.is-binding{border-color:#dfc38c;box-shadow:0 8px 30px #ac8b4520}

/* A compact viewport needs separate image and annotation regions. The model
   coordinates, bond anchors and ordinary phone/desktop framing are unchanged. */
@media(max-width:360px) and (max-height:600px) and (orientation:portrait){
 .panel-top{top:5px;left:12px;right:10px}
 .panel-top .eyebrow{font-size:9px}
 .panel-top h2{font-size:13px;line-height:1.35;margin:4px 0}
 .phone-view-buttons{display:flex;gap:3px}
 .phone-view-buttons .compact{font-size:9px!important;padding:2px 5px!important}
 .main-canvas{inset:49px 0 100px}
 .protein-caption{bottom:71px;right:10px;gap:1px}
 .protein-caption strong{font-size:11px}
 .protein-caption span{font-size:8px;max-width:none}
 .keyframes{bottom:45px;left:55px;right:5px;gap:3px}
 .keyframes button{font-size:10px;padding:4px 2px}
 .scene-bond-legend{bottom:33px;left:55px;right:5px;font-size:8px;gap:7px}
 .scene-caption{bottom:3px;left:62px;right:5px;display:grid;gap:2px;justify-items:start}
 .tracked-tag{font-size:10px;padding:2px 5px}
 .scene-caption p{font-size:8px;text-align:left}
 .scene-caption p br{display:none}
 .main-panel.local-focus .local-panel{top:49px;bottom:94px;min-height:0;left:7px;right:7px}
 .main-panel.local-focus .local-heading{top:4px}
 .main-panel.local-focus .local-heading h3{font-size:10px;margin:2px 0}
 .main-panel.local-focus .local-heading .eyebrow{font-size:8px}
 .main-panel.local-focus .local-canvas,.main-panel.local-focus .local-labels{inset:33px 90px 3px 3px}
 .main-panel.local-focus .local-note{left:auto;right:4px;bottom:9px;max-width:90px;font-size:9px}
 .model-area[data-immersive="true"] .main-canvas{inset:96px 0 154px}
 .model-area[data-immersive="true"] .protein-caption{bottom:128px}
 .model-area[data-immersive="true"] .scene-bond-legend{bottom:88px}
 .model-area[data-immersive="true"] .local-panel{top:96px;bottom:154px}
}

@media(max-width:360px) and (max-height:600px) and (orientation:portrait){
 .water-layout[data-layout="structure"] .structure-panel{overflow-y:auto;display:flex;padding:8px 15px;overscroll-behavior:contain}
 .structure-panel>*{flex-shrink:0}
 .structure-head h2{margin:4px 0}
 .structure-canvas{height:82px;min-height:82px}
 .back-to-scene{margin-top:7px;margin-bottom:8px}
}
