
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
    background: #fbfbfd;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #fbfbfd;
    color: #1d1d1f;
    line-height: 1.5;
    letter-spacing: -0.01em;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

:root {
    --brand-blue: #0071e3;
    --brand-blue-dark: #005bb5;
    --brand-error: #de071c;
    --card-bg: rgba(255, 255, 255, 0.85);
    --input-bg: #f5f5f7;
}

/* ===== 底部波浪 ===== */
.wave-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 15vh;
    min-height: 100px;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(245, 247, 250, 0.7) 100%);
}

.waves {
    position: relative;
    width: 100%;
    height: 100%;
    margin-bottom: -7px;
}

.parallax > use {
    animation: move-forever 30s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite;
}

.parallax > use:nth-child(1) {
    animation-delay: -2s;
    animation-duration: 18s;
}

.parallax > use:nth-child(2) {
    animation-delay: -3s;
    animation-duration: 24s;
}

.parallax > use:nth-child(3) {
    animation-delay: -4s;
    animation-duration: 32s;
}

.parallax > use:nth-child(4) {
    animation-delay: -5s;
    animation-duration: 45s;
}

@keyframes move-forever {
    0% {
        transform: translate3d(-90px, 0, 0);
    }
    100% {
        transform: translate3d(85px, 0, 0);
    }
}

/* ===== 主体区域 ===== */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 10;
    padding: 30px 0;
}

/* ===== 登录卡片 ===== */
.login-card {
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 28px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.03), 0 1px 4px rgba(0, 0, 0, 0.02), inset 0 0 0 0.5px rgba(255, 255, 255, 0.8);
    padding: 44px 36px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 头部 */
.login-header {
    text-align: center;
    margin-bottom: 34px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.login-header p {
    font-size: 15px;
    color: #86868b;
    font-weight: 400;
}

/* ===== 表单 ===== */
.form-item {
    margin-bottom: 20px;
    position: relative;
}

.input-wrap {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid transparent;
    border-radius: 16px;
    height: 54px;
    transition: all 0.25s ease;
    padding: 0 16px;
}

.input-wrap:focus-within {
    background: #ffffff;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

/* 错误状态 */
.form-item.has-error .input-wrap {
    border-color: var(--brand-error) !important;
    background: #fff5f5;
}

.form-item.has-error .input-wrap i {
    color: var(--brand-error);
}

.form-item.has-error .input-wrap:focus-within {
    box-shadow: 0 0 0 4px rgba(222, 7, 28, 0.1);
}

.input-wrap i {
    font-size: 20px;
    color: #a1a1a6;
    margin-right: 12px;
    transition: color 0.25s ease;
}

.input-wrap:focus-within i {
    color: var(--brand-blue);
}

.input-wrap input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 16px;
    color: #1d1d1f;
    outline: none;
    font-family: inherit;
    font-weight: 400;
}

.input-wrap input::placeholder {
    color: #a1a1a6;
    font-weight: 400;
    font-size: 15px;
}

/* 错误提示 */
.error-msg {
    display: none;
    font-size: 12px;
    color: var(--brand-error);
    margin-top: 6px;
    padding-left: 6px;
    animation: shake 0.3s ease-in-out;
    font-weight: 500;
}

.form-item.has-error .error-msg {
    display: block;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-4px);
    }
    75% {
        transform: translateX(4px);
    }
}

/* ===== 验证码行 ===== */
.captcha-wrap {
    position: relative;
    width: 100%;
}

.captcha-wrap .input-wrap {
    width: calc(100% - 118px);
}

.captcha-img-btn {
    position: absolute;
    right: 0;
    top: 0;
    width: 106px;
    height: 54px;
    border-radius: 16px;
    border: 1px solid transparent;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px #e8e8ed;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s;
}

.captcha-img-btn:hover {
    box-shadow: inset 0 0 0 1px #d2d2d7;
}

/* 验证码图片 */
.captcha-img-btn img {
    /*width: 100%;*/
    /*height: 100%;*/
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}

/* ★ 点击刷新时：::after 伪元素 spinner 蒙层 */
.captcha-img-btn.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: rgba(255, 255, 255, 0.85) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%230071e3" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="2" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="22"/><line x1="4.93" y1="4.93" x2="7.76" y2="7.76"/><line x1="16.24" y1="16.24" x2="19.07" y2="19.07"/><line x1="2" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="22" y2="12"/><line x1="4.93" y1="19.07" x2="7.76" y2="16.24"/><line x1="16.24" y1="7.76" x2="19.07" y2="4.93"/></svg>') center no-repeat;
    background-size: 20px;
    animation: spin 1s linear infinite;
}

.captcha-img-btn.loading img {
    opacity: 0.15;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* 按钮 */
.btn-submit {
    width: 100%;
    height: 54px;
    border: none;
    border-radius: 16px;
    background: var(--brand-blue);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.2);
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.3px;
}

.btn-submit:hover:not(:disabled) {
    background: var(--brand-blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(0, 113, 227, 0.3);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.15);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 底部链接 */
.login-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 26px;
    font-size: 13px;
}

.login-footer a {
    color: var(--brand-blue);
    font-weight: 500;
}

.login-footer a:hover {
    color: var(--brand-blue-dark);
    text-decoration: underline;
}

.login-footer .text-muted {
    color: #86868b;
}

/* 页面最底部 */
.page-footer {
    position: absolute;
    bottom: 16px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: #86868b;
    z-index: 10;
    letter-spacing: 0.02em;
    font-weight: 400;
}

/* ===== 移动端宽度优化 ===== */
@media (max-width: 768px) {
    .login-container {
        padding-left: 0;
        padding-right: 0;
    }

    .login-container .layui-row {
        margin-left: 0;
        margin-right: 0;
    }

    .login-container [class*="layui-col-xs"] {
        padding-left: 0;
        padding-right: 0;
    }

    .main-wrapper {
        padding: 20px 16px;
    }

    .login-card {
        padding: 32px 20px;
        border-radius: 22px;
    }

    .login-header h1 {
        font-size: 26px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .main-wrapper {
        padding-left: 24px;
        padding-right: 24px;
    }

    .login-card {
        padding: 36px 32px;
    }
}

@media (max-width: 360px) {
    .main-wrapper {
        padding-left: 12px;
        padding-right: 12px;
    }

    .login-card {
        padding: 28px 16px;
    }

    .input-wrap {
        height: 48px;
    }

    .captcha-img-btn {
        height: 48px;
        width: 88px;
    }

    .captcha-wrap .input-wrap {
        width: calc(100% - 98px);
    }

    .btn-submit {
        height: 48px;
    }

    .wave-container {
        height: 12vh;
        min-height: 80px;
    }

    .login-header h1 {
        font-size: 24px;
    }

    .login-header p {
        font-size: 14px;
    }
}


/* 密码眼睛图标 */
.password-eye {
    font-size: 18px;
    color: #a1a1a6;
    cursor: pointer;
    margin-right: 0;
    margin-left: 8px;
    flex-shrink: 0;
    transition: color 0.2s ease;
    user-select: none;
}

.password-eye:hover {
    color: var(--brand-blue);
}

.password-eye.is-active {
    color: var(--brand-blue);
}

/* 确保 input 在图标之间正确伸缩 */
.input-wrap input[type="password"],
.input-wrap input[type="text"] {
    flex: 1;
    min-width: 0;
}
