/**
 * Nova 颜色管理系统样式
 * 支持实时预览、预设切换等功能
 */

/* 颜色预览区域 */
.nova-color-preview {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--preview-primary, #5bc0eb) 0%, var(--preview-secondary, #333333) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 颜色选择器容器 */
.nova-color-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.nova-color-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nova-color-control label {
    font-weight: 500;
    color: var(--nova-text-dark);
}

.nova-color-picker {
    width: 100%;
    height: 50px;
    border: 2px solid var(--nova-border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--nova-transition);
}

.nova-color-picker:hover {
    border-color: var(--nova-primary-color);
}

/* 预设选择器 */
.nova-presets {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.nova-preset {
    padding: 10px 20px;
    border: 2px solid var(--nova-border-color);
    border-radius: 6px;
    background: var(--nova-bg-color);
    cursor: pointer;
    transition: var(--nova-transition);
    font-weight: 500;
}

.nova-preset:hover {
    border-color: var(--nova-primary-color);
    background: var(--nova-primary-color);
    color: white;
}

.nova-preset.active {
    border-color: var(--nova-primary-color);
    background: var(--nova-primary-color);
    color: white;
}

/* 导入导出按钮 */
.nova-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.nova-export,
.nova-import-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--nova-transition);
}

.nova-export {
    background: var(--nova-success-color);
    color: white;
}

.nova-export:hover {
    background: #2e9355;
}

.nova-import-btn {
    background: var(--nova-info-color);
    color: white;
}

.nova-import-btn:hover {
    background: #3d7eb8;
}

.nova-import-input {
    display: none;
}

/* 返回顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--nova-primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--nova-transition);
    z-index: 1000;
    font-size: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--nova-link-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* 阅读进度条 */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 9999;
}

.reading-progress-bar {
    height: 100%;
    background: var(--nova-primary-color);
    width: 0%;
    transition: width 0.1s ease;
}

/* 代码块复制按钮 */
.code-block-wrapper {
    position: relative;
}

.copy-code-button {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    background: var(--nova-secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    opacity: 0;
    transition: var(--nova-transition);
}

.code-block-wrapper:hover .copy-code-button {
    opacity: 1;
}

.copy-code-button:hover {
    background: var(--nova-primary-color);
}

/* 暗色模式切换按钮 */
#dark-mode-toggle {
    padding: 8px 16px;
    border: 2px solid var(--nova-border-color);
    border-radius: 6px;
    background: var(--nova-bg-color);
    color: var(--nova-text-dark);
    cursor: pointer;
    transition: var(--nova-transition);
}

#dark-mode-toggle:hover {
    border-color: var(--nova-primary-color);
    background: var(--nova-primary-color);
    color: white;
}

/* 无障礙访问增强 */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nova-color-controls {
        grid-template-columns: 1fr;
    }
    
    .nova-presets {
        justify-content: center;
    }
    
    .nova-actions {
        flex-direction: column;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* 打印样式 */
@media print {
    .nova-color-preview,
    .nova-color-controls,
    .nova-presets,
    .nova-actions,
    .back-to-top,
    .reading-progress {
        display: none;
    }
}
