/* ====== 曙光站 · 登录注册样式 ====== */
:root {
    --primary: #4f9eff;
    --primary-dark: #2b6eb0;
    --primary-light: #8ac0ff;
    --accent: #ff6b8a;
    --bg: #f0f6ff;
    --bg-card: rgba(255,255,255,0.78);
    --text: #2f4858;
    --text-light: #6b8a9f;
    --text-muted: #99b0c4;
    --border: rgba(176,212,255,0.5);
    --shadow-sm: 0 2px 8px rgba(43,110,176,0.08);
    --shadow: 0 8px 32px rgba(43,110,176,0.12);
    --shadow-lg: 0 20px 50px rgba(43,110,176,0.18);
    --radius: 14px;
    --radius-lg: 22px;
    --radius-xl: 60px;
    --font: -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei","Helvetica Neue",sans-serif;
    --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
    --bg-image: url('ima/bg.jpg');
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: var(--font);
    min-height: 100vh;
    background: linear-gradient(135deg, #e8f2ff 0%, #d4e6ff 30%, #c8dcff 60%, #e0ecff 100%);
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow-x: hidden;
}

/* 背景光点动画（纯CSS） */
body::before {
    content: '';
    position: fixed;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background:
        radial-gradient(circle at 20% 30%, rgba(79,158,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(120,100,255,0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255,107,138,0.05) 0%, transparent 50%);
    animation: bgFloat 20s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}
@keyframes bgFloat {
    0%,100% { transform: translate(0,0) rotate(0deg); }
    33% { transform: translate(2%,1%) rotate(1deg); }
    66% { transform: translate(-1%,-1%) rotate(-1deg); }
}

/* ====== 卡片容器 ====== */
.auth-container {
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: var(--radius-xl) var(--radius-xl) 48px 48px;
    padding: 1.8rem 2rem 1.5rem;
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.8);
    position: relative;
    overflow: hidden;
}

/* 卡片微光边框 */
.auth-card::before {
    content: '';
    position: absolute;
    top: -2px; left: 20%; right: 20%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-light), var(--primary), var(--primary-light), transparent);
    border-radius: 2px;
    animation: shimmer 3s ease-in-out infinite;
}
@keyframes shimmer {
    0%,100% { opacity: 0.4; left: 20%; right: 20%; }
    50% { opacity: 1; left: 5%; right: 5%; }
}

/* ====== LOGO ====== */
.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.8rem;
    position: relative;
    z-index: 1;
}
.logo-wrapper {
    width: auto; height: auto;
    margin-bottom: 0.4rem;
    filter: drop-shadow(0 6px 16px rgba(79,158,255,0.35));
    transition: transform var(--transition);
}
.logo-wrapper:hover { transform: scale(1.06); }
.logo-image {
    width: 72px; height: auto;
    border-radius: 20px;
    display: block;
    transition: transform var(--transition);
}
.logo-image:hover { transform: rotate(3deg); }
.logo-text { text-align: center; }
.logo-text .site-name {
    font-size: 1.8rem; font-weight: 800;
    background: linear-gradient(135deg, #2563eb, #4f9eff, #7bb5ff);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    letter-spacing: 3px;
    line-height: 1.2;
}
.logo-text .slogan {
    color: var(--primary-dark);
    font-size: 0.85rem;
    letter-spacing: 2px;
    font-weight: 600;
    opacity: 0.75;
    margin-top: 2px;
}

/* ====== 切换标签 ====== */
.tab-bar {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.5);
    padding: 5px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.6);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}
.tab {
    flex: 1; text-align: center;
    padding: 0.65rem 0;
    border-radius: 40px;
    font-weight: 600; font-size: 1rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition);
    border: none; background: transparent;
    position: relative;
    z-index: 1;
}
.tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(79,158,255,0.4);
}
.tab:not(.active):hover { color: var(--primary); }

/* ====== 表单 ====== */
.forms-container { position: relative; z-index: 1; }
.form { display: none; flex-direction: column; gap: 0.7rem; }
.form.active { display: flex; }

/* 双列并排 */
.form-row { display: flex; gap: 0.6rem; }
.form-row .input-group { flex: 1; min-width: 0; }

.input-group { display: flex; flex-direction: column; gap: 4px; }
.input-group label {
    color: var(--primary-dark);
    font-size: 0.82rem; font-weight: 600;
    margin-left: 4px; letter-spacing: 0.3px;
}

.input-field {
    background: rgba(255,255,255,0.85);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 0.65rem 1rem;
    font-size: 0.95rem; font-family: var(--font);
    color: var(--text); outline: none;
    transition: all var(--transition);
    width: 100%;
    box-shadow: var(--shadow-sm);
}
.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79,158,255,0.12), var(--shadow-sm);
    background: white;
}
.input-field::placeholder { color: var(--text-muted); }

