/* ============================================
   iOS 设备适配样式
   ============================================ */

/* 基础重置和 iOS 特定修复 */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

input, textarea, select {
    -webkit-user-select: text;
    user-select: text;
    -webkit-appearance: none;
    border-radius: 0;
}

/* 防止 iOS Safari 的弹性滚动问题 */
html {
    width: 100%;
    height: 100%;
    overflow: hidden; /* 防止html滚动，滚动应该在main-content内部 */
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 0;
}

body {
    width: 100%;
    height: 100vh;
    overflow: hidden; /* 防止body滚动，滚动应该在main-content内部 */
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #ffffff;
    color: #333;
    /* iOS 安全区域适配 */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    position: relative;
}

.container {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    position: relative;
    /* 确保内容在安全区域内 */
    padding-bottom: env(safe-area-inset-bottom);
}

/* iOS Safari 地址栏适配 */
@supports (-webkit-touch-callout: none) {
    .container {
        min-height: -webkit-fill-available;
    }
}

/* 防止 iOS 双击缩放 */
button, a, input, select, textarea {
    touch-action: manipulation;
}

/* iOS 输入框样式修复 */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
textarea,
select {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 8px;
    font-size: 16px; /* 防止 iOS 自动缩放 */
    padding: 12px;
    border: 1px solid #ddd;
    background-color: #fff;
    width: 100%;
    box-sizing: border-box;
}

/* iOS 选择框样式 */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* 按钮样式优化 */
button, .btn {
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-height: 44px; /* iOS 推荐的最小触摸目标 */
    min-width: 44px;
}

button:active, .btn:active {
    transform: scale(0.98);
    opacity: 0.8;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    padding-top: calc(15px + env(safe-area-inset-top));
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 12px;
    opacity: 0.9;
}

.status-connected {
    color: #4ade80;
}

.status-disconnected {
    color: #f87171;
}

/* 导航标签 */
.nav-tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: calc(60px + env(safe-area-inset-top));
    z-index: 99;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 1;
    min-width: 80px;
    padding: 12px 16px;
    background: transparent;
    color: #6b7280;
    font-size: 14px;
    border: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    position: relative;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

/* 标签页内容 */
.tab-content {
    display: none;
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card h2 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    min-height: 44px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:active {
    opacity: 0.9;
    transform: scale(0.98);
}

.btn-outline {
    background: white;
    color: #667eea;
    border: 1px solid #667eea;
}

.btn-info {
    background: #3b82f6;
    color: white;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: calc(60px + env(safe-area-inset-top) + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #1f2937;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
    text-align: center;
    font-size: 14px;
}

.notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.notification.success {
    background: #10b981;
}

.notification.error {
    background: #ef4444;
}

.notification.info {
    background: #3b82f6;
}

/* 统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

/* 链列表 */
.chain-list {
    display: grid;
    gap: 15px;
}

.chain-item {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 15px;
}

.chain-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.chain-info {
    flex: 1;
}

.chain-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 5px;
}

.chain-description {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
}

.chain-badges {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}

.badge-evm {
    background: #dbeafe;
    color: #1e40af;
}

.badge-testnet {
    background: #fef3c7;
    color: #92400e;
}

.badge-contract {
    background: #d1fae5;
    color: #065f46;
}

/* 钱包列表 */
.wallet-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* iOS 特定修复 */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari 滚动优化 */
    .container {
        -webkit-overflow-scrolling: touch;
    }
    
    /* iOS 输入框字体大小修复 */
    input, select, textarea {
        font-size: 16px !important;
    }
    
    /* iOS 按钮点击反馈 */
    button:active, .btn:active {
        background-color: rgba(0, 0, 0, 0.05);
    }
}

/* iOS 设备类名样式 */
.ios-device .container {
    /* iOS 特定的滚动优化 */
    -webkit-overflow-scrolling: touch;
}

.ios-standalone .header {
    /* 独立 Web App 模式下的额外顶部间距 */
    padding-top: calc(20px + env(safe-area-inset-top));
}

/* 横屏适配 */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .header {
        padding: 10px 20px;
        padding-top: calc(10px + env(safe-area-inset-top));
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .tab-content {
        padding: 15px;
    }
}

