:root {
    --blue: #0080FF;
    --blue_light: #007bff55;
    --indigo: #4A3CFF;
    --indigo_light: #4A3CFF55;
    --purple: #d63aff;
    --pink: #e83e8c;
    --red: #dc3545;
    --red_light: #dc354555;
    --orange: #fd7e14;
    --yellow: #ffc107;
    --green: #28a745;
    --green_light: #28a74533;
    --teal: #20c997;
    --cyan: #17a2b8;
    --checked-color: #564ad7;
}

html,
body {
    margin: 0;
    /*min-height: 100vh;*/
    width: 100%;
    font-family: "Poppins", Arial, Helvetica, sans-serif;
    background: #232323;
}

h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    font-weight: 600;
    color: #f0f0f0;
    text-align: center;
    width: 100%;
}

.textTag {
    background: #1d1d1e;
    /*display: table;*/
    font-size: 1rem;
    line-height: 1;
    text-align: center;
    color: #fff;
    padding: 5px 10px;
    margin-bottom: 5px;
    letter-spacing: .5px;
}

.settingBg {
    background-image: url('../images/setting-bg.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.grayBg {
    background: linear-gradient(0deg, #333 0%, #36344e 100%);
}

.container {
    width: 100%;
    max-width: 100% !important;
    min-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    margin-top: 64px;
}

.grayBg.container {
    flex-direction: initial;
    align-items: center;
}

.chromeLink a {
    color: #fff;
    display: table;
    margin: 0 auto;
    text-align: center;
}

.chromeLink {
    transition: all 0.3s ease-out 0s;
}

.chromeLink:hover {
    transform: scale(1.05);
}

ol {
    position: relative;
}

li,
.ne {
    font-size: 1.1rem;
    line-height: 1.5;
    padding-bottom: 5px;
    color: #eee;
}

.ne {
    text-align: center;
}

.ne span {
    display: contents;
    color: var(--purple);
}

#connectBtn {
    font-size: 1.3rem;
    padding: 8px 80px;
    font-weight: 600;
    background: linear-gradient(to right, #d63aff 0%, #4A3CFF 100%);
}

#connectBtn img {
    width: 15px;
    height: auto;
}

.connectTipBox {
    flex-wrap: nowrap;
}

.connectTipBox .img {
    width: 20px;
    height: auto;
    margin-right: 8px;
}

.tipBar {
    font-size: .9rem;
    line-height: 1.2;
    /* color: #878787; */
    /* color: #4fc3f7; */
    color: #FFEB3B;
    font-weight: bold;
}


.stepNumber {
    position: relative;
    padding: 0px 10px;
    color: #000;
    z-index: 1;
    margin-right: 5px;
}

.stepNumber:after {
    content: '';
    position: absolute;
    width: 80%;
    padding-top: 80%;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    background: #fff;
    border-radius: 50px;
    z-index: -2;
}

.top-bar {
    position: fixed;
    width: 100%;
    height: 64px;
    top: 0;
    background-color: #232323;
    color: white;
    display: flex;
    align-items: center;
    /*justify-content: center; */
    z-index: 999;
}

.top-bar-inner {
    width: 100%;
    max-width: 1920px;
    display: flex;
    align-items: center;
}

.platform-tabs {
    position: fixed;
    width: 100%;
    height: 55px;
    background-color: #393939;
    color: white;
    display: flex;
    align-items: center;
    /* justify-content: center; */
}

#top-bar-brand {
    width: 127px;
    height: 48px;
    margin-left: 16px;
    margin-top: 2px;
}

/* Hide radios but keep them accessible for existing logic */
.gamepad-type-select.is-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Tabs UI */
.gamepadTypeTabs {
    display: flex;
    align-items: center;
    gap: 0px;
    height: 100%;
    width: 100%;
}

.typeTab {
    appearance: none;
    border: 0;
    background: transparent;
    color: #fff;
    opacity: 0.7;
    cursor: pointer;
    /*padding: 10px 50%;*/
    font-size: 1.1rem;
    line-height: 1;
    position: relative;
    height: 100%;
    width: 8%;
}

.typeTab:hover {
    opacity: 1;
}

