.fun-page { max-width:1240px; margin:0 auto; padding:32px 28px 64px; }
.fun-heading { padding:24px 0 26px; border-bottom:3px solid #222; }
.fun-kicker { font:700 .72rem/1.6 Arial,sans-serif; letter-spacing:.09em; color:#9d1640; margin:0 0 12px; }
.fun-heading h1 { font-family:var(--nature-serif,Georgia,serif); font-size:clamp(2rem,4vw,3.6rem); line-height:1.2; margin:6px 0 20px; text-decoration:none; max-width:none; }
.fun-heading > p:not(.fun-kicker) { color:#555; max-width:760px; line-height:1.8; }
.fun-heading > a { display:inline-block; margin-top:10px; font-size:.9rem; }
.fun-credit { font-size:.85rem; line-height:1.8; color:#555; margin:20px 0 30px; }
.fun-library-heading { display:flex; align-items:baseline; justify-content:space-between; gap:18px; border-bottom:1px solid #bbb; padding:8px 0 14px; margin-bottom:24px; }
.fun-library-heading h2 { margin:0; font-size:1.5rem; }
.fun-library-heading span { font-size:.7rem; letter-spacing:.08em; color:#666; }
.fun-catalog { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; }
.fun-card { display:flex; flex-direction:column; min-width:0; border:1px solid #d5d5d5; padding:22px; background:#fff; }
.fun-card-art { margin:-22px -22px 20px; padding:12px 18px; background:#f5f2f3; color:#a0123b; border-bottom:1px solid #e7dfe2; }
.fun-card:nth-child(3n+2) .fun-card-art { color:#245c6b; background:#f0f5f5; }
.fun-card:nth-child(3n+3) .fun-card-art { color:#5b4c83; background:#f3f2f7; }
.fun-card-art svg { width:100%; height:88px; display:block; }
.fun-card h3 { font:700 1.6rem/1.15 var(--nature-serif,Georgia,serif); margin:0 0 8px; }
.fun-card-zh { font-size:.95rem; font-weight:700; margin:0 0 14px; }
.fun-card-description { color:#555; font-size:.88rem; line-height:1.8; margin:0 0 18px; flex:1; }
.fun-card-tags { font-size:.72rem; color:#666; margin:0 0 18px; }
.fun-card-actions { display:flex; justify-content:space-between; gap:12px; align-items:center; border-top:1px solid #ddd; padding-top:14px; font-size:.83rem; }
.fun-card-actions a { color:inherit; }
.fun-card-actions .fun-launch { color:#9d1640; font-weight:700; }
.fun-workspace { scroll-margin-top:160px; border:1px solid #bbb; margin-bottom:36px; background:#fff; }
.fun-workspace[hidden] { display:none; }
.fun-workspace-bar { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:18px 20px; border-bottom:1px solid #ddd; }
.fun-workspace-bar h2 { font-size:1.25rem; margin:0; }
.fun-workspace-bar .fun-kicker { margin:0 0 4px; }
.fun-actions { display:flex; flex-wrap:wrap; align-items:center; gap:12px; font-size:.85rem; flex-shrink:0; }
.fun-actions button { border:1px solid #aaa; padding:9px 12px; background:#fff; font:inherit; cursor:pointer; }
#simulatorStatus, .fun-workspace-note { margin:12px 20px; font-size:.8rem; line-height:1.6; color:#555; }
.fun-page :focus-visible { outline:3px solid #1567a1; outline-offset:4px; }
.fun-tools-entry a { display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; padding:18px 20px; background:#f7f2f4; border-left:3px solid #a0123b; color:#222; text-decoration:none; }
.fun-tools-entry a:hover strong { text-decoration:underline; }
.fun-tools-entry span { font-size:.85rem; color:#555; }
.fun-home-intro { color:#555; line-height:1.7; }
.fun-home-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border:1px solid #ccc; }
.fun-home-grid > a { display:grid; gap:12px; padding:22px; text-decoration:none; color:inherit; border-right:1px solid #ccc; }
.fun-home-grid > a:last-child { border-right:0; }
.fun-home-grid > a:hover { background:#f7f2f4; }
.fun-home-grid span { font-size:.7rem; letter-spacing:.08em; color:#9d1640; }
.fun-home-grid strong { font-family:var(--nature-serif,Georgia,serif); font-size:1.35rem; line-height:1.25; }
.fun-home-grid small { color:#666; font-size:.76rem; }
.fun-home-footer { display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap; font-size:.83rem; margin-top:14px; }
.fun-home-footer span { color:#666; }
@media(max-width:960px) { .fun-catalog { grid-template-columns:repeat(2,minmax(0,1fr)); } .fun-workspace-bar { flex-direction:column; align-items:start; } }
/* Independent local laboratory: input controls and numerical plots. */
.lab-layout { display:grid; grid-template-columns:minmax(210px,270px) minmax(0,1fr); align-items:start; border-top:1px solid #ddd; }
.lab-controls { padding:22px; background:#f8f7f5; border-right:1px solid #ddd; }
.lab-control { display:grid; gap:9px; margin-bottom:24px; }
.lab-control:last-child { margin-bottom:0; }
.lab-control label { font-weight:700; font-size:.82rem; line-height:1.5; }
.lab-control input[type=number] { width:100%; min-width:0; border:1px solid #aaa; border-radius:0; background:white; padding:10px; font:inherit; color:#222; }
.lab-control input[type=range] { width:100%; margin:5px 0; accent-color:#a81743; cursor:pointer; }
.lab-range { font-size:.7rem; color:#777; }
.lab-output { min-width:0; padding:22px; }
.lab-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1px; background:#ddd; border:1px solid #ddd; }
.lab-metrics:empty { display:none; }
.lab-metrics > div { display:grid; gap:8px; padding:14px; background:#f7f7f5; }
.lab-metrics > div:first-child { background:#f7edf0; }
.lab-metrics span { font-size:.74rem; color:#555; }
.lab-metrics strong { font-size:1.17rem; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.lab-warning { font-size:.82rem; color:#8c4d05; line-height:1.7; }
.lab-warning:empty { display:none; }
.lab-plot { margin:24px 0; padding-top:18px; border-top:1px solid #ddd; }
.lab-plot figcaption { font-size:.98rem; font-weight:700; line-height:1.6; margin-bottom:12px; }
.lab-plot canvas { display:block; width:100%; height:280px; }
.lab-legend { display:flex; flex-wrap:wrap; gap:10px 18px; margin:8px 0 12px; font-size:.72rem; }
.lab-legend span { color:var(--series-color,#555); }
.lab-legend span::before { content:'●'; margin-right:5px; }
.lab-local-badge { font-size:.72rem; color:#55716b; }
.lab-plot-download, #simulatorDownload { cursor:pointer; font:inherit; font-size:.8rem; border:1px solid #aaa; background:#fff; color:#222; padding:8px 12px; }
#simulatorDownload:disabled { opacity:.45; cursor:default; }
.lab-method { padding:18px 22px; background:#f9f9f7; border-top:1px solid #ddd; font-size:.85rem; line-height:1.9; }
.lab-method summary { font-weight:700; cursor:pointer; }
.lab-method p { margin:12px 0; }
#simulatorReferences a { margin-left:10px; }
#simulatorPlots[aria-busy=true] { opacity:.55; }
@media(max-width:760px) { .lab-layout { grid-template-columns:1fr; } .lab-controls { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; border-right:0; border-bottom:1px solid #ddd; padding:16px; } .lab-control { margin:0; } .lab-output { padding:16px; } .lab-plot canvas { min-width:0; } .fun-workspace { scroll-margin-top:100px; } }
@media(max-width:400px) { .lab-controls { grid-template-columns:1fr; } .lab-metrics { grid-template-columns:1fr; } }
/* Propagation instruments use a compact control deck and paired field plots. */
body.lab-focused { background:#eaf0f7; }
.lab-focused .site-header,.lab-focused .fun-heading,.lab-focused .fun-credit,.lab-focused .breadcrumb,.lab-focused #siteFooter { display:none; }
.lab-focused .fun-page { max-width:1600px; padding:24px 16px 60px; }
.lab-focused .fun-library-heading,.lab-focused #funCatalog { margin-top:28px; }
.lab-propagation { border:0; background:none; }
.lab-propagation .fun-workspace-bar { background:#fff; border:1px solid #d4dce5; border-radius:20px; box-shadow:0 10px 30px #192f4a16; margin-bottom:14px; align-items:start; }
.lab-propagation .fun-workspace-bar h2 { font:700 1.65rem/1.2 Arial,sans-serif; text-decoration:none; }
.lab-propagation .lab-layout { display:flex; flex-direction:column; border:0; }
.lab-propagation .lab-controls { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); grid-template-rows:repeat(4,auto); grid-auto-flow:column; gap:10px 18px; width:100%; padding:12px; margin:0 0 16px; border:1px solid #d4dce5; border-radius:18px; background:#ffffffed; box-shadow:0 10px 30px #192f4a16; }
.lab-propagation .lab-control { grid-template-columns:1fr 80px; gap:2px 8px; margin:0; }
.lab-propagation .lab-control label { font:500 .76rem/1.4 Arial,sans-serif; align-self:center; }
.lab-propagation .lab-control input[type=number] { font-size:.8rem; padding:3px 6px; height:25px; border-radius:4px; border-color:#c4ced9; }
.lab-propagation .lab-control input[type=range] { grid-column:1/-1; accent-color:#086de0; margin:0; height:14px; }
.lab-propagation .lab-range { display:none; }
.lab-propagation .lab-output { padding:0; width:100%; display:flex; flex-direction:column; }
.lab-propagation #simulatorPlots { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; order:0; }
.lab-propagation .lab-plot { padding:16px; margin:0; border:1px solid #d4dce5; border-radius:18px; background:#fff; box-shadow:0 10px 30px #192f4a16; min-width:0; }
.lab-propagation .lab-plot figcaption { font:700 1rem/1.3 Arial,sans-serif; text-transform:uppercase; }
.lab-propagation .lab-plot canvas { height:300px; }
.lab-propagation .lab-metrics { order:1; margin-top:16px; border-radius:16px; overflow:hidden; grid-template-columns:repeat(3,minmax(0,1fr)); }
.lab-propagation .lab-warning { order:2; }
.lab-propagation #simulatorDownload { order:3; align-self:start; margin-top:16px; }
.lab-evolution { grid-column:1/-1; min-width:0; padding:16px; border:1px solid #d4dce5; border-radius:18px; background:#fff; }
.lab-evolution > label { display:block; font-size:.9rem; font-weight:700; margin-bottom:10px; }
.lab-evolution > input { width:100%; accent-color:#086de0; }
.lab-evolution .lab-plot { border:0; box-shadow:none; }
.lab-save-all { position:fixed; right:22px; bottom:22px; z-index:20; border:0; border-radius:10px; padding:13px 18px; background:#1b2738; color:white; font:700 .85rem Arial,sans-serif; box-shadow:0 8px 24px #14253a44; cursor:pointer; }
.lab-save-all[hidden] { display:none; }
.lab-propagation .lab-method { margin-top:20px; border-radius:16px; border:1px solid #d4dce5; }
@media(max-width:700px) { .lab-propagation .lab-controls { grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(5,auto); } .lab-propagation #simulatorPlots { grid-template-columns:1fr; } .lab-propagation .lab-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } .lab-propagation .fun-workspace-bar { flex-direction:column; gap:12px; } }
@media(max-width:420px) { .lab-propagation .lab-controls { grid-template-columns:1fr;grid-template-rows:none;grid-auto-flow:row; } }
.lab-instrument-actions {display:flex;flex-wrap:wrap;gap:8px;margin:12px 0;align-items:center;}
.lab-instrument-actions[hidden],.lab-instrument-actions [hidden],.lab-controls .lab-control[hidden]{display:none!important;}
.lab-instrument-actions button,.lab-instrument-actions label {font:500 .85rem Arial,sans-serif;border:1px solid #c4ced9;border-radius:6px;background:white;padding:8px 12px;color:#24364b;}
.lab-instrument-actions input[type=file]{max-width:200px;margin-left:8px;}
.lab-propagation .lab-controls {grid-auto-flow:row;grid-template-rows:none;}
.lab-propagation .lab-control select{width:100%;min-width:0;height:30px;grid-column:1/-1;font-size:.85rem;}
.lab-propagation .lab-plot{font-size:calc(1rem * var(--lab-ui-scale,1));}
.lab-propagation .lab-plot canvas{height:calc(300px * var(--lab-ui-scale,1));}
.lab-plot canvas:focus-visible{outline:3px solid #126ce0;outline-offset:4px;}
@media(max-width:700px){.lab-propagation .lab-controls{grid-template-rows:none;}.lab-instrument-actions{gap:6px;}.lab-instrument-actions input[type=file]{max-width:160px;}}
