* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    font-size: 32px;
    margin-bottom: 30px;
    color: #222;
}

h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

.section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* 链选择器 */
.chain-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.chain-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f8f8f8;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.chain-btn:hover {
    background: #e8f5e9;
    border-color: #4caf50;
}

.chain-btn.active {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
    font-weight: 600;
}

.chain-icon {
    font-size: 24px;
}

.network-info {
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
}

/* 按钮样式 */
.btn-primary {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 10px 24px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 500;
}

.btn-primary:hover {
    background-color: #45a049;
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background-color: #45a049;
}

.btn-large {
    width: 100%;
    padding: 14px;
    font-size: 18px;
    margin-top: 10px;
}

/* 表单样式 */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-field {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.input-field:focus {
    outline: none;
    border-color: #4caf50;
}

.input-field:readonly {
    background-color: #f5f5f5;
    color: #666;
}

.amount-group {
    display: flex;
    gap: 10px;
}

.amount-group .input-field {
    flex: 1;
}

/* 信息框 */
.info-box {
    background: #f9f9f9;
    border-radius: 6px;
    padding: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e8e8e8;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item .label {
    font-weight: 500;
    color: #666;
}

.info-item .value {
    color: #333;
    font-weight: 600;
}

.contract-address {
    font-size: 12px;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.info-text {
    margin-top: 12px;
    padding: 10px;
    background: #e8f5e9;
    border-radius: 4px;
    font-size: 14px;
    color: #2e7d32;
}

/* 状态信息 */
.status-info {
    margin-top: 12px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.status-info.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.status-info.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
}

.status-info.warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ff9800;
}

/* 交易记录 */
.transaction-list {
    max-height: 400px;
    overflow-y: auto;
}

.transaction-item {
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
    background: #fafafa;
    font-size: 13px;
}

.transaction-item .tx-hash {
    font-family: 'Courier New', monospace;
    color: #4caf50;
    word-break: break-all;
    margin-top: 5px;
}

.transaction-item .tx-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 30px;
}

/* 帮助文本 */
.help-text {
    margin-top: 12px;
    padding: 12px;
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    border-radius: 4px;
    font-size: 14px;
    color: #e65100;
}

/* 高亮值 */
.value.highlight {
    color: #4caf50;
    font-weight: 700;
    font-size: 16px;
}

/* 折叠区域 */
.section.collapsed .collapsible-content {
    display: none;
}

.collapsible {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapsible:hover {
    color: #4caf50;
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.3s;
}

.section:not(.collapsed) .toggle-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    margin-top: 15px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4caf50;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: white;
    margin-top: 20px;
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 24px;
    }

    .section {
        padding: 15px;
    }

    .chain-selector {
        flex-direction: column;
    }

    .chain-btn {
        width: 100%;
    }
}
