/* ===== 测色仪UI样式 ===== */

/* 测色仪按钮 */
.colorimeter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    cursor: pointer;
    border-radius: 16px;
    background-color: #f0f4f8;
    border: 1px solid #d0d7de;
    transition: all 0.2s ease;
    position: relative;
}

.colorimeter-btn:hover {
    background-color: #e3ebf3;
    border-color: #b0b8c4;
}

.colorimeter-btn .colorimeter-icon {
    font-size: 14px;
    color: #6b7280;
}

.colorimeter-btn .colorimeter-label {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
}

.colorimeter-btn .colorimeter-state {
    font-size: 12px;
    color: #9ca3af;
    padding: 1px 6px;
    border-radius: 10px;
    background-color: rgba(156, 163, 175, 0.15);
}

/* 状态指示点 */
.colorimeter-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #9ca3af;
    transition: all 0.3s ease;
}

.colorimeter-status-dot.connected {
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    animation: pulse-green 2s infinite;
}

.colorimeter-status-dot.shared {
    background-color: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
    animation: pulse-blue 2s infinite;
}

.colorimeter-status-dot.ready {
    background-color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
    animation: pulse-yellow 2s infinite;
}

.colorimeter-status-dot.disconnected {
    background-color: #9ca3af;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
    50% { box-shadow: 0 0 16px rgba(16, 185, 129, 0.8); }
}

@keyframes pulse-blue {
    0%, 100% { box-shadow: 0 0 8px rgba(59, 130, 246, 0.5); }
    50% { box-shadow: 0 0 16px rgba(59, 130, 246, 0.8); }
}

@keyframes pulse-yellow {
    0%, 100% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.5); }
    50% { box-shadow: 0 0 16px rgba(245, 158, 11, 0.8); }
}

/* 测色仪管理面板 */
.colorimeter-panel {
    display: none;
    position: absolute;
    top: 100%;
    right: 12px;
    width: 300px;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    margin-top: 8px;
    overflow: hidden;
}

.colorimeter-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 14px;
    color: #111827;
}

.colorimeter-panel-header .fa-tint {
    color: #3b82f6;
}

.colorimeter-close {
    margin-left: auto;
    cursor: pointer;
    color: #9ca3af;
    font-size: 16px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.colorimeter-close:hover {
    color: #374151;
    background-color: #e5e7eb;
}

.colorimeter-panel-body {
    padding: 16px;
}

.colorimeter-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.colorimeter-info-item:last-child {
    border-bottom: none;
}

.colorimeter-info-label {
    font-size: 13px;
    color: #6b7280;
}

.colorimeter-info-value {
    font-size: 13px;
    color: #111827;
    font-weight: 500;
}

/* 状态徽章 */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.status-connected {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.status-shared {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-badge.status-disconnected {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* 操作按钮 */
.colorimeter-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-top: 1px solid #e5e7eb;
}

.colorimeter-action-btn {
    flex: 1;
    min-width: 120px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 8px 12px !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
}

.colorimeter-action-btn.btn-primary {
    background-color: #3b82f6 !important;
    color: #fff !important;
}

.colorimeter-action-btn.btn-primary:hover {
    background-color: #2563eb !important;
}

.colorimeter-action-btn.btn-secondary {
    background-color: #e5e7eb !important;
    color: #374151 !important;
}

.colorimeter-action-btn.btn-secondary:hover {
    background-color: #d1d5db !important;
}

.colorimeter-action-btn.btn-danger {
    background-color: #ef4444 !important;
    color: #fff !important;
}

.colorimeter-action-btn.btn-danger:hover {
    background-color: #dc2626 !important;
}

/* Toast 提示 */
.colorimeter-toast {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10002;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.colorimeter-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 交互式Toast - 允许点击内部按钮（BLE操作需要用户手势） */
.colorimeter-toast-interactive {
    pointer-events: auto;
    z-index: 10003;
}

.colorimeter-toast-info {
    background-color: #3b82f6;
    color: #fff;
}

.colorimeter-toast-success {
    background-color: #10b981;
    color: #fff;
}

.colorimeter-toast-warning {
    background-color: #f59e0b;
    color: #fff;
}

.colorimeter-toast-error {
    background-color: #ef4444;
    color: #fff;
}

/* ===== 子页面内联测色仪状态栏 ===== */
.colorimeter-inline-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background-color: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 12px;
}

.colorimeter-inline-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.colorimeter-inline-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.connected { background-color: #10b981; }
.status-dot.disconnected { background-color: #9ca3af; }
.status-dot.shared { background-color: #3b82f6; }
.status-dot.ready { background-color: #f59e0b; }

.colorimeter-inline-buttons {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.colorimeter-inline-buttons button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid #d0d7de;
    background-color: #fff;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.colorimeter-inline-buttons button:hover {
    background-color: #f3f4f6;
    border-color: #b0b8c4;
}

.colorimeter-inline-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.colorimeter-inline-buttons button.btn-primary {
    background-color: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.colorimeter-inline-buttons button.btn-primary:hover {
    background-color: #2563eb;
}

/* 颜色测量按钮 */
.measure-color-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #d0d7de;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
}

.measure-color-btn:hover {
    background-color: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.measure-color-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 颜色色块显示 */
.color-swatch {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid #d0d7de;
    vertical-align: middle;
}

.color-swatch-empty {
    background: repeating-linear-gradient(
        45deg,
        #f3f4f6,
        #f3f4f6 4px,
        #e5e7eb 4px,
        #e5e7eb 8px
    );
}

/* 内联测色仪隐藏连接提示 */
.colorimeter-hint {
    font-size: 12px;
    color: #6b7280;
    padding: 4px 0;
}

.colorimeter-hint a {
    color: #3b82f6;
    cursor: pointer;
    text-decoration: underline;
}

.colorimeter-hint a:hover {
    color: #2563eb;
}
