/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #09090b;
    color: #FFFFFF;
    line-height: 1.5;
    font-size: 16px;
    display: flex;
    justify-content: center;
    width: 100%;
    height: 100vh;
}

#app{
    border: solid 2px #273248;
    margin: 15px;
    border-radius: 16px;
    background-image: url('../images/diag-ascii.png');
    background-size: 100% 100%;
    display: flex;
    flex-direction: column;
}

.form-label2{
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 选择块样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 66px;
    height: 36px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 28px;
    width: 28px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    transform: translateX(30px);
}

/*  弹窗 信息框样式 */
.popup-content{
    position: relative;
    max-width: 500px;
    padding-top: 20px;
    min-width: 300px;
}

/* 容器样式 */
.container {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* 顶部标题栏 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: solid 1px #27292d;
    padding: 15px 24px;
    margin-bottom: 1.2rem;
    border-radius: 32px;
}
.header img{
    width: 32px;
    height: 32px;
}
.header-logo{
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 标题 */
h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #d0d1d4;
}

h2 {
    font-size: 1.2rem;
    font-weight: 600;
    
    color: #d0d1d4;
}

/* 钱包信息 */
.wallet-info {
    text-align: right;
    position: relative;
}

.connect-wallet, .wallet-address{
    display: inline-block;
    padding: 0.35rem 1.3rem;
    text-decoration: none;

    color: #fafafa;
    background-color: #0b0b0b;
    border-radius: 3.40282e+38px;
    font-size: 13px;
    border: solid 1px #6c93b9;
}

.wallet-address {
    background: #1A2233;
    border: 1px solid #4B5563;
}

.connect-wallet:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(106, 44, 255, 0.4);
}

.btn-con {
    display: inline-block;
    padding: 0.3rem 1rem;
    text-decoration: none;
    
    color: #fafafa;
    background-color: #0b0b0b8c;
    border-radius: 3.40282e+38px;
    font-size: 11px;
    border: solid 1px #6c93b9;
    cursor: pointer;
}
/* 余额信息 */
.balance-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.m-icon{
    width: 18px;
    height: 18px;
}

.balance-info div {
    background: #1A223380;
    border-radius: 12px;
    padding: 1.5rem;
    flex: 1;
    min-width: 200px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #4B5563;
}

.balance-info p {
    font-size: 1.1rem;
    color: #D1D5DB;
}

