/* ==========================================
   🎨 智慧树 V3 样式表
   
   📌 快速参考：
   - 想让XX向上？ → 减小 margin-top 或 padding-top 的值
   - 想让XX向下？ → 增大 margin-top 或 padding-top 的值
   - 想让XX向左？ → 减小 margin-left 的值
   - 想让XX向右？ → 增大 margin-left 的值
   - 想让XX更大？ → 增大 width/height/font-size 的值
   - 想让XX更小？ → 减小 width/height/font-size 的值
   ========================================== */

/* ========== 主题变量（统一控制） ========== */
:root {
    /* 📌 【调整导航栏宽度】修改此值 */
    /* 想更宽？改为 140px, 160px */
    /* 想更窄？改为 100px, 80px */
    --trunk-w: 120px;
    
    /* 📌 【调整分身大小】修改此值 */
    /* 想更大？改为 70px, 80px */
    /* 想更小？改为 50px, 40px */
    --fruit-size: 60px;
    
    --canopy-h: 180px;
    --speed: 0.6s;

    /* 夏季主题颜色 */
    --leaf: #7cb342;
    --leaf-light: #aed581;
    --branch: #6d4c41;
    --branch-dark: #4e342e;
    --grass: #81c784;
    --grass-dark: #66bb6a;

    /* 通用颜色 */
    --white: #ffffff;
    --text: #37474f;
    --text2: #78909c;
    --shadow: rgba(0,0,0,0.12);
    --glass: rgba(255,255,255,0.88);
}

/* 秋季主题颜色 */
.theme-autumn {
    --leaf: #ff8a65;
    --leaf-light: #ffab91;
    --branch: #6d4c41;
    --branch-dark: #4e342e;
    --grass: #bcaaa4;
    --grass-dark: #a1887f;
}

/* ========== 开场视频 ========== */
.video-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1s ease;
}

.video-splash.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 📌 【调整视频填充方式】 */
/* object-fit: cover → 铺满页面，可能裁切边缘 */
/* object-fit: contain → 完整显示，可能有黑边 */
/* object-fit: fill → 拉伸铺满，可能变形 */
.video-splash video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========== 基础重置 ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: url('assets/背景.png') center/cover no-repeat fixed;
    color: var(--text);
    transition: background var(--speed);
}

/* ========== 主布局 ========== */
.app {
    display: flex;
    height: 100vh;
}

/* ========== 左侧导航栏 ========== */
/* 📌 【调整导航栏向下移动】修改 padding-top 的值 */
/* 想再下移？改为 60px, 80px */
/* 想上移？改为 20px, 10px */
.trunk {
    width: var(--trunk-w);
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 8px 16px;
    position: relative;
    flex-shrink: 0;
    z-index: 20;
    transition: transform 0.3s ease;
}

/* 导航栏纹理（已移除） */
.trunk::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
}

/* Logo图片 */
/* 📌 【调整Logo大小】修改 width 和 height 的值 */
/* 想更大？改为 56px, 64px */
/* 想更小？改为 40px, 36px */
.trunk-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: contain;
    background: var(--white);
    padding: 4px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

/* 导航按钮容器 */
.trunk-btns {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* 导航按钮 */
/* 📌 【调整按钮间距】修改 gap 的值 */
.trunk-btn {
    width: 100%;
    padding: 10px 4px;
    background: rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(5px);
}

.trunk-btn-icon { font-size: 20px; }
.trunk-btn-text { font-size: 10px; font-weight: 600; letter-spacing: 0.5px; }

.trunk-btn:hover {
    background: rgba(0,0,0,0.65);
    transform: scale(1.05);
}

.trunk-btn.active {
    background: var(--leaf);
    border-color: var(--leaf-light);
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    transform: scale(1.05);
}

/* ========== 右侧主内容 ========== */
/* 📌 【调整右侧内容左边距】修改 margin-left 的值 */
/* 想离导航栏更远？改为 20px, 30px */
/* 想离导航栏更近？改为 5px, 0px */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    margin-left: 10px;
}

