@font-face {
    font-family: 'DY';
    src: url('../font/dy.otf') format('opentype');
}

@font-face {
    font-family: 'FZ';
    src: url('../font/fz.ttf') format('truetype');
}

@font-face {
    font-family: 'ZhuYuan';
    src: url('../font/zhuyuan.ttf') format('truetype');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

body {
    font-family: 'ZhuYuan', 'Microsoft YaHei', sans-serif;
    height: 100vh;
    overflow: hidden;
    position: relative;
    overscroll-behavior-y: contain;
}

#app {
    width: 1920px;
    height: 1080px;
    position: absolute;
    overflow: hidden;
    transform-origin: 0 0;
}

.body {
    width: 100%;
    height: 100%;
    position: relative;
    background: url('../img/bg.png') center/cover no-repeat;
}

/* .body::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
} */

.container,
.game-screen {
    position: relative;
    z-index: 1;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    padding-top: 160px;
    text-align: center;
}

.logo {
    position: fixed;
    top: 28px;
    right: 28px;
    width: 86px;
    height: 96px;
    z-index: 20;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

h1 img {
    width: 920px;
}

.subtitle {
    margin: 70px auto 232px;
}

.subtitle img {
    width: 1320px;
}

.start-btn {
    width: 404px;
    height: 114px;
    border: none;
    background: url('../img/start.png') center/100% 100% no-repeat;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.start-btn:hover {
    transform: scale(1.04);
}

.start-btn:active {
    transform: scale(0.96);
}

.sound-btn {
    position: fixed;
    left: 34px;
    bottom: 28px;
    width: 92px;
    height: 92px;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 60;
    transition: transform 0.2s ease;
}

.sound-btn:hover {
    transform: scale(1.06);
}

.sound-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.game-screen {
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
}

.game-screen.active {
    display: flex;
}

.game-header {
    display: flex;
    align-items: flex-start;
    padding: 24px 36px 0;
    padding-bottom: 61px;
}

.game-header > *:not(:first-child) {
    margin-left: 22px;
}

.back-btn {
    width: 160px;
    height: 80px;
    border: none;
    background: url('../img/back.png') center/100% 100% no-repeat;
    cursor: pointer;
    flex-shrink: 0;
}

.task-text-container {
    padding-top: 6px;
}

.task-title {
    max-width: 1450px;
    display: flex;
    align-items: center;
}

.task-title img {
    width: 1507px;
    height: auto;
    display: block;
    object-fit: contain;
}
.secondType .task-title {
    width: 1267px;
}
.task-meta {
    display: none;
    align-items: center;
    gap: 18px;
    margin-top: 16px;
    font-family: 'DY', 'Microsoft YaHei', sans-serif;
    font-size: 28px;
    color: #8b521c;
}

.task-meta span {
    padding: 6px 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 4px 10px rgba(118, 78, 38, 0.12);
}

.game-content {
    /* flex: 1; */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 110px 150px;
}

.ramp-game-content {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 140px 135px;
}

.ramp-game-content > *:not(:first-child) {
    margin-left: 75px;
}

.plank-options {
    width: 319px;

    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.plank-options > *:not(:first-child) {
    margin-top: 32px;
}

.plank-option {
    width: 100%;
    height: 202px;
    background:none;
    border: none;
    
    cursor: pointer;
}

.plank-option img {
    width: 100%;
    height: 100%;
   background: none;
}

.plank-option:hover:not(:disabled) {
    transform: translateY(-2px);
    
}

.plank-option:disabled {
    cursor: not-allowed;
}

.plank-option.dragging {
    opacity: 0.5;
    border: none;
    background-color: none;
    box-shadow: none;

}

.plank-option.selected img{
    /* transform: scale(1.1); */
}

.scene-panel.drag-over {
    /* box-shadow: 0 0 0 15px #DD9362, 0 4px 4px 6px #BD7E53, 0 0 30px rgba(221,147,98,0.6); */
}

.dragging-label {
    position: absolute;
    z-index: 9999;
    pointer-events: none;
    border: none;
    display: none;
}

.scene-panel {
    position: relative;
    width: 1203px;
    height: 670px;
    border-radius: 15px;
    box-shadow: 0 0 0 15px #DD9362, 0 4px 4px 6px #BD7E53;
    overflow: hidden;
}

.scene-image,
.scene-video {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
}

.scene-video {
    display: none;
    z-index: 2;
    /* 兼容老内核：overflow:hidden + border-radius 上下文中 video 画面会被丢弃，强制独立合成层 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.quiz-layout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-layout > *:not(:first-child) {
    margin-left: 111px;
}

.image-panel {
    display: flex;
    flex-direction: column;
}

.image-panel > *:not(:first-child) {
    margin-top: 18px;
}

.question-card {
    display: none;
    align-items: center;
    gap: 18px;
    padding-left: 10px;
}

.question-card img {
    width: 120px;
    height: auto;
    border-radius: 26px;
    box-shadow: 0 10px 24px rgba(69, 34, 12, 0.12);
}

.question-card-info {
    color: #6a3a18;
}

.question-card-title {
    font-family: 'DY', 'Microsoft YaHei', sans-serif;
    font-size: 38px;
    line-height: 1.2;
}

.question-card-subtitle {
    margin-top: 8px;
    font-size: 22px;
    color: #8b6a4d;
}

.image-frame {
    
    
     
}

.image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    
}

#quizImage {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
   
}

.drop-zones,
.placed-labels {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
}

.drop-zone {
    position: absolute;
    background: url(../img/box1.png);
    background-size: 100% 100%;
    /* border: 4px dashed #8ea0bc; */
    border-radius: 999px;
    /* background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.65) inset; */
    /* transition: all 0.2s ease; */
}

.drop-zone.highlight {
    background-image: url(../img/box1-m.png);

    /* border-color: #274d80; */
    box-shadow: 0 0 18px rgba(74, 140, 229, 0.55);
}

.drop-zone.matched {
    background-image: url(../img/box1-m.png);

    /* border-style: solid;
    border-color: rgba(74, 140, 229, 0.2);
    background: rgba(255, 255, 255, 0.22); */
    box-shadow: none;
}

.options-panel {
    display: flex;
    justify-content: center;
    /* min-width: 260px; */
}

.options-list {
    display: flex;
    flex-direction: column;
}

.options-list > *:not(:first-child) {
    margin-top: 28px;
}

.organ-btn,
.placed-label,
.dragging-label {
    font-family: 'DY', 'Microsoft YaHei', sans-serif;
    font-size: 35px;
    font-weight: bold;
    color: #fff;
    line-height: 1.2;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.organ-btn {
    width: 202px;
    height: 76px;
    /* padding: 0 16px; */
    border-radius: 999px;
    cursor: pointer;
    touch-action: none;
    box-shadow: 0 2px 0 #000;
}

.organ-btn.green,
.placed-label.green,
.dragging-label.green {
    background: #62c84f;
}

.organ-btn.matched {
    opacity: 0;
    cursor: default;
    box-shadow: none;
}

.organ-btn.dragging {
    opacity: 0;
}

.organ-btn.shake {
    animation: shake 0.45s ease-in-out;
}

.placed-label {
    position: absolute;
    border-radius: 999px;
    animation: labelPlace 0.22s ease-out;
}

.dragging-label {
    position: absolute;
    /* padding: 0 16px; */
    /* border-radius: 999px; */
    /* box-shadow: 0 2px 0 #000; */
    pointer-events: none;
    z-index: 999;
    display: none;
}

.dragging-card {
    position: absolute;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    z-index: 999;
    display: none;
    /* border: 3px dashed #8f7f98; */
    /* border-radius: 16px; */
    /* background: rgba(233, 229, 240, 0.96); */
    /* box-shadow: 0 8px 16px rgba(0, 0, 0, 0.16); */
    overflow: hidden;
}

.dragging-card .level-two-item-image {
    padding: 0;
}

.dragging-card .level-two-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dragging-card .level-two-item-name {
    height: 46px;
    margin: 10px 12px 12px;
}

.bottom-controls {
    position: absolute;
    left: 50%;
    bottom:50px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    z-index: 15;
}

.bottom-controls > *:not(:first-child) {
    margin-left: 100px;
}

.complete-btn {
    width: 328px;
    height: 100px;
}
.secondType .bottom-controls > *:not(:first-child) {
    margin-left: 55px;
}
.action-btn,
.nav-btn {
     width:328px;
    height: 100px;
    /* padding: 0 34px; */
    border: none;
    background: none;
    /* border-radius: 999px; */
    font-family: 'DY', 'Microsoft YaHei', sans-serif;
    /* font-size: 32px; */
    /* color: #fff; */
    cursor: pointer;
    /* transition: transform 0.15s ease, opacity 0.15s ease; */
    /* box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18); */
    justify-content: center;
    align-items: center;
    display: inline-flex;
}
.action-btn{
    font-size: 48px;
    border-radius: 100px;
    padding-top: 10px;
    color: white;
    box-shadow: 0 2px 0 #000;
}
.nav-btn img{
  width: 100%;
}
.action-btn {
    display: none;
}

.reset-btn {
    background: #4383dd;
}

.submit-btn {
    background: #e6c80f;
    color: #fff;
}

.prev-btn {
    display: none;
    /* background: #9c9c9c; */
}

.next-btn {
    /* background: #a8571e; */
    /* min-width: 300px; */
}

.next-btn.complete-mode {
    background: url('../img/complete.png') center/100% 100% no-repeat;
    color: transparent;
    font-size: 0;
    box-shadow: none;
}
.next-btn.complete-mode img {
    display: none;
}

.action-btn:hover:not(:disabled),
.nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.action-btn:active:not(:disabled),
.nav-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.action-btn.disabled,
.action-btn:disabled,
.nav-btn.disabled,
.nav-btn:disabled {
    filter: grayscale(100%) brightness(1.4);
    cursor: not-allowed;
}

.level-two-view {
    display: none;
    width: 100%;
    height: 350px;
    justify-content: space-between;
    flex-direction: column;
    align-items: center;
    margin-top: 260px;
}

.level-two-view.show {
    display: flex;

}

.level-two-question {
    width: 100%;
    max-width: 1550px;
    text-align: center;
    font-family: 'DY', 'Microsoft YaHei', sans-serif;
    font-size: 60px;
    line-height: 1.4;
    color: #000;
    padding: 0 0;
}

.level-two-blank {
    display: inline-block;
    min-width: 240px;
    padding: 0 12px;
    margin: 0 10px;
    border-bottom: 6px solid #000;
    vertical-align: baseline;
}

.level-two-blank.filled {
    border-bottom-color: #000;
}

.level-two-options {
    display: flex;
    align-items: center;
    justify-content: center;
}

.level-two-options > *:not(:first-child) {
    margin-left: 50px;
}

.level-two-option {
    min-width: 290px;
    height: 76px;
    /* padding: 0 26px; */
    border: none;
    border-radius: 999px;
    background: #3B81DE;
    box-shadow: 0 2px 0 #000;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'DY', 'Microsoft YaHei', sans-serif;
    font-size: 35px;
    color: #fff;
    transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.level-two-option > *:not(:first-child) {
    margin-left: 14px;
}

.level-two-option:disabled,
.level-two-option.locked {
    cursor: not-allowed;
    /* opacity: 0.82; */
    /* filter: grayscale(20%); */
}

.level-two-option:hover:not(:disabled) {
    transform: translateY(-2px);
}

.level-two-option:active:not(:disabled) {
    transform: translateY(1px);
}

.level-two-option-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    display: none;
}

.level-two-option.show-icon .level-two-option-icon {
    display: block;
}

.category-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
}

.category-column {
    height: 320px;
    width: 540px;
    padding: 35px;
    border: none;
    border-radius: 15px;
    background: url(../img/box-bg.png);
    background-size: 100% 100%;
    /* box-shadow: 0 10px 26px rgba(124, 75, 24, 0.12); */
}

.category-title {
    font-family: 'DY', 'Microsoft YaHei', sans-serif;
    font-size: 30px;
    color: #422411;
    text-align: center;
    line-height: 1.25;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
}

.category-drop-zone {
     height: 208px;
    /* border-radius: 14px; */
    background: #fff;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0;
    border: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.category-drop-zone > *:not(:first-child) {
    margin-left: 14px;
}

.category-drop-zone.highlight {
    /* border-color: #82a0cf; */
    /* box-shadow: inset 0 0 0 2px rgba(130, 160, 207, 0.35); */
}

.level-two-tray {
    padding: 30px 40px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.7);
}

.level-two-items {
    display: flex;
}

.level-two-items > *:not(:first-child) {
    margin-left: 40px;
}

.level-two-item-card {
    width: 180px;
    /* border: 3px dashed #8f7f98; */
    border-radius: 16px;
    /* background: #e9e5f0; */
    cursor: grab;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.level-two-item-card:hover:not(.placed):not(.in-zone) {
    transform: translateY(-2px);
}

.level-two-item-card.dragging {
    opacity: 0;
}

.level-two-item-card.placed {
    opacity:0;
    cursor: default;
}

.level-two-item-card.in-zone {
    width: 180px;
    /* border-style: solid; */
    /* border-color: #d3c5e2; */
    cursor: default;
    background: #f2f0f7;
}

.level-two-item-image {
    padding: 0;
    font-size: 0;
}

.level-two-item-image img {
    width: 100%;
    height: 208px;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
}

.level-two-item-name {
    height: 38px;
    margin: 8px 10px 10px;
    border-radius: 999px;
    background: #fff;
    color: #9a6033;
    font-size: 18px;
    line-height: 1.1;
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 6px;
}

.success-toast,
.error-toast {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    animation: fadeIn 0.2s ease;
}

.toast-content {
    /* max-width: 1420px; */
    width: 1200px;
    padding: 40px 0;
    border-radius:48px;
    border: 8px solid #8f4c21;
    background: rgba(255, 255, 255, 0.96);
    font-family: 'DY', 'Microsoft YaHei', sans-serif;
    text-align: center;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.toast-content > *:not(:first-child) {
    margin-top: 16px;
}

.toast-title {
    font-size: 64px;
    font-weight: bold;
}

.toast-message {
    font-size: 36px;
}

.toast-success {
    color: #57b548;
}

.toast-error {
    color: #DE613B;
}

.end-screen {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 40;
    background: url('../img/bg.png') center/cover no-repeat;
}

.end-screen.active {
    display: flex;
}

.end-content {
    /* width: 1200px; */
    text-align: center;
}

.end-title img {
    width: 1288px;
    max-width: 100%;
}

.end-desc {
    margin-top: 26px;
    display: none;
    font-size: 36px;
    color: #6a3815;
}

.restart-btn {
    width: 404px;
    height: 114px;
    margin-top:120px;
    border: none;
    background: url('../img/restart.png') center/100% 100% no-repeat;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.restart-btn:hover {
    transform: scale(1.04);
}

.restart-btn:active {
    transform: scale(0.96);
}

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

@keyframes labelPlace {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 确认弹框 */
.confirm-dialog {
    position: absolute;
    left: 50%;
    top: calc(50% + 80px);
    width: 600px;
    height: 300px;
    transform: translate(-50%, -50%) scale(0.9);
    background-color: rgba(255, 245, 230, 0.5);
    border: 8px solid #914718;
    border-radius: 48px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.confirm-dialog::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-image: var(--confirm-bg, none);
    background-repeat: no-repeat;
    background-position: top center;
    background-size: 50% auto;
    /* opacity: 0.5; */
    pointer-events: none;
    z-index: 0;
}

.confirm-dialog.show {
    display: flex;
    animation: fadeIn 0.25s ease forwards;
}

.confirm-title {
    position: relative;
    z-index: 1;
    font-family: 'DY', 'Microsoft YaHei', sans-serif;
    font-size: 40px;
    color: #8f4c21;
    font-weight: bold;
    margin-bottom: 70px;
}

.confirm-buttons {
    position: relative;
    z-index: 1;
    display: flex;
}

.confirm-buttons > *:not(:first-child) {
    margin-left: 60px;
}

.confirm-btn {
    width: 75px;
    height: 70px;
    border-radius: 50%;
    border: none;
    font-family: 'DY', 'Microsoft YaHei', sans-serif;
    font-size: 30px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
   
    transition: transform 0.15s ease;
}
.confirm-btn img{
    width: 100%;
}
.yes-btn {
    background: #5EC850;
}

.no-btn {
    background: #DE613B;
}

.confirm-btn:hover {
    transform: scale(1.08);
}

.confirm-btn:active {
    transform: scale(0.95);
}
