/* 引入自定义字体Lolita | Introduce the custom font Lolita */
@font-face {
    font-family: 'Lolita';
    src: url('assets/fonts/Lolita.woff2') format('woff2'),
         url('assets/fonts/Lolita.woff') format('woff'),
         url('assets/fonts/Lolita.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* 全局body样式设置 | Global body style settings */
body {
    background-color: #f1d5da;
    text-align: center;
    font-family: 'Lolita', Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* 表白内容容器样式 | Style of the confession content container */
.container {
    width: 90%;
    max-width: 500px;
}

/* 主图片样式 | Style of the main image */
#mainImage {
    width: 100%;
    max-width: 200px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 侧头图片样式 | Style of the side head image */
#sidehead {
    width: 100%;
    max-width: 200px;
    margin-bottom: 20px;
}

/* 链接样式 | Style of the links */
#nameInputContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/*免费声明样式 | Free declaration*/
.free-notice {
    font-size: 1.5vw;
    color: #ff6b6b;
    margin: 10px 0;
    padding: 8px;
    background: #fff0f0;
    border-radius: 15px;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-3px); }
}

#sidehead-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#xiaohongshuLink,
#douyinLink,
#repoLink {
    font-size: 2vw;
    color: #68495b;
    text-decoration: none;
    margin-top: 5px;
}

/* 标题样式 | Style of the title */
h1 {
    font-size: 3.5vw;
    color: #68495b;
    margin: 20px 0;
    word-wrap: break-word;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 按钮通用样式 | General style of the buttons */
button {
    font-family: 'Lolita', Arial, sans-serif;
    font-size: 4vw;
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 语言选择器样式 | Language selector styling */
#languageSelect.styled-select {
    /* 字体设置 | Font settings */
    font-family: 'Lolita', Arial, sans-serif;
    /* 主背景色（与确认按钮相同）| Main background color (same as confirm button) */
    background-color: #a581d4;
    color: white;
    /* 圆角半径 | Border radius */
    border-radius: 20px;
    /* 内边距（右侧预留箭头空间）| Padding (right padding for arrow) */
    padding: 10px 45px 10px 20px;
    border: none;
    /* 响应式字号 | Responsive font size */
    font-size: 4vw;
    cursor: pointer;
    /* 隐藏原生样式 | Hide native styling */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    /* 过渡动画 | Transition animation */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* 自定义下拉箭头 | Custom dropdown arrow */
    background-image: url('data:image/svg+xml;utf8,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7 10L12 15L17 10H7Z" fill="white"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
}

/* 桌面端适配 | Desktop adaptation */
@media (min-width: 768px) {
    #languageSelect.styled-select {
        font-size: 18px;
        /* 调整内边距 | Adjust padding */
        padding: 10px 40px 10px 15px;
        /* 箭头位置微调 | Arrow position adjustment */
        background-position: right 12px center;
    }
}

/* 移动端优化 | Mobile optimization */
@media (max-width: 767px) {
    #languageSelect.styled-select {
        /* 响应式字号 | Responsive font size */
        font-size: 5.5vw;
        margin: 5px;
    }
}

/* 交互状态 | Interaction states */
#languageSelect.styled-select:focus {
    /* 焦点轮廓 | Focus outline */
    outline: 2px solid #d4818e;
    outline-offset: 2px;
}

#languageSelect.styled-select:active {
    /* 点击效果 | Click effect */
    transform: scale(0.95);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* 下拉菜单样式 | Dropdown menu styling */
#languageSelect.styled-select option {
    /* 选项背景色 | Option background color */
    background: #f1d5da;
    /* 选项文字色 | Option text color */
    color: #68495b;
    font-family: 'Lolita', Arial, sans-serif;
}

/* “可以”按钮样式 | Style of the "Yes" button */
#yes {
    background-color: #d4818e;
    color: white;
}

/* “不要”按钮样式 | Style of the "No" button */
#no {
    background-color: #6784b1;
    color: white;
    position: relative;
}

/* 表白成功页面样式 | Style of the successful confession page */
.yes-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffdae0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

/* 表白成功文字样式 | Style of the text for successful confession */
.yes-text {
    font-family: 'Lolita', Arial, sans-serif;
    font-size: 7vw;
}

/* 表白成功图片样式 | Style of the image for successful confession */
.yes-image {
    width: 50%;
    max-width: 300px;
}

