body{font-family:sans-serif;overflow:hidden;margin:0;min-width:320px;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;touch-action:none}@media only screen and (max-width: 450px){body{background-color:var(--bg-color)}}@media only screen and (max-height: 450px){body.horizontal{background-color:var(--bg-color)}}#root{max-width:1280px;margin:0 auto;text-align:center;background-color:var(--bg-color);display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:50px}.phone{height:840px;width:400px;display:flex;flex-direction:column;align-items:center;justify-content:center}body.horizontal .phone{height:400px;width:840px}body.horizontal .phone .screen-container{position:absolute;zoom:.83;margin-bottom:0;width:506px}body.horizontal .phone .controls{margin-top:0;gap:70px}body.horizontal .phone .controls .play-container{gap:460px;padding-right:20px}body.horizontal .phone .controls .menu-container{flex-direction:column}body.horizontal .phone .controls .menu-container .menu-buttons{gap:460px}body.horizontal .phone .controls>.button-group{gap:460px}.screen-container{background-color:#4a4a4a;padding:0;aspect-ratio:256 / 240;margin-bottom:20px;position:relative}#game-screen{width:100%;height:100%;background-color:#000;aspect-ratio:256 / 196;zoom:2}.controls{margin-top:20px;display:flex;flex-direction:column;align-items:center;gap:50px}.controls .menu-container{display:flex;gap:30px}.controls .play-container{display:flex;flex-direction:row;align-items:center;gap:20px}.controls .control-btn{width:60px;height:20px;font-size:10px;background:linear-gradient(145deg,var(--primary-btn-color1),var(--primary-btn-color2));color:#fff;border:none;border-radius:10px;cursor:pointer;font-family:monospace;box-shadow:2px 2px 4px #0003,-2px -2px 4px #ffffff1a,inset 1px 1px 2px #fff3;display:flex;align-items:center;justify-content:center;transition:all .2s ease;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.controls .control-btn:hover{background:linear-gradient(105deg,var(--primary-btn-color1),var(--primary-btn-color2));transform:translateY(-1px);box-shadow:3px 3px 5px #00000040,-3px -3px 5px #ffffff26,inset 1px 1px 2px #ffffff4d}.controls .control-btn:active,.controls .control-btn.active{transform:scale(.95) translateY(.5px);box-shadow:1px 1px 2px #00000026,-1px -1px 2px #ffffff0d,inset 1px 1px 2px #0000001a;animation:button-press .1s ease-in-out}@keyframes button-press{0%{transform:scale(1)}50%{transform:scale(.95) translateY(.5px)}to{transform:scale(.97)}}.play-container .control-btn{width:60px;height:60px;border-radius:50%;padding:0;font-family:arial;font-size:22px;margin:-5px}.play-container .d-pad #dpad-buttons .control-btn{width:90px;height:90px;margin:-15px;box-shadow:none;background:transparent}.play-container .d-pad #circle-buttons .control-btn{rotate:45deg}.play-container .d-pad #circle-buttons #btn-circle-up,.play-container .d-pad #circle-buttons #btn-circle-down{width:68px;height:68px;background:transparent;box-shadow:none}.play-container .d-pad #circle-buttons #btn-circle-up:after,.play-container .d-pad #circle-buttons #btn-circle-down:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:60px;height:60px;border-radius:50%;background:linear-gradient(145deg,var(--primary-btn-color1),var(--primary-btn-color2));box-shadow:2px 2px 4px #0003,-2px -2px 4px #ffffff1a,inset 1px 1px 2px #fff3}.play-container .d-pad #circle-buttons #btn-circle-left,.play-container .d-pad #circle-buttons #btn-circle-right{width:80px;height:80px;background:transparent;box-shadow:none}.play-container .d-pad #circle-buttons #btn-circle-left:after,.play-container .d-pad #circle-buttons #btn-circle-right:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:60px;height:60px;border-radius:50%;background:linear-gradient(145deg,var(--primary-btn-color1),var(--primary-btn-color2));box-shadow:2px 2px 4px #0003,-2px -2px 4px #ffffff1a,inset 1px 1px 2px #fff3}.play-container .d-pad .control-btn div{width:60px;height:60px;border:none;border-radius:50%;box-shadow:2px 2px 4px #0003,-2px -2px 4px #ffffff1a,inset 1px 1px 2px #fff3}.d-pad{display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);gap:0px;width:180px;height:180px;position:relative;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#joystick-container{grid-column:1 / span 3;grid-row:1 / span 3;width:100%;height:100%;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;border-radius:50%;background:linear-gradient(145deg,var(--primary-btn-color1),var(--primary-btn-color2));box-shadow:inset 2px 2px 4px #0003,-2px -2px 4px #ffffff1a,1px 1px 2px #fff3}#dpad-buttons,#circle-buttons{grid-column:1 / span 3;grid-row:1 / span 3;width:100%;height:100%;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);align-items:center;justify-items:center;position:relative;z-index:2}.dpad-btn{width:50px;height:50px;border-radius:6px;font-size:20px;font-weight:700;display:flex;align-items:center;justify-content:center;position:relative;background:rgba(255,255,255,.1);transition:all .2s ease}.dpad-btn:hover{background:rgba(255,255,255,.2)}.dpad-btn:active{background:rgba(0,0,0,.2);transform:scale(.95)}.dpad-up:before{content:"";width:3px;height:24px;margin-top:36px;background:currentColor;border-radius:1px}.dpad-down:before{content:"";width:3px;height:24px;margin-bottom:36px;background:currentColor;border-radius:1px}.dpad-left:before{content:"";width:24px;height:3px;margin-left:36px;background:currentColor;border-radius:1px}.dpad-right:before{content:"";width:24px;height:3px;margin-right:36px;background:currentColor;border-radius:1px}.nipple{border-radius:50%!important;box-shadow:2px 2px 4px #0003,-2px -2px 4px #ffffff1a,inset 1px 1px 2px #fff3!important}.d-pad.dpad-mode:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:50px;height:150px;background:linear-gradient(145deg,var(--primary-btn-color1),var(--primary-btn-color2));border-radius:8px;z-index:0}.d-pad.dpad-mode:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:150px;height:50px;background:linear-gradient(145deg,var(--primary-btn-color1),var(--primary-btn-color2));border-radius:8px;z-index:0}.d-pad.dpad-mode{filter:drop-shadow(2px 2px 4px rgba(0,0,0,.2)) drop-shadow(-2px -2px 4px rgba(255,255,255,.1))}.circle-btn{width:50px;height:50px;border-radius:50%;font-size:18px;font-weight:700;display:flex;align-items:center;justify-content:center;position:relative;background:linear-gradient(145deg,var(--primary-btn-color1),var(--primary-btn-color2));color:#fff;border:none;cursor:pointer;transition:all .2s ease;box-shadow:2px 2px 4px #0003,-2px -2px 4px #ffffff1a,inset 1px 1px 2px #fff3;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.circle-btn:hover{background:linear-gradient(105deg,var(--primary-btn-color1),var(--primary-btn-color2));transform:translateY(-1px);box-shadow:3px 3px 5px #00000040,-3px -3px 5px #ffffff26,inset 1px 1px 2px #ffffff4d}.circle-btn:active,.circle-btn.active{transform:scale(.95) translateY(.5px);box-shadow:1px 1px 2px #00000026,-1px -1px 2px #ffffff0d,inset 1px 1px 2px #0000001a;animation:button-press .1s ease-in-out}.action-buttons{display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);gap:0px;align-items:center}.action-buttons button{width:50px;height:50px;border-radius:50%;border:none;background-color:#4a4a4a;color:#fff;cursor:pointer;font-size:16px}.action-buttons button:active{background-color:#2a2a2a}.rom-list{display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background-color:#4a4a4a;border-radius:10px;padding:20px;color:#fff;z-index:1000;max-height:80vh;overflow-y:auto;width:80%;max-width:620px}.rom-list.show{display:block}.rom-list h2{margin:0 0 15px;font-size:20px;text-align:center;border-bottom:2px solid #5a5a5a;padding-bottom:10px}.rom-list ul{list-style:none;padding:0 10px 0 0;margin:0 0 20px;display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px;max-height:50vh;overflow-y:auto}.rom-list ul::-webkit-scrollbar{width:8px}.rom-list ul::-webkit-scrollbar-track{background:#5a5a5a;border-radius:4px}.rom-list ul::-webkit-scrollbar-thumb{background:#7a7a7a;border-radius:4px}.rom-list li{padding:12px;background-color:#5a5a5a;color:#fff;border-radius:5px;cursor:pointer;transition:all .2s ease;text-align:center}.rom-list li:hover{background-color:#6a6a6a;transform:translateY(-2px);box-shadow:0 2px 5px #0003}.rom-item-content{display:flex;align-items:center;justify-content:space-between}.rom-item-left{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.rom-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cache-indicator{width:20px;height:20px;flex-shrink:0;opacity:.8;transition:all .2s ease;cursor:pointer;padding:4px;border-radius:4px;display:flex;align-items:center;justify-content:center}.cache-indicator[data-cached=true]{opacity:1;color:#4caf50}.cache-indicator[data-cached=false]{opacity:.7;color:#ffc107}.rom-list li.long-pressing{background-color:#ff6b6b;transform:scale(.98);box-shadow:0 0 10px #ff6b6b80}.rom-list li.long-press-ready{animation:pulse .8s ease-in-out}@keyframes pulse{0%{transform:scale(1);box-shadow:0 0 #ff6b6bb3}70%{transform:scale(1.02);box-shadow:0 0 0 10px #ff6b6b00}to{transform:scale(1);box-shadow:0 0 #ff6b6b00}}.rom-item-content:has(.cache-indicator[data-cached=true]){position:relative}.rom-item-content:has(.cache-indicator[data-cached=true]):hover:after{content:"右键或双击删除缓存";position:absolute;bottom:-25px;left:50%;transform:translate(-50%);background:rgba(0,0,0,.8);color:#fff;padding:4px 8px;border-radius:4px;font-size:12px;white-space:nowrap;z-index:1000;pointer-events:none;opacity:0;animation:fadeInTooltip .3s ease-in-out 1s forwards}@keyframes fadeInTooltip{0%{opacity:0;transform:translate(-50%) translateY(5px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.confirm-dialog{display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background-color:#4a4a4a;border-radius:10px;padding:0;color:#fff;z-index:1001;min-width:300px;max-width:400px;box-shadow:0 4px 20px #0000004d}.confirm-dialog.show{display:block}.confirm-content{padding:20px}.confirm-content h3{margin:0 0 15px;font-size:18px;text-align:center;color:#ff6b6b}.confirm-content p{margin:0 0 20px;font-size:14px;line-height:1.4;text-align:center;color:#e0e0e0}.confirm-actions{display:flex;gap:10px;justify-content:center}.confirm-btn{padding:10px 20px;border:none;border-radius:5px;font-size:14px;cursor:pointer;transition:all .2s ease;min-width:80px}.cancel-btn{background-color:#6a6a6a;color:#fff}.cancel-btn:hover{background-color:#7a7a7a}.confirm-btn-primary{background-color:#ff6b6b;color:#fff}.confirm-btn-primary:hover{background-color:#ff5252}.cache-indicator img{width:16px;height:16px;filter:brightness(0) saturate(100%)}.cache-indicator[data-cached=true] img{filter:brightness(0) saturate(100%) invert(58%) sepia(14%) saturate(3166%) hue-rotate(92deg) brightness(96%) contrast(89%)}.cache-indicator[data-cached=false] img{filter:brightness(0) saturate(100%) invert(84%) sepia(84%) saturate(2676%) hue-rotate(3deg) brightness(106%) contrast(101%)}.cache-indicator.loading img{filter:brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(346deg) brightness(104%) contrast(97%)}.cache-indicator.loading{color:#2196f3;font-size:10px;font-weight:700;text-align:center;line-height:1}.console-icon{width:20px;height:20px;flex-shrink:0;background-color:currentColor;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center}.console-icon[data-icon=nes]{-webkit-mask-image:url(/icons/nes.svg);mask-image:url(/icons/nes.svg)}.console-icon[data-icon=snes]{-webkit-mask-image:url(/icons/snes.svg);mask-image:url(/icons/snes.svg)}.console-icon[data-icon=gba]{-webkit-mask-image:url(/icons/gba.svg);mask-image:url(/icons/gba.svg)}.console-icon[data-icon=arcade]{-webkit-mask-image:url(/icons/arcade.svg);mask-image:url(/icons/arcade.svg)}.rom-name{flex:1;text-align:left;line-height:1.2}.rom-size{font-size:11px;color:#fff9;margin-left:8px;padding:2px 6px;background-color:#ffffff1a;border-radius:10px;white-space:nowrap;flex-shrink:0;transition:all .2s ease}.rom-input{margin:0;padding:15px;background-color:#5a5a5a;border-radius:5px;text-align:center}.rom-input label{color:#fff;display:block;margin-bottom:10px;font-size:16px}.rom-input input[type=file]{width:100%;max-width:calc(100% - 20px);padding:8px;background-color:#4a4a4a;border:1px solid #6a6a6a;border-radius:4px;color:#fff;cursor:pointer}.rom-input input[type=file]::-webkit-file-upload-button{background-color:#6a6a6a;color:#fff;padding:8px 16px;border:none;border-radius:4px;cursor:pointer;margin-right:10px;transition:background-color .2s}.rom-input input[type=file]::-webkit-file-upload-button:hover{background-color:#7a7a7a}.modal-overlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:999}.modal-overlay.show{display:block}.button-group{display:flex;gap:10px;justify-content:center}.button-group>div.button{width:60px;height:20px;font-size:10px;background:linear-gradient(145deg,var(--secondary-btn-color1),var(--secondary-btn-color2));color:#fff;border:none;border-radius:10px;cursor:pointer;font-family:monospace;box-shadow:2px 2px 4px #0003,-2px -2px 4px #ffffff1a,inset 1px 1px 2px #fff3;display:flex;align-items:center;justify-content:center;transition:all .2s ease;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.button-group>div.button:hover{background-color:#2a2a2a}.rom-list h2{margin:0 0 10px;font-size:18px}.rom-list ul{list-style:none;padding:0 10px 0 0;margin:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px}.rom-list li{padding:10px;background-color:#5a5a5a;border-radius:5px;cursor:pointer;transition:background-color .2s;text-align:left}.rom-list li:hover{background-color:#6a6a6a}.rom-input{margin-bottom:20px}:root{--bg-color: #c9c5bc;--primary-btn-color1: #72191c;--primary-btn-color2: #982d31;--secondary-btn-color1: #795548;--secondary-btn-color2: #593f36}.state-list{display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background-color:#4a4a4a;border-radius:10px;padding:20px;color:#fff;z-index:1000;max-height:80vh;overflow-y:auto;width:90%;max-width:600px}.state-list.show{display:block}.state-list h2{margin:0 0 15px;font-size:20px;text-align:center;border-bottom:2px solid #5a5a5a;padding-bottom:10px}.state-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:15px;margin-bottom:20px;max-height:60vh;overflow-y:auto}.state-item{background-color:#5a5a5a;border-radius:8px;padding:10px;cursor:pointer;transition:all .2s ease;text-align:center;border:2px solid transparent}.state-item:hover{background-color:#6a6a6a;transform:translateY(-2px);box-shadow:0 4px 8px #0000004d}.state-item.empty{border:2px dashed #7a7a7a;background-color:#3a3a3a;opacity:.7}.state-item.empty:hover{background-color:#4a4a4a;opacity:1}.state-screenshot{width:100%;aspect-ratio:256 / 196;background-color:#2a2a2a;border-radius:4px;margin-bottom:8px;display:flex;align-items:center;justify-content:center;font-size:12px;color:#888;background-size:contain;background-position:center;background-repeat:no-repeat}.state-info{font-size:12px}.state-slot{font-weight:700;margin-bottom:4px}.state-time{color:#ccc;font-size:10px}.state-actions{text-align:center;border-top:1px solid #5a5a5a;padding-top:15px}.close-btn{padding:10px 20px;background:linear-gradient(145deg,var(--secondary-btn-color1),var(--secondary-btn-color2));color:#fff;border:none;border-radius:5px;cursor:pointer;font-size:14px;transition:all .2s ease}.close-btn:hover{background:linear-gradient(145deg,var(--secondary-btn-color2),var(--secondary-btn-color1))}.options-dialog{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#000c;display:none;align-items:center;justify-content:center;z-index:1000}.options-dialog.show{display:flex}.options-content{background-color:#3a3a3a;border-radius:15px;max-width:720px;width:90%;color:#fff;box-shadow:0 10px 30px #00000080}.options-content h2{margin:10px 0;text-align:center;font-size:20px}.option-item{margin:10px 0}.option-item label{display:block;margin-bottom:10px;font-size:16px;font-weight:700;background:#313131;padding:5px 0}.orientation-buttons,.theme-buttons,.control-buttons{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}.orientation-btn,.theme-btn,.control-btn-option{padding:10px 20px;background:linear-gradient(145deg,var(--secondary-btn-color1),var(--secondary-btn-color2));color:#fff;border:none;border-radius:8px;cursor:pointer;font-size:14px;transition:all .2s ease;box-shadow:2px 2px 4px #0003,-2px -2px 4px #ffffff1a;min-width:60px;width:96px}.orientation-btn:hover,.theme-btn:hover,.control-btn-option:hover{background:linear-gradient(145deg,#8d6e63,#6d4c41);transform:translateY(-1px)}.orientation-btn.active,.theme-btn.active,.control-btn-option.active{background:linear-gradient(145deg,var(--primary-btn-color1),var(--primary-btn-color2));color:#fff;box-shadow:0 0 15px #fffc,0 0 25px #fff9,2px 2px 4px #ffffff4d,-2px -2px 4px #0003;transform:scale(1.05);animation:glow-pulse 2s ease-in-out infinite alternate}@keyframes glow-pulse{0%{box-shadow:0 0 15px #fffc,0 0 25px #fff9,2px 2px 4px #ffffff4d,-2px -2px 4px #0003}to{box-shadow:0 0 20px #fff,0 0 35px #fffc,2px 2px 4px #fff6,-2px -2px 4px #0003}}.option-actions{text-align:center;padding:10px;border-top:2px solid #313131}.close-btn{padding:8px 30px;background:linear-gradient(145deg,#f44336,#d32f2f);color:#fff;border:none;border-radius:8px;cursor:pointer;font-size:16px;transition:all .2s ease;box-shadow:2px 2px 4px #0003,-2px -2px 4px #ffffff1a}.close-btn:hover{background:linear-gradient(145deg,#e53935,#c62828);transform:translateY(-1px)}.rom-input label{color:#fff;margin-right:10px}.menu-buttons{display:flex;flex-direction:row;gap:20px;align-items:center}.menu-buttons button{width:80px;height:30px;border-radius:15px;border:none;background-color:#4a4a4a;color:#fff;cursor:pointer;font-size:14px}.menu-buttons button .save-state-btn,.menu-buttons button .load-state-btn{position:absolute;padding:10px;background-color:#4caf50;color:#fff;border-radius:5px;cursor:pointer;font-size:14px;z-index:100}.menu-buttons button .save-state-btn{bottom:60px;right:10px}.menu-buttons button .load-state-btn{bottom:10px;right:10px}.menu-buttons button:active{background-color:#2a2a2a}@media only screen and ((max-height: 850px) or (max-width: 376px)){.phone{zoom:.95}}@media only screen and ((max-height: 800px) or (max-width: 366px)){.phone{zoom:.93}}@media only screen and ((max-height: 750px) or (max-width: 356px)){.phone{zoom:.91}}@media only screen and ((max-height: 695px) or (max-width: 346px)){.phone{zoom:.82}}@media only screen and ((max-height: 660px) or (max-width: 341px)){.phone{zoom:.78}}@media only screen and ((max-height: 635px) or (max-width: 336px)){.phone{zoom:.74}}@media only screen and ((max-height: 560px) or (max-width: 326px)){.phone{zoom:.68}}@media only screen and ((max-height: 460px) or (max-width: 320px)){.phone{zoom:.6}}body.horizontal .phone{zoom:1}body.horizontal .options-dialog{zoom:.94}@media only screen and ((max-width: 850px) or (max-height: 396px)){body.horizontal .phone{zoom:.98}body.horizontal .options-dialog{zoom:.9}}@media only screen and ((max-width: 810px) or (max-height: 386px)){body.horizontal .phone{zoom:.96}body.horizontal .options-dialog{zoom:.86}}@media only screen and ((max-width: 800px) or (max-height: 376px)){body.horizontal .phone{zoom:.92}body.horizontal .options-dialog{zoom:.82}}@media only screen and ((max-width: 750px) or (max-height: 356px)){body.horizontal .phone{zoom:.87}body.horizontal .options-dialog{zoom:.78}}@media only screen and ((max-width: 695px) or (max-height: 346px)){body.horizontal .phone{zoom:.81}body.horizontal .options-dialog{zoom:.72}}@media only screen and ((max-width: 660px) or (max-height: 341px)){body.horizontal .phone{zoom:.8}body.horizontal .options-dialog{zoom:.68}}@media only screen and ((max-width: 560px) or (max-height: 336px)){body.horizontal .phone{zoom:.7}}@media only screen and ((max-width: 460px) or (max-height: 320px)){body.horizontal .phone{zoom:.58}}.toast-container{position:fixed;top:20px;right:20px;z-index:10}.toast{position:absolute;bottom:0;left:50%;transform:translate(-50%);width:100%;min-width:200px;max-width:300px;text-align:center;padding:7px 24px;margin-bottom:10px;opacity:0;transition:opacity .3s ease;z-index:10;background-color:#000c;color:#fff;border-radius:4px;font-size:14px}.toast.show{opacity:.8}.toast.hide{animation:fadeOut .3s forwards}@keyframes fadeOut{to{opacity:0}}
