/* style.css - 最终版 (已彻底重写适配) */

@keyframes pulseAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #e3f2ff;
    padding-bottom: 60px; /* 为固定的 footer 留出空间 */
}

#app-root {
    max-width: 800px;
    min-height: 100vh;
    margin: 0 auto;
    background: url('image/bb.gif') no-repeat top center;
    background-size: 100% auto;
    box-sizing: border-box;
    /* 核心：使用 vw (视口宽度) 单位，让顶部间距随屏幕宽度缩放 */
    padding-top: 40vw;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 40px;
}

.main-content-wrapper {
    position: relative;
    text-align: center;
    margin-top: 50px;
}

.title-section {
    background: url('image/t_bg.png') no-repeat center center;
    background-size: 100% 100%;
    color: #0d47a1;
    padding: 15px 10px;
    font-size: 1.2em;
    font-weight: bold;
    text-shadow: none;
    margin-bottom: -2px;
    width: 75%;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 2;
}

.content-box {
    background: url('image/content_step3.png') no-repeat center center;
    background-size: 100% 100%;
    padding: 40px;
    box-sizing: border-box;
    width: 75%;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

.content-box h2 { color: #0d47a1; font-size: 1.8em; margin-top: 0; margin-bottom: 20px; }
.content-box p { font-size: 1.1em; line-height: 1.6; margin-bottom: 0; color: #1565c0; }

.interactive-area { display: flex; flex-direction: column; align-items: center; gap: 15px; margin-top: 5px; }

#stockInput {
    width: 80%;
    max-width: 480px;
    padding: 15px 20px;
    border: 2px solid #007bff;
    border-radius: 50px;
    font-size: 1.1em;
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
}
#stockInput::placeholder { text-align: center; color: #aaa; }

#analyzeButton, #getReportButton {
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    animation: pulseAnimation 2s ease-in-out infinite;
    width: 80%;
    max-width: 480px;
    padding: 15px 20px;
    font-size: 1.2em;
    box-sizing: border-box;
}
#analyzeButton { background-color: #007bff; box-shadow: 0 4px 10px rgba(0, 123, 255, 0.4); }
#getReportButton { background-color: #1DA1F2; box-shadow: 0 6px 15px rgba(29, 161, 242, 0.5); white-space: nowrap; }
#analyzeButton:hover, #getReportButton:hover { animation-play-state: paused; transform: scale(1.05); }
#analyzeButton:hover { background-color: #0056b3; }
#getReportButton:hover { background-color: #1A8CD8; }

footer { position: fixed; bottom: 0; left: 0; width: 100%; background-color: #007bff; color: white; text-align: center; padding: 15px 0; z-index: 100; font-size: 0.9em; }
footer a { color: white; text-decoration: none; margin: 0 10px; }
footer a:hover { text-decoration: underline; }

.result-content-box h2 { color: #0d47a1; }
.result-content-box p { color: #1565c0; }

.loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); display: none; justify-content: center; align-items: center; z-index: 999; }
.loading-message { background-color: white; border-radius: 10px; padding: 30px 40px; width: 90%; max-width: 450px; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2); text-align: center; }
.loading-message p { font-size: 1.6em; color: #007bff; margin-bottom: 25px; font-weight: bold; }
.progress-item { display: flex; align-items: center; margin-bottom: 15px; font-size: 1.1em; color: #495057; }
.progress-item .progress-text { flex-basis: 120px; text-align: left; margin-right: 15px; }
.progress-bar-container { flex-grow: 1; height: 12px; background-color: #e9ecef; border-radius: 6px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background-color: #28a745; border-radius: 6px; transition: width 0.4s cubic-bezier(0.25, 0.1, 0.25, 1); }
.check-icon { margin-left: 10px; color: #28a745; font-size: 1.3em; visibility: hidden; opacity: 0; transition: opacity 0.3s ease; }
.check-icon.visible { visibility: visible; opacity: 1; }
.check-icon::before { content: '✓'; }
.custom-alert-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); display: none; justify-content: center; align-items: center; z-index: 1000; }
.custom-alert-box { background-color: white; border-radius: 15px; padding: 25px; text-align: center; box-shadow: 0 4px 15px rgba(0,0,0,0.2); width: 90%; max-width: 400px; }
.custom-alert-box .message { font-size: 1.1em; color: #333; margin-bottom: 25px; font-weight: 500;}
.custom-alert-box button { background-color: #28a745; color: white; border: none; border-radius: 10px; padding: 12px 40px; cursor: pointer; font-size: 1.1em; font-weight: bold; }
.custom-alert-box button:hover { background-color: #218838; }


/* --- 核心：彻底重写的手机适配代码 --- */
@media (max-width: 768px) {
    #app-root {
        /* 使用更灵活的vw单位调整顶部间距 */
        padding-top: 55vw;
        padding-left: 5vw;
        padding-right: 5vw;
    }

    .main-content-wrapper {
        margin-top: 5vw; /* 间距也使用相对单位 */
    }

    /* 放大内容框，使其在手机上更易读 */
    .title-section, .content-box {
        width: 95%; /* 宽度占满，更适合手机 */
    }
    
    .content-box {
        padding: 6vw 5vw; /* 内边距也使用相对单位 */
    }

    /* 调整字体大小，使用em单位，相对于父元素字体大小 */
    .content-box h2 {
        font-size: 1.6em;
    }
    .content-box p {
        font-size: 1em;
        line-height: 1.5; /* 调整行高 */
    }
    .title-section {
        font-size: 1.1em;
        padding: 12px 10px;
    }

    /* 调整输入框和按钮的大小 */
    #stockInput, #analyzeButton, #getReportButton {
        width: 95%; /* 宽度占满 */
        padding: 14px 15px;
        font-size: 1.1em;
    }

    #getReportButton {
        /* 允许文字在小屏幕上换行 */
        white-space: normal;
    }
    
    footer {
        padding: 10px 0;
        font-size: 0.8em;
    }
}