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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.main-content {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.wallet-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    margin-bottom: 30px;
    border: 1px solid #e1e8ed;
}

.wallet-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.wallet-details {
    display: flex;
    flex-direction: column;
    margin-left: 10px;
}

.network-info {
    font-size: 0.85rem;
    color: #666;
    margin-top: 2px;
}

.wallet-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.network-btn {
    background: linear-gradient(135deg, #ffd93d 0%, #ff6b35 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.3);
}

.network-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.5);
}

.diagnostic-btn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(108, 117, 125, 0.3);
}

.diagnostic-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.5);
}

.network-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff6b6b;
    margin-right: 10px;
    transition: background 0.3s ease;
}

.status-indicator.connected {
    background: #51cf66;
}

.connect-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.connect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.connect-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.95rem;
}

.address-input, .amount-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.address-input:focus, .amount-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.amount-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.amount-input {
    flex: 1;
}

.max-btn {
    background: #f8f9fa;
    border: 2px solid #e1e8ed;
    padding: 15px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    color: #667eea;
    transition: all 0.3s ease;
}

.max-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.input-hint {
    font-size: 0.85rem;
    color: #888;
    margin-top: 5px;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 30px;
}

.auth-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-btn.primary {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(81, 207, 102, 0.4);
}

.auth-btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(81, 207, 102, 0.6);
}

.auth-btn.secondary {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.auth-btn.secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

.auth-btn:disabled {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-icon {
    font-size: 1.2rem;
}

.transaction-status {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffeaa7;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.status-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

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

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

.history-section {
    margin-top: 30px;
}

.history-section h3 {
    margin-bottom: 15px;
    color: #555;
    font-size: 1.2rem;
}

.history-list {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    min-height: 100px;
}

.empty-history {
    text-align: center;
    color: #888;
    font-style: italic;
}

.history-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-item .item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.history-item .item-type {
    font-weight: 600;
    color: #667eea;
}

.history-item .item-time {
    font-size: 0.85rem;
    color: #888;
}

.history-item .item-address {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #555;
    word-break: break-all;
}

.footer {
    text-align: center;
    margin-top: 20px;
    color: white;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 钱包诊断窗口样式 */
.wallet-diagnostic {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.diagnostic-content {
    padding: 0;
    border-radius: 15px;
    overflow: hidden;
}

.diagnostic-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.diagnostic-header h3 {
    margin: 0;
    font-size: 1.2em;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.diagnostic-info {
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.diagnostic-info h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1em;
}

.diagnostic-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.diagnostic-info li {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

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

.diagnostic-solutions {
    padding: 20px;
}

.diagnostic-solutions h4 {
    margin: 0 0 20px 0;
    color: #495057;
    font-size: 1.1em;
}

.solution-steps {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.step {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.step strong {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-size: 1em;
}

.step p {
    margin: 5px 0;
    color: #6c757d;
    font-size: 0.9em;
    line-height: 1.4;
}

.retry-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .wallet-status {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .wallet-info {
        justify-content: center;
    }
    
    .wallet-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .amount-input-group {
        flex-direction: column;
    }
    
    .amount-input, .max-btn {
        width: 100%;
    }
    
    .wallet-diagnostic {
        margin: 10px;
        max-width: calc(100vw - 20px);
    }
    
    .diagnostic-header {
        padding: 15px;
    }
    
    .diagnostic-info,
    .diagnostic-solutions {
        padding: 15px;
    }
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
    .main-content {
        background: rgba(255, 255, 255, 0.95);
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #c3e6cb;
    color: #155724;
}

.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #f5c6cb;
    color: #721c24;
}