/* ========== 分身头像区域 ========== */
/* 📌 【调整分身区域高度】修改 height 的值 */
/* 想更高？改为 18vh, 20vh */
/* 想更矮？改为 12vh, 10vh */
/* 📌 【调整分身整体向上移动】添加 margin-top: -10px; 或 -20px; */
.canopy {
    height: 15vh;
    position: relative;
    flex-shrink: 0;
    padding: 0 20px;
}

/* 分身容器 */
/* 📌 【调整分身间距】修改 gap 的值 */
/* 想间距更大？改为 20px, 30px */
/* 想间距更小？改为 5px, 0px */
.fruits {
    position: relative;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    z-index: 2;
    gap: 10px;
}

/* 单个分身 */
.fruit {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

/* 📌 【调整单个分身向上移动】修改 margin-top 的值 */
/* 想向上？改为 margin-top: -10px; 或 -20px; */
/* 想向下？改为 margin-top: 10px; 或 20px; */
.fruit:hover { transform: translateY(-4px) scale(1.05); }
.fruit.active .fruit-img { box-shadow: 0 0 0 3px var(--leaf-light), 0 4px 15px var(--shadow); }

/* 分身图片（透明背景，直接显示） */
/* 📌 【调整分身大小】修改 width 的值 */
/* 想更大？改为 70px, 80px */
/* 想更小？改为 50px, 40px */
.fruit-img {
    width: var(--fruit-size);
    height: auto;
    border-radius: 0;
    object-fit: contain;
    border: none;
    box-shadow: none;
    background: transparent;
    transition: all 0.3s ease;
}

.fruit-img.emoji {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: transparent;
}

/* 分身名称标签（白底黑字） */
/* 📌 【调整标签字体大小】修改 font-size 的值 */
/* 想更大？改为 13px, 14px */
/* 想更小？改为 10px, 9px */
.fruit-name {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #000000;
    background: rgba(255,255,255,0.9);
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 80px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ========== 对话框区域 ========== */
/* 📌 【调整对话框高度】修改 height 的值 */
/* 想更高？改为 75vh, 80vh */
/* 想更矮？改为 65vh, 60vh */
/* 📌 【调整对话框向下移动】修改 margin-top 的值 */
/* 想再下移？改为 20px, 30px */
/* 想上移？改为 5px, 0px */
/* 📌 【调整对话框左右边距】修改 margin 的值 */
/* margin: 上 右 下 左 */
/* 想左边更宽？改为 margin: 10px 12px 0 20px; */
.chat-wrapper {
    flex: 1;
    height: 70vh;
    margin: 10px 12px 0;
    padding: 8px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.4) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 
        0 8px 32px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.4),
        inset 0 -1px 0 rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    min-height: 0;
    z-index: 3;
}

.chat {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: transparent;
}

.chat iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ========== 下方留空 ========== */
/* 📌 【调整下方留空高度】修改 height 的值 */
/* 想留空更多？改为 10vh, 15vh */
/* 想留空更少？改为 5vh, 3vh */
.bottom-space {
    height: 7vh;
    flex-shrink: 0;
}

/* ========== 草地装饰 ========== */
.grass {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(180deg, transparent 0%, var(--grass) 100%);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    transition: background var(--speed);
    z-index: 0;
    pointer-events: none;
}

/* ========== 移动端菜单按钮 ========== */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
    width: 36px;
    height: 36px;
    background: var(--glass);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: 0 2px 8px var(--shadow);
}

.mobile-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
}

/* ========== 遮罩层 ========== */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    transition: opacity 0.3s ease;
}

.overlay.show {
    display: block;
}

/* ========== 响应式（手机端） ========== */
@media (max-width: 768px) {
    .trunk {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        transform: translateX(-100%);
        z-index: 1000;
    }

    .trunk.open { transform: translateX(0); }

    .mobile-toggle { display: flex; }

    .main {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .canopy { height: 130px; padding-top: 8px; }

    :root { --fruit-size: 50px; --canopy-h: 130px; }

    .fruit-name { font-size: 10px; }

    .chat-wrapper { margin: 6px 8px 0; }
}

@media (max-width: 480px) {
    :root { --fruit-size: 44px; --canopy-h: 110px; }
    .fruit-name { font-size: 9px; }
}
