/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: white;
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.color-picker-section,
.results-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.color-picker-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

/* 颜色选择器包装器 */
.color-picker-wrapper {
    position: relative;
    display: inline-block;
    width: 120px;
    height: 90px;
}

/* 颜色选择器标签样式 */
.color-picker-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    border: 2px solid transparent;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.color-picker-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.color-picker-label:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.picker-icon {
    font-size: 24px;
    display: block;
}

.picker-text {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

/* 颜色选择器样式 */
#colorPicker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    margin: 0;
    padding: 0;
    border: none;
}

.selected-color {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.color-preview {
    width: 100px;
    height: 60px;
    border-radius: 10px;
    border: 2px solid #ddd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.color-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.name-input-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.input-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.name-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.name-input:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.color-recommendation {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    transition: all 0.3s ease;
}

.color-recommendation .prediction-rank {
    background: #ff6b6b;
    color: white;
    padding: 4px 8px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    margin-right: 10px;
}

.color-recommendation:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.color-preview-small {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid #ddd;
}

.color-info-small {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.results-container {
    min-height: 200px;
}

.placeholder {
    color: #999;
    font-style: italic;
    text-align: center;
    margin-top: 80px;
}

.prediction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.prediction-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.prediction-rank {
    background: #ff6b6b;
    color: white;
    padding: 4px 8px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    margin-right: 10px;
}

.prediction-name {
    font-weight: 600;
    color: #333;
    flex: 1;
}

.prediction-score {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.examples-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.example-colors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.example-color {
    height: 80px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.example-color:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.loading {
    text-align: center;
    color: #667eea;
    font-style: italic;
}

.error {
    color: #dc3545;
    text-align: center;
    padding: 20px;
    background: #f8d7da;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .container {
        padding: 10px;
    }

    h1 {
        font-size: 2rem;
    }

    .color-picker-container {
        flex-direction: column;
        align-items: center;
    }
    
    .color-picker-wrapper {
        width: 100px;
        height: 80px;
    }
    
    .color-picker-label {
        padding: 12px 16px;
    }
    
    .picker-text {
        font-size: 11px;
    }
}

/* RGB输入容器样式 */
.rgb-input-container {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.rgb-input-container h3 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 1rem;
}

.rgb-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.rgb-text-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
}

.rgb-text-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.rgb-text-input::placeholder {
    color: #6c757d;
    font-style: italic;
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.8rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-small:hover {
    background: #5a6268;
}

.rgb-input-help {
    color: #6c757d;
    font-size: 0.8rem;
}

/* 快速生成标签样式 */
.generated-tag {
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
    margin-top: 2px;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}