/* =====================================================
   超级情报局 - 炫酷输入框样式
   基于 input.js 的霓虹发光效果
   ===================================================== */

/* 基础输入框容器 */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

/* 网格背景 */
.input-grid-bg {
    height: 70px;
    width: 320px;
    background-image: linear-gradient(to right, #0f0f10 1px, transparent 1px),
      linear-gradient(to bottom, #0f0f10 1px, transparent 1px);
    background-size: 1rem 1rem;
    background-position: center center;
    position: absolute;
    z-index: -1;
    filter: blur(1px);
}

/* 白色发光层 */
.input-white,
.input-border,
.input-darkBorderBg,
.input-glow {
    max-height: 70px;
    max-width: 314px;
    height: 100%;
    width: 100%;
    position: absolute;
    overflow: hidden;
    z-index: -1;
    border-radius: 12px;
    filter: blur(3px);
}

/* 实际输入框 */
.form-input {
    background-color: #010201;
    border: none;
    width: 301px;
    height: 56px;
    border-radius: 10px;
    color: white;
    padding-inline: 59px;
    font-size: 18px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    z-index: 1;
}

.form-input::placeholder {
    color: #c0b9c0;
}

.form-input:focus {
    outline: none;
}

/* 输入框聚焦时隐藏mask */
.input-wrapper:focus-within .input-mask {
    display: none;
}

/* 粉红mask */
.input-pink-mask {
    pointer-events: none;
    width: 30px;
    height: 20px;
    position: absolute;
    background: #cf30aa;
    top: 10px;
    left: 5px;
    filter: blur(20px);
    opacity: 0.8;
    transition: all 2s;
    z-index: 2;
}

.input-wrapper:hover .input-pink-mask {
    opacity: 0;
}

/* 白色层 */
.input-white {
    max-height: 63px;
    max-width: 307px;
    border-radius: 10px;
    filter: blur(2px);
}

.input-white::before {
    content: "";
    z-index: -2;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(83deg);
    position: absolute;
    width: 600px;
    height: 600px;
    background-repeat: no-repeat;
    background-position: 0 0;
    filter: brightness(1.4);
    background-image: conic-gradient(
      rgba(0, 0, 0) 0%,
      #a099d8,
      rgba(0, 0, 0) 8%,
      rgba(0, 0, 0) 50%,
      #dfa2da,
      rgba(0, 0, 0) 58%
    );
    transition: all 2s;
}

/* 边框层 */
.input-border {
    max-height: 59px;
    max-width: 303px;
    border-radius: 11px;
    filter: blur(0.5px);
}

.input-border::before {
    content: "";
    z-index: -2;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(70deg);
    position: absolute;
    width: 600px;
    height: 600px;
    filter: brightness(1.3);
    background-repeat: no-repeat;
    background-position: 0 0;
    background-image: conic-gradient(
      #1c191c,
      #402fb5 5%,
      #1c191c 14%,
      #1c191c 50%,
      #cf30aa 60%,
      #1c191c 64%
    );
    transition: all 2s;
}

/* 深色边框层 */
.input-darkBorderBg {
    max-height: 65px;
    max-width: 312px;
}

.input-darkBorderBg::before {
    content: "";
    z-index: -2;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(82deg);
    position: absolute;
    width: 600px;
    height: 600px;
    background-repeat: no-repeat;
    background-position: 0 0;
    background-image: conic-gradient(
      rgba(0, 0, 0, 0),
      #18116a,
      rgba(0, 0, 0) 10%,
      rgba(0, 0, 0) 50%,
      #6e1b60,
      rgba(0, 0, 0) 60%
    );
    transition: all 2s;
}

/* 发光层 */
.input-glow {
    overflow: hidden;
    filter: blur(30px);
    opacity: 0.4;
    max-height: 130px;
    max-width: 354px;
}

.input-glow::before {
    content: "";
    z-index: -2;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(60deg);
    position: absolute;
    width: 999px;
    height: 999px;
    background-repeat: no-repeat;
    background-position: 0 0;
    background-image: conic-gradient(
      #000,
      #402fb5 5%,
      #000 38%,
      #000 50%,
      #cf30aa 60%,
      #000 87%
    );
    transition: all 2s;
}

/* 悬停和聚焦时的动画效果 */
.input-wrapper:hover .input-darkBorderBg::before,
.input-wrapper:focus-within .input-darkBorderBg::before {
    transform: translate(-50%, -50%) rotate(262deg);
}

.input-wrapper:hover .input-glow::before,
.input-wrapper:focus-within .input-glow::before {
    transform: translate(-50%, -50%) rotate(240deg);
}

.input-wrapper:hover .input-white::before,
.input-wrapper:focus-within .input-white::before {
    transform: translate(-50%, -50%) rotate(263deg);
}

.input-wrapper:hover .input-border::before,
.input-wrapper:focus-within .input-border::before {
    transform: translate(-50%, -50%) rotate(250deg);
}

/* 聚焦时的动画效果 */
.input-wrapper:focus-within .input-darkBorderBg::before {
    transform: translate(-50%, -50%) rotate(442deg);
    transition: all 4s;
}

.input-wrapper:focus-within .input-glow::before {
    transform: translate(-50%, -50%) rotate(420deg);
    transition: all 4s;
}

.input-wrapper:focus-within .input-white::before {
    transform: translate(-50%, -50%) rotate(443deg);
    transition: all 4s;
}

.input-wrapper:focus-within .input-border::before {
    transform: translate(-50%, -50%) rotate(430deg);
    transition: all 4s;
}

/* 搜索图标 */
.input-search-icon {
    position: absolute;
    left: 20px;
    top: 15px;
    z-index: 2;
    color: #666;
}

/* 过滤器图标 */
.filter-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    max-height: 40px;
    max-width: 38px;
    height: 100%;
    width: 100%;
    isolation: isolate;
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(180deg, #161329, black, #1d1b4b);
    border: 1px solid transparent;
}

/* 小型输入框变体 */
.input-wrapper-sm .input-grid-bg {
    width: 100%;
    height: 50px;
}

.input-wrapper-sm .form-input {
    width: 100%;
    height: 45px;
    font-size: 14px;
    padding-inline: 40px;
}

.input-wrapper-sm .input-white,
.input-wrapper-sm .input-border,
.input-wrapper-sm .input-darkBorderBg,
.input-wrapper-sm .input-glow {
    max-height: 50px;
}

.input-wrapper-sm .input-pink-mask {
    top: 8px;
    left: 3px;
}

.input-wrapper-sm .input-search-icon {
    left: 12px;
    top: 12px;
}

/* =====================================================
   移动端优化样式
   针对手机设备简化特效，提升性能
   ===================================================== */

/* 移动端媒体查询 - 屏幕宽度小于 768px */
@media screen and (max-width: 768px) {
    /* 简化输入框容器 */
    .input-wrapper {
        margin-bottom: 15px;
        /* 启用硬件加速 */
        transform: translateZ(0);
        will-change: transform;
    }

    /* 简化网格背景 - 减少模糊 */
    .input-grid-bg {
        filter: blur(0.5px);
    }

    /* 简化发光层 - 减少 blur 强度 */
    .input-white,
    .input-border,
    .input-darkBorderBg,
    .input-glow {
        filter: blur(1px);
        /* 减少过渡动画时间 */
        transition: all 0.5s;
    }

    /* 简化粉红 mask */
    .input-pink-mask {
        filter: blur(10px);
        opacity: 0.6;
    }

    /* 输入框保持原样 */
    .form-input {
        width: 100%;
        height: 50px;
        font-size: 16px; /* 移动端使用 16px 避免自动缩放 */
        padding-inline: 50px;
    }

    /* 减少悬停/聚焦时的动画效果 */
    .input-wrapper:hover .input-darkBorderBg::before,
    .input-wrapper:focus-within .input-darkBorderBg::before,
    .input-wrapper:hover .input-glow::before,
    .input-wrapper:focus-within .input-glow::before,
    .input-wrapper:hover .input-white::before,
    .input-wrapper:focus-within .input-white::before,
    .input-wrapper:hover .input-border::before,
    .input-wrapper:focus-within .input-border::before {
        transition: all 1s; /* 缩短过渡时间 */
    }

    .input-wrapper:focus-within .input-darkBorderBg::before,
    .input-wrapper:focus-within .input-glow::before,
    .input-wrapper:focus-within .input-white::before,
    .input-wrapper:focus-within .input-border::before {
        transition: all 2s;
    }

    /* 发光层优化 */
    .input-glow {
        filter: blur(15px);
        opacity: 0.3;
    }
}

/* 超小屏幕优化 - 屏幕宽度小于 360px */
@media screen and (max-width: 360px) {
    .form-input {
        height: 46px;
        font-size: 15px;
        padding-inline: 45px;
    }

    .input-white,
    .input-border,
    .input-darkBorderBg,
    .input-glow {
        filter: blur(0.5px);
    }

    .input-glow {
        filter: blur(10px);
    }
}