.typeTab.is-active {
    opacity: 1;
    font-weight: 600;
}

.typeTab.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0px;
    height: 3px;
    border-radius: 999px;
    /*background: #6c63ff;*/
}

.typeTab:nth-child(1).is-active {
    background: var(--green_light);
}

.typeTab:nth-child(1):hover {
    background: var(--green_light);
}

.typeTab:nth-child(1).is-active::after {
    background: var(--green);
}

.typeTab:nth-child(2).is-active {
    background: var(--blue_light);
}

.typeTab:nth-child(2):hover {
    background: var(--blue_light);
}

.typeTab:nth-child(2).is-active::after {
    background: var(--blue);
}

.typeTab:nth-child(3).is-active {
    background: var(--red_light);
}

.typeTab:nth-child(3):hover {
    background: var(--red_light);
}

.typeTab:nth-child(3).is-active::after {
    background: var(--red);
}

.gamepad-type-select {
    width: 200px;
    display: flex;
    justify-content: space-between;
    color: whitesmoke;
    margin-left: 120px;
    margin-top: auto;
    margin-bottom: 12px;
}

#lang-selector {

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 150px;
    height: 38px;
    border: 2px solid #fff;
    border-radius: 18px;
    background-color: #333;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    padding-left: 12px;
    padding-right: 42px;
    background-image: url("data:image/svg+xml;utf8,\
    <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'>\
      <path d='M1 1l4 4 4-4' stroke='white' stroke-width='1.8' fill='none' stroke-linecap='round'/>\
    </svg>");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 12px 8px;
}

.content {
    width: 100%;
    height: calc(100vh - 119px);
    /*flex: 1;*/
    display: flex;
    overflow: auto;
    justify-content: center;
    flex-wrap: wrap;
    /* background-color: #f0f0f0; */
    align-items: center;
    align-content: center;
    margin-top: 55px;
}

/*
grid-template-columns: 150px 1fr 300px;
表示你要建立 三欄的網格，每欄的寬度如下：
第 1 欄     150px       固定寬度 150 像素（通常用來放側邊選單）
第 2 欄     1fr         剩下空間的 1 份（自動撐滿）
第 3 欄     300px       固定寬度 300 像素（通常用來放設定區或資訊欄）

# fr 是 fractional unit（比例單位），代表「剩餘空間的份數」。
*/
/*.controller-ui {
    display: grid;
    grid-template-columns: 160px 0px 1fr;
    font-family: "Poppins",sans-serif;
    width: 100%;
    height: 100%;
}
*/
.controller-ui {
    display: flex;
    width: 100%;
    /*height: 100%;*/
    min-width: 0;
    height: calc(100vh - 119px);
}


.sidebar-tabs {
    background: rgba(51, 51, 51, 0.5);
    display: flex;
    flex-direction: column;
    padding: 6px;
}

.sidebar-tabs button {
    /* margin-bottom: 2px; */
    margin-left: 12px;
    padding: 10px;
    /* font-weight: bold; */
    background-color: transparent;
    color: #a9a9a9;
    /* ← 這才是完整的邊框語法 */
    border: 1px solid #a9a9a9;
    border-top-left-radius: 12px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
    /* 可選，讓邊角圓滑 */
    /* border-radius: 6px; */
}

.sidebar-tabs button:hover {
    cursor: pointer;
}