/* 大屏幕设备 */
@media (min-width: 768px) {
    .container {
        max-width: 768px;
        margin: 0 auto;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   新增样式
   ============================================ */

/* 卡片头部 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* 搜索框 */
.search-box {
    margin-bottom: 20px;
}

/* 钱包统计 */
.wallet-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

/* 输入框带按钮 */
.input-with-button {
    display: flex;
    gap: 10px;
}

.input-with-button .form-control {
    flex: 1;
}

/* 钱包项增强样式 */
.wallet-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wallet-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-left-color: #5a6fd8;
}

.wallet-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.wallet-info {
    flex: 1;
}

.wallet-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
    margin-bottom: 5px;
}

.wallet-chain {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-block;
}

.wallet-address {
    font-family: monospace;
    color: #7f8c8d;
    font-size: 14px;
    word-break: break-all;
    margin-bottom: 8px;
}

.wallet-derivation {
    font-size: 12px;
    color: #95a5a6;
    margin-bottom: 10px;
}

.wallet-balance {
    background: #e8f5e8;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 10px;
}

.balance-amount {
    font-weight: 600;
    color: #27ae60;
    font-size: 16px;
}

.balance-symbol {
    color: #7f8c8d;
    font-size: 14px;
}

.wallet-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
    font-style: italic;
}

.loading-state:before {
    content: "⏳";
    display: block;
    font-size: 24px;
    margin-bottom: 10px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e8e8e8;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close {
    color: #95a5a6;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #2c3e50;
}

.modal-body {
    padding: 20px 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.wallet-select-list {
    display: grid;
    gap: 12px;
}

.wallet-select-item {
    padding: 15px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wallet-select-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.wallet-select-item.selected {
    border-color: #667eea;
    background: #f0f4ff;
}

/* 余额项样式 */
.balance-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #27ae60;
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.balance-symbol {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}

.balance-amount {
    font-weight: 700;
    color: #27ae60;
    font-size: 18px;
}

.balance-details {
    display: flex;
    justify-content: space-between;
    color: #7f8c8d;
    font-size: 14px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    color: #7f8c8d;
    padding: 40px 20px;
    font-style: italic;
}

.empty-state:before {
    content: "📭";
    display: block;
    font-size: 32px;
    margin-bottom: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .card-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .wallet-stats {
        flex-direction: column;
        gap: 10px;
    }

    .input-with-button {
        flex-direction: column;
    }

    .input-with-button .btn {
        width: 100%;
    }

    .wallet-item-header {
        flex-direction: column;
        gap: 10px;
    }

    .wallet-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
    }
    
    .modal-body {
        max-height: calc(85vh - 80px);
        -webkit-overflow-scrolling: touch;
    }
    
    /* iOS 模态框优化 */
    .modal {
        padding: env(safe-area-inset-top) env(safe-area-inset-right) 
                 env(safe-area-inset-bottom) env(safe-area-inset-left);
    }
}

/* iOS 特定媒体查询 */
@media only screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3),
       only screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2),
       only screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3),
       only screen and (device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3),
       only screen and (device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) {
    /* iPhone X 及更新机型适配 */
    .header {
        padding-top: calc(15px + env(safe-area-inset-top));
    }
    
    .nav-tabs {
        top: calc(60px + env(safe-area-inset-top));
    }
    
    .tab-content {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
    
    .notification {
        top: calc(60px + env(safe-area-inset-top) + 10px);
    }
}

/* ============================================
   新增样式 - imToken 风格
   ============================================ */

/* 安全警告横幅 */
.security-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    padding: 10px 20px;
    text-align: center;
    font-size: 13px;
    border-bottom: 1px solid #fbbf24;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.security-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.security-content i {
    font-size: 14px;
}

/* 主导航栏 */
.main-nav {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 40px;
    z-index: 999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 18px;
    color: #1e40af;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
}

.logo-text {
    color: #1e40af;
}

.nav-menu {
    display: flex;
    gap: 20px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    color: #6b7280;
    text-decoration: none;
    font-size: 15px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: #1e40af;
    background: #eff6ff;
}

.nav-download-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.nav-download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.nav-download-btn:active {
    transform: translateY(0);
}

/* 必填字段标记 */
.required {
    color: #ef4444;
    margin-left: 4px;
}

/* 通知列表样式 */
.notification-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.notification-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s;
}

.notification-item.unread {
    background: #eff6ff;
    border-color: #3b82f6;
    border-left: 4px solid #3b82f6;
}

