/* 关键词密度检测工具专用样式 */

/* 表单输入样式 */
.form-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: border-color 0.3s;
}

.form-textarea:focus {
    outline: none;
    border-color: #4285f4;
}

/* 生成按钮样式 */
.generate-btn {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
    margin: 20px 0;
    font-weight: 500;
}

.generate-btn:hover {
    background-color: #3367d6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

.generate-btn:active {
    transform: scale(0.98);
}

.generate-btn i {
    font-size: 16px;
}

/* 选项卡容器 */
.tab-container {
    margin-bottom: 20px;
}

/* 选项卡按钮组 */
.tab-buttons {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    gap: 5px;
    margin-bottom: 20px;
}

/* 选项卡按钮 */
.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    font-size: 15px;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
}

.tab-btn:hover {
    color: #4285f4;
    background: rgba(66, 133, 244, 0.05);
}

.tab-btn.active {
    border-bottom-color: #4285f4;
    color: #4285f4;
    font-weight: 600;
}

/* 选项卡内容 */
.tab-content {
    display: none;
    padding: 20px 0;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* 加载指示器 */
#loading-indicator {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4285f4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 统计面板 */
.stats-panel {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.stats-panel h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    font-weight: 500;
}

.stat-value {
    font-size: 16px;
    color: #333;
    font-weight: 600;
    word-break: break-all;
}

/* 导出按钮 */
.export-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-secondary i {
    font-size: 14px;
}

/* 结果选项卡 */
.result-tabs {
    margin-top: 20px;
}

.result-tab-buttons {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.result-tab-btn {
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    position: relative;
    bottom: -2px;
}

.result-tab-btn:hover {
    color: #4285f4;
}

.result-tab-btn.active {
    color: #4285f4;
    border-bottom-color: #4285f4;
    font-weight: 600;
}

.result-tab-content {
    display: none;
}

.result-tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

/* 关键词表格 */
.keywords-table-container {
    overflow-x: auto;
}

.keywords-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.keywords-table thead {
    background: #f8f9fa;
}

.keywords-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    border-bottom: 2px solid #e0e0e0;
}

.keywords-table th:first-child {
    width: 60px;
    text-align: center;
}

.keywords-table th:nth-child(3) {
    width: 100px;
    text-align: center;
}

.keywords-table th:nth-child(4) {
    width: 100px;
    text-align: center;
}

.keywords-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.keywords-table tbody tr:hover {
    background: #f8f9fa;
}

.keywords-table td {
    padding: 12px 15px;
    color: #555;
    font-size: 14px;
}

.keywords-table td:first-child {
    text-align: center;
    color: #999;
    font-weight: 500;
}

.keywords-table td:nth-child(3),
.keywords-table td:nth-child(4) {
    text-align: center;
    font-weight: 600;
}

.keywords-table td:nth-child(2) {
    font-family: 'Courier New', monospace;
    font-weight: 500;
    color: #4285f4;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 15px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .result-tab-buttons {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .result-tab-btn {
        white-space: nowrap;
        padding: 10px 15px;
        font-size: 13px;
    }

    .keywords-table {
        font-size: 13px;
    }

    .keywords-table th,
    .keywords-table td {
        padding: 10px 8px;
    }

    .export-buttons {
        flex-direction: column;
    }

    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* 淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
