@charset "utf-8";

* {
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    background: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
                 "Helvetica Neue", Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* ========================================================
   背景层：图片 + 视频
   ======================================================== */
.bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: no-repeat center center;
    background-size: cover;
    opacity: 1;
    transition: opacity 1.2s ease;
}

.bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.2s ease;
    background: #000;
}

/* ========================================================
   主盒子（毛玻璃）
   ======================================================== */
.box {
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 350px;
    height: auto;
    min-height: 380px;
    padding: 30px 0;
    border-top: 1px solid rgba(255,255,255,0.5);
    border-left: 1px solid rgba(255,255,255,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.2);
    border-right: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(50,50,50,0.2);
    box-sizing: border-box;
}

.box > h2 {
    color: rgba(255,255,255,0.9);
    margin-bottom: 20px;
}

.box .input-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: start;
    margin-bottom: 10px;
}

.box .input-box > label {
    margin-bottom: 5px;
    color: rgba(255,255,255,0.9);
    font-size: 13px;
}

.box .input-box input {
    box-sizing: border-box;
    color: #000;
    font-size: 14px;
    height: 35px;
    width: 250px;
    background: rgba(255,255,255,0.3);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 5px;
    transition: 0.2s;
    outline: none;
    padding: 0 10px;
    letter-spacing: 1px;
}

.box .input-box input::placeholder {
    color: rgba(0,0,0,0.45);
}

.box .input-box input:focus {
    border: 1px solid rgba(255,255,255,0.8);
}

/* ===== 按钮区 ===== */
.box .btn-box {
    width: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.box .btn-box > a {
    font-size: 14px;
    text-decoration: none;
    color: rgba(255,255,255,0.9);
    transition: 0.2s;
    width: 250px;
    text-align: end;
}

.box .btn-box > a:hover {
    color: rgba(255,255,255,1);
}

.box .btn-box > div {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: start;
    margin-top: 20px;
    width: 250px;
}

.box .btn-box > div > button {
    width: 120px;
    height: 35px;
    border: 1px solid rgba(197, 81, 58,0.8);
    background: rgba(197, 81, 58,0.5);
    color: rgba(255,255,255,0.9);
    border-radius: 5px;
    transition: 0.2s;
    cursor: pointer;
}

.box .btn-box > div > button:nth-of-type(2) {
    margin-left: 10px;
}

.box .btn-box > div > button:only-child {
    width: 250px;
}

.box .btn-box > div > button:hover {
    border: 1px solid rgba(248, 108, 76,0.8);
    background: rgba(248, 108, 76,0.5);
}

/* ===== 验证码行 ===== */
.box .input-box .code-box {
    display: flex;
    align-items: center;
    width: 250px;
    gap: 8px;
}

.box .input-box .code-box input {
    flex: 1;
    min-width: 0;
    width: auto;
    text-align: center;
    letter-spacing: 4px;
    padding: 0 4px 0 8px;
}

.box .input-box .code-box .code-btn {
    flex-shrink: 0;
    box-sizing: border-box;
    width: 100px;
    height: 35px;
    font-size: 13px;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.3);
    border-radius: 5px;
    outline: none;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}

.box .input-box .code-box .code-btn:hover:not(:disabled) {
    border: 1px solid rgba(255,255,255,0.8);
}

.box .input-box .code-box .code-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== 提示文字 ===== */
.box .tip {
    width: 250px;
    min-height: 16px;
    margin: 2px 0 4px;
    font-size: 12px;
    text-align: left;
    opacity: 0;
    transition: opacity 0.3s;
}

.box .tip.show {
    opacity: 1;
}

/* ========================================================
   右上角控制区（语言 + 背景）
   ======================================================== */
.top-right-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    font-family: inherit;
}

.lang-switcher,
.bg-switcher {
    position: relative;
}

.lang-switcher {
    z-index: 2;
}

.bg-switcher {
    z-index: 1;
}

.lang-btn,
.bg-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 130px;
    height: 36px;
    padding: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(50, 50, 50, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: 0.3s;
    white-space: nowrap;
}

.lang-btn:hover,
.bg-btn:hover {
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(50, 50, 50, 0.4);
}

