
html, body {
    overflow: hidden !important; 
    height: 100% !important;
}

html {
    scroll-behavior: smooth;
}

body {
    padding-top: 0; 
}

.interactive-section {
    position: relative !important;
    width: 100% !important;
    height: 100vh;
    padding: 40px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    overflow: hidden;
}

/* --- 基础与字体规范 --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;700&display=swap');

:root {
    --main-red: #8b0000;
    --bg-beige: #fff8dc;
    --accent-pink: #EFB3B3;
    --border-brown: #9C7B58;
}

body {
    font-family: 'Noto Serif SC', serif;
    font-size: 16px;
    line-height: 1.8;
    background-color: var(--bg-beige);
    color: #333;
    margin: 0;
}

h1, h2, h3 {
    font-weight: 700;
}

h2 {
    font-size: 32px;
    color: var(--border-brown);
    border-bottom: 2px solid var(--border-brown);
    padding-bottom: 15px;
    margin-bottom: 30px; /* 减小一点边距 */
    flex-shrink: 0; 
}

p, label {
    margin-bottom: 15px; /* 减小一点边距 */
}

#ai-poetry {
    background-image: url('assets/images/bg_poetry.jpg');
}
#aigc-oracle {
    background-image: url('assets/images/bg_oracle.jpg');
}
#game-zone {
    background-image: url('assets/images/bg_game.jpg');
}


.content-wrapper {
    background-color: rgba(255, 248, 220, 0.9);
    padding: 40px;
    border-radius: 15px;
    border: 1px solid var(--border-brown);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    max-width: 900px;
    width: 100%;
    

    display: flex; 
    flex-direction: column; 

    max-height: calc(100vh - 80px); 
}

.result-box {
    /* flex-grow: 1; 让它占据所有剩余的垂直空间 */
    flex-grow: 1;

    overflow-y: auto;
    
    /* 其他美化样式 */
    padding: 20px;
    background-color: rgba(255, 253, 250, 0.8);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px; /* 给一个最小高度 */
}
/* ========== 【修复结束】 ========== */


#game-zone .content-wrapper {
    display: block;
    overflow-y: initial;
}


button {
    background-color: var(--main-red);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 25px;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    transition: background-color 0.3s, transform 0.2s;
    flex-shrink: 0;
}

button:hover {
    background-color: var(--accent-pink);
    color: var(--main-red);
    transform: translateY(-2px);
}

input[type="text"], select, textarea {
    padding: 12px;
    border: 1px solid var(--border-brown);
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    background-color: #fff;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

#poem-output, #oracle-output {
    white-space: pre-wrap;
    word-wrap: break-word;
    text-align: center;
    font-size: 1.2rem;
    line-height: 2;
    margin: 0;
    width: 100%;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    justify-content: center;
}

footer {
    text-align: center;
    padding: 40px;
    background-color: #3a2d21;
    color: var(--bg-beige);
}

.user-message, .ai-message {
    padding: 8px 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    max-width: 80%;
}
.user-message {
    background-color: #d1e7dd;
    margin-left: auto;
    text-align: right;
}
.ai-message {
    background-color: #f8d7da;
}
.game-card {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    display: block;
    text-decoration: none;
    max-width: 250px;
    margin: 0 auto;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.game-card img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}

.game-card:hover img {
    transform: scale(1.05);
}

.game-card .game-title {
    padding: 15px;
    font-weight: bold;
    font-size: 1.2rem;
    color: #333;
    text-align: center;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.game-card:hover .game-overlay {
    opacity: 1;
}
.game-overlay .game-title {
    color: white;
}

.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #bf5757;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* #chat-widget-container {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 1001;
}

#chat-toggle-btn {
    width: 150px;
    height: 150px;
    background-color: transparent;
    background-image: url('assets/images/chat_icon_lindaiyu.png'); 
    background-size: contain;
    background-repeat: no-repeat;
    cursor: pointer;
    border: none;
    border-radius: 0;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25));
    transition: transform 0.3s, filter 0.3s;
}

#chat-toggle-btn:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.3));
}

#chat-widget {
    width: 350px;
    height: 500px;
    background-color: var(--bg-beige);
    border: 2px solid var(--border-brown);
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 170px;
    right: 0;
    transition: opacity 0.3s, transform 0.3s;
    transform-origin: bottom right;
}

#chat-widget.hidden {
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
}

.chat-header {
    padding: 15px;
    background-color: rgba(156, 123, 88, 0.1);
    border-bottom: 1px solid var(--border-brown);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--main-red);
}

#chat-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--border-brown);
}

.chat-body {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
}

.chat-footer {
    padding: 15px;
    border-top: 1px solid var(--border-brown);
    display: flex;
    gap: 10px;
} */

@media screen and (max-width: 750px) {
    body {
        padding-top: 60px !important;
    }
    html {
        scroll-padding-top: 60px !important;
    }

    .interactive-section {
        padding: 40px 15px;
        height: auto;
        min-height: calc(100vh - 60px);
    }
    
    .content-wrapper {
        max-height: calc(100vh - 100px);
    }

    h2 {
        font-size: 24px;
    }
}