.sidebar-tabs button.selected {
    background: linear-gradient(to right, #90268D 0%, #4A3CFF 100%);
    color: white;
    font-size: 14pt;
    font-weight: bold;
    margin-left: 0px;
    border: 0px;
    border-top-left-radius: 12px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
}

.sidebar-tabs button[disabled] {
    pointer-events: none;
    background: gray;
}

.sidebar-tabs-1 {
    /* flex: 0 0 16%; */
    /* max-width: 16%; */
    flex: 0 0 auto;
    max-width: 100%;
    min-width: 0;

    background: rgba(50, 50, 50, 0.85);
    display: flex;
    flex-direction: column;
    padding-top: 20px;
}

.sidebar-tabs-1 button {
    padding: 15px 20px;
    color: #bbb;
    background: transparent;
    border-color: transparent;
    text-align: left;
}

.sidebar-tabs-1 button:hover {
    cursor: pointer;
    background: linear-gradient(90deg, rgba(150, 0, 255, 0.2), rgba(0, 180, 255, 0.2));
    color: #fff;
}

.sidebar-tabs-1 button.selected {
    background: linear-gradient(90deg, rgba(150, 0, 255, 0.15), rgba(0, 180, 255, 0.15));
    border-left: 3px solid #d63aff;
    color: #fff;
    /* font-size: 14pt; */
    font-weight: bold;
}

.sidebar-tabs-1 button[disabled] {
    pointer-events: none;
    background: gray;
    opacity: 0.5;
}

.split-bar {
    /* 分隔線寬度 */
    width: 0px;
    /* height: 100%; */
    background: linear-gradient(to bottom,
            #0069B5 0%,
            #0C9F87 17%,
            #96A11E 36%,
            #EB5616 59%,
            #E50B63 80%,
            #511B85 100%);
    /* 可調整左右間距 */
    /* margin: 0 12px; */
}

.main-panel {
    display: flex;
    flex: 0 0 84%;
    max-width: 84%;
    min-width: 0;
    min-height: calc(100vh - 119px);
    /*height: 100%;*/
    transition: background 0.3s ease;
    overflow: hidden;
    flex-wrap: wrap;
    overflow-y: auto;
    /* 垂直捲軸 */
}

.controller-container-wrap {
    width: 90%;
    height: 90%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    /* background-color: #00bfff;  */
}

#panel-macro .controller-container-out {
    width: 30%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
}

#panel-macro .setting-container {
    width: 70%;
}

#panel-macro .controller-container-wrap {
    width: 90%;
    /* align-content: start; */
}

/* @media screen and (max-width: 1366px) { */
@media screen and (max-width: 1700px) {
    #panel-macro .setting-container {
        width: 60%;
    }

    /* #panel-macro .controller-container-wrap {
        width: 35%;
    } */

    #panel-macro .controller-container-out {
        width: 40%;
    }
}

#panel-macro input {
    width: 100%;
    background: #333333;
    border: 1px solid #777;
    color: #eee;
    padding: 0 4px;
}

.controller-container-box {
    flex-wrap: nowrap;
}

.triggerKey {
    white-space: nowrap;
}

#macro-trigger-key-selects {
    width: 100%;
}

#panel-remap xb-buttons-list {
    background: linear-gradient(0deg, #333333bd 0%, #36344eb8 100%);
    border-radius: 10px;
}

#panel-remap ps-buttons-list {
    background: linear-gradient(0deg, #333333bd 0%, #36344eb8 100%);
    border-radius: 10px;
}

#panel-remap ns-buttons-list {
    background: linear-gradient(0deg, #333333bd 0%, #36344eb8 100%);
    border-radius: 10px;
}

#panel-macro xb-buttons-list {
    background: #333;
    border-radius: 10px;
}

#panel-macro ps-buttons-list {
    background: #333;
    border-radius: 10px;
}

#panel-macro ns-buttons-list {
    background: #333;
    border-radius: 10px;
}

#panel-test xb-buttons-list {
    background: linear-gradient(0deg, #333333bd 0%, #36344eb8 100%);
    border-radius: 10px;
    border: 1px solid #4d4d4d;
}

#panel-test ps-buttons-list {
    background: linear-gradient(0deg, #333333bd 0%, #36344eb8 100%);
    border-radius: 10px;
    border: 1px solid #4d4d4d;
}

#panel-test ns-buttons-list {
    background: linear-gradient(0deg, #333333bd 0%, #36344eb8 100%);
    border-radius: 10px;
    border: 1px solid #4d4d4d;
}

xb-controller,
ps-controller,
ns-controller {
    width: 75%;
}

#remap-buttons-list-container {
    width: 80%;
}

#macro-buttons-list-container {
    width: 100%;
}

#button-macro-add img {
    width: 14px;
    height: 14px;
}

#test-buttons-list-container {
    width: 100%;
}

.gamepad-area xb-controller,
.gamepad-area ps-controller,
.gamepad-area ns-controller {
    width: 100%;
}