.notification-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.notification-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.notification-time {
    font-size: 12px;
    color: #6b7280;
}

.notification-content {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.6;
}

.notification-content p {
    margin: 0 0 10px 0;
}

.notification-details {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 13px;
}

.notification-details div {
    margin-bottom: 6px;
    color: #6b7280;
}

.notification-details strong {
    color: #374151;
    margin-right: 8px;
}

.notification-details code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    word-break: break-all;
}

/* 响应式导航 */
@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
        padding: 10px 15px;
    }

    .nav-menu {
        order: 3;
        width: 100%;
        justify-content: space-around;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #e5e7eb;
    }

    .nav-link {
        font-size: 14px;
        padding: 6px 10px;
    }

    .nav-download-btn {
        font-size: 13px;
        padding: 8px 16px;
    }

    .security-banner {
        font-size: 12px;
        padding: 8px 15px;
    }

    .security-content {
        flex-wrap: wrap;
    }
}

/* 表单标签样式增强 */
.form-group label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-group label small {
    font-weight: normal;
    color: #6b7280;
    margin-left: auto;
}

/* 代码样式 */
code {
    font-family: 'Courier New', Courier, monospace;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* 顶部用户信息 */
.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-user #currentUserName {
    font-size: 12px;
    color: #e5e7eb;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 32px;
}

/* 链类型复选框容器 */
.chain-checkboxes {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    background: #f9fafb;
}

.chain-checkboxes label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.chain-checkboxes label:hover {
    background-color: #f3f4f6;
}

.chain-checkboxes input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 手续费显示 */
.fee-display {
    color: #667eea;
    font-weight: 600;
    margin-left: 10px;
}

/* 转账结果样式 */
#transferResult {
    margin-top: 20px;
}

#transferResult code {
    word-break: break-all;
    display: block;
    padding: 8px;
    margin-top: 5px;
}

/* 链类型复选框容器 */
.chain-checkboxes {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    background: #f9fafb;
}

.chain-checkboxes label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.chain-checkboxes label:hover {
    background-color: #f3f4f6;
}

.chain-checkboxes input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 手续费显示 */
.fee-display {
    color: #667eea;
    font-weight: 600;
    margin-left: 10px;
}

/* 转账结果样式 */
#transferResult {
    margin-top: 20px;
}

#transferResult code {
    word-break: break-all;
    display: block;
    padding: 8px;
    margin-top: 5px;
}

/* ============================================
   新布局样式 - 顶部Tab + 左侧菜单
   ============================================ */

/* 应用主容器 */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* 顶部头部 */
.top-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}

.header-content h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 12px;
}

/* 顶部Tab导航 */
.top-nav-tabs {
    display: flex;
    background: white;
    border-bottom: 2px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    z-index: 999;
}

.top-tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    color: #6b7280;
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.top-tab-btn:hover {
    background: #f9fafb;
    color: #667eea;
}

.top-tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f0f4ff;
}

/* 主内容包装器 */
.main-content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0; /* 允许flex子元素正确收缩 */
}

/* 左侧菜单 */
.sidebar-menu {
    width: 240px;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    flex-shrink: 0;
    padding: 20px 0;
}

.sidebar-menu-item {
    padding: 12px 20px;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-menu-item:hover {
    background: #f3f4f6;
    color: #667eea;
}

.sidebar-menu-item.active {
    background: #eff6ff;
    color: #667eea;
    border-left-color: #667eea;
    font-weight: 600;
}

.sidebar-menu-item i {
    width: 20px;
    text-align: center;
}

/* 右侧主内容区 */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: #ffffff;
    -webkit-overflow-scrolling: touch;
    min-height: 0; /* 允许flex子元素正确收缩 */
    max-height: 100%; /* 确保不超过父容器 */
}

/* 子内容区域 */
.sub-content {
    animation: fadeIn 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content-wrapper {
        flex-direction: column;
    }

    .sidebar-menu {
        width: 100%;
        height: auto;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        display: flex;
        overflow-x: auto;
        padding: 10px 0;
    }

    .sidebar-menu-item {
        white-space: nowrap;
        padding: 10px 15px;
        min-width: 120px;
    }

    .top-nav-tabs {
        overflow-x: auto;
    }

    .top-tab-btn {
        min-width: 120px;
        padding: 12px 15px;
        font-size: 14px;
    }

    .header-content {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }
}
