/* ================= 基础重置与全局样式 ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
}

body {
    background: linear-gradient(120deg, #ffe2ed 0%, #eadaff 25%, #d4f7ff 50%, #e0fbf2 75%, #ffe2ed 100%);
    background-size: 200% 200%;
    animation: auroraBreathe 12s ease infinite;
    color: #333;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

@keyframes auroraBreathe {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ================= 标题模块 ================= */
.system-title-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    padding: 15px 40px;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(162, 169, 255, 0.2);
    margin-bottom: 40px;
    transition: transform 0.3s ease;
}

.system-title-card:hover {
    transform: translateY(-3px);
}

.system-title {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(90deg, #ff7eb3 0%, #9d7dfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 2px;
    user-select: none;
}

/* ================= 表单毛玻璃卡片 ================= */
.auth-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 30px;
    box-shadow: 0 15px 40px rgba(162, 169, 255, 0.15);
    width: 85%;
    max-width: 360px;
    padding: 40px 25px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.auth-card:hover {
    box-shadow: 0 20px 50px rgba(162, 169, 255, 0.25);
    background: rgba(255, 255, 255, 0.75);
}

/* ================= 输入框组 ================= */
.input-group {
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.4s ease;
    max-height: 60px;
    opacity: 1;
    overflow: hidden;
    position: relative; /* 为提示框占位 */
}

.input-group.hidden {
    max-height: 0;
    opacity: 0;
    margin-top: -25px;
    pointer-events: none;
}

.label-shape {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 65px;
    height: 36px;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    color: #9d7dfa;
    border: 1.5px solid #eadaff;
    box-shadow: 0 4px 10px rgba(157, 125, 250, 0.1);
    user-select: none;
}

.shape-cloud { border-radius: 20px; }
.shape-flag { border-radius: 15px 0 15px 0; color: #17c3b2; border-color: #a7ebe4; }
.shape-paper { border-radius: 4px 15px 15px 4px; color: #ff7eb3; border-color: #ffb6c1; }

.custom-input {
    flex: 1;
    height: 42px;
    border: 1.5px solid transparent;
    border-radius: 12px;
    padding: 0 15px;
    font-size: 15px;
    color: #555;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.02);
    outline: none;
    transition: all 0.3s ease;
}

.custom-input:focus {
    background: #fff;
    border-color: #9d7dfa;
    box-shadow: 0 0 0 4px rgba(157, 125, 250, 0.15);
}

.custom-input::placeholder { color: #bbb; font-size: 14px; }

/* ================= 密码实时提示 (新增) ================= */
.password-hint {
    display: none; /* 默认隐藏，仅注册时显示 */
    flex-direction: column;
    gap: 5px;
    margin-top: -15px;
    padding-left: 80px; /* 对齐输入框 */
    font-size: 12px;
    transition: all 0.3s ease;
}

.password-hint.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.hint-item {
    color: #8390c1;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.hint-item::before {
    content: '○';
    font-size: 10px;
}

.hint-item.valid {
    color: #17c3b2;
}
.hint-item.valid::before {
    content: '✔';
    font-weight: bold;
}

/* ================= 核心操作按钮 ================= */
.submit-btn {
    margin-top: 5px;
    height: 48px;
    border-radius: 24px;
    border: none;
    background: linear-gradient(135deg, #ff7eb3 0%, #9d7dfa 100%);
    color: white;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(157, 125, 250, 0.4);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
}

.submit-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(157, 125, 250, 0.5);
    filter: brightness(1.05);
}

.submit-btn:active {
    transform: scale(0.95) translateY(2px);
    box-shadow: 0 4px 10px rgba(157, 125, 250, 0.2);
    transition: all 0.1s ease;
}

.submit-btn:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

/* ================= 底部切换文字 ================= */
.toggle-text {
    margin-top: 25px;
    font-size: 14px;
    color: #8390c1;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    user-select: none;
    transition: color 0.3s ease;
}

.toggle-text:hover { color: #9d7dfa; text-decoration: underline; }

/* ================= 自定义弹窗 ================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    z-index: 9999; display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}

.modal-overlay.show { opacity: 1; pointer-events: auto; }

.modal-box {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border-radius: 24px; padding: 30px 25px;
    width: 80%; max-width: 320px; text-align: center;
    transform: scale(0.85); transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.show .modal-box { transform: scale(1); }
.modal-title { font-size: 18px; font-weight: 700; color: #444; margin-bottom: 12px; }
.modal-msg { font-size: 15px; color: #666; margin-bottom: 25px; line-height: 1.5; }
.modal-actions { display: flex; gap: 15px; justify-content: center; }

.modal-btn {
    flex: 1; padding: 10px 0; border-radius: 15px; border: none;
    font-size: 15px; font-weight: bold; cursor: pointer; transition: all 0.2s ease;
}

.modal-btn-confirm {
    background: linear-gradient(135deg, #ff7eb3 0%, #9d7dfa 100%); color: white;
    box-shadow: 0 4px 15px rgba(157, 125, 250, 0.3);
}

.modal-btn-confirm:hover { filter: brightness(1.1); transform: translateY(-2px); }
.modal-btn:active { transform: scale(0.95); }

/* ================= 体验增强与响应式细节 ================= */
body {
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

.system-title-card,
.auth-card {
    animation: softRise 0.58s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-card { animation-delay: 0.08s; }

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

.label-shape {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.input-group:focus-within .label-shape {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(157, 125, 250, 0.16);
}

.submit-btn:focus-visible,
.modal-btn:focus-visible,
.toggle-text:focus-visible {
    outline: 3px solid rgba(157, 125, 250, 0.24);
    outline-offset: 3px;
}

@media (max-width: 420px) {
    body { padding: 24px 0; justify-content: center; }
    .system-title-card { padding: 14px 24px; margin-bottom: 28px; }
    .system-title { font-size: 19px; }
    .auth-card { width: calc(100% - 32px); padding: 32px 20px; gap: 22px; }
    .input-group { gap: 10px; }
    .label-shape { width: 58px; font-size: 12px; }
    .password-hint { padding-left: 68px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