.panel-content {
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 1;
}

.panel-content-box {
    justify-content: center;
}

.panel-content-box-inner {
    position: relative;
    display: flex;
    width: 80%;
    flex-wrap: wrap;
    justify-content: center;
    padding: 40px 0;
}

@media screen and (max-width: 1366px) {
    .panel-content-box-inner {
        width: 100%;
    }
}

#panel-test .panel-content-box-inner {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
}

.panel-content-grid {
    height: 100%;
    /*flex: 1;*/
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
}

.panel-content-flex {
    height: 100%;
    /*flex: 1;*/
    min-height: 0;
    display: flex;
    /*grid-template-columns: 1fr 1fr;*/
    overflow: hidden;
    /*overflow-y: scroll;*/
}

.controller-container {
    width: 70%;
    max-width: 1100px;
    /* height: 100%; */
    display: flex;
    align-items: center;
    justify-content: center;
    /* background-color: #333; */
}

#panel-turbo .controller-container {
    width: 100%;
}

#panel-remap .controller-container {
    width: 100%;
}

#panel-remap #remap-buttons-list-container {
    width: 80%;
}

.controller-container.disabled {
    /* 禁止點擊 */
    pointer-events: none;
    /* 淡化外觀 */
    opacity: 0.5;
}

.setting-container {
    width: 50%;
    border: #434855 solid 2px;
    border-radius: 12px;
    margin: 3px;
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    padding: 6px;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    /* 水平置中 */
    /* justify-content: center; */
    /* 垂直置中 */
    /* align-items: center; */
}



.bottom-bar {
    position: absolute;
    display: flex;
    width: 100%;
    height: 100%;
    /*background-color: #333;*/
    align-items: center;
    justify-content: center;
    pointer-events: none;
    top: 0;
}

#bottom-bar-content {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 72px;
    border-radius: 10px;
    background-color: #0d1a2680;
    display: flex;
    align-items: center;
    justify-content: center;
}

#bottom-bar-content button[disabled] {
    pointer-events: none;
}

#topbar-button-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

#topbar-button-content button[disabled] {
    pointer-events: none;
    background-color: gray;
}

.button-base {
    position: relative;
    height: 36px;
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;

    padding: 6px;
    /*border-radius: 4px;*/
    border: 0;

    /* 對應 TemplateBinding Background */
    /* background-color: var(--btn-bg, #333);  */

    color: white;
    font-family: "Poppins", sans-serif;

    cursor: pointer;

    /* box-sizing: border-box; */
}

.button-base.button-clear {
    width: fit-content;
    /* border: none; */
    background-color: rgba(0, 0, 0, 0.3);
    padding: 5px 30px;
    gap: 4px;
    margin-bottom: 5px;
    border: 1px solid #ffffff;
}

.button-base:hover {
    border: 1.8px solid #ffffff;
    background-color: rgba(80, 80, 80, 1);
}

.button-base .btn-icon {
    width: 18px;
    height: 18px;
    font-size: 16px;
    /* background-color: red; */
}

