* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.input-section {
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.input-group label {
    font-weight: 600;
    color: #555;
    min-width: 80px;
    font-size: 1.1rem;
}

.input-group input,
.input-group select {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

#queryBtn {
    flex: 1;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.today-btn {
    padding: 15px 25px;
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#queryBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

#queryBtn:active {
    transform: translateY(0);
}

.today-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(78, 205, 196, 0.3);
}

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

.result-section {
    margin-top: 30px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-align: center;
}

.result-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid #dee2e6;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 1.1rem;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin: 10px -15px;
    padding: 15px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 1.2rem;
}

.result-item.highlight .label {
    color: rgba(255,255,255,0.9);
}

.result-item .label {
    font-weight: 600;
    color: #555;
}

.result-item .value {
    color: #333;
    font-weight: 500;
}

.result-item.highlight .value {
    color: white;
    font-size: 1.3rem;
}

footer {
    text-align: center;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

/* 输入框与按钮组合样式 */
.input-with-buttons {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 8px;
}

.adjust-btn {
    width: 44px;
    height: 44px;
    border: 2px solid #e1e5e9;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    color: #4a5568;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.adjust-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.3);
}

.adjust-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.adjust-btn:disabled {
    background: #f1f3f4;
    color: #9aa0a6;
    border-color: #dadce0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.adjust-btn:disabled:hover {
    background: #f1f3f4;
    color: #9aa0a6;
    border-color: #dadce0;
    transform: none;
    box-shadow: none;
}

.input-with-buttons input,
.input-with-buttons select {
    margin: 0;
    flex: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 20px;
    }
    
    .input-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .input-group label {
        min-width: auto;
    }
    
    .input-group input,
    .input-group select {
        width: 100%;
    }
    
    .input-with-buttons {
        width: 100%;
    }
    
    .adjust-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .result-item.highlight {
        text-align: center;
    }
    
    .button-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .today-btn {
        width: 100%;
        padding: 12px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 穿衣推荐推导过程样式 */
.dress-analysis-section {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
    border-radius: 12px;
    border: 1px solid #e1e8ff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.dress-analysis-section h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.5em;
    border-bottom: 3px solid #667eea;
    padding-bottom: 12px;
}

.analysis-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}

.step h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
    border-bottom: 2px solid #e1e8ff;
    padding-bottom: 8px;
}

.step p {
    margin: 8px 0;
    color: #34495e;
    font-size: 0.95em;
    line-height: 1.5;
}

.wuxing-relations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.relation-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.wuxing-name {
    font-weight: bold;
    color: #2c3e50;
    font-size: 0.9em;
}

.relation-type {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.level-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.level-auspicious {
    background: #e8f5e8;
    color: #2e7d32;
}

.level-neutral {
    background: #fff3e0;
    color: #f57c00;
}

.level-unfavorable {
    background: #ffebee;
    color: #c62828;
}

.level-avoid {
    background: #f3e5f5;
    color: #7b1fa2;
}

.color-list {
    color: #666;
    font-size: 0.85em;
    font-style: italic;
}

.relation-description {
    color: #888;
    font-size: 0.8em;
    font-style: italic;
    margin-top: 4px;
    line-height: 1.3;
}

/* 新增样式 - 推理过程优化 */
.relation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.relation-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    flex-wrap: wrap;
    gap: 8px;
}

.score-info {
    display: flex;
    gap: 8px;
    font-size: 0.8em;
}

.final-score {
    color: #2c3e50;
    font-weight: 500;
}

.seasonal-adj {
    color: #7b1fa2;
    font-weight: 500;
}

.ten-gods-analysis {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.ten-god-item {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.seasonal-adjustment {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.adjustment-item {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.strength-explanation,
.use-god-explanation,
.algorithm-info {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 8px;
    border-left: 3px solid #667eea;
}

.strength-explanation p,
.use-god-explanation p,
.algorithm-info p {
    margin: 0;
    font-size: 0.85em;
    color: #666;
}

.recommendation-summary {
    background: #f0f8ff;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #b3d9ff;
}

.recommendation-summary p {
    margin: 10px 0;
    font-size: 0.95em;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .dress-analysis-section {
        margin-top: 20px;
        padding: 15px;
    }
    
    .dress-analysis-section h3 {
        font-size: 1.3em;
    }
    
    .step {
        padding: 15px;
    }
    
    .step h4 {
        font-size: 1.1em;
    }
    
    .wuxing-relations {
        grid-template-columns: 1fr;
    }
    
    .relation-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* 五行穿衣指南样式 - 卡片式布局 */
.dress-guide-section {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
    border-radius: 12px;
    border: 1px solid #e1e8ff;
}

.dress-guide-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.4em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.analysis-info {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.analysis-info p {
    margin: 8px 0;
    color: #34495e;
    font-size: 0.95em;
}

/* 卡片容器 - 长条布局 */
.color-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

/* 单个颜色卡片 - 简洁底板设计 */
.color-card {
    border-radius: 8px;
    padding: 16px 20px;
    overflow: hidden;
    height: auto;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    position: relative;
    align-items: stretch;
}

/* 卡片内容 - 简洁布局 */
.card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    height: 100%;
}

/* 等级标题 */
.level-title {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 4px;
}

/* 五行颜色信息 - 简洁布局 */
.wuxing-color {
    margin-bottom: 4px;
}

.wuxing-name {
    font-weight: bold;
    font-size: 1em;
}

.color-list {
    font-weight: 500;
    font-size: 0.95em;
}

/* 颜色描述 - 简洁风格 */
.color-description {
    font-size: 0.85em;
    opacity: 0.9;
    font-style: italic;
    line-height: 1.3;
}

/* 响应式设计 - 简洁布局 */
@media (max-width: 768px) {
    .dress-guide-section {
        margin-top: 20px;
        padding: 15px;
    }
    
    .color-cards {
        gap: 10px;
    }
    
    .color-card {
        padding: 12px 16px;
        min-height: 70px;
    }
    
    .level-title {
        font-size: 1em;
    }
    
    .wuxing-name {
        font-size: 0.9em;
    }
    
    .color-list {
        font-size: 0.9em;
    }
    
    .color-description {
        font-size: 0.8em;
    }
}
