/* ============================================
   颜色转换器样式
   ============================================ */

/* 页面头部 */
.cc-page-header {
    margin-bottom: 24px;
}

.cc-page-title {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.cc-page-desc {
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 12px 0;
}

.cc-feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cc-tag {
    display: inline-block;
    padding: 3px 10px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 12px;
    color: #4b5563;
}

/* 颜色预览卡片 */
.cc-preview-card {
    margin-bottom: 20px;
    padding: 20px;
}

.cc-preview-section {
    display: flex;
    gap: 20px;
    align-items: stretch;
    flex-wrap: wrap;
}

.cc-color-preview {
    flex: 1;
    min-width: 200px;
    min-height: 150px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.cc-preview-bg {
    position: absolute;
    inset: 0;
    background: #3b82f6;
    transition: background 0.3s ease;
}

.cc-preview-info {
    position: relative;
    padding: 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: white;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cc-preview-hex {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 24px;
    font-weight: 700;
}

.cc-preview-rgb {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    opacity: 0.9;
}

.cc-color-inputs {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 160px;
}

.cc-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cc-input-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #f9fafb;
    border: 2px dashed #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cc-input-label:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.cc-color-picker {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    background: none;
}

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

.cc-color-picker::-webkit-color-swatch {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
}

.cc-input-label span {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.cc-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 转换器网格 */
.cc-converters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.cc-converter-card {
    display: flex;
    flex-direction: column;
}

.cc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.cc-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.cc-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.cc-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cc-copy-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.cc-copy-btn:active {
    transform: scale(0.95);
}

.cc-copy-btn svg {
    width: 16px;
    height: 16px;
    color: #6b7280;
}

.cc-copy-btn:hover svg {
    color: #111827;
}

.cc-copy-btn.copied {
    background: #ecfdf5;
    border-color: #10b981;
}

.cc-copy-btn.copied svg {
    color: #10b981;
}

/* HEX 输入 */
.cc-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.cc-input-prefix {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 18px;
    font-weight: 600;
    color: #6b7280;
}

.cc-format-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 16px;
    font-weight: 500;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.cc-format-input:focus {
    outline: none;
    border-color: #3b82f6;
}

/* RGB/HSL/CMYK 输入 */
.cc-rgb-inputs,
.cc-hsl-inputs,
.cc-cmyk-inputs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.cc-channel-input {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cc-channel-input label {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
}

.cc-channel-input input {
    width: 100%;
    padding: 8px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 14px;
    text-align: center;
    transition: all 0.2s ease;
}

.cc-channel-input input:focus {
    outline: none;
    border-color: #3b82f6;
}

.cc-channel-input span {
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    margin-top: 2px;
}

.cc-cmyk label {
    font-size: 10px;
}

.cc-cmyk input {
    padding: 6px 4px;
    font-size: 13px;
}

/* CSS 输出 */
.cc-css-output {
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.cc-css-output code {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 12px;
    color: #374151;
    word-break: break-all;
}

/* 调色板卡片 */
.cc-palette-card {
    margin-bottom: 20px;
}

.cc-palette-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.cc-option-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f3f4f6;
    border-radius: 20px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cc-option-label:hover {
    background: #e5e7eb;
}

.cc-option-label input {
    margin: 0;
}

.cc-option-label:has(input:checked) {
    background: #3b82f6;
    color: white;
}

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

.cc-palette-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.cc-palette-item:hover {
    background: #f9fafb;
    transform: translateY(-2px);
}

.cc-palette-color {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.cc-palette-item:hover .cc-palette-color {
    transform: scale(1.05);
}

.cc-palette-hex {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
}

/* 使用说明 */
.cc-guide-content {
    font-size: 14px;
    line-height: 1.8;
    color: #374151;
}

.cc-guide-content h4 {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 20px 0 12px 0;
}

.cc-guide-content p {
    margin: 0 0 12px 0;
}

.cc-guide-list {
    margin: 0 0 16px 0;
    padding-left: 20px;
}

.cc-guide-list li {
    margin-bottom: 8px;
}

.cc-guide-list strong {
    color: #111827;
}

/* FAQ */
.cc-faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cc-faq-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.cc-faq-item:hover {
    border-color: #d1d5db;
}

.cc-faq-item[open] {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

.cc-faq-question {
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    cursor: pointer;
    list-style: none;
    position: relative;
    user-select: none;
}

.cc-faq-question::-webkit-details-marker {
    display: none;
}

.cc-faq-question::after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.cc-faq-item[open] .cc-faq-question::after {
    content: '−';
    color: #3b82f6;
}

.cc-faq-answer {
    padding: 0 20px 16px 20px;
    font-size: 14px;
    line-height: 1.7;
    color: #6b7280;
}

.cc-faq-answer p {
    margin: 0;
}

.cc-faq-answer code {
    display: inline-block;
    padding: 2px 6px;
    background: #f3f4f6;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 12px;
    color: #111827;
}

/* 响应式调整 */
@media (max-width: 640px) {
    .cc-page-title {
        font-size: 22px;
    }
    
    .cc-preview-section {
        flex-direction: column;
    }
    
    .cc-color-preview {
        min-height: 120px;
    }
    
    .cc-converters-grid {
        grid-template-columns: 1fr;
    }
    
    .cc-palette-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .cc-palette-color {
        width: 50px;
        height: 50px;
    }
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
    .cc-tag {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }
    
    .cc-input-label {
        background: #1f2937;
        border-color: #374151;
    }
    
    .cc-input-label:hover {
        border-color: #3b82f6;
        background: #1e3a5f;
    }
    
    .cc-input-label span {
        color: #9ca3af;
    }
    
    .cc-format-input,
    .cc-channel-input input {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .cc-css-output {
        background: #1f2937;
        border-color: #374151;
    }
    
    .cc-css-output code {
        color: #e5e7eb;
    }
    
    .cc-option-label {
        background: #374151;
        color: #d1d5db;
    }
    
    .cc-option-label:hover {
        background: #4b5563;
    }
    
    .cc-palette-item:hover {
        background: #1f2937;
    }
    
    .cc-palette-hex {
        color: #d1d5db;
    }
    
    .cc-faq-item {
        border-color: #374151;
    }
    
    .cc-faq-item:hover {
        border-color: #4b5563;
    }
}