.balance-info span {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: #FFFFFF;
    margin-top: 0.5rem;

    color: #0000;
    background: linear-gradient(90deg, #a4afc2 -1.49%, #e7effc 19.18%, #bfd4fa 60.52%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* 主内容区域 */
.main-content {
    display: flex;
    gap: 2rem;
    flex: 1;
}

.tab-btns{
    display: flex;
    gap: 3px;
    /*background: radial-gradient(232.36% 214.3% at 124.11% -92.78%, #dae3f21a 0, #0000 100%), #0c0f14;*/
    /*border-bottom: 1px solid #4B5563;*/
    padding-left: 7px;
    color: #a4afc2;
    position: relative;
}
.tab-btns> img{
    position: absolute;
    right: 15px;
    top: 10px;
    cursor: pointer;
}
.tab-btn{
    padding: 10px 20px;
    /*background: radial-gradient(90% 80% at 50% 100%, #dae3f233 0, #667a9b00 100%);*/
    background:#090c1380;
    border-left: 1px solid #4B5563;
    border-top: 1px solid #4B5563;
    border-right: 1px solid #4B5563;
    border-radius: 12px 12px 0 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}
.tab-btn-active,.tab-btn:hover{
    background: #35425f8c;
    box-shadow: 0px 0px 10px #00A3FF;
    color:#e7effc;
}

/* 左边列：挂单列表 */
.left-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    /*gap: 1rem;*/
}

/* 右边列：挂单表单 */
.right-column {
    /*flex: 1;*/
}

/* 表单区域（右边紧凑模式） */
.order-form {
    background: #1A223380;
    border-radius: 12px;
    padding: 1.5rem; /* 紧凑 padding */
    border: 1px solid #4B5563;
}
.order-form-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.svg-icon{
    user-select: none;
    width: 1em;
    height: 1em;
    display: inline-block;
    flex-shrink: 0;
    fill: currentcolor;
    font-size: 1.5rem;
    transition: fill 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.sub-form{
    display: flex;
    gap: 10px;
}

/* 交易方向选择框 */
.direction-group {
    margin-bottom: 1rem;
}

.direction-select {
    display: flex;
    gap: 0.5rem;
}

.direction-btn {
    flex: 1;
    padding: 0.6rem;
    background: #2D3748;
    border: 1px solid #4B5563;
    /*border-radius: 6px;*/
    color: #D1D5DB;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

/* 交易方向选择框 - 激活状态 */
.direction-btn.active {
    background: linear-gradient(90deg, #1E3A8A 0%, #3B82F6 100%);
    border-color: #3B82F6;
    color: #FFFFFF;
}

.direction-btn:hover:not(.active) {
    background: #4B5563;
    color: #FFFFFF;
}

.form-group {
    margin-bottom: 1rem; /* 紧凑间距 */
    flex: 1;
}

.form-group label {
    display: flex;
    align-items: center;
    font-size: 0.85rem; /* 紧凑字体 */
    color: #D1D5DB;
    margin-bottom: 0.3rem;
}
.form-group label svg{
    margin-left: 10px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.6rem; /* 紧凑 padding */
    background: #2D3748;
    border: 1px solid #4B5563;
    border-radius: 6px;
    color: #FFFFFF;
    font-size: 0.95rem; /* 紧凑字体 */
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #00A3FF;
    box-shadow: 0 0 0 2px rgba(0, 163, 255, 0.2);
}
.slip-label{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.slip-label>input{
    flex: 1;
}

.submit-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0.6rem; /* 紧凑 padding */
    font-size: 0.95rem; /* 紧凑字体 */
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    color: #d0d1d4;
    background: linear-gradient(90deg, #181818 0%, #0b0b0b 100%);
    border-radius: 3.40282e+38px;
    border: solid 1px #6c93b9;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(106, 44, 255, 0.4);
}

td input,
td select {
    max-width: 200px;
    padding: 5px 10px; /* 紧凑 padding */
    background: #2D3748;
    border: 1px solid #4B5563;
    border-radius: 6px;
    color: #FFFFFF;
    font-size: 1rem; /* 紧凑字体 */    
}

.fee-info {
    font-size: 0.85rem; /* 紧凑字体 */
    color: #D1D5DB;
    margin-top: 0.5rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.warning-box {
    background: radial-gradient(232.36% 214.3% at 124.11% -92.78%, #dae3f233 0, #667a9b00 100%), #1c202999;
    padding: 15px;
    border: #2a3344 1px solid;
    border-radius: .5rem;
    display: flex;
    align-items: center;
}
.gradient-text {
    color: #0000;
    background: linear-gradient(90deg, #a4afc2 -1.49%, #e7effc 19.18%, #bfd4fa 60.52%);
    -webkit-background-clip: text;
    background-clip: text;
}

.warning-box svg, .submit-btn img{
    margin-right: 15px;
}
/* 代币选择器 */
.token-select {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background: #2D3748;
    border: 1px solid #4B5563;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.token-icon {
    width: 24px;
    height: 24px;
    margin-right: 0.5rem;
    border-radius: 50%;
}

.token-list {
    list-style: none;
    background: #1c2431;
    border: 1px solid #4B5563;
    border-radius: 6px;
    max-height: 400px;
    overflow-y: auto;
    position: absolute;
    z-index: 10;
    width: 100%;
    max-width: 350px;
    box-shadow: 10px 10px 10px #020202;
}

.token-list li {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    cursor: pointer;
}

.token-list li:hover {
    background: #4B5563;
}

/* 交换图标 */
.swap-icon {
    text-align: center;
    margin: 1rem 0;
    cursor: pointer;
    font-size: 1.5rem;
    color: #D1D5DB;
}

.swap-icon:hover {
    color: #FFFFFF;
}

/* 滑点滑块 */
.form-group input[type="range"] {
    width: 100%;
}


/* 表格样式 */
.order-table {
    background: #1A223380;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #4B5563;
    flex: 1;
    overflow: hidden;
    margin-bottom: 1rem;
}

.order-table h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #d0d1d4;
}

.order-table table {
    width: 100%;
    border-collapse: collapse;
}

.order-table .table-container{
    max-height: 65vh;
    overflow-y: auto;
}
/* WebKit 浏览器滚动条 */
.table-container::-webkit-scrollbar {
  width: 1px; /* 滚动条宽度 */
}

.table-container::-webkit-scrollbar-track {
  background: #1A2233; /* 轨道背景 */
}

.table-container::-webkit-scrollbar-thumb {
  background: #4B5563; /* 滑块颜色 */
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: #6B7280; /* 悬停颜色 */
}

/* Firefox 滚动条 */
.table-container {
  scrollbar-width: thin; /* 超薄滚动条 */
  scrollbar-color: #4B5563 #1A2233; /* 滑块和轨道颜色 */
}
.order-table tbody{
    color: #D1D5DB;
}
.order-table th,
.order-table td {
    padding: 0.75rem;
    text-align: left;
    font-size: 0.9rem;
}

.order-table th {
    font-weight: 600;
    color: #d0d1d4;
    
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(to bottom, #dae3f229 0%, #667a9b00 100%), #1c2029e3;
}
.order-table thead{
    /*background: radial-gradient(232.36% 214.3% at 124.11% -92.78%, #dae3f233 0, #667a9b00 100%), #1c202999;*/
}

.order-table td {
    border-bottom: 1px solid #4B5563;
    cursor: pointer;
}

.order-table tr:last-child td {
    border-bottom: none;
}

.order-table tr:hover {
    background: #2D3748;
}

.button_img{
    width: 23px;
}

.btn-ok-bkcolor{
    background: linear-gradient(90deg, #1E3A8A 0%, #3B82F6 100%);
}

/*弹窗*/
.popup-mark{
    width: 100%;
    height: 100%;
    position: fixed;
    top:0px;
    left:0px;
    background-color: #020202e0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}


.mobile-view{
    /*display: none;*/
}

.order-card{
    border: solid 1px #454747;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0px 0px 10px #0b0a0a;
    font-size: 0.8rem;
}
.order-card-item{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0px;
    color: #d0d1d4;
}
.order-card-item img {
    width: 24px;
    height: 24px;
    margin: auto 5px;
}
.order-card-title{
    font-size: 1rem;
    font-weight: bolder;
}
.order-card+.order-card{
    margin-top: 15px;
}
.order-card-empty{
    height: 370px;
    color: #a4afc2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.block-row-center{
    display: flex;
    align-items: center;
}
.block-row{
    display: flex;
}

.info-column{
    min-width: 400px;
    margin-left: 15px;
}

.bk-cancle{
    background-color: #121212;
}
.bk-success{
    background-color: #091e06;    
}
.color-cancle{
    color:#af8955;
}
.color-buy{
    color: #10b981;
}
.color-sell{
    color: #1089b9;
}
.color-warning{
    color: #ff8400;
}
.color-blue{
    color:#88b4f5;
}
.color-gray{
    color: #6B7280;
}

/* 弹出用户菜单 */
.user-menu{
    position: absolute;
    top:30px;
    right: 10px;
    
    background: radial-gradient(232.36% 214.3% at 124.11% -92.78%, #dae3f233 0, #667a9b00 100%), #1c202999;
    border: #2a3344 1px solid;
    border-radius: .5rem;    
}
.menu-item{
    padding: 10px 10px;
    min-width: 150px;
    display: flex;
    align-items: center;
}
.menu-item img{
    width: 24px;
    height: 24px;
    margin-right: 20px;
}


/* 新交互UI */
.pairs-list{
    margin-bottom: 10px;
}
.pairs-list-item{
    background: #0d0d0d6e;
    border-radius: 12px;
    padding: 0.2rem;
    flex: 1;
    min-width: 100px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #4B5563;
    cursor: pointer;
    margin: 0 5px;
}
.pairs-list-item:hover{
    background-color: #2d3748;
}
.pairs-active{
    background-color: #2d3748;
    font-weight: bold;
}


/* 响应式设计：PC 端左右布局（min-width: 768px） */
@media (min-width: 768px) {
    
   
    .main-content {
        flex-direction: row;
    }
    .edit-form{
        margin: 15px;
    }

    .left-column {
        flex: 1;
    }

    .right-column {
        /*flex: 1;*/
    }
    .header img {
        width: 24px;
        height: 24px;
    }
}

/* 响应式设计：手机端垂直布局（max-width: 767px） */
@media (max-width: 767px) {
    body{
        display: block;
    }
    .container {
        padding: 0.6rem;
        width: auto;
    }
    .header img {
        width: 24px;
        height: 24px;
    }
    .edit-form{
        margin: 15px;
    }

    #app{
        margin: 10px;
    }
    .header {
        /*flex-direction: column;*/
        align-items: center;
        padding: 12px 18px;
    }

    .wallet-info {
        text-align: left;
        /*margin-top: 1rem;*/
    }

    .main-content {
        flex-direction: column;
    }

    .balance-info {
        /*flex-direction: column;*/
        flex-wrap: nowrap;
        align-items: stretch;
    }

    .balance-info div {
        /*min-width: 100%;*/
        min-width: 0;
        display: flex;
        align-items: center;
    }
    .balance-info p{
        font-size: 0.9rem;
        margin-right: 15px;
    }
    .balance-info span{
        font-size: 1.2rem;
    }

    .tab-btn{
        font-size: 1.1rem;
    }

    .order-table h3{
        font-size: 1rem;
    }

    .order-form,
    .order-table {
        padding: 0.5rem;
    }

    .order-table th,
    .order-table td {
        font-size: 0.65rem;
        padding: 0.5rem;
    }

    .form-group {
        margin-bottom: 1.5rem; /* 恢复手机端间距 */
        flex: 1;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    .form-group input,
    .form-group select {
        padding: 0.75rem;
        font-size: 1rem;
    }

    .submit-btn {
        padding: 0.75rem;
        font-size: 1rem;
    }
    

    .fee-info {
        font-size: 0.9rem;
    }

    .token-list{
        max-width: 290px;
    }
}

@media (max-width: 480px) {
    .mobile-view{
        display: block;
    }

    .balance-info div{
        padding: 0.5rem 0.8rem;
    }
    .balance-info p{
        font-size: 0.8rem;
    }
 
    .right-column {
        flex: 1;
    }
    body{
        display: block;
    }
    .container {
        padding: 0.6rem;
        width: auto;
    }
    h1 {
        font-size: 1.2rem;
    }
    .header img {
        width: 24px;
        height: 24px;
    }
    .edit-form{
        margin: 15px;
    }    

    h2 {
        font-size: 1rem;
    }

    .form-group{
        margin-bottom: 1.1rem;
    }

    .form-group input,
    .form-group select {
        font-size: 0.9rem;
    }

    .submit-btn {
        font-size: 0.9rem;
    }

    .connect-wallet, .wallet-address {
        padding: 0.3rem 1rem;
        font-size: 0.8rem;
    }
    .right-column{
        order: 1;
    }
    .left-column{
        order: 2;
    }

    .tab-btn{
        font-size: 1rem;
    }

    .order-table h3{
        font-size: 1rem;
    }

    .order-form,
    .order-table {
        padding: 0.5rem;
    }

    .order-table th,
    .order-table td {
        font-size: 0.65rem;
        padding: 0.5rem;
    }

    .popup-content{
        padding-top: 18px;
    }

    .warning-box{
        margin-top: 15px;
        font-size: 0.8rem;
    }
}