/* 表单相关样式 */

#mainForm {
    position: relative;
    background: rgba(44, 55, 66, 0.92);
    color: #e3e8ee;
    border-radius: 22px;
    box-shadow: 0 8px 32px 0 rgba(44, 77, 111, 0.18);
    padding: 30px 30px 32px;
    width: 90%;
    max-width: 900px;
    margin: 32px auto -18px;
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    animation: fadeInUp 0.7s cubic-bezier(.23, 1.01, .32, 1) 1;
    box-sizing: border-box;
    transition: all 0.3s ease-in-out;
}

/* 按钮样式 */
button,
.row button,
.row [id$='Btn'] {
    background: linear-gradient(90deg, #60a5fa 0%, #818cf8 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 32px;
    font-size: 1.08rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px 0 rgba(31, 38, 135, 0.10);
    transition: all 0.3s ease;
    outline: none;
    letter-spacing: 0.02em;
    min-width: 480px;
    max-width: 720px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

/* 输入框样式 */
input,
select,
textarea {
    background: rgba(36, 54, 84, 0.92);
    color: #e0e7ef;
    border: 1.5px solid rgba(255, 255, 255, 0.10);
    border-radius: 7px;
    padding: 10px 14px;
    font-size: 1rem;
    margin-bottom: 14px;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s, background 0.3s, color 0.3s;
}

/* 价格显示器样式 */
#price-ticker {
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: #e0e7ef;
    background: rgba(36, 54, 84, 0.92);
    border-radius: 10px;
    padding: 14px 0 10px 0;
    margin-bottom: 24px;
    margin-top: 18px;
    box-shadow: 0 2px 8px 0 rgba(31, 38, 135, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.3s, color 0.3s;
    animation: pulse 2s infinite;
}

/* 标签样式 */
label {
    color: #a5b4fc;
    font-size: 1rem;
    margin-bottom: 6px;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: color 0.3s;
}

/* 布局组件 */
.row {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

h2 {
    color: #60a5fa;
    font-size: 2rem;
    margin-bottom: 22px;
    letter-spacing: 0.03em;
    font-weight: 700;
    text-align: center;
}

/* 结果显示 */
.result {
    background: linear-gradient(90deg, #60a5fa 0%, #818cf8 100%);
    border-radius: 8px;
    padding: 13px 18px;
    color: #fff;
    margin-top: 18px;
    font-weight: 600;
    font-size: 1.08rem;
    box-shadow: 0 2px 8px 0 rgba(31, 38, 135, 0.10);
    border: none;
    animation: fadeInUp 0.6s cubic-bezier(.23,1.01,.32,1) 1;
}

/* 表单输入控件 */
.row label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 600px;
    font-size: 1rem;
    margin-bottom: 0;
    gap: 8px;
}

.row label input[type="text"] {
    width: 110px;
    min-width: 60px;
    margin: 0 8px;
    font-size: 1rem;
    padding: 6px 10px;
    border-radius: 6px;
}

#user-wallet-info {
    margin-left: 8px;
    font-size: 14px;
    color: #666;
    word-break: break-all;
    flex: 1;
}

/* 交互状态 */
button:hover, .row button:hover, .row [id$='Btn']:hover {
    background: linear-gradient(90deg, #818cf8 0%, #60a5fa 100%);
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 4px 16px 0 rgba(31, 38, 135, 0.18);
}

/* 确保区块链浏览器查询按钮在普通模式下显示为绿色 */
#explorerQueryBtn {
    background: linear-gradient(90deg, #5d7ee2 0%, #2540c9 100%);
    box-shadow: 0 2px 8px 0 rgba(37, 64, 201, 0.2);
}

#explorerQueryBtn:hover {
    background: linear-gradient(90deg, #4951a8 0%, #2a2890 100%);
    box-shadow: 0 4px 16px 0 rgba(37, 64, 201, 0.3);
}

/* 强制区块链浏览器查询按钮显示蓝色 - 使用最高优先级 */
#mainForm .row #explorerQueryBtn {
    background: linear-gradient(90deg, #5d7ee2 0%, #2540c9 100%) !important;
    box-shadow: 0 2px 8px 0 rgba(37, 64, 201, 0.2) !important;
}

#mainForm .row #explorerQueryBtn:hover {
    background: linear-gradient(90deg, #4951a8 0%, #2a2890 100%) !important;
    box-shadow: 0 4px 16px 0 rgba(37, 64, 201, 0.3) !important;
}

input:focus, select:focus, textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96,165,250,0.2);
}

.theme-btn:hover::before {
    background: rgba(36, 41, 59, 0.95);
    transform: scale(1.1);
}

/* 设置按钮样式 */
#mainForm .settings-btn,
.settings-btn {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: rgba(96, 165, 250, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
    cursor: pointer !important;
    font-size: 18px !important;
    line-height: 32px !important;
    text-align: center !important;
    z-index: 1001 !important;
    transition: all 0.3s ease !important;
    padding: 0 !important;
    min-width: unset !important;
    max-width: unset !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important; /* 确保内容不超出按钮边界 */
}

#mainForm .settings-btn:hover,
.settings-btn:hover {
    background: rgba(96, 165, 250, 0.3) !important;
    transform: rotate(30deg) scale(1.05) !important;
}

body.dark-mode #mainForm .settings-btn,
.dark-mode .settings-btn {
    background: rgba(96, 165, 250, 0.15) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode #mainForm .settings-btn:hover,
.dark-mode .settings-btn:hover {
    background: rgba(96, 165, 250, 0.25) !important;
}

/* 设置表单样式 */
.settings-form {
    text-align: left;
    padding: 10px;
}

.settings-form .form-group {
    margin-bottom: 15px;
    width: 100%;
}

.settings-form .form-hint {
    font-size: 0.8rem;
    color: #a5b4fc;
    margin-top: 2px;
    margin-bottom: 5px;
    opacity: 0.8;
}

.dark-mode .settings-form .form-hint {
    color: #8998b7;
}

.settings-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.dark-mode .settings-form label {
    color: #ccc;
}

.settings-form input.swal2-input {
    font-size: 14px;
    padding: 8px 12px;
    margin: 5px 0;
    width: 100%;
}

/* 单选按钮样式 */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    margin-bottom: 0;
}

.radio-label input[type="radio"] {
    width: auto;
    margin: 0 8px 0 0;
    cursor: pointer;
}

/* 防止弹窗时背景图片抖动 */
body {
    padding-right: 0 !important;
    overflow-y: scroll !important; /* 始终显示滚动条，防止弹窗时布局变化 */
}

.swal2-container {
    padding-right: 0 !important; /* 覆盖SweetAlert2默认添加的padding */
}

/* 修复查询功能选择条溢出问题 */
.swal2-select {
    width: 90% !important;
    max-width: 300px !important;
    margin: 0 auto !important;
    font-size: 1rem !important;
}

/* 确保弹窗内容居中且不溢出 */
.swal2-popup {
    width: auto !important;
    max-width: 32em !important;
    padding: 1.5em !important;
}

/* 特别宽的弹窗样式（部署/调用合约等） */
.swal2-popup.swal2-popup-wide {
    max-width: 45em !important; /* 加宽一倍 */
    width: 95% !important;
}

/* 适中宽度的弹窗样式（输入地址/哈希等） */
.swal2-popup.swal2-popup-medium {
    max-width: 40em !important; /* 适当加宽 */
    width: 90% !important;
}

.swal2-html-container {
    margin: 0.5em 1em !important;
    text-align: center !important;
}

/* 特别宽的弹窗中的文本内容 */
.swal2-popup-wide .swal2-html-container {
    padding: 0 1em !important;
}

/* 确保弹窗中的按钮居中 */
.swal2-actions {
    justify-content: center !important;
    margin: 1.25em auto 0 !important;
    width: 100% !important;
}

.swal2-confirm, .swal2-cancel, .swal2-deny {
    margin: 0.3125em !important;
    padding: 0.625em 1.1em !important;
    min-width: 120px !important;
}

/* 确保弹窗中的输入框居中 */
.swal2-input, .swal2-textarea, .swal2-select {
    margin: 1em auto !important;
    max-width: 90% !important;
}

/* 宽弹窗中的输入框宽度 */
.swal2-popup-wide .swal2-input,
.swal2-popup-wide .swal2-textarea {
    max-width: 95% !important;
    width: 95% !important;
}

/* 中等宽度弹窗中的输入框宽度 */
.swal2-popup-medium .swal2-input {
    max-width: 90% !important;
    width: 90% !important;
    font-family: monospace !important; /* 使用等宽字体，便于显示地址和哈希 */
}

/* 设置弹窗中输入标签的居中显示 */
.swal2-input-label {
    display: block !important;
    text-align: center !important;
    margin: 0 auto !important;
    font-weight: 500 !important;
}

/* 设置按钮备用样式 - 当添加到body时使用 */
.settings-btn-fallback {
    position: fixed !important;
    top: 10px !important;
    right: 10px !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: rgba(96, 165, 250, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
    cursor: pointer !important;
    font-size: 18px !important;
    line-height: 32px !important;
    text-align: center !important;
    z-index: 9999 !important;
    transition: all 0.3s ease !important;
    padding: 0 !important;
    min-width: unset !important;
    max-width: unset !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

.settings-btn-fallback:hover {
    background: rgba(96, 165, 250, 0.3) !important;
    transform: rotate(30deg) scale(1.05) !important;
}

body.dark-mode .settings-btn-fallback {
    background: rgba(96, 165, 250, 0.15) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode .settings-btn-fallback:hover {
    background: rgba(96, 165, 250, 0.25) !important;
}
