/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    background-image: url('background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #fff;
    overflow-x: hidden;
    width: 100vw;
    overflow-y: scroll;  /* 始终显示垂直滚动条，防止闪烁 */
}

/* 通用容器样式 */
.welcome-container,
.question-container,
.report-container,
.cocktail-container {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;  /* 防止内容溢出 */
}

/* 内容卡片通用样式 */
.welcome-content,
.question-content,
.report-content,
.cocktail-content {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;  /* 防止内容溢出 */
}

/* 标题通用样式 */
.welcome-title,
.question-title,
.cocktail-title {
    font-size: 2.5em;
    margin-bottom: 30px;
    color: #333333;
    font-weight: 600;
}

/* 文本通用样式 */
.welcome-text,
.question-text,
.cocktail-name {
    font-size: 1.2em;
    line-height: 1.6;
    color: #333333;
    margin-bottom: 30px;
    max-width: 600px;
}

/* 按钮通用样式 */
.start-button,
.next-button {
    background: linear-gradient(45deg, #ffc46c, #ffd792);
    border: none;
    border-radius: 25px;
    padding: 15px 40px;
    font-size: 1.0em;
    color: #333333;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 196, 108, 0.3);
    font-weight: 500;
}

.start-button:hover,
.next-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 196, 108, 0.4);
}

.start-button:active,
.next-button:active {
    transform: translateY(1px);
}

/* 问题容器特定样式 */
.question-container {
    display: none;
    overflow: hidden !important;  /* 强制隐藏所有滚动条 */
    height: auto;                /* 恢复自适应高度 */
    position: relative;          /* 确保定位正确 */
}

.question-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;           /* 防止内容溢出 */
}

.questions {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;           /* 防止内容溢出 */
    transition: all 0.3s ease-in-out;  /* 保留平滑过渡效果 */
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #ffc46c, #ffd792);
    transition: width 0.5s ease;
}

/* 问题编号样式 */
.question-number {
    color: #333333;
    font-size: 1.1em;
    margin-bottom: 15px;
    text-align: center;
    width: 100%;
}

