/* 消费帮扶模式智能推荐系统样式 - 横版布局 */

.logos-row img[alt="gqt"] {
    display: none !important;
}

.logos-row img[alt="zufe"] {
    height: 48px !important;
    width: auto !important;
    margin-top: 2px;
}

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

body {
    font-family: 'Microsoft YaHei', 'SimHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #FCF4F5;
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

header h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin: 0;
    font-weight: bold;
    flex: 1;
    min-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logo-left {
    height: 60px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo-left:hover {
    transform: scale(1.05);
}

/* 主要修改：横版三列等宽布局 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    align-items: stretch;
    min-height: 700px;
}

/* 输入参数区域 - 左侧列 */
.input-params-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 600px;
}

.input-params-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
    border-bottom: 3px solid #e74c3c;
    padding-bottom: 10px;
    text-align: left;
}

.params-container {
    height: 400px;
    overflow-y: auto;
    padding-right: 10px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
    flex: 1;
}

.params-container::-webkit-scrollbar {
    width: 8px;
}

.params-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.params-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.params-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.param-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.param-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
}

.param-item label {
    flex: 1;
    font-weight: 500;
    color: #2c3e50;
    margin-right: 10px;
    font-size: 0.9em;
    line-height: 1.3;
}

.param-item input {
    width: 100px;
    padding: 6px 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    transition: border-color 0.3s ease;
}

.param-item input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.param-item.city-input {
    background: #e8f4fd;
    border-color: #3498db;
}

.param-item.city-input input {
    width: 100px;
}

.form-submit {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

#predictBtn {
    width: 180px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

#predictBtn:hover:not(:disabled) {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

#predictBtn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.hidden {
    display: none;
}

/* 结果显示区域 - 中间列 */
.result-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 600px;
}

.result-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
    border-bottom: 3px solid #e74c3c;
    padding-bottom: 10px;
    text-align: center;
}

.recommendation {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.recommendation-content {
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.recommendation-content h3 {
    color: #2c3e50;
    font-size: 1.1em;
    margin-bottom: 12px;
    font-weight: bold;
}

.recommendation-content.default-mode h3 {
    color: #7f8c8d;
}

.recommendation-content .mode-name {
    color: #34495e;
    font-size: 1.1em;
    font-weight: 500;
    margin-bottom: 15px;
    padding: 10px 16px;
    background: #ecf0f1;
    border-radius: 20px;
    display: inline-block;
}

.recommendation-content .rating-display {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.stars {
    color: #f39c12;
    font-size: 1.1em;
    font-weight: bold;
    letter-spacing: 1px;
}

/* AI推荐理由区域 - 右侧列 */
.ai-reason-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 600px;
}

.ai-reason-card h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
    border-bottom: 3px solid #e74c3c;
    padding-bottom: 10px;
    text-align: center;
}

.ai-reason-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.reason-content {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-y: auto;
}

.reason-content p {
    margin: 0;
    line-height: 1.6;
    color: #2c3e50;
    font-size: 0.95em;
}

.reason-content .default-text {
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
}

.reason-content .loading-text {
    color: #3498db;
    font-weight: 500;
    text-align: center;
}

.reason-content .reason-text {
    color: #2c3e50;
    font-size: 0.95em;
    text-align: justify;
    line-height: 2;
}

.reason-content .error-text {
    color: #e74c3c;
    font-weight: 500;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 15px;
    }

    .main-content {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto 1fr;
        gap: 20px;
        align-items: stretch;
        min-height: 700px;
    }

    .input-params-section {
        grid-column: 1 / -1;
        margin-bottom: 10px;
        height: auto;
        min-height: auto;
    }

    .result-section {
        grid-column: 1;
        height: 100%;
    }

    .ai-reason-card {
        grid-column: 2;
        height: 100%;
    }
}

