/* 屏幕取色器样式 - 使用 .tool-page 作用域限定 */

/* 操作指南区域 */
.tool-page .guide-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.tool-page .guide-card {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tool-page .guide-card h3 {
    margin-bottom: 10px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-page .guide-card h3 i {
    font-size: 20px;
}

.tool-page .guide-card p {
    margin: 0;
    opacity: 0.9;
    line-height: 1.5;
}

/* 操作按钮区域 */
.tool-page .action-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.tool-page .action-section .btn {
    margin: 5px;
    min-width: 150px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tool-page .action-section .btn i {
    font-size: 16px;
}

/* 图片显示区域 */
.tool-page .image-section {
    margin-bottom: 30px;
}

.tool-page .image-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    background-color: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
}

.tool-page #imageCanvas {
    max-width: 100%;
    max-height: 600px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: crosshair;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 放大镜 */
.tool-page .magnifier {
    position: absolute;
    border: 3px solid #007bff;
    border-radius: 50%;
    pointer-events: none;
    background-color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.tool-page #magnifierCanvas {
    border-radius: 50%;
    display: block;
}

.tool-page .image-info {
    text-align: center;
    color: #666;
    font-size: 14px;
}

.tool-page .image-info p {
    margin: 5px 0;
}

/* 颜色信息区域 */
.tool-page .color-result {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 30px;
}

.tool-page .color-result h3 {
    margin-bottom: 20px;
    color: #333;
}

.tool-page .color-display {
    display: flex;
    gap: 20px;
    align-items: center;
}

.tool-page .color-preview {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    border: 2px solid #ddd;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tool-page .color-values {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.tool-page .color-format {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-page .color-format label {
    min-width: 60px;
    font-weight: 500;
    color: #333;
}

.tool-page .color-format input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    background-color: white;
}

.tool-page .copy-btn {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.tool-page .copy-btn:hover {
    background-color: #0056b3;
}

.tool-page .copy-btn.copied {
    background-color: #28a745;
    transform: scale(0.95);
}

/* 颜色历史 */
.tool-page .color-history-section {
    margin-bottom: 30px;
}

.tool-page .color-history-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.tool-page .history-container {
    min-height: 100px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
}

.tool-page .empty-message {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 0;
    padding: 30px 0;
}

.tool-page .history-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background-color: white;
    border-radius: 6px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.tool-page .history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tool-page .history-color {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 1px solid #ddd;
    cursor: pointer;
}

.tool-page .history-info {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    font-size: 12px;
    font-family: monospace;
}

.tool-page .history-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* 颜色分析 */
.tool-page .color-analysis {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 30px;
}

.tool-page .color-analysis h3 {
    margin-bottom: 15px;
    color: #333;
}

.tool-page .analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.tool-page .analysis-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tool-page .analysis-item label {
    font-weight: 500;
    color: #333;
}

.tool-page .analysis-item span {
    font-weight: bold;
    color: #007bff;
}

/* 按钮样式 */
.tool-page .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    text-align: center;
}

.tool-page .btn-primary {
    background-color: #007bff;
    color: white;
}

.tool-page .btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.tool-page .btn-secondary {
    background-color: #6c757d;
    color: white;
}

.tool-page .btn-secondary:hover {
    background-color: #545b62;
    transform: translateY(-2px);
}

/* 动画效果 */
@keyframes colorPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.tool-page .color-picked {
    animation: colorPulse 0.3s ease-in-out;
}

/* 加载状态 */
.tool-page .loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 123, 255, 0.3);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tool-page .guide-section {
        grid-template-columns: 1fr;
    }

    .tool-page .action-section .btn {
        width: 100%;
        margin: 5px 0;
    }

    .tool-page .color-display {
        flex-direction: column;
        text-align: center;
    }

    .tool-page .history-info {
        grid-template-columns: 1fr;
    }

    .tool-page .history-actions {
        flex-direction: column;
    }

    .tool-page .analysis-grid {
        grid-template-columns: 1fr;
    }
}