.button-base .btn-label {
    font-size: 16px;
    /* background-color: red; */
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.button-base-1 {
    /*height: 32px;*/
    /*font-size: 1.1rem;*/
    position: relative;
    display: flex;
    /*gap: 16px;*/
    align-items: center;
    justify-content: center;

    padding: 5px 15px;
    /* border-radius: 4px; */
    /* border: 1.8px solid #ffffff; */
    border: 0;
    color: white;
    /* font-family: sans-serif; */
    background: var(--indigo);
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.button-base-1:hover:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid #ffffff;
    top: 0;
    left: 0;
    z-index: 1;
    /*transform: scale(1.05);*/
}

.btn-icon {
    width: 20px;
    height: 20px;
    font-size: 16px;
    margin-right: 5px;
}

.button-base-1 .btn-icon {
    width: 20px;
    height: 20px;
    font-size: 16px;
    /* background-color: red; */
    margin-right: 5px;
}

.openfileBtn {
    position: relative;
    cursor: pointer;
    display: flex;
    margin-right: 5px;
}

.openfileLabel {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.openfileLabel .btn-icon {
    width: 22px;
    height: auto;
}

.openfileBtn:hover .tipBox {
    /*opacity: 1;*/
    display: block;
}

.tipBox {
    position: absolute;
    width: 250px;
    height: auto;
    left: 50%;
    transform: translateX(-50%);
    top: 43px;
    padding: 20px;
    background: #111;
    /*opacity: 0;*/
    /*pointer-events: none;*/
    z-index: 999;
    display: none;
}

.tipBox p {
    font-size: 1rem;
    line-height: 1.3;
}

.tipBox span {
    font-size: .8rem;
    line-height: 1.2;
    color: #ddd;
}

.button-reset-container:hover .tipBox {
    display: block;
    /* 往上 */
    top: -80px;
    /* 在按鈕右邊 */
    left: 80%;
    /* 與按鈕保持距離 */
    margin-left: 10px;
    
}

.InfoDetailBtn {
    position: relative;
    background: var(--blue);
    cursor: pointer;
    padding: 5px 20px;
    display: table;
    margin: 0 auto;
    margin-top: 10px;
}

.InfoDetailBtn:hover:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid #ffffff;
    top: 0;
    left: 0;
    z-index: 1;
}

.progress-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    inset: 0;
    background: rgba(0, 0, 0, 0.66);
    z-index: 999;
    backdrop-filter: blur(3px);
    /*display: block;*/
}

.progress-container-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    width: 300px;
    height: 20px;
    margin: 12px;
}

.progress-container-inner p {
    font-size: 1rem;
    line-height: 1;
    color: #fff;
    text-align: center;
    padding-bottom: 10px;
    display: none;
}

.progress-container:not([hidden]) {
    display: flex;
}

progress {
    width: 100%;
    height: 100%;
    -webkit-appearance: none;
    appearance: none;
    background-color: #eee;
    border: none;
    border-radius: 10px;
}

progress::-webkit-progress-bar {
    background-color: #eee;
    border-radius: 10px;
}

progress::-webkit-progress-value {
    background: linear-gradient(90deg, var(--purple) 0%, var(--indigo) 100%);
    border-radius: 10px;
}

