/* 基础重置和变量 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --background-primary: #ffffff;
    --background-secondary: #f8f9fa;
    --border-color: #e9ecef;
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    margin-top: 40px;
    background: var(--background-primary);
    padding: 40px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.header h1 i {
    color: var(--secondary-color);
    margin-right: 12px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* 主要内容区域 */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 输入区域样式 */
.input-section {
    background: var(--background-primary);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.color-inputs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.color-input-group {
    max-width: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.color-input-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.color-picker-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
}

.color-picker-wrapper input[type="color"] {
    width: 60px;
    height: 50px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.color-picker-wrapper input[type="color"]:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-light);
}

.color-picker-wrapper input[type="text"] {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    transition: var(--transition);
}

.color-picker-wrapper input[type="text"]:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 图片颜色提取区域样式 */
.image-color-section {
    background: var(--background-primary);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    margin-bottom: 30px;
}

.image-color-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-upload-area {
    width: 100%;
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--background-secondary);
}

.upload-zone:hover {
    border-color: var(--secondary-color);
    background: rgba(52, 152, 219, 0.05);
}

.upload-zone.dragover {
    border-color: var(--secondary-color);
    background: rgba(52, 152, 219, 0.1);
    transform: scale(1.02);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.upload-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.image-preview-container {
    margin-top: 20px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.image-preview-header {
    background: var(--background-secondary);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.clear-image-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.clear-image-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

#image-canvas {
    display: block;
    max-width: 100%;
    width: 100%;
    cursor: crosshair;
    background: white;
}

.control-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.generate-btn,
.random-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.generate-btn {
    background: var(--secondary-color);
    color: white;
}

.generate-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.random-btn {
    background: var(--warning-color);
    color: white;
}

.random-btn:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* 配色方案展示区域 */
.schemes-section {
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
}

.schemes-section.show {
    opacity: 1;
    transform: translateY(0);
}

.scheme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
}

.scheme-card {
    background: var(--background-primary);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.scheme-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.scheme-header h3 {
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.scheme-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.6;
    text-align: left;
}

.scheme-description strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* 配色方案演示图 */
.scheme-illustration {
    margin: 16px 0;
    display: flex;
    justify-content: center;
}

.color-wheel-demo {
    width: 80px;
    height: 80px;
    position: relative;
    margin: 0 auto;
}

/* 色环基础样式 */
.color-wheel-demo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        hsl(0, 70%, 60%),
        hsl(30, 70%, 60%),
        hsl(60, 70%, 60%),
        hsl(90, 70%, 60%),
        hsl(120, 70%, 60%),
        hsl(150, 70%, 60%),
        hsl(180, 70%, 60%),
        hsl(210, 70%, 60%),
        hsl(240, 70%, 60%),
        hsl(270, 70%, 60%),
        hsl(300, 70%, 60%),
        hsl(330, 70%, 60%),
        hsl(360, 70%, 60%)
    );
    z-index: 1;
}

/* 内部白色圆圈 */
.color-wheel-demo::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 50%;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    border: 1px solid var(--border-color);
}

/* 颜色点标记 */
.color-point {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
    z-index: 3;
}

/* SVG 连接线容器（动态生成） */
.color-wheel-demo svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* 不同配色方案的特殊样式 */
.monochromatic-demo .color-point {
    background: #3498db;
}