/* 大屏手机适配 (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {

    /* 布局调整 */
    .main-content {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto 1fr;
        gap: 18px;
        align-items: stretch;
        min-height: 650px;
    }

    /* 输入区域横跨顶部 */
    .input-params-section {
        grid-column: 1 / -1;
        margin-bottom: 15px;
        height: auto;
        min-height: auto;
        padding: 20px;
    }

    /* 结果显示区域 - 左列 */
    .result-section {
        grid-column: 1;
        height: 100%;
        padding: 22px;
        min-height: 500px;
    }

    /* AI推荐理由区域 - 右列 */
    .ai-reason-card {
        grid-column: 2;
        height: 100%;
        padding: 22px;
        min-height: 500px;
    }

    /* 容器和头部优化 */
    .container {
        padding: 15px;
        max-width: 100%;
    }

    header h1 {
        font-size: 2.2em;
        min-width: auto;
        flex: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-content {
        flex-direction: column;
        gap: 12px;
    }

    .logo-left {
        height: 52px;
    }

    /* 输入参数优化 */
    .params-container {
        height: 280px;
        padding-right: 8px;
    }

    .param-item {
        flex-direction: row;
        align-items: center;
        padding: 10px 12px;
        margin-bottom: 10px;
    }

    .param-item label {
        margin-bottom: 0;
        margin-right: 10px;
        font-size: 0.9em;
        flex: 1;
    }

    .param-item input {
        width: 120px;
        padding: 8px 10px;
        font-size: 0.9em;
    }

    .param-item.city-input input {
        width: 120px;
    }

    /* 按钮优化 */
    #predictBtn {
        width: 160px;
        padding: 12px 20px;
        font-size: 1em;
        min-height: 44px;
    }

    /* 内容区域优化 */
    .recommendation-content {
        padding: 18px;
    }

    .recommendation-content h3 {
        font-size: 1.1em;
    }

    .recommendation-content .mode-name {
        font-size: 1em;
        padding: 10px 18px;
    }

    .reason-content {
        padding: 0;
    }

    .reason-content .reason-text {
        font-size: 0.9em;
        line-height: 1.8;
    }

    /* 触摸优化 */
    input[type="number"],
    input[type="text"] {
        font-size: 16px !important;
        min-height: 44px;
    }

    /* 卡片标题优化 */
    .input-params-section h2,
    .result-section h2,
    .ai-reason-card h2 {
        font-size: 1.2em;
        margin-bottom: 18px;
    }
}

/* 多 Logo 横排容器 */
.logos-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.logos-row img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

/* 让标题在页头水平居中（不受左侧 Logos 影响） */
.header-content {
    position: relative;
}

.header-content h1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    flex: none;
    min-width: auto;
    width: max-content;
}

/* 将 Logos 固定在左侧 */
.header-content {
    justify-content: flex-start;
}

.header-content .logos-row {
    justify-content: flex-start;
    margin-right: auto;
}

@media (max-width: 480px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5em;
        min-width: auto;
        flex: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .logo-left {
        height: 50px;
    }

    .input-params-section,
    .result-section,
    .ai-reason-card {
        padding: 20px;
    }

    .params-container {
        height: 300px;
        padding-right: 5px;
    }

    .param-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }

    .param-item label {
        margin-bottom: 8px;
        margin-right: 0;
        font-size: 0.9em;
    }

    .param-item input {
        width: 100%;
        max-width: 150px;
    }

    .param-item.city-input input {
        width: 100%;
        max-width: 150px;
    }

    #predictBtn {
        width: 100%;
        max-width: 200px;
    }

    .recommendation-content {
        padding: 15px;
    }

    .recommendation-content h3 {
        font-size: 1.1em;
    }

    .recommendation-content .mode-name {
        font-size: 1em;
        padding: 8px 16px;
    }

    .reason-content {
        padding: 0;
    }

    .reason-content .reason-text {
        font-size: 0.9em;
        line-height: 2;
    }

    .input-params-section h2,
    .result-section h2 {
        font-size: 1.1em;
    }

    .ai-reason-card h2 {
        font-size: 1.1em;
    }
}