.turbo-slider {
    width: 80%;
    max-width: 1000px;
    /*margin: 36px 0 0 0;*/
    display: flex;
    align-items: center;
    padding: 6px;
    background: linear-gradient(0deg, #333333bd 0%, #36344eb8 100%);
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 10px;
}

.turbo-slider.disabled {
    /* 禁止點擊 */
    pointer-events: none;
    background: linear-gradient(0deg, #333333bd 0%, #36344eb8 100%);
    border: rgba(128, 128, 128, 0.5);
}

.slider-container {
    width: 85%;
    /* background-color: #333; */
    /* border: 2px solid #434855; */
    padding: 12px 10px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ticks {
    position: relative;
    width: 87%;
    height: 1.2vw;
    display: flex;
    /* 平均分布每個刻度 */
    justify-content: space-between;
    font-size: 16px;
    color: #ccc;
    /*background: red;*/
}

.deco {
    position: absolute;
}

.TC {
    text-align: center;
}

.ticks .num {
    width: 1px;
    height: 100%;
    /*background: white;*/
    bottom: 0;
}

@media screen and (max-width: 767px) {
    .ticks .num {
        background: #C2CCE0;
    }
}

.ticks p {
    font-size: .8vw;
}

.ticks .numText {
    position: relative;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    width: 4vw;
    height: auto;
}

@media screen and (max-width: 1200px) {
    .ticks .numText {
        width: 4.8vw;
        height: auto;
    }
}

@media screen and (max-width: 1024px) {
    .ticks .numText {
        width: 3.2rem;
        height: auto;
    }
}

.ticks .num0 {
    left: 0%;
}

.ticks .num16 {
    left: 16.67%;
}

.ticks .num25 {
    left: 25%;
}

.ticks .num33 {
    left: 33.33%;
}

.ticks .num50 {
    left: 50%;
}

.ticks .num66 {
    left: 66.67%;
}

.ticks .num75 {
    left: 75%;
}

.ticks .num83 {
    left: 83.33%;
}

.ticks .num100 {
    left: 100%;
}

input[type="range"] {
    width: 100%;
    accent-color: #00bfff;
    /* 可自訂滑桿顏色 */
}

/* input[type="checkbox"]:disabled+label {
    color: #aaa;
    cursor: not-allowed;
}

input[type="checkbox"]:not(:disabled)+label {
    color: #fff;
    cursor: pointer;
} */



.table-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
    min-height: 0;
}

.table-header {
    table-layout: fixed;
    /*width: 100%; */
    width: calc(100% - 15px);
    /* ✅ 預留 scrollbar 寬度 */
    border-collapse: separate;
}


.table-header th {
    background-color: #2E3A59;
    color: #f9f9f9;
    padding: 8px;
    text-align: left;
    border-bottom: 2px solid #ccc;
}

.table-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-gutter: stable;
    max-height: calc(100vh - 225px);
}

.table-body td {
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.table-body-inner {
    table-layout: fixed;
    width: 100%;
    border-collapse: separate;
}

.table-body-inner button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 0;
    padding: 3px;
}

.table-body-inner button:hover {
    transform: scale(0.9);
}

tr:hover {
    /*background-color: rgba(243, 243, 243, 0.5);*/
    cursor: pointer;
}

/*#f5f5f5;*/

tr.selected {
    background-color: #564ad791;
    /* outline: 1px solid #4CAF50; */
}

.drag-handle {
    /* cursor: grab; */
    cursor: ns-resize;
}

.drag-handle:active {
    /* cursor: grabbing; */
    cursor: ns-resize;
}

/* .table-scroll-wrapper {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
} */

/* #turbo-table,
#remap-table,
#macro-table {
    width: 100%;
    border-collapse: separate;
    font-family: sans-serif;
    table-layout: fixed;
}

#turbo-table th,
#remap-table th,
#macro-table th {
    background-color: #2E3A59;
    color: #f9f9f9;
    padding: 8px;
    text-align: left;
    border-bottom: 2px solid #ccc;
}

#turbo-table td,
#remap-table td,
#macro-table td {
    padding: 8px;
    border-bottom: 1px solid #eee;
}

#turbo-table button,
#remap-table button,
#macro-table button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
} */




.dropdown {
    position: relative;
    /* width: 200px;  */
    border: 1.8px solid white;
    border-radius: 8px;
    margin: 6px 0;
}

.dropdown-btn {
    padding: 2px;
    background: #333;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-list {
    position: absolute;
    background: #444;
    width: 100%;
    z-index: 10;
}

.dropdown-item {
    padding: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: white;
}

.dropdown-item:hover {
    background: #666;
}

.dropdown-icon {
    width: 32px;
    height: 32px;
}

.dropdown-arrow {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.dropdown-btn.open .dropdown-arrow {
    transform: rotate(180deg);
}



.circlState {
    margin: 12px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.6);
    width: 36px;
    height: 36px;
    background-color: rgba(128, 128, 128, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
}

.circlState:hover {
    cursor: pointer;
    border: 2px solid white;
}

.circlState.enabled {
    background-color: green;
    border: none
}



.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toogle-slider {
    position: absolute;
    cursor: pointer;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.toogle-slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toogle-slider {
    background-color: #00bfff;
}

.toggle-switch input:checked+.toogle-slider::before {
    transform: translateX(24px);
}



/* .advance-main-content { */
.panel-content>div {
    width: 95%;
    height: 95%;
    background: linear-gradient(0deg, #333333bd 0%, #36344eb8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-radius: 12px;
    /* margin: 24px; */
    overflow-y: auto;
    gap: 1px;
}

@media screen and (max-width: 1366px) {
    .panel-content>div {
        width: 95%;
        height: 95%;
        background-color: #2e3a59d9;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        border-radius: 12px;
        /* margin: 24px; */
        overflow-y: auto;
        gap: 1px;
    }
}

.advance-content-grid {
    width: 80%;
    display: grid;
    grid-template-columns: 0.5fr auto 1fr;
    padding-top: 16px;
    padding-bottom: 16px;
    gap: 30px;
}

.advance-content-grid label {
    cursor: pointer;
}

.informationBox {
    position: relative;
    width: 48px;
    height: auto;
    /*margin-right: 10px;*/
    padding: 14px;
}

.informationBox:hover .tipBox {
    /*opacity: 1;*/
    display: block;
    top: 50%;
    color: #fff;
    transform: translateY(-50%);
    left: 40px;
    width: 400px;
}

.informationBox.macro {
    position: relative;
    height: 36px;
    width: 36px;
    margin-right: 8px;
    padding: 6px;
}

.informationBox.macro:hover .tipBox {
    /*opacity: 1;*/
    display: block;
    top: 100%;
    background: rgb(117, 134, 198);
    color: #fff;
    transform: translateY(5%);
    left: 20px;
    width: 400px;
}



.advance-content-grid .title {
    color: white;
    font-size: 12pt;
    font-weight: bold;
    display: flex;
    align-items: center;
    text-align: right;
    /*margin: 6px;*/
    /*margin-left: auto;*/
    width: calc(100% - 34px);
    justify-content: end;
}

.advance-content-grid .title.titleNoInfo {
    padding-right: 16px;

}

.advance-content-grid .toggle {
    display: flex;
    align-items: center;
    width: 48px;
}

.advance-spliter {
    width: 90%;
    height: 1px;
    background-color: #4d4d4d;
}

@media screen and (max-width: 1366px) {
    .advance-content-grid {
        width: 90%;
    }

    .advance-content-grid .title {
        font-size: 11pt;
    }
}

.vibration-slider-wrapper {
    width: 75%;
    display: flex;
    flex-direction: column;
    /* display: grid;
    grid-template-rows: 1fr 1fr;
    width: 65%;
    padding: 8px; */
}

.vibration-slider-wrapper .ticks {
    width: 97%;
    margin-left: 2%;
}

.vibration-slider-wrapper.disabled {
    pointer-events: none;
    opacity: 0.5;
}

.vibration-slider-wrapper .slider-wrapper-input {
    display: flex;
    justify-items: center;
}

.vibration-slider-wrapper input[type="range"] {
    width: 100%;
    accent-color: #00bfff;
}

.vibration-slider-wrapper .slider-wrapper-ticks {
    position: relative;
    height: 32px;
    color: white;
}

/* .vibration-slider-wrapper .ticks {
    position: absolute;
    top: 0;
    left: 0px;
    width: 100%;
} */

.vibration-slider-wrapper .ticks span {
    position: absolute;
    /* transform: translateX(-50%); */
    font-size: 10pt;
    color: #ccc;
}


.thumber-slider-wrapper {
    display: grid;
    /*grid-template-rows: 1fr 1fr 1fr 1fr;*/
    padding: 8px 0;
}

.thumber-slider-wrapper.disabled {
    pointer-events: none;
    opacity: 0.5;
}

.thumber-slider-wrapper .sub-title {
    font-size: 0.8vw;
    color: #ccc;
    padding-top: 10px;
}

.thumber-slider-wrapper .slider-value {
    display: grid;
    grid-template-columns: 3fr 1fr;
    padding: 5px 0 0 0;
}

.thumber-slider-wrapper input[type="range"] {
    /* width: 100%; */
    accent-color: #00bfff;
}

#right-scale-value,
#left-scale-value,
#left-deadzone-value,
#right-deadzone-value,
#left-Trigger-value,
#right-Trigger-value {
    width: 60%;
    background: #333;
    border: 1px solid #434855;
    color: #eee;
    padding: 0 4px;
}

#left-Trigger-value,
#right-Trigger-value {
    pointer-events: none;
    background: none;
    border: 0;
}

/* #panel-test>div {
    display: grid;
    grid-template-columns: 1fr 2fr;
} */

.panel-test-container {
    width: 60%;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2% 0 0 0;
    /* display: grid;
    grid-template-columns: 1fr 1fr; */
    /* background-color: #272A30; */
}

@media screen and (max-width: 1280px) {
    .panel-test-container {
        width: 80%;
    }
}

.panel-test-container .button-list .key-button {
    width: 50%;
}

.panel-test-btn {
    width: 77%;
    display: flex;
    justify-content: end;
    position: fixed;
    top: calc(119px + 4%);
    right: 3.5%;
    z-index: 500;
}

#button-test:hover .tipBox {
    opacity: 1;
    display: block;
    text-align: left;
}

.button-list {
    width: 20%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* background-color: navajowhite; */
}

.gamepad-area {
    width: 80%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* background-color: rgba(51, 51, 51, 0.5); */
}

.gamepad-area .stick-area {
    display: flex;
    flex-direction: row;
    /* grid-template-columns: 1fr 1fr; */
    /* background-color: #4caf50; */
    justify-content: center;
    gap: 110px;
}

/* ===== UI Confirm Modal ===== */
.uiModal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.uiModal.is-open {
    display: block;
}

.uiModal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
}

