/* index.css */

/* Disable focus effect for all elements */
* {
    outline: none;
    user-select: none;
}

/* Define reusable variables */
:root {
    --background-color: #222222;
    --navbar-height: 50px;
    /* --vh 将由 JS 填充，fallback 1vh */
    --vh: 1vh;
}

/* Custom CSS for the body */
body {
    overflow: hidden;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    touch-action: none;
    -webkit-touch-callout: none;
    /* 支持 iOS Safari 安全区域 */
    padding-bottom: env(safe-area-inset-bottom);
}

/* Common styles for centering elements */
.center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Custom CSS for the wrapper container */
.wrapper {
    position: relative;
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    /* 动态高度，使用 JS 计算的 --vh */
    height: calc(var(--vh, 1vh) * 100);
}

/* Custom CSS for the navigation bar */
.navbar {
    position: fixed;
    width: 100%;
    max-width: 650px;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: var(--navbar-height);
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10; /* 提高 z-index */
}

/* Custom CSS for the navbar title */
.navbar h1 {
    margin: 0;
    font-size: 1.5em;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Custom CSS for the photo container */
.photo-container {
    height: 100vh;
    width: 100%;
    /* Ensure photo width fills container */
    overflow: hidden;
}

/* 新增 CSS 过渡效果 */
.photo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
    z-index: 1; /* 默认低于 UI 元素 */
}

.photo.active {
    opacity: 1;
    z-index: 1;
}

.photo.next {
    opacity: 0;
    z-index: 1;  /* 保持同级，或根据动画需要微调 */
}

/* Custom CSS for the interaction buttons */
.interaction-buttons {
    position: absolute;
    bottom: calc(3% + env(safe-area-inset-bottom)); /* 可加上安全区 inset */
    display: flex;
    flex-direction: column;  /* 垂直排列 */
    align-items: flex-end;   /* 整体按钮组靠右显示 */
    z-index: 10;  /* 提高 z-index */
    width: 94%;
}

/* 新增 interaction-item 容器 */
.interaction-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* 保证所有 item 宽度一致：
       如果要让它自动缩放到图片和文字的最小宽度，可以改为 width: fit-content; */
    width: clamp(48px, 7%, 60px);
    margin-top: 3%;
}

/* 图片统一大小，让其填满 .interaction-item 的宽度 */
.interaction-item img {
    width: 100%;          /* 让图片宽度随容器 */
    aspect-ratio: 1 / 1;  /* 等比正方形 */
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 2px;   /* 图片和文字之间留一点间距 */
}

/* 数字/文字保持居中 */
.interaction-item p {
    margin: 0;
    text-align: center;
    font-size: 1em;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Custom CSS for the author comment section */
.author-comment {
    position: absolute;
    bottom: calc(3% + env(safe-area-inset-bottom));
    padding-left: 3%;
    right: 16%;
    width: 84%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-sizing: border-box;
    z-index: 10;  /* 提高 z-index */
}

.author-name {
    margin: 0;
    font-size: 1em;
    font-weight: bold;
    color: white;
    /* white color */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    /* Darker shadow */
}

.author-text {
    margin: 0;
    font-size: 1em;
    color: white;
    /* white color */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    /* Darker shadow */
}

/* Media Query for Small Devices (Smartphones) */
@media only screen and (max-width: 650px) {
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .navbar h1 {
        font-size: 1.2em;
        /* Adjust font size */
    }

    .interaction-buttons {
        bottom: calc(3% + env(safe-area-inset-bottom));
    }

    .author-comment {
        bottom: calc(3% + env(safe-area-inset-bottom));
    }
}

/* Media Query for Large Devices (Desktops) */
@media only screen and (min-width: 651px) {
    .navbar h1 {
        font-size: 1.5em;
        /* Adjust font size */
    }
}

.swipe-up {
    transform: translateY(-100%);
    opacity: 0;
}

.swipe-down {
    transform: translateY(100%);
    opacity: 0;
}

