/*
 * =======================================================
 * === 字体定义：引用自定义字体文件 (保持不变) ===
 * =======================================================
 */

/* 通用字体：AlibabaPuHuiTi-3-55-Regular.otf */
@font-face {
    font-family: 'AlibabaPuHuiTi-3-55-Regular';
    src: url('fonts/AlibabaPuHuiTi-3-55-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* 中文字体：SmileySans-Oblique.otf */
@font-face {
    font-family: 'SmileySans';
    src: url('fonts/SmileySans-Oblique.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* 日文字体：Makinas-Flat-3-2.otf */
@font-face {
    font-family: 'MakinasFlat';
    src: url('fonts/Makinas-Flat-3-2.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* 英文字体：Rajdhani-Regular.otf */
@font-face {
    font-family: 'Rajdhani';
    src: url('fonts/Rajdhani-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* =======================================================
 * === 核心布局修改（解决居中问题） ===
 * =======================================================
 */

body {
    /* 允许内容自然流向，避免与 fixed header 冲突 */
    font-family: 'SmileySans', 'AlibabaPuHuiTi-3-55-Regular', "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ede7f6;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

html[lang="jp"] body {
    font-family: 'MakinasFlat', "Meiryo", "Yu Gothic", sans-serif;
}

html[lang="en"] body {
    font-family: 'Rajdhani', Arial, Helvetica, sans-serif;
}

button {
    font-family: 'AlibabaPuHuiTi-3-55-Regular', "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

.container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    border: 1px solid #dbdbdb;

    /* 关键修正1: 使用 margin: 0 auto; 实现水平居中 */
    margin: auto;
    /* 关键修正2: 为 fixed Header 预留顶部空间（约 60px - 80px 足够） */

    display: block;
    /* 容器居中布局完成 */
}

/* Header 样式 (确保它固定在顶部并铺满宽度) */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* 确保 header 铺满宽度 */
    z-index: 1000;

    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 15px 20px;
    width: 100%;
    box-sizing: border-box;

    background-color: #ffffff;
}

.header label {
    font-family: 'AlibabaPuHuiTi-3-55-Regular', "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    margin-right: 10px;
    font-size: 1.1em;
    color: #666;
}

.header select {
    font-family: 'AlibabaPuHuiTi-3-55-Regular', "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    font-size: 1em;
    color: #666;
}

/* 鼠标点击特效 */
.circle {
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: expand 0.6s ease-out forwards;
}

@keyframes expand {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(3);
    }
}

/* * =======================================================
 * === 组件样式 (保持不变) ===
 * =======================================================
 */

#home-screen h1 {
    color: #333;
    font-size: 32px;
    margin-bottom: 20px;
}

#home-screen p {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

#quiz-screen {
    display: none;
}

.question-card {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.question-text-dimension {
    font-size: 15px;
    color: #8e63cd;
    margin-top: 10px;
    line-height: 1.6;
    font-weight: bold;
}

.question-text {
    font-size: 20px;
    color: #333;
    margin-bottom: 30px;
    line-height: 1.6;
}

.options-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-button {
    background-color: #f0f0f0;
    color: #333;
    padding: 15px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s, border-color 0.2s;
    text-align: center;
}

.option-button:hover {
    background-color: #e5e5e5;
    border-color: #ccc;
}

.progress {
    margin-top: 25px;
    color: #999;
    font-size: 14px;
}


.primary-button {
    background-color: #d0b0ff;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    margin-top: 20px;
    transition: background-color 0.3s;
    width: 100%;
}

.primary-button:hover {
    background-color: #b290e5;
}

#result-screen {
    display: none;
}

#result-screen h2 {
    color: #ab73ff;
    font-size: 28px;
    margin-bottom: 15px;
}

#final-result {
    font-size: 20px;
    color: #333;
    margin-bottom: 30px;
    white-space: pre-wrap;
    text-align: left;
    padding: 10px;
    border: 1px dashed #ccc;
    border-radius: 6px;
}