/* 工具三（颜色代码转换）专用样式 */

/* 页面头部 */
.page-header {
    background-color: #1e1e1e;
    padding: 40px 0;
    border-bottom: 1px solid #333333;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #2196f3;
}

.page-header p {
    font-size: 16px;
    color: #b0b0b0;
    max-width: 700px;
}

/* 工具主体区域 */
.color-converter {
    padding: 48px 0;
}

/* 主要内容区域布局 */
.converter-container {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

/* 左侧颜色选择面板 */
.color-selection-panel {
    flex: 0 0 320px;
}

.panel-section {
    margin-bottom: 24px;
}

.panel-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #ffffff;
    padding-bottom: 8px;
    border-bottom: 1px solid #333333;
}

/* 颜色选择器 */
.color-picker-container {
    padding: 24px;
    background-color: #2d2d2d;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.color-picker {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 8px solid #1e1e1e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    overflow: hidden;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

/* 颜色输入区域 */
.color-input-group {
    margin-bottom: 16px;
}

.color-input-group label {
    display: block;
    margin-bottom: 8px;
    color: #e0e0e0;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
}

.format-hint {
    font-size: 12px;
    color: #888888;
}

.text-input {
    width: 100%;
    padding: 10px 12px;
    background-color: #2d2d2d;
    border: 1px solid #333333;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 14px;
}

.text-input:focus {
    outline: none;
    border-color: #2196f3;
}

/* 颜色调整控制 */
.slider-control {
    margin-bottom: 24px;
}

.slider-control label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #e0e0e0;
    font-size: 14px;
}

.slider-value {
    color: #2196f3;
}

.color-slider {
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, #000, #fff);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.color-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #2196f3;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 右侧颜色预览和信息区域 */
.preview-panel {
    flex: 1;
    min-width: 300px;
}

/* 颜色预览 */
.color-preview-card {
    min-height: 200px;
    border-radius: 8px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.color-preview {
    width: 100%;
    height: 100%;
    min-height: 200px;
    transition: background-color 0.3s ease;
}

.color-code-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: #ffffff;
    font-family: monospace;
    font-size: 18px;
    text-align: center;
}

/* 颜色信息 */
.color-info-section {
    margin-bottom: 32px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.info-item {
    padding: 16px;
    text-align: center;
}

.info-value {
    font-size: 18px;
    font-weight: 600;
    color: #2196f3;
    margin-bottom: 4px;
    font-family: monospace;
}

.info-label {
    font-size: 13px;
    color: #b0b0b0;
}

/* 颜色方案建议 */
.color-palette-section {
    margin-top: 32px;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.palette-color {
    height: 80px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.palette-color:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.palette-color-code {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    font-size: 11px;
    text-align: center;
    font-family: monospace;
    opacity: 0;
    transition: opacity 0.2s;
}

.palette-color:hover .palette-color-code {
    opacity: 1;
}

/* 对比度检查器 */
.contrast-checker {
    margin-top: 32px;
}

.contrast-preview {
    border-radius: 6px;
    padding: 24px;
    margin: 16px 0;
}

.contrast-text {
    font-size: 16px;
    margin-bottom: 16px;
}

.contrast-large-text {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 16px;
}

.contrast-result {
    padding: 16px;
    border-radius: 6px;
    text-align: center;
    margin-top: 16px;
}

.contrast-passed {
    background-color: rgba(76, 175, 80, 0.1);
    border: 1px solid #4caf50;
}

.contrast-failed {
    background-color: rgba(244, 67, 54, 0.1);
    border: 1px solid #f44336;
}

.contrast-label {
    font-weight: 600;
    margin-bottom: 8px;
}

.contrast-value {
    font-size: 24px;
    font-weight: 700;
    font-family: monospace;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .converter-container {
        flex-direction: column;
    }
    
    .color-selection-panel {
        flex: 1 0 100%;
    }
    
    .palette-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .palette-color {
        height: 60px;
    }
}
