/* 基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 头部样式 */
h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin: 0;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    text-align: center;
    color: #666;
    margin: 20px 0;
    font-size: 1.1em;
}

/* 统计面板 */
.stats-panel {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px;
    border-left: 5px solid #667eea;
}

.stats-panel h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

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

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-weight: 600;
    color: #555;
}

.stat-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #667eea;
}

.recent-usage {
    margin-top: 15px;
}

.recent-usage summary {
    cursor: pointer;
    font-weight: 600;
    color: #667eea;
    padding: 5px 0;
}

.recent-usage ul {
    list-style: none;
    padding: 10px 0;
}

.recent-usage li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
}

/* 标签页样式 */
.tab-nav {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    margin: 0 20px;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #333;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-bottom: 3px solid #667eea;
}

.tab-content {
    display: none;
    padding: 20px;
}

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

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input[type="text"], 
input[type="url"], 
input[type="number"], 
textarea, 
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

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

textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.proxy-count {
    margin-top: 5px;
    font-size: 0.9em;
    color: #666;
}

/* 按钮样式 */
.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.9em;
}

.loading {
    animation: spin 1s linear infinite;
}

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

/* 搜索表单 */
.search-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.search-input-group {
    display: flex;
    gap: 10px;
}

.search-input-group input {
    flex: 1;
}

/* 结果样式 */
.results-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #dee2e6;
}

.results-section h3 {
    color: #333;
    margin-bottom: 20px;
}

.summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.summary .success {
    color: #28a745;
    font-weight: bold;
}

.summary .failed {
    color: #dc3545;
    font-weight: bold;
}

.results-table-container {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.9em;
}

.results-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    border: none;
}

.results-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
}

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

.results-table tr.success {
    border-left: 4px solid #28a745;
}

.results-table tr.failed {
    border-left: 4px solid #dc3545;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
}

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

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

.error-msg {
    color: #dc3545;
    font-size: 0.85em;
    max-width: 200px;
    word-wrap: break-word;
}

.usage-info {
    font-size: 0.8em;
    color: #666;
}

.first-use {
    color: #28a745;
    font-weight: 600;
}

/* 导出部分 */
.export-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.export-section h4 {
    margin-bottom: 15px;
    color: #333;
}

/* 管理部分 */
.manage-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.manage-section h3 {
    margin-bottom: 15px;
    color: #333;
}

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

.detailed-stats p {
    margin: 8px 0;
    padding: 8px;
    background: white;
    border-radius: 5px;
}

/* 记录控制 */
.records-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.records-controls select {
    width: auto;
    min-width: 150px;
}

/* 搜索结果 */
.search-results {
    margin-top: 20px;
}

.search-results h3 {
    color: #333;
    margin-bottom: 15px;
}

.no-results {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 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: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 20px;
}

.close:hover {
    color: #000;
}

/* 警告样式 */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 10px;
    }
    
    h1 {
        font-size: 2em;
        padding: 20px 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .button-group {
        justify-content: center;
    }
    
    .btn {
        flex: 1;
        min-width: 120px;
    }
    
    .search-input-group {
        flex-direction: column;
    }
    
    .export-form, .clean-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .records-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .records-controls select {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-nav {
        flex-direction: column;
    }
    
    .tab-btn {
        border-bottom: 1px solid #dee2e6;
    }
    
    .tab-btn.active {
        border-bottom: 3px solid #667eea;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .results-table {
        font-size: 0.8em;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px 5px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.pagination button {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background: white;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background: #667eea;
    color: white;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .current-page {
    font-weight: bold;
    color: #667eea;
}

/* 历史记录样式 */
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.history-table th,
.history-table td {
    padding: 10px;
    border: 1px solid #dee2e6;
    text-align: left;
}

.history-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.history-table tr:nth-child(even) {
    background: #f9f9f9;
}

/* 工具提示 */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    white-space: nowrap;
    z-index: 1000;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state img {
    max-width: 200px;
    opacity: 0.5;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #333;
}

.empty-state p {
    font-size: 0.9em;
    line-height: 1.5;
}
