/* --- 全局与字体 --- */
body, html {
    margin: 0; padding: 0; width: 100%; height: 100%;
    overflow: hidden; font-family: 'Noto Sans SC', sans-serif; font-weight: 700;
}
body {
    background-image: url('images/game_background.jpg');
    background-size: cover; background-position: center center; background-repeat: no-repeat;
    position: relative; color: #fff;
}
/* 金色边框装饰 */
body::before, body::after {
    content: ''; position: absolute; background-color: rgba(255, 204, 0, 0.7);
    z-index: 10; opacity: 0.8;
}
body::before { top: 0; bottom: 0; width: 5px; left: 10px; box-shadow: 20px 0 0 rgba(255, 204, 0, 0.7); }
body::after { top: 0; bottom: 0; width: 5px; right: 10px; box-shadow: -20px 0 0 rgba(255, 204, 0, 0.7); }

/* --- 屏幕切换与通用样式 --- */
.screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: none; flex-direction: column; align-items: center;
    padding: 20px; box-sizing: border-box; text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    z-index: 20;
}
.screen.active { display: flex; }

/* --- 按钮样式 --- */
.btn {
    padding: 12px 35px; font-family: 'Noto Sans SC', sans-serif; font-weight: 900;
    font-size: 1.1em; cursor: pointer; transition: all 0.3s ease; text-shadow: none;
    border-radius: 4px; position: relative; border: 2px solid transparent; flex-shrink: 0;
}
.primary-btn { background-color: rgba(255, 204, 0, 0.9); color: #000; border-color: rgba(255, 204, 0, 1); }
.primary-btn:hover { background-color: rgba(255, 204, 0, 1); box-shadow: 0 0 15px rgba(255, 204, 0, 0.5); transform: translateY(-2px); }
.secondary-btn { background-color: rgba(40, 40, 40, 0.8); color: #fff; border-color: rgba(150, 150, 150, 0.8); }
.secondary-btn:hover { background-color: rgba(60, 60, 60, 1); border-color: #fff; transform: translateY(-2px); }

/* --- 开始界面 --- */
#start-screen { justify-content: center; }
#start-screen .content-wrapper { text-align: center; flex-grow: 1; display: flex; flex-direction: column; justify-content: center; }
#start-screen .start-text { font-size: 1.5em; line-height: 1.8; color: #fff; }
#start-screen .start-text-footer { margin-top: 40px; font-size: 1.3em; color: rgba(255, 204, 0, 0.9); }

/* 新增：输入框样式 */
.input-group {
    width: 90%;
    max-width: 400px;
    margin-top: 20px;
}
#name-input {
    width: 100%;
    padding: 15px;
    box-sizing: border-box;
    font-size: 1.1em;
    font-family: 'Noto Sans SC', sans-serif;
    text-align: center;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 204, 0, 0.7);
    border-radius: 4px;
    outline: none;
    transition: all 0.3s ease;
}
#name-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}
#name-input:focus {
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.7);
}
#name-error {
    color: #c0392b;
    font-size: 0.9em;
    height: 1.2em;
    margin-top: 5px;
    text-shadow: 0 0 5px #000;
}
#start-screen .btn {
    margin-bottom: 5vh; /* 调整按钮位置，给输入框留空间 */
}


/* --- 答题界面 --- */
#quiz-screen { background-color: rgba(0, 0, 0, 0.7); justify-content: center; }
.quiz-container { width: 100%; max-width: 600px; text-align: center; padding: 20px; background-color: rgba(0,0,0,0.5); border: 1px solid rgba(255,204,0,0.5); box-shadow: 0 0 15px rgba(255,204,0,0.3); }
#question-counter { font-size: 1em; color: rgba(255,255,255,0.7); }
#question-text { font-size: 1.8em; margin: 20px 0 40px; color: #fff; }
#options-container { display: flex; flex-direction: column; gap: 15px; }
.option-btn { background-color: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.3); color: #fff; padding: 15px; font-size: 1.1em; cursor: pointer; transition: all 0.3s ease; text-align: center; }
.option-btn:hover { background-color: rgba(255, 204, 0, 0.8); color: #000; }

/* --- 结果界面 (海报) --- */
#result-screen {
    background-color: rgba(0,0,0,0.3);
    justify-content: flex-start;
    overflow-y: auto;
    padding-top: 8vh;
}
.headnote {
    position: absolute; top: 15px; left: 50%; transform: translateX(-50%);
    font-size: 0.9em; color: rgba(255, 255, 255, 0.7); z-index: 21;
}
#poster {
    width: 100%; max-width: 500px;
    position: relative;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    box-sizing: border-box;
    padding-bottom: 100px;
}
.result-title {
    font-size: 1.8em; margin-bottom: 10px; color: #fff; font-weight: 900; text-align: center; line-height: 1.4;
}
/* 新增：干员代号高亮 */
#result-agent-name {
    color: rgba(255, 204, 0, 1);
    text-shadow: 0 0 8px rgba(255, 204, 0, 0.7);
}