.analogous-demo .color-point:nth-child(2) { background: #3498db; }
.analogous-demo .color-point:nth-child(3) { background: #5dade2; }
.analogous-demo .color-point:nth-child(4) { background: #85c1e9; }

.complementary-demo .color-point:nth-child(2) { background: #3498db; }
.complementary-demo .color-point:nth-child(3) { background: #e67e22; }

.split-complementary-demo .color-point:nth-child(2) { background: #3498db; }
.split-complementary-demo .color-point:nth-child(3) { background: #e74c3c; }
.split-complementary-demo .color-point:nth-child(4) { background: #f39c12; }

.triadic-demo .color-point:nth-child(2) { background: #3498db; }
.triadic-demo .color-point:nth-child(3) { background: #e74c3c; }
.triadic-demo .color-point:nth-child(4) { background: #f1c40f; }

.square-demo .color-point:nth-child(2) { background: #3498db; }
.square-demo .color-point:nth-child(3) { background: #e74c3c; }
.square-demo .color-point:nth-child(4) { background: #f39c12; }
.square-demo .color-point:nth-child(5) { background: #27ae60; }

.tetradic-demo .color-point:nth-child(2) { background: #3498db; }
.tetradic-demo .color-point:nth-child(3) { background: #e74c3c; }
.tetradic-demo .color-point:nth-child(4) { background: #f39c12; }
.tetradic-demo .color-point:nth-child(5) { background: #27ae60; }

.color-palette {
    display: flex;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow-light);
}

.color-swatch {
    flex: 1;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.color-swatch:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: var(--shadow-medium);
}

.color-swatch::after {
    content: attr(data-color);
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    opacity: 0;
    transition: var(--transition);
    font-family: 'Courier New', monospace;
}

.color-swatch:hover::after {
    opacity: 1;
}

.palette-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.copy-palette-btn,
.download-palette-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
}

.copy-palette-btn {
    background: var(--success-color);
    color: white;
}

.copy-palette-btn:hover {
    background: #219a52;
    transform: translateY(-1px);
}

.download-palette-btn {
    background: var(--secondary-color);
    color: white;
}

.download-palette-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* 颜色信息面板 */
.color-info-section {
    background: var(--background-primary);
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.color-info-card h3 {
    color: var(--primary-color);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.base-color-display {
    margin-bottom: 20px;
}

.base-color-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.base-color-bar {
    height: 30px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    box-shadow: var(--shadow-light);
    min-height: 30px;
    display: block;
}

.base-color-bar.has-color {
    border-color: rgba(0, 0, 0, 0.1);
}

.color-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.color-detail-item {
    padding: 16px;
    background: var(--background-secondary);
    border-radius: 8px;
    text-align: center;
}

.color-detail-item h4 {
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.color-detail-item p {
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 工具介绍区域 */
.tool-intro-section {
    background: var(--background-primary);
    margin: 40px 0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    overflow: hidden;
}

.intro-container {
    padding: 50px 40px;
}

.intro-header {
    text-align: center;
    margin-bottom: 50px;
}

.intro-header h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 700;
}

.intro-header h2 i {
    color: var(--secondary-color);
    margin-right: 15px;
}

.intro-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* 介绍卡片网格 */
.intro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.intro-card {
    background: var(--background-secondary);
    padding: 30px;
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    transition: var(--transition);
}

.intro-card:hover {
    border-color: var(--secondary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--secondary-color), #5dade2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.card-icon i {
    font-size: 1.5rem;
    color: white;
}

.intro-card h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.intro-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    color: var(--text-secondary);
    padding: 5px 0;
    position: relative;
    padding-left: 20px;
}

.feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

/* 适用场景 */
.use-cases-section {
    margin: 50px 0;
}

.use-cases-section h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-align: center;
}

.use-cases-section h3 i {
    color: var(--secondary-color);
    margin-right: 10px;
}

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.use-case {
    background: var(--background-secondary);
    padding: 25px;
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
}

.use-case:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-light);
}

.use-case-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: block;
}

.use-case h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.use-case p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* 技术特色 */
.tech-features-section {
    margin: 50px 0;
}

.tech-features-section h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-align: center;
}

.tech-features-section h3 i {
    color: var(--secondary-color);
    margin-right: 10px;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.tech-item {
    background: var(--background-secondary);
    padding: 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--secondary-color);
    transition: var(--transition);
}

.tech-item:hover {
    background: rgba(52, 152, 219, 0.05);
    transform: translateX(5px);
}

.tech-item strong {
    color: var(--primary-color);
    font-size: 1rem;
    display: block;
    margin-bottom: 8px;
}

.tech-item span {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* 统计数据 */
.stats-section {
    margin: 50px 0;
}

.stats-section h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-align: center;
}

.stats-section h3 i {
    color: var(--secondary-color);
    margin-right: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 30px;
}

.stat-item {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--secondary-color), #5dade2);
    border-radius: var(--border-radius);
    color: white;
    transition: var(--transition);
}

.stat-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
}

/* 页脚样式 */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    transform: translateX(100%);
    transition: var(--transition);
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    background: var(--accent-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .header {
        padding: 24px 16px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .color-inputs {
        padding: 0 20px;
    }
    
    .control-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .generate-btn,
    .random-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .scheme-grid {
        grid-template-columns: 1fr;
    }
    
    .color-details {
        grid-template-columns: 1fr;
    }
    
    .palette-actions {
        flex-direction: column;
    }
    
    .copy-palette-btn,
    .download-palette-btn {
        width: 100%;
    }
    
    .upload-zone {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .color-picker-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .color-picker-wrapper input[type="color"] {
        width: 100%;
        height: 60px;
    }
    
    .image-preview-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    #image-canvas {
        max-height: 250px;
        object-fit: contain;
    }
    
    /* 工具介绍区域移动端适配 */
    .intro-container {
        padding: 30px 20px;
    }
    
    .intro-header h2 {
        font-size: 2rem;
    }
    
    .intro-subtitle {
        font-size: 1rem;
    }
    
    .intro-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .intro-card {
        padding: 20px;
    }
    
    .use-cases-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .use-case {
        padding: 20px 15px;
    }
    
    .use-case-icon {
        font-size: 2rem;
    }
    
    .tech-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .stat-item {
        padding: 20px 15px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* 加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scheme-card {
    animation: fadeInUp 0.6s ease-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
} 