/* 问题文本样式 */
.question-text {
    color: #333333;
    font-size: 1.2em;
    margin-bottom: 20px;
    text-align: center;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 答案输入框样式 */
.answer-input {
    width: 100%;
    min-height: 120px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(51, 51, 51, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0 30px;
    color: #333333;
    font-size: 1em;
    resize: vertical;
    transition: all 0.3s ease;
}

.answer-input:focus {
    outline: none;
    border-color: rgba(255, 196, 108, 0.5);
    box-shadow: 0 0 10px rgba(255, 196, 108, 0.2);
}

.answer-input::placeholder {
    color: rgba(51, 51, 51, 0.5);
}

/* 报告容器特定样式 */
.report-container {
    display: none;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px;
    color: #333333;
    font-size: 1.1em;
    font-weight: 500;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #ffc46c;
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error {
    color: #ffc46c;
    text-align: center;
    padding: 20px;
    font-size: 1.1em;
}

/* 继续按钮样式 */
.next-button {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease-in-out;
}

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

/* 响应式调整 */
@media (max-width: 768px) {
    .welcome-content,
    .question-content,
    .report-content,
    .cocktail-content {
        padding: 20px;
        width: 95%;
    }

    .welcome-title,
    .question-title,
    .cocktail-title {
        font-size: 1.8em;
    }

    .welcome-text,
    .question-text {
        font-size: 1em;
    }

    .answer-input {
        width: 100%;
        min-height: 100px;
    }

    .button-container {
        flex-direction: column;
        gap: 15px;
        padding: 10px;
    }

    .generate-card-button,
    .view-cocktail-button,
    .back-to-report-button {
        width: 100%;
        min-width: 100%;
        margin: 5px 0;  /* 垂直方向的外边距 */
    }
}

@media (max-width: 480px) {
    .welcome-content,
    .question-content,
    .report-content,
    .cocktail-content {
        padding: 15px;
        width: 100%;
    }

    .welcome-title,
    .question-title,
    .cocktail-title {
        font-size: 1.5em;
    }

    .welcome-text,
    .question-text {
        font-size: 0.9em;
    }

    .answer-input {
        min-height: 80px;
    }

    .button-container {
        padding: 5px;
    }

    .generate-card-button,
    .view-cocktail-button,
    .back-to-report-button {
        margin: 3px 0;  /* 减小垂直方向的外边距 */
    }
}

/* 报告内容样式 */
.report-text {
    text-align: left;
    color: #333333;
    line-height: 1.8;
    max-width: 100%;
    overflow-x: hidden;
    word-wrap: break-word;
}

.report-text h1,
.report-text h2,
.report-text h3 {
    max-width: 100%;
    overflow-x: hidden;
    word-wrap: break-word;
}

.report-text p,
.report-text li {
    max-width: 100%;
    overflow-x: hidden;
    word-wrap: break-word;
}

.report-text h1 {
    font-size: 1.8em;
    color: #333333;
    margin: 1.5em 0 0.8em 0;
    border-bottom: 2px solid rgba(51, 51, 51, 0.3);
    padding-bottom: 0.3em;
}

.report-text h2 {
    font-size: 1.5em;
    color: #333333;
    margin: 1.3em 0 0.7em 0;
}

.report-text h3 {
    font-size: 1.3em;
    color: #333333;
    margin: 1.1em 0 0.6em 0;
}

.report-text p {
    margin: 1em 0;
}

.report-text ul,
.report-text ol {
    margin: 1em 0;
    padding-left: 2em;
}

.report-text li {
    margin: 0.8em 0;
}

.report-text strong {
    color: #333333;
    font-weight: 600;
}

.report-text em {
    color: rgba(51, 51, 51, 0.9);
    font-style: italic;
}

.report-text blockquote {
    border-left: 4px solid #333333;
    padding: 0.5em 0 0.5em 1em;
    margin: 1em 0;
    background: rgba(51, 51, 51, 0.1);
    border-radius: 0 4px 4px 0;
}

/* 建议部分的特殊样式 */
.report-text li strong {
    display: inline-block;
    margin-right: 0.5em;
}

/* 确保所有容器使用相同的居中布局 */
.welcome-container,
.question-container,
.report-container,
.cocktail-container {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;  /* 防止内容溢出 */
}

.welcome-content,
.question-content,
.report-content,
.cocktail-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 800px;
    width: 90%;
    margin: 0 auto;
    overflow: hidden;  /* 防止内容溢出 */
}

/* 名字输入框样式 */
.name-input-container {
    width: 100%;
    max-width: 300px;
    margin: 20px auto;
}

.name-input {
    width: 100%;
    padding: 12px 20px;
    font-size: 1em;
    border: 1px solid rgba(51, 51, 51, 0.3);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    color: #333333;
    text-align: center;
    transition: all 0.3s ease;
}

.name-input:focus {
    outline: none;
    border-color: #ffc46c;
    box-shadow: 0 0 10px rgba(255, 196, 108, 0.2);
}

.name-input::placeholder {
    color: rgba(51, 51, 51, 0.5);
}

.name-error {
    color: #ff6b6b;
    font-size: 0.9em;
    margin-top: 8px;
    text-align: center;
    display: none;
}

/* 当输入框验证失败时的样式 */
.name-input.error {
    border-color: #ff6b6b;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 按钮容器样式 */
.button-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
    width: 100%;
    padding: 10px;
    position: relative;
}

/* 调整按钮样式以适应并排布局 */
.generate-card-button,
.view-cocktail-button,
.back-to-report-button {
    flex: 0 1 auto;
    min-width: 180px;
    background: linear-gradient(45deg, #ffc46c, #ffd792);
    border: none;
    border-radius: 25px;
    padding: 15px 30px;
    font-size: 1.0em;
    color: #333333;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 196, 108, 0.3);
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    position: relative;
    z-index: 1;
    margin: 5px;
}

/* 修改按钮悬浮效果 */
.generate-card-button:hover,
.view-cocktail-button:hover,
.back-to-report-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 196, 108, 0.4);
    z-index: 2;
}

/* 移动端样式调整 */
@media screen and (max-width: 768px) {
    .button-container {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 15px;
        margin-top: 20px;
    }

    .generate-card-button,
    .view-cocktail-button,
    .back-to-report-button {
        width: 100%;
        max-width: 300px;
        min-width: unset;
        margin: 0;
        padding: 12px 20px;
        font-size: 0.95em;
    }
}

/* 超小屏幕样式调整 */
@media screen and (max-width: 480px) {
    .button-container {
        padding: 10px;
        gap: 12px;
    }

    .generate-card-button,
    .view-cocktail-button,
    .back-to-report-button {
        max-width: 250px;
        padding: 10px 15px;
        font-size: 0.9em;
    }
}

/* 心灵卡片容器样式 */
#cardCanvas {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;  /* 防止内容溢出 */
}

