/* ============================================
   彩色文字生成工具 - 专用样式
   依赖 tools-common.css 公共样式
   ============================================ */

/* 输入区域 */
.input-section {
    margin-bottom: 25px;
}

.input-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.text-input {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.text-input:focus {
    outline: none;
    border-color: #3498db;
}

.input-hint {
    text-align: right;
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

#char-count {
    font-weight: 600;
    color: #3498db;
}

/* 颜色模式选择区 */
.mode-section {
    margin-bottom: 25px;
}

.mode-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.mode-btn.active {
    border-color: #3498db;
    background: #f0f8ff;
}

.mode-preview {
    width: 100%;
    height: 40px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.mode-preview-random {
    background: linear-gradient(90deg,
        #FF6B6B 0%, #4ECDC4 20%, #45B7D1 40%,
        #FFA07A 60%, #98D8C8 80%, #F7DC6F 100%);
}

.mode-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* 双色渐变设置 */
.gradient-settings {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.color-picker-group {
    display: flex;
    gap: 20px;
}

.color-picker-item {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.color-picker-item label {
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.color-picker-item input[type="color"] {
    width: 100%;
    height: 45px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
}

/* 渲染模式选择区 */
.render-mode-section {
    margin-bottom: 25px;
}

.render-mode-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.render-mode-group {
    display: flex;
    gap: 30px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
}

.radio-label input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.radio-label span {
    color: #555;
}

/* 高级选项区 */
.advanced-section {
    margin-bottom: 25px;
}

.toggle-btn {
    width: 100%;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #555;
    transition: all 0.3s ease;
    text-align: left;
}

.toggle-btn:hover {
    background: #e9ecef;
}

.toggle-btn i {
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.advanced-options {
    margin-top: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.option-item {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.checkbox-label span {
    color: #555;
}

.slider-container {
    margin-bottom: 20px;
}

.slider-container label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #555;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #3498db, #2980b9);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
}

.select-container {
    margin-bottom: 15px;
}

.select-container label {
    display: inline-block;
    margin-right: 10px;
    font-weight: 500;
    color: #555;
}

.select-input {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    background: white;
}

.select-input:focus {
    outline: none;
    border-color: #3498db;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* 预览区域 */
.preview-section {
    margin-bottom: 30px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.preview-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.bg-switcher {
    display: flex;
    gap: 10px;
}

.bg-btn {
    width: 35px;
    height: 35px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.bg-btn:hover {
    transform: scale(1.1);
}

.bg-btn.active {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.bg-btn[data-bg="white"] i {
    color: #ffffff;
    text-shadow: 0 0 1px #333;
}

.bg-btn[data-bg="gray"] i {
    color: #9e9e9e;
}

.bg-btn[data-bg="black"] i {
    color: #333;
}

.preview-area {
    min-height: 150px;
    padding: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.preview-area[data-bg="white"] {
    background: #ffffff;
    border: 2px solid #e0e0e0;
}

.preview-area[data-bg="gray"] {
    background: #f5f5f5;
    border: 2px solid #d0d0d0;
}

.preview-area[data-bg="black"] {
    background: #1a1a1a;
    border: 2px solid #333;
}

.preview-text {
    font-size: 24px;
    line-height: 1.6;
    word-wrap: break-word;
    text-align: center;
}

/* 输出区域 */
.output-section {
    margin-bottom: 30px;
    position: relative;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.output-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.output-actions {
    display: flex;
    gap: 10px;
}

.html-output {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    resize: vertical;
    line-height: 1.6;
}

.html-output:focus {
    outline: none;
    border-color: #3498db;
}

.copy-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: #28a745;
    color: white;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.copy-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .mode-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .color-picker-group {
        flex-direction: column;
        gap: 15px;
    }

    .preview-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .output-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .output-actions {
        width: 100%;
        flex-direction: column;
    }

    .output-actions .btn {
        width: 100%;
    }

    .preview-text {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .mode-grid {
        grid-template-columns: 1fr;
    }

    .render-mode-group {
        flex-direction: column;
        gap: 15px;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .preview-area {
        padding: 20px;
    }

    .copy-toast {
        right: 10px;
        top: 10px;
        padding: 12px 20px;
        font-size: 14px;
    }
}
