/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #34495e;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background-color: #34495e;
    color: white;
    border-left-color: #3498db;
}

.sidebar-nav li.active a {
    background-color: #34495e;
    color: white;
    border-left-color: #3498db;
}

.sidebar-nav i {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
}

.sidebar-nav .divider {
    height: 1px;
    background-color: #34495e;
    margin: 10px 0;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.header {
    background-color: #ecf0f1;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #bdc3c7;
}

.header-left h1 {
    font-size: 24px;
    color: #2c3e50;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #7f8c8d;
}

.header-right i {
    font-size: 18px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.header-right i:hover {
    color: #3498db;
}

/* 内容区域 */
.content {
    padding: 30px;
    flex: 1;
}

/* 统计卡片网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.stat-card.blue {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.stat-card.green {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.stat-card.orange {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.stat-card.red {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.stat-icon {
    font-size: 40px;
    margin-right: 20px;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

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

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

/* 快速操作 */
.quick-actions {
    margin-bottom: 30px;
}

.quick-actions h3 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.action-btn {
    background: white;
    border-radius: 10px;
    padding: 25px;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    text-decoration: none;
    color: #333;
}

.action-btn.blue:hover {
    border-color: #3498db;
}

.action-btn.green:hover {
    border-color: #27ae60;
}

.action-btn.orange:hover {
    border-color: #f39c12;
}

.action-btn i {
    font-size: 40px;
    margin-right: 20px;
    opacity: 0.8;
}

.action-btn.blue i {
    color: #3498db;
}

.action-btn.green i {
    color: #27ae60;
}

.action-btn.orange i {
    color: #f39c12;
}

.action-content {
    flex: 1;
}

.action-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c3e50;
}

.action-desc {
    font-size: 14px;
    color: #7f8c8d;
}

/* 最近记录 */
.recent-records {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.section-header h3 {
    font-size: 20px;
    color: #2c3e50;
    font-weight: 600;
}

.view-all {
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.view-all:hover {
    color: #2980b9;
    text-decoration: none;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.data-table th {
    background-color: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
    padding: 15px 12px;
    text-align: left;
    border-bottom: 2px solid #e9ecef;
    font-size: 14px;
}

.data-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

.coins {
    color: #27ae60;
    font-weight: 600;
}

.no-data {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 40px !important;
}

/* 筛选区域 */
.filter-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.filter-group label {
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 5px;
    font-weight: 600;
}

.filter-group input,
.filter-group select {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #3498db;
}

.filter-btn,
.reset-btn,
.export-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.filter-btn {
    background: #3498db;
    color: white;
}

.filter-btn:hover {
    background: #2980b9;
}

.reset-btn {
    background: #95a5a6;
    color: white;
}

.reset-btn:hover {
    background: #7f8c8d;
}

.export-btn {
    background: #27ae60;
    color: white;
}

.export-btn:hover {
    background: #229954;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

/* 状态标签 */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* 模态框样式 */
.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: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

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

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.page-btn {
    padding: 8px 16px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    transition: background 0.3s ease;
}

.page-btn:hover {
    background: #2980b9;
    text-decoration: none;
    color: white;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-number {
    padding: 8px 12px;
    background: #ecf0f1;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.page-number:hover {
    background: #bdc3c7;
    text-decoration: none;
    color: #2c3e50;
}

.page-number.active {
    background: #3498db;
    color: white;
}

/* 记录统计 */
.records-summary {
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    gap: 30px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-label {
    color: #7f8c8d;
    font-size: 14px;
}

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

/* 账号信息 */
.account-info {
    display: flex;
    flex-direction: column;
}

.account-name {
    font-weight: 600;
    color: #2c3e50;
}

.account-id {
    font-size: 12px;
    color: #7f8c8d;
}

/* 配置区域 */
.config-section,
.api-section,
.api-docs {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.config-section h3,
.api-section h3,
.api-docs h3 {
    color: #2c3e50;
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: 600;
}

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

.config-item {
    display: flex;
    flex-direction: column;
}

.config-item label {
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 5px;
    font-weight: 600;
}

.config-item input {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.config-item input:focus {
    outline: none;
    border-color: #3498db;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* API文档样式 */
.docs-content {
    background: #f8f9fa;
    border-radius: 5px;
    padding: 20px;
}

.docs-content h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.docs-content p {
    margin-bottom: 10px;
    color: #555;
}

.docs-content pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 10px 0;
}

.docs-content code {
    background: #ecf0f1;
    color: #2c3e50;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* 图表区域 */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chart-container h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .content {
        padding: 20px;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .config-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .header {
        padding: 15px 20px;
    }
    
    .content {
        padding: 15px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .records-summary {
        flex-direction: column;
        gap: 15px;
    }
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

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

.login-header h2 {
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 10px;
}

.login-header p {
    color: #7f8c8d;
    font-size: 14px;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* API密钥管理样式 */
.api-key {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 4px 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #495057;
    display: inline-block;
    margin-right: 8px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-copy {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-copy:hover {
    background: #5a6268;
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
}

.form-inline .form-group {
    margin-bottom: 0;
    min-width: 200px;
}

.form-inline .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.form-inline .form-group select,
.form-inline .form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-inline .form-group select:focus,
.form-inline .form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.code-block {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 15px;
    margin: 10px 0;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    color: #495057;
}

.code-block code {
    background: none;
    padding: 0;
    border: none;
    color: inherit;
}

/* 代理信息样式 */
.agent-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.agent-info small {
    font-size: 11px;
    color: #6c757d;
    margin-top: 2px;
}

.text-muted {
    color: #6c757d !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-inline .form-group {
        min-width: auto;
    }
    
    .api-key {
        max-width: 150px;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 5px;
    }
    
    .agent-info {
        font-size: 12px;
    }
}
