:root {
    --primary-color: #4a6cf7;
    --secondary-color: #3b5be3;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f6f9;
    padding: 20px;
}

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

.card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

.hidden {
    display: none;
}

/* 语言切换组件样式 */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-button {
    padding: 10px 15px;
    border-radius: var(--border-radius);
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.language-button:hover {
    transform: scale(1.05);
    background: var(--secondary-color);
}

.language-dropdown {
    position: absolute;
    top: 45px;
    right: 0;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 10px;
    min-width: 150px;
    display: none;
    flex-direction: column;
    gap: 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 10001;
}

.language-dropdown.show {
    display: flex;
    animation: slideInDown 0.3s ease;
}

.language-option {
    padding: 8px 12px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-option:hover {
    background: #f5f5f5;
}

.language-flag {
    font-size: 16px;
}

.language-name {
    flex: 1;
    font-size: 14px;
}

.language-option.selected {
    background: var(--primary-color);
    color: white;
}

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

/* 移动端适配 */
@media (max-width: 768px) {
    .language-switcher {
        top: 15px;
        right: 15px;
    }
    
    .language-button {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .language-dropdown {
        min-width: 140px;
        max-height: 250px;
    }
    
    .language-name {
        font-size: 13px;
    }
    /* 代理系统样式 */
.tab-container {
    margin-top: 20px;
}

.tab-buttons {
    display: flex;
    border-bottom: 2px solid #3a3f4b;
    margin-bottom: 20px;
}

.tab-button {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    color: #a0aec0;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-button.active {
    color: #5B8CFF;
    border-bottom: 2px solid #5B8CFF;
}

.tab-button:hover {
    color: #5B8CFF;
}

.tab-pane {
    display: none;
}

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

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

.stat-card {
    background: #2d3748;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.stat-card h3 {
    margin: 0 0 10px 0;
    color: #a0aec0;
    font-size: 14px;
}

.stat-card p {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    color: #5B8CFF;
}

.section {
    background: #2d3748;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.section h3 {
    margin: 0 0 15px 0;
    color: #e2e8f0;
}

.referral-list, .history-list {
    max-height: 300px;
    overflow-y: auto;
}

.referral-item, .history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #4a5568;
}

.referral-item:last-child, .history-item:last-child {
    border-bottom: none;
}

.history-item.pending {
    border-left: 4px solid #ffd700;
}

.history-item.approved {
    border-left: 4px solid #5B8CFF;
}

.history-item.completed {
    border-left: 4px solid #6DCF8F;
}

.history-item.rejected {
    border-left: 4px solid #ff4757;
}

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

.history-details {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #a0aec0;
}

.withdraw-form {
    background: #2d3748;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.referral-link-box {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.referral-link-box input {
    flex: 1;
    padding: 10px;
    background: #1a202c;
    border: 1px solid #4a5568;
    border-radius: 6px;
    color: white;
}

.commission-rules {
    list-style: none;
    padding: 0;
}

.commission-rules li {
    padding: 8px 0;
    border-bottom: 1px solid #4a5568;
}

.commission-rules li:last-child {
    border-bottom: none;
}

.note {
    font-size: 14px;
    color: #a0aec0;
    font-style: italic;
}
/* 推荐信息样式 */
.referral-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
}

.referral-info p {
    margin: 5px 0;
}

.referral-info #referrerAddress {
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
}

.connect-card {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    padding: 40px 20px;
}
/* 代理管理样式 */
.agent-management {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

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

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-value {
  font-size: 24px;
  font-weight: bold;
  color: #4a5568;
}

.table-container {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.agent-table {
  width: 100%;
  border-collapse: collapse;
}

.agent-table th,
.agent-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.agent-table th {
  background: #f7fafc;
  font-weight: 600;
}

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

.status-pending { background: #fed7d7; color: #c53030; }
.status-approved { background: #c6f6d5; color: #2d7d32; }
.status-rejected { background: #fed7d7; color: #c53030; }
.status-completed { background: #c6f6d5; color: #2d7d32; }

.action-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 5px;
}

.btn-approve { background: #48bb78; color: white; }
.btn-reject { background: #f56565; color: white; }
.btn-complete { background: #4299e1; color: white; }

.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: 20px;
  border-radius: 10px;
  width: 80%;
  max-width: 600px;
}
.input-error-message {
    color: #ff4757;
    font-size: 12px;
    margin-top: 5px;
    padding: 5px;
    background: rgba(255, 71, 87, 0.1);
    border-radius: 4px;
    border-left: 3px solid #ff4757;
}

.input:invalid {
    border-color: #ff4757;
}

.input:focus:invalid {
    box-shadow: 0 0 0 2px rgba(255, 71, 87, 0.2);
}
#errorContainer {
    padding: 10px;
    margin: 10px 0;
    border-radius: var(--border-radius);
    background-color: #E3F2FD; /* 淡蓝色背景 */
    color: #1565C0; /* 深蓝色文字 */
    border: 1px solid #64B5F6; /* 天蓝色边框 */
    display: none; /* 默认隐藏 */
}

.error-message {
    display: flex;
    align-items: center;
    gap: 8px;
}
}