/* 重启按钮样式 */
.restart-button {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 1000;
}

.restart-button:hover {
    transform: rotate(180deg);
    background: rgba(255, 196, 108, 0.9);
}

.restart-button::before {
    content: "↺";
    font-size: 24px;
    color: #333333;
}

/* 鸡尾酒容器样式 */
.cocktail-container {
    overflow-x: hidden;
}

.cocktail-content {
    overflow-x: hidden;
}

.cocktail-image-container {
    width: 100%;
    max-width: 400px;
    margin: 20px 0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.cocktail-image {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
}

.cocktail-name {
    font-size: 1.5em;
    color: #333333;
    margin: 20px 0;
    font-weight: 500;
}

/* 删除单独的返回报告按钮样式，使用统一的按钮样式 */
/* 按钮样式统一 */
.start-button,
.next-button,
.generate-card-button,
.view-cocktail-button,
.back-to-report-button {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 1.0em;
    font-weight: 500;
    background: linear-gradient(45deg, #ffc46c, #ffd792);
    border: none;
    border-radius: 25px;
    padding: 15px 30px;
    color: #333333;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 196, 108, 0.3);
    min-width: 180px;
    text-align: center;
    white-space: nowrap;
}

/* 统一按钮悬停效果 */
.start-button:hover,
.next-button:hover,
.generate-card-button:hover,
.view-cocktail-button:hover,
.back-to-report-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 196, 108, 0.4);
}

/* 统一按钮点击效果 */
.start-button:active,
.next-button:active,
.generate-card-button:active,
.view-cocktail-button:active,
.back-to-report-button:active {
    transform: translateY(1px);
}

/* 返回首页按钮样式 */
.home-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 53px;
    height: 45px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    object-fit: cover;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.home-button:active {
    transform: translateY(1px);
}

/* 全局字体设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* 输入框字体统一 */
.name-input,
.answer-input {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* 标题字体统一 */
.welcome-title,
.question-title,
.cocktail-title {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-weight: 600;
}

/* 文本内容字体统一 */
.welcome-text,
.question-text,
.report-text,
.cocktail-name {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.question-card {
    width: 100%;
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease-in-out;
    text-align: center;
}

.question-card[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
}

/* 确保父容器也不会出现滚动条 */
.container, 
.content-wrapper {
    overflow: hidden !important;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    padding: 20px;
}

.modal-tip {
    color: white;
    font-size: 16px;
    margin-bottom: 15px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    text-align: center;
}

.modal-image-container {
    max-width: 100%;
    max-height: 80vh;
    overflow: hidden;
    border-radius: 20px;
    position: relative;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 20px;
    display: block;
}

.modal-close-button {
    margin-top: 20px;
    padding: 10px 30px;
    border: none;
    border-radius: 25px;
    background: white;
    color: #333;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-close-button:active {
    transform: translateY(1px);
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .modal-tip {
        font-size: 14px;
        padding: 6px 12px;
    }

    .modal-close-button {
        padding: 8px 24px;
        font-size: 14px;
    }
} 