html {
    cursor: url(../images/alternate.png) 16 16, auto;
}

a,
button,
input {
    cursor: url(../images/link.png) 16 16, pointer;
}

p,
span,
h2,
label {
    cursor: url(../images/text.png) 16 16, text;
}

/* 基础样式 */
body {
    margin: 0px 15px;
    height: 100vh;
    color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url(../images/bg.webp) no-repeat center/cover fixed;
    font-family: system-ui, -apple-system, sans-serif;
}

/* 登录容器 */
.login-container {
    width: 360px;
    padding: 2rem;
    border-radius: 16px;
    background: rgb(255 255 255 / 15%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 
        0 4px 6px -1px rgb(0 0 0 / 10%),
        0 2px 4px -2px rgb(0 0 0 / 10%);
    border: 1px solid rgb(255 255 255 / 20%);
}

/* 标题样式 */
h2 {
    margin: 0 0 1.5rem;
    font-size: 1.75rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.5px;
}

/* 表单容器 */
.form-container {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.form-container.active {
    display: block;
}

/* 表单组件 */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #f0f0f0;
}

.input-wrapper {
    position: relative;
}

/* 输入框样式 */
.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #fff;
    background: rgb(255 255 255 / 10%);
    border: 1px solid rgb(255 255 255 / 20%);
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: rgb(255 255 255 / 40%);
    background: rgb(255 255 255 / 15%);
}

.form-group input::placeholder {
    color: rgb(255 255 255 / 50%);
}

/* 错误提示 */
.error-message {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #ddd;
    background: rgb(255 0 3 / 55%);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.error-message.show {
    opacity: 1;
    visibility: visible;
}

/* 按钮样式 */
.action-buttons {
    margin-top: 2rem;
}

button {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    background: rgb(255 255 255 / 25%);
    border: 1px solid rgb(255 255 255 / 30%);
    border-radius: 8px;
    transition: all 0.3s ease;
}

button:hover {
    background: rgba(128, 128, 128, 0.35);
}

/* 表单切换链接 */
.form-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.toggle-form-link {
    color: #999;
    font-size: 14px;
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
    transition: all 0.3s;
}

.toggle-form-link:hover {
    color: #eee;
}

.toggle-form-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 50%;
    background-color: #eee;
    transition: all 0.3s;
}

.toggle-form-link:hover::after {
    width: 100%;
    left: 0;
}

/* 输入验证样式 */
.form-group input:not(:placeholder-shown):valid {
    border-color: rgb(0 200 0 / 50%);
}

/* 错误状态样式 - 放在valid样式后面以提高优先级 */
.form-group input.input-error {
    border-color: rgb(255 77 79 / 50%) !important;
}

/* 消息提示 */
.msg {
    position: fixed;
    top: 20px;
    right: 15px;
    padding: 15px;
    color: #fff;
    border-radius: 8px;
    backdrop-filter: blur(5px);
    border: 1px solid rgb(255 255 255 / 20%);
    z-index: 9999;
    animation: fadeInTop .6s forwards;
}

.msg-red { background-color: rgb(166 19 19 / 70%); }
.msg-green { background-color: rgb(0 126 0 / 70%); }
.msg-right { animation: fadeOutRight .8s forwards; }

/* 动画 */
@keyframes fadeInTop {
    from { opacity: 0; transform: translateY(-100%); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

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