.weapon-group {
    display: flex; flex-direction: column; align-items: center;
    width: 100%; margin-bottom: 20px;
}
.weapon-display-container {
    position: relative; width: 90%; max-width: 450px;
    background-color: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); padding: 20px;
    display: flex; justify-content: center; align-items: center;
    min-height: 150px; border-radius: 4px;
}
.weapon-img { max-width: 100%; max-height: 25vh; object-fit: contain; filter: drop-shadow(0 0 15px rgba(0,0,0,0.8)); }
.weapon-name-banner {
    position: absolute; bottom: 10px; right: 10px;
    background-color: #c0392b; color: #fff; font-size: 1.5em; font-weight: 900;
    padding: 10px 20px; border-radius: 4px;
    box-shadow: 0 0 10px rgba(192, 57, 43, 0.6); text-shadow: 0 0 5px rgba(0,0,0,0.5);
}
.slogan {
    font-size: 1.2em; font-weight: 900; font-style: italic;
    margin-top: 20px; line-height: 1.6; text-align: center; max-width: 90%;
}
.gunsmith-code-banner {
    background-color: rgba(255, 204, 0, 0.2); border: 1px solid rgba(255, 204, 0, 0.6);
    color: #fff; width: 95%; max-width: 500px; padding: 20px; padding-top: 30px;
    position: relative; box-shadow: 0 0 15px rgba(255, 204, 0, 0.3);
    border-radius: 4px; box-sizing: border-box; cursor: pointer;
    transition: background-color 0.3s ease;
}
.gunsmith-code-banner:hover { background-color: rgba(255, 204, 0, 0.3); }
.gunsmith-title-red-box {
    position: absolute; top: -1px; left: -1px; background-color: #c0392b; color: #fff;
    padding: 8px 15px; font-weight: 900; font-size: 0.9em;
    border-radius: 4px 0 4px 0; text-shadow: 0 0 3px rgba(0,0,0,0.5);
}
.gunsmith-code-info {
    padding-top: 15px; word-break: break-all; text-align: center;
}
#gunsmith-code { color: rgba(255, 204, 0, 0.9); font-weight: bold; font-size: 0.95em; }
#result-value { color: rgba(255, 255, 255, 0.8); font-size: 0.85em; }
.copy-instruction {
    color: rgba(255, 255, 255, 0.6); font-style: italic; font-size: 0.8em;
    font-weight: normal; margin-top: 10px; margin-bottom: 0;
}
#copy-feedback {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(255, 204, 0, 1); color: #000;
    display: flex; justify-content: center; align-items: center; font-weight: 900;
    opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
    border-radius: 4px;
}
#copy-feedback.show { opacity: 1; }

#qrcode-container {
    position: absolute;
    bottom: 15px;
    right: 5%;
    background: #fff; padding: 3px; border: 1px solid rgba(255, 204, 0, 0.8);
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.5); width: 70px; height: 70px;
}
#qrcode-container img { width: 100%; height: 100%; }

/* 底部操作按钮区 */
.action-buttons {
    position: relative;
    width: 100%;
    max-width: 500px;
    padding: 15px 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    z-index: 25;
    margin-top: 0;
    margin-bottom: 20px;
}
#share-poster-btn {
    display: none; /* JS会控制显示 */
}
/* 用于PC端占位的二维码容器 */
#qrcode-container-desktop-fallback {
    display: none; /* 默认隐藏, JS会控制 */
    background: #fff; padding: 3px; border: 1px solid rgba(255, 204, 0, 0.8);
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.5); width: 70px; height: 70px;
}
#qrcode-container-desktop-fallback img { width: 100%; height: 100%; }


/* 移动端小屏幕适配 */
@media (max-width: 480px) {
    body::before, body::after { display: none; }
    #start-screen .start-text { font-size: 1.1em; }
    #start-screen .btn { margin-bottom: 5vh; padding: 10px 30px; font-size: 1em; }
    #question-text { font-size: 1.3em; }
    #result-screen { padding-top: 60px; }
    .headnote { top: 10px; font-size: 0.8em; }
    .result-title { font-size: 1.2em; }
    .weapon-name-banner { font-size: 1em; }
    .slogan { font-size: 0.9em; }
    #poster { padding-bottom: 80px; }
    #qrcode-container { width: 60px; height: 60px; bottom: 10px; }
    .action-buttons {
        gap: 10px; margin-top: 10px; margin-bottom: 10px;
        flex-direction: column; width: 90%;
    }
    .action-buttons .btn { padding: 12px 20px; font-size: 0.9em; width: 100%; }
    #restart-btn { display: inline-block; order: 2; }
    #share-poster-btn { display: none; order: 1; } /* JS 仍然会控制显示 */
}