/**
 * 文本复制粘贴工具样式
 */

/* 编辑器容器样式 */
.text-editor-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

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

.editor-header label {
    font-weight: 600;
    color: #333;
}

.editor-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-icon .icon {
    font-size: 14px;
}

/* 文本域样式 */
.query-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
}

.query-textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.1);
}

/* 实时统计 */
.live-stats {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 4px;
    font-size: 13px;
}

.stat-item {
    color: #666;
}

.stat-label {
    color: #999;
}

.stat-item span:last-child {
    font-weight: 600;
    color: #333;
    margin-left: 4px;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-buttons .button,
.action-buttons .secondary,
.action-buttons .third {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* 快捷格式化选项 */
.format-options {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 4px;
}

.options-label {
    font-size: 13px;
    color: #666;
    margin-right: 5px;
}

.btn-small {
    padding: 4px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-small:hover {
    background: #e9ecef;
    border-color: #999;
}

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

.stat-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #007bff;
    line-height: 1.2;
}

.stat-name {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

/* 结果区域 */
.result-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.result-textarea {
    background: #fff;
    border: 1px solid #28a745;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .editor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .editor-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .live-stats {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons button {
        width: 100%;
        justify-content: center;
    }
    
    .format-options {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 撤销按钮特殊样式 */
.btn-undo {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

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