/* ====== 验证码 ====== */
.captcha-row {
    display: flex; gap: 0.5rem; align-items: center;
}
.captcha-row .input-field { flex: 1; min-width: 0; }
.captcha-canvas {
    background: linear-gradient(135deg, #e8f2ff, #dceaff);
    border-radius: 10px;
    border: 2px solid var(--primary);
    width: 100px; height: 41px;
    cursor: pointer;
    box-shadow: 0 3px 0 var(--primary-dark), 0 4px 12px rgba(79,158,255,0.2);
    transition: transform 0.15s;
    flex-shrink: 0;
}
.captcha-canvas:active { transform: scale(0.96); }

.refresh-btn {
    background: white;
    border: 2px solid var(--primary);
    border-radius: 50px;
    padding: 0.35rem 0.9rem;
    color: var(--primary-dark);
    font-size: 0.78rem; font-weight: 600; font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap; flex-shrink: 0;
    box-shadow: 0 3px 0 var(--primary-dark);
}
.refresh-btn:hover {
    background: #e8f2ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--primary-dark), 0 6px 14px rgba(79,158,255,0.25);
}
.refresh-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 0 var(--primary-dark);
}
.refresh-btn:disabled {
    opacity: 0.45; background: #eee;
    border-color: #ccc; color: #999;
    box-shadow: 0 3px 0 #bbb;
    cursor: not-allowed; transform: none;
}

/* ====== 主按钮 ====== */
.action-btn {
    background: linear-gradient(135deg, var(--primary), #3d7ce8);
    border: none;
    padding: 0.7rem;
    border-radius: 50px;
    font-size: 1rem; font-weight: 700; font-family: var(--font);
    color: white; cursor: pointer;
    box-shadow: 0 5px 0 #1a4faf, 0 6px 16px rgba(79,158,255,0.3);
    transition: all 0.15s ease;
    margin-top: 0.2rem;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}
.action-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}
.action-btn:hover::after { left: 100%; }
.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #1a4faf, 0 12px 28px rgba(79,158,255,0.4);
}
.action-btn:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #1a4faf, 0 4px 10px rgba(79,158,255,0.3);
}
.action-btn:disabled {
    opacity: 0.5; cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 0 #7a8faf;
}

/* ====== 消息框 ====== */
.message-box {
    display: none;
    background: rgba(255,255,255,0.8);
    border-radius: var(--radius);
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    border-left: 4px solid var(--primary);
    color: var(--primary-dark);
    backdrop-filter: blur(5px);
    font-weight: 500;
    align-items: center; gap: 6px;
}
.message-box.error {
    border-left-color: var(--accent);
    color: #c0395b; background: rgba(255,230,240,0.8);
}
.message-box.success {
    border-left-color: #4cd964;
    color: #1f7a3b; background: rgba(230,255,240,0.8);
}

/* ====== 分割线 ====== */
hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 0.8rem 0;
}

.demo-hint {
    font-size: 0.78rem;
    color: var(--text-light);
    text-align: center;
    font-weight: 500;
    opacity: 0.75;
}

/* ====== 忘记密码链接 ====== */
#forgotLink {
    color: var(--primary) !important;
    font-size: 0.85rem !important;
    text-decoration: none !important;
    font-weight: 600;
    transition: color var(--transition);
}
#forgotLink:hover { color: var(--primary-dark) !important; text-decoration: underline !important; }

/* ====== 弹窗 ====== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: white;
    border-radius: var(--radius-lg);
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0,0,0,0.25);
    animation: modalIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #eef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { color: var(--primary-dark); font-size: 1.15rem; }
.modal-close {
    background: none; border: none;
    font-size: 26px; cursor: pointer;
    color: #bbb; line-height: 1;
    transition: color var(--transition);
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: #333; background: #f5f5f5; }
.modal-body { padding: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block; margin-bottom: 4px;
    font-weight: 600; color: var(--primary-dark);
    font-size: 0.85rem;
}

/* ====== 响应式 ====== */
@media (max-width: 480px) {
    body { padding: 1rem; align-items: flex-start; padding-top: 2rem; }
    .auth-card { padding: 1.8rem 1.2rem 1.5rem; border-radius: 36px 36px 28px 28px; }
    .logo-image { width: 70px; }
    .logo-text .site-name { font-size: 1.8rem; }
    .input-field { padding: 0.7rem 0.9rem; font-size: 0.9rem; }
    .action-btn { font-size: 1rem; padding: 0.75rem; }
}

/* ====== 滚动条美化 ====== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ====== 密码要求浮动提示 ====== */
.pwd-hint {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: white;
    border: 1.5px solid var(--primary);
    border-radius: var(--radius);
    padding: 0.7rem 1rem;
    font-size: 0.82rem;
    box-shadow: 0 8px 24px rgba(43,110,176,0.18);
    z-index: 10;
    display: none;
    animation: hintIn 0.2s ease;
}
@keyframes hintIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.pwd-hint.show { display: block; }
.pwd-hint .hint-title {
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
}
.pwd-hint .hint-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    color: #999;
    transition: color 0.2s;
}
.pwd-hint .hint-item .check-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.pwd-hint .hint-item.met { color: #1f7a3b; }
.pwd-hint .hint-item.met .check-icon {
    border-color: #4cd964;
    background: #e8f8ec;
    color: #4cd964;
}
.pwd-group { position: relative; }

::selection { background: rgba(79,158,255,0.2); color: var(--primary-dark); }