/* 输入框样式 | Style of the input box */
input[type="text"] {
    font-family: 'Lolita', Arial, sans-serif;
    font-size: 3.5vw;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    margin-bottom: 10px;
    width: 90%;
    box-sizing: border-box;
    word-wrap: break-word;
}

/* 按钮激活（点击）样式，优化点击反馈 | Style of the button when activated (clicked), optimizing click feedback */
button:active {
    transform: scale(0.95);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* 按钮获得焦点样式，焦点管理 | Style of the button when it gets focus, focus management */
button:focus {
    outline: 2px solid #d4818e;
    outline-offset: 2px;
}

/* 输入框获得焦点样式，焦点管理 | Style of the input box when it gets focus, focus management */
input:focus {
    outline: 2px solid #d4818e;
    outline-offset: 2px;
}

/* 电脑端样式优化，当屏幕宽度大于等于768px时应用以下样式 | Style optimization for desktop, apply the following styles when the screen width is greater than or equal to 768px */
@media (min-width: 768px) {
    body {
        display: flex;
    }
   .container {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: auto;
        max-width: none;
    }
    #mainImage {
        width: 200px;
    }
    h1 {
        font-size: 20px;
        margin: 20px 0;
    }
    button {
        font-size: 18px;
    }
   .yes-text {
        font-size: 36px;
    }
   .yes-image {
        width: 300px;
    }
    input[type="text"] {
        font-size: 16px;
        width: 300px;
    }
    #nameInputContainer {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    #sidehead {
        width: 200px;
    }
    #xiaohongshuLink,
    #douyinLink,
    #repoLink {
        font-size: 16px;
        margin-top: 10px;
    }
}

/* 移动端优先样式优化 | Mobile-first style optimization */
@media (max-width: 767px) {
    /* 基础布局调整 | Base layout adjustment */
    body {
        height: auto;
        min-height: 100vh;
        padding: 15px;
    }

    /* 输入容器优化 | Input container optimization */
    #nameInputContainer {
        width: 95%;
        transform: none;
        position: relative;
        top: auto;
        left: auto;
    }

    /* 文字大小优化 | Text size optimization */
    h1 {
        font-size: 6vw !important;
        margin: 10px 0;
    }

    /* 免费声明优化 | Free notice optimization */
    .free-notice {
        font-size: 14px;  /* 固定像素保证可读性 | Fixed pixels for readability */
        margin: 5px 0;
        padding: 6px;
    }

    /* 按钮优化 | Button optimization */
    button {
        font-size: 5.5vw;
        padding: 8px 15px;
        margin: 5px;
    }

    /* 输入框优化 | Input field optimization */
    input[type="text"] {
        font-size: 16px;
        width: 85%;
    }

    /* 链接优化 | Link optimization */
    #xiaohongshuLink,
    #douyinLink,
    #repoLink {
        font-size: 14px;
        margin-top: 3px;
    }

    /* 图片尺寸优化 | Image size optimization */
    #mainImage, #sidehead {
        max-width: 150px;
    }

    /* 表白成功页面优化 | Success page optimization */
    .yes-text {
        font-size: 8vw;
        padding: 0 10px;
    }
}

/* 超小屏适配 (iPhone SE等) | Ultra-small screen adaptation (e.g. iPhone SE) */
@media (max-width: 320px) {
    h1 {
        font-size: 20px !important;
    }
    button {
        font-size: 18px;
    }
    .free-notice {
        font-size: 12px;
    }
}

/* 横向手机适配 | Landscape mobile adaptation */
@media (max-height: 500px) and (orientation: landscape) {
    #nameInputContainer {
        transform: scale(0.85);
        padding-top: 5px;
    }
    #sidehead {
        max-width: 100px;
    }
}


/* 新增动画关键帧，实现从下往上冒出和渐显效果 | Add a new animation keyframe to achieve the effect of emerging from the bottom and fading in */
@keyframes slideUpFadeIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 用于触发动画的类名 | Class name used to trigger the animation */
.slide-up-fade-in {
    animation: slideUpFadeIn 0.5s ease-out both;
}

/* 新增动画关键帧，实现慢慢浮现效果 | Add a new animation keyframe to achieve the effect of slowly fading in */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


/* 用于触发慢慢浮现动画的类名 | Class name used to trigger the slow fade-in animation */
.fade-in {
    animation: fadeIn 1s ease-out both;
}
