/* 确保整个页面使用 flex 布局 */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
}

/* 头部样式，悬浮置顶 */
header {
    background-color: #3f51b5;
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

h1 {
    margin: 0;
    font-size: 28px;
    font-weight: bold;
    text-align: center;
}

.header-subtitle {
    margin: 8px 0 0 0;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    font-weight: normal;
}

/* 颜色生成器卡片样式 */
.generator-card {
    margin: 40px auto;
    width: 95%;
    max-width: 800px;
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

/* 颜色显示区域 */
.color-display {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    align-items: center;
}

.color-preview {
    width: 200px;
    height: 200px;
    border-radius: 10px;
    border: 2px solid #ddd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: #FF5722;
    flex-shrink: 0;
}

.color-info {
    flex: 1;
}

.color-values {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.color-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-value label {
    font-weight: bold;
    width: 40px;
    color: #333;
}

.color-value input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: monospace;
    font-size: 14px;
    background-color: #f9f9f9;
}

.copy-btn {
    background: #4caf50;
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

.copy-btn:hover {
    background: #45a049;
}

/* 自定义设置区域 */
.customize-section {
    margin: 30px 0;
}

.customize-section h2 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

.customize-section h3 {
    font-size: 16px;
    margin: 20px 0 10px 0;
    color: #555;
}

/* 生成选项 */
.generation-options {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.generate-btn {
    padding: 12px 24px;
    font-size: 16px;
    background-color: #ff5722;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.generate-btn:hover {
    background-color: #e64a19;
}

.generate-btn.secondary {
    background-color: #2196f3;
}

.generate-btn.secondary:hover {
    background-color: #1976d2;
}

/* 手动输入 */
.manual-input {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.input-methods {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.input-group {
    flex: 1;
    min-width: 200px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.input-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.input-group input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
}

/* RGB 滑块 */
.rgb-sliders {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.slider-group {
    margin-bottom: 15px;
}

.slider-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.slider-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff5722;
    cursor: pointer;
}

.slider-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff5722;
    cursor: pointer;
    border: none;
}

/* 调色板部分 */
.palette-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.palette-section h3 {
    margin-top: 0;
    color: #333;
}

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

.palette-color {
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.palette-color:hover {
    transform: translateY(-2px);
}

.palette-color-preview {
    height: 80px;
    width: 100%;
}

.palette-color-info {
    padding: 10px;
    background: white;
    font-size: 12px;
    color: #666;
}

/* Use Cases Section */
.use-cases {
    margin: 40px auto;
    width: 90%;
    max-width: 1200px;
}

.use-cases h2 {
    font-size: 22px;
    margin-bottom: 30px;
    text-align: center;
    color: #333;
}

.use-case-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 1200px) {
    .use-case-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .use-case-grid {
        grid-template-columns: 1fr;
    }
    
    .color-display {
        flex-direction: column;
        gap: 20px;
    }
    
    .color-preview {
        width: 100%;
        height: 150px;
    }
    
    .input-methods {
        flex-direction: column;
    }
    
    .generation-options {
        flex-direction: column;
    }
}

.use-case-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #3f51b5;
}

.use-case-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #3f51b5;
}

.use-case-card p {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    margin: 0;
}

/* FAQ 样式 */
.faq {
    margin: 40px auto;
    width: 90%;
    max-width: 700px;
}

.faq h2 {
    font-size: 22px;
    margin-bottom: 20px;
}

.qa-question {
    font-weight: bold;
    font-size: 18px;
}

.qa-answer {
    font-size: 16px;
    line-height: 1.6;
}

.qa {
    margin-bottom: 20px;
}

/* 页脚样式 */
footer {
    padding: 10px;
    background-color: #e0e0e0;
    color: #666666;
    font-size: 12px;
    text-align: center;
    width: 100%;
    position: relative;
    bottom: 0;
}

footer p {
    margin: 5px 0;
    opacity: 0.7;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 300px;
    word-wrap: break-word;
}

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

.toast-success {
    background-color: #4caf50;
}

.toast-error {
    background-color: #f44336;
}

.toast-warning {
    background-color: #ff9800;
}

/* Related Tools Section */
.related-tools {
    margin: 60px auto;
    width: 95%;
    max-width: 1200px;
    padding: 0 20px;
}

.related-tools h2 {
    text-align: center;
    color: #333;
    margin-bottom: 40px;
    font-size: 28px;
    font-weight: 600;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.tool-card {
    background: white;
    border-radius: 12px;
    padding: 30px 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border-color: #3f51b5;
}

.tool-icon {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
}

.tool-card h3 {
    color: #333;
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 600;
}

.tool-card p {
    color: #666;
    line-height: 1.6;
    margin: 0 0 25px 0;
    font-size: 14px;
}

.tool-link {
    display: inline-block;
    background: linear-gradient(135deg, #3f51b5, #5c6bc0);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.tool-link:hover {
    background: linear-gradient(135deg, #303f9f, #3f51b5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(63, 81, 181, 0.3);
}

/* Responsive design for related tools */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .tool-card {
        padding: 25px 20px;
    }
    
    .related-tools {
        margin: 40px auto;
    }
    
    .related-tools h2 {
        font-size: 24px;
        margin-bottom: 30px;
    }
}