.uiModal__dialog {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, calc(100% - 32px));
    background: #fff;
    /*border-radius: 6px;*/
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    padding: 26px 28px 22px;
    text-align: center;
    min-height: min(230px);
    display: flex;
    flex-wrap: wrap;
    align-content: center;
}

.uiModal__title {
    width: 100%;
    font-size: 18px;
    font-weight: 700;
    color: #222;
    margin-bottom: 20px;
}

.uiModal__content {
    width: 100%;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    margin: 0 auto 18px;
    max-width: 420px;
    word-break: break-word;
}

.uiModal__actions {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 30px;
}

.uiBtn {
    min-width: 140px;
    height: 42px;
    /*border-radius: 3px;*/
    border: 0;
    cursor: pointer;
    font-size: 14px;
    letter-spacing: 0.5px;
    transition: all 0.3s ease-out 0s;
}

.uiBtn:hover {
    opacity: .8;
}

.uiBtn--cancel {
    background: #7b7f86;
    /* 灰色 */
    color: #fff;
}

.uiBtn--ok {
    background: linear-gradient(to right, #90268D 0%, #4A3CFF 100%);
    color: #fff;
}

.uiBtn:active {
    transform: translateY(1px);
}


/* ===== Modal ===== */
.infoModal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.infoModal.is-open {
    display: block;
}

.infoModal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
}

