/* 全局样式重置 */
* {
    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;
    padding: 20px;
}

/* 主容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 头部区域样式 */
.header {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 30px;
    text-align: center;
}

/* 头部标题样式 */
.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* 头部描述文字样式 */
.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

/* 主要内容区域样式 */
.main-content {
    padding: 30px;
}

/* 上传区域样式 */
.upload-section {
    text-align: center;
    margin-bottom: 30px;
}

/* 上传区域框样式 */
.upload-area {
    border: 3px dashed #ddd;
    border-radius: 15px;
    padding: 40px;
    margin: 20px 0;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* 上传区域悬停效果 */
.upload-area:hover {
    border-color: #007bff;
    background: #e3f2fd;
}

/* 上传区域拖拽效果 */
.upload-area.dragover {
    border-color: #28a745;
    background: #d4edda;
}

/* 上传图标样式 */
.upload-icon {
    font-size: 4em;
    color: #6c757d;
    margin-bottom: 15px;
}

/* 上传文字提示样式 */
.upload-text {
    font-size: 1.2em;
    color: #6c757d;
    margin-bottom: 15px;
}

/* 隐藏的文件输入框 */
#fileInput {
    display: none;
}

/* 按钮通用样式 */
.btn {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

/* 按钮悬停效果 */
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

/* 按钮按下效果 */
.btn:active {
    transform: translateY(0);
}

/* 成功按钮样式 */
.btn-success {
    background: linear-gradient(45deg, #28a745, #1e7e34);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

/* 成功按钮悬停效果 */
.btn-success:hover {
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* 图片显示区域样式 */
.image-section {
    display: none;
    margin-bottom: 30px;
}

/* 图片容器样式 */
.image-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

/* 图片画布样式 */
#imageCanvas {
    max-width: 100%;
    height: auto;
    cursor: crosshair;
    display: block;
}

/* 图片操作提示样式 */
.image-tip {
    text-align: center;
    margin: 10px 0;
    padding: 10px;
    background-color: #e9f5ff;
    border-radius: 5px;
    color: #007bff;
    font-weight: 500;
}

/* 颜色信息区域样式 */
.color-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 颜色显示区域样式 */
.color-display {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

/* 颜色预览块样式 */
.color-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    border: 3px solid white;
}

/* 颜色值容器样式 */
.color-values {
    flex: 1;
}

/* 颜色值样式 */
.color-value {
    margin: 5px 0;
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
}

/* 色卡区域样式 */
.palette-section {
    margin-top: 30px;
}

/* 区域标题样式 */
.section-title {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

/* 色卡容器样式 */
.palette-container {
    display: flex;
    flex-wrap: wrap; /* 允许多行显示 */
    gap: 15px; /* 设置色卡之间的间距 */
    justify-content: center;
    margin-bottom: 20px;
    width: 100%;
    max-width: 1200px;
}

/* 色卡卡片样式 */
.color-card {
    width: calc(20% - 30px); /* 每行显示5个色卡，根据需要调整 */
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

/* 色卡悬停效果 */
.color-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* 色块样式 */
.color-swatch {
    height: 80px;
    position: relative;
}

/* 色卡信息文字样式 */
.color-info-text {
    padding: 10px;
    background: white;
    font-size: 0.8em;
    text-align: center;
    font-family: 'Courier New', monospace;
}

/* 复制区域样式 */
.copy-section {
    text-align: center;
    margin-top: 20px;
}

/* 通知提示框样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

/* 显示通知提示框 */
.notification.show {
    transform: translateX(0);
}

/* 响应式设计 - 移动端适配 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 10px;
    }

    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 2em;
    }

    .main-content {
        padding: 20px;
    }

    .color-card {
        width: 80px;
        height: 100px;
    }

    .color-swatch {
        height: 60px;
    }
}