.demo-container {
    padding-top: 100px;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--light-blue) 100%);
}

/* 认证界面样式 */
.auth-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.auth-card {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.auth-card h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 10px;
}

.auth-card > p {
    color: var(--gray-600);
    margin-bottom: 30px;
}

.auth-form {
    text-align: left;
}

.auth-form h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

.backup-warning {
    text-align: center;
}

.mnemonic-display {
    background: var(--gray-50);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    font-family: monospace;
    font-size: 1.1rem;
    line-height: 1.8;
    border: 2px solid var(--accent-yellow);
}

.warning-text {
    color: #ef4444;
    font-weight: 500;
    margin-bottom: 20px;
}

/* 钱包主界面样式 */
.wallet-section {
    padding: 40px 0;
}

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

.wallet-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.wallet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.wallet-info-card {
    background: var(--white);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    min-height: 200px;
}

.transaction-card,
.add-token-card,
.history-card {
    background: var(--white);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
}

.wallet-info-card h3,
.transaction-card h3,
.add-token-card h3,
.history-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 24px;
    text-align: center;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px 0;
    border-bottom: 1px solid var(--gray-100);
    gap: 10px;
}

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

.address-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0; /* 重要：防止flex项目溢出 */
}

.address-text {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--gray-600);
    word-break: break-all; /* 允许长地址换行 */
    overflow-wrap: break-word;
    flex: 1;
    min-width: 0;
}

.copy-btn {
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* 余额显示样式 */
.balance-text {
    font-family: monospace;
    font-weight: 600;
    color: var(--gray-900);
}

/* 表单样式 */
.transaction-form,
.add-token-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.token-select {
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 16px;
    background: var(--white);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: var(--gray-900);
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

/* 代币列表样式 */
.token-list h4 {
    margin: 20px 0 15px 0;
    color: var(--gray-700);
}

.tokens-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.token-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 8px;
}

.token-info {
    display: flex;
    flex-direction: column;
}

.token-symbol {
    font-weight: 600;
    color: var(--gray-900);
}

.token-balance {
    font-size: 0.9rem;
    color: var(--gray-600);
}

.remove-token {
    background: #ef4444;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

/* 交易历史样式 */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 8px;
    font-size: 0.9rem;
}

.tx-hash {
    font-family: monospace;
    color: var(--primary-blue);
    cursor: pointer;
    text-decoration: underline;
}

.tx-amount {
    font-weight: 600;
}

.tx-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.tx-status.success {
    background: #10b981;
    color: white;
}

.tx-status.pending {
    background: #f59e0b;
    color: white;
}

/* 交易确认模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.transaction-details {
    margin: 20px 0;
    padding: 20px;
    background: var(--gray-50);
    border-radius: 12px;
    font-family: monospace;
    font-size: 0.9rem;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* 确保语言切换器样式正确 */
.language-switcher {
    display: flex;
    background: var(--gray-100);
    border-radius: 20px;
    padding: 4px;
    margin-left: 20px;
}

.lang-btn {
    background: none;
    border: none;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    transition: all 0.3s ease;
    min-width: 40px;
}

.lang-btn:hover {
    color: var(--primary-blue);
}

.lang-btn.active {
    background: var(--white);
    color: var(--primary-blue);
    box-shadow: var(--shadow-sm);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .wallet-grid {
        grid-template-columns: 1fr;
    }
    
    .wallet-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .auth-card {
        padding: 20px;
        margin: 0 15px;
    }
    
    .modal-actions {
        flex-direction: column;
    }

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .address-container {
        width: 100%;
    }
    
    .address-text {
        font-size: 0.8rem;
    }

    .language-switcher {
        margin-left: 10px;
    }
    
    .lang-btn {
        padding: 5px 10px;
        font-size: 12px;
        min-width: 35px;
    }
}

.no-transactions {
    text-align: center;
    color: var(--gray-600);
    padding: 20px;
    font-style: italic;
}

.tx-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tx-time {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.wallet-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

/* 响应式改进 */
@media (max-width: 480px) {
    .info-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .tx-info {
        align-items: flex-start;
    }
    
    .history-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-blue);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 1.1rem;
    color: var(--gray-700);
    font-weight: 500;
}

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

/* 按钮loading状态 */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 表单内的loading状态 */
.form-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* 脉冲动画 */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}