.infoModal__dialog {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(920px, calc(100vw - 32px));
    height: min(70vh, 720px);
    background: rgba(16, 16, 20, 0.95);
    color: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.infoModal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.infoModal__title {
    font-weight: 800;
}

.infoModal__close {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.85;
}

.infoModal__close:hover {
    opacity: 1;
}

.infoModal__content {
    padding: 16px;
    overflow: auto;
    font-size: 14px;
    line-height: 1.7;
}

/* ===== Tooltip ===== */
.infoTooltip {
    position: fixed;
    z-index: 9998;
    width: 320px;
    max-width: calc(100vw - 24px);
    max-height: 260px;
    padding: 12px 12px 10px;
    background: #000;
    color: #fff;
    display: none;
    overflow: hidden;
}

.infoTooltip.is-open {
    display: block;
}

.infoTooltip__title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
}

.infoTooltip__body {
    font-size: 13px;
    line-height: 1.55;
    opacity: 0.92;
    max-height: 180px;
    overflow: auto;
    /* 長內容可捲 */
    padding-right: 6px;
}

.infoTooltip__more {
    display: inline-block;
    margin-top: 8px;
    color: #35a7ff;
    /* 藍色連結 */
    font-size: 13px;
    text-decoration: none;
}

.infoTooltip__more:hover {
    text-decoration: underline;
}


/* ===== Modal ===== */
.infoModal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.infoModal.is-open {
    display: block;
}

.infoModal__backdrop {
    position: absolute;
    inset: 0;
    background: none;
}

.infoModal__dialog {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(920px, calc(100vw - 32px));
    height: min(70vh, 720px);
    background: #000;
    color: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.infoModal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.infoModal__title {
    font-weight: 800;
}

.infoModal__close {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    opacity: 0.85;
}

.infoModal__close:hover {
    opacity: 1;
}

.infoModal__content {
    padding: 2% 5% 5% 5%;
    overflow: auto;
    font-size: 1rem;
    line-height: 1.7;
}

.infoModalTitle {
    text-align: center;
    font-size: 1.2rem;
    line-height: 1.7;
    font-weight: 900;
    color: var(--purple);
}