/* 自动循环引蜘蛛工具样式 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

/* 头部装饰效果 */
header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

header h1 {
    font-size: 2.8rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

header p {
    font-size: 1.3rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* 工具容器 */
.tool-container {
    display: flex;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 650px;
    transition: all 0.3s ease;
}

.tool-container:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
}

/* 左侧导航 */
.tool-sidebar {
    width: 280px;
    border-right: 1px solid #e0e0e0;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 1.8rem;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.sidebar-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-btn {
    width: 100%;
    padding: 1.2rem 1.8rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.menu-btn:hover::before {
    left: 100%;
}

.menu-btn:hover {
    background-color: #f0f0f0;
    color: #333;
    transform: translateX(5px);
}

.menu-btn.active {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #667eea;
    border-left-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

/* 右侧内容区域 */
.tool-content {
    flex: 1;
    padding: 2.5rem;
    overflow-y: auto;
}

.content-section {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-section.show {
    display: block;
}

.content-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #333;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.content-section h2::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.content-section p {
    margin-bottom: 2.5rem;
    color: #666;
    font-size: 1.1rem;
}

/* 表单样式 */
.form-group {
    margin-bottom: 2rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 500;
    color: #333;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.form-input::placeholder {
    color: #999;
    transition: color 0.3s ease;
}

.form-input:focus::placeholder {
    color: #ccc;
}

/* 表单行 */
.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 220px;
    margin-bottom: 0;
}

/* 按钮样式 */
.btn {
    padding: 1rem 1.8rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.primary-btn:hover {
    opacity: 0.95;
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn:disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 1.2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

/* 日志样式 */
.log {
    margin-top: 25px;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    line-height: 1.6;
    font-size: 14px;
    white-space: pre-wrap;
    max-height: 450px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.log:hover {
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* 状态和成功率 */
.status {
    margin-top: 12px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.success-rate {
    margin-top: 12px;
    font-size: 16px;
    font-weight: bold;
    color: #667eea;
    transition: all 0.3s ease;
}

.success-rate.high {
    color: #28a745;
}

.success-rate.low {
    color: #dc3545;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    margin-top: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressAnimation 2s infinite;
}

@keyframes progressAnimation {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 数据分析样式 */
.analysis-section {
    margin-bottom: 2.5rem;
    padding: 2rem;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.analysis-section:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.analysis-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.analysis-section h3::before {
    content: '';
    width: 3px;
    height: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.history-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#history-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

#history-table th,
#history-table td {
    padding: 1rem;
    border: 1px solid #e0e0e0;
    text-align: left;
    transition: all 0.3s ease;
}

#history-table th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

#history-table tr:hover {
    background-color: #f9f9f9;
    transform: translateX(2px);
}

#history-table tr:hover td {
    border-color: #667eea;
}

.chart-container {
    position: relative;
    height: 320px;
    margin-top: 1.5rem;
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.chart-container:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* 设置样式 */
.settings-section {
    margin-bottom: 2.5rem;
    padding: 2rem;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.settings-section:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.settings-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.settings-section h3::before {
    content: '';
    width: 3px;
    height: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

#custom-engines-list {
    margin-top: 2rem;
}

.engine-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.engine-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(5px);
    border-color: #667eea;
}

.engine-item button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.engine-item button:hover {
    transform: scale(1.05);
}

/* 响应式设计 */
@media (max-width: 768px) {
    header {
        padding: 2rem 1rem;
    }

    header h1 {
        font-size: 2.2rem;
    }

    .tool-container {
        flex-direction: column;
        border-radius: 12px;
    }

    .tool-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        padding: 0;
    }

    .menu-btn {
        white-space: nowrap;
        border-left: none;
        border-bottom: 4px solid transparent;
        padding: 1rem 1.5rem;
    }

    .menu-btn.active {
        border-left: none;
        border-bottom-color: #667eea;
        transform: none;
    }

    .menu-btn:hover {
        transform: none;
    }

    .tool-content {
        padding: 1.5rem;
    }

    .form-row {
        flex-direction: column;
        gap: 1.5rem;
    }

    .button-group {
        flex-direction: column;
        gap: 1rem;
    }

    .button-group .btn {
        width: 100%;
    }

    .analysis-section,
    .settings-section {
        padding: 1.5rem;
    }

    .chart-container {
        height: 250px;
        padding: 1rem;
    }
}

/* 加载动画 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #666;
    font-size: 1.1rem;
}

.loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 页脚样式 */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    border-top: 4px solid #667eea;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    animation: gradientMove 4s linear infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

footer p {
    font-size: 1rem;
    opacity: 0.8;
    margin: 0;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notification.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.notification.error {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
}

.notification.info {
    background: linear-gradient(135deg, #17a2b8 0%, #3498db 100%);
}

/* 复选框样式 */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: #667eea;
}

/* 选择框样式 */
select.form-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M8 11l-4-4h8l-4 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px;
    appearance: none;
}

/* 时间输入框样式 */
input[type="time"] {
    cursor: pointer;
}

/* 滚动条样式 */
::-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;
}