/* ========== 用户认证样式 ========== */

/* 头部用户入口 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.header-login-btn {
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.header-login-btn:hover {
    background: var(--primary);
    color: #fff;
}

.header-register-btn {
    padding: 8px 18px;
    border-radius: 20px;
    border: none;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.header-register-btn:hover {
    opacity: 0.85;
}

.header-user-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 12px 4px 4px;
    border-radius: 20px;
    transition: background 0.15s;
    position: relative;
}

.header-user-entry:hover {
    background: var(--bg-secondary);
}

.header-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.header-user-name {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
}

.header-user-points {
    font-size: 11px;
    color: var(--primary);
    white-space: nowrap;
}

.header-user-dropdown {
    position: absolute;
    top: 42px;
    right: 0;
    background: var(--bg-elevated);
    border-radius: 10px;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 6px;
    min-width: 140px;
    z-index: 100;
    display: none;
}

.header-user-dropdown.show {
    display: block;
}

.header-user-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s;
}

.header-user-dropdown a:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.header-user-dropdown .dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

/* 弹窗遮罩 */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s;
}

/* 认证弹窗 */
.auth-modal {
    background: var(--bg-elevated);
    border-radius: 14px;
    width: 380px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
    animation: slideUp 0.25s;
}

.auth-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.auth-modal-header h2 {
    font-size: 18px;
    color: var(--text-primary);
}

.auth-modal-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.auth-modal-close:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.auth-modal-body {
    padding: 20px 24px 24px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-light);
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}

.auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 500;
}

.auth-form-group {
    margin-bottom: 14px;
}

.auth-form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.auth-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.auth-input:focus {
    outline: none;
    border-color: var(--primary);
}

.auth-input-row {
    display: flex;
    gap: 10px;
}

.auth-input-row .auth-input {
    flex: 1;
}

.auth-send-code {
    width: 100px;
    flex-shrink: 0;
    border: 1px solid var(--primary);
    border-radius: 8px;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
}

.auth-send-code:hover {
    background: var(--primary);
    color: #fff;
}

.auth-send-code:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.auth-submit {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 4px;
    transition: opacity 0.2s;
}

.auth-submit:hover {
    opacity: 0.9;
}

.auth-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-error {
    background: #fff0f0;
    color: #ff4757;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 12px;
    display: none;
}

.auth-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}

.auth-footer a {
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
}

.invite-code-field {
    display: none;
}

.invite-code-field.show {
    display: block;
}

/* 动画使用 variables.css 中定义的全局 keyframes，此处不再重复定义 */
/* fadeIn, slideUp 等动画已在 variables.css 中统一定义 */

@media (max-width: 768px) {
    .header-login-btn,
    .header-register-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    .header-user-name {
        display: none;
    }
    .auth-modal {
        max-width: 95vw;
        border-radius: 16px 16px 0 0;
        margin-top: auto;
    }
}
