/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #2d3748;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
}

.header h1 {
    font-size: 2.5rem;
    color: #2d5a27;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    color: #68d391;
    font-weight: 400;
}

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

/* 输入区域 */
.input-section {
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(45, 90, 39, 0.1);
    border: 1px solid rgba(104, 211, 145, 0.2);
}

.color-input-group {
    margin-bottom: 20px;
}

.color-input-group label,
.format-select label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d5a27;
    font-size: 0.95rem;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

#colorInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

#colorInput:focus {
    outline: none;
    border-color: #68d391;
    box-shadow: 0 0 0 3px rgba(104, 211, 145, 0.1);
}

#colorPicker {
    width: 50px;
    height: 44px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

.format-select {
    margin-bottom: 25px;
}

#formatSelect {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

#formatSelect:focus {
    outline: none;
    border-color: #68d391;
    box-shadow: 0 0 0 3px rgba(104, 211, 145, 0.1);
}

.generate-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #48bb78, #68d391);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.generate-btn:hover {
    background: linear-gradient(135deg, #38a169, #48bb78);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
}

/* 结果区域 */
.result-section {
    min-height: 200px;
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #68d391;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #68d391;
    font-weight: 500;
}

/* 颜色信息 */
.color-info {
    background: rgba(255, 255, 255, 0.9);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(45, 90, 39, 0.1);
    border: 1px solid rgba(104, 211, 145, 0.2);
}

.color-info h3 {
    color: #2d5a27;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.color-preview {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 2px solid rgba(104, 211, 145, 0.3);
}

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

.color-detail {
    text-align: center;
    padding: 10px;
    background: rgba(104, 211, 145, 0.1);
    border-radius: 6px;
}

.color-detail strong {
    display: block;
    color: #2d5a27;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.color-detail span {
    color: #4a5568;
    font-size: 0.95rem;
}

/* 配色方案容器 */
.palettes-container {
    display: grid;
    gap: 25px;
}

.palette {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(45, 90, 39, 0.1);
    border: 1px solid rgba(104, 211, 145, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.palette:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(45, 90, 39, 0.15);
}

.palette-header {
    margin-bottom: 20px;
}

.palette-name {
    font-size: 1.4rem;
    color: #2d5a27;
    margin-bottom: 8px;
    font-weight: 600;
}

.palette-description {
    color: #68d391;
    font-size: 0.95rem;
    line-height: 1.5;
}

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

.color-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(104, 211, 145, 0.2);
    transition: all 0.3s ease;
}

.color-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 90, 39, 0.1);
}

.color-swatch {
    width: 100%;
    height: 50px;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.color-swatch::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 45%, rgba(255,255,255,0.1) 50%, transparent 55%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.color-name {
    font-weight: 600;
    color: #2d5a27;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.color-hex {
    font-family: 'Courier New', monospace;
    color: #4a5568;
    font-size: 0.85rem;
    margin-bottom: 3px;
}

.color-role {
    font-size: 0.8rem;
    color: #68d391;
    font-style: italic;
}

/* 底部 */
.footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
    color: #68d391;
    font-size: 0.9rem;
}

/* 平板端适配 */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2.2rem;
    }
    
    .colors-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

/* 手机端适配 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        margin-bottom: 25px;
        padding: 20px 0;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .input-section {
        padding: 20px;
    }
    
    .input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    #colorPicker {
        width: 100%;
        height: 44px;
    }
    
    .colors-grid {
        grid-template-columns: 1fr;
    }
    
    .color-details {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .palette {
        padding: 20px;
    }
    
    .palette-name {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.6rem;
    }
    
    .input-section {
        padding: 15px;
    }
    
    .palette {
        padding: 15px;
    }
    
    .color-details {
        grid-template-columns: 1fr;
    }
}