/* ===== 通用下拉容器 ===== */
.lang-dropdown,
.bg-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 130px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(50, 50, 50, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    max-height: 0;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition:
        max-height 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.45s ease,
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.lang-dropdown.show,
.bg-dropdown.show {
    max-height: 500px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.lang-dropdown a {
    padding: 10px 15px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    text-align: left;
    transition: 0.2s;
    white-space: nowrap;
}

.lang-dropdown a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ========================================================
   背景切换器的分类 & 条目
   ======================================================== */
.bg-category {
    display: flex;
    flex-direction: column;
}

.bg-cat-title {
    padding: 10px 15px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    text-align: left;
    transition: 0.2s;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bg-cat-title:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.bg-items {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
    transition:
        max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.4s ease,
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    background: rgba(0, 0, 0, 0.12);
}

.bg-category.active .bg-items {
    max-height: 320px;
    opacity: 1;
    transform: translateY(0);
}

.bg-items a {
    padding: 9px 15px 9px 28px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    text-align: left;
    transition: 0.2s;
    white-space: nowrap;
    position: relative;
}

.bg-items a::before {
    content: '·';
    position: absolute;
    left: 16px;
    color: rgba(255, 255, 255, 0.5);
}

.bg-items a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ========================================================
   忘记密码弹窗
   ======================================================== */
.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: maskIn 0.2s ease;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

@keyframes maskIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-box {
    width: 350px;
    padding: 30px 0;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.5);
    border-left: 1px solid rgba(255,255,255,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.2);
    border-right: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(50,50,50,0.4);
    animation: boxIn 0.25s ease;
    box-sizing: border-box;
}

@keyframes boxIn {
    from { transform: translateY(12px) scale(0.98); opacity: 0; }
    to   { transform: translateY(0)   scale(1);    opacity: 1; }
}

.modal-box > h3 {
    color: rgba(255,255,255,0.9);
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 20px;
}

.modal-box .input-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: start;
    margin-bottom: 10px;
}

.modal-box .input-box > label {
    margin-bottom: 5px;
    color: rgba(255,255,255,0.9);
    font-size: 13px;
}

.modal-box .input-box input,
.modal-box .input-box textarea {
    box-sizing: border-box;
    width: 250px;
    color: #000;
    font-size: 14px;
    letter-spacing: 1px;
    background: rgba(255,255,255,0.3);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 5px;
    outline: none;
    transition: 0.2s;
    font-family: inherit;
}

.modal-box .input-box input {
    height: 35px;
    padding: 0 10px;
}

.modal-box .input-box textarea {
    height: 70px;
    padding: 8px 10px;
    resize: none;
    line-height: 1.5;
}

.modal-box .input-box input::placeholder,
.modal-box .input-box textarea::placeholder {
    color: rgba(0,0,0,0.45);
}

.modal-box .input-box input:focus,
.modal-box .input-box textarea:focus {
    border: 1px solid rgba(255,255,255,0.8);
}

.modal-box .tip {
    width: 250px;
    min-height: 16px;
    margin: 2px 0 4px;
    font-size: 12px;
    text-align: left;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-box .tip.show {
    opacity: 1;
}

.modal-box .btn-box {
    width: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-box .btn-box > div {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: start;
    margin-top: 10px;
    width: 250px;
}

.modal-box .btn-box > div > button {
    width: 120px;
    height: 35px;
    border: 1px solid rgba(197, 81, 58, 0.8);
    background: rgba(197, 81, 58, 0.5);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 5px;
    transition: 0.2s;
    cursor: pointer;
}

.modal-box .btn-box > div > button:nth-of-type(2) {
    margin-left: 10px;
}

.modal-box .btn-box > div > button:hover {
    border: 1px solid rgba(248, 108, 76, 0.8);
    background: rgba(248, 108, 76, 0.5);
}

/* ============================================================
   📱 移动端适配（480px 及以下）
   桌面端样式一律不动，只在窄屏时覆盖
   ============================================================ */
@media (max-width: 480px) {

    /* ---------- 页面容器：允许滚动、顶部留空 ---------- */
    body {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
        justify-content: flex-start;
        padding: 76px 16px 30px;
        box-sizing: border-box;
    }

    /* ---------- 主盒子：宽度自适应，左右留白 ---------- */
    .box {
        width: 100%;
        max-width: 380px;
        min-height: 0;
        padding: 30px 18px;
        border-radius: 16px;
        margin: auto 0;   /* 内容不足时垂直居中 */
    }

    .box > h2 {
        font-size: 20px;
        margin-bottom: 18px;
    }

    /* 输入框：撑满盒子，高度加大到 44px */
    .box .input-box {
        width: 100%;
        margin-bottom: 12px;
    }

    .box .input-box > label {
        font-size: 13px;
    }

    .box .input-box input {
        width: 100%;
        height: 44px;
        font-size: 15px;
        letter-spacing: 0.5px;
    }

    /* 验证码行 */
    .box .input-box .code-box {
        width: 100%;
        gap: 8px;
    }

    .box .input-box .code-box input {
        height: 44px;
        letter-spacing: 3px;
        font-size: 16px;
    }

    .box .input-box .code-box .code-btn {
        height: 44px;
        width: 104px;
        font-size: 13px;
    }

    /* 按钮区 */
    .box .btn-box {
        width: 100%;
    }

    .box .btn-box > a {
        width: 100%;
        font-size: 13px;
    }

    .box .btn-box > div {
        width: 100%;
        margin-top: 16px;
    }

    .box .btn-box > div > button {
        flex: 1;
        width: auto;
        height: 44px;
        font-size: 15px;
    }

    .box .btn-box > div > button:only-child {
        width: 100%;
    }

    /* 提示文字 */
    .box .tip {
        width: 100%;
        font-size: 13px;
    }

    /* ---------- 右上角控制：小一点，别抢位置 ---------- */
    .top-right-controls {
        top: 12px;
        right: 12px;
        gap: 8px;
    }

    .lang-btn,
    .bg-btn {
        width: 104px;
        height: 34px;
        font-size: 13px;
        border-radius: 8px;
    }

    .lang-dropdown,
    .bg-dropdown {
        min-width: 118px;
    }

    .lang-dropdown a {
        padding: 10px 13px;
        font-size: 13px;
    }

    .bg-cat-title {
        padding: 10px 13px;
        font-size: 13px;
    }

    .bg-items a {
        padding: 9px 13px 9px 24px;
        font-size: 12.5px;
    }

    /* ---------- 忘记密码弹窗：同样自适应 ---------- */
    .modal-mask {
        padding: 16px;
        align-items: flex-start;
    }

    .modal-box {
        width: 100%;
        max-width: 380px;
        padding: 24px 18px;
        border-radius: 16px;
        margin: auto 0;
    }

    .modal-box > h3 {
        font-size: 17px;
        margin-bottom: 16px;
    }

    .modal-box .input-box {
        width: 100%;
    }

    .modal-box .input-box input,
    .modal-box .input-box textarea {
        width: 100%;
    }

    .modal-box .input-box input {
        height: 44px;
        font-size: 15px;
    }

    .modal-box .input-box textarea {
        height: auto;
        min-height: 84px;
        font-size: 15px;
    }

    .modal-box .tip {
        width: 100%;
        font-size: 13px;
    }

    .modal-box .btn-box,
    .modal-box .btn-box > div {
        width: 100%;
    }

    .modal-box .btn-box > div > button {
        flex: 1;
        width: auto;
        height: 44px;
        font-size: 15px;
    }
}

/* ============================================================
   📱 超小屏（360px 以下）进一步压缩
   ============================================================ */
@media (max-width: 360px) {

    body {
        padding: 70px 12px 24px;
    }

    .box {
        padding: 24px 14px;
    }

    .box .input-box input,
    .box .input-box .code-box input,
    .box .input-box .code-box .code-btn,
    .box .btn-box > div > button {
        height: 42px;
    }

    .box .input-box .code-box .code-btn {
        width: 96px;
        font-size: 12.5px;
    }

    .lang-btn,
    .bg-btn {
        width: 96px;
        height: 32px;
        font-size: 12.5px;
    }
}

/* ============================================================
   📱 触屏设备：移除 hover 的“粘滞”效果
   ============================================================ */
@media (hover: none) {

    .box .btn-box > div > button:hover {
        border: 1px solid rgba(197, 81, 58, 0.8);
        background: rgba(197, 81, 58, 0.5);
    }

    .box .input-box .code-box .code-btn:hover:not(:disabled) {
        border: 1px solid rgba(255, 255, 255, 0.5);
        background: rgba(255, 255, 255, 0.3);
    }

    .lang-btn:hover,
    .bg-btn:hover {
        border-color: rgba(255, 255, 255, 0.5);
        background: rgba(50, 50, 50, 0.2);
    }

    .box .btn-box > a:hover {
        color: rgba(255, 255, 255, 0.9);
    }
}

/* ============================================================
   📱 横屏矮屏：允许滚动
   ============================================================ */
@media (max-height: 520px) {
    body {
        height: auto;
        min-height: 100dvh;
        overflow-y: auto;
        justify-content: flex-start;
        padding: 70px 16px 20px;
    }

    .box {
        margin: 0 auto;
    }
}