/* 自定义字体定义 */
@font-face {
    font-family: '今年也要加油鸭体';
    src: url('今年也要加油鸭体.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* 音频激活提示的编辑模式样式 */
.edit-mode #audio-activation-tip {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) scale(1) !important;
    pointer-events: auto !important;
    box-shadow: none !important;
    border: 2px dashed rgba(0, 150, 255, 0.5) !important;
    resize: both !important;
    overflow: visible !important;
}

#audio-activation-tip .audio-tip-text {
    font-family: '今年也要加油鸭体', 'Microsoft YaHei', sans-serif;
    white-space: normal;
    word-break: break-word;
    font-size: 22px;
    position: absolute;
    z-index: 10000;
}

/* 默认初始定位（仅在未手动调整位置时使用） */
#audio-activation-tip .audio-tip-text:not([style*="position"]) {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 在编辑模式下允许文字单独拖动 */
.edit-mode #audio-activation-tip .audio-tip-text {
    pointer-events: auto;
}

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

body {
    overflow: hidden;
    font-family: '今年也要加油鸭体', "Microsoft YaHei", sans-serif;
    background-color: #808080;
}

/* 场景容器样式 */
.scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: black;
    z-index: 1001;
}

.scene-viewport {
    position: relative;
    width: 100vw;
    height: 80vh; /* 只使用屏幕高度的80% */
    top: 10vh;    /* 向下偏移10%，上方留出黑色区域 */
    overflow: hidden;
}

.scene-world {
    position: relative;
    height: 80vh;  /* 世界高度也调整为80vh */
    width: max-content; /* 宽度根据内容自适应，允许超出视口 */
    transition: transform 0.05s ease-out; /* 更快的过渡，更跟得上移动 */
}

.scene-background,
.scene-foreground {
    position: absolute;
    top: 0;
    left: 0;
    height: 80vh;  /* 图片高度固定为80vh */
    width: auto;   /* 宽度自动，保持比例 */
    display: block;
}

.scene-background {
    z-index: 1; /* 背景在最底层 */
}

.scene-foreground {
    z-index: 10; /* 前景在最上层 */
    pointer-events: none;
}

.scene-fox {
    position: absolute;
    z-index: 100; /* 临时设置最高层级，确保可见 */
    width: 30vw; /* 使用视口宽度作为基准，保持响应式 */
    height: auto; /* 保持图片比例 */
    max-width: 600px; /* 最大宽度限制 */
    min-width: 200px; /* 最小宽度限制 */
    pointer-events: none;
    user-select: none;
    transform: translate(-50%, -50%);
    /* 调试边框已移除 */
}

/* 场景1狐狸缩小40% */
#scene1-fox {
    width: 18vw !important; /* 30vw * 0.6 = 18vw */
    max-width: 360px !important; /* 600px * 0.6 = 360px */
    min-width: 120px !important; /* 200px * 0.6 = 120px */
}

/* 场景2狐狸缩小40% */
#scene2-fox {
    width: 18vw !important; /* 30vw * 0.6 = 18vw */
    max-width: 360px !important; /* 600px * 0.6 = 360px */
    min-width: 120px !important; /* 200px * 0.6 = 120px */
}

/* 场景3狐狸缩小20% */
#scene3-fox {
    width: 24vw !important; /* 30vw * 0.8 = 24vw */
    max-width: 480px !important; /* 600px * 0.8 = 480px */
    min-width: 160px !important; /* 200px * 0.8 = 160px */
}

.scene-position-display {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    z-index: 1100;
    min-width: 220px;
    display: none !important; /* 隐藏调试显示 */
}

.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    z-index: 10000;
}

#bgVideo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
    z-index: 10001;
}

/* 这是背景图片和狐狸的父容器 */
.background-image {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: black;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 实际的背景图片样式 */
.actual-background {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    display: block;
}

/* 狐狸的样式 */
#fox {
    position: absolute;
    height: auto;
    pointer-events: none;
    z-index: 10;
    transform: translate(-50%, -50%);
    user-select: none;
}

.content {
    position: relative;
    color: white;
    text-align: center;
    padding: 20px;
    z-index: 1;
}

h1 {
    font-size: 3em;
    margin-top: 20vh;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.dialog-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: -1;
}

.dialog-background img {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    display: block;
}

.dialog-content {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    max-width: 90vw;
    width: min(400px, 90vw);
    min-height: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.dialog h2 {
    margin-bottom: 2rem;
    color: #333;
}

.button-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dialog-button {
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.dialog-button:hover {
    background-color: #45a049;
}

#noTime {
    background-color: #f44336;
}

#noTime:hover {
    background-color: #da190b;
}

/* 响应式设计 - 移动设备适配 */
@media (max-width: 768px) {
    .dialog-content {
        padding: 1.5rem;
        width: min(350px, 85vw);
        margin: 1rem;
    }
    
    .dialog h2 {
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
    }
    
    .dialog-button {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        margin: 0.3rem;
    }
}

@media (max-width: 480px) {
    .dialog-content {
        padding: 1rem;
        width: min(300px, 90vw);
    }
    
    .dialog h2 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .dialog-button {
        padding: 0.7rem 1rem;
        font-size: 0.8rem;
        display: block;
        width: 100%;
        margin: 0.5rem 0;
    }
}

/* 翘边GIF控制 */
#corner-gif {
    animation-play-state: paused;
    transition: opacity 0.3s ease;
}

#corner-gif:hover {
    animation-play-state: running;
}

/* FONT_002 hover文字显示样式 */
.font-text-display {
    position: fixed;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    border-radius: 12px;
    color: #333;
    padding: 20px 25px;
    font-family: '今年也要加油鸭体', "Microsoft YaHei", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    width: 300px;
    min-width: 200px;
    word-wrap: break-word;
    cursor: move;
    user-select: none;
    resize: horizontal;
    overflow: hidden;
    font-weight: 500;
}

/* 移除原有的伪元素装饰效果，完全使用PNG图片 */

/* 简化hover状态，仅保留可拖拽提示 */
.font-text-display:hover {
    transform: translateY(-50%);
    box-shadow: 0 0 15px rgba(100, 150, 255, 0.3);
}

/* 当文字框显示时，在右下角显示调节提示 */
.font-text-display.show::after {
    content: "⟷";
    position: absolute;
    bottom: 5px;
    right: 8px;
    font-size: 12px;
    color: rgba(100, 150, 255, 0.7);
    cursor: ew-resize;
    user-select: none;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.font-text-display.show:hover::after {
    opacity: 1;
    color: rgba(100, 150, 255, 1);
}

.font-text-display.show {
    opacity: 1;
    visibility: visible;
}

/* 移除不必要的拖拽提示样式，直接使用PNG图片 */

/* 当被编辑器选中时，移除transform以避免位置冲突 */
.font-text-display[style*="left"] {
    transform: none;
    right: auto;
    top: auto;
}

.font-text-display .text-line {
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    font-size: 1.44em; /* 标题的80%：1.8 * 0.8 = 1.44em */
    font-weight: normal; /* 普通文本不加粗 */
}

.font-text-display .text-line.title-line {
    font-weight: bold;
    font-size: 1.8em; /* 标题保持放大80% */
    text-align: center; /* 居中对齐 */
}

.font-text-display .text-line:last-child {
    margin-bottom: 0;
}

/* 隐藏调试显示元素 - 保留功能但隐藏显示 */
#position-display {
    display: none !important;
}

#cursor-position-display {
    display: none !important;
}
